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"))
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))
617 message = "¸Ï¤ì¤¿";break;
619 message = "was blasted.";break;
623 message = "½Ì¤ó¤À";break;
625 message = "shrank.";break;
629 message = "ÍϤ±¤¿";break;
631 message = "melted.";break;
636 message = "Åà¤ê¡¢ºÕ¤±»¶¤Ã¤¿";break;
638 message = "was frozen and smashed.";break;
644 message = "dz¤¨¤¿";break;
646 message = "burns up!";break;
660 message = "Ê´ºÕ¤µ¤ì¤¿";break;
662 message = "was crushed.";break;
665 message = NULL;break;
670 msg_format("ÌÚ¤Ï%s¡£", message);
672 msg_format("A tree %s", message);
674 cave_set_feat(y, x, (one_in_(3) ? FEAT_DEEP_GRASS : FEAT_GRASS));
677 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
679 /* Update some things */
680 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
684 /* Analyze the type */
687 /* Ignore most effects */
722 /* Destroy Traps (and Locks) */
725 /* Reveal secret doors */
726 if (is_hidden_door(c_ptr))
731 /* Check line of sight */
739 if (is_trap(c_ptr->feat))
741 /* Check line of sight */
745 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
747 msg_print("There is a bright flash of light!");
753 /* Destroy the trap */
754 cave_alter_feat(y, x, FF_DISARM);
757 /* Locked doors are unlocked */
758 if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
760 s16b old_feat = c_ptr->feat;
762 /* Unlock the door */
763 cave_alter_feat(y, x, FF_DISARM);
765 /* Check line of sound */
766 if (known && (old_feat != c_ptr->feat))
769 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
778 /* Remove "unsafe" flag if player is not blind */
779 if (!p_ptr->blind && player_has_los_bold(y, x))
781 c_ptr->info &= ~(CAVE_UNSAFE);
792 /* Destroy Doors (and traps) */
795 /* Destroy all doors and traps */
796 if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
798 /* Check line of sight */
803 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
805 msg_print("There is a bright flash of light!");
811 /* Visibility change */
812 if (have_flag(f_ptr->flags, FF_DOOR))
814 /* Update some things */
815 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
818 /* Destroy the feature */
819 cave_alter_feat(y, x, FF_TUNNEL);
822 /* Remove "unsafe" flag if player is not blind */
823 if (!p_ptr->blind && player_has_los_bold(y, x))
825 c_ptr->info &= ~(CAVE_UNSAFE);
836 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
838 if (have_flag(f_ptr->flags, FF_SPIKE))
840 s16b old_mimic = c_ptr->mimic;
841 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
843 cave_alter_feat(y, x, FF_SPIKE);
845 c_ptr->mimic = old_mimic;
853 /* Check line of sight */
854 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
858 msg_format("%s¤Ë²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ³«¤«¤Ê¤¯¤Ê¤Ã¤¿¡£", f_name + mimic_f_ptr->name);
860 msg_format("The %s seems stuck.", f_name + mimic_f_ptr->name);
869 /* Destroy walls (and doors) */
872 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
875 if (known && (c_ptr->info & (CAVE_MARK)))
878 msg_format("%s¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª", f_name + f_info[get_feat_mimic(c_ptr)].name);
880 msg_format("The %s turns into mud!", f_name + f_info[get_feat_mimic(c_ptr)].name);
886 /* Destroy the wall */
887 cave_alter_feat(y, x, FF_HURT_ROCK);
889 /* Update some things */
890 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
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;
905 /* Create a closed door */
906 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
909 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
911 /* Update some things */
912 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
929 /* Require a "naked" floor grid */
930 if (!cave_naked_bold(y, x)) break;
932 /* Not on the player */
933 if (player_bold(y, x)) break;
935 /* Create a closed door */
936 cave_set_feat(y, x, FEAT_TREES);
939 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
941 /* Update some things */
942 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
949 /* Require a "naked" floor grid */
950 if (!cave_naked_bold(y, x)) break;
953 c_ptr->info |= CAVE_OBJECT;
954 c_ptr->mimic = FEAT_GLYPH;
967 /* Require a "naked" floor grid */
968 if (!cave_naked_bold(y, x)) break;
970 /* Not on the player */
971 if (player_bold(y, x)) break;
974 cave_set_feat(y, x, FEAT_WALL);
976 /* Update some things */
977 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
985 /* Ignore permanent grid */
986 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
991 /* Ignore grid without enough space */
992 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
994 /* Place a shallow lava */
995 cave_set_feat(y, x, FEAT_SHAL_LAVA);
1000 /* Place a deep lava */
1001 cave_set_feat(y, x, FEAT_DEEP_LAVA);
1008 /* Ignore permanent grid */
1009 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
1014 /* Ignore grid without enough space */
1015 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
1017 /* Place a shallow water */
1018 cave_set_feat(y, x, FEAT_SHAL_WATER);
1023 /* Place a deep water */
1024 cave_set_feat(y, x, FEAT_DEEP_WATER);
1029 /* Lite up the grid */
1033 /* Turn on the light */
1034 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
1036 c_ptr->info |= (CAVE_GLOW);
1044 update_local_illumination(y, x);
1047 if (player_can_see_bold(y, x)) obvious = TRUE;
1049 /* Mega-Hack -- Update the monster in the affected grid */
1050 /* This allows "spear of light" (etc) to work "correctly" */
1051 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1057 /* Darken the grid */
1061 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(c_ptr);
1064 /* Turn off the light. */
1067 for (j = 0; j < 9; j++)
1069 int by = y + ddy_ddd[j];
1070 int bx = x + ddx_ddd[j];
1072 if (in_bounds2(by, bx))
1074 cave_type *cc_ptr = &cave[by][bx];
1076 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
1084 if (!do_dark) break;
1086 c_ptr->info &= ~(CAVE_GLOW);
1088 /* Hack -- Forget "boring" grids */
1089 if (!have_flag(f_ptr->flags, FF_REMEMBER))
1092 c_ptr->info &= ~(CAVE_MARK);
1101 update_local_illumination(y, x);
1104 if (player_can_see_bold(y, x)) obvious = TRUE;
1106 /* Mega-Hack -- Update the monster in the affected grid */
1107 /* This allows "spear of light" (etc) to work "correctly" */
1108 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1117 if (is_mirror_grid(c_ptr))
1120 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1122 msg_print("The mirror was crashed!");
1124 remove_mirror(y, x);
1125 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1131 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
1134 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1136 msg_print("The mirror was crashed!");
1138 remove_mirror(y, x);
1139 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1144 case GF_DISINTEGRATE:
1146 /* Destroy mirror */
1147 if (is_mirror_grid(c_ptr)) remove_mirror(y, x);
1149 /* Permanent features don't get effect */
1150 /* But not protect monsters and other objects */
1151 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
1153 cave_alter_feat(y, x, FF_HURT_DISI);
1155 /* Update some things -- similar to GF_KILL_WALL */
1156 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
1163 /* Return "Anything seen?" */
1170 * We are called from "project()" to "damage" objects
1172 * We are called both for "beam" effects and "ball" effects.
1174 * Perhaps we should only SOMETIMES damage things on the ground.
1176 * The "r" parameter is the "distance from ground zero".
1178 * Note that we determine if the player can "see" anything that happens
1179 * by taking into account: blindness, line-of-sight, and illumination.
1181 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1183 * We return "TRUE" if the effect of the projection is "obvious".
1185 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1187 cave_type *c_ptr = &cave[y][x];
1189 s16b this_o_idx, next_o_idx = 0;
1191 bool obvious = FALSE;
1192 bool known = player_has_los_bold(y, x);
1194 u32b flgs[TR_FLAG_SIZE];
1196 char o_name[MAX_NLEN];
1199 bool is_potion = FALSE;
1203 who = who ? who : 0;
1205 /* Reduce damage by distance */
1206 dam = (dam + r) / (r + 1);
1209 /* Scan all objects in the grid */
1210 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1212 /* Acquire object */
1213 object_type *o_ptr = &o_list[this_o_idx];
1215 bool is_art = FALSE;
1216 bool ignore = FALSE;
1217 bool do_kill = FALSE;
1219 cptr note_kill = NULL;
1222 /* Get the "plural"-ness */
1223 bool plural = (o_ptr->number > 1);
1226 /* Acquire next object */
1227 next_o_idx = o_ptr->next_o_idx;
1229 /* Extract the flags */
1230 object_flags(o_ptr, flgs);
1232 /* Check for artifact */
1233 if (object_is_artifact(o_ptr)) is_art = TRUE;
1235 /* Analyze the type */
1238 /* Acid -- Lots of things */
1241 if (hates_acid(o_ptr))
1245 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1247 note_kill = (plural ? " melt!" : " melts!");
1250 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1255 /* Elec -- Rings and Wands */
1258 if (hates_elec(o_ptr))
1262 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1264 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1267 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1272 /* Fire -- Flammable objects */
1275 if (hates_fire(o_ptr))
1279 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1281 note_kill = (plural ? " burn up!" : " burns up!");
1284 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1289 /* Cold -- potions and flasks */
1292 if (hates_cold(o_ptr))
1295 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1297 note_kill = (plural ? " shatter!" : " shatters!");
1301 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1309 if (hates_fire(o_ptr))
1313 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1315 note_kill = (plural ? " burn up!" : " burns up!");
1318 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1320 if (hates_elec(o_ptr))
1325 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1327 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1330 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1338 if (hates_fire(o_ptr))
1342 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1344 note_kill = (plural ? " burn up!" : " burns up!");
1347 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1349 if (hates_cold(o_ptr))
1354 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1356 note_kill = (plural ? " shatter!" : " shatters!");
1359 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1364 /* Hack -- break potions and such */
1370 if (hates_cold(o_ptr))
1373 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1375 note_kill = (plural ? " shatter!" : " shatters!");
1383 /* Mana and Chaos -- destroy everything */
1390 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1392 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1398 case GF_DISINTEGRATE:
1402 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1404 note_kill = (plural ? " evaporate!" : " evaporates!");
1414 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1416 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1419 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1420 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1424 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1428 if (object_is_cursed(o_ptr))
1432 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1434 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1443 identify_item(o_ptr);
1445 /* Auto-inscription */
1446 autopick_alter_item((-this_o_idx), FALSE);
1454 /* Chests are noticed only if trapped or locked */
1455 if (o_ptr->tval == TV_CHEST)
1457 /* Disarm/Unlock traps */
1458 if (o_ptr->pval > 0)
1460 /* Disarm or Unlock */
1461 o_ptr->pval = (0 - o_ptr->pval);
1464 object_known(o_ptr);
1467 if (known && o_ptr->marked)
1470 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1472 msg_print("Click!");
1484 if (o_ptr->tval == TV_CORPSE)
1489 if (!who || is_pet(&m_list[who]))
1490 mode |= PM_FORCE_PET;
1492 for (i = 0; i < o_ptr->number ; i++)
1494 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1495 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1500 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1502 note_kill = (plural ? " become dust." : " becomes dust.");
1507 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1510 note_kill = "À¸¤Ê֤ä¿¡£";
1512 note_kill = "rivived.";
1515 else if (!note_kill)
1518 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1520 note_kill = (plural ? " become dust." : " becomes dust.");
1532 /* Attempt to destroy the object */
1535 /* Effect "observed" */
1536 if (known && o_ptr->marked)
1539 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1542 /* Artifacts, and other objects, get to resist */
1543 if (is_art || ignore)
1545 /* Observe the resist */
1546 if (known && o_ptr->marked)
1549 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1552 msg_format("The %s %s unaffected!",
1553 o_name, (plural ? "are" : "is"));
1562 /* Describe if needed */
1563 if (known && o_ptr->marked && note_kill)
1566 msg_format("%s¤Ï%s", o_name, note_kill);
1568 msg_format("The %s%s", o_name, note_kill);
1573 k_idx = o_ptr->k_idx;
1574 is_potion = object_is_potion(o_ptr);
1577 /* Delete the object */
1578 delete_object_idx(this_o_idx);
1580 /* Potions produce effects when 'shattered' */
1583 (void)potion_smash_effect(who, y, x, k_idx);
1592 /* Return "Anything seen?" */
1598 * Helper function for "project()" below.
1600 * Handle a beam/bolt/ball causing damage to a monster.
1602 * This routine takes a "source monster" (by index) which is mostly used to
1603 * determine if the player is causing the damage, and a "radius" (see below),
1604 * which is used to decrease the power of explosions with distance, and a
1605 * location, via integers which are modified by certain types of attacks
1606 * (polymorph and teleport being the obvious ones), a default damage, which
1607 * is modified as needed based on various properties, and finally a "damage
1608 * type" (see below).
1610 * Note that this routine can handle "no damage" attacks (like teleport) by
1611 * taking a "zero" damage, and can even take "parameters" to attacks (like
1612 * confuse) by accepting a "damage", using it to calculate the effect, and
1613 * then setting the damage to zero. Note that the "damage" parameter is
1614 * divided by the radius, so monsters not at the "epicenter" will not take
1615 * as much damage (or whatever)...
1617 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1618 * may result in a dereference of an invalid pointer. XXX XXX XXX
1620 * Various messages are produced, and damage is applied.
1622 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1623 * actually be "made" of that substance, or "breathe" big balls of it.
1625 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1628 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1629 * and hurts evil less. If can breath nether, then it resists it as well.
1631 * Damage reductions use the following formulas:
1632 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1633 * gives avg damage of .655, ranging from .858 to .500
1634 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1635 * gives avg damage of .544, ranging from .714 to .417
1636 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1637 * gives avg damage of .444, ranging from .556 to .333
1638 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1639 * gives avg damage of .327, ranging from .427 to .250
1640 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1641 * gives something simple.
1643 * In this function, "result" messages are postponed until the end, where
1644 * the "note" string is appended to the monster name, if not NULL. So,
1645 * to make a spell have "no effect" just set "note" to NULL. You should
1646 * also set "notice" to FALSE, or the player will learn what the spell does.
1648 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1650 /* "flg" was added. */
1651 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1655 cave_type *c_ptr = &cave[y][x];
1657 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1659 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1663 /* Is the monster "seen"? */
1664 bool seen = m_ptr->ml;
1666 bool slept = (bool)(m_ptr->csleep > 0);
1668 /* Were the effects "obvious" (if seen)? */
1669 bool obvious = FALSE;
1671 /* Can the player know about this effect? */
1672 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1674 /* Can the player see the source of this effect? */
1675 bool see_s = ((who <= 0) || m_list[who].ml);
1677 /* Were the effects "irrelevant"? */
1678 bool skipped = FALSE;
1680 /* Gets the monster angry at the source of the effect? */
1681 bool get_angry = FALSE;
1683 /* Polymorph setting (true or false) */
1684 bool do_poly = FALSE;
1686 /* Teleport setting (max distance) */
1689 /* Confusion setting (amount to confuse) */
1692 /* Stunning setting (amount to stun) */
1695 /* Sleep amount (amount to sleep) */
1698 /* Fear amount (amount to fear) */
1701 /* Time amount (amount to time) */
1704 bool heal_leper = FALSE;
1706 /* Hold the monster name */
1715 /* Assume no note */
1718 /* Assume a default death */
1719 cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
1724 int caster_lev = (who > 0) ? r_info[m_list[who].r_idx].level : p_ptr->lev * 2;
1727 if (!c_ptr->m_idx) return (FALSE);
1729 /* Never affect projector */
1730 if (who && (c_ptr->m_idx == who)) return (FALSE);
1731 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1732 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1734 /* Don't affect already death monsters */
1735 /* Prevents problems with chain reactions of exploding monsters */
1736 if (m_ptr->hp < 0) return (FALSE);
1738 /* Reduce damage by distance */
1739 dam = (dam + r) / (r + 1);
1742 /* Get the monster name (BEFORE polymorphing) */
1743 monster_desc(m_name, m_ptr, 0);
1746 /* Get the monster possessive ("his"/"her"/"its") */
1747 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1751 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1753 /* Analyze the damage type */
1756 /* Magic Missile -- pure damage */
1759 if (seen) obvious = TRUE;
1761 if (r_ptr->flagsr & RFR_RES_ALL)
1764 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1766 note = " is immune.";
1769 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1778 if (seen) obvious = TRUE;
1780 if (r_ptr->flagsr & RFR_RES_ALL)
1783 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1785 note = " is immune.";
1788 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1791 if (r_ptr->flagsr & RFR_IM_ACID)
1794 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1796 note = " resists a lot.";
1800 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1808 if (seen) obvious = TRUE;
1810 if (r_ptr->flagsr & RFR_RES_ALL)
1813 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1815 note = " is immune.";
1818 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1821 if (r_ptr->flagsr & RFR_IM_ELEC)
1824 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1826 note = " resists a lot.";
1830 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1838 if (seen) obvious = TRUE;
1840 if (r_ptr->flagsr & RFR_RES_ALL)
1843 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1845 note = " is immune.";
1848 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1851 if (r_ptr->flagsr & RFR_IM_FIRE)
1854 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1856 note = " resists a lot.";
1860 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1862 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1865 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1867 note = " is hit hard.";
1871 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1879 if (seen) obvious = TRUE;
1881 if (r_ptr->flagsr & RFR_RES_ALL)
1884 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1886 note = " is immune.";
1889 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1892 if (r_ptr->flagsr & RFR_IM_COLD)
1895 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1897 note = " resists a lot.";
1901 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1903 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1906 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1908 note = " is hit hard.";
1912 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1920 if (seen) obvious = TRUE;
1922 if (r_ptr->flagsr & RFR_RES_ALL)
1925 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1927 note = " is immune.";
1930 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1933 if (r_ptr->flagsr & RFR_IM_POIS)
1936 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1938 note = " resists a lot.";
1942 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1950 if (seen) obvious = TRUE;
1952 if (r_ptr->flagsr & RFR_RES_ALL)
1955 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1957 note = " is immune.";
1960 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1963 if (r_ptr->flagsr & RFR_IM_POIS)
1966 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
1971 dam *= 3; dam /= randint1(6) + 6;
1972 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1974 else if (one_in_(3)) do_poly = TRUE;
1978 /* Hellfire -- hurts Evil */
1981 if (seen) obvious = TRUE;
1983 if (r_ptr->flagsr & RFR_RES_ALL)
1986 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1988 note = " is immune.";
1991 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1994 if (r_ptr->flags3 & RF3_GOOD)
1998 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2000 note = " is hit hard.";
2003 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
2008 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2011 if (seen) obvious = TRUE;
2013 if (r_ptr->flagsr & RFR_RES_ALL)
2016 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2018 note = " is immune.";
2021 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2024 if (r_ptr->flags3 & RF3_GOOD)
2028 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2030 note = " is immune.";
2033 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
2035 else if (r_ptr->flags3 & RF3_EVIL)
2039 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2041 note = " is hit hard.";
2044 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
2049 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2054 dam *= 3; dam /= randint1(6) + 6;
2059 /* Arrow -- XXX no defense */
2062 if (seen) obvious = TRUE;
2064 if (r_ptr->flagsr & RFR_RES_ALL)
2067 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2069 note = " is immune.";
2072 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2078 /* Plasma -- XXX perhaps check ELEC or FIRE */
2081 if (seen) obvious = TRUE;
2083 if (r_ptr->flagsr & RFR_RES_ALL)
2086 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2088 note = " is immune.";
2091 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2094 if (r_ptr->flagsr & RFR_RES_PLAS)
2097 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2102 dam *= 3; dam /= randint1(6) + 6;
2103 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
2108 /* Nether -- see above */
2111 if (seen) obvious = TRUE;
2113 if (r_ptr->flagsr & RFR_RES_ALL)
2116 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2118 note = " is immune.";
2121 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2124 if (r_ptr->flagsr & RFR_RES_NETH)
2126 if (r_ptr->flags3 & RF3_UNDEAD)
2129 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2131 note = " is immune.";
2135 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2140 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2145 dam *= 3; dam /= randint1(6) + 6;
2147 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
2149 else if (r_ptr->flags3 & RF3_EVIL)
2153 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2155 note = " resists somewhat.";
2158 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2163 /* Water (acid) damage -- Water spirits/elementals are immune */
2166 if (seen) obvious = TRUE;
2168 if (r_ptr->flagsr & RFR_RES_ALL)
2171 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2173 note = " is immune.";
2176 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2179 if (r_ptr->flagsr & RFR_RES_WATE)
2181 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
2184 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2186 note = " is immune.";
2194 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2199 dam *= 3; dam /= randint1(6) + 6;
2201 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
2206 /* Chaos -- Chaos breathers resist */
2209 if (seen) obvious = TRUE;
2211 if (r_ptr->flagsr & RFR_RES_ALL)
2214 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2216 note = " is immune.";
2219 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2222 if (r_ptr->flagsr & RFR_RES_CHAO)
2225 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2230 dam *= 3; dam /= randint1(6) + 6;
2231 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
2233 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
2236 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2238 note = " resists somewhat.";
2241 dam *= 3; dam /= randint1(6) + 6;
2242 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2247 do_conf = (5 + randint1(11) + r) / (r + 1);
2252 /* Shards -- Shard breathers resist */
2255 if (seen) obvious = TRUE;
2257 if (r_ptr->flagsr & RFR_RES_ALL)
2260 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2262 note = " is immune.";
2265 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2268 if (r_ptr->flagsr & RFR_RES_SHAR)
2271 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2276 dam *= 3; dam /= randint1(6) + 6;
2277 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2282 /* Rocket: Shard resistance helps */
2285 if (seen) obvious = TRUE;
2287 if (r_ptr->flagsr & RFR_RES_ALL)
2290 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2292 note = " is immune.";
2295 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2298 if (r_ptr->flagsr & RFR_RES_SHAR)
2301 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2303 note = " resists somewhat.";
2307 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2313 /* Sound -- Sound breathers resist */
2316 if (seen) obvious = TRUE;
2318 if (r_ptr->flagsr & RFR_RES_ALL)
2321 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2323 note = " is immune.";
2326 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2329 if (r_ptr->flagsr & RFR_RES_SOUN)
2332 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2337 dam *= 2; dam /= randint1(6) + 6;
2338 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
2340 else do_stun = (10 + randint1(15) + r) / (r + 1);
2347 if (seen) obvious = TRUE;
2349 if (r_ptr->flagsr & RFR_RES_ALL)
2352 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2354 note = " is immune.";
2357 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2360 if (r_ptr->flags3 & RF3_NO_CONF)
2363 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2368 dam *= 3; dam /= randint1(6) + 6;
2369 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2371 else do_conf = (10 + randint1(15) + r) / (r + 1);
2375 /* Disenchantment -- Breathers and Disenchanters resist */
2378 if (seen) obvious = TRUE;
2380 if (r_ptr->flagsr & RFR_RES_ALL)
2383 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2385 note = " is immune.";
2388 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2391 if (r_ptr->flagsr & RFR_RES_DISE)
2394 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2399 dam *= 3; dam /= randint1(6) + 6;
2400 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
2405 /* Nexus -- Breathers and Existers resist */
2408 if (seen) obvious = TRUE;
2410 if (r_ptr->flagsr & RFR_RES_ALL)
2413 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2415 note = " is immune.";
2418 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2421 if (r_ptr->flagsr & RFR_RES_NEXU)
2424 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2429 dam *= 3; dam /= randint1(6) + 6;
2430 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
2438 if (seen) obvious = TRUE;
2440 if (r_ptr->flagsr & RFR_RES_ALL)
2443 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2445 note = " is immune.";
2448 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2451 if (r_ptr->flagsr & RFR_RES_WALL)
2454 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2459 dam *= 3; dam /= randint1(6) + 6;
2460 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
2462 else do_stun = (randint1(15) + r) / (r + 1);
2466 /* Inertia -- breathers resist */
2469 if (seen) obvious = TRUE;
2471 if (r_ptr->flagsr & RFR_RES_ALL)
2474 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2476 note = " is immune.";
2479 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2482 if (r_ptr->flagsr & RFR_RES_INER)
2485 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2490 dam *= 3; dam /= randint1(6) + 6;
2491 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
2495 /* Powerful monsters can resist */
2496 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2497 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2501 /* Normal monsters slow down */
2507 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2509 note = " starts moving slower.";
2512 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2513 if (c_ptr->m_idx == p_ptr->riding)
2514 p_ptr->update |= (PU_BONUS);
2520 /* Time -- breathers resist */
2523 if (seen) obvious = TRUE;
2525 if (r_ptr->flagsr & RFR_RES_ALL)
2528 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2530 note = " is immune.";
2533 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2536 if (r_ptr->flagsr & RFR_RES_TIME)
2539 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2544 dam *= 3; dam /= randint1(6) + 6;
2545 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
2547 else do_time = (dam + 1) / 2;
2551 /* Gravity -- breathers resist */
2554 bool resist_tele = FALSE;
2556 if (seen) obvious = TRUE;
2558 if (r_ptr->flagsr & RFR_RES_ALL)
2561 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2563 note = " is immune.";
2566 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2569 if (r_ptr->flagsr & RFR_RES_TELE)
2571 if (r_ptr->flags1 & (RF1_UNIQUE))
2573 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2575 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2577 note = " is unaffected!";
2582 else if (r_ptr->level > randint1(100))
2584 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2586 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2595 if (!resist_tele) do_dist = 10;
2597 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2599 if (r_ptr->flagsr & RFR_RES_GRAV)
2602 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2607 dam *= 3; dam /= randint1(6) + 6;
2609 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
2614 /* Powerful monsters can resist */
2615 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2616 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2620 /* Normal monsters slow down */
2626 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2628 note = " starts moving slower.";
2631 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2632 if (c_ptr->m_idx == p_ptr->riding)
2633 p_ptr->update |= (PU_BONUS);
2637 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2639 /* Attempt a saving throw */
2640 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2641 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2645 /* No obvious effect */
2647 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2649 note = " is unaffected!";
2663 if (seen) obvious = TRUE;
2665 if (r_ptr->flagsr & RFR_RES_ALL)
2668 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2670 note = " is immune.";
2673 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2681 case GF_DISINTEGRATE:
2683 if (seen) obvious = TRUE;
2685 if (r_ptr->flagsr & RFR_RES_ALL)
2688 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2690 note = " is immune.";
2693 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2696 if (r_ptr->flags3 & RF3_HURT_ROCK)
2698 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2700 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2701 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2703 note = " loses some skin!";
2704 note_dies = " evaporates!";
2714 if (seen) obvious = TRUE;
2716 /* PSI only works if the monster can see you! -- RG */
2717 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2720 if (seen) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name);
2722 if (seen) msg_format("%^s can't see you, and isn't affected!", m_name);
2728 if (r_ptr->flagsr & RFR_RES_ALL)
2731 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2733 note = " is immune.";
2736 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2739 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2743 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2745 note = " is immune!";
2747 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2750 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2751 (r_ptr->flags3 & RF3_ANIMAL) ||
2752 (r_ptr->level > randint1(3 * dam)))
2756 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2763 * Powerful demons & undead can turn a mindcrafter's
2764 * attacks back on them
2766 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2767 (r_ptr->level > p_ptr->lev / 2) &&
2772 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2774 msg_format("%^s%s corrupted mind backlashes your attack!",
2775 m_name, (seen ? "'s" : "s"));
2779 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2782 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2784 msg_print("You resist the effects!");
2790 /* Injure +/- confusion */
2791 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2792 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2795 switch (randint1(4))
2798 set_confused(p_ptr->confused + 3 + randint1(dam));
2801 set_stun(p_ptr->stun + randint1(dam));
2805 if (r_ptr->flags3 & RF3_NO_FEAR)
2807 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2809 note = " is unaffected.";
2813 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2817 if (!p_ptr->free_act)
2818 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2827 if ((dam > 0) && one_in_(4))
2829 switch (randint1(4))
2832 do_conf = 3 + randint1(dam);
2835 do_stun = 3 + randint1(dam);
2838 do_fear = 3 + randint1(dam);
2842 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2844 note = " falls asleep!";
2847 do_sleep = 3 + randint1(dam);
2853 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2855 note_dies = " collapses, a mindless husk.";
2863 if (seen) obvious = TRUE;
2865 if (r_ptr->flagsr & RFR_RES_ALL)
2868 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2870 note = " is immune.";
2873 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2876 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2880 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2882 note = " is immune!";
2886 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2887 (r_ptr->flags3 & RF3_ANIMAL) ||
2888 (r_ptr->level > randint1(3 * dam)))
2892 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2899 * Powerful demons & undead can turn a mindcrafter's
2900 * attacks back on them
2902 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2903 (r_ptr->level > p_ptr->lev / 2) &&
2908 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2910 msg_format("%^s%s corrupted mind backlashes your attack!",
2911 m_name, (seen ? "'s" : "s"));
2915 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2918 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2920 msg_print("You resist the effects!");
2926 /* Injure + mana drain */
2927 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2929 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
2931 msg_print("Your psychic energy is drained!");
2934 p_ptr->csp -= damroll(5, dam) / 2;
2935 if (p_ptr->csp < 0) p_ptr->csp = 0;
2936 p_ptr->redraw |= PR_MANA;
2937 p_ptr->window |= (PW_SPELL);
2938 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2945 int b = damroll(5, dam) / 4;
2947 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª", m_name);
2949 msg_format("You convert %s%s pain into psychic energy!",
2950 m_name, (seen ? "'s" : "s"));
2953 b = MIN(p_ptr->msp, p_ptr->csp + b);
2955 p_ptr->redraw |= PR_MANA;
2956 p_ptr->window |= (PW_SPELL);
2960 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2962 note_dies = " collapses, a mindless husk.";
2968 case GF_TELEKINESIS:
2970 if (seen) obvious = TRUE;
2972 if (r_ptr->flagsr & RFR_RES_ALL)
2975 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2977 note = " is immune.";
2980 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2985 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2990 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2992 /* Attempt a saving throw */
2993 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2994 (r_ptr->level > 5 + randint1(dam)))
2998 /* No obvious effect */
3004 /* Psycho-spear -- powerful magic missile */
3007 if (seen) obvious = TRUE;
3009 if (r_ptr->flagsr & RFR_RES_ALL)
3012 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3014 note = " is immune.";
3017 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3023 /* Meteor -- powerful magic missile */
3026 if (seen) obvious = TRUE;
3028 if (r_ptr->flagsr & RFR_RES_ALL)
3031 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3033 note = " is immune.";
3036 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3044 if (!is_hostile(m_ptr)) break;
3046 if (seen) obvious = TRUE;
3048 if (r_ptr->flagsr & RFR_RES_ALL)
3051 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3053 note = " is immune.";
3056 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3059 /* Attempt a saving throw */
3060 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
3061 (r_ptr->flags3 & RF3_NO_CONF) ||
3062 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3064 /* Memorize a flag */
3065 if (r_ptr->flags3 & RF3_NO_CONF)
3067 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3074 * Powerful demons & undead can turn a mindcrafter's
3075 * attacks back on them
3077 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
3078 (r_ptr->level > p_ptr->lev / 2) &&
3083 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
3085 msg_format("%^s%s corrupted mind backlashes your attack!",
3086 m_name, (seen ? "'s" : "s"));
3090 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3093 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3095 msg_print("You resist the effects!");
3101 /* Confuse, stun, terrify */
3102 switch (randint1(4))
3105 set_stun(p_ptr->stun + dam / 2);
3108 set_confused(p_ptr->confused + dam / 2);
3112 if (r_ptr->flags3 & RF3_NO_FEAR)
3114 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3116 note = " is unaffected.";
3120 set_afraid(p_ptr->afraid + dam);
3127 /* No obvious effect */
3129 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3131 note = " is unaffected!";
3139 if ((dam > 29) && (randint1(100) < dam))
3142 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3144 note = " is in your thrall!";
3151 switch (randint1(4))
3165 /* No "real" damage */
3172 /* Ice -- Cold + Cuts + Stun */
3175 if (seen) obvious = TRUE;
3177 if (r_ptr->flagsr & RFR_RES_ALL)
3180 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3182 note = " is immune.";
3185 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3188 do_stun = (randint1(15) + 1) / (r + 1);
3189 if (r_ptr->flagsr & RFR_IM_COLD)
3192 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3194 note = " resists a lot.";
3198 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
3200 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3203 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3205 note = " is hit hard.";
3209 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3218 if (seen) obvious = TRUE;
3220 if (r_ptr->flagsr & RFR_RES_ALL)
3223 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3225 note = " is immune.";
3228 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3231 if (!monster_living(r_ptr))
3235 if (is_original_ap(m_ptr))
3237 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3238 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3239 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3244 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3246 note = " is unaffected!";
3252 else do_time = (dam+7)/8;
3260 if (seen) obvious = TRUE;
3262 if (r_ptr->flagsr & RFR_RES_ALL)
3265 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3267 note = " is immune.";
3270 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3273 if (!monster_living(r_ptr))
3277 if (is_original_ap(m_ptr))
3279 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3280 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3281 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3286 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3288 note = " is immune.";
3294 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3295 (randint1(888) != 666)) ||
3296 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
3297 randint1(100) != 66))
3300 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3312 /* Polymorph monster (Use "dam" as "power") */
3315 if (seen) obvious = TRUE;
3317 if (r_ptr->flagsr & RFR_RES_ALL)
3320 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3322 note = " is immune.";
3325 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3328 /* Attempt to polymorph (see below) */
3331 /* Powerful monsters can resist */
3332 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3333 (r_ptr->flags1 & RF1_QUESTOR) ||
3334 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3337 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3339 note = " is unaffected!";
3346 /* No "real" damage */
3353 /* Clone monsters (Ignore "dam") */
3356 if (seen) obvious = TRUE;
3358 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
3361 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3363 note = " is unaffected!";
3369 m_ptr->hp = m_ptr->maxhp;
3371 /* Attempt to clone. */
3372 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3375 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3383 /* No "real" damage */
3390 /* Heal Monster (use "dam" as amount of healing) */
3393 if (seen) obvious = TRUE;
3398 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3400 if (m_ptr->maxhp < m_ptr->max_maxhp)
3403 msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3405 msg_format("%^s recovers %s vitality.", m_name, m_poss);
3407 m_ptr->maxhp = m_ptr->max_maxhp;
3413 if (seen) obvious = TRUE;
3418 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3423 msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3425 msg_format("%^s is no longer stunned.", m_name);
3429 if (m_ptr->confused)
3432 msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3434 msg_format("%^s is no longer confused.", m_name);
3436 m_ptr->confused = 0;
3441 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3443 msg_format("%^s recovers %s courage.", m_name, m_poss);
3449 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3452 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3454 chg_virtue(V_VITALITY, 1);
3456 if (r_ptr->flags1 & RF1_UNIQUE)
3457 chg_virtue(V_INDIVIDUALISM, 1);
3459 if (is_friendly(m_ptr))
3460 chg_virtue(V_HONOUR, 1);
3461 else if (!(r_ptr->flags3 & RF3_EVIL))
3463 if (r_ptr->flags3 & RF3_GOOD)
3464 chg_virtue(V_COMPASSION, 2);
3466 chg_virtue(V_COMPASSION, 1);
3469 if (m_ptr->r_idx == MON_LEPER)
3472 chg_virtue(V_COMPASSION, 5);
3475 if (r_ptr->flags3 & RF3_ANIMAL)
3476 chg_virtue(V_NATURE, 1);
3478 /* Redraw (later) if needed */
3479 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3480 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3484 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3486 note = " looks healthier.";
3490 /* No "real" damage */
3496 /* Speed Monster (Ignore "dam") */
3499 if (seen) obvious = TRUE;
3505 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3507 note = " starts moving faster.";
3510 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3512 if (c_ptr->m_idx == p_ptr->riding)
3513 p_ptr->update |= (PU_BONUS);
3515 if (r_ptr->flags1 & RF1_UNIQUE)
3516 chg_virtue(V_INDIVIDUALISM, 1);
3517 if (is_friendly(m_ptr))
3518 chg_virtue(V_HONOUR, 1);
3520 /* No "real" damage */
3526 /* Slow Monster (Use "dam" as "power") */
3529 if (seen) obvious = TRUE;
3531 if (r_ptr->flagsr & RFR_RES_ALL)
3534 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3536 note = " is immune.";
3539 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3542 /* Powerful monsters can resist */
3543 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3544 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3547 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3549 note = " is unaffected!";
3555 /* Normal monsters slow down */
3561 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3563 note = " starts moving slower.";
3566 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3568 if (c_ptr->m_idx == p_ptr->riding)
3569 p_ptr->update |= (PU_BONUS);
3572 /* No "real" damage */
3578 /* Sleep (Use "dam" as "power") */
3581 if (seen) obvious = TRUE;
3583 if (r_ptr->flagsr & RFR_RES_ALL)
3586 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3588 note = " is immune.";
3591 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3594 /* Attempt a saving throw */
3595 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3596 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3597 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3599 /* Memorize a flag */
3600 if (r_ptr->flags3 & RF3_NO_SLEEP)
3602 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3605 /* No obvious effect */
3607 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3609 note = " is unaffected!";
3616 /* Go to sleep (much) later */
3618 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3620 note = " falls asleep!";
3626 /* No "real" damage */
3632 /* Sleep (Use "dam" as "power") */
3633 case GF_STASIS_EVIL:
3635 if (seen) obvious = TRUE;
3637 if (r_ptr->flagsr & RFR_RES_ALL)
3640 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3642 note = " is immune.";
3645 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3648 /* Attempt a saving throw */
3649 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3650 !(r_ptr->flags3 & RF3_EVIL) ||
3651 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3654 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3656 note = " is unaffected!";
3663 /* Go to sleep (much) later */
3665 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3667 note = " is suspended!";
3673 /* No "real" damage */
3678 /* Sleep (Use "dam" as "power") */
3681 if (seen) obvious = TRUE;
3683 if (r_ptr->flagsr & RFR_RES_ALL)
3686 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3688 note = " is immune.";
3691 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3694 /* Attempt a saving throw */
3695 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3696 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3699 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3701 note = " is unaffected!";
3708 /* Go to sleep (much) later */
3710 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3712 note = " is suspended!";
3718 /* No "real" damage */
3727 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3728 vir = virtue_number(V_HARMONY);
3731 dam += p_ptr->virtues[vir-1]/10;
3734 vir = virtue_number(V_INDIVIDUALISM);
3737 dam -= p_ptr->virtues[vir-1]/20;
3740 if (seen) obvious = TRUE;
3742 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3745 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3747 note = " is immune.";
3750 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3754 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3757 /* Attempt a saving throw */
3758 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3759 (r_ptr->flags3 & RF3_NO_CONF) ||
3760 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3761 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3763 /* Memorize a flag */
3764 if (r_ptr->flags3 & RF3_NO_CONF)
3766 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3770 /* No obvious effect */
3772 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3774 note = " is unaffected!";
3779 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3781 else if (p_ptr->cursed & TRC_AGGRAVATE)
3784 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3786 note = " hates you too much!";
3789 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3794 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3796 note = " suddenly seems friendly!";
3801 chg_virtue(V_INDIVIDUALISM, -1);
3802 if (r_ptr->flags3 & RF3_ANIMAL)
3803 chg_virtue(V_NATURE, 1);
3806 /* No "real" damage */
3811 /* Control undead */
3812 case GF_CONTROL_UNDEAD:
3815 if (seen) obvious = TRUE;
3817 vir = virtue_number(V_UNLIFE);
3820 dam += p_ptr->virtues[vir-1]/10;
3823 vir = virtue_number(V_INDIVIDUALISM);
3826 dam -= p_ptr->virtues[vir-1]/20;
3829 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3832 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3834 note = " is immune.";
3837 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3841 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3844 /* Attempt a saving throw */
3845 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3846 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3847 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3848 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3850 /* No obvious effect */
3852 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3854 note = " is unaffected!";
3858 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3860 else if (p_ptr->cursed & TRC_AGGRAVATE)
3863 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3865 note = " hates you too much!";
3868 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3873 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3875 note = " is in your thrall!";
3881 /* No "real" damage */
3887 case GF_CONTROL_DEMON:
3890 if (seen) obvious = TRUE;
3892 vir = virtue_number(V_UNLIFE);
3895 dam += p_ptr->virtues[vir-1]/10;
3898 vir = virtue_number(V_INDIVIDUALISM);
3901 dam -= p_ptr->virtues[vir-1]/20;
3904 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3907 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3909 note = " is immune.";
3912 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3916 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3919 /* Attempt a saving throw */
3920 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3921 (!(r_ptr->flags3 & RF3_DEMON)) ||
3922 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3923 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3925 /* No obvious effect */
3927 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3929 note = " is unaffected!";
3933 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3935 else if (p_ptr->cursed & TRC_AGGRAVATE)
3938 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3940 note = " hates you too much!";
3943 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3948 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3950 note = " is in your thrall!";
3956 /* No "real" damage */
3962 case GF_CONTROL_ANIMAL:
3966 if (seen) obvious = TRUE;
3968 vir = virtue_number(V_NATURE);
3971 dam += p_ptr->virtues[vir-1]/10;
3974 vir = virtue_number(V_INDIVIDUALISM);
3977 dam -= p_ptr->virtues[vir-1]/20;
3980 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3983 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3985 note = " is immune.";
3988 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3992 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3995 /* Attempt a saving throw */
3996 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3997 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
3998 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3999 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4000 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4002 /* Memorize a flag */
4003 if (r_ptr->flags3 & (RF3_NO_CONF))
4005 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4009 /* No obvious effect */
4011 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4013 note = " is unaffected!";
4017 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4019 else if (p_ptr->cursed & TRC_AGGRAVATE)
4022 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4024 note = " hates you too much!";
4027 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4032 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4034 note = " is tamed!";
4039 if (r_ptr->flags3 & RF3_ANIMAL)
4040 chg_virtue(V_NATURE, 1);
4043 /* No "real" damage */
4049 case GF_CONTROL_LIVING:
4053 vir = virtue_number(V_UNLIFE);
4054 if (seen) obvious = TRUE;
4056 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4057 vir = virtue_number(V_UNLIFE);
4060 dam -= p_ptr->virtues[vir-1]/10;
4063 vir = virtue_number(V_INDIVIDUALISM);
4066 dam -= p_ptr->virtues[vir-1]/20;
4069 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4070 if (dam < 1) dam = 1;
4072 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4074 msg_format("You stare into %s.", m_name);
4076 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4079 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4081 note = " is immune.";
4084 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4088 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4091 /* Attempt a saving throw */
4092 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4093 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4094 !monster_living(r_ptr) ||
4095 ((r_ptr->level+10) > randint1(dam)))
4098 /* No obvious effect */
4100 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4102 note = " is unaffected!";
4106 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4108 else if (p_ptr->cursed & TRC_AGGRAVATE)
4111 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4113 note = " hates you too much!";
4116 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4121 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4123 note = " is tamed!";
4128 if (r_ptr->flags3 & RF3_ANIMAL)
4129 chg_virtue(V_NATURE, 1);
4132 /* No "real" damage */
4137 /* Confusion (Use "dam" as "power") */
4140 if (seen) obvious = TRUE;
4142 if (r_ptr->flagsr & RFR_RES_ALL)
4145 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4147 note = " is immune.";
4150 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4153 /* Get confused later */
4154 do_conf = damroll(3, (dam / 2)) + 1;
4156 /* Attempt a saving throw */
4157 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4158 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4159 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4161 /* Memorize a flag */
4162 if (r_ptr->flags3 & (RF3_NO_CONF))
4164 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4170 /* No obvious effect */
4172 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4174 note = " is unaffected!";
4180 /* No "real" damage */
4187 if (seen) obvious = TRUE;
4189 if (r_ptr->flagsr & RFR_RES_ALL)
4192 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4194 note = " is immune.";
4197 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4200 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
4202 /* Attempt a saving throw */
4203 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4204 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4209 /* No obvious effect */
4211 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4213 note = " is unaffected!";
4219 /* No "real" damage */
4227 /* Lite, but only hurts susceptible creatures */
4235 if (r_ptr->flagsr & RFR_RES_ALL)
4241 if (r_ptr->flags3 & (RF3_HURT_LITE))
4245 /* Obvious effect */
4248 /* Memorize the effects */
4249 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4252 /* Special effect */
4254 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4255 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4257 note = " cringes from the light!";
4258 note_dies = " shrivels away in the light!";
4263 /* Normally no damage */
4275 /* Lite -- opposite of Dark */
4278 if (seen) obvious = TRUE;
4280 if (r_ptr->flagsr & RFR_RES_ALL)
4283 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4285 note = " is immune.";
4288 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4291 if (r_ptr->flagsr & RFR_RES_LITE)
4294 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4299 dam *= 2; dam /= (randint1(6)+6);
4300 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4302 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4304 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4306 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4307 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4309 note = " cringes from the light!";
4310 note_dies = " shrivels away in the light!";
4319 /* Dark -- opposite of Lite */
4322 if (seen) obvious = TRUE;
4324 if (r_ptr->flagsr & RFR_RES_ALL)
4327 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4329 note = " is immune.";
4332 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4335 if (r_ptr->flagsr & RFR_RES_DARK)
4338 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4343 dam *= 2; dam /= (randint1(6)+6);
4344 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4353 if (r_ptr->flagsr & RFR_RES_ALL)
4358 /* Hurt by rock remover */
4359 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4366 /* Memorize the effects */
4367 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4370 /* Cute little message */
4372 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4373 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4375 note = " loses some skin!";
4376 note_dies = " dissolves!";
4381 /* Usually, ignore the effects */
4392 /* Teleport undead (Use "dam" as "power") */
4393 case GF_AWAY_UNDEAD:
4395 /* Only affect undead */
4396 if (r_ptr->flags3 & (RF3_UNDEAD))
4398 bool resists_tele = FALSE;
4400 if (r_ptr->flagsr & RFR_RES_TELE)
4402 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4404 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4406 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4408 note = " is unaffected!";
4411 resists_tele = TRUE;
4413 else if (r_ptr->level > randint1(100))
4415 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4417 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4422 resists_tele = TRUE;
4431 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4444 /* No "real" damage */
4450 /* Teleport evil (Use "dam" as "power") */
4453 /* Only affect evil */
4454 if (r_ptr->flags3 & (RF3_EVIL))
4456 bool resists_tele = FALSE;
4458 if (r_ptr->flagsr & RFR_RES_TELE)
4460 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4462 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4464 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4466 note = " is unaffected!";
4469 resists_tele = TRUE;
4471 else if (r_ptr->level > randint1(100))
4473 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4475 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4480 resists_tele = TRUE;
4489 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4502 /* No "real" damage */
4508 /* Teleport monster (Use "dam" as "power") */
4511 bool resists_tele = FALSE;
4512 if (r_ptr->flagsr & RFR_RES_TELE)
4514 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4516 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4518 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4520 note = " is unaffected!";
4523 resists_tele = TRUE;
4525 else if (r_ptr->level > randint1(100))
4527 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4529 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4534 resists_tele = TRUE;
4541 if (seen) obvious = TRUE;
4543 /* Prepare to teleport */
4547 /* No "real" damage */
4553 /* Turn undead (Use "dam" as "power") */
4554 case GF_TURN_UNDEAD:
4556 if (r_ptr->flagsr & RFR_RES_ALL)
4561 /* Only affect undead */
4562 if (r_ptr->flags3 & (RF3_UNDEAD))
4566 /* Learn about type */
4567 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4573 /* Apply some fear */
4574 do_fear = damroll(3, (dam / 2)) + 1;
4576 /* Attempt a saving throw */
4577 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4579 /* No obvious effect */
4581 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4583 note = " is unaffected!";
4598 /* No "real" damage */
4604 /* Turn evil (Use "dam" as "power") */
4607 if (r_ptr->flagsr & RFR_RES_ALL)
4612 /* Only affect evil */
4613 if (r_ptr->flags3 & (RF3_EVIL))
4617 /* Learn about type */
4618 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4624 /* Apply some fear */
4625 do_fear = damroll(3, (dam / 2)) + 1;
4627 /* Attempt a saving throw */
4628 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4630 /* No obvious effect */
4632 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4634 note = " is unaffected!";
4649 /* No "real" damage */
4655 /* Turn monster (Use "dam" as "power") */
4658 if (r_ptr->flagsr & RFR_RES_ALL)
4664 if (seen) obvious = TRUE;
4666 /* Apply some fear */
4667 do_fear = damroll(3, (dam / 2)) + 1;
4669 /* Attempt a saving throw */
4670 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4671 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4672 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4674 /* No obvious effect */
4676 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4678 note = " is unaffected!";
4685 /* No "real" damage */
4692 case GF_DISP_UNDEAD:
4694 if (r_ptr->flagsr & RFR_RES_ALL)
4700 /* Only affect undead */
4701 if (r_ptr->flags3 & (RF3_UNDEAD))
4705 /* Learn about type */
4706 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4714 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4715 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4717 note = " shudders.";
4718 note_dies = " dissolves!";
4740 if (r_ptr->flagsr & RFR_RES_ALL)
4746 /* Only affect evil */
4747 if (r_ptr->flags3 & (RF3_EVIL))
4751 /* Learn about type */
4752 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4760 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4761 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4763 note = " shudders.";
4764 note_dies = " dissolves!";
4785 if (r_ptr->flagsr & RFR_RES_ALL)
4791 /* Only affect good */
4792 if (r_ptr->flags3 & (RF3_GOOD))
4796 /* Learn about type */
4797 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4805 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4806 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4808 note = " shudders.";
4809 note_dies = " dissolves!";
4828 case GF_DISP_LIVING:
4830 if (r_ptr->flagsr & RFR_RES_ALL)
4836 /* Only affect non-undead */
4837 if (monster_living(r_ptr))
4840 if (seen) obvious = TRUE;
4844 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4845 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4847 note = " shudders.";
4848 note_dies = " dissolves!";
4869 if (r_ptr->flagsr & RFR_RES_ALL)
4875 /* Only affect demons */
4876 if (r_ptr->flags3 & (RF3_DEMON))
4880 /* Learn about type */
4881 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4889 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4890 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4892 note = " shudders.";
4893 note_dies = " dissolves!";
4911 /* Dispel monster */
4914 if (r_ptr->flagsr & RFR_RES_ALL)
4921 if (seen) obvious = TRUE;
4925 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4926 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4928 note = " shudders.";
4929 note_dies = " dissolves!";
4939 if (seen) obvious = TRUE;
4941 if (r_ptr->flagsr & RFR_RES_ALL)
4944 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4946 note = " is immune.";
4949 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4953 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4957 monster_type *caster_ptr = &m_list[who];
4959 /* Heal the monster */
4960 if (caster_ptr->hp < caster_ptr->maxhp)
4963 caster_ptr->hp += 6 * dam;
4964 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
4966 /* Redraw (later) if needed */
4967 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4968 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4970 /* Special message */
4973 /* Get the monster name */
4974 monster_desc(killer, caster_ptr, 0);
4976 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", killer);
4978 msg_format("%^s appears healthier.", killer);
4987 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£", m_name);
4989 msg_format("You draw psychic energy from %s.", m_name);
4992 (void)hp_player(dam);
4998 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
5000 msg_format("%s is unaffected.", m_name);
5010 if (seen) obvious = TRUE;
5013 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5015 if (!who) msg_format("You gaze intently at %s.", m_name);
5018 if (r_ptr->flagsr & RFR_RES_ALL)
5021 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5023 note = " is immune.";
5026 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5030 /* Attempt a saving throw */
5031 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5032 (r_ptr->flags3 & RF3_NO_CONF) ||
5033 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5035 /* Memorize a flag */
5036 if (r_ptr->flags3 & (RF3_NO_CONF))
5038 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5041 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5043 note = "is unaffected!";
5047 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5049 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5051 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5053 note = " is immune!";
5057 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5059 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5061 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5070 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5071 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5073 note = " is blasted by psionic energy.";
5074 note_dies = " collapses, a mindless husk.";
5077 if (who > 0) do_conf = randint0(4) + 4;
5078 else do_conf = randint0(8) + 8;
5084 case GF_BRAIN_SMASH:
5086 if (seen) obvious = TRUE;
5089 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5091 if (!who) msg_format("You gaze intently at %s.", m_name);
5094 if (r_ptr->flagsr & RFR_RES_ALL)
5097 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5099 note = " is immune.";
5102 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5106 /* Attempt a saving throw */
5107 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5108 (r_ptr->flags3 & RF3_NO_CONF) ||
5109 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5111 /* Memorize a flag */
5112 if (r_ptr->flags3 & (RF3_NO_CONF))
5114 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5117 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5119 note = "is unaffected!";
5123 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5125 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5127 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5129 note = " is immune!";
5133 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5135 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5137 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5146 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5147 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5149 note = " is blasted by psionic energy.";
5150 note_dies = " collapses, a mindless husk.";
5155 do_conf = randint0(4) + 4;
5156 do_stun = randint0(4) + 4;
5160 do_conf = randint0(8) + 8;
5161 do_stun = randint0(8) + 8;
5163 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5164 if (c_ptr->m_idx == p_ptr->riding)
5165 p_ptr->update |= (PU_BONUS);
5173 if (seen) obvious = TRUE;
5176 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5178 if (!who) msg_format("You point at %s and curses.", m_name);
5181 if (r_ptr->flagsr & RFR_RES_ALL)
5184 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5186 note = " is immune.";
5189 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5193 /* Attempt a saving throw */
5194 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5197 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5199 note = "is unaffected!";
5209 if (seen) obvious = TRUE;
5212 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5214 if (!who) msg_format("You point at %s and curses horribly.", m_name);
5217 if (r_ptr->flagsr & RFR_RES_ALL)
5220 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5222 note = " is immune.";
5225 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5229 /* Attempt a saving throw */
5230 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5233 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5235 note = "is unaffected!";
5245 if (seen) obvious = TRUE;
5248 if (!who) msg_format("%s¤ò»Øº¹¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
5250 if (!who) msg_format("You point at %s, incanting terribly!", m_name);
5253 if (r_ptr->flagsr & RFR_RES_ALL)
5256 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5258 note = " is immune.";
5261 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5265 /* Attempt a saving throw */
5266 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5269 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5271 note = "is unaffected!";
5281 if (seen) obvious = TRUE;
5284 if (!who) msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
5286 if (!who) msg_format("You point at %s, screaming the word, 'DIE!'.", m_name);
5289 if (r_ptr->flagsr & RFR_RES_ALL)
5292 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5294 note = " is immune.";
5297 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5301 /* Attempt a saving throw */
5302 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (m_list[who].r_idx != MON_KENSHIROU)))
5305 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5307 note = "is unaffected!";
5317 if (seen) obvious = TRUE;
5319 if (r_ptr->flagsr & RFR_RES_ALL)
5322 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5324 note = " is immune.";
5327 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5331 if (r_ptr->flags1 & RF1_UNIQUE)
5334 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5336 note = "is unaffected!";
5342 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
5343 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
5345 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5347 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5352 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5362 /* Capture monster */
5366 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5367 (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)
5370 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5372 msg_format("%^s is unaffected.", m_name);
5378 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5379 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5380 nokori_hp = m_ptr->maxhp * 3 / 10;
5382 nokori_hp = m_ptr->maxhp * 3 / 20;
5384 if (m_ptr->hp >= nokori_hp)
5387 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5389 msg_format("You need to weaken %s more.", m_name);
5393 else if (m_ptr->hp < randint0(nokori_hp))
5395 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5397 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5399 msg_format("You capture %^s!", m_name);
5401 cap_mon = m_list[c_ptr->m_idx].r_idx;
5402 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5403 cap_hp = m_list[c_ptr->m_idx].hp;
5404 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5405 if (m_list[c_ptr->m_idx].nickname)
5406 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5409 if (c_ptr->m_idx == p_ptr->riding)
5411 if (rakuba(-1, FALSE))
5414 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5416 msg_format("You have fallen from %s.", m_name);
5421 delete_monster_idx(c_ptr->m_idx);
5428 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5430 msg_format("You failed to capture %s.", m_name);
5437 /* Attack (Use "dam" as attack type) */
5440 /* Return this monster's death */
5441 return py_attack(y, x, dam);
5444 /* Sleep (Use "dam" as "power") */
5450 if (seen) obvious = TRUE;
5452 if (r_ptr->flagsr & RFR_RES_ALL)
5455 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5457 note = " is immune.";
5460 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5463 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5466 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5468 note = " is immune!";
5472 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5478 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5480 note = " is immune!";
5487 if (one_in_(5)) effect = 1;
5488 else if (one_in_(4)) effect = 2;
5489 else if (one_in_(3)) effect = 3;
5494 /* Powerful monsters can resist */
5495 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5496 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5499 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5501 note = " is unaffected!";
5507 /* Normal monsters slow down */
5513 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5515 note = " starts moving slower.";
5518 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5520 if (c_ptr->m_idx == p_ptr->riding)
5521 p_ptr->update |= (PU_BONUS);
5525 else if (effect == 2)
5527 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5529 /* Attempt a saving throw */
5530 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5531 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5536 /* No obvious effect */
5538 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5540 note = " is unaffected!";
5547 else if (effect == 3)
5549 /* Attempt a saving throw */
5550 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5551 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5552 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5554 /* Memorize a flag */
5555 if (r_ptr->flags3 & RF3_NO_SLEEP)
5557 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5560 /* No obvious effect */
5562 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5564 note = " is unaffected!";
5571 /* Go to sleep (much) later */
5573 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5575 note = " falls asleep!";
5585 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5587 note = " is immune!";
5591 /* No "real" damage */
5600 if (seen) obvious = TRUE;
5602 if (r_ptr->flagsr & RFR_RES_ALL)
5605 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5607 note = " is immune.";
5610 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5614 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (c_ptr->m_idx == p_ptr->riding)) || p_ptr->inside_arena || p_ptr->inside_quest)
5621 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG2_NOGENO))
5628 delete_monster_idx(c_ptr->m_idx);
5630 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5632 msg_format("%^s disappered!",m_name);
5636 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5638 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5642 chg_virtue(V_VITALITY, -1);
5647 p_ptr->redraw |= (PR_HP);
5650 p_ptr->window |= (PW_PLAYER);
5657 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5659 note = "is unaffected!";
5662 if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
5670 if (!who) msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£", m_name);
5672 if (!who) msg_format("You take a photograph of %s.", m_name);
5675 if (r_ptr->flags3 & (RF3_HURT_LITE))
5679 /* Obvious effect */
5682 /* Memorize the effects */
5683 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5686 /* Special effect */
5688 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5689 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5691 note = " cringes from the light!";
5692 note_dies = " shrivels away in the light!";
5697 /* Normally no damage */
5704 photo = m_ptr->r_idx;
5711 case GF_BLOOD_CURSE:
5713 if (seen) obvious = TRUE;
5715 if (r_ptr->flagsr & RFR_RES_ALL)
5718 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5720 note = " is immune.";
5723 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5731 bool success = FALSE;
5732 if (seen) obvious = TRUE;
5734 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5736 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5737 if (dam < 1) dam = 1;
5739 /* No need to tame your pet */
5743 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5745 note = " starts moving faster.";
5748 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5752 /* Attempt a saving throw */
5753 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5754 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5755 (m_ptr->mflag2 & MFLAG2_NOPET) ||
5756 (p_ptr->cursed & TRC_AGGRAVATE) ||
5757 ((r_ptr->level+10) > randint1(dam)))
5760 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5765 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5767 note = " is tamed!";
5771 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5773 /* Learn about type */
5774 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5781 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5783 do_fear = randint1(90)+10;
5787 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5791 /* No "real" damage */
5798 if (seen) obvious = TRUE;
5800 if (r_ptr->flagsr & RFR_RES_ALL)
5803 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5805 note = " is immune.";
5808 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5812 /* Attempt a saving throw */
5813 if (randint0(100 + dam) < (r_ptr->level + 50))
5817 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5819 note = "is unaffected!";
5840 /* Absolutely no effect */
5841 if (skipped) return (FALSE);
5843 /* "Unique" monsters cannot be polymorphed */
5844 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5846 /* Quest monsters cannot be polymorphed */
5847 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5849 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5851 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5852 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
5854 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5859 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5860 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5863 /* Modify the damage */
5865 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5867 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤¡£";
5869 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5872 /* Check for death */
5873 if (dam > m_ptr->hp)
5875 /* Extract method of death */
5879 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5880 else if (do_poly && (randint1(90) > r_ptr->level))
5882 if (polymorph_monster(y, x))
5885 if (seen) obvious = TRUE;
5887 /* Monster polymorphs */
5889 note = "¤¬ÊѿȤ·¤¿¡ª";
5895 /* Turn off the damage */
5898 /* Hack -- Get new monster */
5899 m_ptr = &m_list[c_ptr->m_idx];
5901 /* Hack -- Get new race */
5902 r_ptr = &r_info[m_ptr->r_idx];
5908 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5910 note = " is unaffected!";
5916 /* Handle "teleport" */
5920 if (seen) obvious = TRUE;
5924 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5926 note = " disappears!";
5929 chg_virtue(V_VALOUR, -1);
5932 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who), TRUE);
5934 /* Hack -- get new location */
5938 /* Hack -- get new grid */
5939 c_ptr = &cave[y][x];
5942 /* Sound and Impact resisters never stun */
5944 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5945 !(r_ptr->flags3 & RF3_NO_STUN))
5948 if (seen) obvious = TRUE;
5954 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5956 note = " is more dazed.";
5959 tmp = m_ptr->stunned + (do_stun / 2);
5964 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5966 note = " is dazed.";
5973 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5979 /* Confusion and Chaos resisters (and sleepers) never confuse */
5981 !(r_ptr->flags3 & RF3_NO_CONF) &&
5982 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
5985 if (seen) obvious = TRUE;
5987 /* Already partially confused */
5988 if (m_ptr->confused)
5991 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5993 note = " looks more confused.";
5996 tmp = m_ptr->confused + (do_conf / 2);
5999 /* Was not confused */
6003 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
6005 note = " looks confused.";
6011 /* Apply confusion */
6012 m_ptr->confused = (tmp < 200) ? tmp : 200;
6021 if (seen) obvious = TRUE;
6023 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
6028 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
6030 note = " seems weakened.";
6032 m_ptr->maxhp -= do_time;
6033 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
6043 tmp = m_ptr->monfear + do_fear;
6046 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6053 if (typ == GF_DRAIN_MANA)
6055 /* Drain mana does nothing */
6058 /* If another monster did the damage, hurt the monster by hand */
6061 /* Redraw (later) if needed */
6062 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6063 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6065 /* Wake the monster up */
6068 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
6070 /* Hurt the monster */
6078 if (is_pet(m_ptr) && !(m_ptr->ml))
6081 /* Give detailed messages if destroyed */
6084 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
6087 msg_format("%^s%s", m_name, note);
6095 monster_gain_exp(who, m_ptr->r_idx);
6097 /* Generate treasure, etc */
6098 monster_death(c_ptr->m_idx, FALSE);
6100 /* Delete the monster */
6101 delete_monster_idx(c_ptr->m_idx);
6106 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6108 msg_print("You feel sad for a moment.");
6114 /* Damaged monster */
6117 /* Give detailed messages if visible or destroyed */
6118 if (note && seen) msg_format("%^s%s", m_name, note);
6120 /* Hack -- Pain message */
6123 message_pain(c_ptr->m_idx, dam);
6130 /* Hack -- handle sleep */
6131 if (do_sleep) m_ptr->csleep = do_sleep;
6135 else if (heal_leper)
6138 msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6140 msg_print("The Mangy looking leper is healed!");
6143 delete_monster_idx(c_ptr->m_idx);
6146 /* If the player did it, give him experience, check fear */
6151 /* Hurt the monster, check for fear and death */
6152 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6157 /* Damaged monster */
6160 /* HACK - anger the monster before showing the sleep message */
6161 if (do_sleep) anger_monster(m_ptr);
6163 /* Give detailed messages if visible or destroyed */
6166 msg_format("%s%s", m_name, note);
6168 msg_format("%^s%s", m_name, note);
6172 /* Hack -- Pain message */
6173 else if (known && (dam || !do_fear))
6175 message_pain(c_ptr->m_idx, dam);
6178 /* Anger monsters */
6179 if (((dam > 0) || get_angry) && !do_sleep)
6180 anger_monster(m_ptr);
6183 if ((fear || do_fear) && (m_ptr->ml))
6190 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6192 msg_format("%^s flees in terror!", m_name);
6197 /* Hack -- handle sleep */
6198 if (do_sleep) m_ptr->csleep = do_sleep;
6202 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6204 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6208 switch (randint1(28))
6214 msg_print("ÃÏÌ̤¬Íɤ줿...");
6216 msg_print("The ground trembles...");
6219 earthquake(ty, tx, 4 + randint0(4));
6220 if (!one_in_(6)) break;
6222 case 3: case 4: case 5: case 6:
6225 int dam = damroll(10, 10);
6227 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6229 msg_print("A portal opens to a plane of raw mana!");
6232 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6233 if (!one_in_(6)) break;
6239 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6241 msg_print("Space warps about you!");
6244 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE, TRUE);
6245 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6246 if (!one_in_(6)) break;
6248 case 9: case 10: case 11:
6250 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6252 msg_print("You feel a surge of energy!");
6255 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6256 if (!one_in_(6)) break;
6257 case 12: case 13: case 14: case 15: case 16:
6258 aggravate_monsters(0);
6259 if (!one_in_(6)) break;
6261 count += activate_hi_summon(ty, tx, TRUE);
6262 if (!one_in_(6)) break;
6263 case 19: case 20: case 21: case 22:
6265 bool pet = !one_in_(3);
6266 u32b mode = PM_ALLOW_GROUP;
6268 if (pet) mode |= PM_FORCE_PET;
6269 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6271 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6272 if (!one_in_(6)) break;
6274 case 23: case 24: case 25:
6275 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6277 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6279 msg_print("You feel your life draining away...");
6282 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6283 else lose_exp(p_ptr->exp / 16);
6284 if (!one_in_(6)) break;
6285 case 26: case 27: case 28:
6294 (void)do_dec_stat(i);
6303 (void)do_dec_stat(randint0(6));
6312 if (p_ptr->inside_battle)
6314 p_ptr->health_who = c_ptr->m_idx;
6315 p_ptr->redraw |= (PR_HEALTH);
6319 /* XXX XXX XXX Verify this code */
6321 /* Update the monster */
6322 update_mon(c_ptr->m_idx, FALSE);
6324 /* Redraw the monster grid */
6328 /* Update monster recall window */
6329 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6332 p_ptr->window |= (PW_MONSTER);
6335 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6339 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6341 set_target(m_ptr, monster_target_y, monster_target_x);
6344 else if (is_pet(&m_list[who]) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6346 set_target(m_ptr, m_list[who].fy, m_list[who].fx);
6350 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6352 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6353 rakubadam_m = (dam > 200) ? 200 : dam;
6362 /* Get local object */
6365 /* Prepare to make a Blade of Chaos */
6366 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6368 q_ptr->pval = photo;
6370 /* Mark the item as fully known */
6371 q_ptr->ident |= (IDENT_MENTAL);
6373 /* Drop it in the dungeon */
6374 (void)drop_near(q_ptr, -1, py, px);
6382 /* Return "Anything seen?" */
6388 * Helper function for "project()" below.
6390 * Handle a beam/bolt/ball causing damage to the player.
6392 * This routine takes a "source monster" (by index), a "distance", a default
6393 * "damage", and a "damage type". See "project_m()" above.
6395 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6396 * is reduced (see "project_m()" above). This can happen if a monster breathes
6397 * at the player and hits a wall instead.
6399 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6400 * to know if this is actually a ball or a bolt spell
6403 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6404 * we just assume that the effects were obvious, for historical reasons.
6406 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6411 /* Hack -- assume obvious */
6412 bool obvious = TRUE;
6414 /* Player blind-ness */
6415 bool blind = (p_ptr->blind ? TRUE : FALSE);
6417 /* Player needs a "description" (he is blind) */
6420 /* Source monster */
6421 monster_type *m_ptr = NULL;
6423 /* Monster name (for attacks) */
6426 /* Monster name (for damage) */
6429 /* Hack -- messages */
6435 /* Player is not here */
6436 if (!player_bold(y, x)) return (FALSE);
6438 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6444 /* Player cannot hurt himself */
6445 if (!who) return (FALSE);
6446 if (who == p_ptr->riding) return (FALSE);
6448 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6451 int max_attempts = 10;
6454 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6455 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6456 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6458 if (blind) msg_print("Something bounces!");
6459 else msg_print("The attack bounces!");
6463 /* Choose 'new' target */
6466 t_y = m_list[who].fy - 1 + randint1(3);
6467 t_x = m_list[who].fx - 1 + randint1(3);
6470 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
6472 if (max_attempts < 1)
6474 t_y = m_list[who].fy;
6475 t_x = m_list[who].fx;
6478 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6485 /* Limit maximum damage */
6486 if (dam > 1600) dam = 1600;
6488 /* Reduce damage by distance */
6489 dam = (dam + r) / (r + 1);
6492 /* If the player is blind, be more descriptive */
6493 if (blind) fuzzy = TRUE;
6498 /* Get the source monster */
6499 m_ptr = &m_list[who];
6500 /* Extract the monster level */
6501 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6503 /* Get the monster name */
6504 monster_desc(m_name, m_ptr, 0);
6506 /* Get the monster's real name (gotten before polymorph!) */
6507 strcpy(killer, who_name);
6512 strcpy(killer, "æ«");
6514 strcpy(killer, "a trap");
6518 /* Analyze the damage */
6521 /* Standard damage -- hurts inventory too */
6525 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6527 if (fuzzy) msg_print("You are hit by acid!");
6530 get_damage = acid_dam(dam, killer, monspell);
6534 /* Standard damage -- hurts inventory too */
6538 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6540 if (fuzzy) msg_print("You are hit by fire!");
6543 get_damage = fire_dam(dam, killer, monspell);
6547 /* Standard damage -- hurts inventory too */
6551 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6553 if (fuzzy) msg_print("You are hit by cold!");
6556 get_damage = cold_dam(dam, killer, monspell);
6560 /* Standard damage -- hurts inventory too */
6564 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6566 if (fuzzy) msg_print("You are hit by lightning!");
6569 get_damage = elec_dam(dam, killer, monspell);
6573 /* Standard damage -- also poisons player */
6576 bool double_resist = IS_OPPOSE_POIS();
6578 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6580 if (fuzzy) msg_print("You are hit by poison!");
6583 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6584 if (double_resist) dam = (dam + 2) / 3;
6586 if ((!(double_resist || p_ptr->resist_pois)) &&
6587 one_in_(HURT_CHANCE))
6592 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6594 if (!(double_resist || p_ptr->resist_pois))
6596 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6601 /* Standard damage -- also poisons / mutates player */
6604 bool double_resist = IS_OPPOSE_POIS();
6606 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6608 if (fuzzy) msg_print("You are hit by radiation!");
6611 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6612 if (double_resist) dam = (2 * dam + 2) / 5;
6613 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6614 if (!(double_resist || p_ptr->resist_pois))
6616 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6618 if (one_in_(5)) /* 6 */
6621 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6623 msg_print("You undergo a freakish metamorphosis!");
6626 if (one_in_(4)) /* 4 */
6634 inven_damage(set_acid_destroy, 2);
6640 /* Standard damage */
6644 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6646 if (fuzzy) msg_print("You are hit by something!");
6649 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6653 /* Holy Orb -- Player only takes partial damage */
6657 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6659 if (fuzzy) msg_print("You are hit by something!");
6662 if (p_ptr->align > 10)
6664 else if (p_ptr->align < -10)
6666 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6673 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6675 if (fuzzy) msg_print("You are hit by something!");
6678 if (p_ptr->align > 10)
6680 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6684 /* Arrow -- XXX no dodging */
6688 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6690 if (fuzzy) msg_print("You are hit by something sharp!");
6693 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6696 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6698 msg_print("You cut down the arrow!");
6702 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6706 /* Plasma -- XXX No resist */
6710 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6712 if (fuzzy) msg_print("You are hit by something *HOT*!");
6715 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6717 if (!p_ptr->resist_sound)
6719 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6720 (void)set_stun(p_ptr->stun + k);
6723 if (!(p_ptr->resist_fire ||
6725 p_ptr->immune_fire))
6727 inven_damage(set_acid_destroy, 3);
6733 /* Nether -- drain experience */
6737 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6739 if (fuzzy) msg_print("You are hit by nether forces!");
6743 if (p_ptr->resist_neth)
6745 if (!prace_is_(RACE_SPECTRE))
6746 dam *= 6; dam /= (randint1(4) + 7);
6748 else drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
6750 if (prace_is_(RACE_SPECTRE))
6753 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6755 msg_print("You feel invigorated!");
6759 learn_spell(monspell);
6763 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6769 /* Water -- stun/confuse */
6773 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6775 if (fuzzy) msg_print("You are hit by something wet!");
6778 if (!p_ptr->resist_sound)
6780 set_stun(p_ptr->stun + randint1(40));
6782 if (!p_ptr->resist_conf)
6784 set_confused(p_ptr->confused + randint1(5) + 5);
6789 inven_damage(set_cold_destroy, 3);
6792 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6796 /* Chaos -- many effects */
6800 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6802 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6805 if (p_ptr->resist_chaos)
6807 dam *= 6; dam /= (randint1(4) + 7);
6809 if (!p_ptr->resist_conf)
6811 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6813 if (!p_ptr->resist_chaos)
6815 (void)set_image(p_ptr->image + randint1(10));
6819 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6821 msg_print("Your body is twisted by chaos!");
6824 (void)gain_random_mutation(0);
6827 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6829 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
6831 if (!p_ptr->resist_chaos || one_in_(9))
6833 inven_damage(set_elec_destroy, 2);
6834 inven_damage(set_fire_destroy, 2);
6836 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6840 /* Shards -- mostly cutting */
6844 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6846 if (fuzzy) msg_print("You are hit by something sharp!");
6849 if (p_ptr->resist_shard)
6851 dam *= 6; dam /= (randint1(4) + 7);
6855 (void)set_cut(p_ptr->cut + dam);
6858 if (!p_ptr->resist_shard || one_in_(13))
6860 inven_damage(set_cold_destroy, 2);
6863 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6867 /* Sound -- mostly stunning */
6871 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6873 if (fuzzy) msg_print("You are hit by a loud noise!");
6876 if (p_ptr->resist_sound)
6878 dam *= 5; dam /= (randint1(4) + 7);
6882 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6883 (void)set_stun(p_ptr->stun + k);
6886 if (!p_ptr->resist_sound || one_in_(13))
6888 inven_damage(set_cold_destroy, 2);
6891 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6895 /* Pure confusion */
6899 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6901 if (fuzzy) msg_print("You are hit by something puzzling!");
6904 if (p_ptr->resist_conf)
6906 dam *= 5; dam /= (randint1(4) + 7);
6908 if (!p_ptr->resist_conf)
6910 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6912 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6916 /* Disenchantment -- see above */
6920 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6922 if (fuzzy) msg_print("You are hit by something static!");
6925 if (p_ptr->resist_disen)
6927 dam *= 6; dam /= (randint1(4) + 7);
6931 (void)apply_disenchant(0);
6933 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6937 /* Nexus -- see above */
6941 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6943 if (fuzzy) msg_print("You are hit by something strange!");
6946 if (p_ptr->resist_nexus)
6948 dam *= 6; dam /= (randint1(4) + 7);
6954 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6958 /* Force -- mostly stun */
6962 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6964 if (fuzzy) msg_print("You are hit by kinetic force!");
6967 if (!p_ptr->resist_sound)
6969 (void)set_stun(p_ptr->stun + randint1(20));
6971 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6976 /* Rocket -- stun, cut */
6980 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
6982 if (fuzzy) msg_print("There is an explosion!");
6985 if (!p_ptr->resist_sound)
6987 (void)set_stun(p_ptr->stun + randint1(20));
6989 if (p_ptr->resist_shard)
6995 (void)set_cut(p_ptr-> cut + ( dam / 2));
6998 if ((!p_ptr->resist_shard) || one_in_(12))
7000 inven_damage(set_cold_destroy, 3);
7003 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7007 /* Inertia -- slowness */
7011 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7013 if (fuzzy) msg_print("You are hit by something slow!");
7016 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7017 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7021 /* Lite -- blinding */
7025 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7027 if (fuzzy) msg_print("You are hit by something!");
7030 if (p_ptr->resist_lite)
7032 dam *= 4; dam /= (randint1(4) + 7);
7034 else if (!blind && !p_ptr->resist_blind)
7036 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7038 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
7041 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
7043 msg_print("The light scorches your flesh!");
7048 else if (prace_is_(RACE_S_FAIRY))
7052 if (p_ptr->wraith_form) dam *= 2;
7053 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7055 if (p_ptr->wraith_form)
7057 p_ptr->wraith_form = 0;
7059 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7061 msg_print("The light forces you out of your incorporeal shadow form.");
7064 p_ptr->redraw |= PR_MAP;
7065 /* Update monsters */
7066 p_ptr->update |= (PU_MONSTERS);
7068 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7070 /* Redraw status bar */
7071 p_ptr->redraw |= (PR_STATUS);
7078 /* Dark -- blinding */
7082 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7084 if (fuzzy) msg_print("You are hit by something!");
7087 if (p_ptr->resist_dark)
7089 dam *= 4; dam /= (randint1(4) + 7);
7091 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7093 else if (!blind && !p_ptr->resist_blind)
7095 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7097 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7101 /* Time -- bolt fewer effects XXX */
7105 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7107 if (fuzzy) msg_print("You are hit by a blast from the past!");
7110 if (p_ptr->resist_time)
7113 dam /= (randint1(4) + 7);
7115 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7117 msg_print("You feel as if time is passing you by.");
7123 switch (randint1(10))
7125 case 1: case 2: case 3: case 4: case 5:
7127 if (p_ptr->prace == RACE_ANDROID) break;
7129 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7131 msg_print("You feel life has clocked back.");
7134 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7138 case 6: case 7: case 8: case 9:
7140 switch (randint1(6))
7143 case 1: k = A_STR; act = "¶¯¤¯"; break;
7144 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7145 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7146 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7147 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7148 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7150 case 1: k = A_STR; act = "strong"; break;
7151 case 2: k = A_INT; act = "bright"; break;
7152 case 3: k = A_WIS; act = "wise"; break;
7153 case 4: k = A_DEX; act = "agile"; break;
7154 case 5: k = A_CON; act = "hale"; break;
7155 case 6: k = A_CHR; act = "beautiful"; break;
7161 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7163 msg_format("You're not as %s as you used to be...", act);
7167 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7168 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7169 p_ptr->update |= (PU_BONUS);
7176 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7178 msg_print("You're not as powerful as you used to be...");
7182 for (k = 0; k < 6; k++)
7184 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7185 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7187 p_ptr->update |= (PU_BONUS);
7193 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7197 /* Gravity -- stun plus slowness plus teleport */
7201 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7202 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7204 if (fuzzy) msg_print("You are hit by something heavy!");
7205 msg_print("Gravity warps around you.");
7208 teleport_player(5, TRUE);
7209 if (!p_ptr->levitation)
7210 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7211 if (!(p_ptr->resist_sound || p_ptr->levitation))
7213 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7214 (void)set_stun(p_ptr->stun + k);
7216 if (p_ptr->levitation)
7218 dam = (dam * 2) / 3;
7221 if (!p_ptr->levitation || one_in_(13))
7223 inven_damage(set_cold_destroy, 2);
7226 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7230 /* Standard damage */
7231 case GF_DISINTEGRATE:
7234 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7236 if (fuzzy) msg_print("You are hit by pure energy!");
7239 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7246 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7248 if (fuzzy) msg_print("You are hit by something invigorating!");
7251 (void)hp_player(dam);
7259 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7261 if (fuzzy) msg_print("You are hit by something!");
7264 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7272 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7274 if (fuzzy) msg_print("You are hit by something slow!");
7277 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7283 if (p_ptr->free_act) break;
7285 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7287 if (fuzzy) msg_print("You fall asleep!");
7291 if (ironman_nightmare)
7294 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7296 msg_print("A horrible vision enters your mind.");
7300 /* Pick a nightmare */
7301 get_mon_num_prep(get_nightmare, NULL);
7303 /* Have some nightmares */
7304 have_nightmare(get_mon_num(MAX_DEPTH));
7306 /* Remove the monster restriction */
7307 get_mon_num_prep(NULL, NULL);
7310 set_paralyzed(p_ptr->paralyzed + dam);
7321 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7323 if (fuzzy) msg_print("You are hit by an aura of magic!");
7326 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7334 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7336 if (fuzzy) msg_print("You are hit by an energy!");
7339 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7347 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7349 if (fuzzy) msg_print("Something falls from the sky on you!");
7352 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7353 if (!p_ptr->resist_shard || one_in_(13))
7355 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7356 inven_damage(set_cold_destroy, 2);
7362 /* Ice -- cold plus stun plus cuts */
7366 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7368 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7371 cold_dam(dam, killer, monspell);
7372 if (!p_ptr->resist_shard)
7374 (void)set_cut(p_ptr->cut + damroll(5, 8));
7376 if (!p_ptr->resist_sound)
7378 (void)set_stun(p_ptr->stun + randint1(15));
7381 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
7383 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7393 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7395 if (fuzzy) msg_print("You are hit by something extremely cold!");
7399 if (p_ptr->mimic_form)
7401 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7402 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7407 switch (p_ptr->prace)
7409 /* Some races are immune */
7423 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7439 if (who > 0) msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
7440 else msg_print("Àº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
7442 if (who > 0) msg_format("%^s draws psychic energy from you!", m_name);
7443 else msg_print("Your psychic energy is drawn!");
7447 if (dam >= p_ptr->csp)
7451 p_ptr->csp_frac = 0;
7460 learn_spell(monspell);
7463 p_ptr->redraw |= (PR_MANA);
7466 p_ptr->window |= (PW_PLAYER);
7467 p_ptr->window |= (PW_SPELL);
7471 /* Heal the monster */
7472 if (m_ptr->hp < m_ptr->maxhp)
7475 m_ptr->hp += (6 * dam);
7476 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
7478 /* Redraw (later) if needed */
7479 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
7480 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
7482 /* Special message */
7486 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
7488 msg_format("%^s appears healthier.", m_name);
7502 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7505 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7507 msg_print("You resist the effects!");
7509 learn_spell(monspell);
7514 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7516 msg_print("Your mind is blasted by psyonic energy.");
7519 if (!p_ptr->resist_conf)
7521 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7524 if (!p_ptr->resist_chaos && one_in_(3))
7526 (void)set_image(p_ptr->image + randint0(250) + 150);
7533 p_ptr->csp_frac = 0;
7535 p_ptr->redraw |= PR_MANA;
7537 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7543 case GF_BRAIN_SMASH:
7545 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7548 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7550 msg_print("You resist the effects!");
7552 learn_spell(monspell);
7557 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7559 msg_print("Your mind is blasted by psionic energy.");
7566 p_ptr->csp_frac = 0;
7568 p_ptr->redraw |= PR_MANA;
7570 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7571 if (!p_ptr->resist_blind)
7573 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7575 if (!p_ptr->resist_conf)
7577 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7579 if (!p_ptr->free_act)
7581 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7583 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7585 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7586 (void)do_dec_stat(A_INT);
7587 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7588 (void)do_dec_stat(A_WIS);
7590 if (!p_ptr->resist_chaos)
7592 (void)set_image(p_ptr->image + randint0(250) + 150);
7601 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7604 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7606 msg_print("You resist the effects!");
7608 learn_spell(monspell);
7612 curse_equipment(15, 0);
7613 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7621 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7624 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7626 msg_print("You resist the effects!");
7628 learn_spell(monspell);
7632 curse_equipment(25, MIN(rlev/2-15, 5));
7633 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7641 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7644 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7646 msg_print("You resist the effects!");
7648 learn_spell(monspell);
7652 curse_equipment(33, MIN(rlev/2-15, 15));
7653 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7661 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7664 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7666 msg_print("You resist the effects!");
7668 learn_spell(monspell);
7672 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7673 (void)set_cut(p_ptr->cut + damroll(10, 10));
7681 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7684 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7686 msg_format("You resist the effects!");
7688 learn_spell(monspell);
7693 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7695 msg_print("You feel your life fade away!");
7698 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
7699 curse_equipment(40, 20);
7701 if (p_ptr->chp < 1) p_ptr->chp = 1;
7716 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7719 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7721 char m_name_self[80];
7724 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
7726 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7728 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7729 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7732 if (p_ptr->riding && dam > 0)
7734 rakubadam_p = (dam > 200) ? 200 : dam;
7742 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7748 /* Return "Anything seen?" */
7754 * Find the distance from (x, y) to a line.
7756 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7758 /* Vector from (x, y) to (x1, y1) */
7767 int pd = distance(y1, x1, y, x);
7768 int nd = distance(y1, x1, y2, x2);
7770 if (pd > nd) return distance(y, x, y2, x2);
7772 /* Component of P on N */
7773 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7775 /* Absolute value */
7776 return((nd >= 0) ? nd : 0 - nd);
7783 * Modified version of los() for calculation of disintegration balls.
7784 * Disintegration effects are stopped by permanent walls.
7786 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7806 /* Slope, or 1/Slope, of LOS */
7810 /* Extract the offset */
7814 /* Extract the absolute offset */
7819 /* Handle adjacent (or identical) grids */
7820 if ((ax < 2) && (ay < 2)) return (TRUE);
7823 /* Paranoia -- require "safe" origin */
7824 /* if (!in_bounds(y1, x1)) return (FALSE); */
7827 /* Directly South/North */
7830 /* South -- check for walls */
7833 for (ty = y1 + 1; ty < y2; ty++)
7835 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7839 /* North -- check for walls */
7842 for (ty = y1 - 1; ty > y2; ty--)
7844 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7852 /* Directly East/West */
7855 /* East -- check for walls */
7858 for (tx = x1 + 1; tx < x2; tx++)
7860 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7864 /* West -- check for walls */
7867 for (tx = x1 - 1; tx > x2; tx--)
7869 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7878 /* Extract some signs */
7879 sx = (dx < 0) ? -1 : 1;
7880 sy = (dy < 0) ? -1 : 1;
7883 /* Vertical "knights" */
7888 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7892 /* Horizontal "knights" */
7897 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7902 /* Calculate scale factor div 2 */
7905 /* Calculate scale factor */
7909 /* Travel horizontally */
7912 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7918 /* Consider the special case where slope == 1. */
7929 /* Note (below) the case (qy == f2), where */
7930 /* the LOS exactly meets the corner of a tile. */
7933 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7944 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7957 /* Travel vertically */
7960 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7976 /* Note (below) the case (qx == f2), where */
7977 /* the LOS exactly meets the corner of a tile. */
7980 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7991 if (cave_stop_disintegration(ty, tx)) return (FALSE);
8012 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)
8017 int brev = rad * rad / dist;
8021 int mdis = distance(y1, x1, y2, x2) + rad;
8023 while (bdis <= mdis)
8027 if ((0 < dist) && (path_n < dist))
8029 int ny = GRID_Y(path_g[path_n]);
8030 int nx = GRID_X(path_g[path_n]);
8031 int nd = distance(ny, nx, y1, x1);
8033 /* Get next base point */
8042 /* Travel from center outward */
8043 for (cdis = 0; cdis <= brad; cdis++)
8045 /* Scan the maximal blast area of radius "cdis" */
8046 for (y = by - cdis; y <= by + cdis; y++)
8048 for (x = bx - cdis; x <= bx + cdis; x++)
8050 /* Ignore "illegal" locations */
8051 if (!in_bounds(y, x)) continue;
8053 /* Enforce a circular "ripple" */
8054 if (distance(y1, x1, y, x) != bdis) continue;
8056 /* Enforce an arc */
8057 if (distance(by, bx, y, x) != cdis) continue;
8063 /* Lights are stopped by opaque terrains */
8064 if (!los(by, bx, y, x)) continue;
8066 case GF_DISINTEGRATE:
8067 /* Disintegration are stopped only by perma-walls */
8068 if (!in_disintegration_range(by, bx, y, x)) continue;
8071 /* Ball explosions are stopped by walls */
8072 if (!projectable(by, bx, y, x)) continue;
8076 /* Save this grid */
8084 /* Encode some more "radius" info */
8085 gm[bdis + 1] = *pgrids;
8087 /* Increase the size */
8088 brad = rad * (path_n + brev) / (dist + brev);
8090 /* Find the next ripple */
8094 /* Store the effect size */
8100 * Generic "beam"/"bolt"/"ball" projection routine.
8103 * who: Index of "source" monster (zero for "player")
8104 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8105 * y,x: Target location (or location to travel "towards")
8106 * dam: Base damage roll to apply to affected monsters (or player)
8107 * typ: Type of damage to apply to monsters (and objects)
8108 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8111 * TRUE if any "effects" of the projection were observed, else FALSE
8113 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8114 * towards a given location (optionally passing over the heads of interposing
8115 * monsters), and have it do a given amount of damage to the monsters (and
8116 * optionally objects) within the given radius of the final location.
8118 * A "bolt" travels from source to target and affects only the target grid.
8119 * A "beam" travels from source to target, affecting all grids passed through.
8120 * A "ball" travels from source to the target, exploding at the target, and
8121 * affecting everything within the given radius of the target location.
8123 * Traditionally, a "bolt" does not affect anything on the ground, and does
8124 * not pass over the heads of interposing monsters, much like a traditional
8125 * missile, and will "stop" abruptly at the "target" even if no monster is
8126 * positioned there, while a "ball", on the other hand, passes over the heads
8127 * of monsters between the source and target, and affects everything except
8128 * the source monster which lies within the final radius, while a "beam"
8129 * affects every monster between the source and target, except for the casting
8130 * monster (or player), and rarely affects things on the ground.
8132 * Two special flags allow us to use this function in special ways, the
8133 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8134 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8135 * actually projecting from the source monster (or player).
8137 * The player will only get "experience" for monsters killed by himself
8138 * Unique monsters can only be destroyed by attacks from the player
8140 * Only 256 grids can be affected per projection, limiting the effective
8141 * "radius" of standard ball attacks to nine units (diameter nineteen).
8143 * One can project in a given "direction" by combining PROJECT_THRU with small
8144 * offsets to the initial location (see "line_spell()"), or by calculating
8145 * "virtual targets" far away from the player.
8147 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8148 * continuing until it actually hits somethings (useful for "stone to mud").
8150 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8152 * Balls must explode BEFORE hitting walls, or they would affect monsters
8153 * on both sides of a wall. Some bug reports indicate that this is still
8154 * happening in 2.7.8 for Windows, though it appears to be impossible.
8156 * We "pre-calculate" the blast area only in part for efficiency.
8157 * More importantly, this lets us do "explosions" from the "inside" out.
8158 * This results in a more logical distribution of "blast" treasure.
8159 * It also produces a better (in my opinion) animation of the explosion.
8160 * It could be (but is not) used to have the treasure dropped by monsters
8161 * in the middle of the explosion fall "outwards", and then be damaged by
8162 * the blast as it spreads outwards towards the treasure drop location.
8164 * Walls and doors are included in the blast area, so that they can be
8165 * "burned" or "melted" in later versions.
8167 * This algorithm is intended to maximize simplicity, not necessarily
8168 * efficiency, since this function is not a bottleneck in the code.
8170 * We apply the blast effect from ground zero outwards, in several passes,
8171 * first affecting features, then objects, then monsters, then the player.
8172 * This allows walls to be removed before checking the object or monster
8173 * in the wall, and protects objects which are dropped by monsters killed
8174 * in the blast, and allows the player to see all affects before he is
8175 * killed or teleported away. The semantics of this method are open to
8176 * various interpretations, but they seem to work well in practice.
8178 * We process the blast area from ground-zero outwards to allow for better
8179 * distribution of treasure dropped by monsters, and because it provides a
8180 * pleasing visual effect at low cost.
8182 * Note that the damage done by "ball" explosions decreases with distance.
8183 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8185 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8186 * the target, and then the damage "flows" along this beam of destruction.
8187 * The damage at every grid is the same as at the "center" of a "ball"
8188 * explosion, since the "beam" grids are treated as if they ARE at the
8189 * center of a "ball" explosion.
8191 * Currently, specifying "beam" plus "ball" means that locations which are
8192 * covered by the initial "beam", and also covered by the final "ball", except
8193 * for the final grid (the epicenter of the ball), will be "hit twice", once
8194 * by the initial beam, and once by the exploding ball. For the grid right
8195 * next to the epicenter, this results in 150% damage being done. The center
8196 * does not have this problem, for the same reason the final grid in a "beam"
8197 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8198 * grids which are covered by the "ball" will NOT work, as then they will
8199 * receive LESS damage than they should. Do not combine "beam" with "ball".
8201 * The array "gy[],gx[]" with current size "grids" is used to hold the
8202 * collected locations of all grids in the "blast area" plus "beam path".
8204 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8205 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8206 * first blast grid (see above) with radius "N" from the blast center. Note
8207 * that only the first gm[1] grids in the blast area thus take full damage.
8208 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8209 * number of blast grids.
8211 * Note that once the projection is complete, (y2,x2) holds the final location
8212 * of bolts/beams, and the "epicenter" of balls.
8214 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8215 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8216 * implementation of the "distance" function. Also, a bolt can be properly
8217 * viewed as a "ball" with a "rad" of "zero".
8219 * Note that if no "target" is reached before the beam/bolt/ball travels the
8220 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8221 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8223 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8224 * to move from point A to point B, even if the player cannot see part of the
8225 * projection path. Note that in general, the player will *always* see part
8226 * of the path, since it either starts at the player or ends on the player.
8228 * Hack -- we assume that every "projection" is "self-illuminating".
8230 * Hack -- when only a single monster is affected, we automatically track
8231 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8233 * Note that all projections now "explode" at their final destination, even
8234 * if they were being projected at a more distant destination. This means
8235 * that "ball" spells will *always* explode.
8237 * Note that we must call "handle_stuff()" after affecting terrain features
8238 * in the blast radius, in case the "illumination" of the grid was changed,
8239 * and "update_view()" and "update_monsters()" need to be called.
8241 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8251 int y_saver, x_saver; /* For reflecting monsters */
8253 int msec = delay_factor * delay_factor * delay_factor;
8255 /* Assume the player sees nothing */
8256 bool notice = FALSE;
8258 /* Assume the player has seen nothing */
8259 bool visual = FALSE;
8261 /* Assume the player has seen no blast grids */
8264 /* Assume to be a normal ball spell */
8265 bool breath = FALSE;
8267 /* Is the player blind? */
8268 bool blind = (p_ptr->blind ? TRUE : FALSE);
8270 bool old_hide = FALSE;
8272 /* Number of grids in the "path" */
8275 /* Actual grids in the "path" */
8278 /* Number of grids in the "blast area" (including the "beam" path) */
8281 /* Coordinates of the affected grids */
8282 byte gx[1024], gy[1024];
8284 /* Encoded "radius" info (see above) */
8287 /* Actual radius encoded in gm[] */
8292 /* Attacker's name (prepared before polymorph)*/
8295 /* Initialize by null string */
8301 /* Default target of monsterspell is player */
8302 monster_target_y=py;
8303 monster_target_x=px;
8305 /* Hack -- Jump to target */
8306 if (flg & (PROJECT_JUMP))
8311 /* Clear the flag */
8312 flg &= ~(PROJECT_JUMP);
8317 /* Start at player */
8324 /* Start at monster */
8327 x1 = m_list[who].fx;
8328 y1 = m_list[who].fy;
8329 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8342 /* Default "destination" */
8347 /* Hack -- verify stuff */
8348 if (flg & (PROJECT_THRU))
8350 if ((x1 == x2) && (y1 == y2))
8352 flg &= ~(PROJECT_THRU);
8356 /* Handle a breath attack */
8361 if (flg & PROJECT_HIDE) old_hide = TRUE;
8362 flg |= PROJECT_HIDE;
8366 /* Hack -- Assume there will be no blast (max radius 32) */
8367 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8375 /* Collect beam grids */
8376 if (flg & (PROJECT_BEAM))
8387 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
8389 case GF_DISINTEGRATE:
8390 flg |= (PROJECT_GRID);
8391 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
8395 /* Calculate the projection path */
8397 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8399 /* Hack -- Handle stuff */
8402 /* Giga-Hack SEEKER & SUPER_RAY */
8404 if( typ == GF_SEEKER )
8414 for (i = 0; i < path_n; ++i)
8419 int ny = GRID_Y(path_g[i]);
8420 int nx = GRID_X(path_g[i]);
8431 /* Only do visuals if requested */
8432 if (!blind && !(flg & (PROJECT_HIDE)))
8434 /* Only do visuals if the player can "see" the bolt */
8435 if (panel_contains(y, x) && player_has_los_bold(y, x))
8442 /* Obtain the bolt pict */
8443 p = bolt_pict(oy, ox, y, x, typ);
8445 /* Extract attr/char */
8449 /* Visual effects */
8450 print_rel(c, a, y, x);
8451 move_cursor_relative(y, x);
8452 /*if (fresh_before)*/ Term_fresh();
8453 Term_xtra(TERM_XTRA_DELAY, msec);
8455 /*if (fresh_before)*/ Term_fresh();
8457 /* Display "beam" grids */
8458 if (flg & (PROJECT_BEAM))
8460 /* Obtain the explosion pict */
8461 p = bolt_pict(y, x, y, x, typ);
8463 /* Extract attr/char */
8467 /* Visual effects */
8468 print_rel(c, a, y, x);
8471 /* Hack -- Activate delay */
8475 /* Hack -- delay anyway for consistency */
8478 /* Delay for consistency */
8479 Term_xtra(TERM_XTRA_DELAY, msec);
8482 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8483 if( is_mirror_grid(&cave[y][x]))
8485 /* The target of monsterspell becomes tha mirror(broken) */
8486 monster_target_y=(s16b)y;
8487 monster_target_x=(s16b)x;
8490 next_mirror( &oy,&ox,y,x );
8492 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8493 for( j = last_i; j <=i ; j++ )
8495 y = GRID_Y(path_g[j]);
8496 x = GRID_X(path_g[j]);
8497 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8498 if(!who && (project_m_n==1) && !jump ){
8499 if(cave[project_m_y][project_m_x].m_idx >0 ){
8500 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8502 /* Hack -- auto-recall */
8503 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8505 /* Hack - auto-track */
8506 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8509 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8514 for( i = last_i ; i < path_n ; i++ )
8517 y = GRID_Y(path_g[i]);
8518 x = GRID_X(path_g[i]);
8519 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8521 if(!who && (project_m_n==1) && !jump ){
8522 if(cave[project_m_y][project_m_x].m_idx >0 ){
8523 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8525 /* Hack -- auto-recall */
8526 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8528 /* Hack - auto-track */
8529 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8532 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8536 else if(typ == GF_SUPER_RAY){
8538 int second_step = 0;
8545 for (i = 0; i < path_n; ++i)
8550 int ny = GRID_Y(path_g[i]);
8551 int nx = GRID_X(path_g[i]);
8562 /* Only do visuals if requested */
8563 if (!blind && !(flg & (PROJECT_HIDE)))
8565 /* Only do visuals if the player can "see" the bolt */
8566 if (panel_contains(y, x) && player_has_los_bold(y, x))
8573 /* Obtain the bolt pict */
8574 p = bolt_pict(oy, ox, y, x, typ);
8576 /* Extract attr/char */
8580 /* Visual effects */
8581 print_rel(c, a, y, x);
8582 move_cursor_relative(y, x);
8583 /*if (fresh_before)*/ Term_fresh();
8584 Term_xtra(TERM_XTRA_DELAY, msec);
8586 /*if (fresh_before)*/ Term_fresh();
8588 /* Display "beam" grids */
8589 if (flg & (PROJECT_BEAM))
8591 /* Obtain the explosion pict */
8592 p = bolt_pict(y, x, y, x, typ);
8594 /* Extract attr/char */
8598 /* Visual effects */
8599 print_rel(c, a, y, x);
8602 /* Hack -- Activate delay */
8606 /* Hack -- delay anyway for consistency */
8609 /* Delay for consistency */
8610 Term_xtra(TERM_XTRA_DELAY, msec);
8613 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8614 if (!cave_have_flag_bold(y, x, FF_PROJECT))
8616 if( second_step )continue;
8619 if( is_mirror_grid(&cave[y][x]) && !second_step )
8621 /* The target of monsterspell becomes tha mirror(broken) */
8622 monster_target_y=(s16b)y;
8623 monster_target_x=(s16b)x;
8626 for( j = 0; j <=i ; j++ )
8628 y = GRID_Y(path_g[j]);
8629 x = GRID_X(path_g[j]);
8630 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8634 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8635 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8636 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8637 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8638 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8639 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8640 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8641 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8644 for( i = 0; i < path_n ; i++ )
8647 y = GRID_Y(path_g[i]);
8648 x = GRID_X(path_g[i]);
8649 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8650 if(!who && (project_m_n==1) && !jump ){
8651 if(cave[project_m_y][project_m_x].m_idx >0 ){
8652 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8654 /* Hack -- auto-recall */
8655 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8657 /* Hack - auto-track */
8658 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8661 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8666 /* Project along the path */
8667 for (i = 0; i < path_n; ++i)
8672 int ny = GRID_Y(path_g[i]);
8673 int nx = GRID_X(path_g[i]);
8675 if (flg & PROJECT_DISI)
8677 /* Hack -- Balls explode before reaching walls */
8678 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8680 else if (flg & PROJECT_LOS)
8682 /* Hack -- Balls explode before reaching walls */
8683 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
8687 /* Hack -- Balls explode before reaching walls */
8688 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
8695 /* Collect beam grids */
8696 if (flg & (PROJECT_BEAM))
8703 /* Only do visuals if requested */
8704 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
8706 /* Only do visuals if the player can "see" the bolt */
8707 if (panel_contains(y, x) && player_has_los_bold(y, x))
8714 /* Obtain the bolt pict */
8715 p = bolt_pict(oy, ox, y, x, typ);
8717 /* Extract attr/char */
8721 /* Visual effects */
8722 print_rel(c, a, y, x);
8723 move_cursor_relative(y, x);
8724 /*if (fresh_before)*/ Term_fresh();
8725 Term_xtra(TERM_XTRA_DELAY, msec);
8727 /*if (fresh_before)*/ Term_fresh();
8729 /* Display "beam" grids */
8730 if (flg & (PROJECT_BEAM))
8732 /* Obtain the explosion pict */
8733 p = bolt_pict(y, x, y, x, typ);
8735 /* Extract attr/char */
8739 /* Visual effects */
8740 print_rel(c, a, y, x);
8743 /* Hack -- Activate delay */
8747 /* Hack -- delay anyway for consistency */
8750 /* Delay for consistency */
8751 Term_xtra(TERM_XTRA_DELAY, msec);
8758 /* Save the "blast epicenter" */
8762 if (breath && !path_n)
8768 flg &= ~(PROJECT_HIDE);
8772 /* Start the "explosion" */
8775 /* Hack -- make sure beams get to "explode" */
8783 /* If we found a "target", explode there */
8784 if (dist <= MAX_RANGE)
8786 /* Mega-Hack -- remove the final "beam" grid */
8787 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8790 * Create a conical breath attack
8801 flg &= ~(PROJECT_HIDE);
8803 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
8807 /* Determine the blast area, work from the inside out */
8808 for (dist = 0; dist <= rad; dist++)
8810 /* Scan the maximal blast area of radius "dist" */
8811 for (y = by - dist; y <= by + dist; y++)
8813 for (x = bx - dist; x <= bx + dist; x++)
8815 /* Ignore "illegal" locations */
8816 if (!in_bounds2(y, x)) continue;
8818 /* Enforce a "circular" explosion */
8819 if (distance(by, bx, y, x) != dist) continue;
8825 /* Lights are stopped by opaque terrains */
8826 if (!los(by, bx, y, x)) continue;
8828 case GF_DISINTEGRATE:
8829 /* Disintegration are stopped only by perma-walls */
8830 if (!in_disintegration_range(by, bx, y, x)) continue;
8833 /* Ball explosions are stopped by walls */
8834 if (!projectable(by, bx, y, x)) continue;
8838 /* Save this grid */
8845 /* Encode some more "radius" info */
8851 /* Speed -- ignore "non-explosions" */
8852 if (!grids) return (FALSE);
8855 /* Display the "blast area" if requested */
8856 if (!blind && !(flg & (PROJECT_HIDE)))
8858 /* Then do the "blast", from inside out */
8859 for (t = 0; t <= gm_rad; t++)
8861 /* Dump everything with this radius */
8862 for (i = gm[t]; i < gm[t+1]; i++)
8864 /* Extract the location */
8868 /* Only do visuals if the player can "see" the blast */
8869 if (panel_contains(y, x) && player_has_los_bold(y, x))
8878 /* Obtain the explosion pict */
8879 p = bolt_pict(y, x, y, x, typ);
8881 /* Extract attr/char */
8885 /* Visual effects -- Display */
8886 print_rel(c, a, y, x);
8890 /* Hack -- center the cursor */
8891 move_cursor_relative(by, bx);
8893 /* Flush each "radius" seperately */
8894 /*if (fresh_before)*/ Term_fresh();
8896 /* Delay (efficiently) */
8897 if (visual || drawn)
8899 Term_xtra(TERM_XTRA_DELAY, msec);
8903 /* Flush the erasing */
8906 /* Erase the explosion drawn above */
8907 for (i = 0; i < grids; i++)
8909 /* Extract the location */
8913 /* Hack -- Erase if needed */
8914 if (panel_contains(y, x) && player_has_los_bold(y, x))
8920 /* Hack -- center the cursor */
8921 move_cursor_relative(by, bx);
8923 /* Flush the explosion */
8924 /*if (fresh_before)*/ Term_fresh();
8929 /* Update stuff if needed */
8930 if (p_ptr->update) update_stuff();
8933 /* Check features */
8934 if (flg & (PROJECT_GRID))
8936 /* Start with "dist" of zero */
8939 /* Scan for features */
8940 for (i = 0; i < grids; i++)
8942 /* Hack -- Notice new "dist" values */
8943 if (gm[dist+1] == i) dist++;
8945 /* Get the grid location */
8949 /* Find the closest point in the blast */
8952 int d = dist_to_line(y, x, y1, x1, by, bx);
8954 /* Affect the grid */
8955 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8959 /* Affect the grid */
8960 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8965 /* Update stuff if needed */
8966 if (p_ptr->update) update_stuff();
8969 if (flg & (PROJECT_ITEM))
8971 /* Start with "dist" of zero */
8974 /* Scan for objects */
8975 for (i = 0; i < grids; i++)
8977 /* Hack -- Notice new "dist" values */
8978 if (gm[dist+1] == i) dist++;
8980 /* Get the grid location */
8984 /* Find the closest point in the blast */
8987 int d = dist_to_line(y, x, y1, x1, by, bx);
8989 /* Affect the object in the grid */
8990 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8994 /* Affect the object in the grid */
8995 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
9001 /* Check monsters */
9002 if (flg & (PROJECT_KILL))
9009 /* Start with "dist" of zero */
9012 /* Scan for monsters */
9013 for (i = 0; i < grids; i++)
9017 /* Hack -- Notice new "dist" values */
9018 if (gm[dist + 1] == i) dist++;
9020 /* Get the grid location */
9024 /* A single bolt may be reflected */
9027 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9028 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
9030 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
9033 int max_attempts = 10;
9035 /* Choose 'new' target */
9038 t_y = y_saver - 1 + randint1(3);
9039 t_x = x_saver - 1 + randint1(3);
9042 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
9044 if (max_attempts < 1)
9053 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
9054 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9055 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9056 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9058 msg_print("The attack bounces!");
9061 if (is_original_ap(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
9064 /* Reflected bolts randomly target either one */
9065 if (one_in_(2)) flg |= PROJECT_PLAYER;
9066 else flg &= ~(PROJECT_PLAYER);
9068 /* The bolt is reflected */
9069 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9071 /* Don't affect the monster any longer */
9077 /* Find the closest point in the blast */
9080 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9084 effective_dist = dist;
9088 /* There is the riding player on this monster */
9089 if (p_ptr->riding && player_bold(y, x))
9091 /* Aimed on the player */
9092 if (flg & PROJECT_PLAYER)
9094 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9097 * A beam or bolt is well aimed
9099 * So don't affects the mount.
9106 * The spell is not well aimed,
9107 * So partly affect the mount too.
9114 * This grid is the original target.
9115 * Or aimed on your horse.
9117 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
9119 /* Hit the mount with full damage */
9123 * Otherwise this grid is not the
9124 * original target, it means that line
9125 * of fire is obstructed by this
9129 * A beam or bolt will hit either
9130 * player or mount. Choose randomly.
9132 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9136 /* Hit the mount with full damage */
9140 /* Hit the player later */
9141 flg |= PROJECT_PLAYER;
9143 /* Don't affect the mount */
9149 * The spell is not well aimed, so
9150 * partly affect both player and
9159 /* Affect the monster in the grid */
9160 if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
9164 /* Player affected one monster (without "jumping") */
9165 if (!who && (project_m_n == 1) && !jump)
9171 /* Track if possible */
9172 if (cave[y][x].m_idx > 0)
9174 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9176 /* Hack -- auto-recall */
9177 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9179 /* Hack - auto-track */
9180 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9187 if (flg & (PROJECT_KILL))
9189 /* Start with "dist" of zero */
9192 /* Scan for player */
9193 for (i = 0; i < grids; i++)
9197 /* Hack -- Notice new "dist" values */
9198 if (gm[dist+1] == i) dist++;
9200 /* Get the grid location */
9204 /* Affect the player? */
9205 if (!player_bold(y, x)) continue;
9207 /* Find the closest point in the blast */
9210 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9214 effective_dist = dist;
9217 /* Target may be your horse */
9220 /* Aimed on the player */
9221 if (flg & PROJECT_PLAYER)
9223 /* Hit the player with full damage */
9227 * Hack -- When this grid was not the
9228 * original target, a beam or bolt
9229 * would hit either player or mount,
9230 * and should be choosen randomly.
9232 * But already choosen to hit the
9233 * mount at this point.
9235 * Or aimed on your horse.
9237 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9240 * A beam or bolt is well aimed
9242 * So don't affects the player.
9249 * The spell is not well aimed,
9250 * So partly affect the player too.
9256 /* Affect the player */
9257 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9265 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9267 if (rakubadam_m > 0)
9269 if (rakuba(rakubadam_m, FALSE))
9272 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9274 msg_format("%^s has thrown you off!", m_name);
9278 if (p_ptr->riding && rakubadam_p > 0)
9280 if(rakuba(rakubadam_p, FALSE))
9283 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9285 msg_format("You have fallen from %s.", m_name);
9291 /* Return "something was noticed" */
9295 bool binding_field( int dam )
9297 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9298 int mirror_num=0; /* ¶À¤Î¿ô */
9303 int msec= delay_factor*delay_factor*delay_factor;
9309 /* Default target of monsterspell is player */
9310 monster_target_y=py;
9311 monster_target_x=px;
9313 for( x=0 ; x < cur_wid ; x++ )
9315 for( y=0 ; y < cur_hgt ; y++ )
9317 if( is_mirror_grid(&cave[y][x]) &&
9318 distance(py,px,y,x) <= MAX_RANGE &&
9319 distance(py,px,y,x) != 0 &&
9320 player_has_los_bold(y,x) &&
9321 projectable(py, px, y, x)
9323 mirror_y[mirror_num]=y;
9324 mirror_x[mirror_num]=x;
9330 if( mirror_num < 2 )return FALSE;
9332 point_x[0] = randint0( mirror_num );
9334 point_x[1] = randint0( mirror_num );
9336 while( point_x[0] == point_x[1] );
9338 point_y[0]=mirror_y[point_x[0]];
9339 point_x[0]=mirror_x[point_x[0]];
9340 point_y[1]=mirror_y[point_x[1]];
9341 point_x[1]=mirror_x[point_x[1]];
9345 x=point_x[0]+point_x[1]+point_x[2];
9346 y=point_y[0]+point_y[1]+point_y[2];
9348 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9349 - (point_y[0]*3-y)*(point_x[1]*3-x);
9350 if( centersign == 0 )return FALSE;
9352 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9353 x1 = x1 < point_x[2] ? x1 : point_x[2];
9354 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9355 y1 = y1 < point_y[2] ? y1 : point_y[2];
9357 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9358 x2 = x2 > point_x[2] ? x2 : point_x[2];
9359 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9360 y2 = y2 > point_y[2] ? y2 : point_y[2];
9362 for( y=y1 ; y <=y2 ; y++ ){
9363 for( x=x1 ; x <=x2 ; x++ ){
9364 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9365 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9366 centersign*( (point_x[1]-x)*(point_y[2]-y)
9367 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9368 centersign*( (point_x[2]-x)*(point_y[0]-y)
9369 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9371 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9372 /* Visual effects */
9374 && panel_contains(y,x)){
9375 p = bolt_pict(y,x,y,x, GF_MANA );
9376 print_rel(PICT_C(p), PICT_A(p),y,x);
9377 move_cursor_relative(y, x);
9378 /*if (fresh_before)*/ Term_fresh();
9379 Term_xtra(TERM_XTRA_DELAY, msec);
9385 for( y=y1 ; y <=y2 ; y++ ){
9386 for( x=x1 ; x <=x2 ; x++ ){
9387 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9388 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9389 centersign*( (point_x[1]-x)*(point_y[2]-y)
9390 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9391 centersign*( (point_x[2]-x)*(point_y[0]-y)
9392 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9394 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9395 (void)project_f(0,0,y,x,dam,GF_MANA);
9400 for( y=y1 ; y <=y2 ; y++ ){
9401 for( x=x1 ; x <=x2 ; x++ ){
9402 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9403 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9404 centersign*( (point_x[1]-x)*(point_y[2]-y)
9405 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9406 centersign*( (point_x[2]-x)*(point_y[0]-y)
9407 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9409 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9410 (void)project_o(0,0,y,x,dam,GF_MANA);
9415 for( y=y1 ; y <=y2 ; y++ ){
9416 for( x=x1 ; x <=x2 ; x++ ){
9417 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9418 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9419 centersign*( (point_x[1]-x)*(point_y[2]-y)
9420 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9421 centersign*( (point_x[2]-x)*(point_y[0]-y)
9422 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9424 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9425 (void)project_m(0,0,y,x,dam,GF_MANA,
9426 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9433 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9435 msg_print("The field broke a mirror");
9437 remove_mirror(point_y[0],point_x[0]);
9443 void seal_of_mirror( int dam )
9447 for( x = 0 ; x < cur_wid ; x++ )
9449 for( y = 0 ; y < cur_hgt ; y++ )
9451 if( is_mirror_grid(&cave[y][x]))
9453 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9454 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9456 if( !cave[y][x].m_idx )