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) && !have_flag(f_flags_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) && !have_flag(f_flags_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) && !have_flag(f_flags_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);
988 /* Ignore permanent grid */
989 if (cave_perma_bold(y, x)) break;
991 /* Ignore grid without enough space */
992 if (!have_flag(f_flags_bold(y, x), FF_FLOOR)) break;
994 /* Place a shallow lava */
995 cave_set_feat(y, x, FEAT_SHAL_LAVA);
1000 /* Ignore permanent grid */
1001 if (cave_perma_bold(y, x)) break;
1003 /* Place a deep lava */
1004 cave_set_feat(y, x, FEAT_DEEP_LAVA);
1014 /* Ignore permanent grid */
1015 if (cave_perma_bold(y, x)) break;
1017 /* Ignore grid without enough space */
1018 if (!have_flag(f_flags_bold(y, x), FF_FLOOR)) break;
1020 /* Place a shallow lava */
1021 cave_set_feat(y, x, FEAT_SHAL_WATER);
1026 /* Ignore permanent grid */
1027 if (cave_perma_bold(y, x)) break;
1029 /* Place a deep lava */
1030 cave_set_feat(y, x, FEAT_DEEP_WATER);
1035 /* Lite up the grid */
1039 /* Turn on the light */
1040 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
1042 c_ptr->info |= (CAVE_GLOW);
1050 update_local_illumination(y, x);
1053 if (player_can_see_bold(y, x)) obvious = TRUE;
1055 /* Mega-Hack -- Update the monster in the affected grid */
1056 /* This allows "spear of light" (etc) to work "correctly" */
1057 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1063 /* Darken the grid */
1067 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(c_ptr);
1070 /* Turn off the light. */
1073 for (j = 0; j < 9; j++)
1075 int by = y + ddy_ddd[j];
1076 int bx = x + ddx_ddd[j];
1078 if (in_bounds2(by, bx))
1080 cave_type *cc_ptr = &cave[by][bx];
1082 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
1090 if (!do_dark) break;
1092 c_ptr->info &= ~(CAVE_GLOW);
1094 /* Hack -- Forget "boring" grids */
1095 if (!have_flag(f_ptr->flags, FF_REMEMBER))
1098 c_ptr->info &= ~(CAVE_MARK);
1107 update_local_illumination(y, x);
1110 if (player_can_see_bold(y, x)) obvious = TRUE;
1112 /* Mega-Hack -- Update the monster in the affected grid */
1113 /* This allows "spear of light" (etc) to work "correctly" */
1114 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1123 if (is_mirror_grid(c_ptr))
1126 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1128 msg_print("The mirror was crashed!");
1130 remove_mirror(y, x);
1131 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1137 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
1140 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1142 msg_print("The mirror was crashed!");
1144 remove_mirror(y, x);
1145 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1150 case GF_DISINTEGRATE:
1152 /* Destroy mirror */
1153 if (is_mirror_grid(c_ptr)) remove_mirror(y, x);
1155 /* Permanent features don't get effect */
1156 /* But not protect monsters and other objects */
1157 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
1159 cave_alter_feat(y, x, FF_HURT_DISI);
1161 /* Update some things -- similar to GF_KILL_WALL */
1162 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
1169 /* Return "Anything seen?" */
1176 * We are called from "project()" to "damage" objects
1178 * We are called both for "beam" effects and "ball" effects.
1180 * Perhaps we should only SOMETIMES damage things on the ground.
1182 * The "r" parameter is the "distance from ground zero".
1184 * Note that we determine if the player can "see" anything that happens
1185 * by taking into account: blindness, line-of-sight, and illumination.
1187 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1189 * We return "TRUE" if the effect of the projection is "obvious".
1191 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1193 cave_type *c_ptr = &cave[y][x];
1195 s16b this_o_idx, next_o_idx = 0;
1197 bool obvious = FALSE;
1198 bool known = player_has_los_bold(y, x);
1200 u32b flgs[TR_FLAG_SIZE];
1202 char o_name[MAX_NLEN];
1205 bool is_potion = FALSE;
1209 who = who ? who : 0;
1211 /* Reduce damage by distance */
1212 dam = (dam + r) / (r + 1);
1215 /* Scan all objects in the grid */
1216 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1218 /* Acquire object */
1219 object_type *o_ptr = &o_list[this_o_idx];
1221 bool is_art = FALSE;
1222 bool ignore = FALSE;
1223 bool do_kill = FALSE;
1225 cptr note_kill = NULL;
1228 /* Get the "plural"-ness */
1229 bool plural = (o_ptr->number > 1);
1232 /* Acquire next object */
1233 next_o_idx = o_ptr->next_o_idx;
1235 /* Extract the flags */
1236 object_flags(o_ptr, flgs);
1238 /* Check for artifact */
1239 if (object_is_artifact(o_ptr)) is_art = TRUE;
1241 /* Analyze the type */
1244 /* Acid -- Lots of things */
1247 if (hates_acid(o_ptr))
1251 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1253 note_kill = (plural ? " melt!" : " melts!");
1256 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1261 /* Elec -- Rings and Wands */
1264 if (hates_elec(o_ptr))
1268 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1270 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1273 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1278 /* Fire -- Flammable objects */
1281 if (hates_fire(o_ptr))
1285 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1287 note_kill = (plural ? " burn up!" : " burns up!");
1290 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1295 /* Cold -- potions and flasks */
1298 if (hates_cold(o_ptr))
1301 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1303 note_kill = (plural ? " shatter!" : " shatters!");
1307 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1315 if (hates_fire(o_ptr))
1319 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1321 note_kill = (plural ? " burn up!" : " burns up!");
1324 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1326 if (hates_elec(o_ptr))
1331 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1333 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1336 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1344 if (hates_fire(o_ptr))
1348 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1350 note_kill = (plural ? " burn up!" : " burns up!");
1353 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1355 if (hates_cold(o_ptr))
1360 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1362 note_kill = (plural ? " shatter!" : " shatters!");
1365 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1370 /* Hack -- break potions and such */
1376 if (hates_cold(o_ptr))
1379 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1381 note_kill = (plural ? " shatter!" : " shatters!");
1389 /* Mana and Chaos -- destroy everything */
1396 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1398 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1404 case GF_DISINTEGRATE:
1408 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1410 note_kill = (plural ? " evaporate!" : " evaporates!");
1420 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1422 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1425 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1426 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1430 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1434 if (object_is_cursed(o_ptr))
1438 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1440 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1449 identify_item(o_ptr);
1451 /* Auto-inscription */
1452 autopick_alter_item((-this_o_idx), FALSE);
1460 /* Chests are noticed only if trapped or locked */
1461 if (o_ptr->tval == TV_CHEST)
1463 /* Disarm/Unlock traps */
1464 if (o_ptr->pval > 0)
1466 /* Disarm or Unlock */
1467 o_ptr->pval = (0 - o_ptr->pval);
1470 object_known(o_ptr);
1473 if (known && o_ptr->marked)
1476 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1478 msg_print("Click!");
1490 if (o_ptr->tval == TV_CORPSE)
1495 if (!who || is_pet(&m_list[who]))
1496 mode |= PM_FORCE_PET;
1498 for (i = 0; i < o_ptr->number ; i++)
1500 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1501 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1506 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1508 note_kill = (plural ? " become dust." : " becomes dust.");
1513 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1516 note_kill = "À¸¤Ê֤ä¿¡£";
1518 note_kill = "rivived.";
1521 else if (!note_kill)
1524 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1526 note_kill = (plural ? " become dust." : " becomes dust.");
1538 /* Attempt to destroy the object */
1541 /* Effect "observed" */
1542 if (known && o_ptr->marked)
1545 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1548 /* Artifacts, and other objects, get to resist */
1549 if (is_art || ignore)
1551 /* Observe the resist */
1552 if (known && o_ptr->marked)
1555 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1558 msg_format("The %s %s unaffected!",
1559 o_name, (plural ? "are" : "is"));
1568 /* Describe if needed */
1569 if (known && o_ptr->marked && note_kill)
1572 msg_format("%s¤Ï%s", o_name, note_kill);
1574 msg_format("The %s%s", o_name, note_kill);
1579 k_idx = o_ptr->k_idx;
1580 is_potion = object_is_potion(o_ptr);
1583 /* Delete the object */
1584 delete_object_idx(this_o_idx);
1586 /* Potions produce effects when 'shattered' */
1589 (void)potion_smash_effect(who, y, x, k_idx);
1598 /* Return "Anything seen?" */
1604 * Helper function for "project()" below.
1606 * Handle a beam/bolt/ball causing damage to a monster.
1608 * This routine takes a "source monster" (by index) which is mostly used to
1609 * determine if the player is causing the damage, and a "radius" (see below),
1610 * which is used to decrease the power of explosions with distance, and a
1611 * location, via integers which are modified by certain types of attacks
1612 * (polymorph and teleport being the obvious ones), a default damage, which
1613 * is modified as needed based on various properties, and finally a "damage
1614 * type" (see below).
1616 * Note that this routine can handle "no damage" attacks (like teleport) by
1617 * taking a "zero" damage, and can even take "parameters" to attacks (like
1618 * confuse) by accepting a "damage", using it to calculate the effect, and
1619 * then setting the damage to zero. Note that the "damage" parameter is
1620 * divided by the radius, so monsters not at the "epicenter" will not take
1621 * as much damage (or whatever)...
1623 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1624 * may result in a dereference of an invalid pointer. XXX XXX XXX
1626 * Various messages are produced, and damage is applied.
1628 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1629 * actually be "made" of that substance, or "breathe" big balls of it.
1631 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1634 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1635 * and hurts evil less. If can breath nether, then it resists it as well.
1637 * Damage reductions use the following formulas:
1638 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1639 * gives avg damage of .655, ranging from .858 to .500
1640 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1641 * gives avg damage of .544, ranging from .714 to .417
1642 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1643 * gives avg damage of .444, ranging from .556 to .333
1644 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1645 * gives avg damage of .327, ranging from .427 to .250
1646 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1647 * gives something simple.
1649 * In this function, "result" messages are postponed until the end, where
1650 * the "note" string is appended to the monster name, if not NULL. So,
1651 * to make a spell have "no effect" just set "note" to NULL. You should
1652 * also set "notice" to FALSE, or the player will learn what the spell does.
1654 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1656 /* "flg" was added. */
1657 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1661 cave_type *c_ptr = &cave[y][x];
1663 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1665 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1669 /* Is the monster "seen"? */
1670 bool seen = m_ptr->ml;
1672 bool slept = (bool)(m_ptr->csleep > 0);
1674 /* Were the effects "obvious" (if seen)? */
1675 bool obvious = FALSE;
1677 /* Can the player know about this effect? */
1678 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1680 /* Can the player see the source of this effect? */
1681 bool see_s = ((who <= 0) || m_list[who].ml);
1683 /* Were the effects "irrelevant"? */
1684 bool skipped = FALSE;
1686 /* Gets the monster angry at the source of the effect? */
1687 bool get_angry = FALSE;
1689 /* Polymorph setting (true or false) */
1690 bool do_poly = FALSE;
1692 /* Teleport setting (max distance) */
1695 /* Confusion setting (amount to confuse) */
1698 /* Stunning setting (amount to stun) */
1701 /* Sleep amount (amount to sleep) */
1704 /* Fear amount (amount to fear) */
1707 /* Time amount (amount to time) */
1710 bool heal_leper = FALSE;
1712 /* Hold the monster name */
1721 /* Assume no note */
1724 /* Assume a default death */
1725 cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
1730 int caster_lev = (who > 0) ? r_info[m_list[who].r_idx].level : p_ptr->lev * 2;
1733 if (!c_ptr->m_idx) return (FALSE);
1735 /* Never affect projector */
1736 if (who && (c_ptr->m_idx == who)) return (FALSE);
1737 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1738 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1740 /* Don't affect already death monsters */
1741 /* Prevents problems with chain reactions of exploding monsters */
1742 if (m_ptr->hp < 0) return (FALSE);
1744 /* Reduce damage by distance */
1745 dam = (dam + r) / (r + 1);
1748 /* Get the monster name (BEFORE polymorphing) */
1749 monster_desc(m_name, m_ptr, 0);
1752 /* Get the monster possessive ("his"/"her"/"its") */
1753 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1757 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1759 /* Analyze the damage type */
1762 /* Magic Missile -- pure damage */
1765 if (seen) obvious = TRUE;
1767 if (r_ptr->flagsr & RFR_RES_ALL)
1770 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1772 note = " is immune.";
1775 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1784 if (seen) obvious = TRUE;
1786 if (r_ptr->flagsr & RFR_RES_ALL)
1789 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1791 note = " is immune.";
1794 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1797 if (r_ptr->flagsr & RFR_IM_ACID)
1800 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1802 note = " resists a lot.";
1806 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1814 if (seen) obvious = TRUE;
1816 if (r_ptr->flagsr & RFR_RES_ALL)
1819 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1821 note = " is immune.";
1824 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1827 if (r_ptr->flagsr & RFR_IM_ELEC)
1830 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1832 note = " resists a lot.";
1836 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1844 if (seen) obvious = TRUE;
1846 if (r_ptr->flagsr & RFR_RES_ALL)
1849 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1851 note = " is immune.";
1854 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1857 if (r_ptr->flagsr & RFR_IM_FIRE)
1860 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1862 note = " resists a lot.";
1866 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1868 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1871 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1873 note = " is hit hard.";
1877 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1885 if (seen) obvious = TRUE;
1887 if (r_ptr->flagsr & RFR_RES_ALL)
1890 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1892 note = " is immune.";
1895 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1898 if (r_ptr->flagsr & RFR_IM_COLD)
1901 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1903 note = " resists a lot.";
1907 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1909 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1912 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1914 note = " is hit hard.";
1918 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1926 if (seen) obvious = TRUE;
1928 if (r_ptr->flagsr & RFR_RES_ALL)
1931 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1933 note = " is immune.";
1936 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1939 if (r_ptr->flagsr & RFR_IM_POIS)
1942 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1944 note = " resists a lot.";
1948 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1956 if (seen) obvious = TRUE;
1958 if (r_ptr->flagsr & RFR_RES_ALL)
1961 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1963 note = " is immune.";
1966 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1969 if (r_ptr->flagsr & RFR_IM_POIS)
1972 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
1977 dam *= 3; dam /= randint1(6) + 6;
1978 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1980 else if (one_in_(3)) do_poly = TRUE;
1984 /* Hellfire -- hurts Evil */
1987 if (seen) obvious = TRUE;
1989 if (r_ptr->flagsr & RFR_RES_ALL)
1992 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1994 note = " is immune.";
1997 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2000 if (r_ptr->flags3 & RF3_GOOD)
2004 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2006 note = " is hit hard.";
2009 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
2014 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2017 if (seen) obvious = TRUE;
2019 if (r_ptr->flagsr & RFR_RES_ALL)
2022 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2024 note = " is immune.";
2027 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2030 if (r_ptr->flags3 & RF3_GOOD)
2034 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2036 note = " is immune.";
2039 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
2041 else if (r_ptr->flags3 & RF3_EVIL)
2045 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2047 note = " is hit hard.";
2050 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
2055 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2060 dam *= 3; dam /= randint1(6) + 6;
2065 /* Arrow -- XXX no defense */
2068 if (seen) obvious = TRUE;
2070 if (r_ptr->flagsr & RFR_RES_ALL)
2073 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2075 note = " is immune.";
2078 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2084 /* Plasma -- XXX perhaps check ELEC or FIRE */
2087 if (seen) obvious = TRUE;
2089 if (r_ptr->flagsr & RFR_RES_ALL)
2092 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2094 note = " is immune.";
2097 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2100 if (r_ptr->flagsr & RFR_RES_PLAS)
2103 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2108 dam *= 3; dam /= randint1(6) + 6;
2109 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
2114 /* Nether -- see above */
2117 if (seen) obvious = TRUE;
2119 if (r_ptr->flagsr & RFR_RES_ALL)
2122 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2124 note = " is immune.";
2127 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2130 if (r_ptr->flagsr & RFR_RES_NETH)
2132 if (r_ptr->flags3 & RF3_UNDEAD)
2135 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2137 note = " is immune.";
2141 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2146 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2151 dam *= 3; dam /= randint1(6) + 6;
2153 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
2155 else if (r_ptr->flags3 & RF3_EVIL)
2159 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2161 note = " resists somewhat.";
2164 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2169 /* Water (acid) damage -- Water spirits/elementals are immune */
2172 if (seen) obvious = TRUE;
2174 if (r_ptr->flagsr & RFR_RES_ALL)
2177 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2179 note = " is immune.";
2182 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2185 if (r_ptr->flagsr & RFR_RES_WATE)
2187 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
2190 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2192 note = " is immune.";
2200 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2205 dam *= 3; dam /= randint1(6) + 6;
2207 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
2212 /* Chaos -- Chaos breathers resist */
2215 if (seen) obvious = TRUE;
2217 if (r_ptr->flagsr & RFR_RES_ALL)
2220 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2222 note = " is immune.";
2225 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2228 if (r_ptr->flagsr & RFR_RES_CHAO)
2231 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2236 dam *= 3; dam /= randint1(6) + 6;
2237 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
2239 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
2242 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2244 note = " resists somewhat.";
2247 dam *= 3; dam /= randint1(6) + 6;
2248 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2253 do_conf = (5 + randint1(11) + r) / (r + 1);
2258 /* Shards -- Shard breathers resist */
2261 if (seen) obvious = TRUE;
2263 if (r_ptr->flagsr & RFR_RES_ALL)
2266 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2268 note = " is immune.";
2271 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2274 if (r_ptr->flagsr & RFR_RES_SHAR)
2277 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2282 dam *= 3; dam /= randint1(6) + 6;
2283 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2288 /* Rocket: Shard resistance helps */
2291 if (seen) obvious = TRUE;
2293 if (r_ptr->flagsr & RFR_RES_ALL)
2296 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2298 note = " is immune.";
2301 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2304 if (r_ptr->flagsr & RFR_RES_SHAR)
2307 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2309 note = " resists somewhat.";
2313 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2319 /* Sound -- Sound breathers resist */
2322 if (seen) obvious = TRUE;
2324 if (r_ptr->flagsr & RFR_RES_ALL)
2327 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2329 note = " is immune.";
2332 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2335 if (r_ptr->flagsr & RFR_RES_SOUN)
2338 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2343 dam *= 2; dam /= randint1(6) + 6;
2344 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
2346 else do_stun = (10 + randint1(15) + r) / (r + 1);
2353 if (seen) obvious = TRUE;
2355 if (r_ptr->flagsr & RFR_RES_ALL)
2358 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2360 note = " is immune.";
2363 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2366 if (r_ptr->flags3 & RF3_NO_CONF)
2369 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2374 dam *= 3; dam /= randint1(6) + 6;
2375 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2377 else do_conf = (10 + randint1(15) + r) / (r + 1);
2381 /* Disenchantment -- Breathers and Disenchanters resist */
2384 if (seen) obvious = TRUE;
2386 if (r_ptr->flagsr & RFR_RES_ALL)
2389 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2391 note = " is immune.";
2394 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2397 if (r_ptr->flagsr & RFR_RES_DISE)
2400 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2405 dam *= 3; dam /= randint1(6) + 6;
2406 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
2411 /* Nexus -- Breathers and Existers resist */
2414 if (seen) obvious = TRUE;
2416 if (r_ptr->flagsr & RFR_RES_ALL)
2419 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2421 note = " is immune.";
2424 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2427 if (r_ptr->flagsr & RFR_RES_NEXU)
2430 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2435 dam *= 3; dam /= randint1(6) + 6;
2436 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
2444 if (seen) obvious = TRUE;
2446 if (r_ptr->flagsr & RFR_RES_ALL)
2449 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2451 note = " is immune.";
2454 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2457 if (r_ptr->flagsr & RFR_RES_WALL)
2460 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2465 dam *= 3; dam /= randint1(6) + 6;
2466 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
2468 else do_stun = (randint1(15) + r) / (r + 1);
2472 /* Inertia -- breathers resist */
2475 if (seen) obvious = TRUE;
2477 if (r_ptr->flagsr & RFR_RES_ALL)
2480 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2482 note = " is immune.";
2485 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2488 if (r_ptr->flagsr & RFR_RES_INER)
2491 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2496 dam *= 3; dam /= randint1(6) + 6;
2497 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
2501 /* Powerful monsters can resist */
2502 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2503 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2507 /* Normal monsters slow down */
2513 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2515 note = " starts moving slower.";
2518 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2519 if (c_ptr->m_idx == p_ptr->riding)
2520 p_ptr->update |= (PU_BONUS);
2526 /* Time -- breathers resist */
2529 if (seen) obvious = TRUE;
2531 if (r_ptr->flagsr & RFR_RES_ALL)
2534 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2536 note = " is immune.";
2539 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2542 if (r_ptr->flagsr & RFR_RES_TIME)
2545 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2550 dam *= 3; dam /= randint1(6) + 6;
2551 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
2553 else do_time = (dam + 1) / 2;
2557 /* Gravity -- breathers resist */
2560 bool resist_tele = FALSE;
2562 if (seen) obvious = TRUE;
2564 if (r_ptr->flagsr & RFR_RES_ALL)
2567 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2569 note = " is immune.";
2572 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2575 if (r_ptr->flagsr & RFR_RES_TELE)
2577 if (r_ptr->flags1 & (RF1_UNIQUE))
2579 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2581 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2583 note = " is unaffected!";
2588 else if (r_ptr->level > randint1(100))
2590 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2592 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2601 if (!resist_tele) do_dist = 10;
2603 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2605 if (r_ptr->flagsr & RFR_RES_GRAV)
2608 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2613 dam *= 3; dam /= randint1(6) + 6;
2615 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
2620 /* Powerful monsters can resist */
2621 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2622 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2626 /* Normal monsters slow down */
2632 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2634 note = " starts moving slower.";
2637 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2638 if (c_ptr->m_idx == p_ptr->riding)
2639 p_ptr->update |= (PU_BONUS);
2643 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2645 /* Attempt a saving throw */
2646 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2647 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2651 /* No obvious effect */
2653 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2655 note = " is unaffected!";
2669 if (seen) obvious = TRUE;
2671 if (r_ptr->flagsr & RFR_RES_ALL)
2674 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2676 note = " is immune.";
2679 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2687 case GF_DISINTEGRATE:
2689 if (seen) obvious = TRUE;
2691 if (r_ptr->flagsr & RFR_RES_ALL)
2694 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2696 note = " is immune.";
2699 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2702 if (r_ptr->flags3 & RF3_HURT_ROCK)
2704 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2706 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2707 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2709 note = " loses some skin!";
2710 note_dies = " evaporates!";
2720 if (seen) obvious = TRUE;
2722 /* PSI only works if the monster can see you! -- RG */
2723 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2726 if (seen) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name);
2728 if (seen) msg_format("%^s can't see you, and isn't affected!", m_name);
2734 if (r_ptr->flagsr & RFR_RES_ALL)
2737 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2739 note = " is immune.";
2742 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2745 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2749 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2751 note = " is immune!";
2753 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2756 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2757 (r_ptr->flags3 & RF3_ANIMAL) ||
2758 (r_ptr->level > randint1(3 * dam)))
2762 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2769 * Powerful demons & undead can turn a mindcrafter's
2770 * attacks back on them
2772 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2773 (r_ptr->level > p_ptr->lev / 2) &&
2778 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2780 msg_format("%^s%s corrupted mind backlashes your attack!",
2781 m_name, (seen ? "'s" : "s"));
2785 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2788 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2790 msg_print("You resist the effects!");
2796 /* Injure +/- confusion */
2797 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2798 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2801 switch (randint1(4))
2804 set_confused(p_ptr->confused + 3 + randint1(dam));
2807 set_stun(p_ptr->stun + randint1(dam));
2811 if (r_ptr->flags3 & RF3_NO_FEAR)
2813 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2815 note = " is unaffected.";
2819 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2823 if (!p_ptr->free_act)
2824 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2833 if ((dam > 0) && one_in_(4))
2835 switch (randint1(4))
2838 do_conf = 3 + randint1(dam);
2841 do_stun = 3 + randint1(dam);
2844 do_fear = 3 + randint1(dam);
2848 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2850 note = " falls asleep!";
2853 do_sleep = 3 + randint1(dam);
2859 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2861 note_dies = " collapses, a mindless husk.";
2869 if (seen) obvious = TRUE;
2871 if (r_ptr->flagsr & RFR_RES_ALL)
2874 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2876 note = " is immune.";
2879 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2882 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2886 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2888 note = " is immune!";
2892 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2893 (r_ptr->flags3 & RF3_ANIMAL) ||
2894 (r_ptr->level > randint1(3 * dam)))
2898 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2905 * Powerful demons & undead can turn a mindcrafter's
2906 * attacks back on them
2908 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2909 (r_ptr->level > p_ptr->lev / 2) &&
2914 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2916 msg_format("%^s%s corrupted mind backlashes your attack!",
2917 m_name, (seen ? "'s" : "s"));
2921 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2924 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2926 msg_print("You resist the effects!");
2932 /* Injure + mana drain */
2933 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2935 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
2937 msg_print("Your psychic energy is drained!");
2940 p_ptr->csp -= damroll(5, dam) / 2;
2941 if (p_ptr->csp < 0) p_ptr->csp = 0;
2942 p_ptr->redraw |= PR_MANA;
2943 p_ptr->window |= (PW_SPELL);
2944 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2951 int b = damroll(5, dam) / 4;
2953 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª", m_name);
2955 msg_format("You convert %s%s pain into psychic energy!",
2956 m_name, (seen ? "'s" : "s"));
2959 b = MIN(p_ptr->msp, p_ptr->csp + b);
2961 p_ptr->redraw |= PR_MANA;
2962 p_ptr->window |= (PW_SPELL);
2966 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2968 note_dies = " collapses, a mindless husk.";
2974 case GF_TELEKINESIS:
2976 if (seen) obvious = TRUE;
2978 if (r_ptr->flagsr & RFR_RES_ALL)
2981 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2983 note = " is immune.";
2986 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2991 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2996 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2998 /* Attempt a saving throw */
2999 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3000 (r_ptr->level > 5 + randint1(dam)))
3004 /* No obvious effect */
3010 /* Psycho-spear -- powerful magic missile */
3013 if (seen) obvious = TRUE;
3015 if (r_ptr->flagsr & RFR_RES_ALL)
3018 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3020 note = " is immune.";
3023 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3029 /* Meteor -- powerful magic missile */
3032 if (seen) obvious = TRUE;
3034 if (r_ptr->flagsr & RFR_RES_ALL)
3037 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3039 note = " is immune.";
3042 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3050 if (!is_hostile(m_ptr)) break;
3052 if (seen) obvious = TRUE;
3054 if (r_ptr->flagsr & RFR_RES_ALL)
3057 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3059 note = " is immune.";
3062 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3065 /* Attempt a saving throw */
3066 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
3067 (r_ptr->flags3 & RF3_NO_CONF) ||
3068 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3070 /* Memorize a flag */
3071 if (r_ptr->flags3 & RF3_NO_CONF)
3073 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3080 * Powerful demons & undead can turn a mindcrafter's
3081 * attacks back on them
3083 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
3084 (r_ptr->level > p_ptr->lev / 2) &&
3089 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
3091 msg_format("%^s%s corrupted mind backlashes your attack!",
3092 m_name, (seen ? "'s" : "s"));
3096 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3099 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3101 msg_print("You resist the effects!");
3107 /* Confuse, stun, terrify */
3108 switch (randint1(4))
3111 set_stun(p_ptr->stun + dam / 2);
3114 set_confused(p_ptr->confused + dam / 2);
3118 if (r_ptr->flags3 & RF3_NO_FEAR)
3120 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3122 note = " is unaffected.";
3126 set_afraid(p_ptr->afraid + dam);
3133 /* No obvious effect */
3135 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3137 note = " is unaffected!";
3145 if ((dam > 29) && (randint1(100) < dam))
3148 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3150 note = " is in your thrall!";
3157 switch (randint1(4))
3171 /* No "real" damage */
3178 /* Ice -- Cold + Cuts + Stun */
3181 if (seen) obvious = TRUE;
3183 if (r_ptr->flagsr & RFR_RES_ALL)
3186 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3188 note = " is immune.";
3191 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3194 do_stun = (randint1(15) + 1) / (r + 1);
3195 if (r_ptr->flagsr & RFR_IM_COLD)
3198 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3200 note = " resists a lot.";
3204 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
3206 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3209 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3211 note = " is hit hard.";
3215 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3224 if (seen) obvious = TRUE;
3226 if (r_ptr->flagsr & RFR_RES_ALL)
3229 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3231 note = " is immune.";
3234 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3237 if (!monster_living(r_ptr))
3241 if (is_original_ap(m_ptr))
3243 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3244 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3245 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3250 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3252 note = " is unaffected!";
3258 else do_time = (dam+7)/8;
3266 if (seen) obvious = TRUE;
3268 if (r_ptr->flagsr & RFR_RES_ALL)
3271 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3273 note = " is immune.";
3276 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3279 if (!monster_living(r_ptr))
3283 if (is_original_ap(m_ptr))
3285 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3286 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3287 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3292 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3294 note = " is immune.";
3300 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3301 (randint1(888) != 666)) ||
3302 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
3303 randint1(100) != 66))
3306 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3318 /* Polymorph monster (Use "dam" as "power") */
3321 if (seen) obvious = TRUE;
3323 if (r_ptr->flagsr & RFR_RES_ALL)
3326 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3328 note = " is immune.";
3331 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3334 /* Attempt to polymorph (see below) */
3337 /* Powerful monsters can resist */
3338 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3339 (r_ptr->flags1 & RF1_QUESTOR) ||
3340 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3343 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3345 note = " is unaffected!";
3352 /* No "real" damage */
3359 /* Clone monsters (Ignore "dam") */
3362 if (seen) obvious = TRUE;
3364 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
3367 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3369 note = " is unaffected!";
3375 m_ptr->hp = m_ptr->maxhp;
3377 /* Attempt to clone. */
3378 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3381 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3389 /* No "real" damage */
3396 /* Heal Monster (use "dam" as amount of healing) */
3399 if (seen) obvious = TRUE;
3404 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3406 if (m_ptr->maxhp < m_ptr->max_maxhp)
3409 msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3411 msg_format("%^s recovers %s vitality.", m_name, m_poss);
3413 m_ptr->maxhp = m_ptr->max_maxhp;
3419 if (seen) obvious = TRUE;
3424 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3429 msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3431 msg_format("%^s is no longer stunned.", m_name);
3435 if (m_ptr->confused)
3438 msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3440 msg_format("%^s is no longer confused.", m_name);
3442 m_ptr->confused = 0;
3447 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3449 msg_format("%^s recovers %s courage.", m_name, m_poss);
3455 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3458 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3460 chg_virtue(V_VITALITY, 1);
3462 if (r_ptr->flags1 & RF1_UNIQUE)
3463 chg_virtue(V_INDIVIDUALISM, 1);
3465 if (is_friendly(m_ptr))
3466 chg_virtue(V_HONOUR, 1);
3467 else if (!(r_ptr->flags3 & RF3_EVIL))
3469 if (r_ptr->flags3 & RF3_GOOD)
3470 chg_virtue(V_COMPASSION, 2);
3472 chg_virtue(V_COMPASSION, 1);
3475 if (m_ptr->r_idx == MON_LEPER)
3478 chg_virtue(V_COMPASSION, 5);
3481 if (r_ptr->flags3 & RF3_ANIMAL)
3482 chg_virtue(V_NATURE, 1);
3484 /* Redraw (later) if needed */
3485 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3486 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3490 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3492 note = " looks healthier.";
3496 /* No "real" damage */
3502 /* Speed Monster (Ignore "dam") */
3505 if (seen) obvious = TRUE;
3511 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3513 note = " starts moving faster.";
3516 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3518 if (c_ptr->m_idx == p_ptr->riding)
3519 p_ptr->update |= (PU_BONUS);
3521 if (r_ptr->flags1 & RF1_UNIQUE)
3522 chg_virtue(V_INDIVIDUALISM, 1);
3523 if (is_friendly(m_ptr))
3524 chg_virtue(V_HONOUR, 1);
3526 /* No "real" damage */
3532 /* Slow Monster (Use "dam" as "power") */
3535 if (seen) obvious = TRUE;
3537 if (r_ptr->flagsr & RFR_RES_ALL)
3540 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3542 note = " is immune.";
3545 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3548 /* Powerful monsters can resist */
3549 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3550 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3553 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3555 note = " is unaffected!";
3561 /* Normal monsters slow down */
3567 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3569 note = " starts moving slower.";
3572 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3574 if (c_ptr->m_idx == p_ptr->riding)
3575 p_ptr->update |= (PU_BONUS);
3578 /* No "real" damage */
3584 /* Sleep (Use "dam" as "power") */
3587 if (seen) obvious = TRUE;
3589 if (r_ptr->flagsr & RFR_RES_ALL)
3592 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3594 note = " is immune.";
3597 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3600 /* Attempt a saving throw */
3601 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3602 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3603 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3605 /* Memorize a flag */
3606 if (r_ptr->flags3 & RF3_NO_SLEEP)
3608 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3611 /* No obvious effect */
3613 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3615 note = " is unaffected!";
3622 /* Go to sleep (much) later */
3624 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3626 note = " falls asleep!";
3632 /* No "real" damage */
3638 /* Sleep (Use "dam" as "power") */
3639 case GF_STASIS_EVIL:
3641 if (seen) obvious = TRUE;
3643 if (r_ptr->flagsr & RFR_RES_ALL)
3646 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3648 note = " is immune.";
3651 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3654 /* Attempt a saving throw */
3655 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3656 !(r_ptr->flags3 & RF3_EVIL) ||
3657 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3660 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3662 note = " is unaffected!";
3669 /* Go to sleep (much) later */
3671 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3673 note = " is suspended!";
3679 /* No "real" damage */
3684 /* Sleep (Use "dam" as "power") */
3687 if (seen) obvious = TRUE;
3689 if (r_ptr->flagsr & RFR_RES_ALL)
3692 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3694 note = " is immune.";
3697 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3700 /* Attempt a saving throw */
3701 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3702 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3705 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3707 note = " is unaffected!";
3714 /* Go to sleep (much) later */
3716 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3718 note = " is suspended!";
3724 /* No "real" damage */
3733 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3734 vir = virtue_number(V_HARMONY);
3737 dam += p_ptr->virtues[vir-1]/10;
3740 vir = virtue_number(V_INDIVIDUALISM);
3743 dam -= p_ptr->virtues[vir-1]/20;
3746 if (seen) obvious = TRUE;
3748 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3751 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3753 note = " is immune.";
3756 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3760 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3763 /* Attempt a saving throw */
3764 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3765 (r_ptr->flags3 & RF3_NO_CONF) ||
3766 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3767 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3769 /* Memorize a flag */
3770 if (r_ptr->flags3 & RF3_NO_CONF)
3772 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3776 /* No obvious effect */
3778 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3780 note = " is unaffected!";
3785 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3787 else if (p_ptr->cursed & TRC_AGGRAVATE)
3790 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3792 note = " hates you too much!";
3795 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3800 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3802 note = " suddenly seems friendly!";
3807 chg_virtue(V_INDIVIDUALISM, -1);
3808 if (r_ptr->flags3 & RF3_ANIMAL)
3809 chg_virtue(V_NATURE, 1);
3812 /* No "real" damage */
3817 /* Control undead */
3818 case GF_CONTROL_UNDEAD:
3821 if (seen) obvious = TRUE;
3823 vir = virtue_number(V_UNLIFE);
3826 dam += p_ptr->virtues[vir-1]/10;
3829 vir = virtue_number(V_INDIVIDUALISM);
3832 dam -= p_ptr->virtues[vir-1]/20;
3835 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3838 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3840 note = " is immune.";
3843 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3847 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3850 /* Attempt a saving throw */
3851 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3852 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3853 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3854 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3856 /* No obvious effect */
3858 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3860 note = " is unaffected!";
3864 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3866 else if (p_ptr->cursed & TRC_AGGRAVATE)
3869 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3871 note = " hates you too much!";
3874 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3879 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3881 note = " is in your thrall!";
3887 /* No "real" damage */
3893 case GF_CONTROL_DEMON:
3896 if (seen) obvious = TRUE;
3898 vir = virtue_number(V_UNLIFE);
3901 dam += p_ptr->virtues[vir-1]/10;
3904 vir = virtue_number(V_INDIVIDUALISM);
3907 dam -= p_ptr->virtues[vir-1]/20;
3910 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3913 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3915 note = " is immune.";
3918 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3922 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3925 /* Attempt a saving throw */
3926 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3927 (!(r_ptr->flags3 & RF3_DEMON)) ||
3928 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3929 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3931 /* No obvious effect */
3933 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3935 note = " is unaffected!";
3939 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3941 else if (p_ptr->cursed & TRC_AGGRAVATE)
3944 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3946 note = " hates you too much!";
3949 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3954 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3956 note = " is in your thrall!";
3962 /* No "real" damage */
3968 case GF_CONTROL_ANIMAL:
3972 if (seen) obvious = TRUE;
3974 vir = virtue_number(V_NATURE);
3977 dam += p_ptr->virtues[vir-1]/10;
3980 vir = virtue_number(V_INDIVIDUALISM);
3983 dam -= p_ptr->virtues[vir-1]/20;
3986 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3989 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3991 note = " is immune.";
3994 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3998 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4001 /* Attempt a saving throw */
4002 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4003 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
4004 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4005 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4006 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4008 /* Memorize a flag */
4009 if (r_ptr->flags3 & (RF3_NO_CONF))
4011 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4015 /* No obvious effect */
4017 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4019 note = " is unaffected!";
4023 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4025 else if (p_ptr->cursed & TRC_AGGRAVATE)
4028 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4030 note = " hates you too much!";
4033 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4038 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4040 note = " is tamed!";
4045 if (r_ptr->flags3 & RF3_ANIMAL)
4046 chg_virtue(V_NATURE, 1);
4049 /* No "real" damage */
4055 case GF_CONTROL_LIVING:
4059 vir = virtue_number(V_UNLIFE);
4060 if (seen) obvious = TRUE;
4062 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4063 vir = virtue_number(V_UNLIFE);
4066 dam -= p_ptr->virtues[vir-1]/10;
4069 vir = virtue_number(V_INDIVIDUALISM);
4072 dam -= p_ptr->virtues[vir-1]/20;
4075 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4076 if (dam < 1) dam = 1;
4078 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4080 msg_format("You stare into %s.", m_name);
4082 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4085 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4087 note = " is immune.";
4090 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4094 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4097 /* Attempt a saving throw */
4098 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4099 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4100 !monster_living(r_ptr) ||
4101 ((r_ptr->level+10) > randint1(dam)))
4104 /* No obvious effect */
4106 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4108 note = " is unaffected!";
4112 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4114 else if (p_ptr->cursed & TRC_AGGRAVATE)
4117 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4119 note = " hates you too much!";
4122 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4127 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4129 note = " is tamed!";
4134 if (r_ptr->flags3 & RF3_ANIMAL)
4135 chg_virtue(V_NATURE, 1);
4138 /* No "real" damage */
4143 /* Confusion (Use "dam" as "power") */
4146 if (seen) obvious = TRUE;
4148 if (r_ptr->flagsr & RFR_RES_ALL)
4151 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4153 note = " is immune.";
4156 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4159 /* Get confused later */
4160 do_conf = damroll(3, (dam / 2)) + 1;
4162 /* Attempt a saving throw */
4163 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4164 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4165 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4167 /* Memorize a flag */
4168 if (r_ptr->flags3 & (RF3_NO_CONF))
4170 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4176 /* No obvious effect */
4178 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4180 note = " is unaffected!";
4186 /* No "real" damage */
4193 if (seen) obvious = TRUE;
4195 if (r_ptr->flagsr & RFR_RES_ALL)
4198 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4200 note = " is immune.";
4203 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4206 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
4208 /* Attempt a saving throw */
4209 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4210 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4215 /* No obvious effect */
4217 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4219 note = " is unaffected!";
4225 /* No "real" damage */
4233 /* Lite, but only hurts susceptible creatures */
4241 if (r_ptr->flagsr & RFR_RES_ALL)
4247 if (r_ptr->flags3 & (RF3_HURT_LITE))
4251 /* Obvious effect */
4254 /* Memorize the effects */
4255 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4258 /* Special effect */
4260 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4261 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4263 note = " cringes from the light!";
4264 note_dies = " shrivels away in the light!";
4269 /* Normally no damage */
4281 /* Lite -- opposite of Dark */
4284 if (seen) obvious = TRUE;
4286 if (r_ptr->flagsr & RFR_RES_ALL)
4289 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4291 note = " is immune.";
4294 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4297 if (r_ptr->flagsr & RFR_RES_LITE)
4300 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4305 dam *= 2; dam /= (randint1(6)+6);
4306 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4308 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4310 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4312 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4313 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4315 note = " cringes from the light!";
4316 note_dies = " shrivels away in the light!";
4325 /* Dark -- opposite of Lite */
4328 if (seen) obvious = TRUE;
4330 if (r_ptr->flagsr & RFR_RES_ALL)
4333 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4335 note = " is immune.";
4338 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4341 if (r_ptr->flagsr & RFR_RES_DARK)
4344 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4349 dam *= 2; dam /= (randint1(6)+6);
4350 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4359 if (r_ptr->flagsr & RFR_RES_ALL)
4364 /* Hurt by rock remover */
4365 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4372 /* Memorize the effects */
4373 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4376 /* Cute little message */
4378 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4379 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4381 note = " loses some skin!";
4382 note_dies = " dissolves!";
4387 /* Usually, ignore the effects */
4398 /* Teleport undead (Use "dam" as "power") */
4399 case GF_AWAY_UNDEAD:
4401 /* Only affect undead */
4402 if (r_ptr->flags3 & (RF3_UNDEAD))
4404 bool resists_tele = FALSE;
4406 if (r_ptr->flagsr & RFR_RES_TELE)
4408 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4410 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4412 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4414 note = " is unaffected!";
4417 resists_tele = TRUE;
4419 else if (r_ptr->level > randint1(100))
4421 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4423 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4428 resists_tele = TRUE;
4437 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4450 /* No "real" damage */
4456 /* Teleport evil (Use "dam" as "power") */
4459 /* Only affect evil */
4460 if (r_ptr->flags3 & (RF3_EVIL))
4462 bool resists_tele = FALSE;
4464 if (r_ptr->flagsr & RFR_RES_TELE)
4466 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4468 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4470 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4472 note = " is unaffected!";
4475 resists_tele = TRUE;
4477 else if (r_ptr->level > randint1(100))
4479 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4481 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4486 resists_tele = TRUE;
4495 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4508 /* No "real" damage */
4514 /* Teleport monster (Use "dam" as "power") */
4517 bool resists_tele = FALSE;
4518 if (r_ptr->flagsr & RFR_RES_TELE)
4520 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4522 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4524 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4526 note = " is unaffected!";
4529 resists_tele = TRUE;
4531 else if (r_ptr->level > randint1(100))
4533 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4535 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4540 resists_tele = TRUE;
4547 if (seen) obvious = TRUE;
4549 /* Prepare to teleport */
4553 /* No "real" damage */
4559 /* Turn undead (Use "dam" as "power") */
4560 case GF_TURN_UNDEAD:
4562 if (r_ptr->flagsr & RFR_RES_ALL)
4567 /* Only affect undead */
4568 if (r_ptr->flags3 & (RF3_UNDEAD))
4572 /* Learn about type */
4573 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4579 /* Apply some fear */
4580 do_fear = damroll(3, (dam / 2)) + 1;
4582 /* Attempt a saving throw */
4583 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4585 /* No obvious effect */
4587 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4589 note = " is unaffected!";
4604 /* No "real" damage */
4610 /* Turn evil (Use "dam" as "power") */
4613 if (r_ptr->flagsr & RFR_RES_ALL)
4618 /* Only affect evil */
4619 if (r_ptr->flags3 & (RF3_EVIL))
4623 /* Learn about type */
4624 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4630 /* Apply some fear */
4631 do_fear = damroll(3, (dam / 2)) + 1;
4633 /* Attempt a saving throw */
4634 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4636 /* No obvious effect */
4638 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4640 note = " is unaffected!";
4655 /* No "real" damage */
4661 /* Turn monster (Use "dam" as "power") */
4664 if (r_ptr->flagsr & RFR_RES_ALL)
4670 if (seen) obvious = TRUE;
4672 /* Apply some fear */
4673 do_fear = damroll(3, (dam / 2)) + 1;
4675 /* Attempt a saving throw */
4676 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4677 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4678 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4680 /* No obvious effect */
4682 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4684 note = " is unaffected!";
4691 /* No "real" damage */
4698 case GF_DISP_UNDEAD:
4700 if (r_ptr->flagsr & RFR_RES_ALL)
4706 /* Only affect undead */
4707 if (r_ptr->flags3 & (RF3_UNDEAD))
4711 /* Learn about type */
4712 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4720 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4721 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4723 note = " shudders.";
4724 note_dies = " dissolves!";
4746 if (r_ptr->flagsr & RFR_RES_ALL)
4752 /* Only affect evil */
4753 if (r_ptr->flags3 & (RF3_EVIL))
4757 /* Learn about type */
4758 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4766 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4767 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4769 note = " shudders.";
4770 note_dies = " dissolves!";
4791 if (r_ptr->flagsr & RFR_RES_ALL)
4797 /* Only affect good */
4798 if (r_ptr->flags3 & (RF3_GOOD))
4802 /* Learn about type */
4803 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4811 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4812 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4814 note = " shudders.";
4815 note_dies = " dissolves!";
4834 case GF_DISP_LIVING:
4836 if (r_ptr->flagsr & RFR_RES_ALL)
4842 /* Only affect non-undead */
4843 if (monster_living(r_ptr))
4846 if (seen) obvious = TRUE;
4850 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4851 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4853 note = " shudders.";
4854 note_dies = " dissolves!";
4875 if (r_ptr->flagsr & RFR_RES_ALL)
4881 /* Only affect demons */
4882 if (r_ptr->flags3 & (RF3_DEMON))
4886 /* Learn about type */
4887 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4895 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4896 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4898 note = " shudders.";
4899 note_dies = " dissolves!";
4917 /* Dispel monster */
4920 if (r_ptr->flagsr & RFR_RES_ALL)
4927 if (seen) obvious = TRUE;
4931 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4932 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4934 note = " shudders.";
4935 note_dies = " dissolves!";
4945 if (seen) obvious = TRUE;
4947 if (r_ptr->flagsr & RFR_RES_ALL)
4950 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4952 note = " is immune.";
4955 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4959 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4963 monster_type *caster_ptr = &m_list[who];
4965 /* Heal the monster */
4966 if (caster_ptr->hp < caster_ptr->maxhp)
4969 caster_ptr->hp += 6 * dam;
4970 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
4972 /* Redraw (later) if needed */
4973 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4974 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4976 /* Special message */
4979 /* Get the monster name */
4980 monster_desc(killer, caster_ptr, 0);
4982 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", killer);
4984 msg_format("%^s appears healthier.", killer);
4993 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£", m_name);
4995 msg_format("You draw psychic energy from %s.", m_name);
4998 (void)hp_player(dam);
5004 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
5006 msg_format("%s is unaffected.", m_name);
5016 if (seen) obvious = TRUE;
5019 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5021 if (!who) msg_format("You gaze intently at %s.", m_name);
5024 if (r_ptr->flagsr & RFR_RES_ALL)
5027 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5029 note = " is immune.";
5032 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5036 /* Attempt a saving throw */
5037 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5038 (r_ptr->flags3 & RF3_NO_CONF) ||
5039 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5041 /* Memorize a flag */
5042 if (r_ptr->flags3 & (RF3_NO_CONF))
5044 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5047 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5049 note = "is unaffected!";
5053 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5055 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5057 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5059 note = " is immune!";
5063 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5065 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5067 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5076 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5077 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5079 note = " is blasted by psionic energy.";
5080 note_dies = " collapses, a mindless husk.";
5083 if (who > 0) do_conf = randint0(4) + 4;
5084 else do_conf = randint0(8) + 8;
5090 case GF_BRAIN_SMASH:
5092 if (seen) obvious = TRUE;
5095 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5097 if (!who) msg_format("You gaze intently at %s.", m_name);
5100 if (r_ptr->flagsr & RFR_RES_ALL)
5103 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5105 note = " is immune.";
5108 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5112 /* Attempt a saving throw */
5113 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5114 (r_ptr->flags3 & RF3_NO_CONF) ||
5115 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5117 /* Memorize a flag */
5118 if (r_ptr->flags3 & (RF3_NO_CONF))
5120 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5123 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5125 note = "is unaffected!";
5129 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5131 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5133 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5135 note = " is immune!";
5139 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5141 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5143 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5152 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5153 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5155 note = " is blasted by psionic energy.";
5156 note_dies = " collapses, a mindless husk.";
5161 do_conf = randint0(4) + 4;
5162 do_stun = randint0(4) + 4;
5166 do_conf = randint0(8) + 8;
5167 do_stun = randint0(8) + 8;
5169 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5170 if (c_ptr->m_idx == p_ptr->riding)
5171 p_ptr->update |= (PU_BONUS);
5179 if (seen) obvious = TRUE;
5182 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5184 if (!who) msg_format("You point at %s and curses.", m_name);
5187 if (r_ptr->flagsr & RFR_RES_ALL)
5190 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5192 note = " is immune.";
5195 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5199 /* Attempt a saving throw */
5200 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5203 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5205 note = "is unaffected!";
5215 if (seen) obvious = TRUE;
5218 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5220 if (!who) msg_format("You point at %s and curses horribly.", m_name);
5223 if (r_ptr->flagsr & RFR_RES_ALL)
5226 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5228 note = " is immune.";
5231 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5235 /* Attempt a saving throw */
5236 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5239 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5241 note = "is unaffected!";
5251 if (seen) obvious = TRUE;
5254 if (!who) msg_format("%s¤ò»Øº¹¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
5256 if (!who) msg_format("You point at %s, incanting terribly!", m_name);
5259 if (r_ptr->flagsr & RFR_RES_ALL)
5262 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5264 note = " is immune.";
5267 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5271 /* Attempt a saving throw */
5272 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5275 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5277 note = "is unaffected!";
5287 if (seen) obvious = TRUE;
5290 if (!who) msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
5292 if (!who) msg_format("You point at %s, screaming the word, 'DIE!'.", m_name);
5295 if (r_ptr->flagsr & RFR_RES_ALL)
5298 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5300 note = " is immune.";
5303 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5307 /* Attempt a saving throw */
5308 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (m_list[who].r_idx != MON_KENSHIROU)))
5311 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5313 note = "is unaffected!";
5323 if (seen) obvious = TRUE;
5325 if (r_ptr->flagsr & RFR_RES_ALL)
5328 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5330 note = " is immune.";
5333 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5337 if (r_ptr->flags1 & RF1_UNIQUE)
5340 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5342 note = "is unaffected!";
5348 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
5349 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
5351 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5353 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5358 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5368 /* Capture monster */
5372 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5373 (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)
5376 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5378 msg_format("%^s is unaffected.", m_name);
5384 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5385 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5386 nokori_hp = m_ptr->maxhp * 3 / 10;
5388 nokori_hp = m_ptr->maxhp * 3 / 20;
5390 if (m_ptr->hp >= nokori_hp)
5393 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5395 msg_format("You need to weaken %s more.", m_name);
5399 else if (m_ptr->hp < randint0(nokori_hp))
5401 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5403 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5405 msg_format("You capture %^s!", m_name);
5407 cap_mon = m_list[c_ptr->m_idx].r_idx;
5408 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5409 cap_hp = m_list[c_ptr->m_idx].hp;
5410 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5411 if (m_list[c_ptr->m_idx].nickname)
5412 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5415 if (c_ptr->m_idx == p_ptr->riding)
5417 if (rakuba(-1, FALSE))
5420 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5422 msg_format("You have fallen from %s.", m_name);
5427 delete_monster_idx(c_ptr->m_idx);
5434 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5436 msg_format("You failed to capture %s.", m_name);
5443 /* Attack (Use "dam" as attack type) */
5446 /* Return this monster's death */
5447 return py_attack(y, x, dam);
5450 /* Sleep (Use "dam" as "power") */
5456 if (seen) obvious = TRUE;
5458 if (r_ptr->flagsr & RFR_RES_ALL)
5461 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5463 note = " is immune.";
5466 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5469 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5472 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5474 note = " is immune!";
5478 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5484 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5486 note = " is immune!";
5493 if (one_in_(5)) effect = 1;
5494 else if (one_in_(4)) effect = 2;
5495 else if (one_in_(3)) effect = 3;
5500 /* Powerful monsters can resist */
5501 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5502 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5505 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5507 note = " is unaffected!";
5513 /* Normal monsters slow down */
5519 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5521 note = " starts moving slower.";
5524 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5526 if (c_ptr->m_idx == p_ptr->riding)
5527 p_ptr->update |= (PU_BONUS);
5531 else if (effect == 2)
5533 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5535 /* Attempt a saving throw */
5536 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5537 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5542 /* No obvious effect */
5544 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5546 note = " is unaffected!";
5553 else if (effect == 3)
5555 /* Attempt a saving throw */
5556 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5557 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5558 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5560 /* Memorize a flag */
5561 if (r_ptr->flags3 & RF3_NO_SLEEP)
5563 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5566 /* No obvious effect */
5568 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5570 note = " is unaffected!";
5577 /* Go to sleep (much) later */
5579 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5581 note = " falls asleep!";
5591 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5593 note = " is immune!";
5597 /* No "real" damage */
5606 if (seen) obvious = TRUE;
5608 if (r_ptr->flagsr & RFR_RES_ALL)
5611 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5613 note = " is immune.";
5616 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5620 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)
5627 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG2_NOGENO))
5634 delete_monster_idx(c_ptr->m_idx);
5636 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5638 msg_format("%^s disappered!",m_name);
5642 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5644 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5648 chg_virtue(V_VITALITY, -1);
5653 p_ptr->redraw |= (PR_HP);
5656 p_ptr->window |= (PW_PLAYER);
5663 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5665 note = "is unaffected!";
5668 if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
5676 if (!who) msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£", m_name);
5678 if (!who) msg_format("You take a photograph of %s.", m_name);
5681 if (r_ptr->flags3 & (RF3_HURT_LITE))
5685 /* Obvious effect */
5688 /* Memorize the effects */
5689 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5692 /* Special effect */
5694 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5695 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5697 note = " cringes from the light!";
5698 note_dies = " shrivels away in the light!";
5703 /* Normally no damage */
5710 photo = m_ptr->r_idx;
5717 case GF_BLOOD_CURSE:
5719 if (seen) obvious = TRUE;
5721 if (r_ptr->flagsr & RFR_RES_ALL)
5724 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5726 note = " is immune.";
5729 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5737 bool success = FALSE;
5738 if (seen) obvious = TRUE;
5740 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5742 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5743 if (dam < 1) dam = 1;
5745 /* No need to tame your pet */
5749 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5751 note = " starts moving faster.";
5754 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5758 /* Attempt a saving throw */
5759 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5760 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5761 (m_ptr->mflag2 & MFLAG2_NOPET) ||
5762 (p_ptr->cursed & TRC_AGGRAVATE) ||
5763 ((r_ptr->level+10) > randint1(dam)))
5766 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5771 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5773 note = " is tamed!";
5777 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5779 /* Learn about type */
5780 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5787 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5789 do_fear = randint1(90)+10;
5793 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5797 /* No "real" damage */
5804 if (seen) obvious = TRUE;
5806 if (r_ptr->flagsr & RFR_RES_ALL)
5809 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5811 note = " is immune.";
5814 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5818 /* Attempt a saving throw */
5819 if (randint0(100 + dam) < (r_ptr->level + 50))
5823 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5825 note = "is unaffected!";
5846 /* Absolutely no effect */
5847 if (skipped) return (FALSE);
5849 /* "Unique" monsters cannot be polymorphed */
5850 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5852 /* Quest monsters cannot be polymorphed */
5853 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5855 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5857 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5858 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
5860 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5865 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5866 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5869 /* Modify the damage */
5871 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5873 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤¡£";
5875 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5878 /* Check for death */
5879 if (dam > m_ptr->hp)
5881 /* Extract method of death */
5885 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5886 else if (do_poly && (randint1(90) > r_ptr->level))
5888 if (polymorph_monster(y, x))
5891 if (seen) obvious = TRUE;
5893 /* Monster polymorphs */
5895 note = "¤¬ÊѿȤ·¤¿¡ª";
5901 /* Turn off the damage */
5904 /* Hack -- Get new monster */
5905 m_ptr = &m_list[c_ptr->m_idx];
5907 /* Hack -- Get new race */
5908 r_ptr = &r_info[m_ptr->r_idx];
5914 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5916 note = " is unaffected!";
5922 /* Handle "teleport" */
5926 if (seen) obvious = TRUE;
5930 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5932 note = " disappears!";
5935 chg_virtue(V_VALOUR, -1);
5938 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who));
5940 /* Hack -- get new location */
5944 /* Hack -- get new grid */
5945 c_ptr = &cave[y][x];
5948 /* Sound and Impact resisters never stun */
5950 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5951 !(r_ptr->flags3 & RF3_NO_STUN))
5954 if (seen) obvious = TRUE;
5960 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5962 note = " is more dazed.";
5965 tmp = m_ptr->stunned + (do_stun / 2);
5970 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5972 note = " is dazed.";
5979 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5985 /* Confusion and Chaos resisters (and sleepers) never confuse */
5987 !(r_ptr->flags3 & RF3_NO_CONF) &&
5988 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
5991 if (seen) obvious = TRUE;
5993 /* Already partially confused */
5994 if (m_ptr->confused)
5997 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5999 note = " looks more confused.";
6002 tmp = m_ptr->confused + (do_conf / 2);
6005 /* Was not confused */
6009 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
6011 note = " looks confused.";
6017 /* Apply confusion */
6018 m_ptr->confused = (tmp < 200) ? tmp : 200;
6027 if (seen) obvious = TRUE;
6029 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
6034 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
6036 note = " seems weakened.";
6038 m_ptr->maxhp -= do_time;
6039 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
6049 tmp = m_ptr->monfear + do_fear;
6052 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6059 if (typ == GF_DRAIN_MANA)
6061 /* Drain mana does nothing */
6064 /* If another monster did the damage, hurt the monster by hand */
6067 /* Redraw (later) if needed */
6068 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6069 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6071 /* Wake the monster up */
6074 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
6076 /* Hurt the monster */
6084 if (is_pet(m_ptr) && !(m_ptr->ml))
6087 /* Give detailed messages if destroyed */
6090 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
6093 msg_format("%^s%s", m_name, note);
6101 monster_gain_exp(who, m_ptr->r_idx);
6103 /* Generate treasure, etc */
6104 monster_death(c_ptr->m_idx, FALSE);
6106 /* Delete the monster */
6107 delete_monster_idx(c_ptr->m_idx);
6112 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6114 msg_print("You feel sad for a moment.");
6120 /* Damaged monster */
6123 /* Give detailed messages if visible or destroyed */
6124 if (note && seen) msg_format("%^s%s", m_name, note);
6126 /* Hack -- Pain message */
6129 message_pain(c_ptr->m_idx, dam);
6136 /* Hack -- handle sleep */
6137 if (do_sleep) m_ptr->csleep = do_sleep;
6141 else if (heal_leper)
6144 msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6146 msg_print("The Mangy looking leper is healed!");
6149 delete_monster_idx(c_ptr->m_idx);
6152 /* If the player did it, give him experience, check fear */
6157 /* Hurt the monster, check for fear and death */
6158 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6163 /* Damaged monster */
6166 /* HACK - anger the monster before showing the sleep message */
6167 if (do_sleep) anger_monster(m_ptr);
6169 /* Give detailed messages if visible or destroyed */
6172 msg_format("%s%s", m_name, note);
6174 msg_format("%^s%s", m_name, note);
6178 /* Hack -- Pain message */
6179 else if (known && (dam || !do_fear))
6181 message_pain(c_ptr->m_idx, dam);
6184 /* Anger monsters */
6185 if (((dam > 0) || get_angry) && !do_sleep)
6186 anger_monster(m_ptr);
6189 if ((fear || do_fear) && (m_ptr->ml))
6196 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6198 msg_format("%^s flees in terror!", m_name);
6203 /* Hack -- handle sleep */
6204 if (do_sleep) m_ptr->csleep = do_sleep;
6208 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6210 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6214 switch (randint1(28))
6220 msg_print("ÃÏÌ̤¬Íɤ줿...");
6222 msg_print("The ground trembles...");
6225 earthquake(ty, tx, 4 + randint0(4));
6226 if (!one_in_(6)) break;
6228 case 3: case 4: case 5: case 6:
6231 int dam = damroll(10, 10);
6233 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6235 msg_print("A portal opens to a plane of raw mana!");
6238 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6239 if (!one_in_(6)) break;
6245 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6247 msg_print("Space warps about you!");
6250 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE);
6251 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6252 if (!one_in_(6)) break;
6254 case 9: case 10: case 11:
6256 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6258 msg_print("You feel a surge of energy!");
6261 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6262 if (!one_in_(6)) break;
6263 case 12: case 13: case 14: case 15: case 16:
6264 aggravate_monsters(0);
6265 if (!one_in_(6)) break;
6267 count += activate_hi_summon(ty, tx, TRUE);
6268 if (!one_in_(6)) break;
6269 case 19: case 20: case 21: case 22:
6271 bool pet = !one_in_(3);
6272 u32b mode = PM_ALLOW_GROUP;
6274 if (pet) mode |= PM_FORCE_PET;
6275 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6277 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6278 if (!one_in_(6)) break;
6280 case 23: case 24: case 25:
6281 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6283 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6285 msg_print("You feel your life draining away...");
6288 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6289 else lose_exp(p_ptr->exp / 16);
6290 if (!one_in_(6)) break;
6291 case 26: case 27: case 28:
6300 (void)do_dec_stat(i);
6309 (void)do_dec_stat(randint0(6));
6318 if (p_ptr->inside_battle)
6320 p_ptr->health_who = c_ptr->m_idx;
6321 p_ptr->redraw |= (PR_HEALTH);
6325 /* XXX XXX XXX Verify this code */
6327 /* Update the monster */
6328 update_mon(c_ptr->m_idx, FALSE);
6330 /* Redraw the monster grid */
6334 /* Update monster recall window */
6335 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6338 p_ptr->window |= (PW_MONSTER);
6341 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6345 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6347 set_target(m_ptr, monster_target_y, monster_target_x);
6350 else if (is_pet(&m_list[who]) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6352 set_target(m_ptr, m_list[who].fy, m_list[who].fx);
6356 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6358 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6359 rakubadam_m = (dam > 200) ? 200 : dam;
6368 /* Get local object */
6371 /* Prepare to make a Blade of Chaos */
6372 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6374 q_ptr->pval = photo;
6376 /* Mark the item as fully known */
6377 q_ptr->ident |= (IDENT_MENTAL);
6379 /* Drop it in the dungeon */
6380 (void)drop_near(q_ptr, -1, py, px);
6388 /* Return "Anything seen?" */
6394 * Helper function for "project()" below.
6396 * Handle a beam/bolt/ball causing damage to the player.
6398 * This routine takes a "source monster" (by index), a "distance", a default
6399 * "damage", and a "damage type". See "project_m()" above.
6401 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6402 * is reduced (see "project_m()" above). This can happen if a monster breathes
6403 * at the player and hits a wall instead.
6405 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6406 * to know if this is actually a ball or a bolt spell
6409 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6410 * we just assume that the effects were obvious, for historical reasons.
6412 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6417 /* Hack -- assume obvious */
6418 bool obvious = TRUE;
6420 /* Player blind-ness */
6421 bool blind = (p_ptr->blind ? TRUE : FALSE);
6423 /* Player needs a "description" (he is blind) */
6426 /* Source monster */
6427 monster_type *m_ptr = NULL;
6429 /* Monster name (for attacks) */
6432 /* Monster name (for damage) */
6435 /* Hack -- messages */
6441 /* Player is not here */
6442 if (!player_bold(y, x)) return (FALSE);
6444 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6450 /* Player cannot hurt himself */
6451 if (!who) return (FALSE);
6452 if (who == p_ptr->riding) return (FALSE);
6454 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6457 int max_attempts = 10;
6460 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6461 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6462 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6464 if (blind) msg_print("Something bounces!");
6465 else msg_print("The attack bounces!");
6469 /* Choose 'new' target */
6472 t_y = m_list[who].fy - 1 + randint1(3);
6473 t_x = m_list[who].fx - 1 + randint1(3);
6476 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
6478 if (max_attempts < 1)
6480 t_y = m_list[who].fy;
6481 t_x = m_list[who].fx;
6484 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6491 /* Limit maximum damage */
6492 if (dam > 1600) dam = 1600;
6494 /* Reduce damage by distance */
6495 dam = (dam + r) / (r + 1);
6498 /* If the player is blind, be more descriptive */
6499 if (blind) fuzzy = TRUE;
6504 /* Get the source monster */
6505 m_ptr = &m_list[who];
6506 /* Extract the monster level */
6507 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6509 /* Get the monster name */
6510 monster_desc(m_name, m_ptr, 0);
6512 /* Get the monster's real name (gotten before polymorph!) */
6513 strcpy(killer, who_name);
6518 strcpy(killer, "æ«");
6520 strcpy(killer, "a trap");
6524 /* Analyze the damage */
6527 /* Standard damage -- hurts inventory too */
6531 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6533 if (fuzzy) msg_print("You are hit by acid!");
6536 get_damage = acid_dam(dam, killer, monspell);
6540 /* Standard damage -- hurts inventory too */
6544 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6546 if (fuzzy) msg_print("You are hit by fire!");
6549 get_damage = fire_dam(dam, killer, monspell);
6553 /* Standard damage -- hurts inventory too */
6557 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6559 if (fuzzy) msg_print("You are hit by cold!");
6562 get_damage = cold_dam(dam, killer, monspell);
6566 /* Standard damage -- hurts inventory too */
6570 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6572 if (fuzzy) msg_print("You are hit by lightning!");
6575 get_damage = elec_dam(dam, killer, monspell);
6579 /* Standard damage -- also poisons player */
6582 bool double_resist = IS_OPPOSE_POIS();
6584 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6586 if (fuzzy) msg_print("You are hit by poison!");
6589 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6590 if (double_resist) dam = (dam + 2) / 3;
6592 if ((!(double_resist || p_ptr->resist_pois)) &&
6593 one_in_(HURT_CHANCE))
6598 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6600 if (!(double_resist || p_ptr->resist_pois))
6602 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6607 /* Standard damage -- also poisons / mutates player */
6610 bool double_resist = IS_OPPOSE_POIS();
6612 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6614 if (fuzzy) msg_print("You are hit by radiation!");
6617 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6618 if (double_resist) dam = (2 * dam + 2) / 5;
6619 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6620 if (!(double_resist || p_ptr->resist_pois))
6622 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6624 if (one_in_(5)) /* 6 */
6627 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6629 msg_print("You undergo a freakish metamorphosis!");
6632 if (one_in_(4)) /* 4 */
6640 inven_damage(set_acid_destroy, 2);
6646 /* Standard damage */
6650 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6652 if (fuzzy) msg_print("You are hit by something!");
6655 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6659 /* Holy Orb -- Player only takes partial damage */
6663 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6665 if (fuzzy) msg_print("You are hit by something!");
6668 if (p_ptr->align > 10)
6670 else if (p_ptr->align < -10)
6672 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6679 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6681 if (fuzzy) msg_print("You are hit by something!");
6684 if (p_ptr->align > 10)
6686 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6690 /* Arrow -- XXX no dodging */
6694 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6696 if (fuzzy) msg_print("You are hit by something sharp!");
6699 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6702 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6704 msg_print("You cut down the arrow!");
6708 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6712 /* Plasma -- XXX No resist */
6716 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6718 if (fuzzy) msg_print("You are hit by something *HOT*!");
6721 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6723 if (!p_ptr->resist_sound)
6725 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6726 (void)set_stun(p_ptr->stun + k);
6729 if (!(p_ptr->resist_fire ||
6731 p_ptr->immune_fire))
6733 inven_damage(set_acid_destroy, 3);
6739 /* Nether -- drain experience */
6743 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6745 if (fuzzy) msg_print("You are hit by nether forces!");
6749 if (p_ptr->resist_neth)
6751 if (!prace_is_(RACE_SPECTRE))
6752 dam *= 6; dam /= (randint1(4) + 7);
6754 else drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
6756 if (prace_is_(RACE_SPECTRE))
6759 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6761 msg_print("You feel invigorated!");
6765 learn_spell(monspell);
6769 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6775 /* Water -- stun/confuse */
6779 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6781 if (fuzzy) msg_print("You are hit by something wet!");
6784 if (!p_ptr->resist_sound)
6786 set_stun(p_ptr->stun + randint1(40));
6788 if (!p_ptr->resist_conf)
6790 set_confused(p_ptr->confused + randint1(5) + 5);
6795 inven_damage(set_cold_destroy, 3);
6798 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6802 /* Chaos -- many effects */
6806 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6808 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6811 if (p_ptr->resist_chaos)
6813 dam *= 6; dam /= (randint1(4) + 7);
6815 if (!p_ptr->resist_conf)
6817 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6819 if (!p_ptr->resist_chaos)
6821 (void)set_image(p_ptr->image + randint1(10));
6825 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6827 msg_print("Your body is twisted by chaos!");
6830 (void)gain_random_mutation(0);
6833 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6835 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
6837 if (!p_ptr->resist_chaos || one_in_(9))
6839 inven_damage(set_elec_destroy, 2);
6840 inven_damage(set_fire_destroy, 2);
6842 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6846 /* Shards -- mostly cutting */
6850 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6852 if (fuzzy) msg_print("You are hit by something sharp!");
6855 if (p_ptr->resist_shard)
6857 dam *= 6; dam /= (randint1(4) + 7);
6861 (void)set_cut(p_ptr->cut + dam);
6864 if (!p_ptr->resist_shard || one_in_(13))
6866 inven_damage(set_cold_destroy, 2);
6869 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6873 /* Sound -- mostly stunning */
6877 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6879 if (fuzzy) msg_print("You are hit by a loud noise!");
6882 if (p_ptr->resist_sound)
6884 dam *= 5; dam /= (randint1(4) + 7);
6888 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6889 (void)set_stun(p_ptr->stun + k);
6892 if (!p_ptr->resist_sound || one_in_(13))
6894 inven_damage(set_cold_destroy, 2);
6897 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6901 /* Pure confusion */
6905 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6907 if (fuzzy) msg_print("You are hit by something puzzling!");
6910 if (p_ptr->resist_conf)
6912 dam *= 5; dam /= (randint1(4) + 7);
6914 if (!p_ptr->resist_conf)
6916 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6918 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6922 /* Disenchantment -- see above */
6926 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6928 if (fuzzy) msg_print("You are hit by something static!");
6931 if (p_ptr->resist_disen)
6933 dam *= 6; dam /= (randint1(4) + 7);
6937 (void)apply_disenchant(0);
6939 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6943 /* Nexus -- see above */
6947 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6949 if (fuzzy) msg_print("You are hit by something strange!");
6952 if (p_ptr->resist_nexus)
6954 dam *= 6; dam /= (randint1(4) + 7);
6960 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6964 /* Force -- mostly stun */
6968 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6970 if (fuzzy) msg_print("You are hit by kinetic force!");
6973 if (!p_ptr->resist_sound)
6975 (void)set_stun(p_ptr->stun + randint1(20));
6977 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6982 /* Rocket -- stun, cut */
6986 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
6988 if (fuzzy) msg_print("There is an explosion!");
6991 if (!p_ptr->resist_sound)
6993 (void)set_stun(p_ptr->stun + randint1(20));
6995 if (p_ptr->resist_shard)
7001 (void)set_cut(p_ptr-> cut + ( dam / 2));
7004 if ((!p_ptr->resist_shard) || one_in_(12))
7006 inven_damage(set_cold_destroy, 3);
7009 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7013 /* Inertia -- slowness */
7017 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7019 if (fuzzy) msg_print("You are hit by something slow!");
7022 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7023 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7027 /* Lite -- blinding */
7031 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7033 if (fuzzy) msg_print("You are hit by something!");
7036 if (p_ptr->resist_lite)
7038 dam *= 4; dam /= (randint1(4) + 7);
7040 else if (!blind && !p_ptr->resist_blind)
7042 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7044 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
7047 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
7049 msg_print("The light scorches your flesh!");
7054 else if (prace_is_(RACE_S_FAIRY))
7058 if (p_ptr->wraith_form) dam *= 2;
7059 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7061 if (p_ptr->wraith_form)
7063 p_ptr->wraith_form = 0;
7065 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7067 msg_print("The light forces you out of your incorporeal shadow form.");
7070 p_ptr->redraw |= PR_MAP;
7071 /* Update monsters */
7072 p_ptr->update |= (PU_MONSTERS);
7074 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7076 /* Redraw status bar */
7077 p_ptr->redraw |= (PR_STATUS);
7084 /* Dark -- blinding */
7088 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7090 if (fuzzy) msg_print("You are hit by something!");
7093 if (p_ptr->resist_dark)
7095 dam *= 4; dam /= (randint1(4) + 7);
7097 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7099 else if (!blind && !p_ptr->resist_blind)
7101 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7103 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7107 /* Time -- bolt fewer effects XXX */
7111 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7113 if (fuzzy) msg_print("You are hit by a blast from the past!");
7116 if (p_ptr->resist_time)
7119 dam /= (randint1(4) + 7);
7121 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7123 msg_print("You feel as if time is passing you by.");
7129 switch (randint1(10))
7131 case 1: case 2: case 3: case 4: case 5:
7133 if (p_ptr->prace == RACE_ANDROID) break;
7135 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7137 msg_print("You feel life has clocked back.");
7140 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7144 case 6: case 7: case 8: case 9:
7146 switch (randint1(6))
7149 case 1: k = A_STR; act = "¶¯¤¯"; break;
7150 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7151 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7152 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7153 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7154 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7156 case 1: k = A_STR; act = "strong"; break;
7157 case 2: k = A_INT; act = "bright"; break;
7158 case 3: k = A_WIS; act = "wise"; break;
7159 case 4: k = A_DEX; act = "agile"; break;
7160 case 5: k = A_CON; act = "hale"; break;
7161 case 6: k = A_CHR; act = "beautiful"; break;
7167 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7169 msg_format("You're not as %s as you used to be...", act);
7173 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7174 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7175 p_ptr->update |= (PU_BONUS);
7182 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7184 msg_print("You're not as powerful as you used to be...");
7188 for (k = 0; k < 6; k++)
7190 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7191 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7193 p_ptr->update |= (PU_BONUS);
7199 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7203 /* Gravity -- stun plus slowness plus teleport */
7207 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7208 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7210 if (fuzzy) msg_print("You are hit by something heavy!");
7211 msg_print("Gravity warps around you.");
7214 teleport_player(5, TRUE);
7216 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7217 if (!(p_ptr->resist_sound || p_ptr->ffall))
7219 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7220 (void)set_stun(p_ptr->stun + k);
7224 dam = (dam * 2) / 3;
7227 if (!p_ptr->ffall || one_in_(13))
7229 inven_damage(set_cold_destroy, 2);
7232 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7236 /* Standard damage */
7237 case GF_DISINTEGRATE:
7240 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7242 if (fuzzy) msg_print("You are hit by pure energy!");
7245 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7252 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7254 if (fuzzy) msg_print("You are hit by something invigorating!");
7257 (void)hp_player(dam);
7265 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7267 if (fuzzy) msg_print("You are hit by something!");
7270 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7278 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7280 if (fuzzy) msg_print("You are hit by something slow!");
7283 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7289 if (p_ptr->free_act) break;
7291 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7293 if (fuzzy) msg_print("You fall asleep!");
7297 if (ironman_nightmare)
7300 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7302 msg_print("A horrible vision enters your mind.");
7306 /* Pick a nightmare */
7307 get_mon_num_prep(get_nightmare, NULL);
7309 /* Have some nightmares */
7310 have_nightmare(get_mon_num(MAX_DEPTH));
7312 /* Remove the monster restriction */
7313 get_mon_num_prep(NULL, NULL);
7316 set_paralyzed(p_ptr->paralyzed + dam);
7327 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7329 if (fuzzy) msg_print("You are hit by an aura of magic!");
7332 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7340 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7342 if (fuzzy) msg_print("You are hit by an energy!");
7345 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7353 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7355 if (fuzzy) msg_print("Something falls from the sky on you!");
7358 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7359 if (!p_ptr->resist_shard || one_in_(13))
7361 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7362 inven_damage(set_cold_destroy, 2);
7368 /* Ice -- cold plus stun plus cuts */
7372 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7374 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7377 cold_dam(dam, killer, monspell);
7378 if (!p_ptr->resist_shard)
7380 (void)set_cut(p_ptr->cut + damroll(5, 8));
7382 if (!p_ptr->resist_sound)
7384 (void)set_stun(p_ptr->stun + randint1(15));
7387 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
7389 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7399 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7401 if (fuzzy) msg_print("You are hit by something extremely cold!");
7405 if (p_ptr->mimic_form)
7407 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7408 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7413 switch (p_ptr->prace)
7415 /* Some races are immune */
7429 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7445 if (who > 0) msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
7446 else msg_print("Àº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
7448 if (who > 0) msg_format("%^s draws psychic energy from you!", m_name);
7449 else msg_print("Your psychic energy is drawn!");
7453 if (dam >= p_ptr->csp)
7457 p_ptr->csp_frac = 0;
7466 learn_spell(monspell);
7469 p_ptr->redraw |= (PR_MANA);
7472 p_ptr->window |= (PW_PLAYER);
7473 p_ptr->window |= (PW_SPELL);
7477 /* Heal the monster */
7478 if (m_ptr->hp < m_ptr->maxhp)
7481 m_ptr->hp += (6 * dam);
7482 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
7484 /* Redraw (later) if needed */
7485 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
7486 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
7488 /* Special message */
7492 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
7494 msg_format("%^s appears healthier.", m_name);
7508 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7511 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7513 msg_print("You resist the effects!");
7515 learn_spell(monspell);
7520 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7522 msg_print("Your mind is blasted by psyonic energy.");
7525 if (!p_ptr->resist_conf)
7527 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7530 if (!p_ptr->resist_chaos && one_in_(3))
7532 (void)set_image(p_ptr->image + randint0(250) + 150);
7539 p_ptr->csp_frac = 0;
7541 p_ptr->redraw |= PR_MANA;
7543 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7549 case GF_BRAIN_SMASH:
7551 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7554 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7556 msg_print("You resist the effects!");
7558 learn_spell(monspell);
7563 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7565 msg_print("Your mind is blasted by psionic energy.");
7572 p_ptr->csp_frac = 0;
7574 p_ptr->redraw |= PR_MANA;
7576 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7577 if (!p_ptr->resist_blind)
7579 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7581 if (!p_ptr->resist_conf)
7583 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7585 if (!p_ptr->free_act)
7587 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7589 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7591 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7592 (void)do_dec_stat(A_INT);
7593 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7594 (void)do_dec_stat(A_WIS);
7596 if (!p_ptr->resist_chaos)
7598 (void)set_image(p_ptr->image + randint0(250) + 150);
7607 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7610 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7612 msg_print("You resist the effects!");
7614 learn_spell(monspell);
7618 curse_equipment(15, 0);
7619 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7627 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7630 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7632 msg_print("You resist the effects!");
7634 learn_spell(monspell);
7638 curse_equipment(25, MIN(rlev/2-15, 5));
7639 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7647 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7650 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7652 msg_print("You resist the effects!");
7654 learn_spell(monspell);
7658 curse_equipment(33, MIN(rlev/2-15, 15));
7659 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7667 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7670 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7672 msg_print("You resist the effects!");
7674 learn_spell(monspell);
7678 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7679 (void)set_cut(p_ptr->cut + damroll(10, 10));
7687 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7690 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7692 msg_format("You resist the effects!");
7694 learn_spell(monspell);
7699 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7701 msg_print("You feel your life fade away!");
7704 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
7705 curse_equipment(40, 20);
7707 if (p_ptr->chp < 1) p_ptr->chp = 1;
7722 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7725 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7727 char m_name_self[80];
7730 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
7732 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7734 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7735 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7738 if (p_ptr->riding && dam > 0)
7740 rakubadam_p = (dam > 200) ? 200 : dam;
7748 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7754 /* Return "Anything seen?" */
7760 * Find the distance from (x, y) to a line.
7762 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7764 /* Vector from (x, y) to (x1, y1) */
7773 int pd = distance(y1, x1, y, x);
7774 int nd = distance(y1, x1, y2, x2);
7776 if (pd > nd) return distance(y, x, y2, x2);
7778 /* Component of P on N */
7779 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7781 /* Absolute value */
7782 return((nd >= 0) ? nd : 0 - nd);
7789 * Modified version of los() for calculation of disintegration balls.
7790 * Disintegration effects are stopped by permanent walls.
7792 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7812 /* Slope, or 1/Slope, of LOS */
7816 /* Extract the offset */
7820 /* Extract the absolute offset */
7825 /* Handle adjacent (or identical) grids */
7826 if ((ax < 2) && (ay < 2)) return (TRUE);
7829 /* Paranoia -- require "safe" origin */
7830 /* if (!in_bounds(y1, x1)) return (FALSE); */
7833 /* Directly South/North */
7836 /* South -- check for walls */
7839 for (ty = y1 + 1; ty < y2; ty++)
7841 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7845 /* North -- check for walls */
7848 for (ty = y1 - 1; ty > y2; ty--)
7850 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7858 /* Directly East/West */
7861 /* East -- check for walls */
7864 for (tx = x1 + 1; tx < x2; tx++)
7866 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7870 /* West -- check for walls */
7873 for (tx = x1 - 1; tx > x2; tx--)
7875 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7884 /* Extract some signs */
7885 sx = (dx < 0) ? -1 : 1;
7886 sy = (dy < 0) ? -1 : 1;
7889 /* Vertical "knights" */
7894 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7898 /* Horizontal "knights" */
7903 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7908 /* Calculate scale factor div 2 */
7911 /* Calculate scale factor */
7915 /* Travel horizontally */
7918 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7924 /* Consider the special case where slope == 1. */
7935 /* Note (below) the case (qy == f2), where */
7936 /* the LOS exactly meets the corner of a tile. */
7939 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7950 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7963 /* Travel vertically */
7966 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7982 /* Note (below) the case (qx == f2), where */
7983 /* the LOS exactly meets the corner of a tile. */
7986 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7997 if (cave_stop_disintegration(ty, tx)) return (FALSE);
8018 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)
8023 int brev = rad * rad / dist;
8027 int mdis = distance(y1, x1, y2, x2) + rad;
8029 while (bdis <= mdis)
8033 if ((0 < dist) && (path_n < dist))
8035 int ny = GRID_Y(path_g[path_n]);
8036 int nx = GRID_X(path_g[path_n]);
8037 int nd = distance(ny, nx, y1, x1);
8039 /* Get next base point */
8048 /* Travel from center outward */
8049 for (cdis = 0; cdis <= brad; cdis++)
8051 /* Scan the maximal blast area of radius "cdis" */
8052 for (y = by - cdis; y <= by + cdis; y++)
8054 for (x = bx - cdis; x <= bx + cdis; x++)
8056 /* Ignore "illegal" locations */
8057 if (!in_bounds(y, x)) continue;
8059 /* Enforce a circular "ripple" */
8060 if (distance(y1, x1, y, x) != bdis) continue;
8062 /* Enforce an arc */
8063 if (distance(by, bx, y, x) != cdis) continue;
8069 /* Lights are stopped by opaque terrains */
8070 if (!los(by, bx, y, x)) continue;
8072 case GF_DISINTEGRATE:
8073 /* Disintegration are stopped only by perma-walls */
8074 if (!in_disintegration_range(by, bx, y, x)) continue;
8077 /* Ball explosions are stopped by walls */
8078 if (!projectable(by, bx, y, x)) continue;
8082 /* Save this grid */
8090 /* Encode some more "radius" info */
8091 gm[bdis + 1] = *pgrids;
8093 /* Increase the size */
8094 brad = rad * (path_n + brev) / (dist + brev);
8096 /* Find the next ripple */
8100 /* Store the effect size */
8106 * Generic "beam"/"bolt"/"ball" projection routine.
8109 * who: Index of "source" monster (zero for "player")
8110 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8111 * y,x: Target location (or location to travel "towards")
8112 * dam: Base damage roll to apply to affected monsters (or player)
8113 * typ: Type of damage to apply to monsters (and objects)
8114 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8117 * TRUE if any "effects" of the projection were observed, else FALSE
8119 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8120 * towards a given location (optionally passing over the heads of interposing
8121 * monsters), and have it do a given amount of damage to the monsters (and
8122 * optionally objects) within the given radius of the final location.
8124 * A "bolt" travels from source to target and affects only the target grid.
8125 * A "beam" travels from source to target, affecting all grids passed through.
8126 * A "ball" travels from source to the target, exploding at the target, and
8127 * affecting everything within the given radius of the target location.
8129 * Traditionally, a "bolt" does not affect anything on the ground, and does
8130 * not pass over the heads of interposing monsters, much like a traditional
8131 * missile, and will "stop" abruptly at the "target" even if no monster is
8132 * positioned there, while a "ball", on the other hand, passes over the heads
8133 * of monsters between the source and target, and affects everything except
8134 * the source monster which lies within the final radius, while a "beam"
8135 * affects every monster between the source and target, except for the casting
8136 * monster (or player), and rarely affects things on the ground.
8138 * Two special flags allow us to use this function in special ways, the
8139 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8140 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8141 * actually projecting from the source monster (or player).
8143 * The player will only get "experience" for monsters killed by himself
8144 * Unique monsters can only be destroyed by attacks from the player
8146 * Only 256 grids can be affected per projection, limiting the effective
8147 * "radius" of standard ball attacks to nine units (diameter nineteen).
8149 * One can project in a given "direction" by combining PROJECT_THRU with small
8150 * offsets to the initial location (see "line_spell()"), or by calculating
8151 * "virtual targets" far away from the player.
8153 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8154 * continuing until it actually hits somethings (useful for "stone to mud").
8156 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8158 * Balls must explode BEFORE hitting walls, or they would affect monsters
8159 * on both sides of a wall. Some bug reports indicate that this is still
8160 * happening in 2.7.8 for Windows, though it appears to be impossible.
8162 * We "pre-calculate" the blast area only in part for efficiency.
8163 * More importantly, this lets us do "explosions" from the "inside" out.
8164 * This results in a more logical distribution of "blast" treasure.
8165 * It also produces a better (in my opinion) animation of the explosion.
8166 * It could be (but is not) used to have the treasure dropped by monsters
8167 * in the middle of the explosion fall "outwards", and then be damaged by
8168 * the blast as it spreads outwards towards the treasure drop location.
8170 * Walls and doors are included in the blast area, so that they can be
8171 * "burned" or "melted" in later versions.
8173 * This algorithm is intended to maximize simplicity, not necessarily
8174 * efficiency, since this function is not a bottleneck in the code.
8176 * We apply the blast effect from ground zero outwards, in several passes,
8177 * first affecting features, then objects, then monsters, then the player.
8178 * This allows walls to be removed before checking the object or monster
8179 * in the wall, and protects objects which are dropped by monsters killed
8180 * in the blast, and allows the player to see all affects before he is
8181 * killed or teleported away. The semantics of this method are open to
8182 * various interpretations, but they seem to work well in practice.
8184 * We process the blast area from ground-zero outwards to allow for better
8185 * distribution of treasure dropped by monsters, and because it provides a
8186 * pleasing visual effect at low cost.
8188 * Note that the damage done by "ball" explosions decreases with distance.
8189 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8191 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8192 * the target, and then the damage "flows" along this beam of destruction.
8193 * The damage at every grid is the same as at the "center" of a "ball"
8194 * explosion, since the "beam" grids are treated as if they ARE at the
8195 * center of a "ball" explosion.
8197 * Currently, specifying "beam" plus "ball" means that locations which are
8198 * covered by the initial "beam", and also covered by the final "ball", except
8199 * for the final grid (the epicenter of the ball), will be "hit twice", once
8200 * by the initial beam, and once by the exploding ball. For the grid right
8201 * next to the epicenter, this results in 150% damage being done. The center
8202 * does not have this problem, for the same reason the final grid in a "beam"
8203 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8204 * grids which are covered by the "ball" will NOT work, as then they will
8205 * receive LESS damage than they should. Do not combine "beam" with "ball".
8207 * The array "gy[],gx[]" with current size "grids" is used to hold the
8208 * collected locations of all grids in the "blast area" plus "beam path".
8210 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8211 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8212 * first blast grid (see above) with radius "N" from the blast center. Note
8213 * that only the first gm[1] grids in the blast area thus take full damage.
8214 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8215 * number of blast grids.
8217 * Note that once the projection is complete, (y2,x2) holds the final location
8218 * of bolts/beams, and the "epicenter" of balls.
8220 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8221 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8222 * implementation of the "distance" function. Also, a bolt can be properly
8223 * viewed as a "ball" with a "rad" of "zero".
8225 * Note that if no "target" is reached before the beam/bolt/ball travels the
8226 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8227 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8229 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8230 * to move from point A to point B, even if the player cannot see part of the
8231 * projection path. Note that in general, the player will *always* see part
8232 * of the path, since it either starts at the player or ends on the player.
8234 * Hack -- we assume that every "projection" is "self-illuminating".
8236 * Hack -- when only a single monster is affected, we automatically track
8237 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8239 * Note that all projections now "explode" at their final destination, even
8240 * if they were being projected at a more distant destination. This means
8241 * that "ball" spells will *always* explode.
8243 * Note that we must call "handle_stuff()" after affecting terrain features
8244 * in the blast radius, in case the "illumination" of the grid was changed,
8245 * and "update_view()" and "update_monsters()" need to be called.
8247 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8257 int y_saver, x_saver; /* For reflecting monsters */
8259 int msec = delay_factor * delay_factor * delay_factor;
8261 /* Assume the player sees nothing */
8262 bool notice = FALSE;
8264 /* Assume the player has seen nothing */
8265 bool visual = FALSE;
8267 /* Assume the player has seen no blast grids */
8270 /* Assume to be a normal ball spell */
8271 bool breath = FALSE;
8273 /* Is the player blind? */
8274 bool blind = (p_ptr->blind ? TRUE : FALSE);
8276 bool old_hide = FALSE;
8278 /* Number of grids in the "path" */
8281 /* Actual grids in the "path" */
8284 /* Number of grids in the "blast area" (including the "beam" path) */
8287 /* Coordinates of the affected grids */
8288 byte gx[1024], gy[1024];
8290 /* Encoded "radius" info (see above) */
8293 /* Actual radius encoded in gm[] */
8298 /* Attacker's name (prepared before polymorph)*/
8301 /* Initialize by null string */
8307 /* Default target of monsterspell is player */
8308 monster_target_y=py;
8309 monster_target_x=px;
8311 /* Hack -- Jump to target */
8312 if (flg & (PROJECT_JUMP))
8317 /* Clear the flag */
8318 flg &= ~(PROJECT_JUMP);
8323 /* Start at player */
8330 /* Start at monster */
8333 x1 = m_list[who].fx;
8334 y1 = m_list[who].fy;
8335 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8348 /* Default "destination" */
8353 /* Hack -- verify stuff */
8354 if (flg & (PROJECT_THRU))
8356 if ((x1 == x2) && (y1 == y2))
8358 flg &= ~(PROJECT_THRU);
8362 /* Handle a breath attack */
8367 if (flg & PROJECT_HIDE) old_hide = TRUE;
8368 flg |= PROJECT_HIDE;
8372 /* Hack -- Assume there will be no blast (max radius 32) */
8373 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8381 /* Collect beam grids */
8382 if (flg & (PROJECT_BEAM))
8393 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
8395 case GF_DISINTEGRATE:
8396 flg |= (PROJECT_GRID);
8397 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
8401 /* Calculate the projection path */
8403 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8405 /* Hack -- Handle stuff */
8408 /* Giga-Hack SEEKER & SUPER_RAY */
8410 if( typ == GF_SEEKER )
8420 for (i = 0; i < path_n; ++i)
8425 int ny = GRID_Y(path_g[i]);
8426 int nx = GRID_X(path_g[i]);
8437 /* Only do visuals if requested */
8438 if (!blind && !(flg & (PROJECT_HIDE)))
8440 /* Only do visuals if the player can "see" the bolt */
8441 if (panel_contains(y, x) && player_has_los_bold(y, x))
8448 /* Obtain the bolt pict */
8449 p = bolt_pict(oy, ox, y, x, typ);
8451 /* Extract attr/char */
8455 /* Visual effects */
8456 print_rel(c, a, y, x);
8457 move_cursor_relative(y, x);
8458 /*if (fresh_before)*/ Term_fresh();
8459 Term_xtra(TERM_XTRA_DELAY, msec);
8461 /*if (fresh_before)*/ Term_fresh();
8463 /* Display "beam" grids */
8464 if (flg & (PROJECT_BEAM))
8466 /* Obtain the explosion pict */
8467 p = bolt_pict(y, x, y, x, typ);
8469 /* Extract attr/char */
8473 /* Visual effects */
8474 print_rel(c, a, y, x);
8477 /* Hack -- Activate delay */
8481 /* Hack -- delay anyway for consistency */
8484 /* Delay for consistency */
8485 Term_xtra(TERM_XTRA_DELAY, msec);
8488 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8489 if( is_mirror_grid(&cave[y][x]))
8491 /* The target of monsterspell becomes tha mirror(broken) */
8492 monster_target_y=(s16b)y;
8493 monster_target_x=(s16b)x;
8496 next_mirror( &oy,&ox,y,x );
8498 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8499 for( j = last_i; j <=i ; j++ )
8501 y = GRID_Y(path_g[j]);
8502 x = GRID_X(path_g[j]);
8503 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8504 if(!who && (project_m_n==1) && !jump ){
8505 if(cave[project_m_y][project_m_x].m_idx >0 ){
8506 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8508 /* Hack -- auto-recall */
8509 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8511 /* Hack - auto-track */
8512 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8515 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8520 for( i = last_i ; i < path_n ; i++ )
8523 y = GRID_Y(path_g[i]);
8524 x = GRID_X(path_g[i]);
8525 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8527 if(!who && (project_m_n==1) && !jump ){
8528 if(cave[project_m_y][project_m_x].m_idx >0 ){
8529 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8531 /* Hack -- auto-recall */
8532 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8534 /* Hack - auto-track */
8535 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8538 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8542 else if(typ == GF_SUPER_RAY){
8544 int second_step = 0;
8551 for (i = 0; i < path_n; ++i)
8556 int ny = GRID_Y(path_g[i]);
8557 int nx = GRID_X(path_g[i]);
8568 /* Only do visuals if requested */
8569 if (!blind && !(flg & (PROJECT_HIDE)))
8571 /* Only do visuals if the player can "see" the bolt */
8572 if (panel_contains(y, x) && player_has_los_bold(y, x))
8579 /* Obtain the bolt pict */
8580 p = bolt_pict(oy, ox, y, x, typ);
8582 /* Extract attr/char */
8586 /* Visual effects */
8587 print_rel(c, a, y, x);
8588 move_cursor_relative(y, x);
8589 /*if (fresh_before)*/ Term_fresh();
8590 Term_xtra(TERM_XTRA_DELAY, msec);
8592 /*if (fresh_before)*/ Term_fresh();
8594 /* Display "beam" grids */
8595 if (flg & (PROJECT_BEAM))
8597 /* Obtain the explosion pict */
8598 p = bolt_pict(y, x, y, x, typ);
8600 /* Extract attr/char */
8604 /* Visual effects */
8605 print_rel(c, a, y, x);
8608 /* Hack -- Activate delay */
8612 /* Hack -- delay anyway for consistency */
8615 /* Delay for consistency */
8616 Term_xtra(TERM_XTRA_DELAY, msec);
8619 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8620 if (!have_flag(f_flags_bold(y, x), FF_PROJECT))
8622 if( second_step )continue;
8625 if( is_mirror_grid(&cave[y][x]) && !second_step )
8627 /* The target of monsterspell becomes tha mirror(broken) */
8628 monster_target_y=(s16b)y;
8629 monster_target_x=(s16b)x;
8632 for( j = 0; j <=i ; j++ )
8634 y = GRID_Y(path_g[j]);
8635 x = GRID_X(path_g[j]);
8636 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8640 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8641 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8642 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8643 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8644 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8645 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8646 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8647 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8650 for( i = 0; i < path_n ; i++ )
8653 y = GRID_Y(path_g[i]);
8654 x = GRID_X(path_g[i]);
8655 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8656 if(!who && (project_m_n==1) && !jump ){
8657 if(cave[project_m_y][project_m_x].m_idx >0 ){
8658 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8660 /* Hack -- auto-recall */
8661 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8663 /* Hack - auto-track */
8664 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8667 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8672 /* Project along the path */
8673 for (i = 0; i < path_n; ++i)
8678 int ny = GRID_Y(path_g[i]);
8679 int nx = GRID_X(path_g[i]);
8681 if (flg & PROJECT_DISI)
8683 /* Hack -- Balls explode before reaching walls */
8684 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8686 else if (flg & PROJECT_LOS)
8688 /* Hack -- Balls explode before reaching walls */
8689 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
8693 /* Hack -- Balls explode before reaching walls */
8694 if (!have_flag(f_flags_bold(ny, nx), FF_PROJECT) && (rad > 0)) break;
8701 /* Collect beam grids */
8702 if (flg & (PROJECT_BEAM))
8709 /* Only do visuals if requested */
8710 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
8712 /* Only do visuals if the player can "see" the bolt */
8713 if (panel_contains(y, x) && player_has_los_bold(y, x))
8720 /* Obtain the bolt pict */
8721 p = bolt_pict(oy, ox, y, x, typ);
8723 /* Extract attr/char */
8727 /* Visual effects */
8728 print_rel(c, a, y, x);
8729 move_cursor_relative(y, x);
8730 /*if (fresh_before)*/ Term_fresh();
8731 Term_xtra(TERM_XTRA_DELAY, msec);
8733 /*if (fresh_before)*/ Term_fresh();
8735 /* Display "beam" grids */
8736 if (flg & (PROJECT_BEAM))
8738 /* Obtain the explosion pict */
8739 p = bolt_pict(y, x, y, x, typ);
8741 /* Extract attr/char */
8745 /* Visual effects */
8746 print_rel(c, a, y, x);
8749 /* Hack -- Activate delay */
8753 /* Hack -- delay anyway for consistency */
8756 /* Delay for consistency */
8757 Term_xtra(TERM_XTRA_DELAY, msec);
8764 /* Save the "blast epicenter" */
8768 if (breath && !path_n)
8774 flg &= ~(PROJECT_HIDE);
8778 /* Start the "explosion" */
8781 /* Hack -- make sure beams get to "explode" */
8789 /* If we found a "target", explode there */
8790 if (dist <= MAX_RANGE)
8792 /* Mega-Hack -- remove the final "beam" grid */
8793 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8796 * Create a conical breath attack
8807 flg &= ~(PROJECT_HIDE);
8809 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
8813 /* Determine the blast area, work from the inside out */
8814 for (dist = 0; dist <= rad; dist++)
8816 /* Scan the maximal blast area of radius "dist" */
8817 for (y = by - dist; y <= by + dist; y++)
8819 for (x = bx - dist; x <= bx + dist; x++)
8821 /* Ignore "illegal" locations */
8822 if (!in_bounds2(y, x)) continue;
8824 /* Enforce a "circular" explosion */
8825 if (distance(by, bx, y, x) != dist) continue;
8831 /* Lights are stopped by opaque terrains */
8832 if (!los(by, bx, y, x)) continue;
8834 case GF_DISINTEGRATE:
8835 /* Disintegration are stopped only by perma-walls */
8836 if (!in_disintegration_range(by, bx, y, x)) continue;
8839 /* Ball explosions are stopped by walls */
8840 if (!projectable(by, bx, y, x)) continue;
8844 /* Save this grid */
8851 /* Encode some more "radius" info */
8857 /* Speed -- ignore "non-explosions" */
8858 if (!grids) return (FALSE);
8861 /* Display the "blast area" if requested */
8862 if (!blind && !(flg & (PROJECT_HIDE)))
8864 /* Then do the "blast", from inside out */
8865 for (t = 0; t <= gm_rad; t++)
8867 /* Dump everything with this radius */
8868 for (i = gm[t]; i < gm[t+1]; i++)
8870 /* Extract the location */
8874 /* Only do visuals if the player can "see" the blast */
8875 if (panel_contains(y, x) && player_has_los_bold(y, x))
8884 /* Obtain the explosion pict */
8885 p = bolt_pict(y, x, y, x, typ);
8887 /* Extract attr/char */
8891 /* Visual effects -- Display */
8892 print_rel(c, a, y, x);
8896 /* Hack -- center the cursor */
8897 move_cursor_relative(by, bx);
8899 /* Flush each "radius" seperately */
8900 /*if (fresh_before)*/ Term_fresh();
8902 /* Delay (efficiently) */
8903 if (visual || drawn)
8905 Term_xtra(TERM_XTRA_DELAY, msec);
8909 /* Flush the erasing */
8912 /* Erase the explosion drawn above */
8913 for (i = 0; i < grids; i++)
8915 /* Extract the location */
8919 /* Hack -- Erase if needed */
8920 if (panel_contains(y, x) && player_has_los_bold(y, x))
8926 /* Hack -- center the cursor */
8927 move_cursor_relative(by, bx);
8929 /* Flush the explosion */
8930 /*if (fresh_before)*/ Term_fresh();
8935 /* Update stuff if needed */
8936 if (p_ptr->update) update_stuff();
8939 /* Check features */
8940 if (flg & (PROJECT_GRID))
8942 /* Start with "dist" of zero */
8945 /* Scan for features */
8946 for (i = 0; i < grids; i++)
8948 /* Hack -- Notice new "dist" values */
8949 if (gm[dist+1] == i) dist++;
8951 /* Get the grid location */
8955 /* Find the closest point in the blast */
8958 int d = dist_to_line(y, x, y1, x1, by, bx);
8960 /* Affect the grid */
8961 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8965 /* Affect the grid */
8966 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8971 /* Update stuff if needed */
8972 if (p_ptr->update) update_stuff();
8975 if (flg & (PROJECT_ITEM))
8977 /* Start with "dist" of zero */
8980 /* Scan for objects */
8981 for (i = 0; i < grids; i++)
8983 /* Hack -- Notice new "dist" values */
8984 if (gm[dist+1] == i) dist++;
8986 /* Get the grid location */
8990 /* Find the closest point in the blast */
8993 int d = dist_to_line(y, x, y1, x1, by, bx);
8995 /* Affect the object in the grid */
8996 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
9000 /* Affect the object in the grid */
9001 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
9007 /* Check monsters */
9008 if (flg & (PROJECT_KILL))
9015 /* Start with "dist" of zero */
9018 /* Scan for monsters */
9019 for (i = 0; i < grids; i++)
9023 /* Hack -- Notice new "dist" values */
9024 if (gm[dist + 1] == i) dist++;
9026 /* Get the grid location */
9030 /* A single bolt may be reflected */
9033 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9034 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
9036 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
9039 int max_attempts = 10;
9041 /* Choose 'new' target */
9044 t_y = y_saver - 1 + randint1(3);
9045 t_x = x_saver - 1 + randint1(3);
9048 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
9050 if (max_attempts < 1)
9059 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
9060 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9061 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9062 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9064 msg_print("The attack bounces!");
9067 if (is_original_ap(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
9070 /* Reflected bolts randomly target either one */
9071 if (one_in_(2)) flg |= PROJECT_PLAYER;
9072 else flg &= ~(PROJECT_PLAYER);
9074 /* The bolt is reflected */
9075 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9077 /* Don't affect the monster any longer */
9083 /* Find the closest point in the blast */
9086 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9090 effective_dist = dist;
9094 /* There is the riding player on this monster */
9095 if (p_ptr->riding && player_bold(y, x))
9097 /* Aimed on the player */
9098 if (flg & PROJECT_PLAYER)
9100 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9103 * A beam or bolt is well aimed
9105 * So don't affects the mount.
9112 * The spell is not well aimed,
9113 * So partly affect the mount too.
9120 * This grid is the original target.
9121 * Or aimed on your horse.
9123 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
9125 /* Hit the mount with full damage */
9129 * Otherwise this grid is not the
9130 * original target, it means that line
9131 * of fire is obstructed by this
9135 * A beam or bolt will hit either
9136 * player or mount. Choose randomly.
9138 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9142 /* Hit the mount with full damage */
9146 /* Hit the player later */
9147 flg |= PROJECT_PLAYER;
9149 /* Don't affect the mount */
9155 * The spell is not well aimed, so
9156 * partly affect both player and
9165 /* Affect the monster in the grid */
9166 if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
9170 /* Player affected one monster (without "jumping") */
9171 if (!who && (project_m_n == 1) && !jump)
9177 /* Track if possible */
9178 if (cave[y][x].m_idx > 0)
9180 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9182 /* Hack -- auto-recall */
9183 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9185 /* Hack - auto-track */
9186 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9193 if (flg & (PROJECT_KILL))
9195 /* Start with "dist" of zero */
9198 /* Scan for player */
9199 for (i = 0; i < grids; i++)
9203 /* Hack -- Notice new "dist" values */
9204 if (gm[dist+1] == i) dist++;
9206 /* Get the grid location */
9210 /* Affect the player? */
9211 if (!player_bold(y, x)) continue;
9213 /* Find the closest point in the blast */
9216 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9220 effective_dist = dist;
9223 /* Target may be your horse */
9226 /* Aimed on the player */
9227 if (flg & PROJECT_PLAYER)
9229 /* Hit the player with full damage */
9233 * Hack -- When this grid was not the
9234 * original target, a beam or bolt
9235 * would hit either player or mount,
9236 * and should be choosen randomly.
9238 * But already choosen to hit the
9239 * mount at this point.
9241 * Or aimed on your horse.
9243 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9246 * A beam or bolt is well aimed
9248 * So don't affects the player.
9255 * The spell is not well aimed,
9256 * So partly affect the player too.
9262 /* Affect the player */
9263 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9271 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9273 if (rakubadam_m > 0)
9275 if (rakuba(rakubadam_m, FALSE))
9278 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9280 msg_format("%^s has thrown you off!", m_name);
9284 if (p_ptr->riding && rakubadam_p > 0)
9286 if(rakuba(rakubadam_p, FALSE))
9289 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9291 msg_format("You have fallen from %s.", m_name);
9297 /* Return "something was noticed" */
9301 bool binding_field( int dam )
9303 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9304 int mirror_num=0; /* ¶À¤Î¿ô */
9309 int msec= delay_factor*delay_factor*delay_factor;
9315 /* Default target of monsterspell is player */
9316 monster_target_y=py;
9317 monster_target_x=px;
9319 for( x=0 ; x < cur_wid ; x++ )
9321 for( y=0 ; y < cur_hgt ; y++ )
9323 if( is_mirror_grid(&cave[y][x]) &&
9324 distance(py,px,y,x) <= MAX_RANGE &&
9325 distance(py,px,y,x) != 0 &&
9326 player_has_los_bold(y,x) &&
9327 projectable(py, px, y, x)
9329 mirror_y[mirror_num]=y;
9330 mirror_x[mirror_num]=x;
9336 if( mirror_num < 2 )return FALSE;
9338 point_x[0] = randint0( mirror_num );
9340 point_x[1] = randint0( mirror_num );
9342 while( point_x[0] == point_x[1] );
9344 point_y[0]=mirror_y[point_x[0]];
9345 point_x[0]=mirror_x[point_x[0]];
9346 point_y[1]=mirror_y[point_x[1]];
9347 point_x[1]=mirror_x[point_x[1]];
9351 x=point_x[0]+point_x[1]+point_x[2];
9352 y=point_y[0]+point_y[1]+point_y[2];
9354 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9355 - (point_y[0]*3-y)*(point_x[1]*3-x);
9356 if( centersign == 0 )return FALSE;
9358 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9359 x1 = x1 < point_x[2] ? x1 : point_x[2];
9360 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9361 y1 = y1 < point_y[2] ? y1 : point_y[2];
9363 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9364 x2 = x2 > point_x[2] ? x2 : point_x[2];
9365 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9366 y2 = y2 > point_y[2] ? y2 : point_y[2];
9368 for( y=y1 ; y <=y2 ; y++ ){
9369 for( x=x1 ; x <=x2 ; x++ ){
9370 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9371 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9372 centersign*( (point_x[1]-x)*(point_y[2]-y)
9373 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9374 centersign*( (point_x[2]-x)*(point_y[0]-y)
9375 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9377 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9378 /* Visual effects */
9380 && panel_contains(y,x)){
9381 p = bolt_pict(y,x,y,x, GF_MANA );
9382 print_rel(PICT_C(p), PICT_A(p),y,x);
9383 move_cursor_relative(y, x);
9384 /*if (fresh_before)*/ Term_fresh();
9385 Term_xtra(TERM_XTRA_DELAY, msec);
9391 for( y=y1 ; y <=y2 ; y++ ){
9392 for( x=x1 ; x <=x2 ; x++ ){
9393 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9394 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9395 centersign*( (point_x[1]-x)*(point_y[2]-y)
9396 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9397 centersign*( (point_x[2]-x)*(point_y[0]-y)
9398 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9400 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9401 (void)project_f(0,0,y,x,dam,GF_MANA);
9406 for( y=y1 ; y <=y2 ; y++ ){
9407 for( x=x1 ; x <=x2 ; x++ ){
9408 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9409 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9410 centersign*( (point_x[1]-x)*(point_y[2]-y)
9411 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9412 centersign*( (point_x[2]-x)*(point_y[0]-y)
9413 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9415 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9416 (void)project_o(0,0,y,x,dam,GF_MANA);
9421 for( y=y1 ; y <=y2 ; y++ ){
9422 for( x=x1 ; x <=x2 ; x++ ){
9423 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9424 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9425 centersign*( (point_x[1]-x)*(point_y[2]-y)
9426 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9427 centersign*( (point_x[2]-x)*(point_y[0]-y)
9428 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9430 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9431 (void)project_m(0,0,y,x,dam,GF_MANA,
9432 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9439 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9441 msg_print("The field broke a mirror");
9443 remove_mirror(point_y[0],point_x[0]);
9449 void seal_of_mirror( int dam )
9453 for( x = 0 ; x < cur_wid ; x++ )
9455 for( y = 0 ; y < cur_hgt ; y++ )
9457 if( is_mirror_grid(&cave[y][x]))
9459 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9460 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9462 if( !cave[y][x].m_idx )