4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Spell projection */
15 /* ToDo: Make this global */
16 /* 1/x chance of reducing stats (for elemental attacks) */
17 #define HURT_CHANCE 16
20 static int rakubadam_m;
21 static int rakubadam_p;
23 int project_length = 0;
26 * Get another mirror. for SEEKER
28 static void next_mirror( int* next_y , int* next_x , int cury, int curx)
30 int mirror_x[10],mirror_y[10]; /* 鏡はもっと少ない */
31 int mirror_num=0; /* 鏡の数 */
35 for( x=0 ; x < cur_wid ; x++ )
37 for( y=0 ; y < cur_hgt ; y++ )
39 if( is_mirror_grid(&cave[y][x])){
40 mirror_y[mirror_num]=y;
41 mirror_x[mirror_num]=x;
48 num=randint0(mirror_num);
49 *next_y=mirror_y[num];
50 *next_x=mirror_x[num];
53 *next_y=cury+randint0(5)-2;
54 *next_x=curx+randint0(5)-2;
59 * Get a legal "multi-hued" color for drawing "spells"
61 static byte mh_attr(int max)
63 switch (randint1(max))
65 case 1: return (TERM_RED);
66 case 2: return (TERM_GREEN);
67 case 3: return (TERM_BLUE);
68 case 4: return (TERM_YELLOW);
69 case 5: return (TERM_ORANGE);
70 case 6: return (TERM_VIOLET);
71 case 7: return (TERM_L_RED);
72 case 8: return (TERM_L_GREEN);
73 case 9: return (TERM_L_BLUE);
74 case 10: return (TERM_UMBER);
75 case 11: return (TERM_L_UMBER);
76 case 12: return (TERM_SLATE);
77 case 13: return (TERM_WHITE);
78 case 14: return (TERM_L_WHITE);
79 case 15: return (TERM_L_DARK);
87 * Return a color to use for the bolt/ball spells
89 static byte spell_color(int type)
91 /* Check if A.B.'s new graphics should be used (rr9) */
92 if (streq(ANGBAND_GRAF, "new") || streq(ANGBAND_GRAF, "ne2"))
97 case GF_PSY_SPEAR: return (0x06);
98 case GF_MISSILE: return (0x0F);
99 case GF_ACID: return (0x04);
100 case GF_ELEC: return (0x02);
101 case GF_FIRE: return (0x00);
102 case GF_COLD: return (0x01);
103 case GF_POIS: return (0x03);
104 case GF_HOLY_FIRE: return (0x00);
105 case GF_HELL_FIRE: return (0x00);
106 case GF_MANA: return (0x0E);
108 case GF_SEEKER: return (0x0E);
109 case GF_SUPER_RAY: return (0x0E);
111 case GF_ARROW: return (0x0F);
112 case GF_WATER: return (0x04);
113 case GF_NETHER: return (0x07);
114 case GF_CHAOS: return (mh_attr(15));
115 case GF_DISENCHANT: return (0x05);
116 case GF_NEXUS: return (0x0C);
117 case GF_CONFUSION: return (mh_attr(4));
118 case GF_SOUND: return (0x09);
119 case GF_SHARDS: return (0x08);
120 case GF_FORCE: return (0x09);
121 case GF_INERTIA: return (0x09);
122 case GF_GRAVITY: return (0x09);
123 case GF_TIME: return (0x09);
124 case GF_LITE_WEAK: return (0x06);
125 case GF_LITE: return (0x06);
126 case GF_DARK_WEAK: return (0x07);
127 case GF_DARK: return (0x07);
128 case GF_PLASMA: return (0x0B);
129 case GF_METEOR: return (0x00);
130 case GF_ICE: return (0x01);
131 case GF_ROCKET: return (0x0F);
132 case GF_DEATH_RAY: return (0x07);
133 case GF_NUKE: return (mh_attr(2));
134 case GF_DISINTEGRATE: return (0x05);
146 case GF_CAUSE_4: return (0x0E);
147 case GF_HAND_DOOM: return (0x07);
148 case GF_CAPTURE : return (0x0E);
149 case GF_IDENTIFY: return (0x01);
150 case GF_ATTACK: return (0x0F);
151 case GF_PHOTO : return (0x06);
154 /* Normal tiles or ASCII */
160 /* Lookup the default colors for this type */
161 cptr s = quark_str(gf_color[type]);
164 if (!s) return (TERM_WHITE);
166 /* Pick a random color */
167 c = s[randint0(strlen(s))];
169 /* Lookup this color */
170 a = my_strchr(color_char, c) - color_char;
172 /* Invalid color (note check for < 0 removed, gave a silly
173 * warning because bytes are always >= 0 -- RG) */
174 if (a > 15) return (TERM_WHITE);
180 /* Standard "color" */
186 * Find the attr/char pair to use for a spell effect
188 * It is moving (or has moved) from (x,y) to (nx,ny).
190 * If the distance is not "one", we (may) return "*".
192 u16b bolt_pict(int y, int x, int ny, int nx, int typ)
202 if ((ny == y) && (nx == x)) base = 0x30;
205 else if (nx == x) base = 0x40;
208 else if (ny == y) base = 0x50;
211 else if ((ny - y) == (x - nx)) base = 0x60;
214 else if ((ny - y) == (nx - x)) base = 0x70;
219 /* Basic spell color */
220 k = spell_color(typ);
222 /* Obtain attr/char */
223 a = misc_to_attr[base + k];
224 c = misc_to_char[base + k];
232 * Determine the path taken by a projection.
234 * The projection will always start from the grid (y1,x1), and will travel
235 * towards the grid (y2,x2), touching one grid per unit of distance along
236 * the major axis, and stopping when it enters the destination grid or a
237 * wall grid, or has travelled the maximum legal distance of "range".
239 * Note that "distance" in this function (as in the "update_view()" code)
240 * is defined as "MAX(dy,dx) + MIN(dy,dx)/2", which means that the player
241 * actually has an "octagon of projection" not a "circle of projection".
243 * The path grids are saved into the grid array pointed to by "gp", and
244 * there should be room for at least "range" grids in "gp". Note that
245 * due to the way in which distance is calculated, this function normally
246 * uses fewer than "range" grids for the projection path, so the result
247 * of this function should never be compared directly to "range". Note
248 * that the initial grid (y1,x1) is never saved into the grid array, not
249 * even if the initial grid is also the final grid. XXX XXX XXX
251 * The "flg" flags can be used to modify the behavior of this function.
253 * In particular, the "PROJECT_STOP" and "PROJECT_THRU" flags have the same
254 * semantics as they do for the "project" function, namely, that the path
255 * will stop as soon as it hits a monster, or that the path will continue
256 * through the destination grid, respectively.
258 * The "PROJECT_JUMP" flag, which for the "project()" function means to
259 * start at a special grid (which makes no sense in this function), means
260 * that the path should be "angled" slightly if needed to avoid any wall
261 * grids, allowing the player to "target" any grid which is in "view".
262 * This flag is non-trivial and has not yet been implemented, but could
263 * perhaps make use of the "vinfo" array (above). XXX XXX XXX
265 * This function returns the number of grids (if any) in the path. This
266 * function will return zero if and only if (y1,x1) and (y2,x2) are equal.
268 * This algorithm is similar to, but slightly different from, the one used
269 * by "update_view_los()", and very different from the one used by "los()".
271 sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg)
293 /* No path necessary (or allowed) */
294 if ((x1 == x2) && (y1 == y2)) return (0);
322 /* Number of "units" in one "half" grid */
325 /* Number of "units" in one "full" grid */
331 /* Let m = ((dx/dy) * full) = (dx * dx * 2) */
342 /* Advance (X) part 2 */
345 /* Advance (X) part 3 */
352 /* Create the projection path */
356 gp[n++] = GRID(y, x);
358 /* Hack -- Check maximum range */
359 if ((n + (k >> 1)) >= range) break;
361 /* Sometimes stop at destination grid */
362 if (!(flg & (PROJECT_THRU)))
364 if ((x == x2) && (y == y2)) break;
367 if (flg & (PROJECT_DISI))
369 if ((n > 0) && cave_stop_disintegration(y, x)) break;
371 else if (flg & (PROJECT_LOS))
373 if ((n > 0) && !cave_los_bold(y, x)) break;
375 else if (!(flg & (PROJECT_PATH)))
377 /* Always stop at non-initial wall grids */
378 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
381 /* Sometimes stop at non-initial monsters/players */
382 if (flg & (PROJECT_STOP))
385 (player_bold(y, x) || cave[y][x].m_idx != 0))
389 if (!in_bounds(y, x)) break;
394 /* Advance (X) part 1 */
397 /* Horizontal change */
400 /* Advance (X) part 2 */
403 /* Advance (X) part 3 */
419 /* Let m = ((dy/dx) * full) = (dy * dy * 2) */
428 /* Vertical change */
431 /* Advance (Y) part 2 */
434 /* Advance (Y) part 3 */
441 /* Create the projection path */
445 gp[n++] = GRID(y, x);
447 /* Hack -- Check maximum range */
448 if ((n + (k >> 1)) >= range) break;
450 /* Sometimes stop at destination grid */
451 if (!(flg & (PROJECT_THRU)))
453 if ((x == x2) && (y == y2)) break;
456 if (flg & (PROJECT_DISI))
458 if ((n > 0) && cave_stop_disintegration(y, x)) break;
460 else if (flg & (PROJECT_LOS))
462 if ((n > 0) && !cave_los_bold(y, x)) break;
464 else if (!(flg & (PROJECT_PATH)))
466 /* Always stop at non-initial wall grids */
467 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
470 /* Sometimes stop at non-initial monsters/players */
471 if (flg & (PROJECT_STOP))
474 (player_bold(y, x) || cave[y][x].m_idx != 0))
478 if (!in_bounds(y, x)) break;
483 /* Advance (Y) part 1 */
486 /* Vertical change */
489 /* Advance (Y) part 2 */
492 /* Advance (Y) part 3 */
512 /* Create the projection path */
516 gp[n++] = GRID(y, x);
518 /* Hack -- Check maximum range */
519 if ((n + (n >> 1)) >= range) break;
521 /* Sometimes stop at destination grid */
522 if (!(flg & (PROJECT_THRU)))
524 if ((x == x2) && (y == y2)) break;
527 if (flg & (PROJECT_DISI))
529 if ((n > 0) && cave_stop_disintegration(y, x)) break;
531 else if (flg & (PROJECT_LOS))
533 if ((n > 0) && !cave_los_bold(y, x)) break;
535 else if (!(flg & (PROJECT_PATH)))
537 /* Always stop at non-initial wall grids */
538 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
541 /* Sometimes stop at non-initial monsters/players */
542 if (flg & (PROJECT_STOP))
545 (player_bold(y, x) || cave[y][x].m_idx != 0))
549 if (!in_bounds(y, x)) break;
566 * Mega-Hack -- track "affected" monsters (see "project()" comments)
568 static int project_m_n;
569 static int project_m_x;
570 static int project_m_y;
571 /* Mega-Hack -- monsters target */
572 static s16b monster_target_x;
573 static s16b monster_target_y;
577 * We are called from "project()" to "damage" terrain features
579 * We are called both for "beam" effects and "ball" effects.
581 * The "r" parameter is the "distance from ground zero".
583 * Note that we determine if the player can "see" anything that happens
584 * by taking into account: blindness, line-of-sight, and illumination.
586 * We return "TRUE" if the effect of the projection is "obvious".
588 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
590 * XXX XXX XXX Perhaps we should affect doors?
592 static bool project_f(int who, int r, int y, int x, int dam, int typ)
594 cave_type *c_ptr = &cave[y][x];
595 feature_type *f_ptr = &f_info[c_ptr->feat];
597 bool obvious = FALSE;
598 bool known = player_has_los_bold(y, x);
604 /* Reduce damage by distance */
605 dam = (dam + r) / (r + 1);
608 if (have_flag(f_ptr->flags, FF_TREE))
616 message = _("枯れた", "was blasted."); break;
618 message = _("縮んだ", "shrank."); break;
620 message = _("溶けた", "melted."); break;
623 message = _("凍り、砕け散った", "was frozen and smashed."); break;
627 message = _("燃えた", "burns up!"); break;
639 message = _("粉砕された", "was crushed."); break;
641 message = NULL;break;
645 msg_format(_("木は%s。", "A tree %s"), message);
646 cave_set_feat(y, x, one_in_(3) ? feat_brake : feat_grass);
649 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
653 /* Analyze the type */
656 /* Ignore most effects */
691 /* Destroy Traps (and Locks) */
694 /* Reveal secret doors */
695 if (is_hidden_door(c_ptr))
700 /* Check line of sight */
708 if (is_trap(c_ptr->feat))
710 /* Check line of sight */
713 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
717 /* Destroy the trap */
718 cave_alter_feat(y, x, FF_DISARM);
721 /* Locked doors are unlocked */
722 if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
724 s16b old_feat = c_ptr->feat;
726 /* Unlock the door */
727 cave_alter_feat(y, x, FF_DISARM);
729 /* Check line of sound */
730 if (known && (old_feat != c_ptr->feat))
732 msg_print(_("カチッと音がした!", "Click!"));
737 /* Remove "unsafe" flag if player is not blind */
738 if (!p_ptr->blind && player_has_los_bold(y, x))
740 c_ptr->info &= ~(CAVE_UNSAFE);
751 /* Destroy Doors (and traps) */
754 /* Destroy all doors and traps */
755 if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
757 /* Check line of sight */
761 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
765 /* Destroy the feature */
766 cave_alter_feat(y, x, FF_TUNNEL);
769 /* Remove "unsafe" flag if player is not blind */
770 if (!p_ptr->blind && player_has_los_bold(y, x))
772 c_ptr->info &= ~(CAVE_UNSAFE);
783 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
785 if (have_flag(f_ptr->flags, FF_SPIKE))
787 s16b old_mimic = c_ptr->mimic;
788 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
790 cave_alter_feat(y, x, FF_SPIKE);
792 c_ptr->mimic = old_mimic;
800 /* Check line of sight */
801 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
804 msg_format(_("%sに何かがつっかえて開かなくなった。", "The %s seems stuck."), f_name + mimic_f_ptr->name);
811 /* Destroy walls (and doors) */
814 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
817 if (known && (c_ptr->info & (CAVE_MARK)))
819 msg_format(_("%sが溶けて泥になった!", "The %s turns into mud!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
823 /* Destroy the wall */
824 cave_alter_feat(y, x, FF_HURT_ROCK);
826 /* Update some things */
827 p_ptr->update |= (PU_FLOW);
836 /* Require a "naked" floor grid */
837 if (!cave_naked_bold(y, x)) break;
839 /* Not on the player */
840 if (player_bold(y, x)) break;
842 /* Create a closed door */
843 cave_set_feat(y, x, feat_door[DOOR_DOOR].closed);
846 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
863 /* Require a "naked" floor grid */
864 if (!cave_naked_bold(y, x)) break;
866 /* Not on the player */
867 if (player_bold(y, x)) break;
869 /* Create a closed door */
870 cave_set_feat(y, x, feat_tree);
873 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
881 /* Require a "naked" floor grid */
882 if (!cave_naked_bold(y, x)) break;
885 c_ptr->info |= CAVE_OBJECT;
886 c_ptr->mimic = feat_glyph;
899 /* Require a "naked" floor grid */
900 if (!cave_naked_bold(y, x)) break;
902 /* Not on the player */
903 if (player_bold(y, x)) break;
906 cave_set_feat(y, x, feat_granite);
914 /* Ignore permanent grid */
915 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
920 /* Ignore grid without enough space */
921 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
923 /* Place a shallow lava */
924 cave_set_feat(y, x, feat_shallow_lava);
929 /* Place a deep lava */
930 cave_set_feat(y, x, feat_deep_lava);
937 /* Ignore permanent grid */
938 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
943 /* Ignore grid without enough space */
944 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
946 /* Place a shallow water */
947 cave_set_feat(y, x, feat_shallow_water);
952 /* Place a deep water */
953 cave_set_feat(y, x, feat_deep_water);
958 /* Lite up the grid */
962 /* Turn on the light */
963 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
965 c_ptr->info |= (CAVE_GLOW);
973 update_local_illumination(y, x);
976 if (player_can_see_bold(y, x)) obvious = TRUE;
978 /* Mega-Hack -- Update the monster in the affected grid */
979 /* This allows "spear of light" (etc) to work "correctly" */
980 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
982 if (p_ptr->special_defense & NINJA_S_STEALTH)
984 if (player_bold(y, x)) set_superstealth(FALSE);
991 /* Darken the grid */
995 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(c_ptr);
998 /* Turn off the light. */
1001 if (dun_level || !is_daytime())
1003 for (j = 0; j < 9; j++)
1005 int by = y + ddy_ddd[j];
1006 int bx = x + ddx_ddd[j];
1008 if (in_bounds2(by, bx))
1010 cave_type *cc_ptr = &cave[by][bx];
1012 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
1020 if (!do_dark) break;
1023 c_ptr->info &= ~(CAVE_GLOW);
1025 /* Hack -- Forget "boring" grids */
1026 if (!have_flag(f_ptr->flags, FF_REMEMBER))
1029 c_ptr->info &= ~(CAVE_MARK);
1038 update_local_illumination(y, x);
1041 if (player_can_see_bold(y, x)) obvious = TRUE;
1043 /* Mega-Hack -- Update the monster in the affected grid */
1044 /* This allows "spear of light" (etc) to work "correctly" */
1045 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1055 if (is_mirror_grid(c_ptr))
1057 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
1059 remove_mirror(y, x);
1060 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1063 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 50))
1066 if (known && (c_ptr->info & CAVE_MARK))
1068 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
1072 /* Destroy the wall */
1073 cave_alter_feat(y, x, FF_HURT_ROCK);
1075 /* Update some things */
1076 p_ptr->update |= (PU_FLOW);
1083 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
1085 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
1087 remove_mirror(y, x);
1088 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1091 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 200))
1094 if (known && (c_ptr->info & CAVE_MARK))
1096 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
1100 /* Destroy the wall */
1101 cave_alter_feat(y, x, FF_HURT_ROCK);
1103 /* Update some things */
1104 p_ptr->update |= (PU_FLOW);
1109 case GF_DISINTEGRATE:
1111 /* Destroy mirror/glyph */
1112 if (is_mirror_grid(c_ptr) || is_glyph_grid(c_ptr) || is_explosive_rune_grid(c_ptr))
1113 remove_mirror(y, x);
1115 /* Permanent features don't get effect */
1116 /* But not protect monsters and other objects */
1117 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
1119 cave_alter_feat(y, x, FF_HURT_DISI);
1121 /* Update some things -- similar to GF_KILL_WALL */
1122 p_ptr->update |= (PU_FLOW);
1129 /* Return "Anything seen?" */
1136 * We are called from "project()" to "damage" objects
1138 * We are called both for "beam" effects and "ball" effects.
1140 * Perhaps we should only SOMETIMES damage things on the ground.
1142 * The "r" parameter is the "distance from ground zero".
1144 * Note that we determine if the player can "see" anything that happens
1145 * by taking into account: blindness, line-of-sight, and illumination.
1147 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1149 * We return "TRUE" if the effect of the projection is "obvious".
1151 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1153 cave_type *c_ptr = &cave[y][x];
1155 s16b this_o_idx, next_o_idx = 0;
1157 bool obvious = FALSE;
1158 bool known = player_has_los_bold(y, x);
1160 u32b flgs[TR_FLAG_SIZE];
1162 char o_name[MAX_NLEN];
1165 bool is_potion = FALSE;
1169 who = who ? who : 0;
1171 /* Reduce damage by distance */
1172 dam = (dam + r) / (r + 1);
1175 /* Scan all objects in the grid */
1176 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1178 /* Acquire object */
1179 object_type *o_ptr = &o_list[this_o_idx];
1181 bool is_art = FALSE;
1182 bool ignore = FALSE;
1183 bool do_kill = FALSE;
1185 cptr note_kill = NULL;
1188 /* Get the "plural"-ness */
1189 bool plural = (o_ptr->number > 1);
1192 /* Acquire next object */
1193 next_o_idx = o_ptr->next_o_idx;
1195 /* Extract the flags */
1196 object_flags(o_ptr, flgs);
1198 /* Check for artifact */
1199 if (object_is_artifact(o_ptr)) is_art = TRUE;
1201 /* Analyze the type */
1204 /* Acid -- Lots of things */
1207 if (hates_acid(o_ptr))
1210 note_kill = _("融けてしまった!", (plural ? " melt!" : " melts!"));
1211 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1216 /* Elec -- Rings and Wands */
1219 if (hates_elec(o_ptr))
1222 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1223 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1228 /* Fire -- Flammable objects */
1231 if (hates_fire(o_ptr))
1234 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1235 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1240 /* Cold -- potions and flasks */
1243 if (hates_cold(o_ptr))
1245 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1247 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1255 if (hates_fire(o_ptr))
1258 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1259 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1261 if (hates_elec(o_ptr))
1265 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1266 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1274 if (hates_fire(o_ptr))
1277 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1278 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1280 if (hates_cold(o_ptr))
1284 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1285 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1290 /* Hack -- break potions and such */
1296 if (hates_cold(o_ptr))
1298 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1304 /* Mana and Chaos -- destroy everything */
1310 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1314 case GF_DISINTEGRATE:
1317 note_kill = _("蒸発してしまった!", (plural ? " evaporate!" : " evaporates!"));
1324 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1325 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1326 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1330 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1334 if (object_is_cursed(o_ptr))
1337 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1344 identify_item(o_ptr);
1346 /* Auto-inscription */
1347 autopick_alter_item((-this_o_idx), FALSE);
1355 /* Chests are noticed only if trapped or locked */
1356 if (o_ptr->tval == TV_CHEST)
1358 /* Disarm/Unlock traps */
1359 if (o_ptr->pval > 0)
1361 /* Disarm or Unlock */
1362 o_ptr->pval = (0 - o_ptr->pval);
1365 object_known(o_ptr);
1368 if (known && (o_ptr->marked & OM_FOUND))
1370 msg_print(_("カチッと音がした!", "Click!"));
1380 if (o_ptr->tval == TV_CORPSE)
1385 if (!who || is_pet(&m_list[who]))
1386 mode |= PM_FORCE_PET;
1388 for (i = 0; i < o_ptr->number ; i++)
1390 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1391 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1395 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
1399 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1401 note_kill = _("生き返った。", " revived.");
1403 else if (!note_kill)
1405 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
1416 /* Attempt to destroy the object */
1419 /* Effect "observed" */
1420 if (known && (o_ptr->marked & OM_FOUND))
1423 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1426 /* Artifacts, and other objects, get to resist */
1427 if (is_art || ignore)
1429 /* Observe the resist */
1430 if (known && (o_ptr->marked & OM_FOUND))
1432 msg_format(_("%sは影響を受けない!",
1433 (plural ? "The %s are unaffected!" : "The %s is unaffected!")), o_name);
1440 /* Describe if needed */
1441 if (known && (o_ptr->marked & OM_FOUND) && note_kill)
1443 msg_format(_("%sは%s", "The %s%s"), o_name, note_kill);
1446 k_idx = o_ptr->k_idx;
1447 is_potion = object_is_potion(o_ptr);
1450 /* Delete the object */
1451 delete_object_idx(this_o_idx);
1453 /* Potions produce effects when 'shattered' */
1456 (void)potion_smash_effect(who, y, x, k_idx);
1465 /* Return "Anything seen?" */
1471 * Helper function for "project()" below.
1473 * Handle a beam/bolt/ball causing damage to a monster.
1475 * This routine takes a "source monster" (by index) which is mostly used to
1476 * determine if the player is causing the damage, and a "radius" (see below),
1477 * which is used to decrease the power of explosions with distance, and a
1478 * location, via integers which are modified by certain types of attacks
1479 * (polymorph and teleport being the obvious ones), a default damage, which
1480 * is modified as needed based on various properties, and finally a "damage
1481 * type" (see below).
1483 * Note that this routine can handle "no damage" attacks (like teleport) by
1484 * taking a "zero" damage, and can even take "parameters" to attacks (like
1485 * confuse) by accepting a "damage", using it to calculate the effect, and
1486 * then setting the damage to zero. Note that the "damage" parameter is
1487 * divided by the radius, so monsters not at the "epicenter" will not take
1488 * as much damage (or whatever)...
1490 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1491 * may result in a dereference of an invalid pointer. XXX XXX XXX
1493 * Various messages are produced, and damage is applied.
1495 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1496 * actually be "made" of that substance, or "breathe" big balls of it.
1498 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1501 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1502 * and hurts evil less. If can breath nether, then it resists it as well.
1504 * Damage reductions use the following formulas:
1505 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1506 * gives avg damage of .655, ranging from .858 to .500
1507 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1508 * gives avg damage of .544, ranging from .714 to .417
1509 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1510 * gives avg damage of .444, ranging from .556 to .333
1511 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1512 * gives avg damage of .327, ranging from .427 to .250
1513 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1514 * gives something simple.
1516 * In this function, "result" messages are postponed until the end, where
1517 * the "note" string is appended to the monster name, if not NULL. So,
1518 * to make a spell have "no effect" just set "note" to NULL. You should
1519 * also set "notice" to FALSE, or the player will learn what the spell does.
1521 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1523 /* "flg" was added. */
1524 static bool project_m(int who, int r, int y, int x, int dam, int typ, int flg, bool see_s_msg)
1528 cave_type *c_ptr = &cave[y][x];
1530 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1531 monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
1533 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1537 /* Is the monster "seen"? */
1538 bool seen = m_ptr->ml;
1539 bool seen_msg = is_seen(m_ptr);
1541 bool slept = (bool)MON_CSLEEP(m_ptr);
1543 /* Were the effects "obvious" (if seen)? */
1544 bool obvious = FALSE;
1546 /* Can the player know about this effect? */
1547 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1549 /* Were the effects "irrelevant"? */
1550 bool skipped = FALSE;
1552 /* Gets the monster angry at the source of the effect? */
1553 bool get_angry = FALSE;
1555 /* Polymorph setting (true or false) */
1556 bool do_poly = FALSE;
1558 /* Teleport setting (max distance) */
1561 /* Confusion setting (amount to confuse) */
1564 /* Stunning setting (amount to stun) */
1567 /* Sleep amount (amount to sleep) */
1570 /* Fear amount (amount to fear) */
1573 /* Time amount (amount to time) */
1576 bool heal_leper = FALSE;
1578 /* Hold the monster name */
1584 /* Assume no note */
1587 /* Assume a default death */
1588 cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
1593 int caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1596 if (!c_ptr->m_idx) return (FALSE);
1598 /* Never affect projector */
1599 if (who && (c_ptr->m_idx == who)) return (FALSE);
1600 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1601 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1603 /* Don't affect already death monsters */
1604 /* Prevents problems with chain reactions of exploding monsters */
1605 if (m_ptr->hp < 0) return (FALSE);
1607 /* Reduce damage by distance */
1608 dam = (dam + r) / (r + 1);
1611 /* Get the monster name (BEFORE polymorphing) */
1612 monster_desc(m_name, m_ptr, 0);
1614 /* Get the monster possessive ("his"/"her"/"its") */
1615 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1617 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 1);
1619 /* Analyze the damage type */
1622 /* Magic Missile -- pure damage */
1625 if (seen) obvious = TRUE;
1627 if (r_ptr->flagsr & RFR_RES_ALL)
1629 note = _("には完全な耐性がある!", " is immune.");
1631 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1640 if (seen) obvious = TRUE;
1642 if (r_ptr->flagsr & RFR_RES_ALL)
1644 note = _("には完全な耐性がある!", " is immune.");
1646 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1649 if (r_ptr->flagsr & RFR_IM_ACID)
1651 note = _("にはかなり耐性がある!", " resists a lot.");
1653 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1661 if (seen) obvious = TRUE;
1663 if (r_ptr->flagsr & RFR_RES_ALL)
1665 note = _("には完全な耐性がある!", " is immune.");
1667 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1670 if (r_ptr->flagsr & RFR_IM_ELEC)
1672 note = _("にはかなり耐性がある!", " resists a lot.");
1674 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1682 if (seen) obvious = TRUE;
1684 if (r_ptr->flagsr & RFR_RES_ALL)
1686 note = _("には完全な耐性がある!", " is immune.");
1688 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1691 if (r_ptr->flagsr & RFR_IM_FIRE)
1693 note = _("にはかなり耐性がある!", " resists a lot.");
1695 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1697 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1699 note = _("はひどい痛手をうけた。", " is hit hard.");
1701 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1709 if (seen) obvious = TRUE;
1711 if (r_ptr->flagsr & RFR_RES_ALL)
1713 note = _("には完全な耐性がある!", " is immune.");
1715 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1718 if (r_ptr->flagsr & RFR_IM_COLD)
1720 note = _("にはかなり耐性がある!", " resists a lot.");
1722 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1724 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1726 note = _("はひどい痛手をうけた。", " is hit hard.");
1728 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1736 if (seen) obvious = TRUE;
1738 if (r_ptr->flagsr & RFR_RES_ALL)
1740 note = _("には完全な耐性がある!", " is immune.");
1742 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1745 if (r_ptr->flagsr & RFR_IM_POIS)
1747 note = _("にはかなり耐性がある!", " resists a lot.");
1749 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1757 if (seen) obvious = TRUE;
1759 if (r_ptr->flagsr & RFR_RES_ALL)
1761 note = _("には完全な耐性がある!", " is immune.");
1763 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1766 if (r_ptr->flagsr & RFR_IM_POIS)
1768 note = _("には耐性がある。", " resists.");
1769 dam *= 3; dam /= randint1(6) + 6;
1770 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1772 else if (one_in_(3)) do_poly = TRUE;
1776 /* Hellfire -- hurts Evil */
1779 if (seen) obvious = TRUE;
1781 if (r_ptr->flagsr & RFR_RES_ALL)
1783 note = _("には完全な耐性がある!", " is immune.");
1785 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1788 if (r_ptr->flags3 & RF3_GOOD)
1790 note = _("はひどい痛手をうけた。", " is hit hard.");
1792 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1797 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1800 if (seen) obvious = TRUE;
1802 if (r_ptr->flagsr & RFR_RES_ALL)
1804 note = _("には完全な耐性がある!", " is immune.");
1806 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1809 if (r_ptr->flags3 & RF3_GOOD)
1811 note = _("には完全な耐性がある!", " is immune.");
1813 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
1815 else if (r_ptr->flags3 & RF3_EVIL)
1818 note = _("はひどい痛手をうけた。", " is hit hard.");
1819 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
1823 note = _("には耐性がある。", " resists.");
1824 dam *= 3; dam /= randint1(6) + 6;
1829 /* Arrow -- XXX no defense */
1832 if (seen) obvious = TRUE;
1834 if (r_ptr->flagsr & RFR_RES_ALL)
1836 note = _("には完全な耐性がある!", " is immune.");
1838 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1844 /* Plasma -- XXX perhaps check ELEC or FIRE */
1847 if (seen) obvious = TRUE;
1849 if (r_ptr->flagsr & RFR_RES_ALL)
1851 note = _("には完全な耐性がある!", " is immune.");
1853 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1856 if (r_ptr->flagsr & RFR_RES_PLAS)
1858 note = _("には耐性がある。", " resists.");
1859 dam *= 3; dam /= randint1(6) + 6;
1860 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
1865 /* Nether -- see above */
1868 if (seen) obvious = TRUE;
1870 if (r_ptr->flagsr & RFR_RES_ALL)
1872 note = _("には完全な耐性がある!", " is immune.");
1874 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1877 if (r_ptr->flagsr & RFR_RES_NETH)
1879 if (r_ptr->flags3 & RF3_UNDEAD)
1881 note = _("には完全な耐性がある!", " is immune.");
1883 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
1887 note = _("には耐性がある。", " resists.");
1888 dam *= 3; dam /= randint1(6) + 6;
1890 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
1892 else if (r_ptr->flags3 & RF3_EVIL)
1894 note = _("はいくらか耐性を示した。", " resists somewhat.");
1896 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
1901 /* Water (acid) damage -- Water spirits/elementals are immune */
1904 if (seen) obvious = TRUE;
1906 if (r_ptr->flagsr & RFR_RES_ALL)
1908 note = _("には完全な耐性がある!", " is immune.");
1910 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1913 if (r_ptr->flagsr & RFR_RES_WATE)
1915 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
1917 note = _("には完全な耐性がある!", " is immune.");
1922 note = _("には耐性がある。", " resists.");
1923 dam *= 3; dam /= randint1(6) + 6;
1925 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
1930 /* Chaos -- Chaos breathers resist */
1933 if (seen) obvious = TRUE;
1935 if (r_ptr->flagsr & RFR_RES_ALL)
1937 note = _("には完全な耐性がある!", " is immune.");
1939 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1942 if (r_ptr->flagsr & RFR_RES_CHAO)
1944 note = _("には耐性がある。", " resists.");
1945 dam *= 3; dam /= randint1(6) + 6;
1946 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
1948 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
1950 note = _("はいくらか耐性を示した。", " resists somewhat.");
1951 dam *= 3; dam /= randint1(6) + 6;
1952 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
1957 do_conf = (5 + randint1(11) + r) / (r + 1);
1962 /* Shards -- Shard breathers resist */
1965 if (seen) obvious = TRUE;
1967 if (r_ptr->flagsr & RFR_RES_ALL)
1969 note = _("には完全な耐性がある!", " is immune.");
1971 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1974 if (r_ptr->flagsr & RFR_RES_SHAR)
1976 note = _("には耐性がある。", " resists.");
1977 dam *= 3; dam /= randint1(6) + 6;
1978 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1983 /* Rocket: Shard resistance helps */
1986 if (seen) obvious = TRUE;
1988 if (r_ptr->flagsr & RFR_RES_ALL)
1990 note = _("には完全な耐性がある!", " is immune.");
1992 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1995 if (r_ptr->flagsr & RFR_RES_SHAR)
1997 note = _("はいくらか耐性を示した。", " resists somewhat.");
1999 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2005 /* Sound -- Sound breathers resist */
2008 if (seen) obvious = TRUE;
2010 if (r_ptr->flagsr & RFR_RES_ALL)
2012 note = _("には完全な耐性がある!", " is immune.");
2014 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2017 if (r_ptr->flagsr & RFR_RES_SOUN)
2019 note = _("には耐性がある。", " resists.");
2020 dam *= 2; dam /= randint1(6) + 6;
2021 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
2023 else do_stun = (10 + randint1(15) + r) / (r + 1);
2030 if (seen) obvious = TRUE;
2032 if (r_ptr->flagsr & RFR_RES_ALL)
2034 note = _("には完全な耐性がある!", " is immune.");
2036 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2039 if (r_ptr->flags3 & RF3_NO_CONF)
2041 note = _("には耐性がある。", " resists.");
2042 dam *= 3; dam /= randint1(6) + 6;
2043 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2045 else do_conf = (10 + randint1(15) + r) / (r + 1);
2049 /* Disenchantment -- Breathers and Disenchanters resist */
2052 if (seen) obvious = TRUE;
2054 if (r_ptr->flagsr & RFR_RES_ALL)
2056 note = _("には完全な耐性がある!", " is immune.");
2058 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2061 if (r_ptr->flagsr & RFR_RES_DISE)
2063 note = _("には耐性がある。", " resists.");
2064 dam *= 3; dam /= randint1(6) + 6;
2065 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
2070 /* Nexus -- Breathers and Existers resist */
2073 if (seen) obvious = TRUE;
2075 if (r_ptr->flagsr & RFR_RES_ALL)
2077 note = _("には完全な耐性がある!", " is immune.");
2079 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2082 if (r_ptr->flagsr & RFR_RES_NEXU)
2084 note = _("には耐性がある。", " resists.");
2085 dam *= 3; dam /= randint1(6) + 6;
2086 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
2094 if (seen) obvious = TRUE;
2096 if (r_ptr->flagsr & RFR_RES_ALL)
2098 note = _("には完全な耐性がある!", " is immune.");
2100 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2103 if (r_ptr->flagsr & RFR_RES_WALL)
2105 note = _("には耐性がある。", " resists.");
2106 dam *= 3; dam /= randint1(6) + 6;
2107 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
2109 else do_stun = (randint1(15) + r) / (r + 1);
2113 /* Inertia -- breathers resist */
2116 if (seen) obvious = TRUE;
2118 if (r_ptr->flagsr & RFR_RES_ALL)
2120 note = _("には完全な耐性がある!", " is immune.");
2122 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2125 if (r_ptr->flagsr & RFR_RES_INER)
2127 note = _("には耐性がある。", " resists.");
2128 dam *= 3; dam /= randint1(6) + 6;
2129 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
2133 /* Powerful monsters can resist */
2134 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2135 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2139 /* Normal monsters slow down */
2142 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2144 note = _("の動きが遅くなった。", " starts moving slower.");
2151 /* Time -- breathers resist */
2154 if (seen) obvious = TRUE;
2156 if (r_ptr->flagsr & RFR_RES_ALL)
2158 note = _("には完全な耐性がある!", " is immune.");
2160 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2163 if (r_ptr->flagsr & RFR_RES_TIME)
2165 note = _("には耐性がある。", " resists.");
2166 dam *= 3; dam /= randint1(6) + 6;
2167 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
2169 else do_time = (dam + 1) / 2;
2173 /* Gravity -- breathers resist */
2176 bool resist_tele = FALSE;
2178 if (seen) obvious = TRUE;
2180 if (r_ptr->flagsr & RFR_RES_ALL)
2182 note = _("には完全な耐性がある!", " is immune.");
2184 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2187 if (r_ptr->flagsr & RFR_RES_TELE)
2189 if (r_ptr->flags1 & (RF1_UNIQUE))
2191 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2192 note = _("には効果がなかった。", " is unaffected!");
2195 else if (r_ptr->level > randint1(100))
2197 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2198 note = _("には耐性がある!", " resists!");
2203 if (!resist_tele) do_dist = 10;
2205 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2207 if (r_ptr->flagsr & RFR_RES_GRAV)
2209 note = _("には耐性がある!", " resists!");
2210 dam *= 3; dam /= randint1(6) + 6;
2212 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
2217 /* Powerful monsters can resist */
2218 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2219 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2223 /* Normal monsters slow down */
2226 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2228 note = _("の動きが遅くなった。", " starts moving slower.");
2233 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2235 /* Attempt a saving throw */
2236 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2237 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2241 /* No obvious effect */
2242 note = _("には効果がなかった。", " is unaffected!");
2254 if (seen) obvious = TRUE;
2256 if (r_ptr->flagsr & RFR_RES_ALL)
2258 note = _("には完全な耐性がある!", " is immune.");
2260 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2268 case GF_DISINTEGRATE:
2270 if (seen) obvious = TRUE;
2272 if (r_ptr->flagsr & RFR_RES_ALL)
2274 note = _("には完全な耐性がある!", " is immune.");
2276 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2279 if (r_ptr->flags3 & RF3_HURT_ROCK)
2281 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2282 note = _("の皮膚がただれた!", " loses some skin!");
2283 note_dies = _("は蒸発した!", " evaporates!");
2291 if (seen) obvious = TRUE;
2293 /* PSI only works if the monster can see you! -- RG */
2294 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2297 msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), m_name);
2302 if (r_ptr->flagsr & RFR_RES_ALL)
2304 note = _("には完全な耐性がある!", " is immune.");
2306 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2309 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2312 note = _("には完全な耐性がある!", " is immune.");
2313 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2316 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2317 (r_ptr->flags3 & RF3_ANIMAL) ||
2318 (r_ptr->level > randint1(3 * dam)))
2320 note = _("には耐性がある!", " resists!");
2324 * Powerful demons & undead can turn a mindcrafter's
2325 * attacks back on them
2327 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2328 (r_ptr->level > p_ptr->lev / 2) &&
2332 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2333 (seen ? "%^s's corrupted mind backlashes your attack!" :
2334 "%^ss corrupted mind backlashes your attack!")), m_name);
2337 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
2339 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
2343 /* Injure +/- confusion */
2344 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2345 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2346 if (one_in_(4) && !CHECK_MULTISHADOW())
2348 switch (randint1(4))
2351 set_confused(p_ptr->confused + 3 + randint1(dam));
2354 set_stun(p_ptr->stun + randint1(dam));
2358 if (r_ptr->flags3 & RF3_NO_FEAR)
2359 note = _("には効果がなかった。", " is unaffected.");
2361 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2365 if (!p_ptr->free_act)
2366 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2375 if ((dam > 0) && one_in_(4))
2377 switch (randint1(4))
2380 do_conf = 3 + randint1(dam);
2383 do_stun = 3 + randint1(dam);
2386 do_fear = 3 + randint1(dam);
2389 note = _("は眠り込んでしまった!", " falls asleep!");
2390 do_sleep = 3 + randint1(dam);
2395 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
2401 if (seen) obvious = TRUE;
2403 if (r_ptr->flagsr & RFR_RES_ALL)
2405 note = _("には完全な耐性がある!", " is immune.");
2407 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2410 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2413 note = _("には完全な耐性がある!", " is immune.");
2415 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2416 (r_ptr->flags3 & RF3_ANIMAL) ||
2417 (r_ptr->level > randint1(3 * dam)))
2419 note = _("には耐性がある!", " resists!");
2423 * Powerful demons & undead can turn a mindcrafter's
2424 * attacks back on them
2426 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2427 (r_ptr->level > p_ptr->lev / 2) &&
2431 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2432 (seen ? "%^s's corrupted mind backlashes your attack!" :
2433 "%^ss corrupted mind backlashes your attack!")), m_name);
2435 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
2437 msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
2441 /* Injure + mana drain */
2442 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2443 if (!CHECK_MULTISHADOW())
2445 msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
2446 p_ptr->csp -= damroll(5, dam) / 2;
2447 if (p_ptr->csp < 0) p_ptr->csp = 0;
2448 p_ptr->redraw |= PR_MANA;
2449 p_ptr->window |= (PW_SPELL);
2451 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2458 int b = damroll(5, dam) / 4;
2459 cptr str = (p_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
2460 cptr msg = _("あなたは%sの苦痛を%sに変換した!",
2461 (seen ? "You convert %s's pain into %s!" :
2462 "You convert %ss pain into %s!"));
2463 msg_format(msg, m_name, str);
2465 b = MIN(p_ptr->msp, p_ptr->csp + b);
2467 p_ptr->redraw |= PR_MANA;
2468 p_ptr->window |= (PW_SPELL);
2470 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
2474 case GF_TELEKINESIS:
2476 if (seen) obvious = TRUE;
2478 if (r_ptr->flagsr & RFR_RES_ALL)
2480 note = _("には完全な耐性がある!", " is immune.");
2482 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2487 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2492 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2494 /* Attempt a saving throw */
2495 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2496 (r_ptr->level > 5 + randint1(dam)))
2500 /* No obvious effect */
2506 /* Psycho-spear -- powerful magic missile */
2509 if (seen) obvious = TRUE;
2511 if (r_ptr->flagsr & RFR_RES_ALL)
2513 note = _("には完全な耐性がある!", " is immune.");
2515 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2521 /* Meteor -- powerful magic missile */
2524 if (seen) obvious = TRUE;
2526 if (r_ptr->flagsr & RFR_RES_ALL)
2528 note = _("には完全な耐性がある!", " is immune.");
2530 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2538 if (!is_hostile(m_ptr)) break;
2540 if (seen) obvious = TRUE;
2542 if (r_ptr->flagsr & RFR_RES_ALL)
2544 note = _("には効果がなかった!", " is immune.");
2546 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2549 /* Attempt a saving throw */
2550 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
2551 (r_ptr->flags3 & RF3_NO_CONF) ||
2552 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2554 /* Memorize a flag */
2555 if (r_ptr->flags3 & RF3_NO_CONF)
2557 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2564 * Powerful demons & undead can turn a mindcrafter's
2565 * attacks back on them
2567 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2568 (r_ptr->level > p_ptr->lev / 2) &&
2572 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2573 (seen ? "%^s's corrupted mind backlashes your attack!" :
2574 "%^ss corrupted mind backlashes your attack!")), m_name);
2577 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2579 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
2583 /* Confuse, stun, terrify */
2584 switch (randint1(4))
2587 set_stun(p_ptr->stun + dam / 2);
2590 set_confused(p_ptr->confused + dam / 2);
2594 if (r_ptr->flags3 & RF3_NO_FEAR)
2595 note = _("には効果がなかった。", " is unaffected.");
2597 set_afraid(p_ptr->afraid + dam);
2604 /* No obvious effect */
2605 note = _("には効果がなかった。", " is unaffected.");
2611 if ((dam > 29) && (randint1(100) < dam))
2613 note = _("があなたに隷属した。", " is in your thrall!");
2618 switch (randint1(4))
2632 /* No "real" damage */
2639 /* Ice -- Cold + Cuts + Stun */
2642 if (seen) obvious = TRUE;
2644 if (r_ptr->flagsr & RFR_RES_ALL)
2646 note = _("には完全な耐性がある!", " is immune.");
2648 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2651 do_stun = (randint1(15) + 1) / (r + 1);
2652 if (r_ptr->flagsr & RFR_IM_COLD)
2654 note = _("にはかなり耐性がある!", " resists a lot.");
2656 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
2658 else if (r_ptr->flags3 & (RF3_HURT_COLD))
2660 note = _("はひどい痛手をうけた。", " is hit hard.");
2662 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
2671 if (seen) obvious = TRUE;
2673 if (r_ptr->flagsr & RFR_RES_ALL)
2675 note = _("には完全な耐性がある!", " is immune.");
2677 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2680 if (!monster_living(r_ptr))
2682 if (is_original_ap_and_seen(m_ptr))
2684 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2685 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2686 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2688 note = _("には効果がなかった。", " is unaffected.");
2692 else do_time = (dam+7)/8;
2700 if (seen) obvious = TRUE;
2702 if (r_ptr->flagsr & RFR_RES_ALL)
2704 note = _("には完全な耐性がある!", " is immune.");
2706 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2709 if (!monster_living(r_ptr))
2711 if (is_original_ap_and_seen(m_ptr))
2713 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2714 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2715 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2717 note = _("には完全な耐性がある!", " is immune.");
2721 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
2722 (randint1(888) != 666)) ||
2723 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
2724 randint1(100) != 66))
2726 note = _("には耐性がある!", " resists!");
2734 /* Polymorph monster (Use "dam" as "power") */
2737 if (seen) obvious = TRUE;
2739 if (r_ptr->flagsr & RFR_RES_ALL)
2741 note = _("には効果がなかった。", " is unaffected.");
2743 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2746 /* Attempt to polymorph (see below) */
2749 /* Powerful monsters can resist */
2750 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2751 (r_ptr->flags1 & RF1_QUESTOR) ||
2752 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2754 note = _("には効果がなかった。", " is unaffected.");
2759 /* No "real" damage */
2766 /* Clone monsters (Ignore "dam") */
2769 if (seen) obvious = TRUE;
2771 if ((p_ptr->inside_arena) || is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
2773 note = _("には効果がなかった。", " is unaffected.");
2778 m_ptr->hp = m_ptr->maxhp;
2780 /* Attempt to clone. */
2781 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
2783 note = _("が分裂した!", " spawns!");
2787 /* No "real" damage */
2794 /* Heal Monster (use "dam" as amount of healing) */
2797 if (seen) obvious = TRUE;
2800 (void)set_monster_csleep(c_ptr->m_idx, 0);
2802 if (m_ptr->maxhp < m_ptr->max_maxhp)
2804 if (seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), m_name, m_poss);
2805 m_ptr->maxhp = m_ptr->max_maxhp;
2810 /* Redraw (later) if needed */
2811 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2812 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2820 if (seen) obvious = TRUE;
2823 (void)set_monster_csleep(c_ptr->m_idx, 0);
2824 if (MON_STUNNED(m_ptr))
2826 if (seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), m_name);
2827 (void)set_monster_stunned(c_ptr->m_idx, 0);
2829 if (MON_CONFUSED(m_ptr))
2831 if (seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), m_name);
2832 (void)set_monster_confused(c_ptr->m_idx, 0);
2834 if (MON_MONFEAR(m_ptr))
2836 if (seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name);
2837 (void)set_monster_monfear(c_ptr->m_idx, 0);
2841 if (m_ptr->hp < 30000) m_ptr->hp += dam;
2844 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2848 chg_virtue(V_VITALITY, 1);
2850 if (r_ptr->flags1 & RF1_UNIQUE)
2851 chg_virtue(V_INDIVIDUALISM, 1);
2853 if (is_friendly(m_ptr))
2854 chg_virtue(V_HONOUR, 1);
2855 else if (!(r_ptr->flags3 & RF3_EVIL))
2857 if (r_ptr->flags3 & RF3_GOOD)
2858 chg_virtue(V_COMPASSION, 2);
2860 chg_virtue(V_COMPASSION, 1);
2863 if (r_ptr->flags3 & RF3_ANIMAL)
2864 chg_virtue(V_NATURE, 1);
2867 if (m_ptr->r_idx == MON_LEPER)
2870 if (!who) chg_virtue(V_COMPASSION, 5);
2873 /* Redraw (later) if needed */
2874 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2875 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2878 note = _("は体力を回復したようだ。", " looks healthier.");
2880 /* No "real" damage */
2886 /* Speed Monster (Ignore "dam") */
2889 if (seen) obvious = TRUE;
2892 if (set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100))
2894 note = _("の動きが速くなった。", " starts moving faster.");
2899 if (r_ptr->flags1 & RF1_UNIQUE)
2900 chg_virtue(V_INDIVIDUALISM, 1);
2901 if (is_friendly(m_ptr))
2902 chg_virtue(V_HONOUR, 1);
2905 /* No "real" damage */
2911 /* Slow Monster (Use "dam" as "power") */
2914 if (seen) obvious = TRUE;
2916 if (r_ptr->flagsr & RFR_RES_ALL)
2918 note = _("には効果がなかった。", " is unaffected.");
2920 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2923 /* Powerful monsters can resist */
2924 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2925 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2927 note = _("には効果がなかった。", " is unaffected.");
2931 /* Normal monsters slow down */
2934 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2936 note = _("の動きが遅くなった。", " starts moving slower.");
2940 /* No "real" damage */
2946 /* Sleep (Use "dam" as "power") */
2949 if (seen) obvious = TRUE;
2951 if (r_ptr->flagsr & RFR_RES_ALL)
2953 note = _("には効果がなかった。", " is unaffected.");
2955 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2958 /* Attempt a saving throw */
2959 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2960 (r_ptr->flags3 & RF3_NO_SLEEP) ||
2961 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2963 /* Memorize a flag */
2964 if (r_ptr->flags3 & RF3_NO_SLEEP)
2966 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
2968 /* No obvious effect */
2969 note = _("には効果がなかった。", " is unaffected.");
2974 /* Go to sleep (much) later */
2975 note = _("は眠り込んでしまった!", " falls asleep!");
2979 /* No "real" damage */
2985 /* Sleep (Use "dam" as "power") */
2986 case GF_STASIS_EVIL:
2988 if (seen) obvious = TRUE;
2990 if (r_ptr->flagsr & RFR_RES_ALL)
2992 note = _("には効果がなかった!", " is immune.");
2994 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2997 /* Attempt a saving throw */
2998 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2999 !(r_ptr->flags3 & RF3_EVIL) ||
3000 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3002 note = _("には効果がなかった。", " is unaffected.");
3007 /* Go to sleep (much) later */
3008 note = _("は動けなくなった!", " is suspended!");
3012 /* No "real" damage */
3017 /* Sleep (Use "dam" as "power") */
3020 if (seen) obvious = TRUE;
3022 if (r_ptr->flagsr & RFR_RES_ALL)
3024 note = _("には効果がなかった。", " is unaffected.");
3026 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3029 /* Attempt a saving throw */
3030 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3031 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3033 note = _("には効果がなかった。", " is unaffected.");
3038 /* Go to sleep (much) later */
3039 note = _("は動けなくなった!", " is suspended!");
3043 /* No "real" damage */
3052 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3053 vir = virtue_number(V_HARMONY);
3056 dam += p_ptr->virtues[vir-1]/10;
3059 vir = virtue_number(V_INDIVIDUALISM);
3062 dam -= p_ptr->virtues[vir-1]/20;
3065 if (seen) obvious = TRUE;
3067 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3069 note = _("には効果がなかった。", " is unaffected.");
3071 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3075 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3078 /* Attempt a saving throw */
3079 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3080 (r_ptr->flags3 & RF3_NO_CONF) ||
3081 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3082 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3084 /* Memorize a flag */
3085 if (r_ptr->flags3 & RF3_NO_CONF)
3087 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3091 /* No obvious effect */
3092 note = _("には効果がなかった。", " is unaffected.");
3095 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3097 else if (p_ptr->cursed & TRC_AGGRAVATE)
3099 note = _("はあなたに敵意を抱いている!", " hates you too much!");
3100 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3104 note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
3107 chg_virtue(V_INDIVIDUALISM, -1);
3108 if (r_ptr->flags3 & RF3_ANIMAL)
3109 chg_virtue(V_NATURE, 1);
3112 /* No "real" damage */
3117 /* Control undead */
3118 case GF_CONTROL_UNDEAD:
3121 if (seen) obvious = TRUE;
3123 vir = virtue_number(V_UNLIFE);
3126 dam += p_ptr->virtues[vir-1]/10;
3129 vir = virtue_number(V_INDIVIDUALISM);
3132 dam -= p_ptr->virtues[vir-1]/20;
3135 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3137 note = _("には効果がなかった。", " is unaffected.");
3139 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3143 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3146 /* Attempt a saving throw */
3147 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3148 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3149 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3150 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3152 /* No obvious effect */
3153 note = _("には効果がなかった。", " is unaffected.");
3155 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3157 else if (p_ptr->cursed & TRC_AGGRAVATE)
3159 note = _("はあなたに敵意を抱いている!", " hates you too much!");
3160 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3164 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
3168 /* No "real" damage */
3174 case GF_CONTROL_DEMON:
3177 if (seen) obvious = TRUE;
3179 vir = virtue_number(V_UNLIFE);
3182 dam += p_ptr->virtues[vir-1]/10;
3185 vir = virtue_number(V_INDIVIDUALISM);
3188 dam -= p_ptr->virtues[vir-1]/20;
3191 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3193 note = _("には効果がなかった。", " is unaffected.");
3195 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3199 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3202 /* Attempt a saving throw */
3203 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3204 (!(r_ptr->flags3 & RF3_DEMON)) ||
3205 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3206 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3208 /* No obvious effect */
3209 note = _("には効果がなかった。", " is unaffected.");
3212 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3214 else if (p_ptr->cursed & TRC_AGGRAVATE)
3216 note = _("はあなたに敵意を抱いている!", " hates you too much!");
3217 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3221 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
3225 /* No "real" damage */
3231 case GF_CONTROL_ANIMAL:
3235 if (seen) obvious = TRUE;
3237 vir = virtue_number(V_NATURE);
3240 dam += p_ptr->virtues[vir-1]/10;
3243 vir = virtue_number(V_INDIVIDUALISM);
3246 dam -= p_ptr->virtues[vir-1]/20;
3249 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3251 note = _("には効果がなかった。", " is unaffected.");
3253 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3257 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3260 /* Attempt a saving throw */
3261 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3262 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
3263 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3264 (r_ptr->flags3 & (RF3_NO_CONF)) ||
3265 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3267 /* Memorize a flag */
3268 if (r_ptr->flags3 & (RF3_NO_CONF))
3270 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3274 /* No obvious effect */
3275 note = _("には効果がなかった。", " is unaffected.");
3278 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3280 else if (p_ptr->cursed & TRC_AGGRAVATE)
3282 note = _("はあなたに敵意を抱いている!", " hates you too much!");
3283 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3287 note = _("はなついた。", " is tamed!");
3290 if (r_ptr->flags3 & RF3_ANIMAL)
3291 chg_virtue(V_NATURE, 1);
3294 /* No "real" damage */
3300 case GF_CONTROL_LIVING:
3304 vir = virtue_number(V_UNLIFE);
3305 if (seen) obvious = TRUE;
3307 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
3308 vir = virtue_number(V_UNLIFE);
3311 dam -= p_ptr->virtues[vir-1]/10;
3314 vir = virtue_number(V_INDIVIDUALISM);
3317 dam -= p_ptr->virtues[vir-1]/20;
3320 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
3321 if (dam < 1) dam = 1;
3322 msg_format(_("%sを見つめた。", "You stare into %s."), m_name);
3323 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3325 note = _("には効果がなかった。", " is unaffected.");
3327 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3331 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3334 /* Attempt a saving throw */
3335 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3336 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3337 !monster_living(r_ptr) ||
3338 ((r_ptr->level+10) > randint1(dam)))
3341 /* No obvious effect */
3342 note = _("には効果がなかった。", " is unaffected.");
3345 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3347 else if (p_ptr->cursed & TRC_AGGRAVATE)
3349 note = _("はあなたに敵意を抱いている!", " hates you too much!");
3350 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3354 note = _("を支配した。", " is tamed!");
3357 if (r_ptr->flags3 & RF3_ANIMAL)
3358 chg_virtue(V_NATURE, 1);
3361 /* No "real" damage */
3366 /* Confusion (Use "dam" as "power") */
3369 if (seen) obvious = TRUE;
3371 if (r_ptr->flagsr & RFR_RES_ALL)
3373 note = _("には効果がなかった。", " is unaffected.");
3375 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3378 /* Get confused later */
3379 do_conf = damroll(3, (dam / 2)) + 1;
3381 /* Attempt a saving throw */
3382 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3383 (r_ptr->flags3 & (RF3_NO_CONF)) ||
3384 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3386 /* Memorize a flag */
3387 if (r_ptr->flags3 & (RF3_NO_CONF))
3389 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3395 /* No obvious effect */
3396 note = _("には効果がなかった。", " is unaffected.");
3400 /* No "real" damage */
3407 if (seen) obvious = TRUE;
3409 if (r_ptr->flagsr & RFR_RES_ALL)
3411 note = _("には効果がなかった。", " is unaffected.");
3413 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3416 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
3418 /* Attempt a saving throw */
3419 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3420 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3425 /* No obvious effect */
3426 note = _("には効果がなかった。", " is unaffected.");
3430 /* No "real" damage */
3438 /* Lite, but only hurts susceptible creatures */
3446 if (r_ptr->flagsr & RFR_RES_ALL)
3452 if (r_ptr->flags3 & (RF3_HURT_LITE))
3454 /* Obvious effect */
3455 if (seen) obvious = TRUE;
3457 /* Memorize the effects */
3458 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3460 /* Special effect */
3461 note = _("は光に身をすくめた!", " cringes from the light!");
3462 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3465 /* Normally no damage */
3477 /* Lite -- opposite of Dark */
3480 if (seen) obvious = TRUE;
3482 if (r_ptr->flagsr & RFR_RES_ALL)
3484 note = _("には完全な耐性がある!", " is immune.");
3486 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3489 if (r_ptr->flagsr & RFR_RES_LITE)
3491 note = _("には耐性がある!", " resists!");
3492 dam *= 2; dam /= (randint1(6)+6);
3493 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
3495 else if (r_ptr->flags3 & (RF3_HURT_LITE))
3497 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3498 note = _("は光に身をすくめた!", " cringes from the light!");
3499 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3506 /* Dark -- opposite of Lite */
3509 if (seen) obvious = TRUE;
3511 if (r_ptr->flagsr & RFR_RES_ALL)
3513 note = _("には完全な耐性がある!", " is immune.");
3515 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3518 if (r_ptr->flagsr & RFR_RES_DARK)
3520 note = _("には耐性がある!", " resists!");
3521 dam *= 2; dam /= (randint1(6)+6);
3522 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
3531 if (r_ptr->flagsr & RFR_RES_ALL)
3536 /* Hurt by rock remover */
3537 if (r_ptr->flags3 & (RF3_HURT_ROCK))
3540 if (seen) obvious = TRUE;
3542 /* Memorize the effects */
3543 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
3545 /* Cute little message */
3546 note = _("の皮膚がただれた!", " loses some skin!");
3547 note_dies = _("はドロドロに溶けた!", " dissolves!");
3550 /* Usually, ignore the effects */
3561 /* Teleport undead (Use "dam" as "power") */
3562 case GF_AWAY_UNDEAD:
3564 /* Only affect undead */
3565 if (r_ptr->flags3 & (RF3_UNDEAD))
3567 bool resists_tele = FALSE;
3569 if (r_ptr->flagsr & RFR_RES_TELE)
3571 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3573 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3574 note = _("には効果がなかった。", " is unaffected.");
3575 resists_tele = TRUE;
3577 else if (r_ptr->level > randint1(100))
3579 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3580 note = _("には耐性がある!", " resists!");
3581 resists_tele = TRUE;
3587 if (seen) obvious = TRUE;
3588 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3600 /* No "real" damage */
3606 /* Teleport evil (Use "dam" as "power") */
3609 /* Only affect evil */
3610 if (r_ptr->flags3 & (RF3_EVIL))
3612 bool resists_tele = FALSE;
3614 if (r_ptr->flagsr & RFR_RES_TELE)
3616 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3618 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3619 note = _("には効果がなかった。", " is unaffected.");
3620 resists_tele = TRUE;
3622 else if (r_ptr->level > randint1(100))
3624 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3625 note = _("には耐性がある!", " resists!");
3626 resists_tele = TRUE;
3632 if (seen) obvious = TRUE;
3633 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3645 /* No "real" damage */
3651 /* Teleport monster (Use "dam" as "power") */
3654 bool resists_tele = FALSE;
3655 if (r_ptr->flagsr & RFR_RES_TELE)
3657 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3659 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3660 note = _("には効果がなかった。", " is unaffected.");
3661 resists_tele = TRUE;
3663 else if (r_ptr->level > randint1(100))
3665 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3666 note = _("には耐性がある!", " resists!");
3667 resists_tele = TRUE;
3674 if (seen) obvious = TRUE;
3676 /* Prepare to teleport */
3680 /* No "real" damage */
3686 /* Turn undead (Use "dam" as "power") */
3687 case GF_TURN_UNDEAD:
3689 if (r_ptr->flagsr & RFR_RES_ALL)
3694 /* Only affect undead */
3695 if (r_ptr->flags3 & (RF3_UNDEAD))
3698 if (seen) obvious = TRUE;
3700 /* Learn about type */
3701 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3703 /* Apply some fear */
3704 do_fear = damroll(3, (dam / 2)) + 1;
3706 /* Attempt a saving throw */
3707 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
3709 /* No obvious effect */
3710 note = _("には効果がなかった。", " is unaffected.");
3723 /* No "real" damage */
3729 /* Turn evil (Use "dam" as "power") */
3732 if (r_ptr->flagsr & RFR_RES_ALL)
3737 /* Only affect evil */
3738 if (r_ptr->flags3 & (RF3_EVIL))
3741 if (seen) obvious = TRUE;
3743 /* Learn about type */
3744 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3746 /* Apply some fear */
3747 do_fear = damroll(3, (dam / 2)) + 1;
3749 /* Attempt a saving throw */
3750 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
3752 /* No obvious effect */
3753 note = _("には効果がなかった。", " is unaffected.");
3766 /* No "real" damage */
3772 /* Turn monster (Use "dam" as "power") */
3775 if (r_ptr->flagsr & RFR_RES_ALL)
3781 if (seen) obvious = TRUE;
3783 /* Apply some fear */
3784 do_fear = damroll(3, (dam / 2)) + 1;
3786 /* Attempt a saving throw */
3787 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3788 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
3789 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3791 /* No obvious effect */
3792 note = _("には効果がなかった。", " is unaffected.");
3797 /* No "real" damage */
3804 case GF_DISP_UNDEAD:
3806 if (r_ptr->flagsr & RFR_RES_ALL)
3812 /* Only affect undead */
3813 if (r_ptr->flags3 & (RF3_UNDEAD))
3816 if (seen) obvious = TRUE;
3818 /* Learn about type */
3819 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3822 note = _("は身震いした。", " shudders.");
3823 note_dies = _("はドロドロに溶けた!", " dissolves!");
3843 if (r_ptr->flagsr & RFR_RES_ALL)
3849 /* Only affect evil */
3850 if (r_ptr->flags3 & (RF3_EVIL))
3853 if (seen) obvious = TRUE;
3855 /* Learn about type */
3856 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3859 note = _("は身震いした。", " shudders.");
3860 note_dies = _("はドロドロに溶けた!", " dissolves!");
3879 if (r_ptr->flagsr & RFR_RES_ALL)
3885 /* Only affect good */
3886 if (r_ptr->flags3 & (RF3_GOOD))
3889 if (seen) obvious = TRUE;
3891 /* Learn about type */
3892 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
3895 note = _("は身震いした。", " shudders.");
3896 note_dies = _("はドロドロに溶けた!", " dissolves!");
3913 case GF_DISP_LIVING:
3915 if (r_ptr->flagsr & RFR_RES_ALL)
3921 /* Only affect non-undead */
3922 if (monster_living(r_ptr))
3925 if (seen) obvious = TRUE;
3928 note = _("は身震いした。", " shudders.");
3929 note_dies = _("はドロドロに溶けた!", " dissolves!");
3948 if (r_ptr->flagsr & RFR_RES_ALL)
3954 /* Only affect demons */
3955 if (r_ptr->flags3 & (RF3_DEMON))
3958 if (seen) obvious = TRUE;
3960 /* Learn about type */
3961 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
3964 note = _("は身震いした。", " shudders.");
3965 note_dies = _("はドロドロに溶けた!", " dissolves!");
3981 /* Dispel monster */
3984 if (r_ptr->flagsr & RFR_RES_ALL)
3991 if (seen) obvious = TRUE;
3994 note = _("は身震いした。", " shudders.");
3995 note_dies = _("はドロドロに溶けた!", " dissolves!");
4002 if (seen) obvious = TRUE;
4004 if (r_ptr->flagsr & RFR_RES_ALL)
4006 note = _("には完全な耐性がある!", " is immune.");
4008 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4012 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4016 /* Heal the monster */
4017 if (caster_ptr->hp < caster_ptr->maxhp)
4020 caster_ptr->hp += dam;
4021 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
4023 /* Redraw (later) if needed */
4024 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4025 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4027 /* Special message */
4030 /* Get the monster name */
4031 monster_desc(killer, caster_ptr, 0);
4032 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), killer);
4039 msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), m_name);
4040 (void)hp_player(dam);
4045 if (see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
4054 if (seen) obvious = TRUE;
4056 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
4058 if (r_ptr->flagsr & RFR_RES_ALL)
4060 note = _("には完全な耐性がある!", " is immune.");
4062 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4066 /* Attempt a saving throw */
4067 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4068 (r_ptr->flags3 & RF3_NO_CONF) ||
4069 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
4071 /* Memorize a flag */
4072 if (r_ptr->flags3 & (RF3_NO_CONF))
4074 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4076 note = _("には効果がなかった。", " is unaffected.");
4079 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
4081 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
4082 note = _("には完全な耐性がある!", " is immune.");
4085 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
4087 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
4088 note = _("には耐性がある。", " resists.");
4093 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
4094 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
4096 if (who > 0) do_conf = randint0(4) + 4;
4097 else do_conf = randint0(8) + 8;
4103 case GF_BRAIN_SMASH:
4105 if (seen) obvious = TRUE;
4107 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
4109 if (r_ptr->flagsr & RFR_RES_ALL)
4111 note = _("には完全な耐性がある!", " is immune.");
4113 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4117 /* Attempt a saving throw */
4118 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4119 (r_ptr->flags3 & RF3_NO_CONF) ||
4120 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
4122 /* Memorize a flag */
4123 if (r_ptr->flags3 & (RF3_NO_CONF))
4125 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4127 note = _("には効果がなかった。", " is unaffected.");
4130 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
4132 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
4133 note = _("には完全な耐性がある!", " is immune.");
4136 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
4138 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
4139 note = _("には耐性がある!", " resists!");
4144 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
4145 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
4149 do_conf = randint0(4) + 4;
4150 do_stun = randint0(4) + 4;
4154 do_conf = randint0(8) + 8;
4155 do_stun = randint0(8) + 8;
4157 (void)set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 10);
4165 if (seen) obvious = TRUE;
4167 if (!who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), m_name);
4169 if (r_ptr->flagsr & RFR_RES_ALL)
4171 note = _("には完全な耐性がある!", " is immune.");
4173 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4177 /* Attempt a saving throw */
4178 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
4180 note = _("には効果がなかった。", " is unaffected.");
4189 if (seen) obvious = TRUE;
4191 if (!who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), m_name);
4193 if (r_ptr->flagsr & RFR_RES_ALL)
4195 note = _("には完全な耐性がある!", " is immune.");
4197 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4201 /* Attempt a saving throw */
4202 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
4204 note = _("には効果がなかった。", " is unaffected.");
4213 if (seen) obvious = TRUE;
4215 if (!who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), m_name);
4217 if (r_ptr->flagsr & RFR_RES_ALL)
4219 note = _("には完全な耐性がある!", " is immune.");
4221 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4225 /* Attempt a saving throw */
4226 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
4228 note = _("には効果がなかった。", " is unaffected.");
4237 if (seen) obvious = TRUE;
4240 msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
4241 "You point at %s, screaming the word, 'DIE!'."), m_name);
4243 if (r_ptr->flagsr & RFR_RES_ALL)
4245 note = _("には完全な耐性がある!", " is immune.");
4247 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4251 /* Attempt a saving throw */
4252 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
4254 note = _("には効果がなかった。", " is unaffected.");
4263 if (seen) obvious = TRUE;
4265 if (r_ptr->flagsr & RFR_RES_ALL)
4267 note = _("には完全な耐性がある!", " is immune.");
4269 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4273 if (r_ptr->flags1 & RF1_UNIQUE)
4275 note = _("には効果がなかった。", " is unaffected.");
4280 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
4281 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
4283 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
4285 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
4289 note = _("は耐性を持っている!", "resists!");
4296 /* Capture monster */
4300 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
4301 (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_NAZGUL)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR) || m_ptr->parent_m_idx)
4303 msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
4308 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
4309 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
4310 nokori_hp = m_ptr->maxhp * 3 / 10;
4312 nokori_hp = m_ptr->maxhp * 3 / 20;
4314 if (m_ptr->hp >= nokori_hp)
4316 msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), m_name);
4319 else if (m_ptr->hp < randint0(nokori_hp))
4321 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
4322 msg_format(_("%sを捕えた!", "You capture %^s!"), m_name);
4323 cap_mon = m_ptr->r_idx;
4324 cap_mspeed = m_ptr->mspeed;
4326 cap_maxhp = m_ptr->max_maxhp;
4327 cap_nickname = m_ptr->nickname; /* Quark transfer */
4328 if (c_ptr->m_idx == p_ptr->riding)
4330 if (rakuba(-1, FALSE))
4332 msg_format(_("地面に落とされた。", "You have fallen from %s."), m_name);
4336 delete_monster_idx(c_ptr->m_idx);
4342 msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), m_name);
4348 /* Attack (Use "dam" as attack type) */
4351 /* Return this monster's death */
4352 return py_attack(y, x, dam);
4355 /* Sleep (Use "dam" as "power") */
4361 if (seen) obvious = TRUE;
4363 if (r_ptr->flagsr & RFR_RES_ALL)
4365 note = _("には効果がなかった。", " is unaffected.");
4367 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4370 if (r_ptr->flags2 & RF2_EMPTY_MIND)
4372 note = _("には効果がなかった。", " is unaffected.");
4375 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
4378 if (MON_CSLEEP(m_ptr))
4380 note = _("には効果がなかった。", " is unaffected.");
4386 if (one_in_(5)) effect = 1;
4387 else if (one_in_(4)) effect = 2;
4388 else if (one_in_(3)) effect = 3;
4393 /* Powerful monsters can resist */
4394 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4395 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4397 note = _("には効果がなかった。", " is unaffected.");
4401 /* Normal monsters slow down */
4404 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
4406 note = _("の動きが遅くなった。", " starts moving slower.");
4411 else if (effect == 2)
4413 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
4415 /* Attempt a saving throw */
4416 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4417 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4422 /* No obvious effect */
4423 note = _("には効果がなかった。", " is unaffected.");
4428 else if (effect == 3)
4430 /* Attempt a saving throw */
4431 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4432 (r_ptr->flags3 & RF3_NO_SLEEP) ||
4433 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4435 /* Memorize a flag */
4436 if (r_ptr->flags3 & RF3_NO_SLEEP)
4438 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
4441 /* No obvious effect */
4442 note = _("には効果がなかった。", " is unaffected.");
4447 /* Go to sleep (much) later */
4448 note = _("は眠り込んでしまった!", " falls asleep!");
4455 note = _("には効果がなかった。", " is unaffected.");
4458 /* No "real" damage */
4466 if (seen) obvious = TRUE;
4468 if (r_ptr->flagsr & RFR_RES_ALL)
4470 note = _("には効果がなかった。", " is unaffected.");
4472 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4476 if (genocide_aux(c_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
4478 if (seen_msg) msg_format(_("%sは消滅した!", "%^s disappered!"), m_name);
4479 chg_virtue(V_VITALITY, -1);
4489 if (!who) msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), m_name);
4491 if (r_ptr->flags3 & (RF3_HURT_LITE))
4493 /* Obvious effect */
4494 if (seen) obvious = TRUE;
4496 /* Memorize the effects */
4497 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4499 /* Special effect */
4500 note = _("は光に身をすくめた!", " cringes from the light!");
4501 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
4504 /* Normally no damage */
4511 photo = m_ptr->r_idx;
4518 case GF_BLOOD_CURSE:
4520 if (seen) obvious = TRUE;
4522 if (r_ptr->flagsr & RFR_RES_ALL)
4524 note = _("には完全な耐性がある!", " is immune.");
4526 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4534 bool success = FALSE;
4535 if (seen) obvious = TRUE;
4537 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
4539 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
4540 if (dam < 1) dam = 1;
4542 /* No need to tame your pet */
4545 note = _("の動きが速くなった。", " starts moving faster.");
4546 (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100);
4550 /* Attempt a saving throw */
4551 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4552 (r_ptr->flags1 & (RF1_UNIQUE)) ||
4553 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4554 (p_ptr->cursed & TRC_AGGRAVATE) ||
4555 ((r_ptr->level+10) > randint1(dam)))
4558 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4562 note = _("を支配した。", " is tamed!");
4564 (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100);
4566 /* Learn about type */
4567 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4574 if (!(r_ptr->flags3 & RF3_NO_FEAR))
4576 do_fear = randint1(90)+10;
4578 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
4581 /* No "real" damage */
4588 if (seen) obvious = TRUE;
4590 if (r_ptr->flagsr & RFR_RES_ALL)
4592 note = _("には完全な耐性がある!", " is immune.");
4594 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4598 /* Attempt a saving throw */
4599 if (randint0(100 + dam) < (r_ptr->level + 50))
4601 note = _("には効果がなかった。", " is unaffected.");
4621 /* Absolutely no effect */
4622 if (skipped) return (FALSE);
4624 /* "Unique" monsters cannot be polymorphed */
4625 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
4627 /* Quest monsters cannot be polymorphed */
4628 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
4630 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
4632 /* "Unique" and "quest" monsters can only be "killed" by the player. */
4633 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
4635 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
4640 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
4641 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
4644 /* Modify the damage */
4646 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
4647 if ((tmp > 0) && (dam == 0)) note = _("はダメージを受けていない。", " is unharmed.");
4649 /* Check for death */
4650 if (dam > m_ptr->hp)
4652 /* Extract method of death */
4657 /* Sound and Impact resisters never stun */
4659 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
4660 !(r_ptr->flags3 & RF3_NO_STUN))
4663 if (seen) obvious = TRUE;
4666 if (MON_STUNNED(m_ptr))
4668 note = _("はひどくもうろうとした。", " is more dazed.");
4669 tmp = MON_STUNNED(m_ptr) + (do_stun / 2);
4673 note = _("はもうろうとした。", " is dazed.");
4678 (void)set_monster_stunned(c_ptr->m_idx, tmp);
4684 /* Confusion and Chaos resisters (and sleepers) never confuse */
4686 !(r_ptr->flags3 & RF3_NO_CONF) &&
4687 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
4690 if (seen) obvious = TRUE;
4692 /* Already partially confused */
4693 if (MON_CONFUSED(m_ptr))
4695 note = _("はさらに混乱したようだ。", " looks more confused.");
4696 tmp = MON_CONFUSED(m_ptr) + (do_conf / 2);
4699 /* Was not confused */
4702 note = _("は混乱したようだ。", " looks confused.");
4706 /* Apply confusion */
4707 (void)set_monster_confused(c_ptr->m_idx, tmp);
4716 if (seen) obvious = TRUE;
4718 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
4722 note = _("は弱くなったようだ。", " seems weakened.");
4723 m_ptr->maxhp -= do_time;
4724 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
4729 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
4730 if (do_poly && (randint1(90) > r_ptr->level))
4732 if (polymorph_monster(y, x))
4735 if (seen) obvious = TRUE;
4737 /* Monster polymorphs */
4738 note = _("が変身した!", " changes!");
4740 /* Turn off the damage */
4746 note = _("には効果がなかった。", " is unaffected.");
4749 /* Hack -- Get new monster */
4750 m_ptr = &m_list[c_ptr->m_idx];
4752 /* Hack -- Get new race */
4753 r_ptr = &r_info[m_ptr->r_idx];
4756 /* Handle "teleport" */
4760 if (seen) obvious = TRUE;
4763 note = _("が消え去った!", " disappears!");
4765 if (!who) chg_virtue(V_VALOUR, -1);
4768 teleport_away(c_ptr->m_idx, do_dist,
4769 (!who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
4771 /* Hack -- get new location */
4775 /* Hack -- get new grid */
4776 c_ptr = &cave[y][x];
4783 (void)set_monster_monfear(c_ptr->m_idx, MON_MONFEAR(m_ptr) + do_fear);
4790 if (typ == GF_DRAIN_MANA)
4792 /* Drain mana does nothing */
4795 /* If another monster did the damage, hurt the monster by hand */
4798 /* Redraw (later) if needed */
4799 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
4800 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
4802 /* Wake the monster up */
4803 (void)set_monster_csleep(c_ptr->m_idx, 0);
4805 /* Hurt the monster */
4813 if (is_pet(m_ptr) && !(m_ptr->ml))
4816 /* Give detailed messages if destroyed */
4819 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
4822 msg_format("%^s%s", m_name, note);
4830 if (who > 0) monster_gain_exp(who, m_ptr->r_idx);
4832 /* Generate treasure, etc */
4833 monster_death(c_ptr->m_idx, FALSE);
4835 /* Delete the monster */
4836 delete_monster_idx(c_ptr->m_idx);
4840 msg_print(_("少し悲しい気分がした。", "You feel sad for a moment."));
4844 /* Damaged monster */
4847 /* Give detailed messages if visible or destroyed */
4848 if (note && seen_msg) msg_format("%^s%s", m_name, note);
4850 /* Hack -- Pain message */
4853 message_pain(c_ptr->m_idx, dam);
4860 /* Hack -- handle sleep */
4861 if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep);
4865 else if (heal_leper)
4867 if (seen_msg) msg_print(_("不潔な病人は病気が治った!", "The Mangy looking leper is healed!"));
4869 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
4873 monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
4874 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_HEAL_LEPER, m2_name);
4877 delete_monster_idx(c_ptr->m_idx);
4880 /* If the player did it, give him experience, check fear */
4885 /* Hurt the monster, check for fear and death */
4886 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
4891 /* Damaged monster */
4894 /* HACK - anger the monster before showing the sleep message */
4895 if (do_sleep) anger_monster(m_ptr);
4897 /* Give detailed messages if visible or destroyed */
4898 if (note && seen_msg)
4899 msg_format(_("%s%s", "%^s%s"), m_name, note);
4901 /* Hack -- Pain message */
4902 else if (known && (dam || !do_fear))
4904 message_pain(c_ptr->m_idx, dam);
4907 /* Anger monsters */
4908 if (((dam > 0) || get_angry) && !do_sleep)
4909 anger_monster(m_ptr);
4912 if ((fear || do_fear) && seen)
4918 msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
4921 /* Hack -- handle sleep */
4922 if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep);
4926 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
4928 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
4932 switch (randint1(28))
4937 msg_print(_("地面が揺れた...", "The ground trembles..."));
4938 earthquake(ty, tx, 4 + randint0(4));
4939 if (!one_in_(6)) break;
4941 case 3: case 4: case 5: case 6:
4944 int dam = damroll(10, 10);
4945 msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
4947 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
4948 if (!one_in_(6)) break;
4953 msg_print(_("空間が歪んだ!", "Space warps about you!"));
4955 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), TELEPORT_PASSIVE);
4956 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
4957 if (!one_in_(6)) break;
4959 case 9: case 10: case 11:
4960 msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!"));
4961 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
4962 if (!one_in_(6)) break;
4963 case 12: case 13: case 14: case 15: case 16:
4964 aggravate_monsters(0);
4965 if (!one_in_(6)) break;
4967 count += activate_hi_summon(ty, tx, TRUE);
4968 if (!one_in_(6)) break;
4969 case 19: case 20: case 21: case 22:
4971 bool pet = !one_in_(3);
4972 u32b mode = PM_ALLOW_GROUP;
4974 if (pet) mode |= PM_FORCE_PET;
4975 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
4977 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
4978 if (!one_in_(6)) break;
4980 case 23: case 24: case 25:
4981 if (p_ptr->hold_exp && (randint0(100) < 75)) break;
4982 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
4984 if (p_ptr->hold_exp) lose_exp(p_ptr->exp / 160);
4985 else lose_exp(p_ptr->exp / 16);
4986 if (!one_in_(6)) break;
4987 case 26: case 27: case 28:
4996 (void)do_dec_stat(i);
5005 (void)do_dec_stat(randint0(6));
5014 if (p_ptr->inside_battle)
5016 p_ptr->health_who = c_ptr->m_idx;
5017 p_ptr->redraw |= (PR_HEALTH);
5021 /* XXX XXX XXX Verify this code */
5023 /* Update the monster */
5024 if (m_ptr->r_idx) update_mon(c_ptr->m_idx, FALSE);
5026 /* Redraw the monster grid */
5030 /* Update monster recall window */
5031 if ((p_ptr->monster_race_idx == m_ptr->r_idx) && (seen || !m_ptr->r_idx))
5034 p_ptr->window |= (PW_MONSTER);
5037 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
5041 if (!(flg & PROJECT_NO_HANGEKI))
5043 set_target(m_ptr, monster_target_y, monster_target_x);
5046 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
5048 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
5052 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
5054 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
5055 rakubadam_m = (dam > 200) ? 200 : dam;
5064 /* Get local object */
5067 /* Prepare to make a Blade of Chaos */
5068 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
5070 q_ptr->pval = photo;
5072 /* Mark the item as fully known */
5073 q_ptr->ident |= (IDENT_MENTAL);
5075 /* Drop it in the dungeon */
5076 (void)drop_near(q_ptr, -1, py, px);
5084 /* Return "Anything seen?" */
5090 * Helper function for "project()" below.
5092 * Handle a beam/bolt/ball causing damage to the player.
5094 * This routine takes a "source monster" (by index), a "distance", a default
5095 * "damage", and a "damage type". See "project_m()" above.
5097 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
5098 * is reduced (see "project_m()" above). This can happen if a monster breathes
5099 * at the player and hits a wall instead.
5101 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
5102 * to know if this is actually a ball or a bolt spell
5105 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
5106 * we just assume that the effects were obvious, for historical reasons.
5108 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
5113 /* Hack -- assume obvious */
5114 bool obvious = TRUE;
5116 /* Player blind-ness */
5117 bool blind = (p_ptr->blind ? TRUE : FALSE);
5119 /* Player needs a "description" (he is blind) */
5122 /* Source monster */
5123 monster_type *m_ptr = NULL;
5125 /* Monster name (for attacks) */
5128 /* Monster name (for damage) */
5131 /* Hack -- messages */
5137 /* Player is not here */
5138 if (!player_bold(y, x)) return (FALSE);
5140 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
5142 if (kawarimi(TRUE)) return FALSE;
5145 /* Player cannot hurt himself */
5146 if (!who) return (FALSE);
5147 if (who == p_ptr->riding) return (FALSE);
5149 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
5152 int max_attempts = 10;
5155 msg_print(_("何かが跳ね返った!", "Something bounces!"));
5156 else if (p_ptr->special_defense & KATA_FUUJIN)
5157 msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
5159 msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
5162 /* Choose 'new' target */
5167 t_y = m_list[who].fy - 1 + randint1(3);
5168 t_x = m_list[who].fx - 1 + randint1(3);
5171 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
5173 if (max_attempts < 1)
5175 t_y = m_list[who].fy;
5176 t_x = m_list[who].fx;
5181 t_y = py - 1 + randint1(3);
5182 t_x = px - 1 + randint1(3);
5185 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
5192 /* Limit maximum damage */
5193 if (dam > 1600) dam = 1600;
5195 /* Reduce damage by distance */
5196 dam = (dam + r) / (r + 1);
5199 /* If the player is blind, be more descriptive */
5200 if (blind) fuzzy = TRUE;
5205 /* Get the source monster */
5206 m_ptr = &m_list[who];
5207 /* Extract the monster level */
5208 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
5210 /* Get the monster name */
5211 monster_desc(m_name, m_ptr, 0);
5213 /* Get the monster's real name (gotten before polymorph!) */
5214 strcpy(killer, who_name);
5220 case PROJECT_WHO_UNCTRL_POWER:
5221 strcpy(killer, _("制御できない力の氾流", "uncontrollable power storm"));
5224 case PROJECT_WHO_GLASS_SHARDS:
5225 strcpy(killer, _("ガラスの破片", "shards of glass"));
5229 strcpy(killer, _("罠", "a trap"));
5234 strcpy(m_name, killer);
5237 /* Analyze the damage */
5240 /* Standard damage -- hurts inventory too */
5243 if (fuzzy) msg_print(_("酸で攻撃された!", "You are hit by acid!"));
5244 get_damage = acid_dam(dam, killer, monspell, FALSE);
5248 /* Standard damage -- hurts inventory too */
5251 if (fuzzy) msg_print(_("火炎で攻撃された!", "You are hit by fire!"));
5252 get_damage = fire_dam(dam, killer, monspell, FALSE);
5256 /* Standard damage -- hurts inventory too */
5259 if (fuzzy) msg_print(_("冷気で攻撃された!", "You are hit by cold!"));
5260 get_damage = cold_dam(dam, killer, monspell, FALSE);
5264 /* Standard damage -- hurts inventory too */
5267 if (fuzzy) msg_print(_("電撃で攻撃された!", "You are hit by lightning!"));
5268 get_damage = elec_dam(dam, killer, monspell, FALSE);
5272 /* Standard damage -- also poisons player */
5275 bool double_resist = IS_OPPOSE_POIS();
5276 if (fuzzy) msg_print(_("毒で攻撃された!", "You are hit by poison!"));
5278 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
5279 if (double_resist) dam = (dam + 2) / 3;
5281 if ((!(double_resist || p_ptr->resist_pois)) &&
5282 one_in_(HURT_CHANCE) && !CHECK_MULTISHADOW())
5287 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5289 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
5291 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
5296 /* Standard damage -- also poisons / mutates player */
5299 bool double_resist = IS_OPPOSE_POIS();
5300 if (fuzzy) msg_print(_("放射能で攻撃された!", "You are hit by radiation!"));
5302 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
5303 if (double_resist) dam = (2 * dam + 2) / 5;
5304 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5305 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
5307 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
5309 if (one_in_(5)) /* 6 */
5311 msg_print(_("奇形的な変身を遂げた!", "You undergo a freakish metamorphosis!"));
5312 if (one_in_(4)) /* 4 */
5320 inven_damage(set_acid_destroy, 2);
5326 /* Standard damage */
5329 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5330 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5334 /* Holy Orb -- Player only takes partial damage */
5337 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5338 if (p_ptr->align > 10)
5340 else if (p_ptr->align < -10)
5342 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5348 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5349 if (p_ptr->align > 10)
5351 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5355 /* Arrow -- XXX no dodging */
5360 msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
5362 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
5364 msg_print(_("矢を斬り捨てた!", "You cut down the arrow!"));
5367 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5371 /* Plasma -- XXX No resist */
5374 if (fuzzy) msg_print(_("何かとても熱いもので攻撃された!", "You are hit by something *HOT*!"));
5375 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5377 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5379 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
5380 (void)set_stun(p_ptr->stun + k);
5383 if (!(p_ptr->resist_fire ||
5385 p_ptr->immune_fire))
5387 inven_damage(set_acid_destroy, 3);
5393 /* Nether -- drain experience */
5396 if (fuzzy) msg_print(_("地獄の力で攻撃された!", "You are hit by nether forces!"));
5397 if (p_ptr->resist_neth)
5399 if (!prace_is_(RACE_SPECTRE))
5400 dam *= 6; dam /= (randint1(4) + 7);
5402 else if (!CHECK_MULTISHADOW()) drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
5404 if (prace_is_(RACE_SPECTRE) && !CHECK_MULTISHADOW())
5406 msg_print(_("気分がよくなった。", "You feel invigorated!"));
5408 learn_spell(monspell);
5412 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5418 /* Water -- stun/confuse */
5421 if (fuzzy) msg_print(_("何か湿ったもので攻撃された!", "You are hit by something wet!"));
5422 if (!CHECK_MULTISHADOW())
5424 if (!p_ptr->resist_sound)
5426 set_stun(p_ptr->stun + randint1(40));
5428 if (!p_ptr->resist_conf)
5430 set_confused(p_ptr->confused + randint1(5) + 5);
5435 inven_damage(set_cold_destroy, 3);
5439 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5443 /* Chaos -- many effects */
5446 if (fuzzy) msg_print(_("無秩序の波動で攻撃された!", "You are hit by a wave of anarchy!"));
5447 if (p_ptr->resist_chaos)
5449 dam *= 6; dam /= (randint1(4) + 7);
5452 if (!CHECK_MULTISHADOW())
5454 if (!p_ptr->resist_conf)
5456 (void)set_confused(p_ptr->confused + randint0(20) + 10);
5458 if (!p_ptr->resist_chaos)
5460 (void)set_image(p_ptr->image + randint1(10));
5463 msg_print(_("あなたの身体はカオスの力で捻じ曲げられた!", "Your body is twisted by chaos!"));
5464 (void)gain_random_mutation(0);
5467 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
5469 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
5472 if (!p_ptr->resist_chaos || one_in_(9))
5474 inven_damage(set_elec_destroy, 2);
5475 inven_damage(set_fire_destroy, 2);
5479 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5483 /* Shards -- mostly cutting */
5486 if (fuzzy) msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
5487 if (p_ptr->resist_shard)
5489 dam *= 6; dam /= (randint1(4) + 7);
5491 else if (!CHECK_MULTISHADOW())
5493 (void)set_cut(p_ptr->cut + dam);
5496 if (!p_ptr->resist_shard || one_in_(13))
5498 inven_damage(set_cold_destroy, 2);
5501 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5505 /* Sound -- mostly stunning */
5508 if (fuzzy) msg_print(_("轟音で攻撃された!", "You are hit by a loud noise!"));
5509 if (p_ptr->resist_sound)
5511 dam *= 5; dam /= (randint1(4) + 7);
5513 else if (!CHECK_MULTISHADOW())
5515 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
5516 (void)set_stun(p_ptr->stun + k);
5519 if (!p_ptr->resist_sound || one_in_(13))
5521 inven_damage(set_cold_destroy, 2);
5524 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5528 /* Pure confusion */
5531 if (fuzzy) msg_print(_("何か混乱するもので攻撃された!", "You are hit by something puzzling!"));
5532 if (p_ptr->resist_conf)
5534 dam *= 5; dam /= (randint1(4) + 7);
5536 else if (!CHECK_MULTISHADOW())
5538 (void)set_confused(p_ptr->confused + randint1(20) + 10);
5540 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5544 /* Disenchantment -- see above */
5547 if (fuzzy) msg_print(_("何かさえないもので攻撃された!", "You are hit by something static!"));
5548 if (p_ptr->resist_disen)
5550 dam *= 6; dam /= (randint1(4) + 7);
5552 else if (!CHECK_MULTISHADOW())
5554 (void)apply_disenchant(0);
5556 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5560 /* Nexus -- see above */
5563 if (fuzzy) msg_print(_("何か奇妙なもので攻撃された!", "You are hit by something strange!"));
5564 if (p_ptr->resist_nexus)
5566 dam *= 6; dam /= (randint1(4) + 7);
5568 else if (!CHECK_MULTISHADOW())
5572 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5576 /* Force -- mostly stun */
5579 if (fuzzy) msg_print(_("運動エネルギーで攻撃された!", "You are hit by kinetic force!"));
5580 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5582 (void)set_stun(p_ptr->stun + randint1(20));
5584 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5589 /* Rocket -- stun, cut */
5592 if (fuzzy) msg_print(_("爆発があった!", "There is an explosion!"));
5593 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5595 (void)set_stun(p_ptr->stun + randint1(20));
5598 if (p_ptr->resist_shard)
5602 else if (!CHECK_MULTISHADOW())
5604 (void)set_cut(p_ptr->cut + (dam / 2));
5607 if (!p_ptr->resist_shard || one_in_(12))
5609 inven_damage(set_cold_destroy, 3);
5612 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5616 /* Inertia -- slowness */
5619 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
5620 if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5621 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5625 /* Lite -- blinding */
5628 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5629 if (p_ptr->resist_lite)
5631 dam *= 4; dam /= (randint1(4) + 7);
5633 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
5635 (void)set_blind(p_ptr->blind + randint1(5) + 2);
5638 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
5640 if (!CHECK_MULTISHADOW()) msg_print(_("光で肉体が焦がされた!", "The light scorches your flesh!"));
5643 else if (prace_is_(RACE_S_FAIRY))
5648 if (p_ptr->wraith_form) dam *= 2;
5649 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5651 if (p_ptr->wraith_form && !CHECK_MULTISHADOW())
5653 p_ptr->wraith_form = 0;
5654 msg_print(_("閃光のため非物質的な影の存在でいられなくなった。",
5655 "The light forces you out of your incorporeal shadow form."));
5657 p_ptr->redraw |= PR_MAP;
5658 /* Update monsters */
5659 p_ptr->update |= (PU_MONSTERS);
5661 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5663 /* Redraw status bar */
5664 p_ptr->redraw |= (PR_STATUS);
5671 /* Dark -- blinding */
5674 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5675 if (p_ptr->resist_dark)
5677 dam *= 4; dam /= (randint1(4) + 7);
5679 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
5681 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
5683 (void)set_blind(p_ptr->blind + randint1(5) + 2);
5685 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5689 /* Time -- bolt fewer effects XXX */
5692 if (fuzzy) msg_print(_("過去からの衝撃に攻撃された!", "You are hit by a blast from the past!"));
5693 if (p_ptr->resist_time)
5696 dam /= (randint1(4) + 7);
5697 msg_print(_("時間が通り過ぎていく気がする。", "You feel as if time is passing you by."));
5699 else if (!CHECK_MULTISHADOW())
5701 switch (randint1(10))
5703 case 1: case 2: case 3: case 4: case 5:
5705 if (p_ptr->prace == RACE_ANDROID) break;
5706 msg_print(_("人生が逆戻りした気がする。", "You feel life has clocked back."));
5707 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
5711 case 6: case 7: case 8: case 9:
5713 switch (randint1(6))
5715 case 1: k = A_STR; act = _("強く", "strong"); break;
5716 case 2: k = A_INT; act = _("聡明で", "bright"); break;
5717 case 3: k = A_WIS; act = _("賢明で", "wise"); break;
5718 case 4: k = A_DEX; act = _("器用で", "agile"); break;
5719 case 5: k = A_CON; act = _("健康で", "hale"); break;
5720 case 6: k = A_CHR; act = _("美しく", "beautiful"); break;
5723 msg_format(_("あなたは以前ほど%sなくなってしまった...。",
5724 "You're not as %s as you used to be..."), act);
5726 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
5727 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
5728 p_ptr->update |= (PU_BONUS);
5734 msg_print(_("あなたは以前ほど力強くなくなってしまった...。",
5735 "You're not as powerful as you used to be..."));
5737 for (k = 0; k < 6; k++)
5739 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
5740 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
5742 p_ptr->update |= (PU_BONUS);
5748 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5752 /* Gravity -- stun plus slowness plus teleport */
5755 if (fuzzy) msg_print(_("何か重いもので攻撃された!", "You are hit by something heavy!"));
5756 msg_print(_("周辺の重力がゆがんだ。", "Gravity warps around you."));
5758 if (!CHECK_MULTISHADOW())
5760 teleport_player(5, TELEPORT_PASSIVE);
5761 if (!p_ptr->levitation)
5762 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5763 if (!(p_ptr->resist_sound || p_ptr->levitation))
5765 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
5766 (void)set_stun(p_ptr->stun + k);
5769 if (p_ptr->levitation)
5771 dam = (dam * 2) / 3;
5774 if (!p_ptr->levitation || one_in_(13))
5776 inven_damage(set_cold_destroy, 2);
5779 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5783 /* Standard damage */
5784 case GF_DISINTEGRATE:
5786 if (fuzzy) msg_print(_("純粋なエネルギーで攻撃された!", "You are hit by pure energy!"));
5788 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5794 if (fuzzy) msg_print(_("何らかの攻撃によって気分がよくなった。", "You are hit by something invigorating!"));
5796 (void)hp_player(dam);
5803 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5804 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
5811 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
5812 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5818 if (p_ptr->free_act) break;
5819 if (fuzzy) msg_print(_("眠ってしまった!", "You fall asleep!"));
5821 if (ironman_nightmare)
5823 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
5825 /* Pick a nightmare */
5826 get_mon_num_prep(get_nightmare, NULL);
5828 /* Have some nightmares */
5829 have_nightmare(get_mon_num(MAX_DEPTH));
5831 /* Remove the monster restriction */
5832 get_mon_num_prep(NULL, NULL);
5835 set_paralyzed(p_ptr->paralyzed + dam);
5845 if (fuzzy) msg_print(_("魔法のオーラで攻撃された!", "You are hit by an aura of magic!"));
5846 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5853 if (fuzzy) msg_print(_("エネルギーの塊で攻撃された!", "You are hit by an energy!"));
5854 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
5861 if (fuzzy) msg_print(_("何かが空からあなたの頭上に落ちてきた!", "Something falls from the sky on you!"));
5863 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5864 if (!p_ptr->resist_shard || one_in_(13))
5866 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
5867 inven_damage(set_cold_destroy, 2);
5873 /* Ice -- cold plus stun plus cuts */
5876 if (fuzzy) msg_print(_("何か鋭く冷たいもので攻撃された!", "You are hit by something sharp and cold!"));
5877 get_damage = cold_dam(dam, killer, monspell, FALSE);
5878 if (!CHECK_MULTISHADOW())
5880 if (!p_ptr->resist_shard)
5882 (void)set_cut(p_ptr->cut + damroll(5, 8));
5884 if (!p_ptr->resist_sound)
5886 (void)set_stun(p_ptr->stun + randint1(15));
5889 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
5891 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
5901 if (fuzzy) msg_print(_("何か非常に冷たいもので攻撃された!", "You are hit by something extremely cold!"));
5903 if (p_ptr->mimic_form)
5905 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
5906 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5911 switch (p_ptr->prace)
5913 /* Some races are immune */
5927 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5939 if (CHECK_MULTISHADOW())
5941 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
5943 else if (p_ptr->csp)
5947 msg_format(_("%^sに精神エネルギーを吸い取られてしまった!", "%^s draws psychic energy from you!"), m_name);
5949 msg_print(_("精神エネルギーを吸い取られてしまった!", "Your psychic energy is drawn!"));
5952 if (dam >= p_ptr->csp)
5956 p_ptr->csp_frac = 0;
5965 learn_spell(monspell);
5968 p_ptr->redraw |= (PR_MANA);
5971 p_ptr->window |= (PW_PLAYER);
5972 p_ptr->window |= (PW_SPELL);
5976 /* Heal the monster */
5977 if (m_ptr->hp < m_ptr->maxhp)
5981 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
5983 /* Redraw (later) if needed */
5984 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
5985 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
5987 /* Special message */
5990 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), m_name);
6003 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
6005 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
6006 learn_spell(monspell);
6010 if (!CHECK_MULTISHADOW())
6012 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
6014 if (!p_ptr->resist_conf)
6016 (void)set_confused(p_ptr->confused + randint0(4) + 4);
6019 if (!p_ptr->resist_chaos && one_in_(3))
6021 (void)set_image(p_ptr->image + randint0(250) + 150);
6028 p_ptr->csp_frac = 0;
6030 p_ptr->redraw |= PR_MANA;
6033 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6039 case GF_BRAIN_SMASH:
6041 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
6043 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
6044 learn_spell(monspell);
6048 if (!CHECK_MULTISHADOW())
6050 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
6056 p_ptr->csp_frac = 0;
6058 p_ptr->redraw |= PR_MANA;
6061 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6062 if (!CHECK_MULTISHADOW())
6064 if (!p_ptr->resist_blind)
6066 (void)set_blind(p_ptr->blind + 8 + randint0(8));
6068 if (!p_ptr->resist_conf)
6070 (void)set_confused(p_ptr->confused + randint0(4) + 4);
6072 if (!p_ptr->free_act)
6074 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
6076 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
6078 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
6079 (void)do_dec_stat(A_INT);
6080 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
6081 (void)do_dec_stat(A_WIS);
6083 if (!p_ptr->resist_chaos)
6085 (void)set_image(p_ptr->image + randint0(250) + 150);
6095 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
6097 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
6098 learn_spell(monspell);
6102 if (!CHECK_MULTISHADOW()) curse_equipment(15, 0);
6103 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6111 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
6113 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
6114 learn_spell(monspell);
6118 if (!CHECK_MULTISHADOW()) curse_equipment(25, MIN(rlev / 2 - 15, 5));
6119 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6127 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
6129 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
6130 learn_spell(monspell);
6134 if (!CHECK_MULTISHADOW()) curse_equipment(33, MIN(rlev / 2 - 15, 15));
6135 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6143 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU) && !CHECK_MULTISHADOW())
6145 msg_print(_("しかし秘孔を跳ね返した!", "You resist the effects!"));
6146 learn_spell(monspell);
6150 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6151 if (!CHECK_MULTISHADOW()) (void)set_cut(p_ptr->cut + damroll(10, 10));
6159 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
6161 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
6162 learn_spell(monspell);
6166 if (!CHECK_MULTISHADOW())
6168 msg_print(_("あなたは命が薄まっていくように感じた!", "You feel your life fade away!"));
6169 curse_equipment(40, 20);
6172 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
6174 if (p_ptr->chp < 1) p_ptr->chp = 1; /* Paranoia */
6189 /* Hex - revenge damage stored */
6190 revenge_store(get_damage);
6192 if ((p_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
6193 && (get_damage > 0) && !p_ptr->is_dead && (who > 0))
6195 char m_name_self[80];
6198 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
6200 msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), m_name, m_name_self);
6201 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
6202 if (p_ptr->tim_eyeeye) set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
6205 if (p_ptr->riding && dam > 0)
6207 rakubadam_p = (dam > 200) ? 200 : dam;
6215 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
6217 (void)kawarimi(FALSE);
6220 /* Return "Anything seen?" */
6226 * Find the distance from (x, y) to a line.
6228 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
6230 /* Vector from (x, y) to (x1, y1) */
6239 int pd = distance(y1, x1, y, x);
6240 int nd = distance(y1, x1, y2, x2);
6242 if (pd > nd) return distance(y, x, y2, x2);
6244 /* Component of P on N */
6245 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
6247 /* Absolute value */
6248 return((nd >= 0) ? nd : 0 - nd);
6255 * Modified version of los() for calculation of disintegration balls.
6256 * Disintegration effects are stopped by permanent walls.
6258 bool in_disintegration_range(int y1, int x1, int y2, int x2)
6278 /* Slope, or 1/Slope, of LOS */
6282 /* Extract the offset */
6286 /* Extract the absolute offset */
6291 /* Handle adjacent (or identical) grids */
6292 if ((ax < 2) && (ay < 2)) return (TRUE);
6295 /* Paranoia -- require "safe" origin */
6296 /* if (!in_bounds(y1, x1)) return (FALSE); */
6299 /* Directly South/North */
6302 /* South -- check for walls */
6305 for (ty = y1 + 1; ty < y2; ty++)
6307 if (cave_stop_disintegration(ty, x1)) return (FALSE);
6311 /* North -- check for walls */
6314 for (ty = y1 - 1; ty > y2; ty--)
6316 if (cave_stop_disintegration(ty, x1)) return (FALSE);
6324 /* Directly East/West */
6327 /* East -- check for walls */
6330 for (tx = x1 + 1; tx < x2; tx++)
6332 if (cave_stop_disintegration(y1, tx)) return (FALSE);
6336 /* West -- check for walls */
6339 for (tx = x1 - 1; tx > x2; tx--)
6341 if (cave_stop_disintegration(y1, tx)) return (FALSE);
6350 /* Extract some signs */
6351 sx = (dx < 0) ? -1 : 1;
6352 sy = (dy < 0) ? -1 : 1;
6355 /* Vertical "knights" */
6360 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
6364 /* Horizontal "knights" */
6369 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
6374 /* Calculate scale factor div 2 */
6377 /* Calculate scale factor */
6381 /* Travel horizontally */
6384 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
6390 /* Consider the special case where slope == 1. */
6401 /* Note (below) the case (qy == f2), where */
6402 /* the LOS exactly meets the corner of a tile. */
6405 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6416 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6429 /* Travel vertically */
6432 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
6448 /* Note (below) the case (qx == f2), where */
6449 /* the LOS exactly meets the corner of a tile. */
6452 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6463 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6484 void breath_shape(u16b *path_g, int dist, int *pgrids, byte *gx, byte *gy, byte *gm, int *pgm_rad, int rad, int y1, int x1, int y2, int x2, int typ)
6489 int brev = rad * rad / dist;
6493 int mdis = distance(y1, x1, y2, x2) + rad;
6495 while (bdis <= mdis)
6499 if ((0 < dist) && (path_n < dist))
6501 int ny = GRID_Y(path_g[path_n]);
6502 int nx = GRID_X(path_g[path_n]);
6503 int nd = distance(ny, nx, y1, x1);
6505 /* Get next base point */
6514 /* Travel from center outward */
6515 for (cdis = 0; cdis <= brad; cdis++)
6517 /* Scan the maximal blast area of radius "cdis" */
6518 for (y = by - cdis; y <= by + cdis; y++)
6520 for (x = bx - cdis; x <= bx + cdis; x++)
6522 /* Ignore "illegal" locations */
6523 if (!in_bounds(y, x)) continue;
6525 /* Enforce a circular "ripple" */
6526 if (distance(y1, x1, y, x) != bdis) continue;
6528 /* Enforce an arc */
6529 if (distance(by, bx, y, x) != cdis) continue;
6535 /* Lights are stopped by opaque terrains */
6536 if (!los(by, bx, y, x)) continue;
6538 case GF_DISINTEGRATE:
6539 /* Disintegration are stopped only by perma-walls */
6540 if (!in_disintegration_range(by, bx, y, x)) continue;
6543 /* Ball explosions are stopped by walls */
6544 if (!projectable(by, bx, y, x)) continue;
6548 /* Save this grid */
6556 /* Encode some more "radius" info */
6557 gm[bdis + 1] = *pgrids;
6559 /* Increase the size */
6560 brad = rad * (path_n + brev) / (dist + brev);
6562 /* Find the next ripple */
6566 /* Store the effect size */
6572 * Generic "beam"/"bolt"/"ball" projection routine.
6575 * who: Index of "source" monster (zero for "player")
6576 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
6577 * y,x: Target location (or location to travel "towards")
6578 * dam: Base damage roll to apply to affected monsters (or player)
6579 * typ: Type of damage to apply to monsters (and objects)
6580 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
6583 * TRUE if any "effects" of the projection were observed, else FALSE
6585 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
6586 * towards a given location (optionally passing over the heads of interposing
6587 * monsters), and have it do a given amount of damage to the monsters (and
6588 * optionally objects) within the given radius of the final location.
6590 * A "bolt" travels from source to target and affects only the target grid.
6591 * A "beam" travels from source to target, affecting all grids passed through.
6592 * A "ball" travels from source to the target, exploding at the target, and
6593 * affecting everything within the given radius of the target location.
6595 * Traditionally, a "bolt" does not affect anything on the ground, and does
6596 * not pass over the heads of interposing monsters, much like a traditional
6597 * missile, and will "stop" abruptly at the "target" even if no monster is
6598 * positioned there, while a "ball", on the other hand, passes over the heads
6599 * of monsters between the source and target, and affects everything except
6600 * the source monster which lies within the final radius, while a "beam"
6601 * affects every monster between the source and target, except for the casting
6602 * monster (or player), and rarely affects things on the ground.
6604 * Two special flags allow us to use this function in special ways, the
6605 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
6606 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
6607 * actually projecting from the source monster (or player).
6609 * The player will only get "experience" for monsters killed by himself
6610 * Unique monsters can only be destroyed by attacks from the player
6612 * Only 256 grids can be affected per projection, limiting the effective
6613 * "radius" of standard ball attacks to nine units (diameter nineteen).
6615 * One can project in a given "direction" by combining PROJECT_THRU with small
6616 * offsets to the initial location (see "line_spell()"), or by calculating
6617 * "virtual targets" far away from the player.
6619 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
6620 * continuing until it actually hits somethings (useful for "stone to mud").
6622 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
6624 * Balls must explode BEFORE hitting walls, or they would affect monsters
6625 * on both sides of a wall. Some bug reports indicate that this is still
6626 * happening in 2.7.8 for Windows, though it appears to be impossible.
6628 * We "pre-calculate" the blast area only in part for efficiency.
6629 * More importantly, this lets us do "explosions" from the "inside" out.
6630 * This results in a more logical distribution of "blast" treasure.
6631 * It also produces a better (in my opinion) animation of the explosion.
6632 * It could be (but is not) used to have the treasure dropped by monsters
6633 * in the middle of the explosion fall "outwards", and then be damaged by
6634 * the blast as it spreads outwards towards the treasure drop location.
6636 * Walls and doors are included in the blast area, so that they can be
6637 * "burned" or "melted" in later versions.
6639 * This algorithm is intended to maximize simplicity, not necessarily
6640 * efficiency, since this function is not a bottleneck in the code.
6642 * We apply the blast effect from ground zero outwards, in several passes,
6643 * first affecting features, then objects, then monsters, then the player.
6644 * This allows walls to be removed before checking the object or monster
6645 * in the wall, and protects objects which are dropped by monsters killed
6646 * in the blast, and allows the player to see all affects before he is
6647 * killed or teleported away. The semantics of this method are open to
6648 * various interpretations, but they seem to work well in practice.
6650 * We process the blast area from ground-zero outwards to allow for better
6651 * distribution of treasure dropped by monsters, and because it provides a
6652 * pleasing visual effect at low cost.
6654 * Note that the damage done by "ball" explosions decreases with distance.
6655 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
6657 * Notice the "napalm" effect of "beam" weapons. First they "project" to
6658 * the target, and then the damage "flows" along this beam of destruction.
6659 * The damage at every grid is the same as at the "center" of a "ball"
6660 * explosion, since the "beam" grids are treated as if they ARE at the
6661 * center of a "ball" explosion.
6663 * Currently, specifying "beam" plus "ball" means that locations which are
6664 * covered by the initial "beam", and also covered by the final "ball", except
6665 * for the final grid (the epicenter of the ball), will be "hit twice", once
6666 * by the initial beam, and once by the exploding ball. For the grid right
6667 * next to the epicenter, this results in 150% damage being done. The center
6668 * does not have this problem, for the same reason the final grid in a "beam"
6669 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
6670 * grids which are covered by the "ball" will NOT work, as then they will
6671 * receive LESS damage than they should. Do not combine "beam" with "ball".
6673 * The array "gy[],gx[]" with current size "grids" is used to hold the
6674 * collected locations of all grids in the "blast area" plus "beam path".
6676 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
6677 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
6678 * first blast grid (see above) with radius "N" from the blast center. Note
6679 * that only the first gm[1] grids in the blast area thus take full damage.
6680 * Also, note that gm[rad+1] is always equal to "grids", which is the total
6681 * number of blast grids.
6683 * Note that once the projection is complete, (y2,x2) holds the final location
6684 * of bolts/beams, and the "epicenter" of balls.
6686 * Note also that "rad" specifies the "inclusive" radius of projection blast,
6687 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
6688 * implementation of the "distance" function. Also, a bolt can be properly
6689 * viewed as a "ball" with a "rad" of "zero".
6691 * Note that if no "target" is reached before the beam/bolt/ball travels the
6692 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
6693 * may be relevant even for bolts, since they have a "1x1" mini-blast.
6695 * Note that for consistency, we "pretend" that the bolt actually takes "time"
6696 * to move from point A to point B, even if the player cannot see part of the
6697 * projection path. Note that in general, the player will *always* see part
6698 * of the path, since it either starts at the player or ends on the player.
6700 * Hack -- we assume that every "projection" is "self-illuminating".
6702 * Hack -- when only a single monster is affected, we automatically track
6703 * (and recall) that monster, unless "PROJECT_JUMP" is used.
6705 * Note that all projections now "explode" at their final destination, even
6706 * if they were being projected at a more distant destination. This means
6707 * that "ball" spells will *always* explode.
6709 * Note that we must call "handle_stuff()" after affecting terrain features
6710 * in the blast radius, in case the "illumination" of the grid was changed,
6711 * and "update_view()" and "update_monsters()" need to be called.
6713 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
6723 int y_saver, x_saver; /* For reflecting monsters */
6725 int msec = delay_factor * delay_factor * delay_factor;
6727 /* Assume the player sees nothing */
6728 bool notice = FALSE;
6730 /* Assume the player has seen nothing */
6731 bool visual = FALSE;
6733 /* Assume the player has seen no blast grids */
6736 /* Assume to be a normal ball spell */
6737 bool breath = FALSE;
6739 /* Is the player blind? */
6740 bool blind = (p_ptr->blind ? TRUE : FALSE);
6742 bool old_hide = FALSE;
6744 /* Number of grids in the "path" */
6747 /* Actual grids in the "path" */
6750 /* Number of grids in the "blast area" (including the "beam" path) */
6753 /* Coordinates of the affected grids */
6754 byte gx[1024], gy[1024];
6756 /* Encoded "radius" info (see above) */
6759 /* Actual radius encoded in gm[] */
6764 /* Attacker's name (prepared before polymorph)*/
6767 /* Can the player see the source of this effect? */
6768 bool see_s_msg = TRUE;
6770 /* Initialize by null string */
6776 /* Default target of monsterspell is player */
6777 monster_target_y=py;
6778 monster_target_x=px;
6780 /* Hack -- Jump to target */
6781 if (flg & (PROJECT_JUMP))
6786 /* Clear the flag */
6787 flg &= ~(PROJECT_JUMP);
6792 /* Start at player */
6799 /* Start at monster */
6802 x1 = m_list[who].fx;
6803 y1 = m_list[who].fy;
6804 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
6817 /* Default "destination" */
6822 /* Hack -- verify stuff */
6823 if (flg & (PROJECT_THRU))
6825 if ((x1 == x2) && (y1 == y2))
6827 flg &= ~(PROJECT_THRU);
6831 /* Handle a breath attack */
6836 if (flg & PROJECT_HIDE) old_hide = TRUE;
6837 flg |= PROJECT_HIDE;
6841 /* Hack -- Assume there will be no blast (max radius 32) */
6842 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
6850 /* Collect beam grids */
6851 if (flg & (PROJECT_BEAM))
6862 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
6864 case GF_DISINTEGRATE:
6865 flg |= (PROJECT_GRID);
6866 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
6870 /* Calculate the projection path */
6872 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
6874 /* Hack -- Handle stuff */
6877 /* Giga-Hack SEEKER & SUPER_RAY */
6879 if( typ == GF_SEEKER )
6889 for (i = 0; i < path_n; ++i)
6894 int ny = GRID_Y(path_g[i]);
6895 int nx = GRID_X(path_g[i]);
6906 /* Only do visuals if requested */
6907 if (!blind && !(flg & (PROJECT_HIDE)))
6909 /* Only do visuals if the player can "see" the bolt */
6910 if (panel_contains(y, x) && player_has_los_bold(y, x))
6917 /* Obtain the bolt pict */
6918 p = bolt_pict(oy, ox, y, x, typ);
6920 /* Extract attr/char */
6924 /* Visual effects */
6925 print_rel(c, a, y, x);
6926 move_cursor_relative(y, x);
6927 /*if (fresh_before)*/ Term_fresh();
6928 Term_xtra(TERM_XTRA_DELAY, msec);
6930 /*if (fresh_before)*/ Term_fresh();
6932 /* Display "beam" grids */
6933 if (flg & (PROJECT_BEAM))
6935 /* Obtain the explosion pict */
6936 p = bolt_pict(y, x, y, x, typ);
6938 /* Extract attr/char */
6942 /* Visual effects */
6943 print_rel(c, a, y, x);
6946 /* Hack -- Activate delay */
6950 /* Hack -- delay anyway for consistency */
6953 /* Delay for consistency */
6954 Term_xtra(TERM_XTRA_DELAY, msec);
6957 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
6958 if( is_mirror_grid(&cave[y][x]))
6960 /* The target of monsterspell becomes tha mirror(broken) */
6961 monster_target_y=(s16b)y;
6962 monster_target_x=(s16b)x;
6965 next_mirror( &oy,&ox,y,x );
6967 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
6968 for( j = last_i; j <=i ; j++ )
6970 y = GRID_Y(path_g[j]);
6971 x = GRID_X(path_g[j]);
6972 if(project_m(0,0,y,x,dam,GF_SEEKER,flg,TRUE))notice=TRUE;
6973 if(!who && (project_m_n==1) && !jump ){
6974 if(cave[project_m_y][project_m_x].m_idx >0 ){
6975 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
6979 /* Hack -- auto-recall */
6980 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6982 /* Hack - auto-track */
6983 health_track(cave[project_m_y][project_m_x].m_idx);
6987 (void)project_f(0,0,y,x,dam,GF_SEEKER);
6992 for( i = last_i ; i < path_n ; i++ )
6995 y = GRID_Y(path_g[i]);
6996 x = GRID_X(path_g[i]);
6997 if(project_m(0,0,y,x,dam,GF_SEEKER,flg,TRUE))
6999 if(!who && (project_m_n==1) && !jump ){
7000 if(cave[project_m_y][project_m_x].m_idx >0 ){
7001 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
7005 /* Hack -- auto-recall */
7006 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
7008 /* Hack - auto-track */
7009 health_track(cave[project_m_y][project_m_x].m_idx);
7013 (void)project_f(0,0,y,x,dam,GF_SEEKER);
7017 else if(typ == GF_SUPER_RAY){
7019 int second_step = 0;
7026 for (i = 0; i < path_n; ++i)
7031 int ny = GRID_Y(path_g[i]);
7032 int nx = GRID_X(path_g[i]);
7043 /* Only do visuals if requested */
7044 if (!blind && !(flg & (PROJECT_HIDE)))
7046 /* Only do visuals if the player can "see" the bolt */
7047 if (panel_contains(y, x) && player_has_los_bold(y, x))
7054 /* Obtain the bolt pict */
7055 p = bolt_pict(oy, ox, y, x, typ);
7057 /* Extract attr/char */
7061 /* Visual effects */
7062 print_rel(c, a, y, x);
7063 move_cursor_relative(y, x);
7064 /*if (fresh_before)*/ Term_fresh();
7065 Term_xtra(TERM_XTRA_DELAY, msec);
7067 /*if (fresh_before)*/ Term_fresh();
7069 /* Display "beam" grids */
7070 if (flg & (PROJECT_BEAM))
7072 /* Obtain the explosion pict */
7073 p = bolt_pict(y, x, y, x, typ);
7075 /* Extract attr/char */
7079 /* Visual effects */
7080 print_rel(c, a, y, x);
7083 /* Hack -- Activate delay */
7087 /* Hack -- delay anyway for consistency */
7090 /* Delay for consistency */
7091 Term_xtra(TERM_XTRA_DELAY, msec);
7094 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
7095 if (!cave_have_flag_bold(y, x, FF_PROJECT))
7097 if( second_step )continue;
7100 if( is_mirror_grid(&cave[y][x]) && !second_step )
7102 /* The target of monsterspell becomes tha mirror(broken) */
7103 monster_target_y=(s16b)y;
7104 monster_target_x=(s16b)x;
7107 for( j = 0; j <=i ; j++ )
7109 y = GRID_Y(path_g[j]);
7110 x = GRID_X(path_g[j]);
7111 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
7115 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
7116 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
7117 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
7118 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
7119 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
7120 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
7121 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
7122 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
7125 for( i = 0; i < path_n ; i++ )
7128 y = GRID_Y(path_g[i]);
7129 x = GRID_X(path_g[i]);
7130 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg,TRUE);
7131 if(!who && (project_m_n==1) && !jump ){
7132 if(cave[project_m_y][project_m_x].m_idx >0 ){
7133 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
7137 /* Hack -- auto-recall */
7138 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
7140 /* Hack - auto-track */
7141 health_track(cave[project_m_y][project_m_x].m_idx);
7145 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
7150 /* Project along the path */
7151 for (i = 0; i < path_n; ++i)
7156 int ny = GRID_Y(path_g[i]);
7157 int nx = GRID_X(path_g[i]);
7159 if (flg & PROJECT_DISI)
7161 /* Hack -- Balls explode before reaching walls */
7162 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
7164 else if (flg & PROJECT_LOS)
7166 /* Hack -- Balls explode before reaching walls */
7167 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
7171 /* Hack -- Balls explode before reaching walls */
7172 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
7179 /* Collect beam grids */
7180 if (flg & (PROJECT_BEAM))
7187 /* Only do visuals if requested */
7188 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
7190 /* Only do visuals if the player can "see" the bolt */
7191 if (panel_contains(y, x) && player_has_los_bold(y, x))
7198 /* Obtain the bolt pict */
7199 p = bolt_pict(oy, ox, y, x, typ);
7201 /* Extract attr/char */
7205 /* Visual effects */
7206 print_rel(c, a, y, x);
7207 move_cursor_relative(y, x);
7208 /*if (fresh_before)*/ Term_fresh();
7209 Term_xtra(TERM_XTRA_DELAY, msec);
7211 /*if (fresh_before)*/ Term_fresh();
7213 /* Display "beam" grids */
7214 if (flg & (PROJECT_BEAM))
7216 /* Obtain the explosion pict */
7217 p = bolt_pict(y, x, y, x, typ);
7219 /* Extract attr/char */
7223 /* Visual effects */
7224 print_rel(c, a, y, x);
7227 /* Hack -- Activate delay */
7231 /* Hack -- delay anyway for consistency */
7234 /* Delay for consistency */
7235 Term_xtra(TERM_XTRA_DELAY, msec);
7242 /* Save the "blast epicenter" */
7246 if (breath && !path_n)
7252 flg &= ~(PROJECT_HIDE);
7256 /* Start the "explosion" */
7259 /* Hack -- make sure beams get to "explode" */
7267 /* If we found a "target", explode there */
7268 if (dist <= MAX_RANGE)
7270 /* Mega-Hack -- remove the final "beam" grid */
7271 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
7274 * Create a conical breath attack
7285 flg &= ~(PROJECT_HIDE);
7287 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
7291 /* Determine the blast area, work from the inside out */
7292 for (dist = 0; dist <= rad; dist++)
7294 /* Scan the maximal blast area of radius "dist" */
7295 for (y = by - dist; y <= by + dist; y++)
7297 for (x = bx - dist; x <= bx + dist; x++)
7299 /* Ignore "illegal" locations */
7300 if (!in_bounds2(y, x)) continue;
7302 /* Enforce a "circular" explosion */
7303 if (distance(by, bx, y, x) != dist) continue;
7309 /* Lights are stopped by opaque terrains */
7310 if (!los(by, bx, y, x)) continue;
7312 case GF_DISINTEGRATE:
7313 /* Disintegration are stopped only by perma-walls */
7314 if (!in_disintegration_range(by, bx, y, x)) continue;
7317 /* Ball explosions are stopped by walls */
7318 if (!projectable(by, bx, y, x)) continue;
7322 /* Save this grid */
7329 /* Encode some more "radius" info */
7335 /* Speed -- ignore "non-explosions" */
7336 if (!grids) return (FALSE);
7339 /* Display the "blast area" if requested */
7340 if (!blind && !(flg & (PROJECT_HIDE)))
7342 /* Then do the "blast", from inside out */
7343 for (t = 0; t <= gm_rad; t++)
7345 /* Dump everything with this radius */
7346 for (i = gm[t]; i < gm[t+1]; i++)
7348 /* Extract the location */
7352 /* Only do visuals if the player can "see" the blast */
7353 if (panel_contains(y, x) && player_has_los_bold(y, x))
7362 /* Obtain the explosion pict */
7363 p = bolt_pict(y, x, y, x, typ);
7365 /* Extract attr/char */
7369 /* Visual effects -- Display */
7370 print_rel(c, a, y, x);
7374 /* Hack -- center the cursor */
7375 move_cursor_relative(by, bx);
7377 /* Flush each "radius" seperately */
7378 /*if (fresh_before)*/ Term_fresh();
7380 /* Delay (efficiently) */
7381 if (visual || drawn)
7383 Term_xtra(TERM_XTRA_DELAY, msec);
7387 /* Flush the erasing */
7390 /* Erase the explosion drawn above */
7391 for (i = 0; i < grids; i++)
7393 /* Extract the location */
7397 /* Hack -- Erase if needed */
7398 if (panel_contains(y, x) && player_has_los_bold(y, x))
7404 /* Hack -- center the cursor */
7405 move_cursor_relative(by, bx);
7407 /* Flush the explosion */
7408 /*if (fresh_before)*/ Term_fresh();
7413 /* Update stuff if needed */
7414 if (p_ptr->update) update_stuff();
7417 if (flg & PROJECT_KILL)
7419 see_s_msg = (who > 0) ? is_seen(&m_list[who]) :
7420 (!who ? TRUE : (player_can_see_bold(y1, x1) && projectable(py, px, y1, x1)));
7424 /* Check features */
7425 if (flg & (PROJECT_GRID))
7427 /* Start with "dist" of zero */
7430 /* Scan for features */
7431 for (i = 0; i < grids; i++)
7433 /* Hack -- Notice new "dist" values */
7434 if (gm[dist+1] == i) dist++;
7436 /* Get the grid location */
7440 /* Find the closest point in the blast */
7443 int d = dist_to_line(y, x, y1, x1, by, bx);
7445 /* Affect the grid */
7446 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
7450 /* Affect the grid */
7451 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
7456 /* Update stuff if needed */
7457 if (p_ptr->update) update_stuff();
7460 if (flg & (PROJECT_ITEM))
7462 /* Start with "dist" of zero */
7465 /* Scan for objects */
7466 for (i = 0; i < grids; i++)
7468 /* Hack -- Notice new "dist" values */
7469 if (gm[dist+1] == i) dist++;
7471 /* Get the grid location */
7475 /* Find the closest point in the blast */
7478 int d = dist_to_line(y, x, y1, x1, by, bx);
7480 /* Affect the object in the grid */
7481 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
7485 /* Affect the object in the grid */
7486 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
7492 /* Check monsters */
7493 if (flg & (PROJECT_KILL))
7500 /* Start with "dist" of zero */
7503 /* Scan for monsters */
7504 for (i = 0; i < grids; i++)
7508 /* Hack -- Notice new "dist" values */
7509 if (gm[dist + 1] == i) dist++;
7511 /* Get the grid location */
7515 /* A single bolt may be reflected */
7518 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
7519 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
7521 if ((flg & PROJECT_REFLECTABLE) && cave[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
7522 ((cave[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
7523 (!who || dist_hack > 1) && !one_in_(10))
7526 int max_attempts = 10;
7528 /* Choose 'new' target */
7531 t_y = y_saver - 1 + randint1(3);
7532 t_x = x_saver - 1 + randint1(3);
7535 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
7537 if (max_attempts < 1)
7545 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
7546 msg_print(_("「北斗神拳奥義・二指真空把!」", "The attack bounces!"));
7547 else if (m_ptr->r_idx == MON_DIO)
7548 msg_print(_("ディオ・ブランドーは指一本で攻撃を弾き返した!", "The attack bounces!"));
7550 msg_print(_("攻撃は跳ね返った!", "The attack bounces!"));
7552 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
7554 /* Reflected bolts randomly target either one */
7555 if (player_bold(y, x) || one_in_(2)) flg &= ~(PROJECT_PLAYER);
7556 else flg |= PROJECT_PLAYER;
7558 /* The bolt is reflected */
7559 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
7561 /* Don't affect the monster any longer */
7567 /* Find the closest point in the blast */
7570 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
7574 effective_dist = dist;
7578 /* There is the riding player on this monster */
7579 if (p_ptr->riding && player_bold(y, x))
7581 /* Aimed on the player */
7582 if (flg & PROJECT_PLAYER)
7584 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
7587 * A beam or bolt is well aimed
7589 * So don't affects the mount.
7596 * The spell is not well aimed,
7597 * So partly affect the mount too.
7604 * This grid is the original target.
7605 * Or aimed on your horse.
7607 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
7609 /* Hit the mount with full damage */
7613 * Otherwise this grid is not the
7614 * original target, it means that line
7615 * of fire is obstructed by this
7619 * A beam or bolt will hit either
7620 * player or mount. Choose randomly.
7622 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
7626 /* Hit the mount with full damage */
7630 /* Hit the player later */
7631 flg |= PROJECT_PLAYER;
7633 /* Don't affect the mount */
7639 * The spell is not well aimed, so
7640 * partly affect both player and
7649 /* Affect the monster in the grid */
7650 if (project_m(who, effective_dist, y, x, dam, typ, flg, see_s_msg)) notice = TRUE;
7654 /* Player affected one monster (without "jumping") */
7655 if (!who && (project_m_n == 1) && !jump)
7661 /* Track if possible */
7662 if (cave[y][x].m_idx > 0)
7664 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
7668 /* Hack -- auto-recall */
7669 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
7671 /* Hack - auto-track */
7672 if (m_ptr->ml) health_track(cave[y][x].m_idx);
7680 if (flg & (PROJECT_KILL))
7682 /* Start with "dist" of zero */
7685 /* Scan for player */
7686 for (i = 0; i < grids; i++)
7690 /* Hack -- Notice new "dist" values */
7691 if (gm[dist+1] == i) dist++;
7693 /* Get the grid location */
7697 /* Affect the player? */
7698 if (!player_bold(y, x)) continue;
7700 /* Find the closest point in the blast */
7703 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
7707 effective_dist = dist;
7710 /* Target may be your horse */
7713 /* Aimed on the player */
7714 if (flg & PROJECT_PLAYER)
7716 /* Hit the player with full damage */
7720 * Hack -- When this grid was not the
7721 * original target, a beam or bolt
7722 * would hit either player or mount,
7723 * and should be choosen randomly.
7725 * But already choosen to hit the
7726 * mount at this point.
7728 * Or aimed on your horse.
7730 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
7733 * A beam or bolt is well aimed
7735 * So don't affects the player.
7742 * The spell is not well aimed,
7743 * So partly affect the player too.
7749 /* Affect the player */
7750 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
7758 monster_desc(m_name, &m_list[p_ptr->riding], 0);
7760 if (rakubadam_m > 0)
7762 if (rakuba(rakubadam_m, FALSE))
7764 msg_format(_("%^sに振り落とされた!", "%^s has thrown you off!"), m_name);
7767 if (p_ptr->riding && rakubadam_p > 0)
7769 if(rakuba(rakubadam_p, FALSE))
7771 msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_name);
7776 /* Return "something was noticed" */
7780 bool binding_field( int dam )
7782 int mirror_x[10],mirror_y[10]; /* 鏡はもっと少ない */
7783 int mirror_num=0; /* 鏡の数 */
7788 int msec= delay_factor*delay_factor*delay_factor;
7794 /* Default target of monsterspell is player */
7795 monster_target_y=py;
7796 monster_target_x=px;
7798 for( x=0 ; x < cur_wid ; x++ )
7800 for( y=0 ; y < cur_hgt ; y++ )
7802 if( is_mirror_grid(&cave[y][x]) &&
7803 distance(py,px,y,x) <= MAX_RANGE &&
7804 distance(py,px,y,x) != 0 &&
7805 player_has_los_bold(y,x) &&
7806 projectable(py, px, y, x)
7808 mirror_y[mirror_num]=y;
7809 mirror_x[mirror_num]=x;
7815 if( mirror_num < 2 )return FALSE;
7817 point_x[0] = randint0( mirror_num );
7819 point_x[1] = randint0( mirror_num );
7821 while( point_x[0] == point_x[1] );
7823 point_y[0]=mirror_y[point_x[0]];
7824 point_x[0]=mirror_x[point_x[0]];
7825 point_y[1]=mirror_y[point_x[1]];
7826 point_x[1]=mirror_x[point_x[1]];
7830 x=point_x[0]+point_x[1]+point_x[2];
7831 y=point_y[0]+point_y[1]+point_y[2];
7833 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
7834 - (point_y[0]*3-y)*(point_x[1]*3-x);
7835 if( centersign == 0 )return FALSE;
7837 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
7838 x1 = x1 < point_x[2] ? x1 : point_x[2];
7839 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
7840 y1 = y1 < point_y[2] ? y1 : point_y[2];
7842 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
7843 x2 = x2 > point_x[2] ? x2 : point_x[2];
7844 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
7845 y2 = y2 > point_y[2] ? y2 : point_y[2];
7847 for( y=y1 ; y <=y2 ; y++ ){
7848 for( x=x1 ; x <=x2 ; x++ ){
7849 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
7850 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
7851 centersign*( (point_x[1]-x)*(point_y[2]-y)
7852 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
7853 centersign*( (point_x[2]-x)*(point_y[0]-y)
7854 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
7856 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
7857 /* Visual effects */
7859 && panel_contains(y,x)){
7860 p = bolt_pict(y,x,y,x, GF_MANA );
7861 print_rel(PICT_C(p), PICT_A(p),y,x);
7862 move_cursor_relative(y, x);
7863 /*if (fresh_before)*/ Term_fresh();
7864 Term_xtra(TERM_XTRA_DELAY, msec);
7870 for( y=y1 ; y <=y2 ; y++ ){
7871 for( x=x1 ; x <=x2 ; x++ ){
7872 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
7873 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
7874 centersign*( (point_x[1]-x)*(point_y[2]-y)
7875 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
7876 centersign*( (point_x[2]-x)*(point_y[0]-y)
7877 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
7879 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
7880 (void)project_f(0,0,y,x,dam,GF_MANA);
7885 for( y=y1 ; y <=y2 ; y++ ){
7886 for( x=x1 ; x <=x2 ; x++ ){
7887 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
7888 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
7889 centersign*( (point_x[1]-x)*(point_y[2]-y)
7890 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
7891 centersign*( (point_x[2]-x)*(point_y[0]-y)
7892 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
7894 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
7895 (void)project_o(0,0,y,x,dam,GF_MANA);
7900 for( y=y1 ; y <=y2 ; y++ ){
7901 for( x=x1 ; x <=x2 ; x++ ){
7902 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
7903 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
7904 centersign*( (point_x[1]-x)*(point_y[2]-y)
7905 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
7906 centersign*( (point_x[2]-x)*(point_y[0]-y)
7907 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
7909 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
7910 (void)project_m(0,0,y,x,dam,GF_MANA,
7911 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP),TRUE);
7917 msg_print(_("鏡が結界に耐えきれず、壊れてしまった。", "The field broke a mirror"));
7918 remove_mirror(point_y[0],point_x[0]);
7924 void seal_of_mirror( int dam )
7928 for( x = 0 ; x < cur_wid ; x++ )
7930 for( y = 0 ; y < cur_hgt ; y++ )
7932 if( is_mirror_grid(&cave[y][x]))
7934 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
7935 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP),TRUE))
7937 if( !cave[y][x].m_idx )