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_PATH)))
373 /* Always stop at non-initial wall grids */
374 if ((n > 0) && !have_flag(f_flags_bold(y, x), FF_PROJECT)) break;
377 /* Sometimes stop at non-initial monsters/players */
378 if (flg & (PROJECT_STOP))
381 (player_bold(y, x) || cave[y][x].m_idx != 0))
385 if (!in_bounds(y, x)) break;
390 /* Advance (X) part 1 */
393 /* Horizontal change */
396 /* Advance (X) part 2 */
399 /* Advance (X) part 3 */
415 /* Let m = ((dy/dx) * full) = (dy * dy * 2) */
424 /* Vertical change */
427 /* Advance (Y) part 2 */
430 /* Advance (Y) part 3 */
437 /* Create the projection path */
441 gp[n++] = GRID(y, x);
443 /* Hack -- Check maximum range */
444 if ((n + (k >> 1)) >= range) break;
446 /* Sometimes stop at destination grid */
447 if (!(flg & (PROJECT_THRU)))
449 if ((x == x2) && (y == y2)) break;
452 if (flg & (PROJECT_DISI))
454 if ((n > 0) && cave_stop_disintegration(y, x)) break;
456 else if (!(flg & (PROJECT_PATH)))
458 /* Always stop at non-initial wall grids */
459 if ((n > 0) && !have_flag(f_flags_bold(y, x), FF_PROJECT)) break;
462 /* Sometimes stop at non-initial monsters/players */
463 if (flg & (PROJECT_STOP))
466 (player_bold(y, x) || cave[y][x].m_idx != 0))
470 if (!in_bounds(y, x)) break;
475 /* Advance (Y) part 1 */
478 /* Vertical change */
481 /* Advance (Y) part 2 */
484 /* Advance (Y) part 3 */
504 /* Create the projection path */
508 gp[n++] = GRID(y, x);
510 /* Hack -- Check maximum range */
511 if ((n + (n >> 1)) >= range) break;
513 /* Sometimes stop at destination grid */
514 if (!(flg & (PROJECT_THRU)))
516 if ((x == x2) && (y == y2)) break;
519 if (flg & (PROJECT_DISI))
521 if ((n > 0) && cave_stop_disintegration(y, x)) break;
523 else if (!(flg & (PROJECT_PATH)))
525 /* Always stop at non-initial wall grids */
526 if ((n > 0) && !have_flag(f_flags_bold(y, x), FF_PROJECT)) break;
529 /* Sometimes stop at non-initial monsters/players */
530 if (flg & (PROJECT_STOP))
533 (player_bold(y, x) || cave[y][x].m_idx != 0))
537 if (!in_bounds(y, x)) break;
554 * Mega-Hack -- track "affected" monsters (see "project()" comments)
556 static int project_m_n;
557 static int project_m_x;
558 static int project_m_y;
559 /* Mega-Hack -- monsters target */
560 static s16b monster_target_x;
561 static s16b monster_target_y;
565 * We are called from "project()" to "damage" terrain features
567 * We are called both for "beam" effects and "ball" effects.
569 * The "r" parameter is the "distance from ground zero".
571 * Note that we determine if the player can "see" anything that happens
572 * by taking into account: blindness, line-of-sight, and illumination.
574 * We return "TRUE" if the effect of the projection is "obvious".
576 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
578 * XXX XXX XXX Perhaps we should affect doors?
580 static bool project_f(int who, int r, int y, int x, int dam, int typ)
582 cave_type *c_ptr = &cave[y][x];
583 feature_type *f_ptr = &f_info[c_ptr->feat];
585 bool obvious = FALSE;
586 bool known = player_has_los_bold(y, x);
592 /* Reduce damage by distance */
593 dam = (dam + r) / (r + 1);
596 if (have_flag(f_ptr->flags, FF_TREE))
605 message = "¸Ï¤ì¤¿";break;
607 message = "was blasted.";break;
611 message = "½Ì¤ó¤À";break;
613 message = "shrank.";break;
617 message = "ÍϤ±¤¿";break;
619 message = "melted.";break;
624 message = "Åà¤ê¡¢ºÕ¤±»¶¤Ã¤¿";break;
626 message = "was frozen and smashed.";break;
632 message = "dz¤¨¤¿";break;
634 message = "burns up!";break;
648 message = "Ê´ºÕ¤µ¤ì¤¿";break;
650 message = "was crushed.";break;
653 message = NULL;break;
658 msg_format("ÌÚ¤Ï%s¡£", message);
660 msg_format("A tree %s", message);
662 cave_set_feat(y, x, (one_in_(3) ? FEAT_DEEP_GRASS : FEAT_GRASS));
665 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
667 /* Update some things */
668 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
672 /* Analyze the type */
675 /* Ignore most effects */
710 /* Destroy Traps (and Locks) */
713 /* Reveal secret doors */
714 if (is_hidden_door(c_ptr))
719 /* Check line of sight */
727 if (is_trap(c_ptr->feat))
729 /* Check line of sight */
733 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
735 msg_print("There is a bright flash of light!");
741 /* Destroy the trap */
742 cave_alter_feat(y, x, FF_DISARM);
745 /* Locked doors are unlocked */
746 if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
748 s16b old_feat = c_ptr->feat;
750 /* Unlock the door */
751 cave_alter_feat(y, x, FF_DISARM);
753 /* Check line of sound */
754 if (known && (old_feat != c_ptr->feat))
757 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
766 /* Remove "unsafe" flag if player is not blind */
767 if (!p_ptr->blind && player_has_los_bold(y, x))
769 c_ptr->info &= ~(CAVE_UNSAFE);
780 /* Destroy Doors (and traps) */
783 /* Destroy all doors and traps */
784 if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
786 /* Check line of sight */
791 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
793 msg_print("There is a bright flash of light!");
799 /* Visibility change */
800 if (have_flag(f_ptr->flags, FF_DOOR))
802 /* Update some things */
803 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
806 /* Destroy the feature */
807 cave_alter_feat(y, x, FF_TUNNEL);
810 /* Remove "unsafe" flag if player is not blind */
811 if (!p_ptr->blind && player_has_los_bold(y, x))
813 c_ptr->info &= ~(CAVE_UNSAFE);
824 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
826 if (have_flag(f_ptr->flags, FF_SPIKE))
828 s16b old_mimic = c_ptr->mimic;
829 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
831 cave_alter_feat(y, x, FF_SPIKE);
833 c_ptr->mimic = old_mimic;
841 /* Check line of sight */
842 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
846 msg_format("%s¤Ë²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ³«¤«¤Ê¤¯¤Ê¤Ã¤¿¡£", f_name + mimic_f_ptr->name);
848 msg_format("The %s seems stuck.", f_name + mimic_f_ptr->name);
857 /* Destroy walls (and doors) */
860 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
863 if (known && (c_ptr->info & (CAVE_MARK)))
866 msg_format("%s¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª", f_name + f_info[get_feat_mimic(c_ptr)].name);
868 msg_format("The %s turns into mud!", f_name + f_info[get_feat_mimic(c_ptr)].name);
874 /* Destroy the wall */
875 cave_alter_feat(y, x, FF_HURT_ROCK);
877 /* Update some things */
878 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
887 /* Require a "naked" floor grid */
888 if (!cave_naked_bold(y, x)) break;
890 /* Not on the player */
891 if (player_bold(y, x)) break;
893 /* Create a closed door */
894 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
897 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
899 /* Update some things */
900 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
917 /* Require a "naked" floor grid */
918 if (!cave_naked_bold(y, x)) break;
920 /* Not on the player */
921 if (player_bold(y, x)) break;
923 /* Create a closed door */
924 cave_set_feat(y, x, FEAT_TREES);
927 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
929 /* Update some things */
930 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
937 /* Require a "naked" floor grid */
938 if (!cave_naked_bold(y, x)) break;
941 c_ptr->info |= CAVE_OBJECT;
942 c_ptr->mimic = FEAT_GLYPH;
955 /* Require a "naked" floor grid */
956 if (!cave_naked_bold(y, x)) break;
958 /* Not on the player */
959 if (player_bold(y, x)) break;
962 cave_set_feat(y, x, FEAT_WALL);
964 /* Update some things */
965 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
976 /* Ignore permanent grid */
977 if (cave_perma_bold(y, x)) break;
979 /* Ignore grid without enough space */
980 if (!have_flag(f_flags_bold(y, x), FF_FLOOR)) break;
982 /* Place a shallow lava */
983 cave_set_feat(y, x, FEAT_SHAL_LAVA);
988 /* Ignore permanent grid */
989 if (cave_perma_bold(y, x)) break;
991 /* Place a deep lava */
992 cave_set_feat(y, x, FEAT_DEEP_LAVA);
1002 /* Ignore permanent grid */
1003 if (cave_perma_bold(y, x)) break;
1005 /* Ignore grid without enough space */
1006 if (!have_flag(f_flags_bold(y, x), FF_FLOOR)) break;
1008 /* Place a shallow lava */
1009 cave_set_feat(y, x, FEAT_SHAL_WATER);
1014 /* Ignore permanent grid */
1015 if (cave_perma_bold(y, x)) break;
1017 /* Place a deep lava */
1018 cave_set_feat(y, x, FEAT_DEEP_WATER);
1023 /* Lite up the grid */
1027 /* Turn on the light */
1028 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) c_ptr->info |= (CAVE_GLOW);
1037 if (player_can_see_bold(y, x)) obvious = TRUE;
1039 /* Mega-Hack -- Update the monster in the affected grid */
1040 /* This allows "spear of light" (etc) to work "correctly" */
1041 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1046 /* Darken the grid */
1050 if (!p_ptr->inside_battle)
1053 if (player_can_see_bold(y, x)) obvious = TRUE;
1055 /* Turn off the light. */
1056 if (!is_mirror_grid(c_ptr))
1058 c_ptr->info &= ~(CAVE_GLOW);
1060 /* Hack -- Forget "boring" grids */
1061 if (!have_flag(f_ptr->flags, FF_REMEMBER))
1064 c_ptr->info &= ~(CAVE_MARK);
1074 /* Mega-Hack -- Update the monster in the affected grid */
1075 /* This allows "spear of light" (etc) to work "correctly" */
1076 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1085 if (is_mirror_grid(c_ptr))
1088 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1090 msg_print("The mirror was crashed!");
1092 remove_mirror(y, x);
1093 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1099 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
1102 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1104 msg_print("The mirror was crashed!");
1106 remove_mirror(y, x);
1107 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1112 case GF_DISINTEGRATE:
1114 /* Destroy mirror */
1115 if (is_mirror_grid(c_ptr)) remove_mirror(y, x);
1117 /* Permanent features don't get effect */
1118 /* But not protect monsters and other objects */
1119 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
1121 cave_alter_feat(y, x, FF_HURT_DISI);
1123 /* Update some things -- similar to GF_KILL_WALL */
1124 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
1131 /* Return "Anything seen?" */
1138 * We are called from "project()" to "damage" objects
1140 * We are called both for "beam" effects and "ball" effects.
1142 * Perhaps we should only SOMETIMES damage things on the ground.
1144 * The "r" parameter is the "distance from ground zero".
1146 * Note that we determine if the player can "see" anything that happens
1147 * by taking into account: blindness, line-of-sight, and illumination.
1149 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1151 * We return "TRUE" if the effect of the projection is "obvious".
1153 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1155 cave_type *c_ptr = &cave[y][x];
1157 s16b this_o_idx, next_o_idx = 0;
1159 bool obvious = FALSE;
1160 bool known = player_has_los_bold(y, x);
1162 u32b flgs[TR_FLAG_SIZE];
1164 char o_name[MAX_NLEN];
1167 bool is_potion = FALSE;
1171 who = who ? who : 0;
1173 /* Reduce damage by distance */
1174 dam = (dam + r) / (r + 1);
1177 /* Scan all objects in the grid */
1178 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1180 /* Acquire object */
1181 object_type *o_ptr = &o_list[this_o_idx];
1183 bool is_art = FALSE;
1184 bool ignore = FALSE;
1185 bool do_kill = FALSE;
1187 cptr note_kill = NULL;
1190 /* Get the "plural"-ness */
1191 bool plural = (o_ptr->number > 1);
1194 /* Acquire next object */
1195 next_o_idx = o_ptr->next_o_idx;
1197 /* Extract the flags */
1198 object_flags(o_ptr, flgs);
1200 /* Check for artifact */
1201 if ((artifact_p(o_ptr) || o_ptr->art_name)) is_art = TRUE;
1203 /* Analyze the type */
1206 /* Acid -- Lots of things */
1209 if (hates_acid(o_ptr))
1213 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1215 note_kill = (plural ? " melt!" : " melts!");
1218 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1223 /* Elec -- Rings and Wands */
1226 if (hates_elec(o_ptr))
1230 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1232 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1235 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1240 /* Fire -- Flammable objects */
1243 if (hates_fire(o_ptr))
1247 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1249 note_kill = (plural ? " burn up!" : " burns up!");
1252 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1257 /* Cold -- potions and flasks */
1260 if (hates_cold(o_ptr))
1263 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1265 note_kill = (plural ? " shatter!" : " shatters!");
1269 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1277 if (hates_fire(o_ptr))
1281 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1283 note_kill = (plural ? " burn up!" : " burns up!");
1286 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1288 if (hates_elec(o_ptr))
1293 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1295 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1298 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1306 if (hates_fire(o_ptr))
1310 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1312 note_kill = (plural ? " burn up!" : " burns up!");
1315 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1317 if (hates_cold(o_ptr))
1322 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1324 note_kill = (plural ? " shatter!" : " shatters!");
1327 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1332 /* Hack -- break potions and such */
1338 if (hates_cold(o_ptr))
1341 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1343 note_kill = (plural ? " shatter!" : " shatters!");
1351 /* Mana and Chaos -- destroy everything */
1358 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1360 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1366 case GF_DISINTEGRATE:
1370 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1372 note_kill = (plural ? " evaporate!" : " evaporates!");
1382 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1384 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1387 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1388 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1392 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1396 if (cursed_p(o_ptr))
1400 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1402 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1411 identify_item(o_ptr);
1413 /* Auto-inscription */
1414 autopick_alter_item((-this_o_idx), FALSE);
1422 /* Chests are noticed only if trapped or locked */
1423 if (o_ptr->tval == TV_CHEST)
1425 /* Disarm/Unlock traps */
1426 if (o_ptr->pval > 0)
1428 /* Disarm or Unlock */
1429 o_ptr->pval = (0 - o_ptr->pval);
1432 object_known(o_ptr);
1435 if (known && o_ptr->marked)
1438 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1440 msg_print("Click!");
1452 if (o_ptr->tval == TV_CORPSE)
1457 if (!who || is_pet(&m_list[who]))
1458 mode |= PM_FORCE_PET;
1460 for (i = 0; i < o_ptr->number ; i++)
1462 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1463 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1468 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1470 note_kill = (plural ? " become dust." : " becomes dust.");
1475 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1478 note_kill = "À¸¤Ê֤ä¿¡£";
1480 note_kill = "rivived.";
1483 else if (!note_kill)
1486 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1488 note_kill = (plural ? " become dust." : " becomes dust.");
1500 /* Attempt to destroy the object */
1503 /* Effect "observed" */
1504 if (known && o_ptr->marked)
1507 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1510 /* Artifacts, and other objects, get to resist */
1511 if (is_art || ignore)
1513 /* Observe the resist */
1514 if (known && o_ptr->marked)
1517 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1520 msg_format("The %s %s unaffected!",
1521 o_name, (plural ? "are" : "is"));
1530 /* Describe if needed */
1531 if (known && o_ptr->marked && note_kill)
1534 msg_format("%s¤Ï%s", o_name, note_kill);
1536 msg_format("The %s%s", o_name, note_kill);
1541 k_idx = o_ptr->k_idx;
1542 is_potion = object_is_potion(o_ptr);
1545 /* Delete the object */
1546 delete_object_idx(this_o_idx);
1548 /* Potions produce effects when 'shattered' */
1551 (void)potion_smash_effect(who, y, x, k_idx);
1560 /* Return "Anything seen?" */
1566 * Helper function for "project()" below.
1568 * Handle a beam/bolt/ball causing damage to a monster.
1570 * This routine takes a "source monster" (by index) which is mostly used to
1571 * determine if the player is causing the damage, and a "radius" (see below),
1572 * which is used to decrease the power of explosions with distance, and a
1573 * location, via integers which are modified by certain types of attacks
1574 * (polymorph and teleport being the obvious ones), a default damage, which
1575 * is modified as needed based on various properties, and finally a "damage
1576 * type" (see below).
1578 * Note that this routine can handle "no damage" attacks (like teleport) by
1579 * taking a "zero" damage, and can even take "parameters" to attacks (like
1580 * confuse) by accepting a "damage", using it to calculate the effect, and
1581 * then setting the damage to zero. Note that the "damage" parameter is
1582 * divided by the radius, so monsters not at the "epicenter" will not take
1583 * as much damage (or whatever)...
1585 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1586 * may result in a dereference of an invalid pointer. XXX XXX XXX
1588 * Various messages are produced, and damage is applied.
1590 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1591 * actually be "made" of that substance, or "breathe" big balls of it.
1593 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1596 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1597 * and hurts evil less. If can breath nether, then it resists it as well.
1599 * Damage reductions use the following formulas:
1600 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1601 * gives avg damage of .655, ranging from .858 to .500
1602 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1603 * gives avg damage of .544, ranging from .714 to .417
1604 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1605 * gives avg damage of .444, ranging from .556 to .333
1606 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1607 * gives avg damage of .327, ranging from .427 to .250
1608 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1609 * gives something simple.
1611 * In this function, "result" messages are postponed until the end, where
1612 * the "note" string is appended to the monster name, if not NULL. So,
1613 * to make a spell have "no effect" just set "note" to NULL. You should
1614 * also set "notice" to FALSE, or the player will learn what the spell does.
1616 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1618 /* "flg" was added. */
1619 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1623 cave_type *c_ptr = &cave[y][x];
1625 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1627 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1631 /* Is the monster "seen"? */
1632 bool seen = m_ptr->ml;
1634 bool slept = (bool)(m_ptr->csleep > 0);
1636 /* Were the effects "obvious" (if seen)? */
1637 bool obvious = FALSE;
1639 /* Can the player know about this effect? */
1640 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1642 /* Can the player see the source of this effect? */
1643 bool see_s = ((who <= 0) || m_list[who].ml);
1645 /* Were the effects "irrelevant"? */
1646 bool skipped = FALSE;
1648 /* Gets the monster angry at the source of the effect? */
1649 bool get_angry = FALSE;
1651 /* Polymorph setting (true or false) */
1652 bool do_poly = FALSE;
1654 /* Teleport setting (max distance) */
1657 /* Confusion setting (amount to confuse) */
1660 /* Stunning setting (amount to stun) */
1663 /* Sleep amount (amount to sleep) */
1666 /* Fear amount (amount to fear) */
1669 /* Time amount (amount to time) */
1672 bool heal_leper = FALSE;
1674 /* Hold the monster name */
1683 /* Assume no note */
1686 /* Assume a default death */
1687 cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
1692 int caster_lev = (who > 0) ? r_info[m_list[who].r_idx].level : p_ptr->lev * 2;
1695 if (!c_ptr->m_idx) return (FALSE);
1697 /* Never affect projector */
1698 if (who && (c_ptr->m_idx == who)) return (FALSE);
1699 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1700 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1702 /* Don't affect already death monsters */
1703 /* Prevents problems with chain reactions of exploding monsters */
1704 if (m_ptr->hp < 0) return (FALSE);
1706 /* Reduce damage by distance */
1707 dam = (dam + r) / (r + 1);
1710 /* Get the monster name (BEFORE polymorphing) */
1711 monster_desc(m_name, m_ptr, 0);
1714 /* Get the monster possessive ("his"/"her"/"its") */
1715 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1719 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1721 /* Analyze the damage type */
1724 /* Magic Missile -- pure damage */
1727 if (seen) obvious = TRUE;
1729 if (r_ptr->flagsr & RFR_RES_ALL)
1732 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1734 note = " is immune.";
1737 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1746 if (seen) obvious = TRUE;
1748 if (r_ptr->flagsr & RFR_RES_ALL)
1751 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1753 note = " is immune.";
1756 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1759 if (r_ptr->flagsr & RFR_IM_ACID)
1762 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1764 note = " resists a lot.";
1768 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1776 if (seen) obvious = TRUE;
1778 if (r_ptr->flagsr & RFR_RES_ALL)
1781 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1783 note = " is immune.";
1786 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1789 if (r_ptr->flagsr & RFR_IM_ELEC)
1792 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1794 note = " resists a lot.";
1798 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1806 if (seen) obvious = TRUE;
1808 if (r_ptr->flagsr & RFR_RES_ALL)
1811 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1813 note = " is immune.";
1816 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1819 if (r_ptr->flagsr & RFR_IM_FIRE)
1822 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1824 note = " resists a lot.";
1828 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1830 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1833 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1835 note = " is hit hard.";
1839 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1847 if (seen) obvious = TRUE;
1849 if (r_ptr->flagsr & RFR_RES_ALL)
1852 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1854 note = " is immune.";
1857 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1860 if (r_ptr->flagsr & RFR_IM_COLD)
1863 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1865 note = " resists a lot.";
1869 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1871 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1874 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1876 note = " is hit hard.";
1880 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1888 if (seen) obvious = TRUE;
1890 if (r_ptr->flagsr & RFR_RES_ALL)
1893 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1895 note = " is immune.";
1898 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1901 if (r_ptr->flagsr & RFR_IM_POIS)
1904 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1906 note = " resists a lot.";
1910 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1918 if (seen) obvious = TRUE;
1920 if (r_ptr->flagsr & RFR_RES_ALL)
1923 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1925 note = " is immune.";
1928 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1931 if (r_ptr->flagsr & RFR_IM_POIS)
1934 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
1939 dam *= 3; dam /= randint1(6) + 6;
1940 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1942 else if (one_in_(3)) do_poly = TRUE;
1946 /* Hellfire -- hurts Evil */
1949 if (seen) obvious = TRUE;
1951 if (r_ptr->flagsr & RFR_RES_ALL)
1954 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1956 note = " is immune.";
1959 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1962 if (r_ptr->flags3 & RF3_GOOD)
1966 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
1968 note = " is hit hard.";
1971 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1976 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1979 if (seen) obvious = TRUE;
1981 if (r_ptr->flagsr & RFR_RES_ALL)
1984 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1986 note = " is immune.";
1989 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1992 if (r_ptr->flags3 & RF3_GOOD)
1996 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
1998 note = " is immune.";
2001 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
2003 else if (r_ptr->flags3 & RF3_EVIL)
2007 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2009 note = " is hit hard.";
2012 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
2017 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2022 dam *= 3; dam /= randint1(6) + 6;
2027 /* Arrow -- XXX no defense */
2030 if (seen) obvious = TRUE;
2032 if (r_ptr->flagsr & RFR_RES_ALL)
2035 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2037 note = " is immune.";
2040 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2046 /* Plasma -- XXX perhaps check ELEC or FIRE */
2049 if (seen) obvious = TRUE;
2051 if (r_ptr->flagsr & RFR_RES_ALL)
2054 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2056 note = " is immune.";
2059 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2062 if (r_ptr->flagsr & RFR_RES_PLAS)
2065 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2070 dam *= 3; dam /= randint1(6) + 6;
2071 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
2076 /* Nether -- see above */
2079 if (seen) obvious = TRUE;
2081 if (r_ptr->flagsr & RFR_RES_ALL)
2084 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2086 note = " is immune.";
2089 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2092 if (r_ptr->flagsr & RFR_RES_NETH)
2094 if (r_ptr->flags3 & RF3_UNDEAD)
2097 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2099 note = " is immune.";
2103 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2108 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2113 dam *= 3; dam /= randint1(6) + 6;
2115 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
2117 else if (r_ptr->flags3 & RF3_EVIL)
2121 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2123 note = " resists somewhat.";
2126 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2131 /* Water (acid) damage -- Water spirits/elementals are immune */
2134 if (seen) obvious = TRUE;
2136 if (r_ptr->flagsr & RFR_RES_ALL)
2139 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2141 note = " is immune.";
2144 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2147 if (r_ptr->flagsr & RFR_RES_WATE)
2149 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
2152 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2154 note = " is immune.";
2162 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2167 dam *= 3; dam /= randint1(6) + 6;
2169 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
2174 /* Chaos -- Chaos breathers resist */
2177 if (seen) obvious = TRUE;
2179 if (r_ptr->flagsr & RFR_RES_ALL)
2182 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2184 note = " is immune.";
2187 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2190 if (r_ptr->flagsr & RFR_RES_CHAO)
2193 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2198 dam *= 3; dam /= randint1(6) + 6;
2199 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
2201 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
2204 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2206 note = " resists somewhat.";
2209 dam *= 3; dam /= randint1(6) + 6;
2210 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2215 do_conf = (5 + randint1(11) + r) / (r + 1);
2220 /* Shards -- Shard breathers resist */
2223 if (seen) obvious = TRUE;
2225 if (r_ptr->flagsr & RFR_RES_ALL)
2228 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2230 note = " is immune.";
2233 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2236 if (r_ptr->flagsr & RFR_RES_SHAR)
2239 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2244 dam *= 3; dam /= randint1(6) + 6;
2245 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2250 /* Rocket: Shard resistance helps */
2253 if (seen) obvious = TRUE;
2255 if (r_ptr->flagsr & RFR_RES_ALL)
2258 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2260 note = " is immune.";
2263 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2266 if (r_ptr->flagsr & RFR_RES_SHAR)
2269 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2271 note = " resists somewhat.";
2275 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2281 /* Sound -- Sound breathers resist */
2284 if (seen) obvious = TRUE;
2286 if (r_ptr->flagsr & RFR_RES_ALL)
2289 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2291 note = " is immune.";
2294 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2297 if (r_ptr->flagsr & RFR_RES_SOUN)
2300 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2305 dam *= 2; dam /= randint1(6) + 6;
2306 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
2308 else do_stun = (10 + randint1(15) + r) / (r + 1);
2315 if (seen) obvious = TRUE;
2317 if (r_ptr->flagsr & RFR_RES_ALL)
2320 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2322 note = " is immune.";
2325 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2328 if (r_ptr->flags3 & RF3_NO_CONF)
2331 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2336 dam *= 3; dam /= randint1(6) + 6;
2337 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2339 else do_conf = (10 + randint1(15) + r) / (r + 1);
2343 /* Disenchantment -- Breathers and Disenchanters resist */
2346 if (seen) obvious = TRUE;
2348 if (r_ptr->flagsr & RFR_RES_ALL)
2351 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2353 note = " is immune.";
2356 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2359 if (r_ptr->flagsr & RFR_RES_DISE)
2362 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2367 dam *= 3; dam /= randint1(6) + 6;
2368 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
2373 /* Nexus -- Breathers and Existers resist */
2376 if (seen) obvious = TRUE;
2378 if (r_ptr->flagsr & RFR_RES_ALL)
2381 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2383 note = " is immune.";
2386 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2389 if (r_ptr->flagsr & RFR_RES_NEXU)
2392 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2397 dam *= 3; dam /= randint1(6) + 6;
2398 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
2406 if (seen) obvious = TRUE;
2408 if (r_ptr->flagsr & RFR_RES_ALL)
2411 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2413 note = " is immune.";
2416 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2419 if (r_ptr->flagsr & RFR_RES_WALL)
2422 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2427 dam *= 3; dam /= randint1(6) + 6;
2428 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
2430 else do_stun = (randint1(15) + r) / (r + 1);
2434 /* Inertia -- breathers resist */
2437 if (seen) obvious = TRUE;
2439 if (r_ptr->flagsr & RFR_RES_ALL)
2442 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2444 note = " is immune.";
2447 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2450 if (r_ptr->flagsr & RFR_RES_INER)
2453 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2458 dam *= 3; dam /= randint1(6) + 6;
2459 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
2463 /* Powerful monsters can resist */
2464 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2465 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2469 /* Normal monsters slow down */
2475 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2477 note = " starts moving slower.";
2480 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2481 if (c_ptr->m_idx == p_ptr->riding)
2482 p_ptr->update |= (PU_BONUS);
2488 /* Time -- breathers resist */
2491 if (seen) obvious = TRUE;
2493 if (r_ptr->flagsr & RFR_RES_ALL)
2496 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2498 note = " is immune.";
2501 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2504 if (r_ptr->flagsr & RFR_RES_TIME)
2507 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2512 dam *= 3; dam /= randint1(6) + 6;
2513 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
2515 else do_time = (dam + 1) / 2;
2519 /* Gravity -- breathers resist */
2522 bool resist_tele = FALSE;
2524 if (seen) obvious = TRUE;
2526 if (r_ptr->flagsr & RFR_RES_ALL)
2529 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2531 note = " is immune.";
2534 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2537 if (r_ptr->flagsr & RFR_RES_TELE)
2539 if (r_ptr->flags1 & (RF1_UNIQUE))
2541 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2543 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2545 note = " is unaffected!";
2550 else if (r_ptr->level > randint1(100))
2552 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2554 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2563 if (!resist_tele) do_dist = 10;
2565 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2567 if (r_ptr->flagsr & RFR_RES_GRAV)
2570 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2575 dam *= 3; dam /= randint1(6) + 6;
2577 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
2582 /* Powerful monsters can resist */
2583 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2584 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2588 /* Normal monsters slow down */
2594 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2596 note = " starts moving slower.";
2599 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2600 if (c_ptr->m_idx == p_ptr->riding)
2601 p_ptr->update |= (PU_BONUS);
2605 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2607 /* Attempt a saving throw */
2608 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2609 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2613 /* No obvious effect */
2615 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2617 note = " is unaffected!";
2631 if (seen) obvious = TRUE;
2633 if (r_ptr->flagsr & RFR_RES_ALL)
2636 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2638 note = " is immune.";
2641 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2649 case GF_DISINTEGRATE:
2651 if (seen) obvious = TRUE;
2653 if (r_ptr->flagsr & RFR_RES_ALL)
2656 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2658 note = " is immune.";
2661 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2664 if (r_ptr->flags3 & RF3_HURT_ROCK)
2666 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2668 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2669 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2671 note = " loses some skin!";
2672 note_dies = " evaporates!";
2682 if (seen) obvious = TRUE;
2684 /* PSI only works if the monster can see you! -- RG */
2685 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2688 if (seen) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name);
2690 if (seen) msg_format("%^s can't see you, and isn't affected!", m_name);
2696 if (r_ptr->flagsr & RFR_RES_ALL)
2699 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2701 note = " is immune.";
2704 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2707 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2711 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2713 note = " is immune!";
2715 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2718 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2719 (r_ptr->flags3 & RF3_ANIMAL) ||
2720 (r_ptr->level > randint1(3 * dam)))
2724 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2731 * Powerful demons & undead can turn a mindcrafter's
2732 * attacks back on them
2734 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2735 (r_ptr->level > p_ptr->lev / 2) &&
2740 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2742 msg_format("%^s%s corrupted mind backlashes your attack!",
2743 m_name, (seen ? "'s" : "s"));
2747 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2750 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2752 msg_print("You resist the effects!");
2758 /* Injure +/- confusion */
2759 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2760 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2763 switch (randint1(4))
2766 set_confused(p_ptr->confused + 3 + randint1(dam));
2769 set_stun(p_ptr->stun + randint1(dam));
2773 if (r_ptr->flags3 & RF3_NO_FEAR)
2775 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2777 note = " is unaffected.";
2781 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2785 if (!p_ptr->free_act)
2786 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2795 if ((dam > 0) && one_in_(4))
2797 switch (randint1(4))
2800 do_conf = 3 + randint1(dam);
2803 do_stun = 3 + randint1(dam);
2806 do_fear = 3 + randint1(dam);
2810 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2812 note = " falls asleep!";
2815 do_sleep = 3 + randint1(dam);
2821 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2823 note_dies = " collapses, a mindless husk.";
2831 if (seen) obvious = TRUE;
2833 if (r_ptr->flagsr & RFR_RES_ALL)
2836 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2838 note = " is immune.";
2841 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2844 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2848 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2850 note = " is immune!";
2854 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2855 (r_ptr->flags3 & RF3_ANIMAL) ||
2856 (r_ptr->level > randint1(3 * dam)))
2860 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2867 * Powerful demons & undead can turn a mindcrafter's
2868 * attacks back on them
2870 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2871 (r_ptr->level > p_ptr->lev / 2) &&
2876 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2878 msg_format("%^s%s corrupted mind backlashes your attack!",
2879 m_name, (seen ? "'s" : "s"));
2883 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2886 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2888 msg_print("You resist the effects!");
2894 /* Injure + mana drain */
2895 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2897 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
2899 msg_print("Your psychic energy is drained!");
2902 p_ptr->csp -= damroll(5, dam) / 2;
2903 if (p_ptr->csp < 0) p_ptr->csp = 0;
2904 p_ptr->redraw |= PR_MANA;
2905 p_ptr->window |= (PW_SPELL);
2906 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2913 int b = damroll(5, dam) / 4;
2915 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª", m_name);
2917 msg_format("You convert %s%s pain into psychic energy!",
2918 m_name, (seen ? "'s" : "s"));
2921 b = MIN(p_ptr->msp, p_ptr->csp + b);
2923 p_ptr->redraw |= PR_MANA;
2924 p_ptr->window |= (PW_SPELL);
2928 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2930 note_dies = " collapses, a mindless husk.";
2936 case GF_TELEKINESIS:
2938 if (seen) obvious = TRUE;
2940 if (r_ptr->flagsr & RFR_RES_ALL)
2943 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2945 note = " is immune.";
2948 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2953 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2958 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2960 /* Attempt a saving throw */
2961 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2962 (r_ptr->level > 5 + randint1(dam)))
2966 /* No obvious effect */
2972 /* Psycho-spear -- powerful magic missile */
2975 if (seen) obvious = TRUE;
2977 if (r_ptr->flagsr & RFR_RES_ALL)
2980 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2982 note = " is immune.";
2985 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2991 /* Meteor -- powerful magic missile */
2994 if (seen) obvious = TRUE;
2996 if (r_ptr->flagsr & RFR_RES_ALL)
2999 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3001 note = " is immune.";
3004 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3012 if (!is_hostile(m_ptr)) break;
3014 if (seen) obvious = TRUE;
3016 if (r_ptr->flagsr & RFR_RES_ALL)
3019 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3021 note = " is immune.";
3024 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3027 /* Attempt a saving throw */
3028 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
3029 (r_ptr->flags3 & RF3_NO_CONF) ||
3030 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3032 /* Memorize a flag */
3033 if (r_ptr->flags3 & RF3_NO_CONF)
3035 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3042 * Powerful demons & undead can turn a mindcrafter's
3043 * attacks back on them
3045 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
3046 (r_ptr->level > p_ptr->lev / 2) &&
3051 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
3053 msg_format("%^s%s corrupted mind backlashes your attack!",
3054 m_name, (seen ? "'s" : "s"));
3058 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3061 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3063 msg_print("You resist the effects!");
3069 /* Confuse, stun, terrify */
3070 switch (randint1(4))
3073 set_stun(p_ptr->stun + dam / 2);
3076 set_confused(p_ptr->confused + dam / 2);
3080 if (r_ptr->flags3 & RF3_NO_FEAR)
3082 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3084 note = " is unaffected.";
3088 set_afraid(p_ptr->afraid + dam);
3095 /* No obvious effect */
3097 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3099 note = " is unaffected!";
3107 if ((dam > 29) && (randint1(100) < dam))
3110 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3112 note = " is in your thrall!";
3119 switch (randint1(4))
3133 /* No "real" damage */
3140 /* Ice -- Cold + Cuts + Stun */
3143 if (seen) obvious = TRUE;
3145 if (r_ptr->flagsr & RFR_RES_ALL)
3148 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3150 note = " is immune.";
3153 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3156 do_stun = (randint1(15) + 1) / (r + 1);
3157 if (r_ptr->flagsr & RFR_IM_COLD)
3160 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3162 note = " resists a lot.";
3166 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
3168 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3171 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3173 note = " is hit hard.";
3177 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3186 if (seen) obvious = TRUE;
3188 if (r_ptr->flagsr & RFR_RES_ALL)
3191 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3193 note = " is immune.";
3196 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3199 if (!monster_living(r_ptr))
3203 if (is_original_ap(m_ptr))
3205 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3206 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3207 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3212 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3214 note = " is unaffected!";
3220 else do_time = (dam+7)/8;
3228 if (seen) obvious = TRUE;
3230 if (r_ptr->flagsr & RFR_RES_ALL)
3233 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3235 note = " is immune.";
3238 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3241 if (!monster_living(r_ptr))
3245 if (is_original_ap(m_ptr))
3247 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3248 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3249 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3254 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3256 note = " is immune.";
3262 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3263 (randint1(888) != 666)) ||
3264 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
3265 randint1(100) != 66))
3268 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3280 /* Polymorph monster (Use "dam" as "power") */
3283 if (seen) obvious = TRUE;
3285 if (r_ptr->flagsr & RFR_RES_ALL)
3288 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3290 note = " is immune.";
3293 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3296 /* Attempt to polymorph (see below) */
3299 /* Powerful monsters can resist */
3300 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3301 (r_ptr->flags1 & RF1_QUESTOR) ||
3302 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3305 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3307 note = " is unaffected!";
3314 /* No "real" damage */
3321 /* Clone monsters (Ignore "dam") */
3324 if (seen) obvious = TRUE;
3326 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
3329 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3331 note = " is unaffected!";
3337 m_ptr->hp = m_ptr->maxhp;
3339 /* Attempt to clone. */
3340 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3343 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3351 /* No "real" damage */
3358 /* Heal Monster (use "dam" as amount of healing) */
3361 if (seen) obvious = TRUE;
3366 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3368 if (m_ptr->maxhp < m_ptr->max_maxhp)
3371 msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3373 msg_format("%^s recovers %s vitality.", m_name, m_poss);
3375 m_ptr->maxhp = m_ptr->max_maxhp;
3381 if (seen) obvious = TRUE;
3386 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3391 msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3393 msg_format("%^s is no longer stunned.", m_name);
3397 if (m_ptr->confused)
3400 msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3402 msg_format("%^s is no longer confused.", m_name);
3404 m_ptr->confused = 0;
3409 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3411 msg_format("%^s recovers %s courage.", m_name, m_poss);
3417 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3420 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3422 chg_virtue(V_VITALITY, 1);
3424 if (r_ptr->flags1 & RF1_UNIQUE)
3425 chg_virtue(V_INDIVIDUALISM, 1);
3427 if (is_friendly(m_ptr))
3428 chg_virtue(V_HONOUR, 1);
3429 else if (!(r_ptr->flags3 & RF3_EVIL))
3431 if (r_ptr->flags3 & RF3_GOOD)
3432 chg_virtue(V_COMPASSION, 2);
3434 chg_virtue(V_COMPASSION, 1);
3437 if (m_ptr->r_idx == MON_LEPER)
3440 chg_virtue(V_COMPASSION, 5);
3443 if (r_ptr->flags3 & RF3_ANIMAL)
3444 chg_virtue(V_NATURE, 1);
3446 /* Redraw (later) if needed */
3447 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3448 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3452 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3454 note = " looks healthier.";
3458 /* No "real" damage */
3464 /* Speed Monster (Ignore "dam") */
3467 if (seen) obvious = TRUE;
3473 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3475 note = " starts moving faster.";
3478 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3480 if (c_ptr->m_idx == p_ptr->riding)
3481 p_ptr->update |= (PU_BONUS);
3483 if (r_ptr->flags1 & RF1_UNIQUE)
3484 chg_virtue(V_INDIVIDUALISM, 1);
3485 if (is_friendly(m_ptr))
3486 chg_virtue(V_HONOUR, 1);
3488 /* No "real" damage */
3494 /* Slow Monster (Use "dam" as "power") */
3497 if (seen) obvious = TRUE;
3499 if (r_ptr->flagsr & RFR_RES_ALL)
3502 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3504 note = " is immune.";
3507 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3510 /* Powerful monsters can resist */
3511 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3512 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3515 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3517 note = " is unaffected!";
3523 /* Normal monsters slow down */
3529 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3531 note = " starts moving slower.";
3534 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3536 if (c_ptr->m_idx == p_ptr->riding)
3537 p_ptr->update |= (PU_BONUS);
3540 /* No "real" damage */
3546 /* Sleep (Use "dam" as "power") */
3549 if (seen) obvious = TRUE;
3551 if (r_ptr->flagsr & RFR_RES_ALL)
3554 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3556 note = " is immune.";
3559 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3562 /* Attempt a saving throw */
3563 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3564 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3565 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3567 /* Memorize a flag */
3568 if (r_ptr->flags3 & RF3_NO_SLEEP)
3570 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3573 /* No obvious effect */
3575 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3577 note = " is unaffected!";
3584 /* Go to sleep (much) later */
3586 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3588 note = " falls asleep!";
3594 /* No "real" damage */
3600 /* Sleep (Use "dam" as "power") */
3601 case GF_STASIS_EVIL:
3603 if (seen) obvious = TRUE;
3605 if (r_ptr->flagsr & RFR_RES_ALL)
3608 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3610 note = " is immune.";
3613 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3616 /* Attempt a saving throw */
3617 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3618 !(r_ptr->flags3 & RF3_EVIL) ||
3619 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3622 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3624 note = " is unaffected!";
3631 /* Go to sleep (much) later */
3633 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3635 note = " is suspended!";
3641 /* No "real" damage */
3646 /* Sleep (Use "dam" as "power") */
3649 if (seen) obvious = TRUE;
3651 if (r_ptr->flagsr & RFR_RES_ALL)
3654 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3656 note = " is immune.";
3659 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3662 /* Attempt a saving throw */
3663 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3664 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3667 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3669 note = " is unaffected!";
3676 /* Go to sleep (much) later */
3678 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3680 note = " is suspended!";
3686 /* No "real" damage */
3695 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3696 vir = virtue_number(V_HARMONY);
3699 dam += p_ptr->virtues[vir-1]/10;
3702 vir = virtue_number(V_INDIVIDUALISM);
3705 dam -= p_ptr->virtues[vir-1]/20;
3708 if (seen) obvious = TRUE;
3710 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3713 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3715 note = " is immune.";
3718 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3722 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3725 /* Attempt a saving throw */
3726 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3727 (r_ptr->flags3 & RF3_NO_CONF) ||
3728 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3729 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3731 /* Memorize a flag */
3732 if (r_ptr->flags3 & RF3_NO_CONF)
3734 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3738 /* No obvious effect */
3740 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3742 note = " is unaffected!";
3747 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3749 else if (p_ptr->cursed & TRC_AGGRAVATE)
3752 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3754 note = " hates you too much!";
3757 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3762 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3764 note = " suddenly seems friendly!";
3769 chg_virtue(V_INDIVIDUALISM, -1);
3770 if (r_ptr->flags3 & RF3_ANIMAL)
3771 chg_virtue(V_NATURE, 1);
3774 /* No "real" damage */
3779 /* Control undead */
3780 case GF_CONTROL_UNDEAD:
3783 if (seen) obvious = TRUE;
3785 vir = virtue_number(V_UNLIFE);
3788 dam += p_ptr->virtues[vir-1]/10;
3791 vir = virtue_number(V_INDIVIDUALISM);
3794 dam -= p_ptr->virtues[vir-1]/20;
3797 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3800 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3802 note = " is immune.";
3805 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3809 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3812 /* Attempt a saving throw */
3813 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3814 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3815 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3816 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3818 /* No obvious effect */
3820 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3822 note = " is unaffected!";
3826 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3828 else if (p_ptr->cursed & TRC_AGGRAVATE)
3831 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3833 note = " hates you too much!";
3836 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3841 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3843 note = " is in your thrall!";
3849 /* No "real" damage */
3855 case GF_CONTROL_DEMON:
3858 if (seen) obvious = TRUE;
3860 vir = virtue_number(V_UNLIFE);
3863 dam += p_ptr->virtues[vir-1]/10;
3866 vir = virtue_number(V_INDIVIDUALISM);
3869 dam -= p_ptr->virtues[vir-1]/20;
3872 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3875 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3877 note = " is immune.";
3880 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3884 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3887 /* Attempt a saving throw */
3888 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3889 (!(r_ptr->flags3 & RF3_DEMON)) ||
3890 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3891 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3893 /* No obvious effect */
3895 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3897 note = " is unaffected!";
3901 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3903 else if (p_ptr->cursed & TRC_AGGRAVATE)
3906 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3908 note = " hates you too much!";
3911 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3916 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3918 note = " is in your thrall!";
3924 /* No "real" damage */
3930 case GF_CONTROL_ANIMAL:
3934 if (seen) obvious = TRUE;
3936 vir = virtue_number(V_NATURE);
3939 dam += p_ptr->virtues[vir-1]/10;
3942 vir = virtue_number(V_INDIVIDUALISM);
3945 dam -= p_ptr->virtues[vir-1]/20;
3948 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3951 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3953 note = " is immune.";
3956 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3960 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3963 /* Attempt a saving throw */
3964 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3965 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
3966 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3967 (r_ptr->flags3 & (RF3_NO_CONF)) ||
3968 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3970 /* Memorize a flag */
3971 if (r_ptr->flags3 & (RF3_NO_CONF))
3973 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3977 /* No obvious effect */
3979 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3981 note = " is unaffected!";
3985 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3987 else if (p_ptr->cursed & TRC_AGGRAVATE)
3990 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3992 note = " hates you too much!";
3995 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4000 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4002 note = " is tamed!";
4007 if (r_ptr->flags3 & RF3_ANIMAL)
4008 chg_virtue(V_NATURE, 1);
4011 /* No "real" damage */
4017 case GF_CONTROL_LIVING:
4021 vir = virtue_number(V_UNLIFE);
4022 if (seen) obvious = TRUE;
4024 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4025 vir = virtue_number(V_UNLIFE);
4028 dam -= p_ptr->virtues[vir-1]/10;
4031 vir = virtue_number(V_INDIVIDUALISM);
4034 dam -= p_ptr->virtues[vir-1]/20;
4037 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4038 if (dam < 1) dam = 1;
4040 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4042 msg_format("You stare into %s.", m_name);
4044 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4047 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4049 note = " is immune.";
4052 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4056 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4059 /* Attempt a saving throw */
4060 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4061 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4062 !monster_living(r_ptr) ||
4063 ((r_ptr->level+10) > randint1(dam)))
4066 /* No obvious effect */
4068 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4070 note = " is unaffected!";
4074 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4076 else if (p_ptr->cursed & TRC_AGGRAVATE)
4079 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4081 note = " hates you too much!";
4084 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4089 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4091 note = " is tamed!";
4096 if (r_ptr->flags3 & RF3_ANIMAL)
4097 chg_virtue(V_NATURE, 1);
4100 /* No "real" damage */
4105 /* Confusion (Use "dam" as "power") */
4108 if (seen) obvious = TRUE;
4110 if (r_ptr->flagsr & RFR_RES_ALL)
4113 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4115 note = " is immune.";
4118 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4121 /* Get confused later */
4122 do_conf = damroll(3, (dam / 2)) + 1;
4124 /* Attempt a saving throw */
4125 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4126 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4127 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4129 /* Memorize a flag */
4130 if (r_ptr->flags3 & (RF3_NO_CONF))
4132 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4138 /* No obvious effect */
4140 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4142 note = " is unaffected!";
4148 /* No "real" damage */
4155 if (seen) obvious = TRUE;
4157 if (r_ptr->flagsr & RFR_RES_ALL)
4160 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4162 note = " is immune.";
4165 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4168 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
4170 /* Attempt a saving throw */
4171 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4172 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4177 /* No obvious effect */
4179 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4181 note = " is unaffected!";
4187 /* No "real" damage */
4195 /* Lite, but only hurts susceptible creatures */
4203 if (r_ptr->flagsr & RFR_RES_ALL)
4209 if (r_ptr->flags3 & (RF3_HURT_LITE))
4213 /* Obvious effect */
4216 /* Memorize the effects */
4217 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4220 /* Special effect */
4222 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4223 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4225 note = " cringes from the light!";
4226 note_dies = " shrivels away in the light!";
4231 /* Normally no damage */
4243 /* Lite -- opposite of Dark */
4246 if (seen) obvious = TRUE;
4248 if (r_ptr->flagsr & RFR_RES_ALL)
4251 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4253 note = " is immune.";
4256 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4259 if (r_ptr->flagsr & RFR_RES_LITE)
4262 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4267 dam *= 2; dam /= (randint1(6)+6);
4268 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4270 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4272 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4274 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4275 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4277 note = " cringes from the light!";
4278 note_dies = " shrivels away in the light!";
4287 /* Dark -- opposite of Lite */
4290 if (seen) obvious = TRUE;
4292 if (r_ptr->flagsr & RFR_RES_ALL)
4295 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4297 note = " is immune.";
4300 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4303 if (r_ptr->flagsr & RFR_RES_DARK)
4306 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4311 dam *= 2; dam /= (randint1(6)+6);
4312 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4321 if (r_ptr->flagsr & RFR_RES_ALL)
4326 /* Hurt by rock remover */
4327 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4334 /* Memorize the effects */
4335 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4338 /* Cute little message */
4340 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4341 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4343 note = " loses some skin!";
4344 note_dies = " dissolves!";
4349 /* Usually, ignore the effects */
4360 /* Teleport undead (Use "dam" as "power") */
4361 case GF_AWAY_UNDEAD:
4363 /* Only affect undead */
4364 if (r_ptr->flags3 & (RF3_UNDEAD))
4366 bool resists_tele = FALSE;
4368 if (r_ptr->flagsr & RFR_RES_TELE)
4370 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4372 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4374 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4376 note = " is unaffected!";
4379 resists_tele = TRUE;
4381 else if (r_ptr->level > randint1(100))
4383 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4385 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4390 resists_tele = TRUE;
4399 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4412 /* No "real" damage */
4418 /* Teleport evil (Use "dam" as "power") */
4421 /* Only affect evil */
4422 if (r_ptr->flags3 & (RF3_EVIL))
4424 bool resists_tele = FALSE;
4426 if (r_ptr->flagsr & RFR_RES_TELE)
4428 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4430 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4432 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4434 note = " is unaffected!";
4437 resists_tele = TRUE;
4439 else if (r_ptr->level > randint1(100))
4441 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4443 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4448 resists_tele = TRUE;
4457 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4470 /* No "real" damage */
4476 /* Teleport monster (Use "dam" as "power") */
4479 bool resists_tele = FALSE;
4480 if (r_ptr->flagsr & RFR_RES_TELE)
4482 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4484 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4486 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4488 note = " is unaffected!";
4491 resists_tele = TRUE;
4493 else if (r_ptr->level > randint1(100))
4495 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4497 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4502 resists_tele = TRUE;
4509 if (seen) obvious = TRUE;
4511 /* Prepare to teleport */
4515 /* No "real" damage */
4521 /* Turn undead (Use "dam" as "power") */
4522 case GF_TURN_UNDEAD:
4524 if (r_ptr->flagsr & RFR_RES_ALL)
4529 /* Only affect undead */
4530 if (r_ptr->flags3 & (RF3_UNDEAD))
4534 /* Learn about type */
4535 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4541 /* Apply some fear */
4542 do_fear = damroll(3, (dam / 2)) + 1;
4544 /* Attempt a saving throw */
4545 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4547 /* No obvious effect */
4549 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4551 note = " is unaffected!";
4566 /* No "real" damage */
4572 /* Turn evil (Use "dam" as "power") */
4575 if (r_ptr->flagsr & RFR_RES_ALL)
4580 /* Only affect evil */
4581 if (r_ptr->flags3 & (RF3_EVIL))
4585 /* Learn about type */
4586 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4592 /* Apply some fear */
4593 do_fear = damroll(3, (dam / 2)) + 1;
4595 /* Attempt a saving throw */
4596 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4598 /* No obvious effect */
4600 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4602 note = " is unaffected!";
4617 /* No "real" damage */
4623 /* Turn monster (Use "dam" as "power") */
4626 if (r_ptr->flagsr & RFR_RES_ALL)
4632 if (seen) obvious = TRUE;
4634 /* Apply some fear */
4635 do_fear = damroll(3, (dam / 2)) + 1;
4637 /* Attempt a saving throw */
4638 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4639 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4640 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4642 /* No obvious effect */
4644 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4646 note = " is unaffected!";
4653 /* No "real" damage */
4660 case GF_DISP_UNDEAD:
4662 if (r_ptr->flagsr & RFR_RES_ALL)
4668 /* Only affect undead */
4669 if (r_ptr->flags3 & (RF3_UNDEAD))
4673 /* Learn about type */
4674 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4682 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4683 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4685 note = " shudders.";
4686 note_dies = " dissolves!";
4708 if (r_ptr->flagsr & RFR_RES_ALL)
4714 /* Only affect evil */
4715 if (r_ptr->flags3 & (RF3_EVIL))
4719 /* Learn about type */
4720 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4728 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4729 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4731 note = " shudders.";
4732 note_dies = " dissolves!";
4753 if (r_ptr->flagsr & RFR_RES_ALL)
4759 /* Only affect good */
4760 if (r_ptr->flags3 & (RF3_GOOD))
4764 /* Learn about type */
4765 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4773 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4774 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4776 note = " shudders.";
4777 note_dies = " dissolves!";
4796 case GF_DISP_LIVING:
4798 if (r_ptr->flagsr & RFR_RES_ALL)
4804 /* Only affect non-undead */
4805 if (monster_living(r_ptr))
4808 if (seen) obvious = TRUE;
4812 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4813 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4815 note = " shudders.";
4816 note_dies = " dissolves!";
4837 if (r_ptr->flagsr & RFR_RES_ALL)
4843 /* Only affect demons */
4844 if (r_ptr->flags3 & (RF3_DEMON))
4848 /* Learn about type */
4849 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4857 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4858 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4860 note = " shudders.";
4861 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 (seen && is_original_ap(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 monster_type *caster_ptr = &m_list[who];
4927 /* Heal the monster */
4928 if (caster_ptr->hp < caster_ptr->maxhp)
4931 caster_ptr->hp += 6 * dam;
4932 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
4934 /* Redraw (later) if needed */
4935 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4936 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4938 /* Special message */
4941 /* Get the monster name */
4942 monster_desc(killer, caster_ptr, 0);
4944 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", killer);
4946 msg_format("%^s appears healthier.", killer);
4955 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£", m_name);
4957 msg_format("You draw psychic energy from %s.", m_name);
4960 (void)hp_player(dam);
4966 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
4968 msg_format("%s is unaffected.", m_name);
4978 if (seen) obvious = TRUE;
4981 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
4983 if (!who) msg_format("You gaze intently at %s.", m_name);
4986 if (r_ptr->flagsr & RFR_RES_ALL)
4989 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4991 note = " is immune.";
4994 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4998 /* Attempt a saving throw */
4999 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5000 (r_ptr->flags3 & RF3_NO_CONF) ||
5001 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5003 /* Memorize a flag */
5004 if (r_ptr->flags3 & (RF3_NO_CONF))
5006 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5009 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5011 note = "is unaffected!";
5015 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5017 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5019 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5021 note = " is immune!";
5025 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5027 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5029 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5038 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5039 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5041 note = " is blasted by psionic energy.";
5042 note_dies = " collapses, a mindless husk.";
5045 if (who > 0) do_conf = randint0(4) + 4;
5046 else do_conf = randint0(8) + 8;
5052 case GF_BRAIN_SMASH:
5054 if (seen) obvious = TRUE;
5057 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5059 if (!who) msg_format("You gaze intently at %s.", m_name);
5062 if (r_ptr->flagsr & RFR_RES_ALL)
5065 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5067 note = " is immune.";
5070 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5074 /* Attempt a saving throw */
5075 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5076 (r_ptr->flags3 & RF3_NO_CONF) ||
5077 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5079 /* Memorize a flag */
5080 if (r_ptr->flags3 & (RF3_NO_CONF))
5082 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5085 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5087 note = "is unaffected!";
5091 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5093 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5095 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5097 note = " is immune!";
5101 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5103 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5105 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5114 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5115 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5117 note = " is blasted by psionic energy.";
5118 note_dies = " collapses, a mindless husk.";
5123 do_conf = randint0(4) + 4;
5124 do_stun = randint0(4) + 4;
5128 do_conf = randint0(8) + 8;
5129 do_stun = randint0(8) + 8;
5131 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5132 if (c_ptr->m_idx == p_ptr->riding)
5133 p_ptr->update |= (PU_BONUS);
5141 if (seen) obvious = TRUE;
5144 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5146 if (!who) msg_format("You point at %s and curses.", m_name);
5149 if (r_ptr->flagsr & RFR_RES_ALL)
5152 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5154 note = " is immune.";
5157 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5161 /* Attempt a saving throw */
5162 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5165 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5167 note = "is unaffected!";
5177 if (seen) obvious = TRUE;
5180 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5182 if (!who) msg_format("You point at %s and curses horribly.", m_name);
5185 if (r_ptr->flagsr & RFR_RES_ALL)
5188 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5190 note = " is immune.";
5193 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5197 /* Attempt a saving throw */
5198 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5201 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5203 note = "is unaffected!";
5213 if (seen) obvious = TRUE;
5216 if (!who) msg_format("%s¤ò»Øº¹¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
5218 if (!who) msg_format("You point at %s, incanting terribly!", m_name);
5221 if (r_ptr->flagsr & RFR_RES_ALL)
5224 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5226 note = " is immune.";
5229 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5233 /* Attempt a saving throw */
5234 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5237 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5239 note = "is unaffected!";
5249 if (seen) obvious = TRUE;
5252 if (!who) msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
5254 if (!who) msg_format("You point at %s, screaming the word, 'DIE!'.", m_name);
5257 if (r_ptr->flagsr & RFR_RES_ALL)
5260 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5262 note = " is immune.";
5265 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5269 /* Attempt a saving throw */
5270 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (m_list[who].r_idx != MON_KENSHIROU)))
5273 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5275 note = "is unaffected!";
5285 if (seen) obvious = TRUE;
5287 if (r_ptr->flagsr & RFR_RES_ALL)
5290 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5292 note = " is immune.";
5295 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5299 if (r_ptr->flags1 & RF1_UNIQUE)
5302 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5304 note = "is unaffected!";
5310 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
5311 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
5313 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5315 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5320 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5330 /* Capture monster */
5334 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5335 (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)
5338 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5340 msg_format("%^s is unaffected.", m_name);
5346 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5347 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5348 nokori_hp = m_ptr->maxhp * 3 / 10;
5350 nokori_hp = m_ptr->maxhp * 3 / 20;
5352 if (m_ptr->hp >= nokori_hp)
5355 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5357 msg_format("You need to weaken %s more.", m_name);
5361 else if (m_ptr->hp < randint0(nokori_hp))
5363 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5365 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5367 msg_format("You capture %^s!", m_name);
5369 cap_mon = m_list[c_ptr->m_idx].r_idx;
5370 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5371 cap_hp = m_list[c_ptr->m_idx].hp;
5372 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5373 if (m_list[c_ptr->m_idx].nickname)
5374 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5377 if (c_ptr->m_idx == p_ptr->riding)
5379 if (rakuba(-1, FALSE))
5382 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5384 msg_format("You have fallen from %s.", m_name);
5389 delete_monster_idx(c_ptr->m_idx);
5396 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5398 msg_format("You failed to capture %s.", m_name);
5405 /* Attack (Use "dam" as attack type) */
5408 /* Return this monster's death */
5409 return py_attack(y, x, dam);
5412 /* Sleep (Use "dam" as "power") */
5418 if (seen) obvious = TRUE;
5420 if (r_ptr->flagsr & RFR_RES_ALL)
5423 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5425 note = " is immune.";
5428 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5431 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5434 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5436 note = " is immune!";
5440 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5446 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5448 note = " is immune!";
5455 if (one_in_(5)) effect = 1;
5456 else if (one_in_(4)) effect = 2;
5457 else if (one_in_(3)) effect = 3;
5462 /* Powerful monsters can resist */
5463 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5464 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5467 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5469 note = " is unaffected!";
5475 /* Normal monsters slow down */
5481 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5483 note = " starts moving slower.";
5486 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5488 if (c_ptr->m_idx == p_ptr->riding)
5489 p_ptr->update |= (PU_BONUS);
5493 else if (effect == 2)
5495 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5497 /* Attempt a saving throw */
5498 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5499 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5504 /* No obvious effect */
5506 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5508 note = " is unaffected!";
5515 else if (effect == 3)
5517 /* Attempt a saving throw */
5518 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5519 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5520 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5522 /* Memorize a flag */
5523 if (r_ptr->flags3 & RF3_NO_SLEEP)
5525 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5528 /* No obvious effect */
5530 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5532 note = " is unaffected!";
5539 /* Go to sleep (much) later */
5541 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5543 note = " falls asleep!";
5553 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5555 note = " is immune!";
5559 /* No "real" damage */
5568 if (seen) obvious = TRUE;
5570 if (r_ptr->flagsr & RFR_RES_ALL)
5573 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5575 note = " is immune.";
5578 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5582 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)
5589 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG2_NOGENO))
5596 delete_monster_idx(c_ptr->m_idx);
5598 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5600 msg_format("%^s disappered!",m_name);
5604 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5606 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5610 chg_virtue(V_VITALITY, -1);
5615 p_ptr->redraw |= (PR_HP);
5618 p_ptr->window |= (PW_PLAYER);
5625 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5627 note = "is unaffected!";
5630 if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
5638 if (!who) msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£", m_name);
5640 if (!who) msg_format("You take a photograph of %s.", m_name);
5643 if (r_ptr->flags3 & (RF3_HURT_LITE))
5647 /* Obvious effect */
5650 /* Memorize the effects */
5651 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5654 /* Special effect */
5656 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5657 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5659 note = " cringes from the light!";
5660 note_dies = " shrivels away in the light!";
5665 /* Normally no damage */
5672 photo = m_ptr->r_idx;
5679 case GF_BLOOD_CURSE:
5681 if (seen) obvious = TRUE;
5683 if (r_ptr->flagsr & RFR_RES_ALL)
5686 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5688 note = " is immune.";
5691 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5699 bool success = FALSE;
5700 if (seen) obvious = TRUE;
5702 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5704 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5705 if (dam < 1) dam = 1;
5707 /* No need to tame your pet */
5711 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5713 note = " starts moving faster.";
5716 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5720 /* Attempt a saving throw */
5721 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5722 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5723 (m_ptr->mflag2 & MFLAG2_NOPET) ||
5724 (p_ptr->cursed & TRC_AGGRAVATE) ||
5725 ((r_ptr->level+10) > randint1(dam)))
5728 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5733 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5735 note = " is tamed!";
5739 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5741 /* Learn about type */
5742 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5749 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5751 do_fear = randint1(90)+10;
5755 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5759 /* No "real" damage */
5766 if (seen) obvious = TRUE;
5768 if (r_ptr->flagsr & RFR_RES_ALL)
5771 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5773 note = " is immune.";
5776 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5780 /* Attempt a saving throw */
5781 if (randint0(100 + dam) < (r_ptr->level + 50))
5785 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5787 note = "is unaffected!";
5808 /* Absolutely no effect */
5809 if (skipped) return (FALSE);
5811 /* "Unique" monsters cannot be polymorphed */
5812 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5814 /* Quest monsters cannot be polymorphed */
5815 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5817 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5819 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5820 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
5822 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5827 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5828 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5831 /* Modify the damage */
5833 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5835 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤¡£";
5837 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5840 /* Check for death */
5841 if (dam > m_ptr->hp)
5843 /* Extract method of death */
5847 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5848 else if (do_poly && (randint1(90) > r_ptr->level))
5850 if (polymorph_monster(y, x))
5853 if (seen) obvious = TRUE;
5855 /* Monster polymorphs */
5857 note = "¤¬ÊѿȤ·¤¿¡ª";
5863 /* Turn off the damage */
5866 /* Hack -- Get new monster */
5867 m_ptr = &m_list[c_ptr->m_idx];
5869 /* Hack -- Get new race */
5870 r_ptr = &r_info[m_ptr->r_idx];
5876 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5878 note = " is unaffected!";
5884 /* Handle "teleport" */
5888 if (seen) obvious = TRUE;
5892 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5894 note = " disappears!";
5897 chg_virtue(V_VALOUR, -1);
5900 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who));
5902 /* Hack -- get new location */
5906 /* Hack -- get new grid */
5907 c_ptr = &cave[y][x];
5910 /* Sound and Impact resisters never stun */
5912 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5913 !(r_ptr->flags3 & RF3_NO_STUN))
5916 if (seen) obvious = TRUE;
5922 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5924 note = " is more dazed.";
5927 tmp = m_ptr->stunned + (do_stun / 2);
5932 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5934 note = " is dazed.";
5941 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5947 /* Confusion and Chaos resisters (and sleepers) never confuse */
5949 !(r_ptr->flags3 & RF3_NO_CONF) &&
5950 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
5953 if (seen) obvious = TRUE;
5955 /* Already partially confused */
5956 if (m_ptr->confused)
5959 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5961 note = " looks more confused.";
5964 tmp = m_ptr->confused + (do_conf / 2);
5967 /* Was not confused */
5971 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
5973 note = " looks confused.";
5979 /* Apply confusion */
5980 m_ptr->confused = (tmp < 200) ? tmp : 200;
5989 if (seen) obvious = TRUE;
5991 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
5996 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
5998 note = " seems weakened.";
6000 m_ptr->maxhp -= do_time;
6001 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
6011 tmp = m_ptr->monfear + do_fear;
6014 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6021 if (typ == GF_DRAIN_MANA)
6023 /* Drain mana does nothing */
6026 /* If another monster did the damage, hurt the monster by hand */
6029 /* Redraw (later) if needed */
6030 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6031 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6033 /* Wake the monster up */
6036 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
6038 /* Hurt the monster */
6046 if (is_pet(m_ptr) && !(m_ptr->ml))
6049 /* Give detailed messages if destroyed */
6052 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
6055 msg_format("%^s%s", m_name, note);
6063 monster_gain_exp(who, m_ptr->r_idx);
6065 /* Generate treasure, etc */
6066 monster_death(c_ptr->m_idx, FALSE);
6068 /* Delete the monster */
6069 delete_monster_idx(c_ptr->m_idx);
6074 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6076 msg_print("You feel sad for a moment.");
6082 /* Damaged monster */
6085 /* Give detailed messages if visible or destroyed */
6086 if (note && seen) msg_format("%^s%s", m_name, note);
6088 /* Hack -- Pain message */
6091 message_pain(c_ptr->m_idx, dam);
6098 /* Hack -- handle sleep */
6099 if (do_sleep) m_ptr->csleep = do_sleep;
6103 else if (heal_leper)
6106 msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6108 msg_print("The Mangy looking leper is healed!");
6111 delete_monster_idx(c_ptr->m_idx);
6114 /* If the player did it, give him experience, check fear */
6119 /* Hurt the monster, check for fear and death */
6120 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6125 /* Damaged monster */
6128 /* HACK - anger the monster before showing the sleep message */
6129 if (do_sleep) anger_monster(m_ptr);
6131 /* Give detailed messages if visible or destroyed */
6134 msg_format("%s%s", m_name, note);
6136 msg_format("%^s%s", m_name, note);
6140 /* Hack -- Pain message */
6141 else if (known && (dam || !do_fear))
6143 message_pain(c_ptr->m_idx, dam);
6146 /* Anger monsters */
6147 if (((dam > 0) || get_angry) && !do_sleep)
6148 anger_monster(m_ptr);
6151 if ((fear || do_fear) && (m_ptr->ml))
6158 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6160 msg_format("%^s flees in terror!", m_name);
6165 /* Hack -- handle sleep */
6166 if (do_sleep) m_ptr->csleep = do_sleep;
6170 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6172 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6176 switch (randint1(28))
6182 msg_print("ÃÏÌ̤¬Íɤ줿...");
6184 msg_print("The ground trembles...");
6187 earthquake(ty, tx, 4 + randint0(4));
6188 if (!one_in_(6)) break;
6190 case 3: case 4: case 5: case 6:
6193 int dam = damroll(10, 10);
6195 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6197 msg_print("A portal opens to a plane of raw mana!");
6200 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6201 if (!one_in_(6)) break;
6207 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6209 msg_print("Space warps about you!");
6212 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE);
6213 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6214 if (!one_in_(6)) break;
6216 case 9: case 10: case 11:
6218 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6220 msg_print("You feel a surge of energy!");
6223 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6224 if (!one_in_(6)) break;
6225 case 12: case 13: case 14: case 15: case 16:
6226 aggravate_monsters(0);
6227 if (!one_in_(6)) break;
6229 count += activate_hi_summon(ty, tx, TRUE);
6230 if (!one_in_(6)) break;
6231 case 19: case 20: case 21: case 22:
6233 bool pet = !one_in_(3);
6234 u32b mode = PM_ALLOW_GROUP;
6236 if (pet) mode |= PM_FORCE_PET;
6237 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6239 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6240 if (!one_in_(6)) break;
6242 case 23: case 24: case 25:
6243 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6245 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6247 msg_print("You feel your life draining away...");
6250 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6251 else lose_exp(p_ptr->exp / 16);
6252 if (!one_in_(6)) break;
6253 case 26: case 27: case 28:
6262 (void)do_dec_stat(i);
6271 (void)do_dec_stat(randint0(6));
6280 if (p_ptr->inside_battle)
6282 p_ptr->health_who = c_ptr->m_idx;
6283 p_ptr->redraw |= (PR_HEALTH);
6287 /* XXX XXX XXX Verify this code */
6289 /* Update the monster */
6290 update_mon(c_ptr->m_idx, FALSE);
6292 /* Redraw the monster grid */
6296 /* Update monster recall window */
6297 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6300 p_ptr->window |= (PW_MONSTER);
6303 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6307 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6309 set_target(m_ptr, monster_target_y, monster_target_x);
6312 else if (is_pet(&m_list[who]) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6314 set_target(m_ptr, m_list[who].fy, m_list[who].fx);
6318 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6320 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6321 rakubadam_m = (dam > 200) ? 200 : dam;
6330 /* Get local object */
6333 /* Prepare to make a Blade of Chaos */
6334 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6336 q_ptr->pval = photo;
6338 /* Mark the item as fully known */
6339 q_ptr->ident |= (IDENT_MENTAL);
6341 /* Drop it in the dungeon */
6342 (void)drop_near(q_ptr, -1, py, px);
6350 /* Return "Anything seen?" */
6356 * Helper function for "project()" below.
6358 * Handle a beam/bolt/ball causing damage to the player.
6360 * This routine takes a "source monster" (by index), a "distance", a default
6361 * "damage", and a "damage type". See "project_m()" above.
6363 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6364 * is reduced (see "project_m()" above). This can happen if a monster breathes
6365 * at the player and hits a wall instead.
6367 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6368 * to know if this is actually a ball or a bolt spell
6371 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6372 * we just assume that the effects were obvious, for historical reasons.
6374 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6379 /* Hack -- assume obvious */
6380 bool obvious = TRUE;
6382 /* Player blind-ness */
6383 bool blind = (p_ptr->blind ? TRUE : FALSE);
6385 /* Player needs a "description" (he is blind) */
6388 /* Source monster */
6389 monster_type *m_ptr = NULL;
6391 /* Monster name (for attacks) */
6394 /* Monster name (for damage) */
6397 /* Hack -- messages */
6403 /* Player is not here */
6404 if (!player_bold(y, x)) return (FALSE);
6406 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6412 /* Player cannot hurt himself */
6413 if (!who) return (FALSE);
6414 if (who == p_ptr->riding) return (FALSE);
6416 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6419 int max_attempts = 10;
6422 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6423 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6424 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6426 if (blind) msg_print("Something bounces!");
6427 else msg_print("The attack bounces!");
6431 /* Choose 'new' target */
6434 t_y = m_list[who].fy - 1 + randint1(3);
6435 t_x = m_list[who].fx - 1 + randint1(3);
6438 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
6440 if (max_attempts < 1)
6442 t_y = m_list[who].fy;
6443 t_x = m_list[who].fx;
6446 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6453 /* Limit maximum damage */
6454 if (dam > 1600) dam = 1600;
6456 /* Reduce damage by distance */
6457 dam = (dam + r) / (r + 1);
6460 /* If the player is blind, be more descriptive */
6461 if (blind) fuzzy = TRUE;
6466 /* Get the source monster */
6467 m_ptr = &m_list[who];
6468 /* Extract the monster level */
6469 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6471 /* Get the monster name */
6472 monster_desc(m_name, m_ptr, 0);
6474 /* Get the monster's real name (gotten before polymorph!) */
6475 strcpy(killer, who_name);
6480 strcpy(killer, "æ«");
6482 strcpy(killer, "a trap");
6486 /* Analyze the damage */
6489 /* Standard damage -- hurts inventory too */
6493 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6495 if (fuzzy) msg_print("You are hit by acid!");
6498 get_damage = acid_dam(dam, killer, monspell);
6502 /* Standard damage -- hurts inventory too */
6506 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6508 if (fuzzy) msg_print("You are hit by fire!");
6511 get_damage = fire_dam(dam, killer, monspell);
6515 /* Standard damage -- hurts inventory too */
6519 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6521 if (fuzzy) msg_print("You are hit by cold!");
6524 get_damage = cold_dam(dam, killer, monspell);
6528 /* Standard damage -- hurts inventory too */
6532 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6534 if (fuzzy) msg_print("You are hit by lightning!");
6537 get_damage = elec_dam(dam, killer, monspell);
6541 /* Standard damage -- also poisons player */
6544 bool double_resist = IS_OPPOSE_POIS();
6546 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6548 if (fuzzy) msg_print("You are hit by poison!");
6551 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6552 if (double_resist) dam = (dam + 2) / 3;
6554 if ((!(double_resist || p_ptr->resist_pois)) &&
6555 one_in_(HURT_CHANCE))
6560 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6562 if (!(double_resist || p_ptr->resist_pois))
6564 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6569 /* Standard damage -- also poisons / mutates player */
6572 bool double_resist = IS_OPPOSE_POIS();
6574 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6576 if (fuzzy) msg_print("You are hit by radiation!");
6579 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6580 if (double_resist) dam = (2 * dam + 2) / 5;
6581 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6582 if (!(double_resist || p_ptr->resist_pois))
6584 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6586 if (one_in_(5)) /* 6 */
6589 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6591 msg_print("You undergo a freakish metamorphosis!");
6594 if (one_in_(4)) /* 4 */
6602 inven_damage(set_acid_destroy, 2);
6608 /* Standard damage */
6612 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6614 if (fuzzy) msg_print("You are hit by something!");
6617 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6621 /* Holy Orb -- Player only takes partial damage */
6625 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6627 if (fuzzy) msg_print("You are hit by something!");
6630 if (p_ptr->align > 10)
6632 else if (p_ptr->align < -10)
6634 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6641 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6643 if (fuzzy) msg_print("You are hit by something!");
6646 if (p_ptr->align > 10)
6648 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6652 /* Arrow -- XXX no dodging */
6656 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6658 if (fuzzy) msg_print("You are hit by something sharp!");
6661 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6664 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6666 msg_print("You cut down the arrow!");
6670 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6674 /* Plasma -- XXX No resist */
6678 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6680 if (fuzzy) msg_print("You are hit by something *HOT*!");
6683 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6685 if (!p_ptr->resist_sound)
6687 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6688 (void)set_stun(p_ptr->stun + k);
6691 if (!(p_ptr->resist_fire ||
6693 p_ptr->immune_fire))
6695 inven_damage(set_acid_destroy, 3);
6701 /* Nether -- drain experience */
6705 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6707 if (fuzzy) msg_print("You are hit by nether forces!");
6711 if (p_ptr->resist_neth)
6713 if (!prace_is_(RACE_SPECTRE))
6714 dam *= 6; dam /= (randint1(4) + 7);
6716 else drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
6718 if (prace_is_(RACE_SPECTRE))
6721 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6723 msg_print("You feel invigorated!");
6727 learn_spell(monspell);
6731 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6737 /* Water -- stun/confuse */
6741 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6743 if (fuzzy) msg_print("You are hit by something wet!");
6746 if (!p_ptr->resist_sound)
6748 set_stun(p_ptr->stun + randint1(40));
6750 if (!p_ptr->resist_conf)
6752 set_confused(p_ptr->confused + randint1(5) + 5);
6757 inven_damage(set_cold_destroy, 3);
6760 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6764 /* Chaos -- many effects */
6768 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6770 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6773 if (p_ptr->resist_chaos)
6775 dam *= 6; dam /= (randint1(4) + 7);
6777 if (!p_ptr->resist_conf)
6779 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6781 if (!p_ptr->resist_chaos)
6783 (void)set_image(p_ptr->image + randint1(10));
6787 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6789 msg_print("Your body is twisted by chaos!");
6792 (void)gain_random_mutation(0);
6795 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6797 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
6799 if (!p_ptr->resist_chaos || one_in_(9))
6801 inven_damage(set_elec_destroy, 2);
6802 inven_damage(set_fire_destroy, 2);
6804 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6808 /* Shards -- mostly cutting */
6812 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6814 if (fuzzy) msg_print("You are hit by something sharp!");
6817 if (p_ptr->resist_shard)
6819 dam *= 6; dam /= (randint1(4) + 7);
6823 (void)set_cut(p_ptr->cut + dam);
6826 if (!p_ptr->resist_shard || one_in_(13))
6828 inven_damage(set_cold_destroy, 2);
6831 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6835 /* Sound -- mostly stunning */
6839 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6841 if (fuzzy) msg_print("You are hit by a loud noise!");
6844 if (p_ptr->resist_sound)
6846 dam *= 5; dam /= (randint1(4) + 7);
6850 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6851 (void)set_stun(p_ptr->stun + k);
6854 if (!p_ptr->resist_sound || one_in_(13))
6856 inven_damage(set_cold_destroy, 2);
6859 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6863 /* Pure confusion */
6867 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6869 if (fuzzy) msg_print("You are hit by something puzzling!");
6872 if (p_ptr->resist_conf)
6874 dam *= 5; dam /= (randint1(4) + 7);
6876 if (!p_ptr->resist_conf)
6878 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6880 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6884 /* Disenchantment -- see above */
6888 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6890 if (fuzzy) msg_print("You are hit by something static!");
6893 if (p_ptr->resist_disen)
6895 dam *= 6; dam /= (randint1(4) + 7);
6899 (void)apply_disenchant(0);
6901 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6905 /* Nexus -- see above */
6909 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6911 if (fuzzy) msg_print("You are hit by something strange!");
6914 if (p_ptr->resist_nexus)
6916 dam *= 6; dam /= (randint1(4) + 7);
6922 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6926 /* Force -- mostly stun */
6930 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6932 if (fuzzy) msg_print("You are hit by kinetic force!");
6935 if (!p_ptr->resist_sound)
6937 (void)set_stun(p_ptr->stun + randint1(20));
6939 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6944 /* Rocket -- stun, cut */
6948 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
6950 if (fuzzy) msg_print("There is an explosion!");
6953 if (!p_ptr->resist_sound)
6955 (void)set_stun(p_ptr->stun + randint1(20));
6957 if (p_ptr->resist_shard)
6963 (void)set_cut(p_ptr-> cut + ( dam / 2));
6966 if ((!p_ptr->resist_shard) || one_in_(12))
6968 inven_damage(set_cold_destroy, 3);
6971 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6975 /* Inertia -- slowness */
6979 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6981 if (fuzzy) msg_print("You are hit by something slow!");
6984 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
6985 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6989 /* Lite -- blinding */
6993 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6995 if (fuzzy) msg_print("You are hit by something!");
6998 if (p_ptr->resist_lite)
7000 dam *= 4; dam /= (randint1(4) + 7);
7002 else if (!blind && !p_ptr->resist_blind)
7004 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7006 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
7009 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
7011 msg_print("The light scorches your flesh!");
7016 else if (prace_is_(RACE_S_FAIRY))
7020 if (p_ptr->wraith_form) dam *= 2;
7021 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7023 if (p_ptr->wraith_form)
7025 p_ptr->wraith_form = 0;
7027 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7029 msg_print("The light forces you out of your incorporeal shadow form.");
7032 p_ptr->redraw |= PR_MAP;
7033 /* Update monsters */
7034 p_ptr->update |= (PU_MONSTERS);
7036 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7038 /* Redraw status bar */
7039 p_ptr->redraw |= (PR_STATUS);
7046 /* Dark -- blinding */
7050 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7052 if (fuzzy) msg_print("You are hit by something!");
7055 if (p_ptr->resist_dark)
7057 dam *= 4; dam /= (randint1(4) + 7);
7059 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7061 else if (!blind && !p_ptr->resist_blind)
7063 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7065 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7069 /* Time -- bolt fewer effects XXX */
7073 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7075 if (fuzzy) msg_print("You are hit by a blast from the past!");
7078 if (p_ptr->resist_time)
7081 dam /= (randint1(4) + 7);
7083 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7085 msg_print("You feel as if time is passing you by.");
7091 switch (randint1(10))
7093 case 1: case 2: case 3: case 4: case 5:
7095 if (p_ptr->prace == RACE_ANDROID) break;
7097 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7099 msg_print("You feel life has clocked back.");
7102 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7106 case 6: case 7: case 8: case 9:
7108 switch (randint1(6))
7111 case 1: k = A_STR; act = "¶¯¤¯"; break;
7112 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7113 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7114 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7115 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7116 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7118 case 1: k = A_STR; act = "strong"; break;
7119 case 2: k = A_INT; act = "bright"; break;
7120 case 3: k = A_WIS; act = "wise"; break;
7121 case 4: k = A_DEX; act = "agile"; break;
7122 case 5: k = A_CON; act = "hale"; break;
7123 case 6: k = A_CHR; act = "beautiful"; break;
7129 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7131 msg_format("You're not as %s as you used to be...", act);
7135 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7136 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7137 p_ptr->update |= (PU_BONUS);
7144 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7146 msg_print("You're not as powerful as you used to be...");
7150 for (k = 0; k < 6; k++)
7152 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7153 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7155 p_ptr->update |= (PU_BONUS);
7161 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7165 /* Gravity -- stun plus slowness plus teleport */
7169 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7170 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7172 if (fuzzy) msg_print("You are hit by something heavy!");
7173 msg_print("Gravity warps around you.");
7178 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7179 if (!(p_ptr->resist_sound || p_ptr->ffall))
7181 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7182 (void)set_stun(p_ptr->stun + k);
7186 dam = (dam * 2) / 3;
7189 if (!p_ptr->ffall || one_in_(13))
7191 inven_damage(set_cold_destroy, 2);
7194 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7198 /* Standard damage */
7199 case GF_DISINTEGRATE:
7202 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7204 if (fuzzy) msg_print("You are hit by pure energy!");
7207 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7214 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7216 if (fuzzy) msg_print("You are hit by something invigorating!");
7219 (void)hp_player(dam);
7227 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7229 if (fuzzy) msg_print("You are hit by something!");
7232 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7240 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7242 if (fuzzy) msg_print("You are hit by something slow!");
7245 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7251 if (p_ptr->free_act) break;
7253 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7255 if (fuzzy) msg_print("You fall asleep!");
7259 if (ironman_nightmare)
7262 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7264 msg_print("A horrible vision enters your mind.");
7268 /* Pick a nightmare */
7269 get_mon_num_prep(get_nightmare, NULL);
7271 /* Have some nightmares */
7272 have_nightmare(get_mon_num(MAX_DEPTH));
7274 /* Remove the monster restriction */
7275 get_mon_num_prep(NULL, NULL);
7278 set_paralyzed(p_ptr->paralyzed + dam);
7289 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7291 if (fuzzy) msg_print("You are hit by an aura of magic!");
7294 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7302 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7304 if (fuzzy) msg_print("You are hit by an energy!");
7307 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7315 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7317 if (fuzzy) msg_print("Something falls from the sky on you!");
7320 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7321 if (!p_ptr->resist_shard || one_in_(13))
7323 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7324 inven_damage(set_cold_destroy, 2);
7330 /* Ice -- cold plus stun plus cuts */
7334 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7336 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7339 cold_dam(dam, killer, monspell);
7340 if (!p_ptr->resist_shard)
7342 (void)set_cut(p_ptr->cut + damroll(5, 8));
7344 if (!p_ptr->resist_sound)
7346 (void)set_stun(p_ptr->stun + randint1(15));
7349 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
7351 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7361 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7363 if (fuzzy) msg_print("You are hit by something extremely cold!");
7367 if (p_ptr->mimic_form)
7369 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7370 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7375 switch (p_ptr->prace)
7377 /* Some races are immune */
7391 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7407 if (who > 0) msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
7408 else msg_print("Àº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
7410 if (who > 0) msg_format("%^s draws psychic energy from you!", m_name);
7411 else msg_print("Your psychic energy is drawn!");
7415 if (dam >= p_ptr->csp)
7419 p_ptr->csp_frac = 0;
7428 learn_spell(monspell);
7431 p_ptr->redraw |= (PR_MANA);
7434 p_ptr->window |= (PW_PLAYER);
7435 p_ptr->window |= (PW_SPELL);
7439 /* Heal the monster */
7440 if (m_ptr->hp < m_ptr->maxhp)
7443 m_ptr->hp += (6 * dam);
7444 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
7446 /* Redraw (later) if needed */
7447 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
7448 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
7450 /* Special message */
7454 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
7456 msg_format("%^s appears healthier.", m_name);
7470 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7473 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7475 msg_print("You resist the effects!");
7477 learn_spell(monspell);
7482 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7484 msg_print("Your mind is blasted by psyonic energy.");
7487 if (!p_ptr->resist_conf)
7489 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7492 if (!p_ptr->resist_chaos && one_in_(3))
7494 (void)set_image(p_ptr->image + randint0(250) + 150);
7501 p_ptr->csp_frac = 0;
7503 p_ptr->redraw |= PR_MANA;
7505 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7511 case GF_BRAIN_SMASH:
7513 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7516 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7518 msg_print("You resist the effects!");
7520 learn_spell(monspell);
7525 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7527 msg_print("Your mind is blasted by psionic energy.");
7534 p_ptr->csp_frac = 0;
7536 p_ptr->redraw |= PR_MANA;
7538 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7539 if (!p_ptr->resist_blind)
7541 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7543 if (!p_ptr->resist_conf)
7545 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7547 if (!p_ptr->free_act)
7549 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7551 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7553 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7554 (void)do_dec_stat(A_INT);
7555 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7556 (void)do_dec_stat(A_WIS);
7558 if (!p_ptr->resist_chaos)
7560 (void)set_image(p_ptr->image + randint0(250) + 150);
7569 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7572 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7574 msg_print("You resist the effects!");
7576 learn_spell(monspell);
7580 curse_equipment(15, 0);
7581 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7589 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7592 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7594 msg_print("You resist the effects!");
7596 learn_spell(monspell);
7600 curse_equipment(25, MIN(rlev/2-15, 5));
7601 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7609 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7612 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7614 msg_print("You resist the effects!");
7616 learn_spell(monspell);
7620 curse_equipment(33, MIN(rlev/2-15, 15));
7621 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7629 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7632 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7634 msg_print("You resist the effects!");
7636 learn_spell(monspell);
7640 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7641 (void)set_cut(p_ptr->cut + damroll(10, 10));
7649 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7652 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7654 msg_format("You resist the effects!");
7656 learn_spell(monspell);
7661 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7663 msg_print("You feel your life fade away!");
7666 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
7667 curse_equipment(40, 20);
7669 if (p_ptr->chp < 1) p_ptr->chp = 1;
7684 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7687 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7689 char m_name_self[80];
7692 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
7694 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7696 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7697 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7700 if (p_ptr->riding && dam > 0)
7702 rakubadam_p = (dam > 200) ? 200 : dam;
7710 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7716 /* Return "Anything seen?" */
7722 * Find the distance from (x, y) to a line.
7724 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7726 /* Vector from (x, y) to (x1, y1) */
7735 int pd = distance(y1, x1, y, x);
7736 int nd = distance(y1, x1, y2, x2);
7738 if (pd > nd) return distance(y, x, y2, x2);
7740 /* Component of P on N */
7741 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7743 /* Absolute value */
7744 return((nd >= 0) ? nd : 0 - nd);
7751 * Modified version of los() for calculation of disintegration balls.
7752 * Disintegration effects are stopped by permanent walls.
7754 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7774 /* Slope, or 1/Slope, of LOS */
7778 /* Extract the offset */
7782 /* Extract the absolute offset */
7787 /* Handle adjacent (or identical) grids */
7788 if ((ax < 2) && (ay < 2)) return (TRUE);
7791 /* Paranoia -- require "safe" origin */
7792 /* if (!in_bounds(y1, x1)) return (FALSE); */
7795 /* Directly South/North */
7798 /* South -- check for walls */
7801 for (ty = y1 + 1; ty < y2; ty++)
7803 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7807 /* North -- check for walls */
7810 for (ty = y1 - 1; ty > y2; ty--)
7812 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7820 /* Directly East/West */
7823 /* East -- check for walls */
7826 for (tx = x1 + 1; tx < x2; tx++)
7828 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7832 /* West -- check for walls */
7835 for (tx = x1 - 1; tx > x2; tx--)
7837 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7846 /* Extract some signs */
7847 sx = (dx < 0) ? -1 : 1;
7848 sy = (dy < 0) ? -1 : 1;
7851 /* Vertical "knights" */
7856 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7860 /* Horizontal "knights" */
7865 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7870 /* Calculate scale factor div 2 */
7873 /* Calculate scale factor */
7877 /* Travel horizontally */
7880 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7886 /* Consider the special case where slope == 1. */
7897 /* Note (below) the case (qy == f2), where */
7898 /* the LOS exactly meets the corner of a tile. */
7901 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7912 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7925 /* Travel vertically */
7928 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7944 /* Note (below) the case (qx == f2), where */
7945 /* the LOS exactly meets the corner of a tile. */
7948 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7959 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7980 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, bool disint_ball)
7985 int brev = rad * rad / dist;
7989 int tdis = distance(y1, x1, y2, x2);
7990 int mdis = tdis + rad;
7992 while (bdis <= mdis)
7996 if ((0 < dist) && (path_n < dist))
7998 int ny = GRID_Y(path_g[path_n]);
7999 int nx = GRID_X(path_g[path_n]);
8000 int nd = distance(ny, nx, y1, x1);
8002 /* Get next base point */
8011 /* Travel from center outward */
8012 for (cdis = 0; cdis <= brad; cdis++)
8014 /* Scan the maximal blast area of radius "cdis" */
8015 for (y = by - cdis; y <= by + cdis; y++)
8017 for (x = bx - cdis; x <= bx + cdis; x++)
8019 /* Ignore "illegal" locations */
8020 if (!in_bounds(y, x)) continue;
8022 /* Enforce a circular "ripple" */
8023 if (distance(y1, x1, y, x) != bdis) continue;
8025 /* Enforce an arc */
8026 if (distance(by, bx, y, x) != cdis) continue;
8031 /* Disintegration are stopped only by perma-walls */
8032 if (!in_disintegration_range(by, bx, y, x)) continue;
8036 /* The blast is stopped by walls */
8037 if (!projectable(by, bx, y, x)) continue;
8040 /* Save this grid */
8048 /* Encode some more "radius" info */
8049 gm[bdis + 1] = *pgrids;
8051 /* Increase the size */
8052 brad = rad * (path_n + brev) / (dist + brev);
8054 /* Find the next ripple */
8058 /* Store the effect size */
8064 * Generic "beam"/"bolt"/"ball" projection routine.
8067 * who: Index of "source" monster (zero for "player")
8068 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8069 * y,x: Target location (or location to travel "towards")
8070 * dam: Base damage roll to apply to affected monsters (or player)
8071 * typ: Type of damage to apply to monsters (and objects)
8072 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8075 * TRUE if any "effects" of the projection were observed, else FALSE
8077 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8078 * towards a given location (optionally passing over the heads of interposing
8079 * monsters), and have it do a given amount of damage to the monsters (and
8080 * optionally objects) within the given radius of the final location.
8082 * A "bolt" travels from source to target and affects only the target grid.
8083 * A "beam" travels from source to target, affecting all grids passed through.
8084 * A "ball" travels from source to the target, exploding at the target, and
8085 * affecting everything within the given radius of the target location.
8087 * Traditionally, a "bolt" does not affect anything on the ground, and does
8088 * not pass over the heads of interposing monsters, much like a traditional
8089 * missile, and will "stop" abruptly at the "target" even if no monster is
8090 * positioned there, while a "ball", on the other hand, passes over the heads
8091 * of monsters between the source and target, and affects everything except
8092 * the source monster which lies within the final radius, while a "beam"
8093 * affects every monster between the source and target, except for the casting
8094 * monster (or player), and rarely affects things on the ground.
8096 * Two special flags allow us to use this function in special ways, the
8097 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8098 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8099 * actually projecting from the source monster (or player).
8101 * The player will only get "experience" for monsters killed by himself
8102 * Unique monsters can only be destroyed by attacks from the player
8104 * Only 256 grids can be affected per projection, limiting the effective
8105 * "radius" of standard ball attacks to nine units (diameter nineteen).
8107 * One can project in a given "direction" by combining PROJECT_THRU with small
8108 * offsets to the initial location (see "line_spell()"), or by calculating
8109 * "virtual targets" far away from the player.
8111 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8112 * continuing until it actually hits somethings (useful for "stone to mud").
8114 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8116 * Balls must explode BEFORE hitting walls, or they would affect monsters
8117 * on both sides of a wall. Some bug reports indicate that this is still
8118 * happening in 2.7.8 for Windows, though it appears to be impossible.
8120 * We "pre-calculate" the blast area only in part for efficiency.
8121 * More importantly, this lets us do "explosions" from the "inside" out.
8122 * This results in a more logical distribution of "blast" treasure.
8123 * It also produces a better (in my opinion) animation of the explosion.
8124 * It could be (but is not) used to have the treasure dropped by monsters
8125 * in the middle of the explosion fall "outwards", and then be damaged by
8126 * the blast as it spreads outwards towards the treasure drop location.
8128 * Walls and doors are included in the blast area, so that they can be
8129 * "burned" or "melted" in later versions.
8131 * This algorithm is intended to maximize simplicity, not necessarily
8132 * efficiency, since this function is not a bottleneck in the code.
8134 * We apply the blast effect from ground zero outwards, in several passes,
8135 * first affecting features, then objects, then monsters, then the player.
8136 * This allows walls to be removed before checking the object or monster
8137 * in the wall, and protects objects which are dropped by monsters killed
8138 * in the blast, and allows the player to see all affects before he is
8139 * killed or teleported away. The semantics of this method are open to
8140 * various interpretations, but they seem to work well in practice.
8142 * We process the blast area from ground-zero outwards to allow for better
8143 * distribution of treasure dropped by monsters, and because it provides a
8144 * pleasing visual effect at low cost.
8146 * Note that the damage done by "ball" explosions decreases with distance.
8147 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8149 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8150 * the target, and then the damage "flows" along this beam of destruction.
8151 * The damage at every grid is the same as at the "center" of a "ball"
8152 * explosion, since the "beam" grids are treated as if they ARE at the
8153 * center of a "ball" explosion.
8155 * Currently, specifying "beam" plus "ball" means that locations which are
8156 * covered by the initial "beam", and also covered by the final "ball", except
8157 * for the final grid (the epicenter of the ball), will be "hit twice", once
8158 * by the initial beam, and once by the exploding ball. For the grid right
8159 * next to the epicenter, this results in 150% damage being done. The center
8160 * does not have this problem, for the same reason the final grid in a "beam"
8161 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8162 * grids which are covered by the "ball" will NOT work, as then they will
8163 * receive LESS damage than they should. Do not combine "beam" with "ball".
8165 * The array "gy[],gx[]" with current size "grids" is used to hold the
8166 * collected locations of all grids in the "blast area" plus "beam path".
8168 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8169 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8170 * first blast grid (see above) with radius "N" from the blast center. Note
8171 * that only the first gm[1] grids in the blast area thus take full damage.
8172 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8173 * number of blast grids.
8175 * Note that once the projection is complete, (y2,x2) holds the final location
8176 * of bolts/beams, and the "epicenter" of balls.
8178 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8179 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8180 * implementation of the "distance" function. Also, a bolt can be properly
8181 * viewed as a "ball" with a "rad" of "zero".
8183 * Note that if no "target" is reached before the beam/bolt/ball travels the
8184 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8185 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8187 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8188 * to move from point A to point B, even if the player cannot see part of the
8189 * projection path. Note that in general, the player will *always* see part
8190 * of the path, since it either starts at the player or ends on the player.
8192 * Hack -- we assume that every "projection" is "self-illuminating".
8194 * Hack -- when only a single monster is affected, we automatically track
8195 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8197 * Note that all projections now "explode" at their final destination, even
8198 * if they were being projected at a more distant destination. This means
8199 * that "ball" spells will *always* explode.
8201 * Note that we must call "handle_stuff()" after affecting terrain features
8202 * in the blast radius, in case the "illumination" of the grid was changed,
8203 * and "update_view()" and "update_monsters()" need to be called.
8205 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8215 int y_saver, x_saver; /* For reflecting monsters */
8217 int msec = delay_factor * delay_factor * delay_factor;
8219 /* Assume the player sees nothing */
8220 bool notice = FALSE;
8222 /* Assume the player has seen nothing */
8223 bool visual = FALSE;
8225 /* Assume the player has seen no blast grids */
8228 /* Assume to be a normal ball spell */
8229 bool breath = FALSE;
8231 /* Is the player blind? */
8232 bool blind = (p_ptr->blind ? TRUE : FALSE);
8234 bool old_hide = FALSE;
8236 /* Number of grids in the "path" */
8239 /* Actual grids in the "path" */
8242 /* Number of grids in the "blast area" (including the "beam" path) */
8245 /* Coordinates of the affected grids */
8246 byte gx[1024], gy[1024];
8248 /* Encoded "radius" info (see above) */
8251 /* Actual radius encoded in gm[] */
8256 /* Attacker's name (prepared before polymorph)*/
8259 /* Initialize by null string */
8265 /* Default target of monsterspell is player */
8266 monster_target_y=py;
8267 monster_target_x=px;
8269 /* Hack -- Jump to target */
8270 if (flg & (PROJECT_JUMP))
8275 /* Clear the flag */
8276 flg &= ~(PROJECT_JUMP);
8281 /* Start at player */
8288 /* Start at monster */
8291 x1 = m_list[who].fx;
8292 y1 = m_list[who].fy;
8293 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8306 /* Default "destination" */
8311 /* Hack -- verify stuff */
8312 if (flg & (PROJECT_THRU))
8314 if ((x1 == x2) && (y1 == y2))
8316 flg &= ~(PROJECT_THRU);
8320 /* Handle a breath attack */
8325 if (flg & PROJECT_HIDE) old_hide = TRUE;
8326 flg |= PROJECT_HIDE;
8330 /* Hack -- Assume there will be no blast (max radius 32) */
8331 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8339 /* Collect beam grids */
8340 if (flg & (PROJECT_BEAM))
8347 if (typ == GF_DISINTEGRATE)
8349 flg |= (PROJECT_GRID);
8350 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
8353 /* Calculate the projection path */
8355 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8357 /* Hack -- Handle stuff */
8360 /* Giga-Hack SEEKER & SUPER_RAY */
8362 if( typ == GF_SEEKER )
8372 for (i = 0; i < path_n; ++i)
8377 int ny = GRID_Y(path_g[i]);
8378 int nx = GRID_X(path_g[i]);
8389 /* Only do visuals if requested */
8390 if (!blind && !(flg & (PROJECT_HIDE)))
8392 /* Only do visuals if the player can "see" the bolt */
8393 if (panel_contains(y, x) && player_has_los_bold(y, x))
8400 /* Obtain the bolt pict */
8401 p = bolt_pict(oy, ox, y, x, typ);
8403 /* Extract attr/char */
8407 /* Visual effects */
8408 print_rel(c, a, y, x);
8409 move_cursor_relative(y, x);
8410 /*if (fresh_before)*/ Term_fresh();
8411 Term_xtra(TERM_XTRA_DELAY, msec);
8413 /*if (fresh_before)*/ Term_fresh();
8415 /* Display "beam" grids */
8416 if (flg & (PROJECT_BEAM))
8418 /* Obtain the explosion pict */
8419 p = bolt_pict(y, x, y, x, typ);
8421 /* Extract attr/char */
8425 /* Visual effects */
8426 print_rel(c, a, y, x);
8429 /* Hack -- Activate delay */
8433 /* Hack -- delay anyway for consistency */
8436 /* Delay for consistency */
8437 Term_xtra(TERM_XTRA_DELAY, msec);
8440 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8441 if( is_mirror_grid(&cave[y][x]))
8443 /* The target of monsterspell becomes tha mirror(broken) */
8444 monster_target_y=(s16b)y;
8445 monster_target_x=(s16b)x;
8448 next_mirror( &oy,&ox,y,x );
8450 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8451 for( j = last_i; j <=i ; j++ )
8453 y = GRID_Y(path_g[j]);
8454 x = GRID_X(path_g[j]);
8455 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8456 if(!who && (project_m_n==1) && !jump ){
8457 if(cave[project_m_y][project_m_x].m_idx >0 ){
8458 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8460 /* Hack -- auto-recall */
8461 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8463 /* Hack - auto-track */
8464 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8467 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8472 for( i = last_i ; i < path_n ; i++ )
8475 y = GRID_Y(path_g[i]);
8476 x = GRID_X(path_g[i]);
8477 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8479 if(!who && (project_m_n==1) && !jump ){
8480 if(cave[project_m_y][project_m_x].m_idx >0 ){
8481 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8483 /* Hack -- auto-recall */
8484 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8486 /* Hack - auto-track */
8487 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8490 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8494 else if(typ == GF_SUPER_RAY){
8496 int second_step = 0;
8503 for (i = 0; i < path_n; ++i)
8508 int ny = GRID_Y(path_g[i]);
8509 int nx = GRID_X(path_g[i]);
8520 /* Only do visuals if requested */
8521 if (!blind && !(flg & (PROJECT_HIDE)))
8523 /* Only do visuals if the player can "see" the bolt */
8524 if (panel_contains(y, x) && player_has_los_bold(y, x))
8531 /* Obtain the bolt pict */
8532 p = bolt_pict(oy, ox, y, x, typ);
8534 /* Extract attr/char */
8538 /* Visual effects */
8539 print_rel(c, a, y, x);
8540 move_cursor_relative(y, x);
8541 /*if (fresh_before)*/ Term_fresh();
8542 Term_xtra(TERM_XTRA_DELAY, msec);
8544 /*if (fresh_before)*/ Term_fresh();
8546 /* Display "beam" grids */
8547 if (flg & (PROJECT_BEAM))
8549 /* Obtain the explosion pict */
8550 p = bolt_pict(y, x, y, x, typ);
8552 /* Extract attr/char */
8556 /* Visual effects */
8557 print_rel(c, a, y, x);
8560 /* Hack -- Activate delay */
8564 /* Hack -- delay anyway for consistency */
8567 /* Delay for consistency */
8568 Term_xtra(TERM_XTRA_DELAY, msec);
8571 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8572 if (!have_flag(f_flags_bold(y, x), FF_PROJECT))
8574 if( second_step )continue;
8577 if( is_mirror_grid(&cave[y][x]) && !second_step )
8579 /* The target of monsterspell becomes tha mirror(broken) */
8580 monster_target_y=(s16b)y;
8581 monster_target_x=(s16b)x;
8584 for( j = 0; j <=i ; j++ )
8586 y = GRID_Y(path_g[j]);
8587 x = GRID_X(path_g[j]);
8588 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
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-1, x , flg);
8594 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8595 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8596 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8597 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8598 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8599 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8602 for( i = 0; i < path_n ; i++ )
8605 y = GRID_Y(path_g[i]);
8606 x = GRID_X(path_g[i]);
8607 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8608 if(!who && (project_m_n==1) && !jump ){
8609 if(cave[project_m_y][project_m_x].m_idx >0 ){
8610 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8612 /* Hack -- auto-recall */
8613 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8615 /* Hack - auto-track */
8616 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8619 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8624 /* Project along the path */
8625 for (i = 0; i < path_n; ++i)
8630 int ny = GRID_Y(path_g[i]);
8631 int nx = GRID_X(path_g[i]);
8633 if (flg & PROJECT_DISI)
8635 /* Hack -- Balls explode before reaching walls */
8636 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8640 /* Hack -- Balls explode before reaching walls */
8641 if (!have_flag(f_flags_bold(ny, nx), FF_PROJECT) && (rad > 0)) break;
8648 /* Collect beam grids */
8649 if (flg & (PROJECT_BEAM))
8656 /* Only do visuals if requested */
8657 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
8659 /* Only do visuals if the player can "see" the bolt */
8660 if (panel_contains(y, x) && player_has_los_bold(y, x))
8667 /* Obtain the bolt pict */
8668 p = bolt_pict(oy, ox, y, x, typ);
8670 /* Extract attr/char */
8674 /* Visual effects */
8675 print_rel(c, a, y, x);
8676 move_cursor_relative(y, x);
8677 /*if (fresh_before)*/ Term_fresh();
8678 Term_xtra(TERM_XTRA_DELAY, msec);
8680 /*if (fresh_before)*/ Term_fresh();
8682 /* Display "beam" grids */
8683 if (flg & (PROJECT_BEAM))
8685 /* Obtain the explosion pict */
8686 p = bolt_pict(y, x, y, x, typ);
8688 /* Extract attr/char */
8692 /* Visual effects */
8693 print_rel(c, a, y, x);
8696 /* Hack -- Activate delay */
8700 /* Hack -- delay anyway for consistency */
8703 /* Delay for consistency */
8704 Term_xtra(TERM_XTRA_DELAY, msec);
8709 /* Save the "blast epicenter" */
8713 if (breath && (y1 == by) && (x1 == bx))
8719 flg &= ~(PROJECT_HIDE);
8723 /* Start the "explosion" */
8726 /* Hack -- make sure beams get to "explode" */
8734 /* If we found a "target", explode there */
8735 if (dist <= MAX_RANGE)
8737 /* Mega-Hack -- remove the final "beam" grid */
8738 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8741 * Create a conical breath attack
8752 flg &= ~(PROJECT_HIDE);
8754 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, (bool)(typ == GF_DISINTEGRATE));
8758 /* Determine the blast area, work from the inside out */
8759 for (dist = 0; dist <= rad; dist++)
8761 /* Scan the maximal blast area of radius "dist" */
8762 for (y = by - dist; y <= by + dist; y++)
8764 for (x = bx - dist; x <= bx + dist; x++)
8766 /* Ignore "illegal" locations */
8767 if (!in_bounds2(y, x)) continue;
8769 /* Enforce a "circular" explosion */
8770 if (distance(by, bx, y, x) != dist) continue;
8772 if (typ == GF_DISINTEGRATE)
8774 /* Disintegration are stopped only by perma-walls */
8775 if (!in_disintegration_range(by, bx, y, x)) continue;
8779 /* Ball explosions are stopped by walls */
8780 if (!projectable(by, bx, y, x)) continue;
8783 /* Save this grid */
8790 /* Encode some more "radius" info */
8796 /* Speed -- ignore "non-explosions" */
8797 if (!grids) return (FALSE);
8800 /* Display the "blast area" if requested */
8801 if (!blind && !(flg & (PROJECT_HIDE)))
8803 /* Then do the "blast", from inside out */
8804 for (t = 0; t <= gm_rad; t++)
8806 /* Dump everything with this radius */
8807 for (i = gm[t]; i < gm[t+1]; i++)
8809 /* Extract the location */
8813 /* Only do visuals if the player can "see" the blast */
8814 if (panel_contains(y, x) && player_has_los_bold(y, x))
8823 /* Obtain the explosion pict */
8824 p = bolt_pict(y, x, y, x, typ);
8826 /* Extract attr/char */
8830 /* Visual effects -- Display */
8831 print_rel(c, a, y, x);
8835 /* Hack -- center the cursor */
8836 move_cursor_relative(by, bx);
8838 /* Flush each "radius" seperately */
8839 /*if (fresh_before)*/ Term_fresh();
8841 /* Delay (efficiently) */
8842 if (visual || drawn)
8844 Term_xtra(TERM_XTRA_DELAY, msec);
8848 /* Flush the erasing */
8851 /* Erase the explosion drawn above */
8852 for (i = 0; i < grids; i++)
8854 /* Extract the location */
8858 /* Hack -- Erase if needed */
8859 if (panel_contains(y, x) && player_has_los_bold(y, x))
8865 /* Hack -- center the cursor */
8866 move_cursor_relative(by, bx);
8868 /* Flush the explosion */
8869 /*if (fresh_before)*/ Term_fresh();
8874 /* Update stuff if needed */
8875 if (p_ptr->update) update_stuff();
8878 /* Check features */
8879 if (flg & (PROJECT_GRID))
8881 /* Start with "dist" of zero */
8884 /* Scan for features */
8885 for (i = 0; i < grids; i++)
8887 /* Hack -- Notice new "dist" values */
8888 if (gm[dist+1] == i) dist++;
8890 /* Get the grid location */
8894 /* Find the closest point in the blast */
8897 int d = dist_to_line(y, x, y1, x1, by, bx);
8899 /* Affect the grid */
8900 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8904 /* Affect the grid */
8905 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8910 /* Update stuff if needed */
8911 if (p_ptr->update) update_stuff();
8914 if (flg & (PROJECT_ITEM))
8916 /* Start with "dist" of zero */
8919 /* Scan for objects */
8920 for (i = 0; i < grids; i++)
8922 /* Hack -- Notice new "dist" values */
8923 if (gm[dist+1] == i) dist++;
8925 /* Get the grid location */
8929 /* Find the closest point in the blast */
8932 int d = dist_to_line(y, x, y1, x1, by, bx);
8934 /* Affect the object in the grid */
8935 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8939 /* Affect the object in the grid */
8940 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8946 /* Check monsters */
8947 if (flg & (PROJECT_KILL))
8954 /* Start with "dist" of zero */
8957 /* Scan for monsters */
8958 for (i = 0; i < grids; i++)
8962 /* Hack -- Notice new "dist" values */
8963 if (gm[dist + 1] == i) dist++;
8965 /* Get the grid location */
8969 /* A single bolt may be reflected */
8972 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
8973 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
8975 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
8978 int max_attempts = 10;
8980 /* Choose 'new' target */
8983 t_y = y_saver - 1 + randint1(3);
8984 t_x = x_saver - 1 + randint1(3);
8987 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
8989 if (max_attempts < 1)
8998 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
8999 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9000 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9001 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9003 msg_print("The attack bounces!");
9006 if (is_original_ap(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
9009 /* Reflected bolts randomly target either one */
9010 if (one_in_(2)) flg |= PROJECT_PLAYER;
9011 else flg &= ~(PROJECT_PLAYER);
9013 /* The bolt is reflected */
9014 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9016 /* Don't affect the monster any longer */
9022 /* Find the closest point in the blast */
9025 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9029 effective_dist = dist;
9033 /* There is the riding player on this monster */
9034 if (p_ptr->riding && player_bold(y, x))
9036 /* Aimed on the player */
9037 if (flg & PROJECT_PLAYER)
9039 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9042 * A beam or bolt is well aimed
9044 * So don't affects the mount.
9051 * The spell is not well aimed,
9052 * So partly affect the mount too.
9059 * This grid is the original target.
9060 * Or aimed on your horse.
9062 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
9064 /* Hit the mount with full damage */
9068 * Otherwise this grid is not the
9069 * original target, it means that line
9070 * of fire is obstructed by this
9074 * A beam or bolt will hit either
9075 * player or mount. Choose randomly.
9077 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9081 /* Hit the mount with full damage */
9085 /* Hit the player later */
9086 flg |= PROJECT_PLAYER;
9088 /* Don't affect the mount */
9094 * The spell is not well aimed, so
9095 * partly affect both player and
9104 /* Affect the monster in the grid */
9105 if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
9109 /* Player affected one monster (without "jumping") */
9110 if (!who && (project_m_n == 1) && !jump)
9116 /* Track if possible */
9117 if (cave[y][x].m_idx > 0)
9119 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9121 /* Hack -- auto-recall */
9122 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9124 /* Hack - auto-track */
9125 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9132 if (flg & (PROJECT_KILL))
9134 /* Start with "dist" of zero */
9137 /* Scan for player */
9138 for (i = 0; i < grids; i++)
9142 /* Hack -- Notice new "dist" values */
9143 if (gm[dist+1] == i) dist++;
9145 /* Get the grid location */
9149 /* Affect the player? */
9150 if (!player_bold(y, x)) continue;
9152 /* Find the closest point in the blast */
9155 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9159 effective_dist = dist;
9162 /* Target may be your horse */
9165 /* Aimed on the player */
9166 if (flg & PROJECT_PLAYER)
9168 /* Hit the player with full damage */
9172 * Hack -- When this grid was not the
9173 * original target, a beam or bolt
9174 * would hit either player or mount,
9175 * and should be choosen randomly.
9177 * But already choosen to hit the
9178 * mount at this point.
9180 * Or aimed on your horse.
9182 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9185 * A beam or bolt is well aimed
9187 * So don't affects the player.
9194 * The spell is not well aimed,
9195 * So partly affect the player too.
9201 /* Affect the player */
9202 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9210 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9212 if (rakubadam_m > 0)
9214 if (rakuba(rakubadam_m, FALSE))
9217 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9219 msg_format("%^s has thrown you off!", m_name);
9223 if (p_ptr->riding && rakubadam_p > 0)
9225 if(rakuba(rakubadam_p, FALSE))
9228 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9230 msg_format("You have fallen from %s.", m_name);
9236 /* Return "something was noticed" */
9240 bool binding_field( int dam )
9242 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9243 int mirror_num=0; /* ¶À¤Î¿ô */
9248 int msec= delay_factor*delay_factor*delay_factor;
9254 /* Default target of monsterspell is player */
9255 monster_target_y=py;
9256 monster_target_x=px;
9258 for( x=0 ; x < cur_wid ; x++ )
9260 for( y=0 ; y < cur_hgt ; y++ )
9262 if( is_mirror_grid(&cave[y][x]) &&
9263 distance(py,px,y,x) <= MAX_RANGE &&
9264 distance(py,px,y,x) != 0 &&
9265 player_has_los_bold(y,x) &&
9266 projectable(py, px, y, x)
9268 mirror_y[mirror_num]=y;
9269 mirror_x[mirror_num]=x;
9275 if( mirror_num < 2 )return FALSE;
9277 point_x[0] = randint0( mirror_num );
9279 point_x[1] = randint0( mirror_num );
9281 while( point_x[0] == point_x[1] );
9283 point_y[0]=mirror_y[point_x[0]];
9284 point_x[0]=mirror_x[point_x[0]];
9285 point_y[1]=mirror_y[point_x[1]];
9286 point_x[1]=mirror_x[point_x[1]];
9290 x=point_x[0]+point_x[1]+point_x[2];
9291 y=point_y[0]+point_y[1]+point_y[2];
9293 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9294 - (point_y[0]*3-y)*(point_x[1]*3-x);
9295 if( centersign == 0 )return FALSE;
9297 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9298 x1 = x1 < point_x[2] ? x1 : point_x[2];
9299 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9300 y1 = y1 < point_y[2] ? y1 : point_y[2];
9302 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9303 x2 = x2 > point_x[2] ? x2 : point_x[2];
9304 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9305 y2 = y2 > point_y[2] ? y2 : point_y[2];
9307 for( y=y1 ; y <=y2 ; y++ ){
9308 for( x=x1 ; x <=x2 ; x++ ){
9309 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9310 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9311 centersign*( (point_x[1]-x)*(point_y[2]-y)
9312 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9313 centersign*( (point_x[2]-x)*(point_y[0]-y)
9314 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9316 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9317 /* Visual effects */
9319 && panel_contains(y,x)){
9320 p = bolt_pict(y,x,y,x, GF_MANA );
9321 print_rel(PICT_C(p), PICT_A(p),y,x);
9322 move_cursor_relative(y, x);
9323 /*if (fresh_before)*/ Term_fresh();
9324 Term_xtra(TERM_XTRA_DELAY, msec);
9330 for( y=y1 ; y <=y2 ; y++ ){
9331 for( x=x1 ; x <=x2 ; x++ ){
9332 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9333 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9334 centersign*( (point_x[1]-x)*(point_y[2]-y)
9335 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9336 centersign*( (point_x[2]-x)*(point_y[0]-y)
9337 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9339 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9340 (void)project_f(0,0,y,x,dam,GF_MANA);
9345 for( y=y1 ; y <=y2 ; y++ ){
9346 for( x=x1 ; x <=x2 ; x++ ){
9347 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9348 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9349 centersign*( (point_x[1]-x)*(point_y[2]-y)
9350 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9351 centersign*( (point_x[2]-x)*(point_y[0]-y)
9352 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9354 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9355 (void)project_o(0,0,y,x,dam,GF_MANA);
9360 for( y=y1 ; y <=y2 ; y++ ){
9361 for( x=x1 ; x <=x2 ; x++ ){
9362 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9363 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9364 centersign*( (point_x[1]-x)*(point_y[2]-y)
9365 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9366 centersign*( (point_x[2]-x)*(point_y[0]-y)
9367 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9369 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9370 (void)project_m(0,0,y,x,dam,GF_MANA,
9371 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9378 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9380 msg_print("The field broke a mirror");
9382 remove_mirror(point_y[0],point_x[0]);
9388 void seal_of_mirror( int dam )
9392 for( x = 0 ; x < cur_wid ; x++ )
9394 for( y = 0 ; y < cur_hgt ; y++ )
9396 if( is_mirror_grid(&cave[y][x]))
9398 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9399 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9401 if( !cave[y][x].m_idx )