4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Spell projection */
15 /* ToDo: Make this global */
16 /* 1/x chance of reducing stats (for elemental attacks) */
17 #define HURT_CHANCE 16
20 static int rakubadam_m;
21 static int rakubadam_p;
23 int project_length = 0;
26 * Get another mirror. for SEEKER
28 static void next_mirror( int* next_y , int* next_x , int cury, int curx)
30 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
31 int mirror_num=0; /* ¶À¤Î¿ô */
35 for( x=0 ; x < cur_wid ; x++ )
37 for( y=0 ; y < cur_hgt ; y++ )
39 if( is_mirror_grid(&cave[y][x])){
40 mirror_y[mirror_num]=y;
41 mirror_x[mirror_num]=x;
48 num=randint0(mirror_num);
49 *next_y=mirror_y[num];
50 *next_x=mirror_x[num];
53 *next_y=cury+randint0(5)-2;
54 *next_x=curx+randint0(5)-2;
59 * Get a legal "multi-hued" color for drawing "spells"
61 static byte mh_attr(int max)
63 switch (randint1(max))
65 case 1: return (TERM_RED);
66 case 2: return (TERM_GREEN);
67 case 3: return (TERM_BLUE);
68 case 4: return (TERM_YELLOW);
69 case 5: return (TERM_ORANGE);
70 case 6: return (TERM_VIOLET);
71 case 7: return (TERM_L_RED);
72 case 8: return (TERM_L_GREEN);
73 case 9: return (TERM_L_BLUE);
74 case 10: return (TERM_UMBER);
75 case 11: return (TERM_L_UMBER);
76 case 12: return (TERM_SLATE);
77 case 13: return (TERM_WHITE);
78 case 14: return (TERM_L_WHITE);
79 case 15: return (TERM_L_DARK);
87 * Return a color to use for the bolt/ball spells
89 static byte spell_color(int type)
91 /* Check if A.B.'s new graphics should be used (rr9) */
92 if (streq(ANGBAND_GRAF, "new"))
97 case GF_PSY_SPEAR: return (0x06);
98 case GF_MISSILE: return (0x0F);
99 case GF_ACID: return (0x04);
100 case GF_ELEC: return (0x02);
101 case GF_FIRE: return (0x00);
102 case GF_COLD: return (0x01);
103 case GF_POIS: return (0x03);
104 case GF_HOLY_FIRE: return (0x00);
105 case GF_HELL_FIRE: return (0x00);
106 case GF_MANA: return (0x0E);
108 case GF_SEEKER: return (0x0E);
109 case GF_SUPER_RAY: return (0x0E);
111 case GF_ARROW: return (0x0F);
112 case GF_WATER: return (0x04);
113 case GF_NETHER: return (0x07);
114 case GF_CHAOS: return (mh_attr(15));
115 case GF_DISENCHANT: return (0x05);
116 case GF_NEXUS: return (0x0C);
117 case GF_CONFUSION: return (mh_attr(4));
118 case GF_SOUND: return (0x09);
119 case GF_SHARDS: return (0x08);
120 case GF_FORCE: return (0x09);
121 case GF_INERTIA: return (0x09);
122 case GF_GRAVITY: return (0x09);
123 case GF_TIME: return (0x09);
124 case GF_LITE_WEAK: return (0x06);
125 case GF_LITE: return (0x06);
126 case GF_DARK_WEAK: return (0x07);
127 case GF_DARK: return (0x07);
128 case GF_PLASMA: return (0x0B);
129 case GF_METEOR: return (0x00);
130 case GF_ICE: return (0x01);
131 case GF_ROCKET: return (0x0F);
132 case GF_DEATH_RAY: return (0x07);
133 case GF_NUKE: return (mh_attr(2));
134 case GF_DISINTEGRATE: return (0x05);
146 case GF_CAUSE_4: return (0x0E);
147 case GF_HAND_DOOM: return (0x07);
148 case GF_CAPTURE : return (0x0E);
149 case GF_IDENTIFY: return (0x01);
150 case GF_ATTACK: return (0x0F);
151 case GF_PHOTO : return (0x06);
154 /* Normal tiles or ASCII */
160 /* Lookup the default colors for this type */
161 cptr s = quark_str(gf_color[type]);
164 if (!s) return (TERM_WHITE);
166 /* Pick a random color */
167 c = s[randint0(strlen(s))];
169 /* Lookup this color */
170 a = my_strchr(color_char, c) - color_char;
172 /* Invalid color (note check for < 0 removed, gave a silly
173 * warning because bytes are always >= 0 -- RG) */
174 if (a > 15) return (TERM_WHITE);
180 /* Standard "color" */
186 * Find the attr/char pair to use for a spell effect
188 * It is moving (or has moved) from (x,y) to (nx,ny).
190 * If the distance is not "one", we (may) return "*".
192 u16b bolt_pict(int y, int x, int ny, int nx, int typ)
202 if ((ny == y) && (nx == x)) base = 0x30;
205 else if (nx == x) base = 0x40;
208 else if (ny == y) base = 0x50;
211 else if ((ny - y) == (x - nx)) base = 0x60;
214 else if ((ny - y) == (nx - x)) base = 0x70;
219 /* Basic spell color */
220 k = spell_color(typ);
222 /* Obtain attr/char */
223 a = misc_to_attr[base + k];
224 c = misc_to_char[base + k];
232 * Determine the path taken by a projection.
234 * The projection will always start from the grid (y1,x1), and will travel
235 * towards the grid (y2,x2), touching one grid per unit of distance along
236 * the major axis, and stopping when it enters the destination grid or a
237 * wall grid, or has travelled the maximum legal distance of "range".
239 * Note that "distance" in this function (as in the "update_view()" code)
240 * is defined as "MAX(dy,dx) + MIN(dy,dx)/2", which means that the player
241 * actually has an "octagon of projection" not a "circle of projection".
243 * The path grids are saved into the grid array pointed to by "gp", and
244 * there should be room for at least "range" grids in "gp". Note that
245 * due to the way in which distance is calculated, this function normally
246 * uses fewer than "range" grids for the projection path, so the result
247 * of this function should never be compared directly to "range". Note
248 * that the initial grid (y1,x1) is never saved into the grid array, not
249 * even if the initial grid is also the final grid. XXX XXX XXX
251 * The "flg" flags can be used to modify the behavior of this function.
253 * In particular, the "PROJECT_STOP" and "PROJECT_THRU" flags have the same
254 * semantics as they do for the "project" function, namely, that the path
255 * will stop as soon as it hits a monster, or that the path will continue
256 * through the destination grid, respectively.
258 * The "PROJECT_JUMP" flag, which for the "project()" function means to
259 * start at a special grid (which makes no sense in this function), means
260 * that the path should be "angled" slightly if needed to avoid any wall
261 * grids, allowing the player to "target" any grid which is in "view".
262 * This flag is non-trivial and has not yet been implemented, but could
263 * perhaps make use of the "vinfo" array (above). XXX XXX XXX
265 * This function returns the number of grids (if any) in the path. This
266 * function will return zero if and only if (y1,x1) and (y2,x2) are equal.
268 * This algorithm is similar to, but slightly different from, the one used
269 * by "update_view_los()", and very different from the one used by "los()".
271 sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg)
293 /* No path necessary (or allowed) */
294 if ((x1 == x2) && (y1 == y2)) return (0);
322 /* Number of "units" in one "half" grid */
325 /* Number of "units" in one "full" grid */
331 /* Let m = ((dx/dy) * full) = (dx * dx * 2) */
342 /* Advance (X) part 2 */
345 /* Advance (X) part 3 */
352 /* Create the projection path */
356 gp[n++] = GRID(y, x);
358 /* Hack -- Check maximum range */
359 if ((n + (k >> 1)) >= range) break;
361 /* Sometimes stop at destination grid */
362 if (!(flg & (PROJECT_THRU)))
364 if ((x == x2) && (y == y2)) break;
367 if (flg & (PROJECT_DISI))
369 if ((n > 0) && cave_stop_disintegration(y, x)) break;
371 else if (flg & (PROJECT_LOS))
373 if ((n > 0) && !cave_los_bold(y, x)) break;
375 else if (!(flg & (PROJECT_PATH)))
377 /* Always stop at non-initial wall grids */
378 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
381 /* Sometimes stop at non-initial monsters/players */
382 if (flg & (PROJECT_STOP))
385 (player_bold(y, x) || cave[y][x].m_idx != 0))
389 if (!in_bounds(y, x)) break;
394 /* Advance (X) part 1 */
397 /* Horizontal change */
400 /* Advance (X) part 2 */
403 /* Advance (X) part 3 */
419 /* Let m = ((dy/dx) * full) = (dy * dy * 2) */
428 /* Vertical change */
431 /* Advance (Y) part 2 */
434 /* Advance (Y) part 3 */
441 /* Create the projection path */
445 gp[n++] = GRID(y, x);
447 /* Hack -- Check maximum range */
448 if ((n + (k >> 1)) >= range) break;
450 /* Sometimes stop at destination grid */
451 if (!(flg & (PROJECT_THRU)))
453 if ((x == x2) && (y == y2)) break;
456 if (flg & (PROJECT_DISI))
458 if ((n > 0) && cave_stop_disintegration(y, x)) break;
460 else if (flg & (PROJECT_LOS))
462 if ((n > 0) && !cave_los_bold(y, x)) break;
464 else if (!(flg & (PROJECT_PATH)))
466 /* Always stop at non-initial wall grids */
467 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
470 /* Sometimes stop at non-initial monsters/players */
471 if (flg & (PROJECT_STOP))
474 (player_bold(y, x) || cave[y][x].m_idx != 0))
478 if (!in_bounds(y, x)) break;
483 /* Advance (Y) part 1 */
486 /* Vertical change */
489 /* Advance (Y) part 2 */
492 /* Advance (Y) part 3 */
512 /* Create the projection path */
516 gp[n++] = GRID(y, x);
518 /* Hack -- Check maximum range */
519 if ((n + (n >> 1)) >= range) break;
521 /* Sometimes stop at destination grid */
522 if (!(flg & (PROJECT_THRU)))
524 if ((x == x2) && (y == y2)) break;
527 if (flg & (PROJECT_DISI))
529 if ((n > 0) && cave_stop_disintegration(y, x)) break;
531 else if (flg & (PROJECT_LOS))
533 if ((n > 0) && !cave_los_bold(y, x)) break;
535 else if (!(flg & (PROJECT_PATH)))
537 /* Always stop at non-initial wall grids */
538 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
541 /* Sometimes stop at non-initial monsters/players */
542 if (flg & (PROJECT_STOP))
545 (player_bold(y, x) || cave[y][x].m_idx != 0))
549 if (!in_bounds(y, x)) break;
566 * Mega-Hack -- track "affected" monsters (see "project()" comments)
568 static int project_m_n;
569 static int project_m_x;
570 static int project_m_y;
571 /* Mega-Hack -- monsters target */
572 static s16b monster_target_x;
573 static s16b monster_target_y;
577 * We are called from "project()" to "damage" terrain features
579 * We are called both for "beam" effects and "ball" effects.
581 * The "r" parameter is the "distance from ground zero".
583 * Note that we determine if the player can "see" anything that happens
584 * by taking into account: blindness, line-of-sight, and illumination.
586 * We return "TRUE" if the effect of the projection is "obvious".
588 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
590 * XXX XXX XXX Perhaps we should affect doors?
592 static bool project_f(int who, int r, int y, int x, int dam, int typ)
594 cave_type *c_ptr = &cave[y][x];
595 feature_type *f_ptr = &f_info[c_ptr->feat];
597 bool obvious = FALSE;
598 bool known = player_has_los_bold(y, x);
604 /* Reduce damage by distance */
605 dam = (dam + r) / (r + 1);
608 if (have_flag(f_ptr->flags, FF_TREE))
617 message = "¸Ï¤ì¤¿";break;
619 message = "was blasted.";break;
623 message = "½Ì¤ó¤À";break;
625 message = "shrank.";break;
629 message = "ÍϤ±¤¿";break;
631 message = "melted.";break;
636 message = "Åà¤ê¡¢ºÕ¤±»¶¤Ã¤¿";break;
638 message = "was frozen and smashed.";break;
644 message = "dz¤¨¤¿";break;
646 message = "burns up!";break;
660 message = "Ê´ºÕ¤µ¤ì¤¿";break;
662 message = "was crushed.";break;
665 message = NULL;break;
670 msg_format("ÌÚ¤Ï%s¡£", message);
672 msg_format("A tree %s", message);
674 cave_set_feat(y, x, (one_in_(3) ? FEAT_DEEP_GRASS : FEAT_GRASS));
677 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
679 /* Update some things */
680 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
684 /* Analyze the type */
687 /* Ignore most effects */
722 /* Destroy Traps (and Locks) */
725 /* Reveal secret doors */
726 if (is_hidden_door(c_ptr))
731 /* Check line of sight */
739 if (is_trap(c_ptr->feat))
741 /* Check line of sight */
745 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
747 msg_print("There is a bright flash of light!");
753 /* Destroy the trap */
754 cave_alter_feat(y, x, FF_DISARM);
757 /* Locked doors are unlocked */
758 if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
760 s16b old_feat = c_ptr->feat;
762 /* Unlock the door */
763 cave_alter_feat(y, x, FF_DISARM);
765 /* Check line of sound */
766 if (known && (old_feat != c_ptr->feat))
769 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
778 /* Remove "unsafe" flag if player is not blind */
779 if (!p_ptr->blind && player_has_los_bold(y, x))
781 c_ptr->info &= ~(CAVE_UNSAFE);
792 /* Destroy Doors (and traps) */
795 /* Destroy all doors and traps */
796 if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
798 /* Check line of sight */
803 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
805 msg_print("There is a bright flash of light!");
811 /* Visibility change */
812 if (have_flag(f_ptr->flags, FF_DOOR))
814 /* Update some things */
815 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
818 /* Destroy the feature */
819 cave_alter_feat(y, x, FF_TUNNEL);
822 /* Remove "unsafe" flag if player is not blind */
823 if (!p_ptr->blind && player_has_los_bold(y, x))
825 c_ptr->info &= ~(CAVE_UNSAFE);
836 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
838 if (have_flag(f_ptr->flags, FF_SPIKE))
840 s16b old_mimic = c_ptr->mimic;
841 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
843 cave_alter_feat(y, x, FF_SPIKE);
845 c_ptr->mimic = old_mimic;
853 /* Check line of sight */
854 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
858 msg_format("%s¤Ë²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ³«¤«¤Ê¤¯¤Ê¤Ã¤¿¡£", f_name + mimic_f_ptr->name);
860 msg_format("The %s seems stuck.", f_name + mimic_f_ptr->name);
869 /* Destroy walls (and doors) */
872 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
875 if (known && (c_ptr->info & (CAVE_MARK)))
878 msg_format("%s¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª", f_name + f_info[get_feat_mimic(c_ptr)].name);
880 msg_format("The %s turns into mud!", f_name + f_info[get_feat_mimic(c_ptr)].name);
886 /* Destroy the wall */
887 cave_alter_feat(y, x, FF_HURT_ROCK);
889 /* Update some things */
890 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
899 /* Require a "naked" floor grid */
900 if (!cave_naked_bold(y, x)) break;
902 /* Not on the player */
903 if (player_bold(y, x)) break;
905 /* Create a closed door */
906 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
909 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
911 /* Update some things */
912 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
929 /* Require a "naked" floor grid */
930 if (!cave_naked_bold(y, x)) break;
932 /* Not on the player */
933 if (player_bold(y, x)) break;
935 /* Create a closed door */
936 cave_set_feat(y, x, FEAT_TREES);
939 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
941 /* Update some things */
942 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
949 /* Require a "naked" floor grid */
950 if (!cave_naked_bold(y, x)) break;
953 c_ptr->info |= CAVE_OBJECT;
954 c_ptr->mimic = FEAT_GLYPH;
967 /* Require a "naked" floor grid */
968 if (!cave_naked_bold(y, x)) break;
970 /* Not on the player */
971 if (player_bold(y, x)) break;
974 cave_set_feat(y, x, FEAT_WALL);
976 /* Update some things */
977 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
985 /* Ignore permanent grid */
986 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
991 /* Ignore grid without enough space */
992 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
994 /* Place a shallow lava */
995 cave_set_feat(y, x, FEAT_SHAL_LAVA);
1000 /* Place a deep lava */
1001 cave_set_feat(y, x, FEAT_DEEP_LAVA);
1008 /* Ignore permanent grid */
1009 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
1014 /* Ignore grid without enough space */
1015 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
1017 /* Place a shallow water */
1018 cave_set_feat(y, x, FEAT_SHAL_WATER);
1023 /* Place a deep water */
1024 cave_set_feat(y, x, FEAT_DEEP_WATER);
1029 /* Lite up the grid */
1033 /* Turn on the light */
1034 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
1036 c_ptr->info |= (CAVE_GLOW);
1044 update_local_illumination(y, x);
1047 if (player_can_see_bold(y, x)) obvious = TRUE;
1049 /* Mega-Hack -- Update the monster in the affected grid */
1050 /* This allows "spear of light" (etc) to work "correctly" */
1051 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1057 /* Darken the grid */
1061 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(c_ptr);
1064 /* Turn off the light. */
1067 for (j = 0; j < 9; j++)
1069 int by = y + ddy_ddd[j];
1070 int bx = x + ddx_ddd[j];
1072 if (in_bounds2(by, bx))
1074 cave_type *cc_ptr = &cave[by][bx];
1076 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
1084 if (!do_dark) break;
1086 c_ptr->info &= ~(CAVE_GLOW);
1088 /* Hack -- Forget "boring" grids */
1089 if (!have_flag(f_ptr->flags, FF_REMEMBER))
1092 c_ptr->info &= ~(CAVE_MARK);
1101 update_local_illumination(y, x);
1104 if (player_can_see_bold(y, x)) obvious = TRUE;
1106 /* Mega-Hack -- Update the monster in the affected grid */
1107 /* This allows "spear of light" (etc) to work "correctly" */
1108 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1117 if (is_mirror_grid(c_ptr))
1120 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1122 msg_print("The mirror was crashed!");
1124 remove_mirror(y, x);
1125 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1131 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
1134 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1136 msg_print("The mirror was crashed!");
1138 remove_mirror(y, x);
1139 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1144 case GF_DISINTEGRATE:
1146 /* Destroy mirror */
1147 if (is_mirror_grid(c_ptr)) remove_mirror(y, x);
1149 /* Permanent features don't get effect */
1150 /* But not protect monsters and other objects */
1151 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
1153 cave_alter_feat(y, x, FF_HURT_DISI);
1155 /* Update some things -- similar to GF_KILL_WALL */
1156 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
1163 /* Return "Anything seen?" */
1170 * We are called from "project()" to "damage" objects
1172 * We are called both for "beam" effects and "ball" effects.
1174 * Perhaps we should only SOMETIMES damage things on the ground.
1176 * The "r" parameter is the "distance from ground zero".
1178 * Note that we determine if the player can "see" anything that happens
1179 * by taking into account: blindness, line-of-sight, and illumination.
1181 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1183 * We return "TRUE" if the effect of the projection is "obvious".
1185 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1187 cave_type *c_ptr = &cave[y][x];
1189 s16b this_o_idx, next_o_idx = 0;
1191 bool obvious = FALSE;
1192 bool known = player_has_los_bold(y, x);
1194 u32b flgs[TR_FLAG_SIZE];
1196 char o_name[MAX_NLEN];
1199 bool is_potion = FALSE;
1203 who = who ? who : 0;
1205 /* Reduce damage by distance */
1206 dam = (dam + r) / (r + 1);
1209 /* Scan all objects in the grid */
1210 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1212 /* Acquire object */
1213 object_type *o_ptr = &o_list[this_o_idx];
1215 bool is_art = FALSE;
1216 bool ignore = FALSE;
1217 bool do_kill = FALSE;
1219 cptr note_kill = NULL;
1222 /* Get the "plural"-ness */
1223 bool plural = (o_ptr->number > 1);
1226 /* Acquire next object */
1227 next_o_idx = o_ptr->next_o_idx;
1229 /* Extract the flags */
1230 object_flags(o_ptr, flgs);
1232 /* Check for artifact */
1233 if (object_is_artifact(o_ptr)) is_art = TRUE;
1235 /* Analyze the type */
1238 /* Acid -- Lots of things */
1241 if (hates_acid(o_ptr))
1245 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1247 note_kill = (plural ? " melt!" : " melts!");
1250 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1255 /* Elec -- Rings and Wands */
1258 if (hates_elec(o_ptr))
1262 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1264 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1267 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1272 /* Fire -- Flammable objects */
1275 if (hates_fire(o_ptr))
1279 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1281 note_kill = (plural ? " burn up!" : " burns up!");
1284 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1289 /* Cold -- potions and flasks */
1292 if (hates_cold(o_ptr))
1295 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1297 note_kill = (plural ? " shatter!" : " shatters!");
1301 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1309 if (hates_fire(o_ptr))
1313 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1315 note_kill = (plural ? " burn up!" : " burns up!");
1318 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1320 if (hates_elec(o_ptr))
1325 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1327 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1330 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1338 if (hates_fire(o_ptr))
1342 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1344 note_kill = (plural ? " burn up!" : " burns up!");
1347 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1349 if (hates_cold(o_ptr))
1354 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1356 note_kill = (plural ? " shatter!" : " shatters!");
1359 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1364 /* Hack -- break potions and such */
1370 if (hates_cold(o_ptr))
1373 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1375 note_kill = (plural ? " shatter!" : " shatters!");
1383 /* Mana and Chaos -- destroy everything */
1390 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1392 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1398 case GF_DISINTEGRATE:
1402 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1404 note_kill = (plural ? " evaporate!" : " evaporates!");
1414 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1416 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1419 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1420 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1424 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1428 if (object_is_cursed(o_ptr))
1432 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1434 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1443 identify_item(o_ptr);
1445 /* Auto-inscription */
1446 autopick_alter_item((-this_o_idx), FALSE);
1454 /* Chests are noticed only if trapped or locked */
1455 if (o_ptr->tval == TV_CHEST)
1457 /* Disarm/Unlock traps */
1458 if (o_ptr->pval > 0)
1460 /* Disarm or Unlock */
1461 o_ptr->pval = (0 - o_ptr->pval);
1464 object_known(o_ptr);
1467 if (known && o_ptr->marked)
1470 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1472 msg_print("Click!");
1484 if (o_ptr->tval == TV_CORPSE)
1489 if (!who || is_pet(&m_list[who]))
1490 mode |= PM_FORCE_PET;
1492 for (i = 0; i < o_ptr->number ; i++)
1494 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1495 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1500 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1502 note_kill = (plural ? " become dust." : " becomes dust.");
1507 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1510 note_kill = "À¸¤Ê֤ä¿¡£";
1512 note_kill = "rivived.";
1515 else if (!note_kill)
1518 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1520 note_kill = (plural ? " become dust." : " becomes dust.");
1532 /* Attempt to destroy the object */
1535 /* Effect "observed" */
1536 if (known && o_ptr->marked)
1539 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1542 /* Artifacts, and other objects, get to resist */
1543 if (is_art || ignore)
1545 /* Observe the resist */
1546 if (known && o_ptr->marked)
1549 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1552 msg_format("The %s %s unaffected!",
1553 o_name, (plural ? "are" : "is"));
1562 /* Describe if needed */
1563 if (known && o_ptr->marked && note_kill)
1566 msg_format("%s¤Ï%s", o_name, note_kill);
1568 msg_format("The %s%s", o_name, note_kill);
1573 k_idx = o_ptr->k_idx;
1574 is_potion = object_is_potion(o_ptr);
1577 /* Delete the object */
1578 delete_object_idx(this_o_idx);
1580 /* Potions produce effects when 'shattered' */
1583 (void)potion_smash_effect(who, y, x, k_idx);
1592 /* Return "Anything seen?" */
1598 * Helper function for "project()" below.
1600 * Handle a beam/bolt/ball causing damage to a monster.
1602 * This routine takes a "source monster" (by index) which is mostly used to
1603 * determine if the player is causing the damage, and a "radius" (see below),
1604 * which is used to decrease the power of explosions with distance, and a
1605 * location, via integers which are modified by certain types of attacks
1606 * (polymorph and teleport being the obvious ones), a default damage, which
1607 * is modified as needed based on various properties, and finally a "damage
1608 * type" (see below).
1610 * Note that this routine can handle "no damage" attacks (like teleport) by
1611 * taking a "zero" damage, and can even take "parameters" to attacks (like
1612 * confuse) by accepting a "damage", using it to calculate the effect, and
1613 * then setting the damage to zero. Note that the "damage" parameter is
1614 * divided by the radius, so monsters not at the "epicenter" will not take
1615 * as much damage (or whatever)...
1617 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1618 * may result in a dereference of an invalid pointer. XXX XXX XXX
1620 * Various messages are produced, and damage is applied.
1622 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1623 * actually be "made" of that substance, or "breathe" big balls of it.
1625 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1628 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1629 * and hurts evil less. If can breath nether, then it resists it as well.
1631 * Damage reductions use the following formulas:
1632 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1633 * gives avg damage of .655, ranging from .858 to .500
1634 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1635 * gives avg damage of .544, ranging from .714 to .417
1636 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1637 * gives avg damage of .444, ranging from .556 to .333
1638 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1639 * gives avg damage of .327, ranging from .427 to .250
1640 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1641 * gives something simple.
1643 * In this function, "result" messages are postponed until the end, where
1644 * the "note" string is appended to the monster name, if not NULL. So,
1645 * to make a spell have "no effect" just set "note" to NULL. You should
1646 * also set "notice" to FALSE, or the player will learn what the spell does.
1648 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1650 /* "flg" was added. */
1651 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1655 cave_type *c_ptr = &cave[y][x];
1657 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1658 monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
1660 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1664 /* Is the monster "seen"? */
1665 bool seen = m_ptr->ml;
1666 bool seen_msg = is_seen(m_ptr);
1668 bool slept = (bool)(m_ptr->csleep > 0);
1670 /* Were the effects "obvious" (if seen)? */
1671 bool obvious = FALSE;
1673 /* Can the player know about this effect? */
1674 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1676 /* Can the player see the source of this effect? */
1677 bool see_s_msg = ((who <= 0) || is_seen(caster_ptr));
1679 /* Were the effects "irrelevant"? */
1680 bool skipped = FALSE;
1682 /* Gets the monster angry at the source of the effect? */
1683 bool get_angry = FALSE;
1685 /* Polymorph setting (true or false) */
1686 bool do_poly = FALSE;
1688 /* Teleport setting (max distance) */
1691 /* Confusion setting (amount to confuse) */
1694 /* Stunning setting (amount to stun) */
1697 /* Sleep amount (amount to sleep) */
1700 /* Fear amount (amount to fear) */
1703 /* Time amount (amount to time) */
1706 bool heal_leper = FALSE;
1708 /* Hold the monster name */
1717 /* Assume no note */
1720 /* Assume a default death */
1721 cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
1726 int caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1729 if (!c_ptr->m_idx) return (FALSE);
1731 /* Never affect projector */
1732 if (who && (c_ptr->m_idx == who)) return (FALSE);
1733 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1734 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1736 /* Don't affect already death monsters */
1737 /* Prevents problems with chain reactions of exploding monsters */
1738 if (m_ptr->hp < 0) return (FALSE);
1740 /* Reduce damage by distance */
1741 dam = (dam + r) / (r + 1);
1744 /* Get the monster name (BEFORE polymorphing) */
1745 monster_desc(m_name, m_ptr, 0);
1748 /* Get the monster possessive ("his"/"her"/"its") */
1749 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1753 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1755 /* Analyze the damage type */
1758 /* Magic Missile -- pure damage */
1761 if (seen) obvious = TRUE;
1763 if (r_ptr->flagsr & RFR_RES_ALL)
1766 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1768 note = " is immune.";
1771 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1780 if (seen) obvious = TRUE;
1782 if (r_ptr->flagsr & RFR_RES_ALL)
1785 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1787 note = " is immune.";
1790 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1793 if (r_ptr->flagsr & RFR_IM_ACID)
1796 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1798 note = " resists a lot.";
1802 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1810 if (seen) obvious = TRUE;
1812 if (r_ptr->flagsr & RFR_RES_ALL)
1815 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1817 note = " is immune.";
1820 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1823 if (r_ptr->flagsr & RFR_IM_ELEC)
1826 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1828 note = " resists a lot.";
1832 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1840 if (seen) obvious = TRUE;
1842 if (r_ptr->flagsr & RFR_RES_ALL)
1845 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1847 note = " is immune.";
1850 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1853 if (r_ptr->flagsr & RFR_IM_FIRE)
1856 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1858 note = " resists a lot.";
1862 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1864 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1867 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1869 note = " is hit hard.";
1873 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1881 if (seen) obvious = TRUE;
1883 if (r_ptr->flagsr & RFR_RES_ALL)
1886 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1888 note = " is immune.";
1891 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1894 if (r_ptr->flagsr & RFR_IM_COLD)
1897 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1899 note = " resists a lot.";
1903 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1905 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1908 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1910 note = " is hit hard.";
1914 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1922 if (seen) obvious = TRUE;
1924 if (r_ptr->flagsr & RFR_RES_ALL)
1927 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1929 note = " is immune.";
1932 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1935 if (r_ptr->flagsr & RFR_IM_POIS)
1938 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1940 note = " resists a lot.";
1944 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1952 if (seen) obvious = TRUE;
1954 if (r_ptr->flagsr & RFR_RES_ALL)
1957 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1959 note = " is immune.";
1962 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1965 if (r_ptr->flagsr & RFR_IM_POIS)
1968 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
1973 dam *= 3; dam /= randint1(6) + 6;
1974 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1976 else if (one_in_(3)) do_poly = TRUE;
1980 /* Hellfire -- hurts Evil */
1983 if (seen) obvious = TRUE;
1985 if (r_ptr->flagsr & RFR_RES_ALL)
1988 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1990 note = " is immune.";
1993 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1996 if (r_ptr->flags3 & RF3_GOOD)
2000 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2002 note = " is hit hard.";
2005 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
2010 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2013 if (seen) obvious = TRUE;
2015 if (r_ptr->flagsr & RFR_RES_ALL)
2018 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2020 note = " is immune.";
2023 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2026 if (r_ptr->flags3 & RF3_GOOD)
2030 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2032 note = " is immune.";
2035 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
2037 else if (r_ptr->flags3 & RF3_EVIL)
2041 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2043 note = " is hit hard.";
2046 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
2051 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2056 dam *= 3; dam /= randint1(6) + 6;
2061 /* Arrow -- XXX no defense */
2064 if (seen) obvious = TRUE;
2066 if (r_ptr->flagsr & RFR_RES_ALL)
2069 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2071 note = " is immune.";
2074 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2080 /* Plasma -- XXX perhaps check ELEC or FIRE */
2083 if (seen) obvious = TRUE;
2085 if (r_ptr->flagsr & RFR_RES_ALL)
2088 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2090 note = " is immune.";
2093 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2096 if (r_ptr->flagsr & RFR_RES_PLAS)
2099 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2104 dam *= 3; dam /= randint1(6) + 6;
2105 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
2110 /* Nether -- see above */
2113 if (seen) obvious = TRUE;
2115 if (r_ptr->flagsr & RFR_RES_ALL)
2118 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2120 note = " is immune.";
2123 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2126 if (r_ptr->flagsr & RFR_RES_NETH)
2128 if (r_ptr->flags3 & RF3_UNDEAD)
2131 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2133 note = " is immune.";
2137 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2142 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2147 dam *= 3; dam /= randint1(6) + 6;
2149 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
2151 else if (r_ptr->flags3 & RF3_EVIL)
2155 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2157 note = " resists somewhat.";
2160 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2165 /* Water (acid) damage -- Water spirits/elementals are immune */
2168 if (seen) obvious = TRUE;
2170 if (r_ptr->flagsr & RFR_RES_ALL)
2173 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2175 note = " is immune.";
2178 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2181 if (r_ptr->flagsr & RFR_RES_WATE)
2183 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
2186 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2188 note = " is immune.";
2196 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2201 dam *= 3; dam /= randint1(6) + 6;
2203 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
2208 /* Chaos -- Chaos breathers resist */
2211 if (seen) obvious = TRUE;
2213 if (r_ptr->flagsr & RFR_RES_ALL)
2216 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2218 note = " is immune.";
2221 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2224 if (r_ptr->flagsr & RFR_RES_CHAO)
2227 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2232 dam *= 3; dam /= randint1(6) + 6;
2233 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
2235 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
2238 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2240 note = " resists somewhat.";
2243 dam *= 3; dam /= randint1(6) + 6;
2244 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2249 do_conf = (5 + randint1(11) + r) / (r + 1);
2254 /* Shards -- Shard breathers resist */
2257 if (seen) obvious = TRUE;
2259 if (r_ptr->flagsr & RFR_RES_ALL)
2262 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2264 note = " is immune.";
2267 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2270 if (r_ptr->flagsr & RFR_RES_SHAR)
2273 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2278 dam *= 3; dam /= randint1(6) + 6;
2279 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2284 /* Rocket: Shard resistance helps */
2287 if (seen) obvious = TRUE;
2289 if (r_ptr->flagsr & RFR_RES_ALL)
2292 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2294 note = " is immune.";
2297 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2300 if (r_ptr->flagsr & RFR_RES_SHAR)
2303 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2305 note = " resists somewhat.";
2309 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2315 /* Sound -- Sound breathers resist */
2318 if (seen) obvious = TRUE;
2320 if (r_ptr->flagsr & RFR_RES_ALL)
2323 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2325 note = " is immune.";
2328 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2331 if (r_ptr->flagsr & RFR_RES_SOUN)
2334 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2339 dam *= 2; dam /= randint1(6) + 6;
2340 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
2342 else do_stun = (10 + randint1(15) + r) / (r + 1);
2349 if (seen) obvious = TRUE;
2351 if (r_ptr->flagsr & RFR_RES_ALL)
2354 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2356 note = " is immune.";
2359 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2362 if (r_ptr->flags3 & RF3_NO_CONF)
2365 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2370 dam *= 3; dam /= randint1(6) + 6;
2371 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2373 else do_conf = (10 + randint1(15) + r) / (r + 1);
2377 /* Disenchantment -- Breathers and Disenchanters resist */
2380 if (seen) obvious = TRUE;
2382 if (r_ptr->flagsr & RFR_RES_ALL)
2385 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2387 note = " is immune.";
2390 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2393 if (r_ptr->flagsr & RFR_RES_DISE)
2396 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2401 dam *= 3; dam /= randint1(6) + 6;
2402 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
2407 /* Nexus -- Breathers and Existers resist */
2410 if (seen) obvious = TRUE;
2412 if (r_ptr->flagsr & RFR_RES_ALL)
2415 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2417 note = " is immune.";
2420 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2423 if (r_ptr->flagsr & RFR_RES_NEXU)
2426 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2431 dam *= 3; dam /= randint1(6) + 6;
2432 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
2440 if (seen) obvious = TRUE;
2442 if (r_ptr->flagsr & RFR_RES_ALL)
2445 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2447 note = " is immune.";
2450 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2453 if (r_ptr->flagsr & RFR_RES_WALL)
2456 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2461 dam *= 3; dam /= randint1(6) + 6;
2462 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
2464 else do_stun = (randint1(15) + r) / (r + 1);
2468 /* Inertia -- breathers resist */
2471 if (seen) obvious = TRUE;
2473 if (r_ptr->flagsr & RFR_RES_ALL)
2476 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2478 note = " is immune.";
2481 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2484 if (r_ptr->flagsr & RFR_RES_INER)
2487 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2492 dam *= 3; dam /= randint1(6) + 6;
2493 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
2497 /* Powerful monsters can resist */
2498 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2499 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2503 /* Normal monsters slow down */
2509 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2511 note = " starts moving slower.";
2514 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2515 if (c_ptr->m_idx == p_ptr->riding)
2516 p_ptr->update |= (PU_BONUS);
2522 /* Time -- breathers resist */
2525 if (seen) obvious = TRUE;
2527 if (r_ptr->flagsr & RFR_RES_ALL)
2530 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2532 note = " is immune.";
2535 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2538 if (r_ptr->flagsr & RFR_RES_TIME)
2541 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2546 dam *= 3; dam /= randint1(6) + 6;
2547 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
2549 else do_time = (dam + 1) / 2;
2553 /* Gravity -- breathers resist */
2556 bool resist_tele = FALSE;
2558 if (seen) obvious = TRUE;
2560 if (r_ptr->flagsr & RFR_RES_ALL)
2563 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2565 note = " is immune.";
2568 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2571 if (r_ptr->flagsr & RFR_RES_TELE)
2573 if (r_ptr->flags1 & (RF1_UNIQUE))
2575 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2577 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2579 note = " is unaffected!";
2584 else if (r_ptr->level > randint1(100))
2586 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2588 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2597 if (!resist_tele) do_dist = 10;
2599 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2601 if (r_ptr->flagsr & RFR_RES_GRAV)
2604 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2609 dam *= 3; dam /= randint1(6) + 6;
2611 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
2616 /* Powerful monsters can resist */
2617 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2618 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2622 /* Normal monsters slow down */
2628 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2630 note = " starts moving slower.";
2633 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2634 if (c_ptr->m_idx == p_ptr->riding)
2635 p_ptr->update |= (PU_BONUS);
2639 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2641 /* Attempt a saving throw */
2642 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2643 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2647 /* No obvious effect */
2649 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2651 note = " is unaffected!";
2665 if (seen) obvious = TRUE;
2667 if (r_ptr->flagsr & RFR_RES_ALL)
2670 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2672 note = " is immune.";
2675 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2683 case GF_DISINTEGRATE:
2685 if (seen) obvious = TRUE;
2687 if (r_ptr->flagsr & RFR_RES_ALL)
2690 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2692 note = " is immune.";
2695 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2698 if (r_ptr->flags3 & RF3_HURT_ROCK)
2700 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2702 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2703 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2705 note = " loses some skin!";
2706 note_dies = " evaporates!";
2716 if (seen) obvious = TRUE;
2718 /* PSI only works if the monster can see you! -- RG */
2719 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2722 if (seen_msg) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name);
2724 if (seen_msg) msg_format("%^s can't see you, and isn't affected!", m_name);
2730 if (r_ptr->flagsr & RFR_RES_ALL)
2733 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2735 note = " is immune.";
2738 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2741 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2745 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2747 note = " is immune!";
2749 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2752 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2753 (r_ptr->flags3 & RF3_ANIMAL) ||
2754 (r_ptr->level > randint1(3 * dam)))
2758 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2765 * Powerful demons & undead can turn a mindcrafter's
2766 * attacks back on them
2768 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2769 (r_ptr->level > p_ptr->lev / 2) &&
2774 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2776 msg_format("%^s%s corrupted mind backlashes your attack!",
2777 m_name, (seen ? "'s" : "s"));
2781 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2784 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2786 msg_print("You resist the effects!");
2792 /* Injure +/- confusion */
2793 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2794 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2797 switch (randint1(4))
2800 set_confused(p_ptr->confused + 3 + randint1(dam));
2803 set_stun(p_ptr->stun + randint1(dam));
2807 if (r_ptr->flags3 & RF3_NO_FEAR)
2809 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2811 note = " is unaffected.";
2815 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2819 if (!p_ptr->free_act)
2820 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2829 if ((dam > 0) && one_in_(4))
2831 switch (randint1(4))
2834 do_conf = 3 + randint1(dam);
2837 do_stun = 3 + randint1(dam);
2840 do_fear = 3 + randint1(dam);
2844 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2846 note = " falls asleep!";
2849 do_sleep = 3 + randint1(dam);
2855 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2857 note_dies = " collapses, a mindless husk.";
2865 if (seen) obvious = TRUE;
2867 if (r_ptr->flagsr & RFR_RES_ALL)
2870 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2872 note = " is immune.";
2875 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2878 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2882 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2884 note = " is immune!";
2888 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2889 (r_ptr->flags3 & RF3_ANIMAL) ||
2890 (r_ptr->level > randint1(3 * dam)))
2894 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2901 * Powerful demons & undead can turn a mindcrafter's
2902 * attacks back on them
2904 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2905 (r_ptr->level > p_ptr->lev / 2) &&
2910 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2912 msg_format("%^s%s corrupted mind backlashes your attack!",
2913 m_name, (seen ? "'s" : "s"));
2917 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2920 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2922 msg_print("You resist the effects!");
2928 /* Injure + mana drain */
2929 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2931 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
2933 msg_print("Your psychic energy is drained!");
2936 p_ptr->csp -= damroll(5, dam) / 2;
2937 if (p_ptr->csp < 0) p_ptr->csp = 0;
2938 p_ptr->redraw |= PR_MANA;
2939 p_ptr->window |= (PW_SPELL);
2940 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2947 int b = damroll(5, dam) / 4;
2949 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª", m_name);
2951 msg_format("You convert %s%s pain into psychic energy!",
2952 m_name, (seen ? "'s" : "s"));
2955 b = MIN(p_ptr->msp, p_ptr->csp + b);
2957 p_ptr->redraw |= PR_MANA;
2958 p_ptr->window |= (PW_SPELL);
2962 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2964 note_dies = " collapses, a mindless husk.";
2970 case GF_TELEKINESIS:
2972 if (seen) obvious = TRUE;
2974 if (r_ptr->flagsr & RFR_RES_ALL)
2977 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2979 note = " is immune.";
2982 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2987 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2992 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2994 /* Attempt a saving throw */
2995 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2996 (r_ptr->level > 5 + randint1(dam)))
3000 /* No obvious effect */
3006 /* Psycho-spear -- powerful magic missile */
3009 if (seen) obvious = TRUE;
3011 if (r_ptr->flagsr & RFR_RES_ALL)
3014 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3016 note = " is immune.";
3019 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3025 /* Meteor -- powerful magic missile */
3028 if (seen) obvious = TRUE;
3030 if (r_ptr->flagsr & RFR_RES_ALL)
3033 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3035 note = " is immune.";
3038 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3046 if (!is_hostile(m_ptr)) break;
3048 if (seen) obvious = TRUE;
3050 if (r_ptr->flagsr & RFR_RES_ALL)
3053 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3055 note = " is immune.";
3058 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3061 /* Attempt a saving throw */
3062 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
3063 (r_ptr->flags3 & RF3_NO_CONF) ||
3064 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3066 /* Memorize a flag */
3067 if (r_ptr->flags3 & RF3_NO_CONF)
3069 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3076 * Powerful demons & undead can turn a mindcrafter's
3077 * attacks back on them
3079 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
3080 (r_ptr->level > p_ptr->lev / 2) &&
3085 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
3087 msg_format("%^s%s corrupted mind backlashes your attack!",
3088 m_name, (seen ? "'s" : "s"));
3092 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3095 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3097 msg_print("You resist the effects!");
3103 /* Confuse, stun, terrify */
3104 switch (randint1(4))
3107 set_stun(p_ptr->stun + dam / 2);
3110 set_confused(p_ptr->confused + dam / 2);
3114 if (r_ptr->flags3 & RF3_NO_FEAR)
3116 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3118 note = " is unaffected.";
3122 set_afraid(p_ptr->afraid + dam);
3129 /* No obvious effect */
3131 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3133 note = " is unaffected!";
3141 if ((dam > 29) && (randint1(100) < dam))
3144 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3146 note = " is in your thrall!";
3153 switch (randint1(4))
3167 /* No "real" damage */
3174 /* Ice -- Cold + Cuts + Stun */
3177 if (seen) obvious = TRUE;
3179 if (r_ptr->flagsr & RFR_RES_ALL)
3182 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3184 note = " is immune.";
3187 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3190 do_stun = (randint1(15) + 1) / (r + 1);
3191 if (r_ptr->flagsr & RFR_IM_COLD)
3194 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3196 note = " resists a lot.";
3200 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
3202 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3205 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3207 note = " is hit hard.";
3211 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3220 if (seen) obvious = TRUE;
3222 if (r_ptr->flagsr & RFR_RES_ALL)
3225 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3227 note = " is immune.";
3230 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3233 if (!monster_living(r_ptr))
3235 if (is_original_ap_and_seen(m_ptr))
3237 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3238 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3239 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3243 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3245 note = " is unaffected!";
3251 else do_time = (dam+7)/8;
3259 if (seen) obvious = TRUE;
3261 if (r_ptr->flagsr & RFR_RES_ALL)
3264 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3266 note = " is immune.";
3269 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3272 if (!monster_living(r_ptr))
3274 if (is_original_ap_and_seen(m_ptr))
3276 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3277 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3278 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3282 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3284 note = " is immune.";
3290 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3291 (randint1(888) != 666)) ||
3292 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
3293 randint1(100) != 66))
3296 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3308 /* Polymorph monster (Use "dam" as "power") */
3311 if (seen) obvious = TRUE;
3313 if (r_ptr->flagsr & RFR_RES_ALL)
3316 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3318 note = " is immune.";
3321 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3324 /* Attempt to polymorph (see below) */
3327 /* Powerful monsters can resist */
3328 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3329 (r_ptr->flags1 & RF1_QUESTOR) ||
3330 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3333 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3335 note = " is unaffected!";
3342 /* No "real" damage */
3349 /* Clone monsters (Ignore "dam") */
3352 if (seen) obvious = TRUE;
3354 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
3357 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3359 note = " is unaffected!";
3365 m_ptr->hp = m_ptr->maxhp;
3367 /* Attempt to clone. */
3368 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3371 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3379 /* No "real" damage */
3386 /* Heal Monster (use "dam" as amount of healing) */
3389 if (seen) obvious = TRUE;
3394 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3396 if (m_ptr->maxhp < m_ptr->max_maxhp)
3399 if (seen_msg) msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3401 if (seen_msg) msg_format("%^s recovers %s vitality.", m_name, m_poss);
3403 m_ptr->maxhp = m_ptr->max_maxhp;
3409 if (seen) obvious = TRUE;
3414 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3419 if (seen_msg) msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3421 if (seen_msg) msg_format("%^s is no longer stunned.", m_name);
3425 if (m_ptr->confused)
3428 if (seen_msg) msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3430 if (seen_msg) msg_format("%^s is no longer confused.", m_name);
3432 m_ptr->confused = 0;
3437 if (seen_msg) msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3439 if (seen_msg) msg_format("%^s recovers %s courage.", m_name, m_poss);
3445 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3448 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3452 chg_virtue(V_VITALITY, 1);
3454 if (r_ptr->flags1 & RF1_UNIQUE)
3455 chg_virtue(V_INDIVIDUALISM, 1);
3457 if (is_friendly(m_ptr))
3458 chg_virtue(V_HONOUR, 1);
3459 else if (!(r_ptr->flags3 & RF3_EVIL))
3461 if (r_ptr->flags3 & RF3_GOOD)
3462 chg_virtue(V_COMPASSION, 2);
3464 chg_virtue(V_COMPASSION, 1);
3467 if (r_ptr->flags3 & RF3_ANIMAL)
3468 chg_virtue(V_NATURE, 1);
3471 if (m_ptr->r_idx == MON_LEPER)
3474 if (!who) chg_virtue(V_COMPASSION, 5);
3477 /* Redraw (later) if needed */
3478 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3479 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3483 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3485 note = " looks healthier.";
3489 /* No "real" damage */
3495 /* Speed Monster (Ignore "dam") */
3498 if (seen) obvious = TRUE;
3504 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3506 note = " starts moving faster.";
3509 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3511 if (c_ptr->m_idx == p_ptr->riding)
3512 p_ptr->update |= (PU_BONUS);
3516 if (r_ptr->flags1 & RF1_UNIQUE)
3517 chg_virtue(V_INDIVIDUALISM, 1);
3518 if (is_friendly(m_ptr))
3519 chg_virtue(V_HONOUR, 1);
3522 /* No "real" damage */
3528 /* Slow Monster (Use "dam" as "power") */
3531 if (seen) obvious = TRUE;
3533 if (r_ptr->flagsr & RFR_RES_ALL)
3536 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3538 note = " is immune.";
3541 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3544 /* Powerful monsters can resist */
3545 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3546 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3549 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3551 note = " is unaffected!";
3557 /* Normal monsters slow down */
3563 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3565 note = " starts moving slower.";
3568 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3570 if (c_ptr->m_idx == p_ptr->riding)
3571 p_ptr->update |= (PU_BONUS);
3574 /* No "real" damage */
3580 /* Sleep (Use "dam" as "power") */
3583 if (seen) obvious = TRUE;
3585 if (r_ptr->flagsr & RFR_RES_ALL)
3588 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3590 note = " is immune.";
3593 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3596 /* Attempt a saving throw */
3597 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3598 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3599 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3601 /* Memorize a flag */
3602 if (r_ptr->flags3 & RF3_NO_SLEEP)
3604 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3607 /* No obvious effect */
3609 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3611 note = " is unaffected!";
3618 /* Go to sleep (much) later */
3620 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3622 note = " falls asleep!";
3628 /* No "real" damage */
3634 /* Sleep (Use "dam" as "power") */
3635 case GF_STASIS_EVIL:
3637 if (seen) obvious = TRUE;
3639 if (r_ptr->flagsr & RFR_RES_ALL)
3642 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3644 note = " is immune.";
3647 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3650 /* Attempt a saving throw */
3651 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3652 !(r_ptr->flags3 & RF3_EVIL) ||
3653 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3656 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3658 note = " is unaffected!";
3665 /* Go to sleep (much) later */
3667 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3669 note = " is suspended!";
3675 /* No "real" damage */
3680 /* Sleep (Use "dam" as "power") */
3683 if (seen) obvious = TRUE;
3685 if (r_ptr->flagsr & RFR_RES_ALL)
3688 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3690 note = " is immune.";
3693 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3696 /* Attempt a saving throw */
3697 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3698 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3701 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3703 note = " is unaffected!";
3710 /* Go to sleep (much) later */
3712 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3714 note = " is suspended!";
3720 /* No "real" damage */
3729 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3730 vir = virtue_number(V_HARMONY);
3733 dam += p_ptr->virtues[vir-1]/10;
3736 vir = virtue_number(V_INDIVIDUALISM);
3739 dam -= p_ptr->virtues[vir-1]/20;
3742 if (seen) obvious = TRUE;
3744 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3747 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3749 note = " is immune.";
3752 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3756 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3759 /* Attempt a saving throw */
3760 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3761 (r_ptr->flags3 & RF3_NO_CONF) ||
3762 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3763 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3765 /* Memorize a flag */
3766 if (r_ptr->flags3 & RF3_NO_CONF)
3768 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3772 /* No obvious effect */
3774 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3776 note = " is unaffected!";
3781 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3783 else if (p_ptr->cursed & TRC_AGGRAVATE)
3786 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3788 note = " hates you too much!";
3791 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3796 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3798 note = " suddenly seems friendly!";
3803 chg_virtue(V_INDIVIDUALISM, -1);
3804 if (r_ptr->flags3 & RF3_ANIMAL)
3805 chg_virtue(V_NATURE, 1);
3808 /* No "real" damage */
3813 /* Control undead */
3814 case GF_CONTROL_UNDEAD:
3817 if (seen) obvious = TRUE;
3819 vir = virtue_number(V_UNLIFE);
3822 dam += p_ptr->virtues[vir-1]/10;
3825 vir = virtue_number(V_INDIVIDUALISM);
3828 dam -= p_ptr->virtues[vir-1]/20;
3831 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3834 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3836 note = " is immune.";
3839 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3843 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3846 /* Attempt a saving throw */
3847 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3848 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3849 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3850 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3852 /* No obvious effect */
3854 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3856 note = " is unaffected!";
3860 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3862 else if (p_ptr->cursed & TRC_AGGRAVATE)
3865 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3867 note = " hates you too much!";
3870 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3875 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3877 note = " is in your thrall!";
3883 /* No "real" damage */
3889 case GF_CONTROL_DEMON:
3892 if (seen) obvious = TRUE;
3894 vir = virtue_number(V_UNLIFE);
3897 dam += p_ptr->virtues[vir-1]/10;
3900 vir = virtue_number(V_INDIVIDUALISM);
3903 dam -= p_ptr->virtues[vir-1]/20;
3906 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3909 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3911 note = " is immune.";
3914 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3918 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3921 /* Attempt a saving throw */
3922 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3923 (!(r_ptr->flags3 & RF3_DEMON)) ||
3924 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3925 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3927 /* No obvious effect */
3929 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3931 note = " is unaffected!";
3935 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3937 else if (p_ptr->cursed & TRC_AGGRAVATE)
3940 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3942 note = " hates you too much!";
3945 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3950 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3952 note = " is in your thrall!";
3958 /* No "real" damage */
3964 case GF_CONTROL_ANIMAL:
3968 if (seen) obvious = TRUE;
3970 vir = virtue_number(V_NATURE);
3973 dam += p_ptr->virtues[vir-1]/10;
3976 vir = virtue_number(V_INDIVIDUALISM);
3979 dam -= p_ptr->virtues[vir-1]/20;
3982 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3985 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3987 note = " is immune.";
3990 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3994 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3997 /* Attempt a saving throw */
3998 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3999 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
4000 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4001 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4002 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4004 /* Memorize a flag */
4005 if (r_ptr->flags3 & (RF3_NO_CONF))
4007 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4011 /* No obvious effect */
4013 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4015 note = " is unaffected!";
4019 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4021 else if (p_ptr->cursed & TRC_AGGRAVATE)
4024 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4026 note = " hates you too much!";
4029 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4034 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4036 note = " is tamed!";
4041 if (r_ptr->flags3 & RF3_ANIMAL)
4042 chg_virtue(V_NATURE, 1);
4045 /* No "real" damage */
4051 case GF_CONTROL_LIVING:
4055 vir = virtue_number(V_UNLIFE);
4056 if (seen) obvious = TRUE;
4058 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4059 vir = virtue_number(V_UNLIFE);
4062 dam -= p_ptr->virtues[vir-1]/10;
4065 vir = virtue_number(V_INDIVIDUALISM);
4068 dam -= p_ptr->virtues[vir-1]/20;
4071 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4072 if (dam < 1) dam = 1;
4074 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4076 msg_format("You stare into %s.", m_name);
4078 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4081 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4083 note = " is immune.";
4086 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4090 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4093 /* Attempt a saving throw */
4094 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4095 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4096 !monster_living(r_ptr) ||
4097 ((r_ptr->level+10) > randint1(dam)))
4100 /* No obvious effect */
4102 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4104 note = " is unaffected!";
4108 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4110 else if (p_ptr->cursed & TRC_AGGRAVATE)
4113 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4115 note = " hates you too much!";
4118 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4123 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4125 note = " is tamed!";
4130 if (r_ptr->flags3 & RF3_ANIMAL)
4131 chg_virtue(V_NATURE, 1);
4134 /* No "real" damage */
4139 /* Confusion (Use "dam" as "power") */
4142 if (seen) obvious = TRUE;
4144 if (r_ptr->flagsr & RFR_RES_ALL)
4147 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4149 note = " is immune.";
4152 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4155 /* Get confused later */
4156 do_conf = damroll(3, (dam / 2)) + 1;
4158 /* Attempt a saving throw */
4159 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4160 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4161 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4163 /* Memorize a flag */
4164 if (r_ptr->flags3 & (RF3_NO_CONF))
4166 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4172 /* No obvious effect */
4174 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4176 note = " is unaffected!";
4182 /* No "real" damage */
4189 if (seen) obvious = TRUE;
4191 if (r_ptr->flagsr & RFR_RES_ALL)
4194 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4196 note = " is immune.";
4199 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4202 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
4204 /* Attempt a saving throw */
4205 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4206 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4211 /* No obvious effect */
4213 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4215 note = " is unaffected!";
4221 /* No "real" damage */
4229 /* Lite, but only hurts susceptible creatures */
4237 if (r_ptr->flagsr & RFR_RES_ALL)
4243 if (r_ptr->flags3 & (RF3_HURT_LITE))
4245 /* Obvious effect */
4246 if (seen) obvious = TRUE;
4248 /* Memorize the effects */
4249 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4251 /* Special effect */
4253 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4254 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4256 note = " cringes from the light!";
4257 note_dies = " shrivels away in the light!";
4262 /* Normally no damage */
4274 /* Lite -- opposite of Dark */
4277 if (seen) obvious = TRUE;
4279 if (r_ptr->flagsr & RFR_RES_ALL)
4282 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4284 note = " is immune.";
4287 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4290 if (r_ptr->flagsr & RFR_RES_LITE)
4293 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4298 dam *= 2; dam /= (randint1(6)+6);
4299 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4301 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4303 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4305 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4306 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4308 note = " cringes from the light!";
4309 note_dies = " shrivels away in the light!";
4318 /* Dark -- opposite of Lite */
4321 if (seen) obvious = TRUE;
4323 if (r_ptr->flagsr & RFR_RES_ALL)
4326 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4328 note = " is immune.";
4331 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4334 if (r_ptr->flagsr & RFR_RES_DARK)
4337 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4342 dam *= 2; dam /= (randint1(6)+6);
4343 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4352 if (r_ptr->flagsr & RFR_RES_ALL)
4357 /* Hurt by rock remover */
4358 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4361 if (seen) obvious = TRUE;
4363 /* Memorize the effects */
4364 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4366 /* Cute little message */
4368 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4369 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4371 note = " loses some skin!";
4372 note_dies = " dissolves!";
4377 /* Usually, ignore the effects */
4388 /* Teleport undead (Use "dam" as "power") */
4389 case GF_AWAY_UNDEAD:
4391 /* Only affect undead */
4392 if (r_ptr->flags3 & (RF3_UNDEAD))
4394 bool resists_tele = FALSE;
4396 if (r_ptr->flagsr & RFR_RES_TELE)
4398 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4400 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4402 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4404 note = " is unaffected!";
4407 resists_tele = TRUE;
4409 else if (r_ptr->level > randint1(100))
4411 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4413 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4418 resists_tele = TRUE;
4424 if (seen) obvious = TRUE;
4425 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4437 /* No "real" damage */
4443 /* Teleport evil (Use "dam" as "power") */
4446 /* Only affect evil */
4447 if (r_ptr->flags3 & (RF3_EVIL))
4449 bool resists_tele = FALSE;
4451 if (r_ptr->flagsr & RFR_RES_TELE)
4453 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4455 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4457 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4459 note = " is unaffected!";
4462 resists_tele = TRUE;
4464 else if (r_ptr->level > randint1(100))
4466 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4468 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4473 resists_tele = TRUE;
4479 if (seen) obvious = TRUE;
4480 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4492 /* No "real" damage */
4498 /* Teleport monster (Use "dam" as "power") */
4501 bool resists_tele = FALSE;
4502 if (r_ptr->flagsr & RFR_RES_TELE)
4504 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4506 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4508 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4510 note = " is unaffected!";
4513 resists_tele = TRUE;
4515 else if (r_ptr->level > randint1(100))
4517 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4519 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4524 resists_tele = TRUE;
4531 if (seen) obvious = TRUE;
4533 /* Prepare to teleport */
4537 /* No "real" damage */
4543 /* Turn undead (Use "dam" as "power") */
4544 case GF_TURN_UNDEAD:
4546 if (r_ptr->flagsr & RFR_RES_ALL)
4551 /* Only affect undead */
4552 if (r_ptr->flags3 & (RF3_UNDEAD))
4555 if (seen) obvious = TRUE;
4557 /* Learn about type */
4558 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4560 /* Apply some fear */
4561 do_fear = damroll(3, (dam / 2)) + 1;
4563 /* Attempt a saving throw */
4564 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4566 /* No obvious effect */
4568 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4570 note = " is unaffected!";
4585 /* No "real" damage */
4591 /* Turn evil (Use "dam" as "power") */
4594 if (r_ptr->flagsr & RFR_RES_ALL)
4599 /* Only affect evil */
4600 if (r_ptr->flags3 & (RF3_EVIL))
4603 if (seen) obvious = TRUE;
4605 /* Learn about type */
4606 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4608 /* Apply some fear */
4609 do_fear = damroll(3, (dam / 2)) + 1;
4611 /* Attempt a saving throw */
4612 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4614 /* No obvious effect */
4616 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4618 note = " is unaffected!";
4633 /* No "real" damage */
4639 /* Turn monster (Use "dam" as "power") */
4642 if (r_ptr->flagsr & RFR_RES_ALL)
4648 if (seen) obvious = TRUE;
4650 /* Apply some fear */
4651 do_fear = damroll(3, (dam / 2)) + 1;
4653 /* Attempt a saving throw */
4654 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4655 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4656 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4658 /* No obvious effect */
4660 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4662 note = " is unaffected!";
4669 /* No "real" damage */
4676 case GF_DISP_UNDEAD:
4678 if (r_ptr->flagsr & RFR_RES_ALL)
4684 /* Only affect undead */
4685 if (r_ptr->flags3 & (RF3_UNDEAD))
4688 if (seen) obvious = TRUE;
4690 /* Learn about type */
4691 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4695 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4696 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4698 note = " shudders.";
4699 note_dies = " dissolves!";
4720 if (r_ptr->flagsr & RFR_RES_ALL)
4726 /* Only affect evil */
4727 if (r_ptr->flags3 & (RF3_EVIL))
4730 if (seen) obvious = TRUE;
4732 /* Learn about type */
4733 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4737 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4738 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4740 note = " shudders.";
4741 note_dies = " dissolves!";
4761 if (r_ptr->flagsr & RFR_RES_ALL)
4767 /* Only affect good */
4768 if (r_ptr->flags3 & (RF3_GOOD))
4771 if (seen) obvious = TRUE;
4773 /* Learn about type */
4774 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4778 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4779 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4781 note = " shudders.";
4782 note_dies = " dissolves!";
4800 case GF_DISP_LIVING:
4802 if (r_ptr->flagsr & RFR_RES_ALL)
4808 /* Only affect non-undead */
4809 if (monster_living(r_ptr))
4812 if (seen) obvious = TRUE;
4816 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4817 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4819 note = " shudders.";
4820 note_dies = " dissolves!";
4841 if (r_ptr->flagsr & RFR_RES_ALL)
4847 /* Only affect demons */
4848 if (r_ptr->flags3 & (RF3_DEMON))
4851 if (seen) obvious = TRUE;
4853 /* Learn about type */
4854 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4858 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4859 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4861 note = " shudders.";
4862 note_dies = " dissolves!";
4879 /* Dispel monster */
4882 if (r_ptr->flagsr & RFR_RES_ALL)
4889 if (seen) obvious = TRUE;
4893 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4894 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4896 note = " shudders.";
4897 note_dies = " dissolves!";
4907 if (seen) obvious = TRUE;
4909 if (r_ptr->flagsr & RFR_RES_ALL)
4912 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4914 note = " is immune.";
4917 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4921 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4925 /* Heal the monster */
4926 if (caster_ptr->hp < caster_ptr->maxhp)
4929 caster_ptr->hp += 6 * dam;
4930 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
4932 /* Redraw (later) if needed */
4933 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4934 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4936 /* Special message */
4939 /* Get the monster name */
4940 monster_desc(killer, caster_ptr, 0);
4942 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", killer);
4944 msg_format("%^s appears healthier.", killer);
4953 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£", m_name);
4955 msg_format("You draw psychic energy from %s.", m_name);
4958 (void)hp_player(dam);
4964 if (see_s_msg) msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
4966 if (see_s_msg) msg_format("%s is unaffected.", m_name);
4976 if (seen) obvious = TRUE;
4979 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
4981 if (!who) msg_format("You gaze intently at %s.", m_name);
4984 if (r_ptr->flagsr & RFR_RES_ALL)
4987 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4989 note = " is immune.";
4992 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4996 /* Attempt a saving throw */
4997 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4998 (r_ptr->flags3 & RF3_NO_CONF) ||
4999 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5001 /* Memorize a flag */
5002 if (r_ptr->flags3 & (RF3_NO_CONF))
5004 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5007 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5009 note = "is unaffected!";
5013 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5015 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5017 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5019 note = " is immune!";
5023 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5025 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5027 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5036 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5037 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5039 note = " is blasted by psionic energy.";
5040 note_dies = " collapses, a mindless husk.";
5043 if (who > 0) do_conf = randint0(4) + 4;
5044 else do_conf = randint0(8) + 8;
5050 case GF_BRAIN_SMASH:
5052 if (seen) obvious = TRUE;
5055 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5057 if (!who) msg_format("You gaze intently at %s.", m_name);
5060 if (r_ptr->flagsr & RFR_RES_ALL)
5063 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5065 note = " is immune.";
5068 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5072 /* Attempt a saving throw */
5073 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5074 (r_ptr->flags3 & RF3_NO_CONF) ||
5075 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5077 /* Memorize a flag */
5078 if (r_ptr->flags3 & (RF3_NO_CONF))
5080 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5083 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5085 note = "is unaffected!";
5089 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5091 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5093 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5095 note = " is immune!";
5099 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5101 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5103 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5112 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5113 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5115 note = " is blasted by psionic energy.";
5116 note_dies = " collapses, a mindless husk.";
5121 do_conf = randint0(4) + 4;
5122 do_stun = randint0(4) + 4;
5126 do_conf = randint0(8) + 8;
5127 do_stun = randint0(8) + 8;
5129 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5130 if (c_ptr->m_idx == p_ptr->riding)
5131 p_ptr->update |= (PU_BONUS);
5139 if (seen) obvious = TRUE;
5142 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5144 if (!who) msg_format("You point at %s and curses.", m_name);
5147 if (r_ptr->flagsr & RFR_RES_ALL)
5150 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5152 note = " is immune.";
5155 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5159 /* Attempt a saving throw */
5160 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5163 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5165 note = "is unaffected!";
5175 if (seen) obvious = TRUE;
5178 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5180 if (!who) msg_format("You point at %s and curses horribly.", m_name);
5183 if (r_ptr->flagsr & RFR_RES_ALL)
5186 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5188 note = " is immune.";
5191 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5195 /* Attempt a saving throw */
5196 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5199 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5201 note = "is unaffected!";
5211 if (seen) obvious = TRUE;
5214 if (!who) msg_format("%s¤ò»Øº¹¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
5216 if (!who) msg_format("You point at %s, incanting terribly!", m_name);
5219 if (r_ptr->flagsr & RFR_RES_ALL)
5222 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5224 note = " is immune.";
5227 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5231 /* Attempt a saving throw */
5232 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5235 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5237 note = "is unaffected!";
5247 if (seen) obvious = TRUE;
5250 if (!who) msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
5252 if (!who) msg_format("You point at %s, screaming the word, 'DIE!'.", m_name);
5255 if (r_ptr->flagsr & RFR_RES_ALL)
5258 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5260 note = " is immune.";
5263 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5267 /* Attempt a saving throw */
5268 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
5271 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5273 note = "is unaffected!";
5283 if (seen) obvious = TRUE;
5285 if (r_ptr->flagsr & RFR_RES_ALL)
5288 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5290 note = " is immune.";
5293 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5297 if (r_ptr->flags1 & RF1_UNIQUE)
5300 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5302 note = "is unaffected!";
5308 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
5309 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
5311 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5313 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5318 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5328 /* Capture monster */
5332 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5333 (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)
5336 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5338 msg_format("%^s is unaffected.", m_name);
5344 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5345 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5346 nokori_hp = m_ptr->maxhp * 3 / 10;
5348 nokori_hp = m_ptr->maxhp * 3 / 20;
5350 if (m_ptr->hp >= nokori_hp)
5353 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5355 msg_format("You need to weaken %s more.", m_name);
5359 else if (m_ptr->hp < randint0(nokori_hp))
5361 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5363 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5365 msg_format("You capture %^s!", m_name);
5367 cap_mon = m_list[c_ptr->m_idx].r_idx;
5368 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5369 cap_hp = m_list[c_ptr->m_idx].hp;
5370 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5371 if (m_list[c_ptr->m_idx].nickname)
5372 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5375 if (c_ptr->m_idx == p_ptr->riding)
5377 if (rakuba(-1, FALSE))
5380 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5382 msg_format("You have fallen from %s.", m_name);
5387 delete_monster_idx(c_ptr->m_idx);
5394 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5396 msg_format("You failed to capture %s.", m_name);
5403 /* Attack (Use "dam" as attack type) */
5406 /* Return this monster's death */
5407 return py_attack(y, x, dam);
5410 /* Sleep (Use "dam" as "power") */
5416 if (seen) obvious = TRUE;
5418 if (r_ptr->flagsr & RFR_RES_ALL)
5421 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5423 note = " is immune.";
5426 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5429 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5432 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5434 note = " is immune!";
5438 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5444 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5446 note = " is immune!";
5453 if (one_in_(5)) effect = 1;
5454 else if (one_in_(4)) effect = 2;
5455 else if (one_in_(3)) effect = 3;
5460 /* Powerful monsters can resist */
5461 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5462 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5465 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5467 note = " is unaffected!";
5473 /* Normal monsters slow down */
5479 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5481 note = " starts moving slower.";
5484 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5486 if (c_ptr->m_idx == p_ptr->riding)
5487 p_ptr->update |= (PU_BONUS);
5491 else if (effect == 2)
5493 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5495 /* Attempt a saving throw */
5496 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5497 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5502 /* No obvious effect */
5504 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5506 note = " is unaffected!";
5513 else if (effect == 3)
5515 /* Attempt a saving throw */
5516 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5517 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5518 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5520 /* Memorize a flag */
5521 if (r_ptr->flags3 & RF3_NO_SLEEP)
5523 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5526 /* No obvious effect */
5528 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5530 note = " is unaffected!";
5537 /* Go to sleep (much) later */
5539 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5541 note = " falls asleep!";
5551 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5553 note = " is immune!";
5557 /* No "real" damage */
5566 if (seen) obvious = TRUE;
5568 if (r_ptr->flagsr & RFR_RES_ALL)
5571 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5573 note = " is immune.";
5576 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5580 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)
5587 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG2_NOGENO))
5594 delete_monster_idx(c_ptr->m_idx);
5596 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5598 msg_format("%^s disappered!",m_name);
5602 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5604 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5608 chg_virtue(V_VITALITY, -1);
5613 p_ptr->redraw |= (PR_HP);
5616 p_ptr->window |= (PW_PLAYER);
5623 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5625 note = "is unaffected!";
5628 if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
5636 if (!who) msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£", m_name);
5638 if (!who) msg_format("You take a photograph of %s.", m_name);
5641 if (r_ptr->flags3 & (RF3_HURT_LITE))
5643 /* Obvious effect */
5644 if (seen) obvious = TRUE;
5646 /* Memorize the effects */
5647 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5649 /* Special effect */
5651 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5652 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5654 note = " cringes from the light!";
5655 note_dies = " shrivels away in the light!";
5659 /* Normally no damage */
5666 photo = m_ptr->r_idx;
5673 case GF_BLOOD_CURSE:
5675 if (seen) obvious = TRUE;
5677 if (r_ptr->flagsr & RFR_RES_ALL)
5680 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5682 note = " is immune.";
5685 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5693 bool success = FALSE;
5694 if (seen) obvious = TRUE;
5696 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5698 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5699 if (dam < 1) dam = 1;
5701 /* No need to tame your pet */
5705 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5707 note = " starts moving faster.";
5710 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5714 /* Attempt a saving throw */
5715 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5716 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5717 (m_ptr->mflag2 & MFLAG2_NOPET) ||
5718 (p_ptr->cursed & TRC_AGGRAVATE) ||
5719 ((r_ptr->level+10) > randint1(dam)))
5722 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5727 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5729 note = " is tamed!";
5733 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5735 /* Learn about type */
5736 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5743 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5745 do_fear = randint1(90)+10;
5747 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5750 /* No "real" damage */
5757 if (seen) obvious = TRUE;
5759 if (r_ptr->flagsr & RFR_RES_ALL)
5762 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5764 note = " is immune.";
5767 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5771 /* Attempt a saving throw */
5772 if (randint0(100 + dam) < (r_ptr->level + 50))
5776 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5778 note = "is unaffected!";
5799 /* Absolutely no effect */
5800 if (skipped) return (FALSE);
5802 /* "Unique" monsters cannot be polymorphed */
5803 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5805 /* Quest monsters cannot be polymorphed */
5806 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5808 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5810 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5811 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
5813 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5818 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5819 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5822 /* Modify the damage */
5824 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5826 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤¡£";
5828 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5831 /* Check for death */
5832 if (dam > m_ptr->hp)
5834 /* Extract method of death */
5839 /* Sound and Impact resisters never stun */
5841 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5842 !(r_ptr->flags3 & RF3_NO_STUN))
5845 if (seen) obvious = TRUE;
5851 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5853 note = " is more dazed.";
5856 tmp = m_ptr->stunned + (do_stun / 2);
5861 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5863 note = " is dazed.";
5870 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5876 /* Confusion and Chaos resisters (and sleepers) never confuse */
5878 !(r_ptr->flags3 & RF3_NO_CONF) &&
5879 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
5882 if (seen) obvious = TRUE;
5884 /* Already partially confused */
5885 if (m_ptr->confused)
5888 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5890 note = " looks more confused.";
5893 tmp = m_ptr->confused + (do_conf / 2);
5896 /* Was not confused */
5900 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
5902 note = " looks confused.";
5908 /* Apply confusion */
5909 m_ptr->confused = (tmp < 200) ? tmp : 200;
5918 if (seen) obvious = TRUE;
5920 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
5925 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
5927 note = " seems weakened.";
5929 m_ptr->maxhp -= do_time;
5930 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
5935 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5936 if (do_poly && (randint1(90) > r_ptr->level))
5938 if (polymorph_monster(y, x))
5941 if (seen) obvious = TRUE;
5943 /* Monster polymorphs */
5945 note = "¤¬ÊѿȤ·¤¿¡ª";
5950 /* Turn off the damage */
5953 /* Hack -- Get new monster */
5954 m_ptr = &m_list[c_ptr->m_idx];
5956 /* Hack -- Get new race */
5957 r_ptr = &r_info[m_ptr->r_idx];
5963 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5965 note = " is unaffected!";
5970 /* Handle "teleport" */
5974 if (seen) obvious = TRUE;
5978 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5980 note = " disappears!";
5983 if (!who) chg_virtue(V_VALOUR, -1);
5986 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who), TRUE);
5988 /* Hack -- get new location */
5992 /* Hack -- get new grid */
5993 c_ptr = &cave[y][x];
6000 tmp = m_ptr->monfear + do_fear;
6003 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6010 if (typ == GF_DRAIN_MANA)
6012 /* Drain mana does nothing */
6015 /* If another monster did the damage, hurt the monster by hand */
6018 /* Redraw (later) if needed */
6019 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6020 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6022 /* Wake the monster up */
6025 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
6027 /* Hurt the monster */
6035 if (is_pet(m_ptr) && !(m_ptr->ml))
6038 /* Give detailed messages if destroyed */
6041 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
6044 msg_format("%^s%s", m_name, note);
6052 monster_gain_exp(who, m_ptr->r_idx);
6054 /* Generate treasure, etc */
6055 monster_death(c_ptr->m_idx, FALSE);
6057 /* Delete the monster */
6058 delete_monster_idx(c_ptr->m_idx);
6063 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6065 msg_print("You feel sad for a moment.");
6071 /* Damaged monster */
6074 /* Give detailed messages if visible or destroyed */
6075 if (note && seen_msg) msg_format("%^s%s", m_name, note);
6077 /* Hack -- Pain message */
6080 message_pain(c_ptr->m_idx, dam);
6087 /* Hack -- handle sleep */
6088 if (do_sleep) m_ptr->csleep = do_sleep;
6092 else if (heal_leper)
6095 if (seen_msg) msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6097 if (seen_msg) msg_print("The Mangy looking leper is healed!");
6100 delete_monster_idx(c_ptr->m_idx);
6103 /* If the player did it, give him experience, check fear */
6108 /* Hurt the monster, check for fear and death */
6109 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6114 /* Damaged monster */
6117 /* HACK - anger the monster before showing the sleep message */
6118 if (do_sleep) anger_monster(m_ptr);
6120 /* Give detailed messages if visible or destroyed */
6121 if (note && seen_msg)
6123 msg_format("%s%s", m_name, note);
6125 msg_format("%^s%s", m_name, note);
6129 /* Hack -- Pain message */
6130 else if (known && (dam || !do_fear))
6132 message_pain(c_ptr->m_idx, dam);
6135 /* Anger monsters */
6136 if (((dam > 0) || get_angry) && !do_sleep)
6137 anger_monster(m_ptr);
6140 if ((fear || do_fear) && seen)
6147 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6149 msg_format("%^s flees in terror!", m_name);
6153 /* Hack -- handle sleep */
6154 if (do_sleep) m_ptr->csleep = do_sleep;
6158 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6160 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6164 switch (randint1(28))
6170 msg_print("ÃÏÌ̤¬Íɤ줿...");
6172 msg_print("The ground trembles...");
6175 earthquake(ty, tx, 4 + randint0(4));
6176 if (!one_in_(6)) break;
6178 case 3: case 4: case 5: case 6:
6181 int dam = damroll(10, 10);
6183 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6185 msg_print("A portal opens to a plane of raw mana!");
6188 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6189 if (!one_in_(6)) break;
6195 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6197 msg_print("Space warps about you!");
6200 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE, TRUE);
6201 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6202 if (!one_in_(6)) break;
6204 case 9: case 10: case 11:
6206 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6208 msg_print("You feel a surge of energy!");
6211 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6212 if (!one_in_(6)) break;
6213 case 12: case 13: case 14: case 15: case 16:
6214 aggravate_monsters(0);
6215 if (!one_in_(6)) break;
6217 count += activate_hi_summon(ty, tx, TRUE);
6218 if (!one_in_(6)) break;
6219 case 19: case 20: case 21: case 22:
6221 bool pet = !one_in_(3);
6222 u32b mode = PM_ALLOW_GROUP;
6224 if (pet) mode |= PM_FORCE_PET;
6225 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6227 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6228 if (!one_in_(6)) break;
6230 case 23: case 24: case 25:
6231 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6233 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6235 msg_print("You feel your life draining away...");
6238 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6239 else lose_exp(p_ptr->exp / 16);
6240 if (!one_in_(6)) break;
6241 case 26: case 27: case 28:
6250 (void)do_dec_stat(i);
6259 (void)do_dec_stat(randint0(6));
6268 if (p_ptr->inside_battle)
6270 p_ptr->health_who = c_ptr->m_idx;
6271 p_ptr->redraw |= (PR_HEALTH);
6275 /* XXX XXX XXX Verify this code */
6277 /* Update the monster */
6278 update_mon(c_ptr->m_idx, FALSE);
6280 /* Redraw the monster grid */
6284 /* Update monster recall window */
6285 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6288 p_ptr->window |= (PW_MONSTER);
6291 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6295 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6297 set_target(m_ptr, monster_target_y, monster_target_x);
6300 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6302 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
6306 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6308 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6309 rakubadam_m = (dam > 200) ? 200 : dam;
6318 /* Get local object */
6321 /* Prepare to make a Blade of Chaos */
6322 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6324 q_ptr->pval = photo;
6326 /* Mark the item as fully known */
6327 q_ptr->ident |= (IDENT_MENTAL);
6329 /* Drop it in the dungeon */
6330 (void)drop_near(q_ptr, -1, py, px);
6338 /* Return "Anything seen?" */
6344 * Helper function for "project()" below.
6346 * Handle a beam/bolt/ball causing damage to the player.
6348 * This routine takes a "source monster" (by index), a "distance", a default
6349 * "damage", and a "damage type". See "project_m()" above.
6351 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6352 * is reduced (see "project_m()" above). This can happen if a monster breathes
6353 * at the player and hits a wall instead.
6355 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6356 * to know if this is actually a ball or a bolt spell
6359 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6360 * we just assume that the effects were obvious, for historical reasons.
6362 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6367 /* Hack -- assume obvious */
6368 bool obvious = TRUE;
6370 /* Player blind-ness */
6371 bool blind = (p_ptr->blind ? TRUE : FALSE);
6373 /* Player needs a "description" (he is blind) */
6376 /* Source monster */
6377 monster_type *m_ptr = NULL;
6379 /* Monster name (for attacks) */
6382 /* Monster name (for damage) */
6385 /* Hack -- messages */
6391 /* Player is not here */
6392 if (!player_bold(y, x)) return (FALSE);
6394 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6400 /* Player cannot hurt himself */
6401 if (!who) return (FALSE);
6402 if (who == p_ptr->riding) return (FALSE);
6404 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6407 int max_attempts = 10;
6410 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6411 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6412 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6414 if (blind) msg_print("Something bounces!");
6415 else msg_print("The attack bounces!");
6419 /* Choose 'new' target */
6422 t_y = m_list[who].fy - 1 + randint1(3);
6423 t_x = m_list[who].fx - 1 + randint1(3);
6426 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
6428 if (max_attempts < 1)
6430 t_y = m_list[who].fy;
6431 t_x = m_list[who].fx;
6434 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6441 /* Limit maximum damage */
6442 if (dam > 1600) dam = 1600;
6444 /* Reduce damage by distance */
6445 dam = (dam + r) / (r + 1);
6448 /* If the player is blind, be more descriptive */
6449 if (blind) fuzzy = TRUE;
6454 /* Get the source monster */
6455 m_ptr = &m_list[who];
6456 /* Extract the monster level */
6457 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6459 /* Get the monster name */
6460 monster_desc(m_name, m_ptr, 0);
6462 /* Get the monster's real name (gotten before polymorph!) */
6463 strcpy(killer, who_name);
6468 strcpy(killer, "æ«");
6470 strcpy(killer, "a trap");
6474 /* Analyze the damage */
6477 /* Standard damage -- hurts inventory too */
6481 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6483 if (fuzzy) msg_print("You are hit by acid!");
6486 get_damage = acid_dam(dam, killer, monspell);
6490 /* Standard damage -- hurts inventory too */
6494 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6496 if (fuzzy) msg_print("You are hit by fire!");
6499 get_damage = fire_dam(dam, killer, monspell);
6503 /* Standard damage -- hurts inventory too */
6507 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6509 if (fuzzy) msg_print("You are hit by cold!");
6512 get_damage = cold_dam(dam, killer, monspell);
6516 /* Standard damage -- hurts inventory too */
6520 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6522 if (fuzzy) msg_print("You are hit by lightning!");
6525 get_damage = elec_dam(dam, killer, monspell);
6529 /* Standard damage -- also poisons player */
6532 bool double_resist = IS_OPPOSE_POIS();
6534 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6536 if (fuzzy) msg_print("You are hit by poison!");
6539 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6540 if (double_resist) dam = (dam + 2) / 3;
6542 if ((!(double_resist || p_ptr->resist_pois)) &&
6543 one_in_(HURT_CHANCE))
6548 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6550 if (!(double_resist || p_ptr->resist_pois))
6552 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6557 /* Standard damage -- also poisons / mutates player */
6560 bool double_resist = IS_OPPOSE_POIS();
6562 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6564 if (fuzzy) msg_print("You are hit by radiation!");
6567 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6568 if (double_resist) dam = (2 * dam + 2) / 5;
6569 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6570 if (!(double_resist || p_ptr->resist_pois))
6572 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6574 if (one_in_(5)) /* 6 */
6577 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6579 msg_print("You undergo a freakish metamorphosis!");
6582 if (one_in_(4)) /* 4 */
6590 inven_damage(set_acid_destroy, 2);
6596 /* Standard damage */
6600 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6602 if (fuzzy) msg_print("You are hit by something!");
6605 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6609 /* Holy Orb -- Player only takes partial damage */
6613 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6615 if (fuzzy) msg_print("You are hit by something!");
6618 if (p_ptr->align > 10)
6620 else if (p_ptr->align < -10)
6622 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6629 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6631 if (fuzzy) msg_print("You are hit by something!");
6634 if (p_ptr->align > 10)
6636 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6640 /* Arrow -- XXX no dodging */
6644 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6646 if (fuzzy) msg_print("You are hit by something sharp!");
6649 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6652 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6654 msg_print("You cut down the arrow!");
6658 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6662 /* Plasma -- XXX No resist */
6666 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6668 if (fuzzy) msg_print("You are hit by something *HOT*!");
6671 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6673 if (!p_ptr->resist_sound)
6675 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6676 (void)set_stun(p_ptr->stun + k);
6679 if (!(p_ptr->resist_fire ||
6681 p_ptr->immune_fire))
6683 inven_damage(set_acid_destroy, 3);
6689 /* Nether -- drain experience */
6693 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6695 if (fuzzy) msg_print("You are hit by nether forces!");
6699 if (p_ptr->resist_neth)
6701 if (!prace_is_(RACE_SPECTRE))
6702 dam *= 6; dam /= (randint1(4) + 7);
6704 else drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
6706 if (prace_is_(RACE_SPECTRE))
6709 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6711 msg_print("You feel invigorated!");
6715 learn_spell(monspell);
6719 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6725 /* Water -- stun/confuse */
6729 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6731 if (fuzzy) msg_print("You are hit by something wet!");
6734 if (!p_ptr->resist_sound)
6736 set_stun(p_ptr->stun + randint1(40));
6738 if (!p_ptr->resist_conf)
6740 set_confused(p_ptr->confused + randint1(5) + 5);
6745 inven_damage(set_cold_destroy, 3);
6748 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6752 /* Chaos -- many effects */
6756 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6758 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6761 if (p_ptr->resist_chaos)
6763 dam *= 6; dam /= (randint1(4) + 7);
6765 if (!p_ptr->resist_conf)
6767 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6769 if (!p_ptr->resist_chaos)
6771 (void)set_image(p_ptr->image + randint1(10));
6775 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6777 msg_print("Your body is twisted by chaos!");
6780 (void)gain_random_mutation(0);
6783 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6785 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
6787 if (!p_ptr->resist_chaos || one_in_(9))
6789 inven_damage(set_elec_destroy, 2);
6790 inven_damage(set_fire_destroy, 2);
6792 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6796 /* Shards -- mostly cutting */
6800 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6802 if (fuzzy) msg_print("You are hit by something sharp!");
6805 if (p_ptr->resist_shard)
6807 dam *= 6; dam /= (randint1(4) + 7);
6811 (void)set_cut(p_ptr->cut + dam);
6814 if (!p_ptr->resist_shard || one_in_(13))
6816 inven_damage(set_cold_destroy, 2);
6819 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6823 /* Sound -- mostly stunning */
6827 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6829 if (fuzzy) msg_print("You are hit by a loud noise!");
6832 if (p_ptr->resist_sound)
6834 dam *= 5; dam /= (randint1(4) + 7);
6838 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6839 (void)set_stun(p_ptr->stun + k);
6842 if (!p_ptr->resist_sound || one_in_(13))
6844 inven_damage(set_cold_destroy, 2);
6847 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6851 /* Pure confusion */
6855 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6857 if (fuzzy) msg_print("You are hit by something puzzling!");
6860 if (p_ptr->resist_conf)
6862 dam *= 5; dam /= (randint1(4) + 7);
6864 if (!p_ptr->resist_conf)
6866 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6868 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6872 /* Disenchantment -- see above */
6876 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6878 if (fuzzy) msg_print("You are hit by something static!");
6881 if (p_ptr->resist_disen)
6883 dam *= 6; dam /= (randint1(4) + 7);
6887 (void)apply_disenchant(0);
6889 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6893 /* Nexus -- see above */
6897 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6899 if (fuzzy) msg_print("You are hit by something strange!");
6902 if (p_ptr->resist_nexus)
6904 dam *= 6; dam /= (randint1(4) + 7);
6910 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6914 /* Force -- mostly stun */
6918 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6920 if (fuzzy) msg_print("You are hit by kinetic force!");
6923 if (!p_ptr->resist_sound)
6925 (void)set_stun(p_ptr->stun + randint1(20));
6927 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6932 /* Rocket -- stun, cut */
6936 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
6938 if (fuzzy) msg_print("There is an explosion!");
6941 if (!p_ptr->resist_sound)
6943 (void)set_stun(p_ptr->stun + randint1(20));
6945 if (p_ptr->resist_shard)
6951 (void)set_cut(p_ptr-> cut + ( dam / 2));
6954 if ((!p_ptr->resist_shard) || one_in_(12))
6956 inven_damage(set_cold_destroy, 3);
6959 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6963 /* Inertia -- slowness */
6967 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6969 if (fuzzy) msg_print("You are hit by something slow!");
6972 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
6973 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6977 /* Lite -- blinding */
6981 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6983 if (fuzzy) msg_print("You are hit by something!");
6986 if (p_ptr->resist_lite)
6988 dam *= 4; dam /= (randint1(4) + 7);
6990 else if (!blind && !p_ptr->resist_blind)
6992 (void)set_blind(p_ptr->blind + randint1(5) + 2);
6994 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
6997 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
6999 msg_print("The light scorches your flesh!");
7004 else if (prace_is_(RACE_S_FAIRY))
7008 if (p_ptr->wraith_form) dam *= 2;
7009 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7011 if (p_ptr->wraith_form)
7013 p_ptr->wraith_form = 0;
7015 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7017 msg_print("The light forces you out of your incorporeal shadow form.");
7020 p_ptr->redraw |= PR_MAP;
7021 /* Update monsters */
7022 p_ptr->update |= (PU_MONSTERS);
7024 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7026 /* Redraw status bar */
7027 p_ptr->redraw |= (PR_STATUS);
7034 /* Dark -- blinding */
7038 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7040 if (fuzzy) msg_print("You are hit by something!");
7043 if (p_ptr->resist_dark)
7045 dam *= 4; dam /= (randint1(4) + 7);
7047 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7049 else if (!blind && !p_ptr->resist_blind)
7051 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7053 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7057 /* Time -- bolt fewer effects XXX */
7061 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7063 if (fuzzy) msg_print("You are hit by a blast from the past!");
7066 if (p_ptr->resist_time)
7069 dam /= (randint1(4) + 7);
7071 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7073 msg_print("You feel as if time is passing you by.");
7079 switch (randint1(10))
7081 case 1: case 2: case 3: case 4: case 5:
7083 if (p_ptr->prace == RACE_ANDROID) break;
7085 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7087 msg_print("You feel life has clocked back.");
7090 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7094 case 6: case 7: case 8: case 9:
7096 switch (randint1(6))
7099 case 1: k = A_STR; act = "¶¯¤¯"; break;
7100 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7101 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7102 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7103 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7104 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7106 case 1: k = A_STR; act = "strong"; break;
7107 case 2: k = A_INT; act = "bright"; break;
7108 case 3: k = A_WIS; act = "wise"; break;
7109 case 4: k = A_DEX; act = "agile"; break;
7110 case 5: k = A_CON; act = "hale"; break;
7111 case 6: k = A_CHR; act = "beautiful"; break;
7117 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7119 msg_format("You're not as %s as you used to be...", act);
7123 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7124 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7125 p_ptr->update |= (PU_BONUS);
7132 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7134 msg_print("You're not as powerful as you used to be...");
7138 for (k = 0; k < 6; k++)
7140 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7141 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7143 p_ptr->update |= (PU_BONUS);
7149 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7153 /* Gravity -- stun plus slowness plus teleport */
7157 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7158 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7160 if (fuzzy) msg_print("You are hit by something heavy!");
7161 msg_print("Gravity warps around you.");
7164 teleport_player(5, TRUE);
7165 if (!p_ptr->levitation)
7166 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7167 if (!(p_ptr->resist_sound || p_ptr->levitation))
7169 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7170 (void)set_stun(p_ptr->stun + k);
7172 if (p_ptr->levitation)
7174 dam = (dam * 2) / 3;
7177 if (!p_ptr->levitation || one_in_(13))
7179 inven_damage(set_cold_destroy, 2);
7182 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7186 /* Standard damage */
7187 case GF_DISINTEGRATE:
7190 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7192 if (fuzzy) msg_print("You are hit by pure energy!");
7195 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7202 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7204 if (fuzzy) msg_print("You are hit by something invigorating!");
7207 (void)hp_player(dam);
7215 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7217 if (fuzzy) msg_print("You are hit by something!");
7220 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7228 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7230 if (fuzzy) msg_print("You are hit by something slow!");
7233 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7239 if (p_ptr->free_act) break;
7241 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7243 if (fuzzy) msg_print("You fall asleep!");
7247 if (ironman_nightmare)
7250 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7252 msg_print("A horrible vision enters your mind.");
7256 /* Pick a nightmare */
7257 get_mon_num_prep(get_nightmare, NULL);
7259 /* Have some nightmares */
7260 have_nightmare(get_mon_num(MAX_DEPTH));
7262 /* Remove the monster restriction */
7263 get_mon_num_prep(NULL, NULL);
7266 set_paralyzed(p_ptr->paralyzed + dam);
7277 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7279 if (fuzzy) msg_print("You are hit by an aura of magic!");
7282 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7290 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7292 if (fuzzy) msg_print("You are hit by an energy!");
7295 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7303 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7305 if (fuzzy) msg_print("Something falls from the sky on you!");
7308 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7309 if (!p_ptr->resist_shard || one_in_(13))
7311 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7312 inven_damage(set_cold_destroy, 2);
7318 /* Ice -- cold plus stun plus cuts */
7322 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7324 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7327 cold_dam(dam, killer, monspell);
7328 if (!p_ptr->resist_shard)
7330 (void)set_cut(p_ptr->cut + damroll(5, 8));
7332 if (!p_ptr->resist_sound)
7334 (void)set_stun(p_ptr->stun + randint1(15));
7337 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
7339 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7349 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7351 if (fuzzy) msg_print("You are hit by something extremely cold!");
7355 if (p_ptr->mimic_form)
7357 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7358 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7363 switch (p_ptr->prace)
7365 /* Some races are immune */
7379 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7395 if (who > 0) msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
7396 else msg_print("Àº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
7398 if (who > 0) msg_format("%^s draws psychic energy from you!", m_name);
7399 else msg_print("Your psychic energy is drawn!");
7403 if (dam >= p_ptr->csp)
7407 p_ptr->csp_frac = 0;
7416 learn_spell(monspell);
7419 p_ptr->redraw |= (PR_MANA);
7422 p_ptr->window |= (PW_PLAYER);
7423 p_ptr->window |= (PW_SPELL);
7427 /* Heal the monster */
7428 if (m_ptr->hp < m_ptr->maxhp)
7431 m_ptr->hp += (6 * dam);
7432 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
7434 /* Redraw (later) if needed */
7435 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
7436 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
7438 /* Special message */
7442 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
7444 msg_format("%^s appears healthier.", m_name);
7458 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7461 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7463 msg_print("You resist the effects!");
7465 learn_spell(monspell);
7470 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7472 msg_print("Your mind is blasted by psyonic energy.");
7475 if (!p_ptr->resist_conf)
7477 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7480 if (!p_ptr->resist_chaos && one_in_(3))
7482 (void)set_image(p_ptr->image + randint0(250) + 150);
7489 p_ptr->csp_frac = 0;
7491 p_ptr->redraw |= PR_MANA;
7493 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7499 case GF_BRAIN_SMASH:
7501 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7504 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7506 msg_print("You resist the effects!");
7508 learn_spell(monspell);
7513 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7515 msg_print("Your mind is blasted by psionic energy.");
7522 p_ptr->csp_frac = 0;
7524 p_ptr->redraw |= PR_MANA;
7526 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7527 if (!p_ptr->resist_blind)
7529 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7531 if (!p_ptr->resist_conf)
7533 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7535 if (!p_ptr->free_act)
7537 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7539 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7541 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7542 (void)do_dec_stat(A_INT);
7543 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7544 (void)do_dec_stat(A_WIS);
7546 if (!p_ptr->resist_chaos)
7548 (void)set_image(p_ptr->image + randint0(250) + 150);
7557 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7560 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7562 msg_print("You resist the effects!");
7564 learn_spell(monspell);
7568 curse_equipment(15, 0);
7569 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7577 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7580 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7582 msg_print("You resist the effects!");
7584 learn_spell(monspell);
7588 curse_equipment(25, MIN(rlev/2-15, 5));
7589 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7597 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7600 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7602 msg_print("You resist the effects!");
7604 learn_spell(monspell);
7608 curse_equipment(33, MIN(rlev/2-15, 15));
7609 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7617 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7620 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7622 msg_print("You resist the effects!");
7624 learn_spell(monspell);
7628 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7629 (void)set_cut(p_ptr->cut + damroll(10, 10));
7637 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7640 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7642 msg_format("You resist the effects!");
7644 learn_spell(monspell);
7649 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7651 msg_print("You feel your life fade away!");
7654 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
7655 curse_equipment(40, 20);
7657 if (p_ptr->chp < 1) p_ptr->chp = 1;
7672 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7675 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7677 char m_name_self[80];
7680 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
7682 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7684 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7685 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7688 if (p_ptr->riding && dam > 0)
7690 rakubadam_p = (dam > 200) ? 200 : dam;
7698 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7704 /* Return "Anything seen?" */
7710 * Find the distance from (x, y) to a line.
7712 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7714 /* Vector from (x, y) to (x1, y1) */
7723 int pd = distance(y1, x1, y, x);
7724 int nd = distance(y1, x1, y2, x2);
7726 if (pd > nd) return distance(y, x, y2, x2);
7728 /* Component of P on N */
7729 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7731 /* Absolute value */
7732 return((nd >= 0) ? nd : 0 - nd);
7739 * Modified version of los() for calculation of disintegration balls.
7740 * Disintegration effects are stopped by permanent walls.
7742 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7762 /* Slope, or 1/Slope, of LOS */
7766 /* Extract the offset */
7770 /* Extract the absolute offset */
7775 /* Handle adjacent (or identical) grids */
7776 if ((ax < 2) && (ay < 2)) return (TRUE);
7779 /* Paranoia -- require "safe" origin */
7780 /* if (!in_bounds(y1, x1)) return (FALSE); */
7783 /* Directly South/North */
7786 /* South -- check for walls */
7789 for (ty = y1 + 1; ty < y2; ty++)
7791 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7795 /* North -- check for walls */
7798 for (ty = y1 - 1; ty > y2; ty--)
7800 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7808 /* Directly East/West */
7811 /* East -- check for walls */
7814 for (tx = x1 + 1; tx < x2; tx++)
7816 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7820 /* West -- check for walls */
7823 for (tx = x1 - 1; tx > x2; tx--)
7825 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7834 /* Extract some signs */
7835 sx = (dx < 0) ? -1 : 1;
7836 sy = (dy < 0) ? -1 : 1;
7839 /* Vertical "knights" */
7844 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7848 /* Horizontal "knights" */
7853 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7858 /* Calculate scale factor div 2 */
7861 /* Calculate scale factor */
7865 /* Travel horizontally */
7868 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7874 /* Consider the special case where slope == 1. */
7885 /* Note (below) the case (qy == f2), where */
7886 /* the LOS exactly meets the corner of a tile. */
7889 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7900 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7913 /* Travel vertically */
7916 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7932 /* Note (below) the case (qx == f2), where */
7933 /* the LOS exactly meets the corner of a tile. */
7936 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7947 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7968 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)
7973 int brev = rad * rad / dist;
7977 int mdis = distance(y1, x1, y2, x2) + rad;
7979 while (bdis <= mdis)
7983 if ((0 < dist) && (path_n < dist))
7985 int ny = GRID_Y(path_g[path_n]);
7986 int nx = GRID_X(path_g[path_n]);
7987 int nd = distance(ny, nx, y1, x1);
7989 /* Get next base point */
7998 /* Travel from center outward */
7999 for (cdis = 0; cdis <= brad; cdis++)
8001 /* Scan the maximal blast area of radius "cdis" */
8002 for (y = by - cdis; y <= by + cdis; y++)
8004 for (x = bx - cdis; x <= bx + cdis; x++)
8006 /* Ignore "illegal" locations */
8007 if (!in_bounds(y, x)) continue;
8009 /* Enforce a circular "ripple" */
8010 if (distance(y1, x1, y, x) != bdis) continue;
8012 /* Enforce an arc */
8013 if (distance(by, bx, y, x) != cdis) continue;
8019 /* Lights are stopped by opaque terrains */
8020 if (!los(by, bx, y, x)) continue;
8022 case GF_DISINTEGRATE:
8023 /* Disintegration are stopped only by perma-walls */
8024 if (!in_disintegration_range(by, bx, y, x)) continue;
8027 /* Ball explosions are stopped by walls */
8028 if (!projectable(by, bx, y, x)) continue;
8032 /* Save this grid */
8040 /* Encode some more "radius" info */
8041 gm[bdis + 1] = *pgrids;
8043 /* Increase the size */
8044 brad = rad * (path_n + brev) / (dist + brev);
8046 /* Find the next ripple */
8050 /* Store the effect size */
8056 * Generic "beam"/"bolt"/"ball" projection routine.
8059 * who: Index of "source" monster (zero for "player")
8060 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8061 * y,x: Target location (or location to travel "towards")
8062 * dam: Base damage roll to apply to affected monsters (or player)
8063 * typ: Type of damage to apply to monsters (and objects)
8064 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8067 * TRUE if any "effects" of the projection were observed, else FALSE
8069 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8070 * towards a given location (optionally passing over the heads of interposing
8071 * monsters), and have it do a given amount of damage to the monsters (and
8072 * optionally objects) within the given radius of the final location.
8074 * A "bolt" travels from source to target and affects only the target grid.
8075 * A "beam" travels from source to target, affecting all grids passed through.
8076 * A "ball" travels from source to the target, exploding at the target, and
8077 * affecting everything within the given radius of the target location.
8079 * Traditionally, a "bolt" does not affect anything on the ground, and does
8080 * not pass over the heads of interposing monsters, much like a traditional
8081 * missile, and will "stop" abruptly at the "target" even if no monster is
8082 * positioned there, while a "ball", on the other hand, passes over the heads
8083 * of monsters between the source and target, and affects everything except
8084 * the source monster which lies within the final radius, while a "beam"
8085 * affects every monster between the source and target, except for the casting
8086 * monster (or player), and rarely affects things on the ground.
8088 * Two special flags allow us to use this function in special ways, the
8089 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8090 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8091 * actually projecting from the source monster (or player).
8093 * The player will only get "experience" for monsters killed by himself
8094 * Unique monsters can only be destroyed by attacks from the player
8096 * Only 256 grids can be affected per projection, limiting the effective
8097 * "radius" of standard ball attacks to nine units (diameter nineteen).
8099 * One can project in a given "direction" by combining PROJECT_THRU with small
8100 * offsets to the initial location (see "line_spell()"), or by calculating
8101 * "virtual targets" far away from the player.
8103 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8104 * continuing until it actually hits somethings (useful for "stone to mud").
8106 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8108 * Balls must explode BEFORE hitting walls, or they would affect monsters
8109 * on both sides of a wall. Some bug reports indicate that this is still
8110 * happening in 2.7.8 for Windows, though it appears to be impossible.
8112 * We "pre-calculate" the blast area only in part for efficiency.
8113 * More importantly, this lets us do "explosions" from the "inside" out.
8114 * This results in a more logical distribution of "blast" treasure.
8115 * It also produces a better (in my opinion) animation of the explosion.
8116 * It could be (but is not) used to have the treasure dropped by monsters
8117 * in the middle of the explosion fall "outwards", and then be damaged by
8118 * the blast as it spreads outwards towards the treasure drop location.
8120 * Walls and doors are included in the blast area, so that they can be
8121 * "burned" or "melted" in later versions.
8123 * This algorithm is intended to maximize simplicity, not necessarily
8124 * efficiency, since this function is not a bottleneck in the code.
8126 * We apply the blast effect from ground zero outwards, in several passes,
8127 * first affecting features, then objects, then monsters, then the player.
8128 * This allows walls to be removed before checking the object or monster
8129 * in the wall, and protects objects which are dropped by monsters killed
8130 * in the blast, and allows the player to see all affects before he is
8131 * killed or teleported away. The semantics of this method are open to
8132 * various interpretations, but they seem to work well in practice.
8134 * We process the blast area from ground-zero outwards to allow for better
8135 * distribution of treasure dropped by monsters, and because it provides a
8136 * pleasing visual effect at low cost.
8138 * Note that the damage done by "ball" explosions decreases with distance.
8139 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8141 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8142 * the target, and then the damage "flows" along this beam of destruction.
8143 * The damage at every grid is the same as at the "center" of a "ball"
8144 * explosion, since the "beam" grids are treated as if they ARE at the
8145 * center of a "ball" explosion.
8147 * Currently, specifying "beam" plus "ball" means that locations which are
8148 * covered by the initial "beam", and also covered by the final "ball", except
8149 * for the final grid (the epicenter of the ball), will be "hit twice", once
8150 * by the initial beam, and once by the exploding ball. For the grid right
8151 * next to the epicenter, this results in 150% damage being done. The center
8152 * does not have this problem, for the same reason the final grid in a "beam"
8153 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8154 * grids which are covered by the "ball" will NOT work, as then they will
8155 * receive LESS damage than they should. Do not combine "beam" with "ball".
8157 * The array "gy[],gx[]" with current size "grids" is used to hold the
8158 * collected locations of all grids in the "blast area" plus "beam path".
8160 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8161 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8162 * first blast grid (see above) with radius "N" from the blast center. Note
8163 * that only the first gm[1] grids in the blast area thus take full damage.
8164 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8165 * number of blast grids.
8167 * Note that once the projection is complete, (y2,x2) holds the final location
8168 * of bolts/beams, and the "epicenter" of balls.
8170 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8171 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8172 * implementation of the "distance" function. Also, a bolt can be properly
8173 * viewed as a "ball" with a "rad" of "zero".
8175 * Note that if no "target" is reached before the beam/bolt/ball travels the
8176 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8177 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8179 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8180 * to move from point A to point B, even if the player cannot see part of the
8181 * projection path. Note that in general, the player will *always* see part
8182 * of the path, since it either starts at the player or ends on the player.
8184 * Hack -- we assume that every "projection" is "self-illuminating".
8186 * Hack -- when only a single monster is affected, we automatically track
8187 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8189 * Note that all projections now "explode" at their final destination, even
8190 * if they were being projected at a more distant destination. This means
8191 * that "ball" spells will *always* explode.
8193 * Note that we must call "handle_stuff()" after affecting terrain features
8194 * in the blast radius, in case the "illumination" of the grid was changed,
8195 * and "update_view()" and "update_monsters()" need to be called.
8197 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8207 int y_saver, x_saver; /* For reflecting monsters */
8209 int msec = delay_factor * delay_factor * delay_factor;
8211 /* Assume the player sees nothing */
8212 bool notice = FALSE;
8214 /* Assume the player has seen nothing */
8215 bool visual = FALSE;
8217 /* Assume the player has seen no blast grids */
8220 /* Assume to be a normal ball spell */
8221 bool breath = FALSE;
8223 /* Is the player blind? */
8224 bool blind = (p_ptr->blind ? TRUE : FALSE);
8226 bool old_hide = FALSE;
8228 /* Number of grids in the "path" */
8231 /* Actual grids in the "path" */
8234 /* Number of grids in the "blast area" (including the "beam" path) */
8237 /* Coordinates of the affected grids */
8238 byte gx[1024], gy[1024];
8240 /* Encoded "radius" info (see above) */
8243 /* Actual radius encoded in gm[] */
8248 /* Attacker's name (prepared before polymorph)*/
8251 /* Initialize by null string */
8257 /* Default target of monsterspell is player */
8258 monster_target_y=py;
8259 monster_target_x=px;
8261 /* Hack -- Jump to target */
8262 if (flg & (PROJECT_JUMP))
8267 /* Clear the flag */
8268 flg &= ~(PROJECT_JUMP);
8273 /* Start at player */
8280 /* Start at monster */
8283 x1 = m_list[who].fx;
8284 y1 = m_list[who].fy;
8285 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8298 /* Default "destination" */
8303 /* Hack -- verify stuff */
8304 if (flg & (PROJECT_THRU))
8306 if ((x1 == x2) && (y1 == y2))
8308 flg &= ~(PROJECT_THRU);
8312 /* Handle a breath attack */
8317 if (flg & PROJECT_HIDE) old_hide = TRUE;
8318 flg |= PROJECT_HIDE;
8322 /* Hack -- Assume there will be no blast (max radius 32) */
8323 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8331 /* Collect beam grids */
8332 if (flg & (PROJECT_BEAM))
8343 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
8345 case GF_DISINTEGRATE:
8346 flg |= (PROJECT_GRID);
8347 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
8351 /* Calculate the projection path */
8353 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8355 /* Hack -- Handle stuff */
8358 /* Giga-Hack SEEKER & SUPER_RAY */
8360 if( typ == GF_SEEKER )
8370 for (i = 0; i < path_n; ++i)
8375 int ny = GRID_Y(path_g[i]);
8376 int nx = GRID_X(path_g[i]);
8387 /* Only do visuals if requested */
8388 if (!blind && !(flg & (PROJECT_HIDE)))
8390 /* Only do visuals if the player can "see" the bolt */
8391 if (panel_contains(y, x) && player_has_los_bold(y, x))
8398 /* Obtain the bolt pict */
8399 p = bolt_pict(oy, ox, y, x, typ);
8401 /* Extract attr/char */
8405 /* Visual effects */
8406 print_rel(c, a, y, x);
8407 move_cursor_relative(y, x);
8408 /*if (fresh_before)*/ Term_fresh();
8409 Term_xtra(TERM_XTRA_DELAY, msec);
8411 /*if (fresh_before)*/ Term_fresh();
8413 /* Display "beam" grids */
8414 if (flg & (PROJECT_BEAM))
8416 /* Obtain the explosion pict */
8417 p = bolt_pict(y, x, y, x, typ);
8419 /* Extract attr/char */
8423 /* Visual effects */
8424 print_rel(c, a, y, x);
8427 /* Hack -- Activate delay */
8431 /* Hack -- delay anyway for consistency */
8434 /* Delay for consistency */
8435 Term_xtra(TERM_XTRA_DELAY, msec);
8438 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8439 if( is_mirror_grid(&cave[y][x]))
8441 /* The target of monsterspell becomes tha mirror(broken) */
8442 monster_target_y=(s16b)y;
8443 monster_target_x=(s16b)x;
8446 next_mirror( &oy,&ox,y,x );
8448 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8449 for( j = last_i; j <=i ; j++ )
8451 y = GRID_Y(path_g[j]);
8452 x = GRID_X(path_g[j]);
8453 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8454 if(!who && (project_m_n==1) && !jump ){
8455 if(cave[project_m_y][project_m_x].m_idx >0 ){
8456 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8458 /* Hack -- auto-recall */
8459 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8461 /* Hack - auto-track */
8462 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8465 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8470 for( i = last_i ; i < path_n ; i++ )
8473 y = GRID_Y(path_g[i]);
8474 x = GRID_X(path_g[i]);
8475 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8477 if(!who && (project_m_n==1) && !jump ){
8478 if(cave[project_m_y][project_m_x].m_idx >0 ){
8479 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8481 /* Hack -- auto-recall */
8482 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8484 /* Hack - auto-track */
8485 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8488 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8492 else if(typ == GF_SUPER_RAY){
8494 int second_step = 0;
8501 for (i = 0; i < path_n; ++i)
8506 int ny = GRID_Y(path_g[i]);
8507 int nx = GRID_X(path_g[i]);
8518 /* Only do visuals if requested */
8519 if (!blind && !(flg & (PROJECT_HIDE)))
8521 /* Only do visuals if the player can "see" the bolt */
8522 if (panel_contains(y, x) && player_has_los_bold(y, x))
8529 /* Obtain the bolt pict */
8530 p = bolt_pict(oy, ox, y, x, typ);
8532 /* Extract attr/char */
8536 /* Visual effects */
8537 print_rel(c, a, y, x);
8538 move_cursor_relative(y, x);
8539 /*if (fresh_before)*/ Term_fresh();
8540 Term_xtra(TERM_XTRA_DELAY, msec);
8542 /*if (fresh_before)*/ Term_fresh();
8544 /* Display "beam" grids */
8545 if (flg & (PROJECT_BEAM))
8547 /* Obtain the explosion pict */
8548 p = bolt_pict(y, x, y, x, typ);
8550 /* Extract attr/char */
8554 /* Visual effects */
8555 print_rel(c, a, y, x);
8558 /* Hack -- Activate delay */
8562 /* Hack -- delay anyway for consistency */
8565 /* Delay for consistency */
8566 Term_xtra(TERM_XTRA_DELAY, msec);
8569 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8570 if (!cave_have_flag_bold(y, x, FF_PROJECT))
8572 if( second_step )continue;
8575 if( is_mirror_grid(&cave[y][x]) && !second_step )
8577 /* The target of monsterspell becomes tha mirror(broken) */
8578 monster_target_y=(s16b)y;
8579 monster_target_x=(s16b)x;
8582 for( j = 0; j <=i ; j++ )
8584 y = GRID_Y(path_g[j]);
8585 x = GRID_X(path_g[j]);
8586 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8590 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8591 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8592 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8593 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8594 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8595 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8596 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8597 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8600 for( i = 0; i < path_n ; i++ )
8603 y = GRID_Y(path_g[i]);
8604 x = GRID_X(path_g[i]);
8605 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8606 if(!who && (project_m_n==1) && !jump ){
8607 if(cave[project_m_y][project_m_x].m_idx >0 ){
8608 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8610 /* Hack -- auto-recall */
8611 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8613 /* Hack - auto-track */
8614 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8617 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8622 /* Project along the path */
8623 for (i = 0; i < path_n; ++i)
8628 int ny = GRID_Y(path_g[i]);
8629 int nx = GRID_X(path_g[i]);
8631 if (flg & PROJECT_DISI)
8633 /* Hack -- Balls explode before reaching walls */
8634 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8636 else if (flg & PROJECT_LOS)
8638 /* Hack -- Balls explode before reaching walls */
8639 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
8643 /* Hack -- Balls explode before reaching walls */
8644 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
8651 /* Collect beam grids */
8652 if (flg & (PROJECT_BEAM))
8659 /* Only do visuals if requested */
8660 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
8662 /* Only do visuals if the player can "see" the bolt */
8663 if (panel_contains(y, x) && player_has_los_bold(y, x))
8670 /* Obtain the bolt pict */
8671 p = bolt_pict(oy, ox, y, x, typ);
8673 /* Extract attr/char */
8677 /* Visual effects */
8678 print_rel(c, a, y, x);
8679 move_cursor_relative(y, x);
8680 /*if (fresh_before)*/ Term_fresh();
8681 Term_xtra(TERM_XTRA_DELAY, msec);
8683 /*if (fresh_before)*/ Term_fresh();
8685 /* Display "beam" grids */
8686 if (flg & (PROJECT_BEAM))
8688 /* Obtain the explosion pict */
8689 p = bolt_pict(y, x, y, x, typ);
8691 /* Extract attr/char */
8695 /* Visual effects */
8696 print_rel(c, a, y, x);
8699 /* Hack -- Activate delay */
8703 /* Hack -- delay anyway for consistency */
8706 /* Delay for consistency */
8707 Term_xtra(TERM_XTRA_DELAY, msec);
8714 /* Save the "blast epicenter" */
8718 if (breath && !path_n)
8724 flg &= ~(PROJECT_HIDE);
8728 /* Start the "explosion" */
8731 /* Hack -- make sure beams get to "explode" */
8739 /* If we found a "target", explode there */
8740 if (dist <= MAX_RANGE)
8742 /* Mega-Hack -- remove the final "beam" grid */
8743 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8746 * Create a conical breath attack
8757 flg &= ~(PROJECT_HIDE);
8759 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
8763 /* Determine the blast area, work from the inside out */
8764 for (dist = 0; dist <= rad; dist++)
8766 /* Scan the maximal blast area of radius "dist" */
8767 for (y = by - dist; y <= by + dist; y++)
8769 for (x = bx - dist; x <= bx + dist; x++)
8771 /* Ignore "illegal" locations */
8772 if (!in_bounds2(y, x)) continue;
8774 /* Enforce a "circular" explosion */
8775 if (distance(by, bx, y, x) != dist) continue;
8781 /* Lights are stopped by opaque terrains */
8782 if (!los(by, bx, y, x)) continue;
8784 case GF_DISINTEGRATE:
8785 /* Disintegration are stopped only by perma-walls */
8786 if (!in_disintegration_range(by, bx, y, x)) continue;
8789 /* Ball explosions are stopped by walls */
8790 if (!projectable(by, bx, y, x)) continue;
8794 /* Save this grid */
8801 /* Encode some more "radius" info */
8807 /* Speed -- ignore "non-explosions" */
8808 if (!grids) return (FALSE);
8811 /* Display the "blast area" if requested */
8812 if (!blind && !(flg & (PROJECT_HIDE)))
8814 /* Then do the "blast", from inside out */
8815 for (t = 0; t <= gm_rad; t++)
8817 /* Dump everything with this radius */
8818 for (i = gm[t]; i < gm[t+1]; i++)
8820 /* Extract the location */
8824 /* Only do visuals if the player can "see" the blast */
8825 if (panel_contains(y, x) && player_has_los_bold(y, x))
8834 /* Obtain the explosion pict */
8835 p = bolt_pict(y, x, y, x, typ);
8837 /* Extract attr/char */
8841 /* Visual effects -- Display */
8842 print_rel(c, a, y, x);
8846 /* Hack -- center the cursor */
8847 move_cursor_relative(by, bx);
8849 /* Flush each "radius" seperately */
8850 /*if (fresh_before)*/ Term_fresh();
8852 /* Delay (efficiently) */
8853 if (visual || drawn)
8855 Term_xtra(TERM_XTRA_DELAY, msec);
8859 /* Flush the erasing */
8862 /* Erase the explosion drawn above */
8863 for (i = 0; i < grids; i++)
8865 /* Extract the location */
8869 /* Hack -- Erase if needed */
8870 if (panel_contains(y, x) && player_has_los_bold(y, x))
8876 /* Hack -- center the cursor */
8877 move_cursor_relative(by, bx);
8879 /* Flush the explosion */
8880 /*if (fresh_before)*/ Term_fresh();
8885 /* Update stuff if needed */
8886 if (p_ptr->update) update_stuff();
8889 /* Check features */
8890 if (flg & (PROJECT_GRID))
8892 /* Start with "dist" of zero */
8895 /* Scan for features */
8896 for (i = 0; i < grids; i++)
8898 /* Hack -- Notice new "dist" values */
8899 if (gm[dist+1] == i) dist++;
8901 /* Get the grid location */
8905 /* Find the closest point in the blast */
8908 int d = dist_to_line(y, x, y1, x1, by, bx);
8910 /* Affect the grid */
8911 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8915 /* Affect the grid */
8916 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8921 /* Update stuff if needed */
8922 if (p_ptr->update) update_stuff();
8925 if (flg & (PROJECT_ITEM))
8927 /* Start with "dist" of zero */
8930 /* Scan for objects */
8931 for (i = 0; i < grids; i++)
8933 /* Hack -- Notice new "dist" values */
8934 if (gm[dist+1] == i) dist++;
8936 /* Get the grid location */
8940 /* Find the closest point in the blast */
8943 int d = dist_to_line(y, x, y1, x1, by, bx);
8945 /* Affect the object in the grid */
8946 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8950 /* Affect the object in the grid */
8951 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8957 /* Check monsters */
8958 if (flg & (PROJECT_KILL))
8965 /* Start with "dist" of zero */
8968 /* Scan for monsters */
8969 for (i = 0; i < grids; i++)
8973 /* Hack -- Notice new "dist" values */
8974 if (gm[dist + 1] == i) dist++;
8976 /* Get the grid location */
8980 /* A single bolt may be reflected */
8983 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
8984 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
8986 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
8989 int max_attempts = 10;
8991 /* Choose 'new' target */
8994 t_y = y_saver - 1 + randint1(3);
8995 t_x = x_saver - 1 + randint1(3);
8998 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
9000 if (max_attempts < 1)
9009 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
9010 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9011 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9012 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9014 msg_print("The attack bounces!");
9017 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
9019 /* Reflected bolts randomly target either one */
9020 if (one_in_(2)) flg |= PROJECT_PLAYER;
9021 else flg &= ~(PROJECT_PLAYER);
9023 /* The bolt is reflected */
9024 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9026 /* Don't affect the monster any longer */
9032 /* Find the closest point in the blast */
9035 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9039 effective_dist = dist;
9043 /* There is the riding player on this monster */
9044 if (p_ptr->riding && player_bold(y, x))
9046 /* Aimed on the player */
9047 if (flg & PROJECT_PLAYER)
9049 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9052 * A beam or bolt is well aimed
9054 * So don't affects the mount.
9061 * The spell is not well aimed,
9062 * So partly affect the mount too.
9069 * This grid is the original target.
9070 * Or aimed on your horse.
9072 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
9074 /* Hit the mount with full damage */
9078 * Otherwise this grid is not the
9079 * original target, it means that line
9080 * of fire is obstructed by this
9084 * A beam or bolt will hit either
9085 * player or mount. Choose randomly.
9087 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9091 /* Hit the mount with full damage */
9095 /* Hit the player later */
9096 flg |= PROJECT_PLAYER;
9098 /* Don't affect the mount */
9104 * The spell is not well aimed, so
9105 * partly affect both player and
9114 /* Affect the monster in the grid */
9115 if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
9119 /* Player affected one monster (without "jumping") */
9120 if (!who && (project_m_n == 1) && !jump)
9126 /* Track if possible */
9127 if (cave[y][x].m_idx > 0)
9129 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9131 /* Hack -- auto-recall */
9132 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9134 /* Hack - auto-track */
9135 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9142 if (flg & (PROJECT_KILL))
9144 /* Start with "dist" of zero */
9147 /* Scan for player */
9148 for (i = 0; i < grids; i++)
9152 /* Hack -- Notice new "dist" values */
9153 if (gm[dist+1] == i) dist++;
9155 /* Get the grid location */
9159 /* Affect the player? */
9160 if (!player_bold(y, x)) continue;
9162 /* Find the closest point in the blast */
9165 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9169 effective_dist = dist;
9172 /* Target may be your horse */
9175 /* Aimed on the player */
9176 if (flg & PROJECT_PLAYER)
9178 /* Hit the player with full damage */
9182 * Hack -- When this grid was not the
9183 * original target, a beam or bolt
9184 * would hit either player or mount,
9185 * and should be choosen randomly.
9187 * But already choosen to hit the
9188 * mount at this point.
9190 * Or aimed on your horse.
9192 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9195 * A beam or bolt is well aimed
9197 * So don't affects the player.
9204 * The spell is not well aimed,
9205 * So partly affect the player too.
9211 /* Affect the player */
9212 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9220 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9222 if (rakubadam_m > 0)
9224 if (rakuba(rakubadam_m, FALSE))
9227 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9229 msg_format("%^s has thrown you off!", m_name);
9233 if (p_ptr->riding && rakubadam_p > 0)
9235 if(rakuba(rakubadam_p, FALSE))
9238 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9240 msg_format("You have fallen from %s.", m_name);
9246 /* Return "something was noticed" */
9250 bool binding_field( int dam )
9252 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9253 int mirror_num=0; /* ¶À¤Î¿ô */
9258 int msec= delay_factor*delay_factor*delay_factor;
9264 /* Default target of monsterspell is player */
9265 monster_target_y=py;
9266 monster_target_x=px;
9268 for( x=0 ; x < cur_wid ; x++ )
9270 for( y=0 ; y < cur_hgt ; y++ )
9272 if( is_mirror_grid(&cave[y][x]) &&
9273 distance(py,px,y,x) <= MAX_RANGE &&
9274 distance(py,px,y,x) != 0 &&
9275 player_has_los_bold(y,x) &&
9276 projectable(py, px, y, x)
9278 mirror_y[mirror_num]=y;
9279 mirror_x[mirror_num]=x;
9285 if( mirror_num < 2 )return FALSE;
9287 point_x[0] = randint0( mirror_num );
9289 point_x[1] = randint0( mirror_num );
9291 while( point_x[0] == point_x[1] );
9293 point_y[0]=mirror_y[point_x[0]];
9294 point_x[0]=mirror_x[point_x[0]];
9295 point_y[1]=mirror_y[point_x[1]];
9296 point_x[1]=mirror_x[point_x[1]];
9300 x=point_x[0]+point_x[1]+point_x[2];
9301 y=point_y[0]+point_y[1]+point_y[2];
9303 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9304 - (point_y[0]*3-y)*(point_x[1]*3-x);
9305 if( centersign == 0 )return FALSE;
9307 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9308 x1 = x1 < point_x[2] ? x1 : point_x[2];
9309 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9310 y1 = y1 < point_y[2] ? y1 : point_y[2];
9312 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9313 x2 = x2 > point_x[2] ? x2 : point_x[2];
9314 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9315 y2 = y2 > point_y[2] ? y2 : point_y[2];
9317 for( y=y1 ; y <=y2 ; y++ ){
9318 for( x=x1 ; x <=x2 ; x++ ){
9319 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9320 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9321 centersign*( (point_x[1]-x)*(point_y[2]-y)
9322 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9323 centersign*( (point_x[2]-x)*(point_y[0]-y)
9324 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9326 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9327 /* Visual effects */
9329 && panel_contains(y,x)){
9330 p = bolt_pict(y,x,y,x, GF_MANA );
9331 print_rel(PICT_C(p), PICT_A(p),y,x);
9332 move_cursor_relative(y, x);
9333 /*if (fresh_before)*/ Term_fresh();
9334 Term_xtra(TERM_XTRA_DELAY, msec);
9340 for( y=y1 ; y <=y2 ; y++ ){
9341 for( x=x1 ; x <=x2 ; x++ ){
9342 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9343 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9344 centersign*( (point_x[1]-x)*(point_y[2]-y)
9345 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9346 centersign*( (point_x[2]-x)*(point_y[0]-y)
9347 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9349 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9350 (void)project_f(0,0,y,x,dam,GF_MANA);
9355 for( y=y1 ; y <=y2 ; y++ ){
9356 for( x=x1 ; x <=x2 ; x++ ){
9357 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9358 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9359 centersign*( (point_x[1]-x)*(point_y[2]-y)
9360 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9361 centersign*( (point_x[2]-x)*(point_y[0]-y)
9362 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9364 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9365 (void)project_o(0,0,y,x,dam,GF_MANA);
9370 for( y=y1 ; y <=y2 ; y++ ){
9371 for( x=x1 ; x <=x2 ; x++ ){
9372 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9373 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9374 centersign*( (point_x[1]-x)*(point_y[2]-y)
9375 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9376 centersign*( (point_x[2]-x)*(point_y[0]-y)
9377 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9379 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9380 (void)project_m(0,0,y,x,dam,GF_MANA,
9381 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9388 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9390 msg_print("The field broke a mirror");
9392 remove_mirror(point_y[0],point_x[0]);
9398 void seal_of_mirror( int dam )
9402 for( x = 0 ; x < cur_wid ; x++ )
9404 for( y = 0 ; y < cur_hgt ; y++ )
9406 if( is_mirror_grid(&cave[y][x]))
9408 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9409 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9411 if( !cave[y][x].m_idx )