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 */
689 case GF_DISINTEGRATE:
711 /* Destroy Traps (and Locks) */
714 /* Reveal secret doors */
715 if (is_hidden_door(c_ptr))
720 /* Check line of sight */
728 if (is_trap(c_ptr->feat))
730 /* Check line of sight */
734 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
736 msg_print("There is a bright flash of light!");
742 /* Destroy the trap */
743 cave_alter_feat(y, x, FF_DISARM);
746 /* Locked doors are unlocked */
747 if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
749 s16b old_feat = c_ptr->feat;
751 /* Unlock the door */
752 cave_alter_feat(y, x, FF_DISARM);
754 /* Check line of sound */
755 if (known && (old_feat != c_ptr->feat))
758 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
767 /* Remove "unsafe" flag if player is not blind */
768 if (!p_ptr->blind && player_has_los_bold(y, x))
770 c_ptr->info &= ~(CAVE_UNSAFE);
781 /* Destroy Doors (and traps) */
784 /* Destroy all doors and traps */
785 if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
787 /* Check line of sight */
792 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
794 msg_print("There is a bright flash of light!");
800 /* Visibility change */
801 if (have_flag(f_ptr->flags, FF_DOOR))
803 /* Update some things */
804 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
807 /* Destroy the feature */
808 cave_alter_feat(y, x, FF_TUNNEL);
811 /* Remove "unsafe" flag if player is not blind */
812 if (!p_ptr->blind && player_has_los_bold(y, x))
814 c_ptr->info &= ~(CAVE_UNSAFE);
825 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
827 if (have_flag(f_ptr->flags, FF_SPIKE))
829 s16b old_mimic = c_ptr->mimic;
830 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
832 cave_alter_feat(y, x, FF_SPIKE);
834 c_ptr->mimic = old_mimic;
842 /* Check line of sight */
843 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
847 msg_format("%s¤Ë²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ³«¤«¤Ê¤¯¤Ê¤Ã¤¿¡£", f_name + mimic_f_ptr->name);
849 msg_format("The %s seems stuck.", f_name + mimic_f_ptr->name);
858 /* Destroy walls (and doors) */
861 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
864 if (known && (c_ptr->info & (CAVE_MARK)))
867 msg_format("%s¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª", f_name + f_info[get_feat_mimic(c_ptr)].name);
869 msg_format("The %s turns into mud!", f_name + f_info[get_feat_mimic(c_ptr)].name);
875 /* Destroy the wall */
876 cave_alter_feat(y, x, FF_HURT_ROCK);
878 /* Update some things */
879 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
888 /* Require a "naked" floor grid */
889 if (!cave_naked_bold(y, x)) break;
891 /* Not on the player */
892 if (player_bold(y, x)) break;
894 /* Create a closed door */
895 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
898 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
900 /* Update some things */
901 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
918 /* Require a "naked" floor grid */
919 if (!cave_naked_bold(y, x)) break;
921 /* Not on the player */
922 if (player_bold(y, x)) break;
924 /* Create a closed door */
925 cave_set_feat(y, x, FEAT_TREES);
928 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
930 /* Update some things */
931 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
938 /* Require a "naked" floor grid */
939 if (!cave_naked_bold(y, x)) break;
942 c_ptr->info |= CAVE_OBJECT;
943 c_ptr->mimic = FEAT_GLYPH;
956 /* Require a "naked" floor grid */
957 if (!cave_naked_bold(y, x)) break;
959 /* Not on the player */
960 if (player_bold(y, x)) break;
963 cave_set_feat(y, x, FEAT_WALL);
965 /* Update some things */
966 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
977 /* Ignore permanent grid */
978 if (cave_perma_bold(y, x)) break;
980 /* Ignore grid without enough space */
981 if (!have_flag(f_flags_bold(y, x), FF_FLOOR)) break;
983 /* Place a shallow lava */
984 cave_set_feat(y, x, FEAT_SHAL_LAVA);
989 /* Ignore permanent grid */
990 if (cave_perma_bold(y, x)) break;
992 /* Place a deep lava */
993 cave_set_feat(y, x, FEAT_DEEP_LAVA);
1003 /* Ignore permanent grid */
1004 if (cave_perma_bold(y, x)) break;
1006 /* Ignore grid without enough space */
1007 if (!have_flag(f_flags_bold(y, x), FF_FLOOR)) break;
1009 /* Place a shallow lava */
1010 cave_set_feat(y, x, FEAT_SHAL_WATER);
1015 /* Ignore permanent grid */
1016 if (cave_perma_bold(y, x)) break;
1018 /* Place a deep lava */
1019 cave_set_feat(y, x, FEAT_DEEP_WATER);
1024 /* Lite up the grid */
1028 /* Turn on the light */
1029 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) c_ptr->info |= (CAVE_GLOW);
1038 if (player_can_see_bold(y, x)) obvious = TRUE;
1040 /* Mega-Hack -- Update the monster in the affected grid */
1041 /* This allows "spear of light" (etc) to work "correctly" */
1042 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1047 /* Darken the grid */
1051 if (!p_ptr->inside_battle)
1054 if (player_can_see_bold(y, x)) obvious = TRUE;
1056 /* Turn off the light. */
1057 if (!is_mirror_grid(c_ptr))
1059 c_ptr->info &= ~(CAVE_GLOW);
1061 /* Hack -- Forget "boring" grids */
1062 if (!have_flag(f_ptr->flags, FF_REMEMBER))
1065 c_ptr->info &= ~(CAVE_MARK);
1075 /* Mega-Hack -- Update the monster in the affected grid */
1076 /* This allows "spear of light" (etc) to work "correctly" */
1077 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1086 if (is_mirror_grid(c_ptr))
1089 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1091 msg_print("The mirror was crashed!");
1093 remove_mirror(y, x);
1094 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1100 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
1103 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1105 msg_print("The mirror was crashed!");
1107 remove_mirror(y, x);
1108 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1115 /* Return "Anything seen?" */
1122 * We are called from "project()" to "damage" objects
1124 * We are called both for "beam" effects and "ball" effects.
1126 * Perhaps we should only SOMETIMES damage things on the ground.
1128 * The "r" parameter is the "distance from ground zero".
1130 * Note that we determine if the player can "see" anything that happens
1131 * by taking into account: blindness, line-of-sight, and illumination.
1133 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1135 * We return "TRUE" if the effect of the projection is "obvious".
1137 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1139 cave_type *c_ptr = &cave[y][x];
1141 s16b this_o_idx, next_o_idx = 0;
1143 bool obvious = FALSE;
1144 bool known = player_has_los_bold(y, x);
1146 u32b flgs[TR_FLAG_SIZE];
1148 char o_name[MAX_NLEN];
1151 bool is_potion = FALSE;
1155 who = who ? who : 0;
1157 /* Reduce damage by distance */
1158 dam = (dam + r) / (r + 1);
1161 /* Scan all objects in the grid */
1162 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1164 /* Acquire object */
1165 object_type *o_ptr = &o_list[this_o_idx];
1167 bool is_art = FALSE;
1168 bool ignore = FALSE;
1169 bool do_kill = FALSE;
1171 cptr note_kill = NULL;
1174 /* Get the "plural"-ness */
1175 bool plural = (o_ptr->number > 1);
1178 /* Acquire next object */
1179 next_o_idx = o_ptr->next_o_idx;
1181 /* Extract the flags */
1182 object_flags(o_ptr, flgs);
1184 /* Check for artifact */
1185 if ((artifact_p(o_ptr) || o_ptr->art_name)) is_art = TRUE;
1187 /* Analyze the type */
1190 /* Acid -- Lots of things */
1193 if (hates_acid(o_ptr))
1197 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1199 note_kill = (plural ? " melt!" : " melts!");
1202 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1207 /* Elec -- Rings and Wands */
1210 if (hates_elec(o_ptr))
1214 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1216 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1219 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1224 /* Fire -- Flammable objects */
1227 if (hates_fire(o_ptr))
1231 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1233 note_kill = (plural ? " burn up!" : " burns up!");
1236 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1241 /* Cold -- potions and flasks */
1244 if (hates_cold(o_ptr))
1247 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1249 note_kill = (plural ? " shatter!" : " shatters!");
1253 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1261 if (hates_fire(o_ptr))
1265 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1267 note_kill = (plural ? " burn up!" : " burns up!");
1270 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1272 if (hates_elec(o_ptr))
1277 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1279 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1282 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1290 if (hates_fire(o_ptr))
1294 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1296 note_kill = (plural ? " burn up!" : " burns up!");
1299 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1301 if (hates_cold(o_ptr))
1306 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1308 note_kill = (plural ? " shatter!" : " shatters!");
1311 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1316 /* Hack -- break potions and such */
1322 if (hates_cold(o_ptr))
1325 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1327 note_kill = (plural ? " shatter!" : " shatters!");
1335 /* Mana and Chaos -- destroy everything */
1342 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1344 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1350 case GF_DISINTEGRATE:
1354 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1356 note_kill = (plural ? " evaporate!" : " evaporates!");
1366 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1368 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1371 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1372 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1376 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1380 if (cursed_p(o_ptr))
1384 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1386 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1395 identify_item(o_ptr);
1397 /* Auto-inscription */
1398 autopick_alter_item((-this_o_idx), FALSE);
1406 /* Chests are noticed only if trapped or locked */
1407 if (o_ptr->tval == TV_CHEST)
1409 /* Disarm/Unlock traps */
1410 if (o_ptr->pval > 0)
1412 /* Disarm or Unlock */
1413 o_ptr->pval = (0 - o_ptr->pval);
1416 object_known(o_ptr);
1419 if (known && o_ptr->marked)
1422 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1424 msg_print("Click!");
1436 if (o_ptr->tval == TV_CORPSE)
1441 if (!who || is_pet(&m_list[who]))
1442 mode |= PM_FORCE_PET;
1444 for (i = 0; i < o_ptr->number ; i++)
1446 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1447 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1452 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1454 note_kill = (plural ? " become dust." : " becomes dust.");
1459 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1462 note_kill = "À¸¤Ê֤ä¿¡£";
1464 note_kill = "rivived.";
1467 else if (!note_kill)
1470 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1472 note_kill = (plural ? " become dust." : " becomes dust.");
1484 /* Attempt to destroy the object */
1487 /* Effect "observed" */
1488 if (known && o_ptr->marked)
1491 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1494 /* Artifacts, and other objects, get to resist */
1495 if (is_art || ignore)
1497 /* Observe the resist */
1498 if (known && o_ptr->marked)
1501 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1504 msg_format("The %s %s unaffected!",
1505 o_name, (plural ? "are" : "is"));
1514 /* Describe if needed */
1515 if (known && o_ptr->marked && note_kill)
1518 msg_format("%s¤Ï%s", o_name, note_kill);
1520 msg_format("The %s%s", o_name, note_kill);
1525 k_idx = o_ptr->k_idx;
1526 is_potion = object_is_potion(o_ptr);
1529 /* Delete the object */
1530 delete_object_idx(this_o_idx);
1532 /* Potions produce effects when 'shattered' */
1535 (void)potion_smash_effect(who, y, x, k_idx);
1544 /* Return "Anything seen?" */
1550 * Helper function for "project()" below.
1552 * Handle a beam/bolt/ball causing damage to a monster.
1554 * This routine takes a "source monster" (by index) which is mostly used to
1555 * determine if the player is causing the damage, and a "radius" (see below),
1556 * which is used to decrease the power of explosions with distance, and a
1557 * location, via integers which are modified by certain types of attacks
1558 * (polymorph and teleport being the obvious ones), a default damage, which
1559 * is modified as needed based on various properties, and finally a "damage
1560 * type" (see below).
1562 * Note that this routine can handle "no damage" attacks (like teleport) by
1563 * taking a "zero" damage, and can even take "parameters" to attacks (like
1564 * confuse) by accepting a "damage", using it to calculate the effect, and
1565 * then setting the damage to zero. Note that the "damage" parameter is
1566 * divided by the radius, so monsters not at the "epicenter" will not take
1567 * as much damage (or whatever)...
1569 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1570 * may result in a dereference of an invalid pointer. XXX XXX XXX
1572 * Various messages are produced, and damage is applied.
1574 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1575 * actually be "made" of that substance, or "breathe" big balls of it.
1577 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1580 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1581 * and hurts evil less. If can breath nether, then it resists it as well.
1583 * Damage reductions use the following formulas:
1584 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1585 * gives avg damage of .655, ranging from .858 to .500
1586 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1587 * gives avg damage of .544, ranging from .714 to .417
1588 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1589 * gives avg damage of .444, ranging from .556 to .333
1590 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1591 * gives avg damage of .327, ranging from .427 to .250
1592 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1593 * gives something simple.
1595 * In this function, "result" messages are postponed until the end, where
1596 * the "note" string is appended to the monster name, if not NULL. So,
1597 * to make a spell have "no effect" just set "note" to NULL. You should
1598 * also set "notice" to FALSE, or the player will learn what the spell does.
1600 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1602 /* "flg" was added. */
1603 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1607 cave_type *c_ptr = &cave[y][x];
1609 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1611 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1615 /* Is the monster "seen"? */
1616 bool seen = m_ptr->ml;
1618 bool slept = (bool)(m_ptr->csleep > 0);
1620 /* Were the effects "obvious" (if seen)? */
1621 bool obvious = FALSE;
1623 /* Can the player know about this effect? */
1624 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1626 /* Can the player see the source of this effect? */
1627 bool see_s = ((who <= 0) || m_list[who].ml);
1629 /* Were the effects "irrelevant"? */
1630 bool skipped = FALSE;
1632 /* Gets the monster angry at the source of the effect? */
1633 bool get_angry = FALSE;
1635 /* Polymorph setting (true or false) */
1636 bool do_poly = FALSE;
1638 /* Teleport setting (max distance) */
1641 /* Confusion setting (amount to confuse) */
1644 /* Stunning setting (amount to stun) */
1647 /* Sleep amount (amount to sleep) */
1650 /* Fear amount (amount to fear) */
1653 /* Time amount (amount to time) */
1656 bool heal_leper = FALSE;
1658 /* Hold the monster name */
1667 /* Assume no note */
1670 /* Assume a default death */
1671 cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
1676 int caster_lev = (who > 0) ? r_info[m_list[who].r_idx].level : p_ptr->lev * 2;
1679 if (!c_ptr->m_idx) return (FALSE);
1681 /* Never affect projector */
1682 if (who && (c_ptr->m_idx == who)) return (FALSE);
1683 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1684 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1686 /* Don't affect already death monsters */
1687 /* Prevents problems with chain reactions of exploding monsters */
1688 if (m_ptr->hp < 0) return (FALSE);
1690 /* Reduce damage by distance */
1691 dam = (dam + r) / (r + 1);
1694 /* Get the monster name (BEFORE polymorphing) */
1695 monster_desc(m_name, m_ptr, 0);
1698 /* Get the monster possessive ("his"/"her"/"its") */
1699 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1703 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1705 /* Analyze the damage type */
1708 /* Magic Missile -- pure damage */
1711 if (seen) obvious = TRUE;
1713 if (r_ptr->flagsr & RFR_RES_ALL)
1716 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1718 note = " is immune.";
1721 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1730 if (seen) obvious = TRUE;
1732 if (r_ptr->flagsr & RFR_RES_ALL)
1735 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1737 note = " is immune.";
1740 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1743 if (r_ptr->flagsr & RFR_IM_ACID)
1746 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1748 note = " resists a lot.";
1752 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1760 if (seen) obvious = TRUE;
1762 if (r_ptr->flagsr & RFR_RES_ALL)
1765 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1767 note = " is immune.";
1770 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1773 if (r_ptr->flagsr & RFR_IM_ELEC)
1776 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1778 note = " resists a lot.";
1782 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1790 if (seen) obvious = TRUE;
1792 if (r_ptr->flagsr & RFR_RES_ALL)
1795 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1797 note = " is immune.";
1800 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1803 if (r_ptr->flagsr & RFR_IM_FIRE)
1806 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1808 note = " resists a lot.";
1812 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1814 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1817 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1819 note = " is hit hard.";
1823 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1831 if (seen) obvious = TRUE;
1833 if (r_ptr->flagsr & RFR_RES_ALL)
1836 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1838 note = " is immune.";
1841 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1844 if (r_ptr->flagsr & RFR_IM_COLD)
1847 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1849 note = " resists a lot.";
1853 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1855 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1858 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1860 note = " is hit hard.";
1864 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1872 if (seen) obvious = TRUE;
1874 if (r_ptr->flagsr & RFR_RES_ALL)
1877 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1879 note = " is immune.";
1882 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1885 if (r_ptr->flagsr & RFR_IM_POIS)
1888 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1890 note = " resists a lot.";
1894 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1902 if (seen) obvious = TRUE;
1904 if (r_ptr->flagsr & RFR_RES_ALL)
1907 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1909 note = " is immune.";
1912 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1915 if (r_ptr->flagsr & RFR_IM_POIS)
1918 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
1923 dam *= 3; dam /= randint1(6) + 6;
1924 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1926 else if (one_in_(3)) do_poly = TRUE;
1930 /* Hellfire -- hurts Evil */
1933 if (seen) obvious = TRUE;
1935 if (r_ptr->flagsr & RFR_RES_ALL)
1938 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1940 note = " is immune.";
1943 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1946 if (r_ptr->flags3 & RF3_GOOD)
1950 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
1952 note = " is hit hard.";
1955 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1960 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1963 if (seen) obvious = TRUE;
1965 if (r_ptr->flagsr & RFR_RES_ALL)
1968 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1970 note = " is immune.";
1973 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1976 if (r_ptr->flags3 & RF3_GOOD)
1980 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
1982 note = " is immune.";
1985 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
1987 else if (r_ptr->flags3 & RF3_EVIL)
1991 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
1993 note = " is hit hard.";
1996 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
2001 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2006 dam *= 3; dam /= randint1(6) + 6;
2011 /* Arrow -- XXX no defense */
2014 if (seen) obvious = TRUE;
2016 if (r_ptr->flagsr & RFR_RES_ALL)
2019 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2021 note = " is immune.";
2024 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2030 /* Plasma -- XXX perhaps check ELEC or FIRE */
2033 if (seen) obvious = TRUE;
2035 if (r_ptr->flagsr & RFR_RES_ALL)
2038 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2040 note = " is immune.";
2043 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2046 if (r_ptr->flagsr & RFR_RES_PLAS)
2049 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2054 dam *= 3; dam /= randint1(6) + 6;
2055 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
2060 /* Nether -- see above */
2063 if (seen) obvious = TRUE;
2065 if (r_ptr->flagsr & RFR_RES_ALL)
2068 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2070 note = " is immune.";
2073 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2076 if (r_ptr->flagsr & RFR_RES_NETH)
2078 if (r_ptr->flags3 & RF3_UNDEAD)
2081 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2083 note = " is immune.";
2087 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2092 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2097 dam *= 3; dam /= randint1(6) + 6;
2099 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
2101 else if (r_ptr->flags3 & RF3_EVIL)
2105 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2107 note = " resists somewhat.";
2110 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2115 /* Water (acid) damage -- Water spirits/elementals are immune */
2118 if (seen) obvious = TRUE;
2120 if (r_ptr->flagsr & RFR_RES_ALL)
2123 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2125 note = " is immune.";
2128 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2131 if (r_ptr->flagsr & RFR_RES_WATE)
2133 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
2136 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2138 note = " is immune.";
2146 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2151 dam *= 3; dam /= randint1(6) + 6;
2153 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
2158 /* Chaos -- Chaos breathers resist */
2161 if (seen) obvious = TRUE;
2163 if (r_ptr->flagsr & RFR_RES_ALL)
2166 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2168 note = " is immune.";
2171 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2174 if (r_ptr->flagsr & RFR_RES_CHAO)
2177 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2182 dam *= 3; dam /= randint1(6) + 6;
2183 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
2185 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
2188 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2190 note = " resists somewhat.";
2193 dam *= 3; dam /= randint1(6) + 6;
2194 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2199 do_conf = (5 + randint1(11) + r) / (r + 1);
2204 /* Shards -- Shard breathers resist */
2207 if (seen) obvious = TRUE;
2209 if (r_ptr->flagsr & RFR_RES_ALL)
2212 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2214 note = " is immune.";
2217 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2220 if (r_ptr->flagsr & RFR_RES_SHAR)
2223 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2228 dam *= 3; dam /= randint1(6) + 6;
2229 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2234 /* Rocket: Shard resistance helps */
2237 if (seen) obvious = TRUE;
2239 if (r_ptr->flagsr & RFR_RES_ALL)
2242 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2244 note = " is immune.";
2247 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2250 if (r_ptr->flagsr & RFR_RES_SHAR)
2253 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2255 note = " resists somewhat.";
2259 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2265 /* Sound -- Sound breathers resist */
2268 if (seen) obvious = TRUE;
2270 if (r_ptr->flagsr & RFR_RES_ALL)
2273 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2275 note = " is immune.";
2278 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2281 if (r_ptr->flagsr & RFR_RES_SOUN)
2284 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2289 dam *= 2; dam /= randint1(6) + 6;
2290 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
2292 else do_stun = (10 + randint1(15) + r) / (r + 1);
2299 if (seen) obvious = TRUE;
2301 if (r_ptr->flagsr & RFR_RES_ALL)
2304 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2306 note = " is immune.";
2309 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2312 if (r_ptr->flags3 & RF3_NO_CONF)
2315 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2320 dam *= 3; dam /= randint1(6) + 6;
2321 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2323 else do_conf = (10 + randint1(15) + r) / (r + 1);
2327 /* Disenchantment -- Breathers and Disenchanters resist */
2330 if (seen) obvious = TRUE;
2332 if (r_ptr->flagsr & RFR_RES_ALL)
2335 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2337 note = " is immune.";
2340 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2343 if (r_ptr->flagsr & RFR_RES_DISE)
2346 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2351 dam *= 3; dam /= randint1(6) + 6;
2352 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
2357 /* Nexus -- Breathers and Existers resist */
2360 if (seen) obvious = TRUE;
2362 if (r_ptr->flagsr & RFR_RES_ALL)
2365 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2367 note = " is immune.";
2370 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2373 if (r_ptr->flagsr & RFR_RES_NEXU)
2376 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2381 dam *= 3; dam /= randint1(6) + 6;
2382 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
2390 if (seen) obvious = TRUE;
2392 if (r_ptr->flagsr & RFR_RES_ALL)
2395 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2397 note = " is immune.";
2400 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2403 if (r_ptr->flagsr & RFR_RES_WALL)
2406 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2411 dam *= 3; dam /= randint1(6) + 6;
2412 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
2414 else do_stun = (randint1(15) + r) / (r + 1);
2418 /* Inertia -- breathers resist */
2421 if (seen) obvious = TRUE;
2423 if (r_ptr->flagsr & RFR_RES_ALL)
2426 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2428 note = " is immune.";
2431 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2434 if (r_ptr->flagsr & RFR_RES_INER)
2437 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2442 dam *= 3; dam /= randint1(6) + 6;
2443 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
2447 /* Powerful monsters can resist */
2448 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2449 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2453 /* Normal monsters slow down */
2459 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2461 note = " starts moving slower.";
2464 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2465 if (c_ptr->m_idx == p_ptr->riding)
2466 p_ptr->update |= (PU_BONUS);
2472 /* Time -- breathers resist */
2475 if (seen) obvious = TRUE;
2477 if (r_ptr->flagsr & RFR_RES_ALL)
2480 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2482 note = " is immune.";
2485 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2488 if (r_ptr->flagsr & RFR_RES_TIME)
2491 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2496 dam *= 3; dam /= randint1(6) + 6;
2497 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
2499 else do_time = (dam + 1) / 2;
2503 /* Gravity -- breathers resist */
2506 bool resist_tele = FALSE;
2508 if (seen) obvious = TRUE;
2510 if (r_ptr->flagsr & RFR_RES_ALL)
2513 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2515 note = " is immune.";
2518 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2521 if (r_ptr->flagsr & RFR_RES_TELE)
2523 if (r_ptr->flags1 & (RF1_UNIQUE))
2525 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2527 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2529 note = " is unaffected!";
2534 else if (r_ptr->level > randint1(100))
2536 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2538 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2547 if (!resist_tele) do_dist = 10;
2549 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2551 if (r_ptr->flagsr & RFR_RES_GRAV)
2554 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2559 dam *= 3; dam /= randint1(6) + 6;
2561 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
2566 /* Powerful monsters can resist */
2567 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2568 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2572 /* Normal monsters slow down */
2578 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2580 note = " starts moving slower.";
2583 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2584 if (c_ptr->m_idx == p_ptr->riding)
2585 p_ptr->update |= (PU_BONUS);
2589 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2591 /* Attempt a saving throw */
2592 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2593 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2597 /* No obvious effect */
2599 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2601 note = " is unaffected!";
2615 if (seen) obvious = TRUE;
2617 if (r_ptr->flagsr & RFR_RES_ALL)
2620 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2622 note = " is immune.";
2625 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2633 case GF_DISINTEGRATE:
2635 if (seen) obvious = TRUE;
2637 if (r_ptr->flagsr & RFR_RES_ALL)
2640 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2642 note = " is immune.";
2645 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2648 if (r_ptr->flags3 & RF3_HURT_ROCK)
2650 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2652 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2653 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2655 note = " loses some skin!";
2656 note_dies = " evaporates!";
2666 if (seen) obvious = TRUE;
2668 /* PSI only works if the monster can see you! -- RG */
2669 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2672 if (seen) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name);
2674 if (seen) msg_format("%^s can't see you, and isn't affected!", m_name);
2680 if (r_ptr->flagsr & RFR_RES_ALL)
2683 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2685 note = " is immune.";
2688 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2691 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2695 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2697 note = " is immune!";
2699 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2702 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2703 (r_ptr->flags3 & RF3_ANIMAL) ||
2704 (r_ptr->level > randint1(3 * dam)))
2708 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2715 * Powerful demons & undead can turn a mindcrafter's
2716 * attacks back on them
2718 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2719 (r_ptr->level > p_ptr->lev / 2) &&
2724 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2726 msg_format("%^s%s corrupted mind backlashes your attack!",
2727 m_name, (seen ? "'s" : "s"));
2731 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2734 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2736 msg_print("You resist the effects!");
2742 /* Injure +/- confusion */
2743 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2744 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2747 switch (randint1(4))
2750 set_confused(p_ptr->confused + 3 + randint1(dam));
2753 set_stun(p_ptr->stun + randint1(dam));
2757 if (r_ptr->flags3 & RF3_NO_FEAR)
2759 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2761 note = " is unaffected.";
2765 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2769 if (!p_ptr->free_act)
2770 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2779 if ((dam > 0) && one_in_(4))
2781 switch (randint1(4))
2784 do_conf = 3 + randint1(dam);
2787 do_stun = 3 + randint1(dam);
2790 do_fear = 3 + randint1(dam);
2794 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2796 note = " falls asleep!";
2799 do_sleep = 3 + randint1(dam);
2805 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2807 note_dies = " collapses, a mindless husk.";
2815 if (seen) obvious = TRUE;
2817 if (r_ptr->flagsr & RFR_RES_ALL)
2820 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2822 note = " is immune.";
2825 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2828 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2832 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2834 note = " is immune!";
2838 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2839 (r_ptr->flags3 & RF3_ANIMAL) ||
2840 (r_ptr->level > randint1(3 * dam)))
2844 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2851 * Powerful demons & undead can turn a mindcrafter's
2852 * attacks back on them
2854 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2855 (r_ptr->level > p_ptr->lev / 2) &&
2860 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2862 msg_format("%^s%s corrupted mind backlashes your attack!",
2863 m_name, (seen ? "'s" : "s"));
2867 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2870 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2872 msg_print("You resist the effects!");
2878 /* Injure + mana drain */
2879 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2881 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
2883 msg_print("Your psychic energy is drained!");
2886 p_ptr->csp -= damroll(5, dam) / 2;
2887 if (p_ptr->csp < 0) p_ptr->csp = 0;
2888 p_ptr->redraw |= PR_MANA;
2889 p_ptr->window |= (PW_SPELL);
2890 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2897 int b = damroll(5, dam) / 4;
2899 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª", m_name);
2901 msg_format("You convert %s%s pain into psychic energy!",
2902 m_name, (seen ? "'s" : "s"));
2905 b = MIN(p_ptr->msp, p_ptr->csp + b);
2907 p_ptr->redraw |= PR_MANA;
2908 p_ptr->window |= (PW_SPELL);
2912 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2914 note_dies = " collapses, a mindless husk.";
2920 case GF_TELEKINESIS:
2922 if (seen) obvious = TRUE;
2924 if (r_ptr->flagsr & RFR_RES_ALL)
2927 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2929 note = " is immune.";
2932 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2937 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2942 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2944 /* Attempt a saving throw */
2945 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2946 (r_ptr->level > 5 + randint1(dam)))
2950 /* No obvious effect */
2956 /* Psycho-spear -- powerful magic missile */
2959 if (seen) obvious = TRUE;
2961 if (r_ptr->flagsr & RFR_RES_ALL)
2964 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2966 note = " is immune.";
2969 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2975 /* Meteor -- powerful magic missile */
2978 if (seen) obvious = TRUE;
2980 if (r_ptr->flagsr & RFR_RES_ALL)
2983 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2985 note = " is immune.";
2988 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2996 if (!is_hostile(m_ptr)) break;
2998 if (seen) obvious = TRUE;
3000 if (r_ptr->flagsr & RFR_RES_ALL)
3003 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3005 note = " is immune.";
3008 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3011 /* Attempt a saving throw */
3012 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
3013 (r_ptr->flags3 & RF3_NO_CONF) ||
3014 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3016 /* Memorize a flag */
3017 if (r_ptr->flags3 & RF3_NO_CONF)
3019 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3026 * Powerful demons & undead can turn a mindcrafter's
3027 * attacks back on them
3029 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
3030 (r_ptr->level > p_ptr->lev / 2) &&
3035 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
3037 msg_format("%^s%s corrupted mind backlashes your attack!",
3038 m_name, (seen ? "'s" : "s"));
3042 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3045 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3047 msg_print("You resist the effects!");
3053 /* Confuse, stun, terrify */
3054 switch (randint1(4))
3057 set_stun(p_ptr->stun + dam / 2);
3060 set_confused(p_ptr->confused + dam / 2);
3064 if (r_ptr->flags3 & RF3_NO_FEAR)
3066 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3068 note = " is unaffected.";
3072 set_afraid(p_ptr->afraid + dam);
3079 /* No obvious effect */
3081 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3083 note = " is unaffected!";
3091 if ((dam > 29) && (randint1(100) < dam))
3094 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3096 note = " is in your thrall!";
3103 switch (randint1(4))
3117 /* No "real" damage */
3124 /* Ice -- Cold + Cuts + Stun */
3127 if (seen) obvious = TRUE;
3129 if (r_ptr->flagsr & RFR_RES_ALL)
3132 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3134 note = " is immune.";
3137 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3140 do_stun = (randint1(15) + 1) / (r + 1);
3141 if (r_ptr->flagsr & RFR_IM_COLD)
3144 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3146 note = " resists a lot.";
3150 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
3152 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3155 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3157 note = " is hit hard.";
3161 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3170 if (seen) obvious = TRUE;
3172 if (r_ptr->flagsr & RFR_RES_ALL)
3175 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3177 note = " is immune.";
3180 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3183 if (!monster_living(r_ptr))
3187 if (is_original_ap(m_ptr))
3189 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3190 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3191 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3196 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3198 note = " is unaffected!";
3204 else do_time = (dam+7)/8;
3212 if (seen) obvious = TRUE;
3214 if (r_ptr->flagsr & RFR_RES_ALL)
3217 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3219 note = " is immune.";
3222 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3225 if (!monster_living(r_ptr))
3229 if (is_original_ap(m_ptr))
3231 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3232 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3233 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3238 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3240 note = " is immune.";
3246 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3247 (randint1(888) != 666)) ||
3248 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
3249 randint1(100) != 66))
3252 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3264 /* Polymorph monster (Use "dam" as "power") */
3267 if (seen) obvious = TRUE;
3269 if (r_ptr->flagsr & RFR_RES_ALL)
3272 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3274 note = " is immune.";
3277 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3280 /* Attempt to polymorph (see below) */
3283 /* Powerful monsters can resist */
3284 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3285 (r_ptr->flags1 & RF1_QUESTOR) ||
3286 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3289 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3291 note = " is unaffected!";
3298 /* No "real" damage */
3305 /* Clone monsters (Ignore "dam") */
3308 if (seen) obvious = TRUE;
3310 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
3313 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3315 note = " is unaffected!";
3321 m_ptr->hp = m_ptr->maxhp;
3323 /* Attempt to clone. */
3324 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3327 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3335 /* No "real" damage */
3342 /* Heal Monster (use "dam" as amount of healing) */
3345 if (seen) obvious = TRUE;
3350 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3352 if (m_ptr->maxhp < m_ptr->max_maxhp)
3355 msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3357 msg_format("%^s recovers %s vitality.", m_name, m_poss);
3359 m_ptr->maxhp = m_ptr->max_maxhp;
3365 if (seen) obvious = TRUE;
3370 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3375 msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3377 msg_format("%^s is no longer stunned.", m_name);
3381 if (m_ptr->confused)
3384 msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3386 msg_format("%^s is no longer confused.", m_name);
3388 m_ptr->confused = 0;
3393 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3395 msg_format("%^s recovers %s courage.", m_name, m_poss);
3401 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3404 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3406 chg_virtue(V_VITALITY, 1);
3408 if (r_ptr->flags1 & RF1_UNIQUE)
3409 chg_virtue(V_INDIVIDUALISM, 1);
3411 if (is_friendly(m_ptr))
3412 chg_virtue(V_HONOUR, 1);
3413 else if (!(r_ptr->flags3 & RF3_EVIL))
3415 if (r_ptr->flags3 & RF3_GOOD)
3416 chg_virtue(V_COMPASSION, 2);
3418 chg_virtue(V_COMPASSION, 1);
3421 if (m_ptr->r_idx == MON_LEPER)
3424 chg_virtue(V_COMPASSION, 5);
3427 if (r_ptr->flags3 & RF3_ANIMAL)
3428 chg_virtue(V_NATURE, 1);
3430 /* Redraw (later) if needed */
3431 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3432 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3436 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3438 note = " looks healthier.";
3442 /* No "real" damage */
3448 /* Speed Monster (Ignore "dam") */
3451 if (seen) obvious = TRUE;
3457 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3459 note = " starts moving faster.";
3462 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3464 if (c_ptr->m_idx == p_ptr->riding)
3465 p_ptr->update |= (PU_BONUS);
3467 if (r_ptr->flags1 & RF1_UNIQUE)
3468 chg_virtue(V_INDIVIDUALISM, 1);
3469 if (is_friendly(m_ptr))
3470 chg_virtue(V_HONOUR, 1);
3472 /* No "real" damage */
3478 /* Slow Monster (Use "dam" as "power") */
3481 if (seen) obvious = TRUE;
3483 if (r_ptr->flagsr & RFR_RES_ALL)
3486 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3488 note = " is immune.";
3491 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3494 /* Powerful monsters can resist */
3495 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3496 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3499 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3501 note = " is unaffected!";
3507 /* Normal monsters slow down */
3513 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3515 note = " starts moving slower.";
3518 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3520 if (c_ptr->m_idx == p_ptr->riding)
3521 p_ptr->update |= (PU_BONUS);
3524 /* No "real" damage */
3530 /* Sleep (Use "dam" as "power") */
3533 if (seen) obvious = TRUE;
3535 if (r_ptr->flagsr & RFR_RES_ALL)
3538 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3540 note = " is immune.";
3543 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3546 /* Attempt a saving throw */
3547 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3548 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3549 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3551 /* Memorize a flag */
3552 if (r_ptr->flags3 & RF3_NO_SLEEP)
3554 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3557 /* No obvious effect */
3559 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3561 note = " is unaffected!";
3568 /* Go to sleep (much) later */
3570 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3572 note = " falls asleep!";
3578 /* No "real" damage */
3584 /* Sleep (Use "dam" as "power") */
3585 case GF_STASIS_EVIL:
3587 if (seen) obvious = TRUE;
3589 if (r_ptr->flagsr & RFR_RES_ALL)
3592 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3594 note = " is immune.";
3597 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3600 /* Attempt a saving throw */
3601 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3602 !(r_ptr->flags3 & RF3_EVIL) ||
3603 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3606 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3608 note = " is unaffected!";
3615 /* Go to sleep (much) later */
3617 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3619 note = " is suspended!";
3625 /* No "real" damage */
3630 /* Sleep (Use "dam" as "power") */
3633 if (seen) obvious = TRUE;
3635 if (r_ptr->flagsr & RFR_RES_ALL)
3638 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3640 note = " is immune.";
3643 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3646 /* Attempt a saving throw */
3647 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3648 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3651 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3653 note = " is unaffected!";
3660 /* Go to sleep (much) later */
3662 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3664 note = " is suspended!";
3670 /* No "real" damage */
3679 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3680 vir = virtue_number(V_HARMONY);
3683 dam += p_ptr->virtues[vir-1]/10;
3686 vir = virtue_number(V_INDIVIDUALISM);
3689 dam -= p_ptr->virtues[vir-1]/20;
3692 if (seen) obvious = TRUE;
3694 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3697 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3699 note = " is immune.";
3702 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3706 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3709 /* Attempt a saving throw */
3710 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3711 (r_ptr->flags3 & RF3_NO_CONF) ||
3712 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3713 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3715 /* Memorize a flag */
3716 if (r_ptr->flags3 & RF3_NO_CONF)
3718 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3722 /* No obvious effect */
3724 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3726 note = " is unaffected!";
3731 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3733 else if (p_ptr->cursed & TRC_AGGRAVATE)
3736 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3738 note = " hates you too much!";
3741 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3746 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3748 note = " suddenly seems friendly!";
3753 chg_virtue(V_INDIVIDUALISM, -1);
3754 if (r_ptr->flags3 & RF3_ANIMAL)
3755 chg_virtue(V_NATURE, 1);
3758 /* No "real" damage */
3763 /* Control undead */
3764 case GF_CONTROL_UNDEAD:
3767 if (seen) obvious = TRUE;
3769 vir = virtue_number(V_UNLIFE);
3772 dam += p_ptr->virtues[vir-1]/10;
3775 vir = virtue_number(V_INDIVIDUALISM);
3778 dam -= p_ptr->virtues[vir-1]/20;
3781 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3784 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3786 note = " is immune.";
3789 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3793 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3796 /* Attempt a saving throw */
3797 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3798 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3799 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3800 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3802 /* No obvious effect */
3804 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3806 note = " is unaffected!";
3810 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3812 else if (p_ptr->cursed & TRC_AGGRAVATE)
3815 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3817 note = " hates you too much!";
3820 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3825 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3827 note = " is in your thrall!";
3833 /* No "real" damage */
3839 case GF_CONTROL_DEMON:
3842 if (seen) obvious = TRUE;
3844 vir = virtue_number(V_UNLIFE);
3847 dam += p_ptr->virtues[vir-1]/10;
3850 vir = virtue_number(V_INDIVIDUALISM);
3853 dam -= p_ptr->virtues[vir-1]/20;
3856 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3859 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3861 note = " is immune.";
3864 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3868 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3871 /* Attempt a saving throw */
3872 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3873 (!(r_ptr->flags3 & RF3_DEMON)) ||
3874 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3875 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3877 /* No obvious effect */
3879 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3881 note = " is unaffected!";
3885 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3887 else if (p_ptr->cursed & TRC_AGGRAVATE)
3890 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3892 note = " hates you too much!";
3895 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3900 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3902 note = " is in your thrall!";
3908 /* No "real" damage */
3914 case GF_CONTROL_ANIMAL:
3918 if (seen) obvious = TRUE;
3920 vir = virtue_number(V_NATURE);
3923 dam += p_ptr->virtues[vir-1]/10;
3926 vir = virtue_number(V_INDIVIDUALISM);
3929 dam -= p_ptr->virtues[vir-1]/20;
3932 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3935 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3937 note = " is immune.";
3940 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3944 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3947 /* Attempt a saving throw */
3948 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3949 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
3950 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3951 (r_ptr->flags3 & (RF3_NO_CONF)) ||
3952 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3954 /* Memorize a flag */
3955 if (r_ptr->flags3 & (RF3_NO_CONF))
3957 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3961 /* No obvious effect */
3963 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3965 note = " is unaffected!";
3969 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3971 else if (p_ptr->cursed & TRC_AGGRAVATE)
3974 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3976 note = " hates you too much!";
3979 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3984 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
3986 note = " is tamed!";
3991 if (r_ptr->flags3 & RF3_ANIMAL)
3992 chg_virtue(V_NATURE, 1);
3995 /* No "real" damage */
4001 case GF_CONTROL_LIVING:
4005 vir = virtue_number(V_UNLIFE);
4006 if (seen) obvious = TRUE;
4008 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4009 vir = virtue_number(V_UNLIFE);
4012 dam -= p_ptr->virtues[vir-1]/10;
4015 vir = virtue_number(V_INDIVIDUALISM);
4018 dam -= p_ptr->virtues[vir-1]/20;
4021 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4022 if (dam < 1) dam = 1;
4024 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4026 msg_format("You stare into %s.", m_name);
4028 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4031 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4033 note = " is immune.";
4036 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4040 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4043 /* Attempt a saving throw */
4044 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4045 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4046 !monster_living(r_ptr) ||
4047 ((r_ptr->level+10) > randint1(dam)))
4050 /* No obvious effect */
4052 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4054 note = " is unaffected!";
4058 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4060 else if (p_ptr->cursed & TRC_AGGRAVATE)
4063 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4065 note = " hates you too much!";
4068 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4073 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4075 note = " is tamed!";
4080 if (r_ptr->flags3 & RF3_ANIMAL)
4081 chg_virtue(V_NATURE, 1);
4084 /* No "real" damage */
4089 /* Confusion (Use "dam" as "power") */
4092 if (seen) obvious = TRUE;
4094 if (r_ptr->flagsr & RFR_RES_ALL)
4097 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4099 note = " is immune.";
4102 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4105 /* Get confused later */
4106 do_conf = damroll(3, (dam / 2)) + 1;
4108 /* Attempt a saving throw */
4109 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4110 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4111 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4113 /* Memorize a flag */
4114 if (r_ptr->flags3 & (RF3_NO_CONF))
4116 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4122 /* No obvious effect */
4124 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4126 note = " is unaffected!";
4132 /* No "real" damage */
4139 if (seen) obvious = TRUE;
4141 if (r_ptr->flagsr & RFR_RES_ALL)
4144 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4146 note = " is immune.";
4149 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4152 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
4154 /* Attempt a saving throw */
4155 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4156 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4161 /* No obvious effect */
4163 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4165 note = " is unaffected!";
4171 /* No "real" damage */
4179 /* Lite, but only hurts susceptible creatures */
4187 if (r_ptr->flagsr & RFR_RES_ALL)
4193 if (r_ptr->flags3 & (RF3_HURT_LITE))
4197 /* Obvious effect */
4200 /* Memorize the effects */
4201 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4204 /* Special effect */
4206 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4207 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4209 note = " cringes from the light!";
4210 note_dies = " shrivels away in the light!";
4215 /* Normally no damage */
4227 /* Lite -- opposite of Dark */
4230 if (seen) obvious = TRUE;
4232 if (r_ptr->flagsr & RFR_RES_ALL)
4235 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4237 note = " is immune.";
4240 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4243 if (r_ptr->flagsr & RFR_RES_LITE)
4246 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4251 dam *= 2; dam /= (randint1(6)+6);
4252 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4254 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4256 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4258 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4259 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4261 note = " cringes from the light!";
4262 note_dies = " shrivels away in the light!";
4271 /* Dark -- opposite of Lite */
4274 if (seen) obvious = TRUE;
4276 if (r_ptr->flagsr & RFR_RES_ALL)
4279 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4281 note = " is immune.";
4284 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4287 if (r_ptr->flagsr & RFR_RES_DARK)
4290 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4295 dam *= 2; dam /= (randint1(6)+6);
4296 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4305 if (r_ptr->flagsr & RFR_RES_ALL)
4310 /* Hurt by rock remover */
4311 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4318 /* Memorize the effects */
4319 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4322 /* Cute little message */
4324 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4325 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4327 note = " loses some skin!";
4328 note_dies = " dissolves!";
4333 /* Usually, ignore the effects */
4344 /* Teleport undead (Use "dam" as "power") */
4345 case GF_AWAY_UNDEAD:
4347 /* Only affect undead */
4348 if (r_ptr->flags3 & (RF3_UNDEAD))
4350 bool resists_tele = FALSE;
4352 if (r_ptr->flagsr & RFR_RES_TELE)
4354 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4356 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4358 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4360 note = " is unaffected!";
4363 resists_tele = TRUE;
4365 else if (r_ptr->level > randint1(100))
4367 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4369 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4374 resists_tele = TRUE;
4383 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4396 /* No "real" damage */
4402 /* Teleport evil (Use "dam" as "power") */
4405 /* Only affect evil */
4406 if (r_ptr->flags3 & (RF3_EVIL))
4408 bool resists_tele = FALSE;
4410 if (r_ptr->flagsr & RFR_RES_TELE)
4412 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4414 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4416 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4418 note = " is unaffected!";
4421 resists_tele = TRUE;
4423 else if (r_ptr->level > randint1(100))
4425 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4427 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4432 resists_tele = TRUE;
4441 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4454 /* No "real" damage */
4460 /* Teleport monster (Use "dam" as "power") */
4463 bool resists_tele = FALSE;
4464 if (r_ptr->flagsr & RFR_RES_TELE)
4466 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4468 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4470 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4472 note = " is unaffected!";
4475 resists_tele = TRUE;
4477 else if (r_ptr->level > randint1(100))
4479 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4481 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4486 resists_tele = TRUE;
4493 if (seen) obvious = TRUE;
4495 /* Prepare to teleport */
4499 /* No "real" damage */
4505 /* Turn undead (Use "dam" as "power") */
4506 case GF_TURN_UNDEAD:
4508 if (r_ptr->flagsr & RFR_RES_ALL)
4513 /* Only affect undead */
4514 if (r_ptr->flags3 & (RF3_UNDEAD))
4518 /* Learn about type */
4519 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4525 /* Apply some fear */
4526 do_fear = damroll(3, (dam / 2)) + 1;
4528 /* Attempt a saving throw */
4529 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4531 /* No obvious effect */
4533 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4535 note = " is unaffected!";
4550 /* No "real" damage */
4556 /* Turn evil (Use "dam" as "power") */
4559 if (r_ptr->flagsr & RFR_RES_ALL)
4564 /* Only affect evil */
4565 if (r_ptr->flags3 & (RF3_EVIL))
4569 /* Learn about type */
4570 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4576 /* Apply some fear */
4577 do_fear = damroll(3, (dam / 2)) + 1;
4579 /* Attempt a saving throw */
4580 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4582 /* No obvious effect */
4584 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4586 note = " is unaffected!";
4601 /* No "real" damage */
4607 /* Turn monster (Use "dam" as "power") */
4610 if (r_ptr->flagsr & RFR_RES_ALL)
4616 if (seen) obvious = TRUE;
4618 /* Apply some fear */
4619 do_fear = damroll(3, (dam / 2)) + 1;
4621 /* Attempt a saving throw */
4622 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4623 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4624 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4626 /* No obvious effect */
4628 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4630 note = " is unaffected!";
4637 /* No "real" damage */
4644 case GF_DISP_UNDEAD:
4646 if (r_ptr->flagsr & RFR_RES_ALL)
4652 /* Only affect undead */
4653 if (r_ptr->flags3 & (RF3_UNDEAD))
4657 /* Learn about type */
4658 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4666 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4667 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4669 note = " shudders.";
4670 note_dies = " dissolves!";
4692 if (r_ptr->flagsr & RFR_RES_ALL)
4698 /* Only affect evil */
4699 if (r_ptr->flags3 & (RF3_EVIL))
4703 /* Learn about type */
4704 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4712 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4713 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4715 note = " shudders.";
4716 note_dies = " dissolves!";
4737 if (r_ptr->flagsr & RFR_RES_ALL)
4743 /* Only affect good */
4744 if (r_ptr->flags3 & (RF3_GOOD))
4748 /* Learn about type */
4749 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4757 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4758 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4760 note = " shudders.";
4761 note_dies = " dissolves!";
4780 case GF_DISP_LIVING:
4782 if (r_ptr->flagsr & RFR_RES_ALL)
4788 /* Only affect non-undead */
4789 if (monster_living(r_ptr))
4792 if (seen) obvious = TRUE;
4796 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4797 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4799 note = " shudders.";
4800 note_dies = " dissolves!";
4821 if (r_ptr->flagsr & RFR_RES_ALL)
4827 /* Only affect demons */
4828 if (r_ptr->flags3 & (RF3_DEMON))
4832 /* Learn about type */
4833 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4841 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4842 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4844 note = " shudders.";
4845 note_dies = " dissolves!";
4863 /* Dispel monster */
4866 if (r_ptr->flagsr & RFR_RES_ALL)
4873 if (seen) obvious = TRUE;
4877 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4878 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4880 note = " shudders.";
4881 note_dies = " dissolves!";
4891 if (seen) obvious = TRUE;
4893 if (r_ptr->flagsr & RFR_RES_ALL)
4896 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4898 note = " is immune.";
4901 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4905 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4909 monster_type *caster_ptr = &m_list[who];
4911 /* Heal the monster */
4912 if (caster_ptr->hp < caster_ptr->maxhp)
4915 caster_ptr->hp += 6 * dam;
4916 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
4918 /* Redraw (later) if needed */
4919 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4920 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4922 /* Special message */
4925 /* Get the monster name */
4926 monster_desc(killer, caster_ptr, 0);
4928 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", killer);
4930 msg_format("%^s appears healthier.", killer);
4939 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£", m_name);
4941 msg_format("You draw psychic energy from %s.", m_name);
4944 (void)hp_player(dam);
4950 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
4952 msg_format("%s is unaffected.", m_name);
4962 if (seen) obvious = TRUE;
4965 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
4967 if (!who) msg_format("You gaze intently at %s.", m_name);
4970 if (r_ptr->flagsr & RFR_RES_ALL)
4973 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4975 note = " is immune.";
4978 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4982 /* Attempt a saving throw */
4983 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4984 (r_ptr->flags3 & RF3_NO_CONF) ||
4985 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
4987 /* Memorize a flag */
4988 if (r_ptr->flags3 & (RF3_NO_CONF))
4990 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4993 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
4995 note = "is unaffected!";
4999 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5001 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5003 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5005 note = " is immune!";
5009 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5011 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5013 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5022 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5023 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5025 note = " is blasted by psionic energy.";
5026 note_dies = " collapses, a mindless husk.";
5029 if (who > 0) do_conf = randint0(4) + 4;
5030 else do_conf = randint0(8) + 8;
5036 case GF_BRAIN_SMASH:
5038 if (seen) obvious = TRUE;
5041 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5043 if (!who) msg_format("You gaze intently at %s.", m_name);
5046 if (r_ptr->flagsr & RFR_RES_ALL)
5049 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5051 note = " is immune.";
5054 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5058 /* Attempt a saving throw */
5059 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5060 (r_ptr->flags3 & RF3_NO_CONF) ||
5061 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5063 /* Memorize a flag */
5064 if (r_ptr->flags3 & (RF3_NO_CONF))
5066 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5069 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5071 note = "is unaffected!";
5075 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5077 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5079 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5081 note = " is immune!";
5085 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5087 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5089 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5098 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5099 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5101 note = " is blasted by psionic energy.";
5102 note_dies = " collapses, a mindless husk.";
5107 do_conf = randint0(4) + 4;
5108 do_stun = randint0(4) + 4;
5112 do_conf = randint0(8) + 8;
5113 do_stun = randint0(8) + 8;
5115 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5116 if (c_ptr->m_idx == p_ptr->riding)
5117 p_ptr->update |= (PU_BONUS);
5125 if (seen) obvious = TRUE;
5128 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5130 if (!who) msg_format("You point at %s and curses.", m_name);
5133 if (r_ptr->flagsr & RFR_RES_ALL)
5136 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5138 note = " is immune.";
5141 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5145 /* Attempt a saving throw */
5146 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5149 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5151 note = "is unaffected!";
5161 if (seen) obvious = TRUE;
5164 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5166 if (!who) msg_format("You point at %s and curses horribly.", m_name);
5169 if (r_ptr->flagsr & RFR_RES_ALL)
5172 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5174 note = " is immune.";
5177 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5181 /* Attempt a saving throw */
5182 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5185 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5187 note = "is unaffected!";
5197 if (seen) obvious = TRUE;
5200 if (!who) msg_format("%s¤ò»Øº¹¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
5202 if (!who) msg_format("You point at %s, incanting terribly!", m_name);
5205 if (r_ptr->flagsr & RFR_RES_ALL)
5208 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5210 note = " is immune.";
5213 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5217 /* Attempt a saving throw */
5218 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5221 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5223 note = "is unaffected!";
5233 if (seen) obvious = TRUE;
5236 if (!who) msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
5238 if (!who) msg_format("You point at %s, screaming the word, 'DIE!'.", m_name);
5241 if (r_ptr->flagsr & RFR_RES_ALL)
5244 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5246 note = " is immune.";
5249 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5253 /* Attempt a saving throw */
5254 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (m_list[who].r_idx != MON_KENSHIROU)))
5257 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5259 note = "is unaffected!";
5269 if (seen) obvious = TRUE;
5271 if (r_ptr->flagsr & RFR_RES_ALL)
5274 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5276 note = " is immune.";
5279 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5283 if (r_ptr->flags1 & RF1_UNIQUE)
5286 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5288 note = "is unaffected!";
5294 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
5295 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
5297 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5299 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5304 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5314 /* Capture monster */
5318 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5319 (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)
5322 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5324 msg_format("%^s is unaffected.", m_name);
5330 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5331 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5332 nokori_hp = m_ptr->maxhp * 3 / 10;
5334 nokori_hp = m_ptr->maxhp * 3 / 20;
5336 if (m_ptr->hp >= nokori_hp)
5339 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5341 msg_format("You need to weaken %s more.", m_name);
5345 else if (m_ptr->hp < randint0(nokori_hp))
5347 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5349 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5351 msg_format("You capture %^s!", m_name);
5353 cap_mon = m_list[c_ptr->m_idx].r_idx;
5354 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5355 cap_hp = m_list[c_ptr->m_idx].hp;
5356 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5357 if (m_list[c_ptr->m_idx].nickname)
5358 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5361 if (c_ptr->m_idx == p_ptr->riding)
5363 if (rakuba(-1, FALSE))
5366 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5368 msg_format("You have fallen from %s.", m_name);
5373 delete_monster_idx(c_ptr->m_idx);
5380 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5382 msg_format("You failed to capture %s.", m_name);
5389 /* Attack (Use "dam" as attack type) */
5392 /* Return this monster's death */
5393 return py_attack(y, x, dam);
5396 /* Sleep (Use "dam" as "power") */
5402 if (seen) obvious = TRUE;
5404 if (r_ptr->flagsr & RFR_RES_ALL)
5407 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5409 note = " is immune.";
5412 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5415 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5418 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5420 note = " is immune!";
5424 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5430 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5432 note = " is immune!";
5439 if (one_in_(5)) effect = 1;
5440 else if (one_in_(4)) effect = 2;
5441 else if (one_in_(3)) effect = 3;
5446 /* Powerful monsters can resist */
5447 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5448 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5451 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5453 note = " is unaffected!";
5459 /* Normal monsters slow down */
5465 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5467 note = " starts moving slower.";
5470 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5472 if (c_ptr->m_idx == p_ptr->riding)
5473 p_ptr->update |= (PU_BONUS);
5477 else if (effect == 2)
5479 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5481 /* Attempt a saving throw */
5482 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5483 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5488 /* No obvious effect */
5490 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5492 note = " is unaffected!";
5499 else if (effect == 3)
5501 /* Attempt a saving throw */
5502 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5503 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5504 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5506 /* Memorize a flag */
5507 if (r_ptr->flags3 & RF3_NO_SLEEP)
5509 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5512 /* No obvious effect */
5514 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5516 note = " is unaffected!";
5523 /* Go to sleep (much) later */
5525 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5527 note = " falls asleep!";
5537 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5539 note = " is immune!";
5543 /* No "real" damage */
5552 if (seen) obvious = TRUE;
5554 if (r_ptr->flagsr & RFR_RES_ALL)
5557 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5559 note = " is immune.";
5562 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5566 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)
5573 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG2_NOGENO))
5580 delete_monster_idx(c_ptr->m_idx);
5582 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5584 msg_format("%^s disappered!",m_name);
5588 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5590 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5594 chg_virtue(V_VITALITY, -1);
5599 p_ptr->redraw |= (PR_HP);
5602 p_ptr->window |= (PW_PLAYER);
5609 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5611 note = "is unaffected!";
5614 if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
5622 if (!who) msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£", m_name);
5624 if (!who) msg_format("You take a photograph of %s.", m_name);
5627 if (r_ptr->flags3 & (RF3_HURT_LITE))
5631 /* Obvious effect */
5634 /* Memorize the effects */
5635 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5638 /* Special effect */
5640 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5641 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5643 note = " cringes from the light!";
5644 note_dies = " shrivels away in the light!";
5649 /* Normally no damage */
5656 photo = m_ptr->r_idx;
5663 case GF_BLOOD_CURSE:
5665 if (seen) obvious = TRUE;
5667 if (r_ptr->flagsr & RFR_RES_ALL)
5670 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5672 note = " is immune.";
5675 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5683 bool success = FALSE;
5684 if (seen) obvious = TRUE;
5686 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5688 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5689 if (dam < 1) dam = 1;
5691 /* No need to tame your pet */
5695 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5697 note = " starts moving faster.";
5700 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5704 /* Attempt a saving throw */
5705 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5706 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5707 (m_ptr->mflag2 & MFLAG2_NOPET) ||
5708 (p_ptr->cursed & TRC_AGGRAVATE) ||
5709 ((r_ptr->level+10) > randint1(dam)))
5712 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5717 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5719 note = " is tamed!";
5723 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5725 /* Learn about type */
5726 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5733 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5735 do_fear = randint1(90)+10;
5739 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5743 /* No "real" damage */
5750 if (seen) obvious = TRUE;
5752 if (r_ptr->flagsr & RFR_RES_ALL)
5755 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5757 note = " is immune.";
5760 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5764 /* Attempt a saving throw */
5765 if (randint0(100 + dam) < (r_ptr->level + 50))
5769 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5771 note = "is unaffected!";
5792 /* Absolutely no effect */
5793 if (skipped) return (FALSE);
5795 /* "Unique" monsters cannot be polymorphed */
5796 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5798 /* Quest monsters cannot be polymorphed */
5799 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5801 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5803 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5804 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
5806 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5811 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5812 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5815 /* Modify the damage */
5817 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5819 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤¡£";
5821 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5824 /* Check for death */
5825 if (dam > m_ptr->hp)
5827 /* Extract method of death */
5831 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5832 else if (do_poly && (randint1(90) > r_ptr->level))
5834 if (polymorph_monster(y, x))
5837 if (seen) obvious = TRUE;
5839 /* Monster polymorphs */
5841 note = "¤¬ÊѿȤ·¤¿¡ª";
5847 /* Turn off the damage */
5850 /* Hack -- Get new monster */
5851 m_ptr = &m_list[c_ptr->m_idx];
5853 /* Hack -- Get new race */
5854 r_ptr = &r_info[m_ptr->r_idx];
5860 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5862 note = " is unaffected!";
5868 /* Handle "teleport" */
5872 if (seen) obvious = TRUE;
5876 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5878 note = " disappears!";
5881 chg_virtue(V_VALOUR, -1);
5884 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who));
5886 /* Hack -- get new location */
5890 /* Hack -- get new grid */
5891 c_ptr = &cave[y][x];
5894 /* Sound and Impact resisters never stun */
5896 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5897 !(r_ptr->flags3 & RF3_NO_STUN))
5900 if (seen) obvious = TRUE;
5906 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5908 note = " is more dazed.";
5911 tmp = m_ptr->stunned + (do_stun / 2);
5916 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5918 note = " is dazed.";
5925 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5931 /* Confusion and Chaos resisters (and sleepers) never confuse */
5933 !(r_ptr->flags3 & RF3_NO_CONF) &&
5934 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
5937 if (seen) obvious = TRUE;
5939 /* Already partially confused */
5940 if (m_ptr->confused)
5943 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5945 note = " looks more confused.";
5948 tmp = m_ptr->confused + (do_conf / 2);
5951 /* Was not confused */
5955 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
5957 note = " looks confused.";
5963 /* Apply confusion */
5964 m_ptr->confused = (tmp < 200) ? tmp : 200;
5973 if (seen) obvious = TRUE;
5975 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
5980 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
5982 note = " seems weakened.";
5984 m_ptr->maxhp -= do_time;
5985 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
5995 tmp = m_ptr->monfear + do_fear;
5998 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6005 if (typ == GF_DRAIN_MANA)
6007 /* Drain mana does nothing */
6010 /* If another monster did the damage, hurt the monster by hand */
6013 /* Redraw (later) if needed */
6014 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6015 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6017 /* Wake the monster up */
6020 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
6022 /* Hurt the monster */
6030 if (is_pet(m_ptr) && !(m_ptr->ml))
6033 /* Give detailed messages if destroyed */
6036 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
6039 msg_format("%^s%s", m_name, note);
6047 monster_gain_exp(who, m_ptr->r_idx);
6049 /* Generate treasure, etc */
6050 monster_death(c_ptr->m_idx, FALSE);
6052 /* Delete the monster */
6053 delete_monster_idx(c_ptr->m_idx);
6058 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6060 msg_print("You feel sad for a moment.");
6066 /* Damaged monster */
6069 /* Give detailed messages if visible or destroyed */
6070 if (note && seen) msg_format("%^s%s", m_name, note);
6072 /* Hack -- Pain message */
6075 message_pain(c_ptr->m_idx, dam);
6082 /* Hack -- handle sleep */
6083 if (do_sleep) m_ptr->csleep = do_sleep;
6087 else if (heal_leper)
6090 msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6092 msg_print("The Mangy looking leper is healed!");
6095 delete_monster_idx(c_ptr->m_idx);
6098 /* If the player did it, give him experience, check fear */
6103 /* Hurt the monster, check for fear and death */
6104 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6109 /* Damaged monster */
6112 /* HACK - anger the monster before showing the sleep message */
6113 if (do_sleep) anger_monster(m_ptr);
6115 /* Give detailed messages if visible or destroyed */
6118 msg_format("%s%s", m_name, note);
6120 msg_format("%^s%s", m_name, note);
6124 /* Hack -- Pain message */
6125 else if (known && (dam || !do_fear))
6127 message_pain(c_ptr->m_idx, dam);
6130 /* Anger monsters */
6131 if (((dam > 0) || get_angry) && !do_sleep)
6132 anger_monster(m_ptr);
6135 if ((fear || do_fear) && (m_ptr->ml))
6142 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6144 msg_format("%^s flees in terror!", m_name);
6149 /* Hack -- handle sleep */
6150 if (do_sleep) m_ptr->csleep = do_sleep;
6154 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6156 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6160 switch (randint1(28))
6166 msg_print("ÃÏÌ̤¬Íɤ줿...");
6168 msg_print("The ground trembles...");
6171 earthquake(ty, tx, 4 + randint0(4));
6172 if (!one_in_(6)) break;
6174 case 3: case 4: case 5: case 6:
6177 int dam = damroll(10, 10);
6179 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6181 msg_print("A portal opens to a plane of raw mana!");
6184 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6185 if (!one_in_(6)) break;
6191 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6193 msg_print("Space warps about you!");
6196 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE);
6197 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6198 if (!one_in_(6)) break;
6200 case 9: case 10: case 11:
6202 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6204 msg_print("You feel a surge of energy!");
6207 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6208 if (!one_in_(6)) break;
6209 case 12: case 13: case 14: case 15: case 16:
6210 aggravate_monsters(0);
6211 if (!one_in_(6)) break;
6213 count += activate_hi_summon(ty, tx, TRUE);
6214 if (!one_in_(6)) break;
6215 case 19: case 20: case 21: case 22:
6217 bool pet = !one_in_(3);
6218 u32b mode = PM_ALLOW_GROUP;
6220 if (pet) mode |= PM_FORCE_PET;
6221 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6223 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6224 if (!one_in_(6)) break;
6226 case 23: case 24: case 25:
6227 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6229 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6231 msg_print("You feel your life draining away...");
6234 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6235 else lose_exp(p_ptr->exp / 16);
6236 if (!one_in_(6)) break;
6237 case 26: case 27: case 28:
6246 (void)do_dec_stat(i);
6255 (void)do_dec_stat(randint0(6));
6264 if (p_ptr->inside_battle)
6266 p_ptr->health_who = c_ptr->m_idx;
6267 p_ptr->redraw |= (PR_HEALTH);
6271 /* XXX XXX XXX Verify this code */
6273 /* Update the monster */
6274 update_mon(c_ptr->m_idx, FALSE);
6276 /* Redraw the monster grid */
6280 /* Update monster recall window */
6281 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6284 p_ptr->window |= (PW_MONSTER);
6287 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6291 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6293 set_target(m_ptr, monster_target_y, monster_target_x);
6296 else if (is_pet(&m_list[who]) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6298 set_target(m_ptr, m_list[who].fy, m_list[who].fx);
6302 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6304 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6305 rakubadam_m = (dam > 200) ? 200 : dam;
6314 /* Get local object */
6317 /* Prepare to make a Blade of Chaos */
6318 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6320 q_ptr->pval = photo;
6322 /* Mark the item as fully known */
6323 q_ptr->ident |= (IDENT_MENTAL);
6325 /* Drop it in the dungeon */
6326 (void)drop_near(q_ptr, -1, py, px);
6334 /* Return "Anything seen?" */
6340 * Helper function for "project()" below.
6342 * Handle a beam/bolt/ball causing damage to the player.
6344 * This routine takes a "source monster" (by index), a "distance", a default
6345 * "damage", and a "damage type". See "project_m()" above.
6347 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6348 * is reduced (see "project_m()" above). This can happen if a monster breathes
6349 * at the player and hits a wall instead.
6351 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6352 * to know if this is actually a ball or a bolt spell
6355 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6356 * we just assume that the effects were obvious, for historical reasons.
6358 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6363 /* Hack -- assume obvious */
6364 bool obvious = TRUE;
6366 /* Player blind-ness */
6367 bool blind = (p_ptr->blind ? TRUE : FALSE);
6369 /* Player needs a "description" (he is blind) */
6372 /* Source monster */
6373 monster_type *m_ptr = NULL;
6375 /* Monster name (for attacks) */
6378 /* Monster name (for damage) */
6381 /* Hack -- messages */
6387 /* Player is not here */
6388 if (!player_bold(y, x)) return (FALSE);
6390 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6396 /* Player cannot hurt himself */
6397 if (!who) return (FALSE);
6398 if (who == p_ptr->riding) return (FALSE);
6400 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6403 int max_attempts = 10;
6406 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6407 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6408 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6410 if (blind) msg_print("Something bounces!");
6411 else msg_print("The attack bounces!");
6415 /* Choose 'new' target */
6418 t_y = m_list[who].fy - 1 + randint1(3);
6419 t_x = m_list[who].fx - 1 + randint1(3);
6422 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
6424 if (max_attempts < 1)
6426 t_y = m_list[who].fy;
6427 t_x = m_list[who].fx;
6430 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6437 /* Limit maximum damage */
6438 if (dam > 1600) dam = 1600;
6440 /* Reduce damage by distance */
6441 dam = (dam + r) / (r + 1);
6444 /* If the player is blind, be more descriptive */
6445 if (blind) fuzzy = TRUE;
6450 /* Get the source monster */
6451 m_ptr = &m_list[who];
6452 /* Extract the monster level */
6453 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6455 /* Get the monster name */
6456 monster_desc(m_name, m_ptr, 0);
6458 /* Get the monster's real name (gotten before polymorph!) */
6459 strcpy(killer, who_name);
6464 strcpy(killer, "æ«");
6466 strcpy(killer, "a trap");
6470 /* Analyze the damage */
6473 /* Standard damage -- hurts inventory too */
6477 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6479 if (fuzzy) msg_print("You are hit by acid!");
6482 get_damage = acid_dam(dam, killer, monspell);
6486 /* Standard damage -- hurts inventory too */
6490 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6492 if (fuzzy) msg_print("You are hit by fire!");
6495 get_damage = fire_dam(dam, killer, monspell);
6499 /* Standard damage -- hurts inventory too */
6503 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6505 if (fuzzy) msg_print("You are hit by cold!");
6508 get_damage = cold_dam(dam, killer, monspell);
6512 /* Standard damage -- hurts inventory too */
6516 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6518 if (fuzzy) msg_print("You are hit by lightning!");
6521 get_damage = elec_dam(dam, killer, monspell);
6525 /* Standard damage -- also poisons player */
6528 bool double_resist = IS_OPPOSE_POIS();
6530 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6532 if (fuzzy) msg_print("You are hit by poison!");
6535 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6536 if (double_resist) dam = (dam + 2) / 3;
6538 if ((!(double_resist || p_ptr->resist_pois)) &&
6539 one_in_(HURT_CHANCE))
6544 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6546 if (!(double_resist || p_ptr->resist_pois))
6548 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6553 /* Standard damage -- also poisons / mutates player */
6556 bool double_resist = IS_OPPOSE_POIS();
6558 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6560 if (fuzzy) msg_print("You are hit by radiation!");
6563 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6564 if (double_resist) dam = (2 * dam + 2) / 5;
6565 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6566 if (!(double_resist || p_ptr->resist_pois))
6568 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6570 if (one_in_(5)) /* 6 */
6573 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6575 msg_print("You undergo a freakish metamorphosis!");
6578 if (one_in_(4)) /* 4 */
6586 inven_damage(set_acid_destroy, 2);
6592 /* Standard damage */
6596 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6598 if (fuzzy) msg_print("You are hit by something!");
6601 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6605 /* Holy Orb -- Player only takes partial damage */
6609 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6611 if (fuzzy) msg_print("You are hit by something!");
6614 if (p_ptr->align > 10)
6616 else if (p_ptr->align < -10)
6618 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6625 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6627 if (fuzzy) msg_print("You are hit by something!");
6630 if (p_ptr->align > 10)
6632 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6636 /* Arrow -- XXX no dodging */
6640 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6642 if (fuzzy) msg_print("You are hit by something sharp!");
6645 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6648 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6650 msg_print("You cut down the arrow!");
6654 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6658 /* Plasma -- XXX No resist */
6662 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6664 if (fuzzy) msg_print("You are hit by something *HOT*!");
6667 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6669 if (!p_ptr->resist_sound)
6671 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6672 (void)set_stun(p_ptr->stun + k);
6675 if (!(p_ptr->resist_fire ||
6677 p_ptr->immune_fire))
6679 inven_damage(set_acid_destroy, 3);
6685 /* Nether -- drain experience */
6689 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6691 if (fuzzy) msg_print("You are hit by nether forces!");
6695 if (p_ptr->resist_neth)
6697 if (!prace_is_(RACE_SPECTRE))
6698 dam *= 6; dam /= (randint1(4) + 7);
6700 else drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
6702 if (prace_is_(RACE_SPECTRE))
6705 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6707 msg_print("You feel invigorated!");
6711 learn_spell(monspell);
6715 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6721 /* Water -- stun/confuse */
6725 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6727 if (fuzzy) msg_print("You are hit by something wet!");
6730 if (!p_ptr->resist_sound)
6732 set_stun(p_ptr->stun + randint1(40));
6734 if (!p_ptr->resist_conf)
6736 set_confused(p_ptr->confused + randint1(5) + 5);
6741 inven_damage(set_cold_destroy, 3);
6744 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6748 /* Chaos -- many effects */
6752 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6754 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6757 if (p_ptr->resist_chaos)
6759 dam *= 6; dam /= (randint1(4) + 7);
6761 if (!p_ptr->resist_conf)
6763 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6765 if (!p_ptr->resist_chaos)
6767 (void)set_image(p_ptr->image + randint1(10));
6771 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6773 msg_print("Your body is twisted by chaos!");
6776 (void)gain_random_mutation(0);
6779 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6781 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
6783 if (!p_ptr->resist_chaos || one_in_(9))
6785 inven_damage(set_elec_destroy, 2);
6786 inven_damage(set_fire_destroy, 2);
6788 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6792 /* Shards -- mostly cutting */
6796 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6798 if (fuzzy) msg_print("You are hit by something sharp!");
6801 if (p_ptr->resist_shard)
6803 dam *= 6; dam /= (randint1(4) + 7);
6807 (void)set_cut(p_ptr->cut + dam);
6810 if (!p_ptr->resist_shard || one_in_(13))
6812 inven_damage(set_cold_destroy, 2);
6815 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6819 /* Sound -- mostly stunning */
6823 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6825 if (fuzzy) msg_print("You are hit by a loud noise!");
6828 if (p_ptr->resist_sound)
6830 dam *= 5; dam /= (randint1(4) + 7);
6834 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6835 (void)set_stun(p_ptr->stun + k);
6838 if (!p_ptr->resist_sound || one_in_(13))
6840 inven_damage(set_cold_destroy, 2);
6843 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6847 /* Pure confusion */
6851 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6853 if (fuzzy) msg_print("You are hit by something puzzling!");
6856 if (p_ptr->resist_conf)
6858 dam *= 5; dam /= (randint1(4) + 7);
6860 if (!p_ptr->resist_conf)
6862 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6864 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6868 /* Disenchantment -- see above */
6872 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6874 if (fuzzy) msg_print("You are hit by something static!");
6877 if (p_ptr->resist_disen)
6879 dam *= 6; dam /= (randint1(4) + 7);
6883 (void)apply_disenchant(0);
6885 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6889 /* Nexus -- see above */
6893 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6895 if (fuzzy) msg_print("You are hit by something strange!");
6898 if (p_ptr->resist_nexus)
6900 dam *= 6; dam /= (randint1(4) + 7);
6906 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6910 /* Force -- mostly stun */
6914 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6916 if (fuzzy) msg_print("You are hit by kinetic force!");
6919 if (!p_ptr->resist_sound)
6921 (void)set_stun(p_ptr->stun + randint1(20));
6923 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6928 /* Rocket -- stun, cut */
6932 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
6934 if (fuzzy) msg_print("There is an explosion!");
6937 if (!p_ptr->resist_sound)
6939 (void)set_stun(p_ptr->stun + randint1(20));
6941 if (p_ptr->resist_shard)
6947 (void)set_cut(p_ptr-> cut + ( dam / 2));
6950 if ((!p_ptr->resist_shard) || one_in_(12))
6952 inven_damage(set_cold_destroy, 3);
6955 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6959 /* Inertia -- slowness */
6963 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6965 if (fuzzy) msg_print("You are hit by something slow!");
6968 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
6969 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6973 /* Lite -- blinding */
6977 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6979 if (fuzzy) msg_print("You are hit by something!");
6982 if (p_ptr->resist_lite)
6984 dam *= 4; dam /= (randint1(4) + 7);
6986 else if (!blind && !p_ptr->resist_blind)
6988 (void)set_blind(p_ptr->blind + randint1(5) + 2);
6990 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
6993 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
6995 msg_print("The light scorches your flesh!");
7000 else if (prace_is_(RACE_S_FAIRY))
7004 if (p_ptr->wraith_form) dam *= 2;
7005 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7007 if (p_ptr->wraith_form)
7009 p_ptr->wraith_form = 0;
7011 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7013 msg_print("The light forces you out of your incorporeal shadow form.");
7016 p_ptr->redraw |= PR_MAP;
7017 /* Update monsters */
7018 p_ptr->update |= (PU_MONSTERS);
7020 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7022 /* Redraw status bar */
7023 p_ptr->redraw |= (PR_STATUS);
7030 /* Dark -- blinding */
7034 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7036 if (fuzzy) msg_print("You are hit by something!");
7039 if (p_ptr->resist_dark)
7041 dam *= 4; dam /= (randint1(4) + 7);
7043 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7045 else if (!blind && !p_ptr->resist_blind)
7047 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7049 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7053 /* Time -- bolt fewer effects XXX */
7057 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7059 if (fuzzy) msg_print("You are hit by a blast from the past!");
7062 if (p_ptr->resist_time)
7065 dam /= (randint1(4) + 7);
7067 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7069 msg_print("You feel as if time is passing you by.");
7075 switch (randint1(10))
7077 case 1: case 2: case 3: case 4: case 5:
7079 if (p_ptr->prace == RACE_ANDROID) break;
7081 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7083 msg_print("You feel life has clocked back.");
7086 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7090 case 6: case 7: case 8: case 9:
7092 switch (randint1(6))
7095 case 1: k = A_STR; act = "¶¯¤¯"; break;
7096 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7097 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7098 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7099 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7100 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7102 case 1: k = A_STR; act = "strong"; break;
7103 case 2: k = A_INT; act = "bright"; break;
7104 case 3: k = A_WIS; act = "wise"; break;
7105 case 4: k = A_DEX; act = "agile"; break;
7106 case 5: k = A_CON; act = "hale"; break;
7107 case 6: k = A_CHR; act = "beautiful"; break;
7113 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7115 msg_format("You're not as %s as you used to be...", act);
7119 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7120 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7121 p_ptr->update |= (PU_BONUS);
7128 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7130 msg_print("You're not as powerful as you used to be...");
7134 for (k = 0; k < 6; k++)
7136 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7137 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7139 p_ptr->update |= (PU_BONUS);
7145 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7149 /* Gravity -- stun plus slowness plus teleport */
7153 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7154 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7156 if (fuzzy) msg_print("You are hit by something heavy!");
7157 msg_print("Gravity warps around you.");
7162 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7163 if (!(p_ptr->resist_sound || p_ptr->ffall))
7165 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7166 (void)set_stun(p_ptr->stun + k);
7170 dam = (dam * 2) / 3;
7173 if (!p_ptr->ffall || one_in_(13))
7175 inven_damage(set_cold_destroy, 2);
7178 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7182 /* Standard damage */
7183 case GF_DISINTEGRATE:
7186 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7188 if (fuzzy) msg_print("You are hit by pure energy!");
7191 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7198 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7200 if (fuzzy) msg_print("You are hit by something invigorating!");
7203 (void)hp_player(dam);
7211 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7213 if (fuzzy) msg_print("You are hit by something!");
7216 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7224 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7226 if (fuzzy) msg_print("You are hit by something slow!");
7229 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7235 if (p_ptr->free_act) break;
7237 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7239 if (fuzzy) msg_print("You fall asleep!");
7243 if (ironman_nightmare)
7246 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7248 msg_print("A horrible vision enters your mind.");
7252 /* Pick a nightmare */
7253 get_mon_num_prep(get_nightmare, NULL);
7255 /* Have some nightmares */
7256 have_nightmare(get_mon_num(MAX_DEPTH));
7258 /* Remove the monster restriction */
7259 get_mon_num_prep(NULL, NULL);
7262 set_paralyzed(p_ptr->paralyzed + dam);
7273 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7275 if (fuzzy) msg_print("You are hit by an aura of magic!");
7278 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7286 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7288 if (fuzzy) msg_print("You are hit by an energy!");
7291 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7299 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7301 if (fuzzy) msg_print("Something falls from the sky on you!");
7304 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7305 if (!p_ptr->resist_shard || one_in_(13))
7307 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7308 inven_damage(set_cold_destroy, 2);
7314 /* Ice -- cold plus stun plus cuts */
7318 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7320 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7323 cold_dam(dam, killer, monspell);
7324 if (!p_ptr->resist_shard)
7326 (void)set_cut(p_ptr->cut + damroll(5, 8));
7328 if (!p_ptr->resist_sound)
7330 (void)set_stun(p_ptr->stun + randint1(15));
7333 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
7335 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7345 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7347 if (fuzzy) msg_print("You are hit by something extremely cold!");
7351 if (p_ptr->mimic_form)
7353 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7354 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7359 switch (p_ptr->prace)
7361 /* Some races are immune */
7375 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7391 if (who > 0) msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
7392 else msg_print("Àº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
7394 if (who > 0) msg_format("%^s draws psychic energy from you!", m_name);
7395 else msg_print("Your psychic energy is drawn!");
7399 if (dam >= p_ptr->csp)
7403 p_ptr->csp_frac = 0;
7412 learn_spell(monspell);
7415 p_ptr->redraw |= (PR_MANA);
7418 p_ptr->window |= (PW_PLAYER);
7419 p_ptr->window |= (PW_SPELL);
7423 /* Heal the monster */
7424 if (m_ptr->hp < m_ptr->maxhp)
7427 m_ptr->hp += (6 * dam);
7428 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
7430 /* Redraw (later) if needed */
7431 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
7432 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
7434 /* Special message */
7438 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
7440 msg_format("%^s appears healthier.", m_name);
7454 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7457 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7459 msg_print("You resist the effects!");
7461 learn_spell(monspell);
7466 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7468 msg_print("Your mind is blasted by psyonic energy.");
7471 if (!p_ptr->resist_conf)
7473 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7476 if (!p_ptr->resist_chaos && one_in_(3))
7478 (void)set_image(p_ptr->image + randint0(250) + 150);
7485 p_ptr->csp_frac = 0;
7487 p_ptr->redraw |= PR_MANA;
7489 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7495 case GF_BRAIN_SMASH:
7497 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7500 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7502 msg_print("You resist the effects!");
7504 learn_spell(monspell);
7509 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7511 msg_print("Your mind is blasted by psionic energy.");
7518 p_ptr->csp_frac = 0;
7520 p_ptr->redraw |= PR_MANA;
7522 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7523 if (!p_ptr->resist_blind)
7525 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7527 if (!p_ptr->resist_conf)
7529 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7531 if (!p_ptr->free_act)
7533 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7535 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7537 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7538 (void)do_dec_stat(A_INT);
7539 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7540 (void)do_dec_stat(A_WIS);
7542 if (!p_ptr->resist_chaos)
7544 (void)set_image(p_ptr->image + randint0(250) + 150);
7553 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7556 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7558 msg_print("You resist the effects!");
7560 learn_spell(monspell);
7564 curse_equipment(15, 0);
7565 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7573 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7576 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7578 msg_print("You resist the effects!");
7580 learn_spell(monspell);
7584 curse_equipment(25, MIN(rlev/2-15, 5));
7585 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7593 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7596 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7598 msg_print("You resist the effects!");
7600 learn_spell(monspell);
7604 curse_equipment(33, MIN(rlev/2-15, 15));
7605 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7613 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7616 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7618 msg_print("You resist the effects!");
7620 learn_spell(monspell);
7624 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7625 (void)set_cut(p_ptr->cut + damroll(10, 10));
7633 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7636 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7638 msg_format("You resist the effects!");
7640 learn_spell(monspell);
7645 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7647 msg_print("You feel your life fade away!");
7650 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
7651 curse_equipment(40, 20);
7653 if (p_ptr->chp < 1) p_ptr->chp = 1;
7668 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7671 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7673 char m_name_self[80];
7676 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
7678 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7680 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7681 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7684 if (p_ptr->riding && dam > 0)
7686 rakubadam_p = (dam > 200) ? 200 : dam;
7694 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7700 /* Return "Anything seen?" */
7706 * Find the distance from (x, y) to a line.
7708 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7710 /* Vector from (x, y) to (x1, y1) */
7719 int pd = distance(y1, x1, y, x);
7720 int nd = distance(y1, x1, y2, x2);
7722 if (pd > nd) return distance(y, x, y2, x2);
7724 /* Component of P on N */
7725 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7727 /* Absolute value */
7728 return((nd >= 0) ? nd : 0 - nd);
7735 * Modified version of los() for calculation of disintegration balls.
7736 * Disintegration effects are stopped by permanent walls.
7738 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7758 /* Slope, or 1/Slope, of LOS */
7762 /* Extract the offset */
7766 /* Extract the absolute offset */
7771 /* Handle adjacent (or identical) grids */
7772 if ((ax < 2) && (ay < 2)) return (TRUE);
7775 /* Paranoia -- require "safe" origin */
7776 /* if (!in_bounds(y1, x1)) return (FALSE); */
7779 /* Directly South/North */
7782 /* South -- check for walls */
7785 for (ty = y1 + 1; ty < y2; ty++)
7787 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7791 /* North -- check for walls */
7794 for (ty = y1 - 1; ty > y2; ty--)
7796 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7804 /* Directly East/West */
7807 /* East -- check for walls */
7810 for (tx = x1 + 1; tx < x2; tx++)
7812 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7816 /* West -- check for walls */
7819 for (tx = x1 - 1; tx > x2; tx--)
7821 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7830 /* Extract some signs */
7831 sx = (dx < 0) ? -1 : 1;
7832 sy = (dy < 0) ? -1 : 1;
7835 /* Vertical "knights" */
7840 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7844 /* Horizontal "knights" */
7849 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7854 /* Calculate scale factor div 2 */
7857 /* Calculate scale factor */
7861 /* Travel horizontally */
7864 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7870 /* Consider the special case where slope == 1. */
7881 /* Note (below) the case (qy == f2), where */
7882 /* the LOS exactly meets the corner of a tile. */
7885 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7896 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7909 /* Travel vertically */
7912 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7928 /* Note (below) the case (qx == f2), where */
7929 /* the LOS exactly meets the corner of a tile. */
7932 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7943 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7962 * Do disintegration effect on the terrain
7963 * before we decide the region of the effect.
7965 static bool do_disintegration(int by, int bx, int y, int x)
7967 feature_type *f_ptr;
7969 /* Disintegration balls explosions are stopped by perma-walls */
7970 if (!in_disintegration_range(by, bx, y, x)) return FALSE;
7972 /* Destroy mirror */
7973 if (is_mirror_grid(&cave[y][x])) remove_mirror(y, x);
7975 f_ptr = &f_info[cave[y][x].feat];
7977 /* Permanent features don't get effect */
7978 /* But not protect monsters and other objects */
7979 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
7981 cave_alter_feat(y, x, FF_HURT_DISI);
7983 /* Update some things -- similar to GF_KILL_WALL */
7984 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
7994 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, bool real_breath)
7999 int brev = rad * rad / dist;
8003 int tdis = distance(y1, x1, y2, x2);
8004 int mdis = tdis + rad;
8006 while (bdis <= mdis)
8010 if ((0 < dist) && (path_n < dist))
8012 int ny = GRID_Y(path_g[path_n]);
8013 int nx = GRID_X(path_g[path_n]);
8014 int nd = distance(ny, nx, y1, x1);
8016 /* Get next base point */
8025 /* Travel from center outward */
8026 for (cdis = 0; cdis <= brad; cdis++)
8028 /* Scan the maximal blast area of radius "cdis" */
8029 for (y = by - cdis; y <= by + cdis; y++)
8031 for (x = bx - cdis; x <= bx + cdis; x++)
8033 /* Ignore "illegal" locations */
8034 if (!in_bounds(y, x)) continue;
8036 /* Enforce a circular "ripple" */
8037 if (distance(y1, x1, y, x) != bdis) continue;
8039 /* Enforce an arc */
8040 if (distance(by, bx, y, x) != cdis) continue;
8045 /* Disintegration are stopped only by perma-walls */
8048 /* Destroy terrains */
8049 if (!do_disintegration(by, bx, y, x)) continue;
8053 /* No actual disintegration */
8054 if (!in_disintegration_range(by, bx, y, x)) continue;
8059 /* The blast is stopped by walls */
8060 if (!projectable(by, bx, y, x)) continue;
8063 /* Save this grid */
8071 /* Encode some more "radius" info */
8072 gm[bdis + 1] = *pgrids;
8074 /* Increase the size */
8075 brad = rad * (path_n + brev) / (dist + brev);
8077 /* Find the next ripple */
8081 /* Store the effect size */
8087 * Generic "beam"/"bolt"/"ball" projection routine.
8090 * who: Index of "source" monster (zero for "player")
8091 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8092 * y,x: Target location (or location to travel "towards")
8093 * dam: Base damage roll to apply to affected monsters (or player)
8094 * typ: Type of damage to apply to monsters (and objects)
8095 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8098 * TRUE if any "effects" of the projection were observed, else FALSE
8100 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8101 * towards a given location (optionally passing over the heads of interposing
8102 * monsters), and have it do a given amount of damage to the monsters (and
8103 * optionally objects) within the given radius of the final location.
8105 * A "bolt" travels from source to target and affects only the target grid.
8106 * A "beam" travels from source to target, affecting all grids passed through.
8107 * A "ball" travels from source to the target, exploding at the target, and
8108 * affecting everything within the given radius of the target location.
8110 * Traditionally, a "bolt" does not affect anything on the ground, and does
8111 * not pass over the heads of interposing monsters, much like a traditional
8112 * missile, and will "stop" abruptly at the "target" even if no monster is
8113 * positioned there, while a "ball", on the other hand, passes over the heads
8114 * of monsters between the source and target, and affects everything except
8115 * the source monster which lies within the final radius, while a "beam"
8116 * affects every monster between the source and target, except for the casting
8117 * monster (or player), and rarely affects things on the ground.
8119 * Two special flags allow us to use this function in special ways, the
8120 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8121 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8122 * actually projecting from the source monster (or player).
8124 * The player will only get "experience" for monsters killed by himself
8125 * Unique monsters can only be destroyed by attacks from the player
8127 * Only 256 grids can be affected per projection, limiting the effective
8128 * "radius" of standard ball attacks to nine units (diameter nineteen).
8130 * One can project in a given "direction" by combining PROJECT_THRU with small
8131 * offsets to the initial location (see "line_spell()"), or by calculating
8132 * "virtual targets" far away from the player.
8134 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8135 * continuing until it actually hits somethings (useful for "stone to mud").
8137 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8139 * Balls must explode BEFORE hitting walls, or they would affect monsters
8140 * on both sides of a wall. Some bug reports indicate that this is still
8141 * happening in 2.7.8 for Windows, though it appears to be impossible.
8143 * We "pre-calculate" the blast area only in part for efficiency.
8144 * More importantly, this lets us do "explosions" from the "inside" out.
8145 * This results in a more logical distribution of "blast" treasure.
8146 * It also produces a better (in my opinion) animation of the explosion.
8147 * It could be (but is not) used to have the treasure dropped by monsters
8148 * in the middle of the explosion fall "outwards", and then be damaged by
8149 * the blast as it spreads outwards towards the treasure drop location.
8151 * Walls and doors are included in the blast area, so that they can be
8152 * "burned" or "melted" in later versions.
8154 * This algorithm is intended to maximize simplicity, not necessarily
8155 * efficiency, since this function is not a bottleneck in the code.
8157 * We apply the blast effect from ground zero outwards, in several passes,
8158 * first affecting features, then objects, then monsters, then the player.
8159 * This allows walls to be removed before checking the object or monster
8160 * in the wall, and protects objects which are dropped by monsters killed
8161 * in the blast, and allows the player to see all affects before he is
8162 * killed or teleported away. The semantics of this method are open to
8163 * various interpretations, but they seem to work well in practice.
8165 * We process the blast area from ground-zero outwards to allow for better
8166 * distribution of treasure dropped by monsters, and because it provides a
8167 * pleasing visual effect at low cost.
8169 * Note that the damage done by "ball" explosions decreases with distance.
8170 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8172 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8173 * the target, and then the damage "flows" along this beam of destruction.
8174 * The damage at every grid is the same as at the "center" of a "ball"
8175 * explosion, since the "beam" grids are treated as if they ARE at the
8176 * center of a "ball" explosion.
8178 * Currently, specifying "beam" plus "ball" means that locations which are
8179 * covered by the initial "beam", and also covered by the final "ball", except
8180 * for the final grid (the epicenter of the ball), will be "hit twice", once
8181 * by the initial beam, and once by the exploding ball. For the grid right
8182 * next to the epicenter, this results in 150% damage being done. The center
8183 * does not have this problem, for the same reason the final grid in a "beam"
8184 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8185 * grids which are covered by the "ball" will NOT work, as then they will
8186 * receive LESS damage than they should. Do not combine "beam" with "ball".
8188 * The array "gy[],gx[]" with current size "grids" is used to hold the
8189 * collected locations of all grids in the "blast area" plus "beam path".
8191 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8192 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8193 * first blast grid (see above) with radius "N" from the blast center. Note
8194 * that only the first gm[1] grids in the blast area thus take full damage.
8195 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8196 * number of blast grids.
8198 * Note that once the projection is complete, (y2,x2) holds the final location
8199 * of bolts/beams, and the "epicenter" of balls.
8201 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8202 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8203 * implementation of the "distance" function. Also, a bolt can be properly
8204 * viewed as a "ball" with a "rad" of "zero".
8206 * Note that if no "target" is reached before the beam/bolt/ball travels the
8207 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8208 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8210 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8211 * to move from point A to point B, even if the player cannot see part of the
8212 * projection path. Note that in general, the player will *always* see part
8213 * of the path, since it either starts at the player or ends on the player.
8215 * Hack -- we assume that every "projection" is "self-illuminating".
8217 * Hack -- when only a single monster is affected, we automatically track
8218 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8220 * Note that all projections now "explode" at their final destination, even
8221 * if they were being projected at a more distant destination. This means
8222 * that "ball" spells will *always* explode.
8224 * Note that we must call "handle_stuff()" after affecting terrain features
8225 * in the blast radius, in case the "illumination" of the grid was changed,
8226 * and "update_view()" and "update_monsters()" need to be called.
8228 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8238 int y_saver, x_saver; /* For reflecting monsters */
8240 int msec = delay_factor * delay_factor * delay_factor;
8242 /* Assume the player sees nothing */
8243 bool notice = FALSE;
8245 /* Assume the player has seen nothing */
8246 bool visual = FALSE;
8248 /* Assume the player has seen no blast grids */
8251 /* Assume to be a normal ball spell */
8252 bool breath = FALSE;
8254 /* Is the player blind? */
8255 bool blind = (p_ptr->blind ? TRUE : FALSE);
8257 bool old_hide = FALSE;
8259 /* Number of grids in the "path" */
8262 /* Actual grids in the "path" */
8265 /* Number of grids in the "blast area" (including the "beam" path) */
8268 /* Coordinates of the affected grids */
8269 byte gx[1024], gy[1024];
8271 /* Encoded "radius" info (see above) */
8274 /* Actual radius encoded in gm[] */
8279 /* Attacker's name (prepared before polymorph)*/
8282 /* Initialize by null string */
8288 /* Default target of monsterspell is player */
8289 monster_target_y=py;
8290 monster_target_x=px;
8292 /* Hack -- Jump to target */
8293 if (flg & (PROJECT_JUMP))
8298 /* Clear the flag */
8299 flg &= ~(PROJECT_JUMP);
8304 /* Start at player */
8311 /* Start at monster */
8314 x1 = m_list[who].fx;
8315 y1 = m_list[who].fy;
8316 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8329 /* Default "destination" */
8334 /* Hack -- verify stuff */
8335 if (flg & (PROJECT_THRU))
8337 if ((x1 == x2) && (y1 == y2))
8339 flg &= ~(PROJECT_THRU);
8343 /* Handle a breath attack */
8348 if (flg & PROJECT_HIDE) old_hide = TRUE;
8349 flg |= PROJECT_HIDE;
8353 /* Hack -- Assume there will be no blast (max radius 32) */
8354 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8362 /* Collect beam grids */
8363 if (flg & (PROJECT_BEAM))
8370 if (breath && typ == GF_DISINTEGRATE)
8372 flg |= (PROJECT_DISI);
8375 /* Calculate the projection path */
8377 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8379 /* Hack -- Handle stuff */
8382 /* Giga-Hack SEEKER & SUPER_RAY */
8384 if( typ == GF_SEEKER )
8394 for (i = 0; i < path_n; ++i)
8399 int ny = GRID_Y(path_g[i]);
8400 int nx = GRID_X(path_g[i]);
8411 /* Only do visuals if requested */
8412 if (!blind && !(flg & (PROJECT_HIDE)))
8414 /* Only do visuals if the player can "see" the bolt */
8415 if (panel_contains(y, x) && player_has_los_bold(y, x))
8422 /* Obtain the bolt pict */
8423 p = bolt_pict(oy, ox, y, x, typ);
8425 /* Extract attr/char */
8429 /* Visual effects */
8430 print_rel(c, a, y, x);
8431 move_cursor_relative(y, x);
8432 /*if (fresh_before)*/ Term_fresh();
8433 Term_xtra(TERM_XTRA_DELAY, msec);
8435 /*if (fresh_before)*/ Term_fresh();
8437 /* Display "beam" grids */
8438 if (flg & (PROJECT_BEAM))
8440 /* Obtain the explosion pict */
8441 p = bolt_pict(y, x, y, x, typ);
8443 /* Extract attr/char */
8447 /* Visual effects */
8448 print_rel(c, a, y, x);
8451 /* Hack -- Activate delay */
8455 /* Hack -- delay anyway for consistency */
8458 /* Delay for consistency */
8459 Term_xtra(TERM_XTRA_DELAY, msec);
8462 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8463 if( is_mirror_grid(&cave[y][x]))
8465 /* The target of monsterspell becomes tha mirror(broken) */
8466 monster_target_y=(s16b)y;
8467 monster_target_x=(s16b)x;
8470 next_mirror( &oy,&ox,y,x );
8472 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8473 for( j = last_i; j <=i ; j++ )
8475 y = GRID_Y(path_g[j]);
8476 x = GRID_X(path_g[j]);
8477 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8478 if(!who && (project_m_n==1) && !jump ){
8479 if(cave[project_m_y][project_m_x].m_idx >0 ){
8480 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8482 /* Hack -- auto-recall */
8483 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8485 /* Hack - auto-track */
8486 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8489 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8494 for( i = last_i ; i < path_n ; i++ )
8497 y = GRID_Y(path_g[i]);
8498 x = GRID_X(path_g[i]);
8499 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8501 if(!who && (project_m_n==1) && !jump ){
8502 if(cave[project_m_y][project_m_x].m_idx >0 ){
8503 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8505 /* Hack -- auto-recall */
8506 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8508 /* Hack - auto-track */
8509 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8512 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8516 else if(typ == GF_SUPER_RAY){
8518 int second_step = 0;
8525 for (i = 0; i < path_n; ++i)
8530 int ny = GRID_Y(path_g[i]);
8531 int nx = GRID_X(path_g[i]);
8542 /* Only do visuals if requested */
8543 if (!blind && !(flg & (PROJECT_HIDE)))
8545 /* Only do visuals if the player can "see" the bolt */
8546 if (panel_contains(y, x) && player_has_los_bold(y, x))
8553 /* Obtain the bolt pict */
8554 p = bolt_pict(oy, ox, y, x, typ);
8556 /* Extract attr/char */
8560 /* Visual effects */
8561 print_rel(c, a, y, x);
8562 move_cursor_relative(y, x);
8563 /*if (fresh_before)*/ Term_fresh();
8564 Term_xtra(TERM_XTRA_DELAY, msec);
8566 /*if (fresh_before)*/ Term_fresh();
8568 /* Display "beam" grids */
8569 if (flg & (PROJECT_BEAM))
8571 /* Obtain the explosion pict */
8572 p = bolt_pict(y, x, y, x, typ);
8574 /* Extract attr/char */
8578 /* Visual effects */
8579 print_rel(c, a, y, x);
8582 /* Hack -- Activate delay */
8586 /* Hack -- delay anyway for consistency */
8589 /* Delay for consistency */
8590 Term_xtra(TERM_XTRA_DELAY, msec);
8593 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8594 if (!have_flag(f_flags_bold(y, x), FF_PROJECT))
8596 if( second_step )continue;
8599 if( is_mirror_grid(&cave[y][x]) && !second_step )
8601 /* The target of monsterspell becomes tha mirror(broken) */
8602 monster_target_y=(s16b)y;
8603 monster_target_x=(s16b)x;
8606 for( j = 0; j <=i ; j++ )
8608 y = GRID_Y(path_g[j]);
8609 x = GRID_X(path_g[j]);
8610 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8614 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8615 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8616 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8617 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8618 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8619 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8620 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8621 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8624 for( i = 0; i < path_n ; i++ )
8627 y = GRID_Y(path_g[i]);
8628 x = GRID_X(path_g[i]);
8629 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8630 if(!who && (project_m_n==1) && !jump ){
8631 if(cave[project_m_y][project_m_x].m_idx >0 ){
8632 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8634 /* Hack -- auto-recall */
8635 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8637 /* Hack - auto-track */
8638 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8641 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8646 /* Project along the path */
8647 for (i = 0; i < path_n; ++i)
8652 int ny = GRID_Y(path_g[i]);
8653 int nx = GRID_X(path_g[i]);
8655 if (flg & PROJECT_DISI)
8657 /* Hack -- Balls explode before reaching walls */
8658 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8662 /* Hack -- Balls explode before reaching walls */
8663 if (!have_flag(f_flags_bold(ny, nx), FF_PROJECT) && (rad > 0)) break;
8670 /* Collect beam grids */
8671 if (flg & (PROJECT_BEAM))
8678 /* Only do visuals if requested */
8679 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
8681 /* Only do visuals if the player can "see" the bolt */
8682 if (panel_contains(y, x) && player_has_los_bold(y, x))
8689 /* Obtain the bolt pict */
8690 p = bolt_pict(oy, ox, y, x, typ);
8692 /* Extract attr/char */
8696 /* Visual effects */
8697 print_rel(c, a, y, x);
8698 move_cursor_relative(y, x);
8699 /*if (fresh_before)*/ Term_fresh();
8700 Term_xtra(TERM_XTRA_DELAY, msec);
8702 /*if (fresh_before)*/ Term_fresh();
8704 /* Display "beam" grids */
8705 if (flg & (PROJECT_BEAM))
8707 /* Obtain the explosion pict */
8708 p = bolt_pict(y, x, y, x, typ);
8710 /* Extract attr/char */
8714 /* Visual effects */
8715 print_rel(c, a, y, x);
8718 /* Hack -- Activate delay */
8722 /* Hack -- delay anyway for consistency */
8725 /* Delay for consistency */
8726 Term_xtra(TERM_XTRA_DELAY, msec);
8731 /* Save the "blast epicenter" */
8735 if (breath && (y1 == by) && (x1 == bx))
8741 flg &= ~(PROJECT_HIDE);
8745 /* Start the "explosion" */
8748 /* Hack -- make sure beams get to "explode" */
8756 /* If we found a "target", explode there */
8757 if (dist <= MAX_RANGE)
8759 /* Mega-Hack -- remove the final "beam" grid */
8760 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8763 * Create a conical breath attack
8774 flg &= ~(PROJECT_HIDE);
8776 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, (bool)(typ == GF_DISINTEGRATE), TRUE);
8780 /* Determine the blast area, work from the inside out */
8781 for (dist = 0; dist <= rad; dist++)
8783 /* Scan the maximal blast area of radius "dist" */
8784 for (y = by - dist; y <= by + dist; y++)
8786 for (x = bx - dist; x <= bx + dist; x++)
8788 /* Ignore "illegal" locations */
8789 if (!in_bounds2(y, x)) continue;
8791 /* Enforce a "circular" explosion */
8792 if (distance(by, bx, y, x) != dist) continue;
8794 if (typ == GF_DISINTEGRATE)
8796 /* Disintegration are stopped only by perma-walls */
8797 if (!do_disintegration(by, bx, y, x)) continue;
8801 /* Ball explosions are stopped by walls */
8802 if (!projectable(by, bx, y, x)) continue;
8805 /* Save this grid */
8812 /* Encode some more "radius" info */
8818 /* Speed -- ignore "non-explosions" */
8819 if (!grids) return (FALSE);
8822 /* Display the "blast area" if requested */
8823 if (!blind && !(flg & (PROJECT_HIDE)))
8825 /* Then do the "blast", from inside out */
8826 for (t = 0; t <= gm_rad; t++)
8828 /* Dump everything with this radius */
8829 for (i = gm[t]; i < gm[t+1]; i++)
8831 /* Extract the location */
8835 /* Only do visuals if the player can "see" the blast */
8836 if (panel_contains(y, x) && player_has_los_bold(y, x))
8845 /* Obtain the explosion pict */
8846 p = bolt_pict(y, x, y, x, typ);
8848 /* Extract attr/char */
8852 /* Visual effects -- Display */
8853 print_rel(c, a, y, x);
8857 /* Hack -- center the cursor */
8858 move_cursor_relative(by, bx);
8860 /* Flush each "radius" seperately */
8861 /*if (fresh_before)*/ Term_fresh();
8863 /* Delay (efficiently) */
8864 if (visual || drawn)
8866 Term_xtra(TERM_XTRA_DELAY, msec);
8870 /* Flush the erasing */
8873 /* Erase the explosion drawn above */
8874 for (i = 0; i < grids; i++)
8876 /* Extract the location */
8880 /* Hack -- Erase if needed */
8881 if (panel_contains(y, x) && player_has_los_bold(y, x))
8887 /* Hack -- center the cursor */
8888 move_cursor_relative(by, bx);
8890 /* Flush the explosion */
8891 /*if (fresh_before)*/ Term_fresh();
8896 /* Update stuff if needed */
8897 if (p_ptr->update) update_stuff();
8900 /* Check features */
8901 if (flg & (PROJECT_GRID))
8903 /* Start with "dist" of zero */
8906 /* Scan for features */
8907 for (i = 0; i < grids; i++)
8909 /* Hack -- Notice new "dist" values */
8910 if (gm[dist+1] == i) dist++;
8912 /* Get the grid location */
8916 /* Find the closest point in the blast */
8919 int d = dist_to_line(y, x, y1, x1, by, bx);
8921 /* Affect the grid */
8922 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8926 /* Affect the grid */
8927 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8934 if (flg & (PROJECT_ITEM))
8936 /* Start with "dist" of zero */
8939 /* Scan for objects */
8940 for (i = 0; i < grids; i++)
8942 /* Hack -- Notice new "dist" values */
8943 if (gm[dist+1] == i) dist++;
8945 /* Get the grid location */
8949 /* Find the closest point in the blast */
8952 int d = dist_to_line(y, x, y1, x1, by, bx);
8954 /* Affect the object in the grid */
8955 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8959 /* Affect the object in the grid */
8960 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8966 /* Check monsters */
8967 if (flg & (PROJECT_KILL))
8974 /* Start with "dist" of zero */
8977 /* Scan for monsters */
8978 for (i = 0; i < grids; i++)
8982 /* Hack -- Notice new "dist" values */
8983 if (gm[dist + 1] == i) dist++;
8985 /* Get the grid location */
8989 /* A single bolt may be reflected */
8992 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
8993 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
8995 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
8998 int max_attempts = 10;
9000 /* Choose 'new' target */
9003 t_y = y_saver - 1 + randint1(3);
9004 t_x = x_saver - 1 + randint1(3);
9007 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
9009 if (max_attempts < 1)
9018 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
9019 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9020 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9021 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9023 msg_print("The attack bounces!");
9026 if (is_original_ap(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
9029 /* Reflected bolts randomly target either one */
9030 if (one_in_(2)) flg |= PROJECT_PLAYER;
9031 else flg &= ~(PROJECT_PLAYER);
9033 /* The bolt is reflected */
9034 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9036 /* Don't affect the monster any longer */
9042 /* Find the closest point in the blast */
9045 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9049 effective_dist = dist;
9053 /* There is the riding player on this monster */
9054 if (p_ptr->riding && player_bold(y, x))
9056 /* Aimed on the player */
9057 if (flg & PROJECT_PLAYER)
9059 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9062 * A beam or bolt is well aimed
9064 * So don't affects the mount.
9071 * The spell is not well aimed,
9072 * So partly affect the mount too.
9079 * This grid is the original target.
9080 * Or aimed on your horse.
9082 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
9084 /* Hit the mount with full damage */
9088 * Otherwise this grid is not the
9089 * original target, it means that line
9090 * of fire is obstructed by this
9094 * A beam or bolt will hit either
9095 * player or mount. Choose randomly.
9097 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9101 /* Hit the mount with full damage */
9105 /* Hit the player later */
9106 flg |= PROJECT_PLAYER;
9108 /* Don't affect the mount */
9114 * The spell is not well aimed, so
9115 * partly affect both player and
9124 /* Affect the monster in the grid */
9125 if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
9129 /* Player affected one monster (without "jumping") */
9130 if (!who && (project_m_n == 1) && !jump)
9136 /* Track if possible */
9137 if (cave[y][x].m_idx > 0)
9139 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9141 /* Hack -- auto-recall */
9142 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9144 /* Hack - auto-track */
9145 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9152 if (flg & (PROJECT_KILL))
9154 /* Start with "dist" of zero */
9157 /* Scan for player */
9158 for (i = 0; i < grids; i++)
9162 /* Hack -- Notice new "dist" values */
9163 if (gm[dist+1] == i) dist++;
9165 /* Get the grid location */
9169 /* Affect the player? */
9170 if (!player_bold(y, x)) continue;
9172 /* Find the closest point in the blast */
9175 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9179 effective_dist = dist;
9182 /* Target may be your horse */
9185 /* Aimed on the player */
9186 if (flg & PROJECT_PLAYER)
9188 /* Hit the player with full damage */
9192 * Hack -- When this grid was not the
9193 * original target, a beam or bolt
9194 * would hit either player or mount,
9195 * and should be choosen randomly.
9197 * But already choosen to hit the
9198 * mount at this point.
9200 * Or aimed on your horse.
9202 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9205 * A beam or bolt is well aimed
9207 * So don't affects the player.
9214 * The spell is not well aimed,
9215 * So partly affect the player too.
9221 /* Affect the player */
9222 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9230 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9232 if (rakubadam_m > 0)
9234 if (rakuba(rakubadam_m, FALSE))
9237 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9239 msg_format("%^s has thrown you off!", m_name);
9243 if (p_ptr->riding && rakubadam_p > 0)
9245 if(rakuba(rakubadam_p, FALSE))
9248 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9250 msg_format("You have fallen from %s.", m_name);
9256 /* Return "something was noticed" */
9260 bool binding_field( int dam )
9262 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9263 int mirror_num=0; /* ¶À¤Î¿ô */
9268 int msec= delay_factor*delay_factor*delay_factor;
9274 /* Default target of monsterspell is player */
9275 monster_target_y=py;
9276 monster_target_x=px;
9278 for( x=0 ; x < cur_wid ; x++ )
9280 for( y=0 ; y < cur_hgt ; y++ )
9282 if( is_mirror_grid(&cave[y][x]) &&
9283 distance(py,px,y,x) <= MAX_RANGE &&
9284 distance(py,px,y,x) != 0 &&
9285 player_has_los_bold(y,x) &&
9286 projectable(py, px, y, x)
9288 mirror_y[mirror_num]=y;
9289 mirror_x[mirror_num]=x;
9295 if( mirror_num < 2 )return FALSE;
9297 point_x[0] = randint0( mirror_num );
9299 point_x[1] = randint0( mirror_num );
9301 while( point_x[0] == point_x[1] );
9303 point_y[0]=mirror_y[point_x[0]];
9304 point_x[0]=mirror_x[point_x[0]];
9305 point_y[1]=mirror_y[point_x[1]];
9306 point_x[1]=mirror_x[point_x[1]];
9310 x=point_x[0]+point_x[1]+point_x[2];
9311 y=point_y[0]+point_y[1]+point_y[2];
9313 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9314 - (point_y[0]*3-y)*(point_x[1]*3-x);
9315 if( centersign == 0 )return FALSE;
9317 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9318 x1 = x1 < point_x[2] ? x1 : point_x[2];
9319 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9320 y1 = y1 < point_y[2] ? y1 : point_y[2];
9322 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9323 x2 = x2 > point_x[2] ? x2 : point_x[2];
9324 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9325 y2 = y2 > point_y[2] ? y2 : point_y[2];
9327 for( y=y1 ; y <=y2 ; y++ ){
9328 for( x=x1 ; x <=x2 ; x++ ){
9329 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9330 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9331 centersign*( (point_x[1]-x)*(point_y[2]-y)
9332 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9333 centersign*( (point_x[2]-x)*(point_y[0]-y)
9334 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9336 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9337 /* Visual effects */
9339 && panel_contains(y,x)){
9340 p = bolt_pict(y,x,y,x, GF_MANA );
9341 print_rel(PICT_C(p), PICT_A(p),y,x);
9342 move_cursor_relative(y, x);
9343 /*if (fresh_before)*/ Term_fresh();
9344 Term_xtra(TERM_XTRA_DELAY, msec);
9350 for( y=y1 ; y <=y2 ; y++ ){
9351 for( x=x1 ; x <=x2 ; x++ ){
9352 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9353 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9354 centersign*( (point_x[1]-x)*(point_y[2]-y)
9355 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9356 centersign*( (point_x[2]-x)*(point_y[0]-y)
9357 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9359 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9360 (void)project_f(0,0,y,x,dam,GF_MANA);
9365 for( y=y1 ; y <=y2 ; y++ ){
9366 for( x=x1 ; x <=x2 ; x++ ){
9367 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9368 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9369 centersign*( (point_x[1]-x)*(point_y[2]-y)
9370 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9371 centersign*( (point_x[2]-x)*(point_y[0]-y)
9372 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9374 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9375 (void)project_o(0,0,y,x,dam,GF_MANA);
9380 for( y=y1 ; y <=y2 ; y++ ){
9381 for( x=x1 ; x <=x2 ; x++ ){
9382 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9383 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9384 centersign*( (point_x[1]-x)*(point_y[2]-y)
9385 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9386 centersign*( (point_x[2]-x)*(point_y[0]-y)
9387 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9389 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9390 (void)project_m(0,0,y,x,dam,GF_MANA,
9391 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9398 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9400 msg_print("The field broke a mirror");
9402 remove_mirror(point_y[0],point_x[0]);
9408 void seal_of_mirror( int dam )
9412 for( x = 0 ; x < cur_wid ; x++ )
9414 for( y = 0 ; y < cur_hgt ; y++ )
9416 if( is_mirror_grid(&cave[y][x]))
9418 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9419 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9421 if( !cave[y][x].m_idx )