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;
831 cave_alter_feat(y, x, FF_SPIKE);
833 c_ptr->mimic = old_mimic;
841 /* Check line of sight */
842 if (known && !c_ptr->mimic)
846 msg_format("%s¤Ë²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ³«¤«¤Ê¤¯¤Ê¤Ã¤¿¡£", f_name + f_ptr->name);
848 msg_format("The %s seems stuck.", f_name + f_ptr->name);
857 /* Destroy walls (and doors) */
860 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
862 cptr name = f_name + f_ptr->name;
865 if (known && (c_ptr->info & (CAVE_MARK)))
868 msg_format("%s¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª", name);
870 msg_format("The %s turns into mud!", name);
876 /* Destroy the wall */
877 cave_alter_feat(y, x, FF_HURT_ROCK);
879 /* Update some things */
880 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
889 /* Require a "naked" floor grid */
890 if (!cave_naked_bold(y, x)) break;
892 /* Not on the player */
893 if (player_bold(y, x)) break;
895 /* Create a closed door */
896 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
899 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
901 /* Update some things */
902 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
910 /* Require a "naked" floor grid */
911 if (!have_flag(f_ptr->flags, FF_FLOOR) || is_mirror_grid(c_ptr))
923 /* Require a "naked" floor grid */
924 if (!cave_naked_bold(y, x)) break;
926 /* Not on the player */
927 if (player_bold(y, x)) break;
929 /* Create a closed door */
930 cave_set_feat(y, x, FEAT_TREES);
933 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
935 /* Update some things */
936 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
943 /* Require a "naked" floor grid */
944 if (!cave_naked_bold(y, x)) break;
947 c_ptr->info |= CAVE_OBJECT;
948 c_ptr->mimic = FEAT_GLYPH;
961 /* Require a "naked" floor grid */
962 if (!cave_naked_bold(y, x)) break;
964 /* Not on the player */
965 if (player_bold(y, x)) break;
968 cave_set_feat(y, x, FEAT_WALL);
970 /* Update some things */
971 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
982 /* Require a "naked" floor grid */
983 if (!cave_naked_bold(y, x)) break;
985 /* Place a shallow lava */
986 cave_set_feat(y, x, FEAT_SHAL_LAVA);
991 /* Require a "naked" floor grid */
992 if (cave_perma_bold(y, x)) break;
994 /* Place a deep lava */
995 cave_set_feat(y, x, FEAT_DEEP_LAVA);
1005 /* Require a "naked" floor grid */
1006 if (!cave_naked_bold(y, x)) break;
1008 /* Place a shallow lava */
1009 cave_set_feat(y, x, FEAT_SHAL_WATER);
1014 /* Require a "naked" floor grid */
1015 if (cave_perma_bold(y, x)) break;
1017 /* Place a deep lava */
1018 cave_set_feat(y, x, FEAT_DEEP_WATER);
1023 /* Lite up the grid */
1027 /* Turn on the light */
1028 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) c_ptr->info |= (CAVE_GLOW);
1037 if (player_can_see_bold(y, x)) obvious = TRUE;
1039 /* Mega-Hack -- Update the monster in the affected grid */
1040 /* This allows "spear of light" (etc) to work "correctly" */
1041 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1046 /* Darken the grid */
1050 if (!p_ptr->inside_battle)
1053 if (player_can_see_bold(y, x)) obvious = TRUE;
1055 /* Turn off the light. */
1056 if (!is_mirror_grid(c_ptr))
1058 c_ptr->info &= ~(CAVE_GLOW);
1060 /* Hack -- Forget "boring" grids */
1061 if (!have_flag(f_ptr->flags, FF_REMEMBER))
1064 c_ptr->info &= ~(CAVE_MARK);
1074 /* Mega-Hack -- Update the monster in the affected grid */
1075 /* This allows "spear of light" (etc) to work "correctly" */
1076 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1085 if (is_mirror_grid(c_ptr))
1088 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1090 msg_print("The mirror was crashed!");
1092 remove_mirror(y, x);
1093 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1099 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
1102 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1104 msg_print("The mirror was crashed!");
1106 remove_mirror(y, x);
1107 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1114 /* Return "Anything seen?" */
1121 * We are called from "project()" to "damage" objects
1123 * We are called both for "beam" effects and "ball" effects.
1125 * Perhaps we should only SOMETIMES damage things on the ground.
1127 * The "r" parameter is the "distance from ground zero".
1129 * Note that we determine if the player can "see" anything that happens
1130 * by taking into account: blindness, line-of-sight, and illumination.
1132 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1134 * We return "TRUE" if the effect of the projection is "obvious".
1136 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1138 cave_type *c_ptr = &cave[y][x];
1140 s16b this_o_idx, next_o_idx = 0;
1142 bool obvious = FALSE;
1143 bool known = player_has_los_bold(y, x);
1145 u32b flgs[TR_FLAG_SIZE];
1147 char o_name[MAX_NLEN];
1150 bool is_potion = FALSE;
1154 who = who ? who : 0;
1156 /* Reduce damage by distance */
1157 dam = (dam + r) / (r + 1);
1160 /* Scan all objects in the grid */
1161 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1163 /* Acquire object */
1164 object_type *o_ptr = &o_list[this_o_idx];
1166 bool is_art = FALSE;
1167 bool ignore = FALSE;
1168 bool do_kill = FALSE;
1170 cptr note_kill = NULL;
1173 /* Get the "plural"-ness */
1174 bool plural = (o_ptr->number > 1);
1177 /* Acquire next object */
1178 next_o_idx = o_ptr->next_o_idx;
1180 /* Extract the flags */
1181 object_flags(o_ptr, flgs);
1183 /* Check for artifact */
1184 if ((artifact_p(o_ptr) || o_ptr->art_name)) is_art = TRUE;
1186 /* Analyze the type */
1189 /* Acid -- Lots of things */
1192 if (hates_acid(o_ptr))
1196 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1198 note_kill = (plural ? " melt!" : " melts!");
1201 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1206 /* Elec -- Rings and Wands */
1209 if (hates_elec(o_ptr))
1213 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1215 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1218 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1223 /* Fire -- Flammable objects */
1226 if (hates_fire(o_ptr))
1230 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1232 note_kill = (plural ? " burn up!" : " burns up!");
1235 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1240 /* Cold -- potions and flasks */
1243 if (hates_cold(o_ptr))
1246 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1248 note_kill = (plural ? " shatter!" : " shatters!");
1252 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1260 if (hates_fire(o_ptr))
1264 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1266 note_kill = (plural ? " burn up!" : " burns up!");
1269 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1271 if (hates_elec(o_ptr))
1276 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1278 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1281 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1289 if (hates_fire(o_ptr))
1293 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1295 note_kill = (plural ? " burn up!" : " burns up!");
1298 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1300 if (hates_cold(o_ptr))
1305 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1307 note_kill = (plural ? " shatter!" : " shatters!");
1310 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1315 /* Hack -- break potions and such */
1321 if (hates_cold(o_ptr))
1324 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1326 note_kill = (plural ? " shatter!" : " shatters!");
1334 /* Mana and Chaos -- destroy everything */
1341 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1343 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1349 case GF_DISINTEGRATE:
1353 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1355 note_kill = (plural ? " evaporate!" : " evaporates!");
1365 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1367 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1370 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1371 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1375 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1379 if (cursed_p(o_ptr))
1383 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1385 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1394 identify_item(o_ptr);
1396 /* Auto-inscription */
1397 autopick_alter_item((-this_o_idx), FALSE);
1405 /* Chests are noticed only if trapped or locked */
1406 if (o_ptr->tval == TV_CHEST)
1408 /* Disarm/Unlock traps */
1409 if (o_ptr->pval > 0)
1411 /* Disarm or Unlock */
1412 o_ptr->pval = (0 - o_ptr->pval);
1415 object_known(o_ptr);
1418 if (known && o_ptr->marked)
1421 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1423 msg_print("Click!");
1435 if (o_ptr->tval == TV_CORPSE)
1440 if (!who || is_pet(&m_list[who]))
1441 mode |= PM_FORCE_PET;
1443 for (i = 0; i < o_ptr->number ; i++)
1445 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1446 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1451 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1453 note_kill = (plural ? " become dust." : " becomes dust.");
1458 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1461 note_kill = "À¸¤Ê֤ä¿¡£";
1463 note_kill = "rivived.";
1466 else if (!note_kill)
1469 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1471 note_kill = (plural ? " become dust." : " becomes dust.");
1483 /* Attempt to destroy the object */
1486 /* Effect "observed" */
1487 if (known && o_ptr->marked)
1490 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1493 /* Artifacts, and other objects, get to resist */
1494 if (is_art || ignore)
1496 /* Observe the resist */
1497 if (known && o_ptr->marked)
1500 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1503 msg_format("The %s %s unaffected!",
1504 o_name, (plural ? "are" : "is"));
1513 /* Describe if needed */
1514 if (known && o_ptr->marked && note_kill)
1517 msg_format("%s¤Ï%s", o_name, note_kill);
1519 msg_format("The %s%s", o_name, note_kill);
1524 k_idx = o_ptr->k_idx;
1525 is_potion = object_is_potion(o_ptr);
1528 /* Delete the object */
1529 delete_object_idx(this_o_idx);
1531 /* Potions produce effects when 'shattered' */
1534 (void)potion_smash_effect(who, y, x, k_idx);
1543 /* Return "Anything seen?" */
1549 * Helper function for "project()" below.
1551 * Handle a beam/bolt/ball causing damage to a monster.
1553 * This routine takes a "source monster" (by index) which is mostly used to
1554 * determine if the player is causing the damage, and a "radius" (see below),
1555 * which is used to decrease the power of explosions with distance, and a
1556 * location, via integers which are modified by certain types of attacks
1557 * (polymorph and teleport being the obvious ones), a default damage, which
1558 * is modified as needed based on various properties, and finally a "damage
1559 * type" (see below).
1561 * Note that this routine can handle "no damage" attacks (like teleport) by
1562 * taking a "zero" damage, and can even take "parameters" to attacks (like
1563 * confuse) by accepting a "damage", using it to calculate the effect, and
1564 * then setting the damage to zero. Note that the "damage" parameter is
1565 * divided by the radius, so monsters not at the "epicenter" will not take
1566 * as much damage (or whatever)...
1568 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1569 * may result in a dereference of an invalid pointer. XXX XXX XXX
1571 * Various messages are produced, and damage is applied.
1573 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1574 * actually be "made" of that substance, or "breathe" big balls of it.
1576 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1579 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1580 * and hurts evil less. If can breath nether, then it resists it as well.
1582 * Damage reductions use the following formulas:
1583 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1584 * gives avg damage of .655, ranging from .858 to .500
1585 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1586 * gives avg damage of .544, ranging from .714 to .417
1587 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1588 * gives avg damage of .444, ranging from .556 to .333
1589 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1590 * gives avg damage of .327, ranging from .427 to .250
1591 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1592 * gives something simple.
1594 * In this function, "result" messages are postponed until the end, where
1595 * the "note" string is appended to the monster name, if not NULL. So,
1596 * to make a spell have "no effect" just set "note" to NULL. You should
1597 * also set "notice" to FALSE, or the player will learn what the spell does.
1599 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1601 /* "flg" was added. */
1602 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1606 cave_type *c_ptr = &cave[y][x];
1608 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1610 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1614 /* Is the monster "seen"? */
1615 bool seen = m_ptr->ml;
1617 bool slept = (bool)(m_ptr->csleep > 0);
1619 /* Were the effects "obvious" (if seen)? */
1620 bool obvious = FALSE;
1622 /* Can the player know about this effect? */
1623 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1625 /* Can the player see the source of this effect? */
1626 bool see_s = ((who <= 0) || m_list[who].ml);
1628 /* Were the effects "irrelevant"? */
1629 bool skipped = FALSE;
1631 /* Gets the monster angry at the source of the effect? */
1632 bool get_angry = FALSE;
1634 /* Polymorph setting (true or false) */
1635 bool do_poly = FALSE;
1637 /* Teleport setting (max distance) */
1640 /* Confusion setting (amount to confuse) */
1643 /* Stunning setting (amount to stun) */
1646 /* Sleep amount (amount to sleep) */
1649 /* Fear amount (amount to fear) */
1652 /* Time amount (amount to time) */
1655 bool heal_leper = FALSE;
1657 /* Hold the monster name */
1666 /* Assume no note */
1669 /* Assume a default death */
1670 cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
1675 int caster_lev = (who > 0) ? r_info[m_list[who].r_idx].level : p_ptr->lev * 2;
1678 if (!c_ptr->m_idx) return (FALSE);
1680 /* Never affect projector */
1681 if (who && (c_ptr->m_idx == who)) return (FALSE);
1682 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1683 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1685 /* Don't affect already death monsters */
1686 /* Prevents problems with chain reactions of exploding monsters */
1687 if (m_ptr->hp < 0) return (FALSE);
1689 /* Reduce damage by distance */
1690 dam = (dam + r) / (r + 1);
1693 /* Get the monster name (BEFORE polymorphing) */
1694 monster_desc(m_name, m_ptr, 0);
1697 /* Get the monster possessive ("his"/"her"/"its") */
1698 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1702 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1704 /* Analyze the damage type */
1707 /* Magic Missile -- pure damage */
1710 if (seen) obvious = TRUE;
1712 if (r_ptr->flagsr & RFR_RES_ALL)
1715 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1717 note = " is immune.";
1720 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1729 if (seen) obvious = TRUE;
1731 if (r_ptr->flagsr & RFR_RES_ALL)
1734 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1736 note = " is immune.";
1739 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1742 if (r_ptr->flagsr & RFR_IM_ACID)
1745 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1747 note = " resists a lot.";
1751 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1759 if (seen) obvious = TRUE;
1761 if (r_ptr->flagsr & RFR_RES_ALL)
1764 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1766 note = " is immune.";
1769 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1772 if (r_ptr->flagsr & RFR_IM_ELEC)
1775 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1777 note = " resists a lot.";
1781 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1789 if (seen) obvious = TRUE;
1791 if (r_ptr->flagsr & RFR_RES_ALL)
1794 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1796 note = " is immune.";
1799 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1802 if (r_ptr->flagsr & RFR_IM_FIRE)
1805 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1807 note = " resists a lot.";
1811 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1813 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1816 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1818 note = " is hit hard.";
1822 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1830 if (seen) obvious = TRUE;
1832 if (r_ptr->flagsr & RFR_RES_ALL)
1835 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1837 note = " is immune.";
1840 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1843 if (r_ptr->flagsr & RFR_IM_COLD)
1846 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1848 note = " resists a lot.";
1852 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1854 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1857 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1859 note = " is hit hard.";
1863 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1871 if (seen) obvious = TRUE;
1873 if (r_ptr->flagsr & RFR_RES_ALL)
1876 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1878 note = " is immune.";
1881 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1884 if (r_ptr->flagsr & RFR_IM_POIS)
1887 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1889 note = " resists a lot.";
1893 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1901 if (seen) obvious = TRUE;
1903 if (r_ptr->flagsr & RFR_RES_ALL)
1906 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1908 note = " is immune.";
1911 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1914 if (r_ptr->flagsr & RFR_IM_POIS)
1917 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
1922 dam *= 3; dam /= randint1(6) + 6;
1923 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1925 else if (one_in_(3)) do_poly = TRUE;
1929 /* Hellfire -- hurts Evil */
1932 if (seen) obvious = TRUE;
1934 if (r_ptr->flagsr & RFR_RES_ALL)
1937 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1939 note = " is immune.";
1942 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1945 if (r_ptr->flags3 & RF3_GOOD)
1949 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
1951 note = " is hit hard.";
1954 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1959 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1962 if (seen) obvious = TRUE;
1964 if (r_ptr->flagsr & RFR_RES_ALL)
1967 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1969 note = " is immune.";
1972 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1975 if (r_ptr->flags3 & RF3_GOOD)
1979 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
1981 note = " is immune.";
1984 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
1986 else if (r_ptr->flags3 & RF3_EVIL)
1990 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
1992 note = " is hit hard.";
1995 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
2000 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2005 dam *= 3; dam /= randint1(6) + 6;
2010 /* Arrow -- XXX no defense */
2013 if (seen) obvious = TRUE;
2015 if (r_ptr->flagsr & RFR_RES_ALL)
2018 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2020 note = " is immune.";
2023 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2029 /* Plasma -- XXX perhaps check ELEC or FIRE */
2032 if (seen) obvious = TRUE;
2034 if (r_ptr->flagsr & RFR_RES_ALL)
2037 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2039 note = " is immune.";
2042 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2045 if (r_ptr->flagsr & RFR_RES_PLAS)
2048 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2053 dam *= 3; dam /= randint1(6) + 6;
2054 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
2059 /* Nether -- see above */
2062 if (seen) obvious = TRUE;
2064 if (r_ptr->flagsr & RFR_RES_ALL)
2067 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2069 note = " is immune.";
2072 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2075 if (r_ptr->flagsr & RFR_RES_NETH)
2077 if (r_ptr->flags3 & RF3_UNDEAD)
2080 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2082 note = " is immune.";
2086 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2091 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2096 dam *= 3; dam /= randint1(6) + 6;
2098 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
2100 else if (r_ptr->flags3 & RF3_EVIL)
2104 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2106 note = " resists somewhat.";
2109 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2114 /* Water (acid) damage -- Water spirits/elementals are immune */
2117 if (seen) obvious = TRUE;
2119 if (r_ptr->flagsr & RFR_RES_ALL)
2122 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2124 note = " is immune.";
2127 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2130 if (r_ptr->flagsr & RFR_RES_WATE)
2132 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
2135 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2137 note = " is immune.";
2145 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2150 dam *= 3; dam /= randint1(6) + 6;
2152 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
2157 /* Chaos -- Chaos breathers resist */
2160 if (seen) obvious = TRUE;
2162 if (r_ptr->flagsr & RFR_RES_ALL)
2165 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2167 note = " is immune.";
2170 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2173 if (r_ptr->flagsr & RFR_RES_CHAO)
2176 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2181 dam *= 3; dam /= randint1(6) + 6;
2182 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
2184 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
2187 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2189 note = " resists somewhat.";
2192 dam *= 3; dam /= randint1(6) + 6;
2193 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2198 do_conf = (5 + randint1(11) + r) / (r + 1);
2203 /* Shards -- Shard breathers resist */
2206 if (seen) obvious = TRUE;
2208 if (r_ptr->flagsr & RFR_RES_ALL)
2211 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2213 note = " is immune.";
2216 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2219 if (r_ptr->flagsr & RFR_RES_SHAR)
2222 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2227 dam *= 3; dam /= randint1(6) + 6;
2228 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2233 /* Rocket: Shard resistance helps */
2236 if (seen) obvious = TRUE;
2238 if (r_ptr->flagsr & RFR_RES_ALL)
2241 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2243 note = " is immune.";
2246 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2249 if (r_ptr->flagsr & RFR_RES_SHAR)
2252 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2254 note = " resists somewhat.";
2258 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2264 /* Sound -- Sound breathers resist */
2267 if (seen) obvious = TRUE;
2269 if (r_ptr->flagsr & RFR_RES_ALL)
2272 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2274 note = " is immune.";
2277 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2280 if (r_ptr->flagsr & RFR_RES_SOUN)
2283 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2288 dam *= 2; dam /= randint1(6) + 6;
2289 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
2291 else do_stun = (10 + randint1(15) + r) / (r + 1);
2298 if (seen) obvious = TRUE;
2300 if (r_ptr->flagsr & RFR_RES_ALL)
2303 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2305 note = " is immune.";
2308 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2311 if (r_ptr->flags3 & RF3_NO_CONF)
2314 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2319 dam *= 3; dam /= randint1(6) + 6;
2320 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2322 else do_conf = (10 + randint1(15) + r) / (r + 1);
2326 /* Disenchantment -- Breathers and Disenchanters resist */
2329 if (seen) obvious = TRUE;
2331 if (r_ptr->flagsr & RFR_RES_ALL)
2334 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2336 note = " is immune.";
2339 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2342 if (r_ptr->flagsr & RFR_RES_DISE)
2345 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2350 dam *= 3; dam /= randint1(6) + 6;
2351 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
2356 /* Nexus -- Breathers and Existers resist */
2359 if (seen) obvious = TRUE;
2361 if (r_ptr->flagsr & RFR_RES_ALL)
2364 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2366 note = " is immune.";
2369 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2372 if (r_ptr->flagsr & RFR_RES_NEXU)
2375 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2380 dam *= 3; dam /= randint1(6) + 6;
2381 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
2389 if (seen) obvious = TRUE;
2391 if (r_ptr->flagsr & RFR_RES_ALL)
2394 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2396 note = " is immune.";
2399 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2402 if (r_ptr->flagsr & RFR_RES_WALL)
2405 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2410 dam *= 3; dam /= randint1(6) + 6;
2411 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
2413 else do_stun = (randint1(15) + r) / (r + 1);
2417 /* Inertia -- breathers resist */
2420 if (seen) obvious = TRUE;
2422 if (r_ptr->flagsr & RFR_RES_ALL)
2425 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2427 note = " is immune.";
2430 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2433 if (r_ptr->flagsr & RFR_RES_INER)
2436 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2441 dam *= 3; dam /= randint1(6) + 6;
2442 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
2446 /* Powerful monsters can resist */
2447 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2448 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2452 /* Normal monsters slow down */
2458 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2460 note = " starts moving slower.";
2463 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2464 if (c_ptr->m_idx == p_ptr->riding)
2465 p_ptr->update |= (PU_BONUS);
2471 /* Time -- breathers resist */
2474 if (seen) obvious = TRUE;
2476 if (r_ptr->flagsr & RFR_RES_ALL)
2479 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2481 note = " is immune.";
2484 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2487 if (r_ptr->flagsr & RFR_RES_TIME)
2490 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2495 dam *= 3; dam /= randint1(6) + 6;
2496 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
2498 else do_time = (dam + 1) / 2;
2502 /* Gravity -- breathers resist */
2505 bool resist_tele = FALSE;
2507 if (seen) obvious = TRUE;
2509 if (r_ptr->flagsr & RFR_RES_ALL)
2512 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2514 note = " is immune.";
2517 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2520 if (r_ptr->flagsr & RFR_RES_TELE)
2522 if (r_ptr->flags1 & (RF1_UNIQUE))
2524 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2526 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2528 note = " is unaffected!";
2533 else if (r_ptr->level > randint1(100))
2535 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2537 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2546 if (!resist_tele) do_dist = 10;
2548 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2550 if (r_ptr->flagsr & RFR_RES_GRAV)
2553 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2558 dam *= 3; dam /= randint1(6) + 6;
2560 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
2565 /* Powerful monsters can resist */
2566 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2567 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2571 /* Normal monsters slow down */
2577 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2579 note = " starts moving slower.";
2582 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2583 if (c_ptr->m_idx == p_ptr->riding)
2584 p_ptr->update |= (PU_BONUS);
2588 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2590 /* Attempt a saving throw */
2591 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2592 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2596 /* No obvious effect */
2598 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2600 note = " is unaffected!";
2614 if (seen) obvious = TRUE;
2616 if (r_ptr->flagsr & RFR_RES_ALL)
2619 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2621 note = " is immune.";
2624 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2632 case GF_DISINTEGRATE:
2634 if (seen) obvious = TRUE;
2636 if (r_ptr->flagsr & RFR_RES_ALL)
2639 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2641 note = " is immune.";
2644 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2647 if (r_ptr->flags3 & RF3_HURT_ROCK)
2649 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2651 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2652 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2654 note = " loses some skin!";
2655 note_dies = " evaporates!";
2665 if (seen) obvious = TRUE;
2667 /* PSI only works if the monster can see you! -- RG */
2668 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2671 if (seen) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name);
2673 if (seen) msg_format("%^s can't see you, and isn't affected!", m_name);
2679 if (r_ptr->flagsr & RFR_RES_ALL)
2682 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2684 note = " is immune.";
2687 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2690 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2694 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2696 note = " is immune!";
2698 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2701 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2702 (r_ptr->flags3 & RF3_ANIMAL) ||
2703 (r_ptr->level > randint1(3 * dam)))
2707 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2714 * Powerful demons & undead can turn a mindcrafter's
2715 * attacks back on them
2717 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2718 (r_ptr->level > p_ptr->lev / 2) &&
2723 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2725 msg_format("%^s%s corrupted mind backlashes your attack!",
2726 m_name, (seen ? "'s" : "s"));
2730 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2733 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2735 msg_print("You resist the effects!");
2741 /* Injure +/- confusion */
2742 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2743 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2746 switch (randint1(4))
2749 set_confused(p_ptr->confused + 3 + randint1(dam));
2752 set_stun(p_ptr->stun + randint1(dam));
2756 if (r_ptr->flags3 & RF3_NO_FEAR)
2758 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2760 note = " is unaffected.";
2764 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2768 if (!p_ptr->free_act)
2769 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2778 if ((dam > 0) && one_in_(4))
2780 switch (randint1(4))
2783 do_conf = 3 + randint1(dam);
2786 do_stun = 3 + randint1(dam);
2789 do_fear = 3 + randint1(dam);
2793 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2795 note = " falls asleep!";
2798 do_sleep = 3 + randint1(dam);
2804 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2806 note_dies = " collapses, a mindless husk.";
2814 if (seen) obvious = TRUE;
2816 if (r_ptr->flagsr & RFR_RES_ALL)
2819 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2821 note = " is immune.";
2824 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2827 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2831 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2833 note = " is immune!";
2837 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2838 (r_ptr->flags3 & RF3_ANIMAL) ||
2839 (r_ptr->level > randint1(3 * dam)))
2843 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2850 * Powerful demons & undead can turn a mindcrafter's
2851 * attacks back on them
2853 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2854 (r_ptr->level > p_ptr->lev / 2) &&
2859 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2861 msg_format("%^s%s corrupted mind backlashes your attack!",
2862 m_name, (seen ? "'s" : "s"));
2866 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2869 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2871 msg_print("You resist the effects!");
2877 /* Injure + mana drain */
2878 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2880 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
2882 msg_print("Your psychic energy is drained!");
2885 p_ptr->csp -= damroll(5, dam) / 2;
2886 if (p_ptr->csp < 0) p_ptr->csp = 0;
2887 p_ptr->redraw |= PR_MANA;
2888 p_ptr->window |= (PW_SPELL);
2889 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2896 int b = damroll(5, dam) / 4;
2898 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª", m_name);
2900 msg_format("You convert %s%s pain into psychic energy!",
2901 m_name, (seen ? "'s" : "s"));
2904 b = MIN(p_ptr->msp, p_ptr->csp + b);
2906 p_ptr->redraw |= PR_MANA;
2907 p_ptr->window |= (PW_SPELL);
2911 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2913 note_dies = " collapses, a mindless husk.";
2919 case GF_TELEKINESIS:
2921 if (seen) obvious = TRUE;
2923 if (r_ptr->flagsr & RFR_RES_ALL)
2926 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2928 note = " is immune.";
2931 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2936 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2941 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2943 /* Attempt a saving throw */
2944 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2945 (r_ptr->level > 5 + randint1(dam)))
2949 /* No obvious effect */
2955 /* Psycho-spear -- powerful magic missile */
2958 if (seen) obvious = TRUE;
2960 if (r_ptr->flagsr & RFR_RES_ALL)
2963 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2965 note = " is immune.";
2968 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2974 /* Meteor -- powerful magic missile */
2977 if (seen) obvious = TRUE;
2979 if (r_ptr->flagsr & RFR_RES_ALL)
2982 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2984 note = " is immune.";
2987 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2995 if (!is_hostile(m_ptr)) break;
2997 if (seen) obvious = TRUE;
2999 if (r_ptr->flagsr & RFR_RES_ALL)
3002 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3004 note = " is immune.";
3007 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3010 /* Attempt a saving throw */
3011 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
3012 (r_ptr->flags3 & RF3_NO_CONF) ||
3013 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3015 /* Memorize a flag */
3016 if (r_ptr->flags3 & RF3_NO_CONF)
3018 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3025 * Powerful demons & undead can turn a mindcrafter's
3026 * attacks back on them
3028 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
3029 (r_ptr->level > p_ptr->lev / 2) &&
3034 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
3036 msg_format("%^s%s corrupted mind backlashes your attack!",
3037 m_name, (seen ? "'s" : "s"));
3041 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3044 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3046 msg_print("You resist the effects!");
3052 /* Confuse, stun, terrify */
3053 switch (randint1(4))
3056 set_stun(p_ptr->stun + dam / 2);
3059 set_confused(p_ptr->confused + dam / 2);
3063 if (r_ptr->flags3 & RF3_NO_FEAR)
3065 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3067 note = " is unaffected.";
3071 set_afraid(p_ptr->afraid + dam);
3078 /* No obvious effect */
3080 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3082 note = " is unaffected!";
3090 if ((dam > 29) && (randint1(100) < dam))
3093 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3095 note = " is in your thrall!";
3102 switch (randint1(4))
3116 /* No "real" damage */
3123 /* Ice -- Cold + Cuts + Stun */
3126 if (seen) obvious = TRUE;
3128 if (r_ptr->flagsr & RFR_RES_ALL)
3131 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3133 note = " is immune.";
3136 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3139 do_stun = (randint1(15) + 1) / (r + 1);
3140 if (r_ptr->flagsr & RFR_IM_COLD)
3143 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3145 note = " resists a lot.";
3149 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
3151 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3154 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3156 note = " is hit hard.";
3160 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3169 if (seen) obvious = TRUE;
3171 if (r_ptr->flagsr & RFR_RES_ALL)
3174 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3176 note = " is immune.";
3179 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3182 if (!monster_living(r_ptr))
3186 if (is_original_ap(m_ptr))
3188 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3189 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3190 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3195 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3197 note = " is unaffected!";
3203 else do_time = (dam+7)/8;
3211 if (seen) obvious = TRUE;
3213 if (r_ptr->flagsr & RFR_RES_ALL)
3216 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3218 note = " is immune.";
3221 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3224 if (!monster_living(r_ptr))
3228 if (is_original_ap(m_ptr))
3230 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3231 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3232 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3237 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3239 note = " is immune.";
3245 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3246 (randint1(888) != 666)) ||
3247 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
3248 randint1(100) != 66))
3251 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3263 /* Polymorph monster (Use "dam" as "power") */
3266 if (seen) obvious = TRUE;
3268 if (r_ptr->flagsr & RFR_RES_ALL)
3271 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3273 note = " is immune.";
3276 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3279 /* Attempt to polymorph (see below) */
3282 /* Powerful monsters can resist */
3283 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3284 (r_ptr->flags1 & RF1_QUESTOR) ||
3285 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3288 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3290 note = " is unaffected!";
3297 /* No "real" damage */
3304 /* Clone monsters (Ignore "dam") */
3307 if (seen) obvious = TRUE;
3309 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
3312 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3314 note = " is unaffected!";
3320 m_ptr->hp = m_ptr->maxhp;
3322 /* Attempt to clone. */
3323 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3326 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3334 /* No "real" damage */
3341 /* Heal Monster (use "dam" as amount of healing) */
3344 if (seen) obvious = TRUE;
3349 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3351 if (m_ptr->maxhp < m_ptr->max_maxhp)
3354 msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3356 msg_format("%^s recovers %s vitality.", m_name, m_poss);
3358 m_ptr->maxhp = m_ptr->max_maxhp;
3364 if (seen) obvious = TRUE;
3369 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3374 msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3376 msg_format("%^s is no longer stunned.", m_name);
3380 if (m_ptr->confused)
3383 msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3385 msg_format("%^s is no longer confused.", m_name);
3387 m_ptr->confused = 0;
3392 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3394 msg_format("%^s recovers %s courage.", m_name, m_poss);
3400 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3403 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3405 chg_virtue(V_VITALITY, 1);
3407 if (r_ptr->flags1 & RF1_UNIQUE)
3408 chg_virtue(V_INDIVIDUALISM, 1);
3410 if (is_friendly(m_ptr))
3411 chg_virtue(V_HONOUR, 1);
3412 else if (!(r_ptr->flags3 & RF3_EVIL))
3414 if (r_ptr->flags3 & RF3_GOOD)
3415 chg_virtue(V_COMPASSION, 2);
3417 chg_virtue(V_COMPASSION, 1);
3420 if (m_ptr->r_idx == MON_LEPER)
3423 chg_virtue(V_COMPASSION, 5);
3426 if (r_ptr->flags3 & RF3_ANIMAL)
3427 chg_virtue(V_NATURE, 1);
3429 /* Redraw (later) if needed */
3430 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3431 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3435 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3437 note = " looks healthier.";
3441 /* No "real" damage */
3447 /* Speed Monster (Ignore "dam") */
3450 if (seen) obvious = TRUE;
3456 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3458 note = " starts moving faster.";
3461 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3463 if (c_ptr->m_idx == p_ptr->riding)
3464 p_ptr->update |= (PU_BONUS);
3466 if (r_ptr->flags1 & RF1_UNIQUE)
3467 chg_virtue(V_INDIVIDUALISM, 1);
3468 if (is_friendly(m_ptr))
3469 chg_virtue(V_HONOUR, 1);
3471 /* No "real" damage */
3477 /* Slow Monster (Use "dam" as "power") */
3480 if (seen) obvious = TRUE;
3482 if (r_ptr->flagsr & RFR_RES_ALL)
3485 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3487 note = " is immune.";
3490 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3493 /* Powerful monsters can resist */
3494 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3495 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3498 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3500 note = " is unaffected!";
3506 /* Normal monsters slow down */
3512 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3514 note = " starts moving slower.";
3517 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3519 if (c_ptr->m_idx == p_ptr->riding)
3520 p_ptr->update |= (PU_BONUS);
3523 /* No "real" damage */
3529 /* Sleep (Use "dam" as "power") */
3532 if (seen) obvious = TRUE;
3534 if (r_ptr->flagsr & RFR_RES_ALL)
3537 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3539 note = " is immune.";
3542 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3545 /* Attempt a saving throw */
3546 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3547 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3548 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3550 /* Memorize a flag */
3551 if (r_ptr->flags3 & RF3_NO_SLEEP)
3553 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3556 /* No obvious effect */
3558 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3560 note = " is unaffected!";
3567 /* Go to sleep (much) later */
3569 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3571 note = " falls asleep!";
3577 /* No "real" damage */
3583 /* Sleep (Use "dam" as "power") */
3584 case GF_STASIS_EVIL:
3586 if (seen) obvious = TRUE;
3588 if (r_ptr->flagsr & RFR_RES_ALL)
3591 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3593 note = " is immune.";
3596 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3599 /* Attempt a saving throw */
3600 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3601 !(r_ptr->flags3 & RF3_EVIL) ||
3602 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3605 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3607 note = " is unaffected!";
3614 /* Go to sleep (much) later */
3616 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3618 note = " is suspended!";
3624 /* No "real" damage */
3629 /* Sleep (Use "dam" as "power") */
3632 if (seen) obvious = TRUE;
3634 if (r_ptr->flagsr & RFR_RES_ALL)
3637 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3639 note = " is immune.";
3642 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3645 /* Attempt a saving throw */
3646 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3647 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3650 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3652 note = " is unaffected!";
3659 /* Go to sleep (much) later */
3661 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3663 note = " is suspended!";
3669 /* No "real" damage */
3678 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3679 vir = virtue_number(V_HARMONY);
3682 dam += p_ptr->virtues[vir-1]/10;
3685 vir = virtue_number(V_INDIVIDUALISM);
3688 dam -= p_ptr->virtues[vir-1]/20;
3691 if (seen) obvious = TRUE;
3693 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3696 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3698 note = " is immune.";
3701 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3705 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3708 /* Attempt a saving throw */
3709 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3710 (r_ptr->flags3 & RF3_NO_CONF) ||
3711 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3712 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3714 /* Memorize a flag */
3715 if (r_ptr->flags3 & RF3_NO_CONF)
3717 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3721 /* No obvious effect */
3723 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3725 note = " is unaffected!";
3730 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3732 else if (p_ptr->cursed & TRC_AGGRAVATE)
3735 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3737 note = " hates you too much!";
3740 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3745 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3747 note = " suddenly seems friendly!";
3752 chg_virtue(V_INDIVIDUALISM, -1);
3753 if (r_ptr->flags3 & RF3_ANIMAL)
3754 chg_virtue(V_NATURE, 1);
3757 /* No "real" damage */
3762 /* Control undead */
3763 case GF_CONTROL_UNDEAD:
3766 if (seen) obvious = TRUE;
3768 vir = virtue_number(V_UNLIFE);
3771 dam += p_ptr->virtues[vir-1]/10;
3774 vir = virtue_number(V_INDIVIDUALISM);
3777 dam -= p_ptr->virtues[vir-1]/20;
3780 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3783 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3785 note = " is immune.";
3788 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3792 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3795 /* Attempt a saving throw */
3796 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3797 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3798 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3799 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3801 /* No obvious effect */
3803 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3805 note = " is unaffected!";
3809 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3811 else if (p_ptr->cursed & TRC_AGGRAVATE)
3814 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3816 note = " hates you too much!";
3819 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3824 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3826 note = " is in your thrall!";
3832 /* No "real" damage */
3838 case GF_CONTROL_DEMON:
3841 if (seen) obvious = TRUE;
3843 vir = virtue_number(V_UNLIFE);
3846 dam += p_ptr->virtues[vir-1]/10;
3849 vir = virtue_number(V_INDIVIDUALISM);
3852 dam -= p_ptr->virtues[vir-1]/20;
3855 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3858 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3860 note = " is immune.";
3863 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3867 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3870 /* Attempt a saving throw */
3871 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3872 (!(r_ptr->flags3 & RF3_DEMON)) ||
3873 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3874 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3876 /* No obvious effect */
3878 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3880 note = " is unaffected!";
3884 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3886 else if (p_ptr->cursed & TRC_AGGRAVATE)
3889 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3891 note = " hates you too much!";
3894 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3899 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3901 note = " is in your thrall!";
3907 /* No "real" damage */
3913 case GF_CONTROL_ANIMAL:
3917 if (seen) obvious = TRUE;
3919 vir = virtue_number(V_NATURE);
3922 dam += p_ptr->virtues[vir-1]/10;
3925 vir = virtue_number(V_INDIVIDUALISM);
3928 dam -= p_ptr->virtues[vir-1]/20;
3931 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3934 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3936 note = " is immune.";
3939 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3943 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3946 /* Attempt a saving throw */
3947 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3948 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
3949 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3950 (r_ptr->flags3 & (RF3_NO_CONF)) ||
3951 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3953 /* Memorize a flag */
3954 if (r_ptr->flags3 & (RF3_NO_CONF))
3956 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3960 /* No obvious effect */
3962 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3964 note = " is unaffected!";
3968 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3970 else if (p_ptr->cursed & TRC_AGGRAVATE)
3973 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3975 note = " hates you too much!";
3978 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3983 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
3985 note = " is tamed!";
3990 if (r_ptr->flags3 & RF3_ANIMAL)
3991 chg_virtue(V_NATURE, 1);
3994 /* No "real" damage */
4000 case GF_CONTROL_LIVING:
4004 vir = virtue_number(V_UNLIFE);
4005 if (seen) obvious = TRUE;
4007 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4008 vir = virtue_number(V_UNLIFE);
4011 dam -= p_ptr->virtues[vir-1]/10;
4014 vir = virtue_number(V_INDIVIDUALISM);
4017 dam -= p_ptr->virtues[vir-1]/20;
4020 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4021 if (dam < 1) dam = 1;
4023 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4025 msg_format("You stare into %s.", m_name);
4027 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4030 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4032 note = " is immune.";
4035 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4039 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4042 /* Attempt a saving throw */
4043 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4044 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4045 !monster_living(r_ptr) ||
4046 ((r_ptr->level+10) > randint1(dam)))
4049 /* No obvious effect */
4051 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4053 note = " is unaffected!";
4057 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4059 else if (p_ptr->cursed & TRC_AGGRAVATE)
4062 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4064 note = " hates you too much!";
4067 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4072 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4074 note = " is tamed!";
4079 if (r_ptr->flags3 & RF3_ANIMAL)
4080 chg_virtue(V_NATURE, 1);
4083 /* No "real" damage */
4088 /* Confusion (Use "dam" as "power") */
4091 if (seen) obvious = TRUE;
4093 if (r_ptr->flagsr & RFR_RES_ALL)
4096 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4098 note = " is immune.";
4101 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4104 /* Get confused later */
4105 do_conf = damroll(3, (dam / 2)) + 1;
4107 /* Attempt a saving throw */
4108 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4109 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4110 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4112 /* Memorize a flag */
4113 if (r_ptr->flags3 & (RF3_NO_CONF))
4115 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4121 /* No obvious effect */
4123 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4125 note = " is unaffected!";
4131 /* No "real" damage */
4138 if (seen) obvious = TRUE;
4140 if (r_ptr->flagsr & RFR_RES_ALL)
4143 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4145 note = " is immune.";
4148 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4151 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
4153 /* Attempt a saving throw */
4154 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4155 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4160 /* No obvious effect */
4162 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4164 note = " is unaffected!";
4170 /* No "real" damage */
4178 /* Lite, but only hurts susceptible creatures */
4186 if (r_ptr->flagsr & RFR_RES_ALL)
4192 if (r_ptr->flags3 & (RF3_HURT_LITE))
4196 /* Obvious effect */
4199 /* Memorize the effects */
4200 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4203 /* Special effect */
4205 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4206 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4208 note = " cringes from the light!";
4209 note_dies = " shrivels away in the light!";
4214 /* Normally no damage */
4226 /* Lite -- opposite of Dark */
4229 if (seen) obvious = TRUE;
4231 if (r_ptr->flagsr & RFR_RES_ALL)
4234 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4236 note = " is immune.";
4239 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4242 if (r_ptr->flagsr & RFR_RES_LITE)
4245 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4250 dam *= 2; dam /= (randint1(6)+6);
4251 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4253 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4255 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4257 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4258 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4260 note = " cringes from the light!";
4261 note_dies = " shrivels away in the light!";
4270 /* Dark -- opposite of Lite */
4273 if (seen) obvious = TRUE;
4275 if (r_ptr->flagsr & RFR_RES_ALL)
4278 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4280 note = " is immune.";
4283 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4286 if (r_ptr->flagsr & RFR_RES_DARK)
4289 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4294 dam *= 2; dam /= (randint1(6)+6);
4295 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4304 if (r_ptr->flagsr & RFR_RES_ALL)
4309 /* Hurt by rock remover */
4310 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4317 /* Memorize the effects */
4318 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4321 /* Cute little message */
4323 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4324 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4326 note = " loses some skin!";
4327 note_dies = " dissolves!";
4332 /* Usually, ignore the effects */
4343 /* Teleport undead (Use "dam" as "power") */
4344 case GF_AWAY_UNDEAD:
4346 /* Only affect undead */
4347 if (r_ptr->flags3 & (RF3_UNDEAD))
4349 bool resists_tele = FALSE;
4351 if (r_ptr->flagsr & RFR_RES_TELE)
4353 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4355 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4357 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4359 note = " is unaffected!";
4362 resists_tele = TRUE;
4364 else if (r_ptr->level > randint1(100))
4366 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4368 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4373 resists_tele = TRUE;
4382 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4395 /* No "real" damage */
4401 /* Teleport evil (Use "dam" as "power") */
4404 /* Only affect evil */
4405 if (r_ptr->flags3 & (RF3_EVIL))
4407 bool resists_tele = FALSE;
4409 if (r_ptr->flagsr & RFR_RES_TELE)
4411 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4413 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4415 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4417 note = " is unaffected!";
4420 resists_tele = TRUE;
4422 else if (r_ptr->level > randint1(100))
4424 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4426 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4431 resists_tele = TRUE;
4440 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4453 /* No "real" damage */
4459 /* Teleport monster (Use "dam" as "power") */
4462 bool resists_tele = FALSE;
4463 if (r_ptr->flagsr & RFR_RES_TELE)
4465 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4467 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4469 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4471 note = " is unaffected!";
4474 resists_tele = TRUE;
4476 else if (r_ptr->level > randint1(100))
4478 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4480 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4485 resists_tele = TRUE;
4492 if (seen) obvious = TRUE;
4494 /* Prepare to teleport */
4498 /* No "real" damage */
4504 /* Turn undead (Use "dam" as "power") */
4505 case GF_TURN_UNDEAD:
4507 if (r_ptr->flagsr & RFR_RES_ALL)
4512 /* Only affect undead */
4513 if (r_ptr->flags3 & (RF3_UNDEAD))
4517 /* Learn about type */
4518 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4524 /* Apply some fear */
4525 do_fear = damroll(3, (dam / 2)) + 1;
4527 /* Attempt a saving throw */
4528 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4530 /* No obvious effect */
4532 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4534 note = " is unaffected!";
4549 /* No "real" damage */
4555 /* Turn evil (Use "dam" as "power") */
4558 if (r_ptr->flagsr & RFR_RES_ALL)
4563 /* Only affect evil */
4564 if (r_ptr->flags3 & (RF3_EVIL))
4568 /* Learn about type */
4569 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4575 /* Apply some fear */
4576 do_fear = damroll(3, (dam / 2)) + 1;
4578 /* Attempt a saving throw */
4579 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4581 /* No obvious effect */
4583 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4585 note = " is unaffected!";
4600 /* No "real" damage */
4606 /* Turn monster (Use "dam" as "power") */
4609 if (r_ptr->flagsr & RFR_RES_ALL)
4615 if (seen) obvious = TRUE;
4617 /* Apply some fear */
4618 do_fear = damroll(3, (dam / 2)) + 1;
4620 /* Attempt a saving throw */
4621 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4622 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4623 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4625 /* No obvious effect */
4627 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4629 note = " is unaffected!";
4636 /* No "real" damage */
4643 case GF_DISP_UNDEAD:
4645 if (r_ptr->flagsr & RFR_RES_ALL)
4651 /* Only affect undead */
4652 if (r_ptr->flags3 & (RF3_UNDEAD))
4656 /* Learn about type */
4657 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4665 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4666 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4668 note = " shudders.";
4669 note_dies = " dissolves!";
4691 if (r_ptr->flagsr & RFR_RES_ALL)
4697 /* Only affect evil */
4698 if (r_ptr->flags3 & (RF3_EVIL))
4702 /* Learn about type */
4703 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4711 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4712 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4714 note = " shudders.";
4715 note_dies = " dissolves!";
4736 if (r_ptr->flagsr & RFR_RES_ALL)
4742 /* Only affect good */
4743 if (r_ptr->flags3 & (RF3_GOOD))
4747 /* Learn about type */
4748 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4756 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4757 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4759 note = " shudders.";
4760 note_dies = " dissolves!";
4779 case GF_DISP_LIVING:
4781 if (r_ptr->flagsr & RFR_RES_ALL)
4787 /* Only affect non-undead */
4788 if (monster_living(r_ptr))
4791 if (seen) obvious = TRUE;
4795 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4796 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4798 note = " shudders.";
4799 note_dies = " dissolves!";
4820 if (r_ptr->flagsr & RFR_RES_ALL)
4826 /* Only affect demons */
4827 if (r_ptr->flags3 & (RF3_DEMON))
4831 /* Learn about type */
4832 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4840 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4841 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4843 note = " shudders.";
4844 note_dies = " dissolves!";
4862 /* Dispel monster */
4865 if (r_ptr->flagsr & RFR_RES_ALL)
4872 if (seen) obvious = TRUE;
4876 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4877 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4879 note = " shudders.";
4880 note_dies = " dissolves!";
4890 if (seen) obvious = TRUE;
4892 if (r_ptr->flagsr & RFR_RES_ALL)
4895 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4897 note = " is immune.";
4900 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4904 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4908 monster_type *caster_ptr = &m_list[who];
4910 /* Heal the monster */
4911 if (caster_ptr->hp < caster_ptr->maxhp)
4914 caster_ptr->hp += 6 * dam;
4915 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
4917 /* Redraw (later) if needed */
4918 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4919 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4921 /* Special message */
4924 /* Get the monster name */
4925 monster_desc(killer, caster_ptr, 0);
4927 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", killer);
4929 msg_format("%^s appears healthier.", killer);
4938 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£", m_name);
4940 msg_format("You draw psychic energy from %s.", m_name);
4943 (void)hp_player(dam);
4949 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
4951 msg_format("%s is unaffected.", m_name);
4961 if (seen) obvious = TRUE;
4964 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
4966 if (!who) msg_format("You gaze intently at %s.", m_name);
4969 if (r_ptr->flagsr & RFR_RES_ALL)
4972 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4974 note = " is immune.";
4977 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4981 /* Attempt a saving throw */
4982 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4983 (r_ptr->flags3 & RF3_NO_CONF) ||
4984 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
4986 /* Memorize a flag */
4987 if (r_ptr->flags3 & (RF3_NO_CONF))
4989 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4992 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
4994 note = "is unaffected!";
4998 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5000 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5002 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5004 note = " is immune!";
5008 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5010 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5012 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5021 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5022 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5024 note = " is blasted by psionic energy.";
5025 note_dies = " collapses, a mindless husk.";
5028 if (who > 0) do_conf = randint0(4) + 4;
5029 else do_conf = randint0(8) + 8;
5035 case GF_BRAIN_SMASH:
5037 if (seen) obvious = TRUE;
5040 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5042 if (!who) msg_format("You gaze intently at %s.", m_name);
5045 if (r_ptr->flagsr & RFR_RES_ALL)
5048 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5050 note = " is immune.";
5053 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5057 /* Attempt a saving throw */
5058 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5059 (r_ptr->flags3 & RF3_NO_CONF) ||
5060 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5062 /* Memorize a flag */
5063 if (r_ptr->flags3 & (RF3_NO_CONF))
5065 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5068 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5070 note = "is unaffected!";
5074 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5076 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5078 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5080 note = " is immune!";
5084 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5086 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5088 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5097 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5098 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5100 note = " is blasted by psionic energy.";
5101 note_dies = " collapses, a mindless husk.";
5106 do_conf = randint0(4) + 4;
5107 do_stun = randint0(4) + 4;
5111 do_conf = randint0(8) + 8;
5112 do_stun = randint0(8) + 8;
5114 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5115 if (c_ptr->m_idx == p_ptr->riding)
5116 p_ptr->update |= (PU_BONUS);
5124 if (seen) obvious = TRUE;
5127 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5129 if (!who) msg_format("You point at %s and curses.", m_name);
5132 if (r_ptr->flagsr & RFR_RES_ALL)
5135 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5137 note = " is immune.";
5140 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5144 /* Attempt a saving throw */
5145 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5148 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5150 note = "is unaffected!";
5160 if (seen) obvious = TRUE;
5163 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5165 if (!who) msg_format("You point at %s and curses horribly.", m_name);
5168 if (r_ptr->flagsr & RFR_RES_ALL)
5171 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5173 note = " is immune.";
5176 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5180 /* Attempt a saving throw */
5181 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5184 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5186 note = "is unaffected!";
5196 if (seen) obvious = TRUE;
5199 if (!who) msg_format("%s¤ò»Øº¹¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
5201 if (!who) msg_format("You point at %s, incanting terribly!", m_name);
5204 if (r_ptr->flagsr & RFR_RES_ALL)
5207 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5209 note = " is immune.";
5212 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5216 /* Attempt a saving throw */
5217 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5220 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5222 note = "is unaffected!";
5232 if (seen) obvious = TRUE;
5235 if (!who) msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
5237 if (!who) msg_format("You point at %s, screaming the word, 'DIE!'.", m_name);
5240 if (r_ptr->flagsr & RFR_RES_ALL)
5243 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5245 note = " is immune.";
5248 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5252 /* Attempt a saving throw */
5253 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (m_list[who].r_idx != MON_KENSHIROU)))
5256 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5258 note = "is unaffected!";
5268 if (seen) obvious = TRUE;
5270 if (r_ptr->flagsr & RFR_RES_ALL)
5273 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5275 note = " is immune.";
5278 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5282 if (r_ptr->flags1 & RF1_UNIQUE)
5285 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5287 note = "is unaffected!";
5293 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
5294 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
5296 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5298 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5303 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5313 /* Capture monster */
5317 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5318 (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)
5321 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5323 msg_format("%^s is unaffected.", m_name);
5329 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5330 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5331 nokori_hp = m_ptr->maxhp * 3 / 10;
5333 nokori_hp = m_ptr->maxhp * 3 / 20;
5335 if (m_ptr->hp >= nokori_hp)
5338 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5340 msg_format("You need to weaken %s more.", m_name);
5344 else if (m_ptr->hp < randint0(nokori_hp))
5346 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5348 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5350 msg_format("You capture %^s!", m_name);
5352 cap_mon = m_list[c_ptr->m_idx].r_idx;
5353 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5354 cap_hp = m_list[c_ptr->m_idx].hp;
5355 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5356 if (m_list[c_ptr->m_idx].nickname)
5357 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5360 if (c_ptr->m_idx == p_ptr->riding)
5362 if (rakuba(-1, FALSE))
5365 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5367 msg_format("You have fallen from %s.", m_name);
5372 delete_monster_idx(c_ptr->m_idx);
5379 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5381 msg_format("You failed to capture %s.", m_name);
5388 /* Attack (Use "dam" as attack type) */
5391 /* Return this monster's death */
5392 return py_attack(y, x, dam);
5395 /* Sleep (Use "dam" as "power") */
5401 if (seen) obvious = TRUE;
5403 if (r_ptr->flagsr & RFR_RES_ALL)
5406 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5408 note = " is immune.";
5411 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5414 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5417 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5419 note = " is immune!";
5423 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5429 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5431 note = " is immune!";
5438 if (one_in_(5)) effect = 1;
5439 else if (one_in_(4)) effect = 2;
5440 else if (one_in_(3)) effect = 3;
5445 /* Powerful monsters can resist */
5446 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5447 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5450 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5452 note = " is unaffected!";
5458 /* Normal monsters slow down */
5464 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5466 note = " starts moving slower.";
5469 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5471 if (c_ptr->m_idx == p_ptr->riding)
5472 p_ptr->update |= (PU_BONUS);
5476 else if (effect == 2)
5478 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5480 /* Attempt a saving throw */
5481 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5482 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5487 /* No obvious effect */
5489 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5491 note = " is unaffected!";
5498 else if (effect == 3)
5500 /* Attempt a saving throw */
5501 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5502 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5503 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5505 /* Memorize a flag */
5506 if (r_ptr->flags3 & RF3_NO_SLEEP)
5508 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5511 /* No obvious effect */
5513 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5515 note = " is unaffected!";
5522 /* Go to sleep (much) later */
5524 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5526 note = " falls asleep!";
5536 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5538 note = " is immune!";
5542 /* No "real" damage */
5551 if (seen) obvious = TRUE;
5553 if (r_ptr->flagsr & RFR_RES_ALL)
5556 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5558 note = " is immune.";
5561 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5565 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)
5572 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG2_NOGENO))
5579 delete_monster_idx(c_ptr->m_idx);
5581 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5583 msg_format("%^s disappered!",m_name);
5587 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5589 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5593 chg_virtue(V_VITALITY, -1);
5598 p_ptr->redraw |= (PR_HP);
5601 p_ptr->window |= (PW_PLAYER);
5608 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5610 note = "is unaffected!";
5613 if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
5621 if (!who) msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£", m_name);
5623 if (!who) msg_format("You take a photograph of %s.", m_name);
5626 if (r_ptr->flags3 & (RF3_HURT_LITE))
5630 /* Obvious effect */
5633 /* Memorize the effects */
5634 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5637 /* Special effect */
5639 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5640 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5642 note = " cringes from the light!";
5643 note_dies = " shrivels away in the light!";
5648 /* Normally no damage */
5655 photo = m_ptr->r_idx;
5662 case GF_BLOOD_CURSE:
5664 if (seen) obvious = TRUE;
5666 if (r_ptr->flagsr & RFR_RES_ALL)
5669 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5671 note = " is immune.";
5674 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5682 bool success = FALSE;
5683 if (seen) obvious = TRUE;
5685 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5687 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5688 if (dam < 1) dam = 1;
5690 /* No need to tame your pet */
5694 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5696 note = " starts moving faster.";
5699 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5703 /* Attempt a saving throw */
5704 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5705 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5706 (m_ptr->mflag2 & MFLAG2_NOPET) ||
5707 (p_ptr->cursed & TRC_AGGRAVATE) ||
5708 ((r_ptr->level+10) > randint1(dam)))
5711 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5716 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5718 note = " is tamed!";
5722 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5724 /* Learn about type */
5725 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5732 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5734 do_fear = randint1(90)+10;
5738 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5742 /* No "real" damage */
5749 if (seen) obvious = TRUE;
5751 if (r_ptr->flagsr & RFR_RES_ALL)
5754 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5756 note = " is immune.";
5759 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5763 /* Attempt a saving throw */
5764 if (randint0(100 + dam) < (r_ptr->level + 50))
5768 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5770 note = "is unaffected!";
5791 /* Absolutely no effect */
5792 if (skipped) return (FALSE);
5794 /* "Unique" monsters cannot be polymorphed */
5795 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5797 /* Quest monsters cannot be polymorphed */
5798 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5800 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5802 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5803 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
5805 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5810 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5811 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5814 /* Modify the damage */
5816 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5818 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤¡£";
5820 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5823 /* Check for death */
5824 if (dam > m_ptr->hp)
5826 /* Extract method of death */
5830 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5831 else if (do_poly && (randint1(90) > r_ptr->level))
5833 if (polymorph_monster(y, x))
5836 if (seen) obvious = TRUE;
5838 /* Monster polymorphs */
5840 note = "¤¬ÊѿȤ·¤¿¡ª";
5846 /* Turn off the damage */
5849 /* Hack -- Get new monster */
5850 m_ptr = &m_list[c_ptr->m_idx];
5852 /* Hack -- Get new race */
5853 r_ptr = &r_info[m_ptr->r_idx];
5859 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5861 note = " is unaffected!";
5867 /* Handle "teleport" */
5871 if (seen) obvious = TRUE;
5875 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5877 note = " disappears!";
5880 chg_virtue(V_VALOUR, -1);
5883 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who));
5885 /* Hack -- get new location */
5889 /* Hack -- get new grid */
5890 c_ptr = &cave[y][x];
5893 /* Sound and Impact resisters never stun */
5895 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5896 !(r_ptr->flags3 & RF3_NO_STUN))
5899 if (seen) obvious = TRUE;
5905 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5907 note = " is more dazed.";
5910 tmp = m_ptr->stunned + (do_stun / 2);
5915 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5917 note = " is dazed.";
5924 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5930 /* Confusion and Chaos resisters (and sleepers) never confuse */
5932 !(r_ptr->flags3 & RF3_NO_CONF) &&
5933 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
5936 if (seen) obvious = TRUE;
5938 /* Already partially confused */
5939 if (m_ptr->confused)
5942 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5944 note = " looks more confused.";
5947 tmp = m_ptr->confused + (do_conf / 2);
5950 /* Was not confused */
5954 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
5956 note = " looks confused.";
5962 /* Apply confusion */
5963 m_ptr->confused = (tmp < 200) ? tmp : 200;
5972 if (seen) obvious = TRUE;
5974 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
5979 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
5981 note = " seems weakened.";
5983 m_ptr->maxhp -= do_time;
5984 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
5994 tmp = m_ptr->monfear + do_fear;
5997 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6004 if (typ == GF_DRAIN_MANA)
6006 /* Drain mana does nothing */
6009 /* If another monster did the damage, hurt the monster by hand */
6012 /* Redraw (later) if needed */
6013 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6014 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6016 /* Wake the monster up */
6019 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
6021 /* Hurt the monster */
6029 if (is_pet(m_ptr) && !(m_ptr->ml))
6032 /* Give detailed messages if destroyed */
6035 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
6038 msg_format("%^s%s", m_name, note);
6046 monster_gain_exp(who, m_ptr->r_idx);
6048 /* Generate treasure, etc */
6049 monster_death(c_ptr->m_idx, FALSE);
6051 /* Delete the monster */
6052 delete_monster_idx(c_ptr->m_idx);
6057 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6059 msg_print("You feel sad for a moment.");
6065 /* Damaged monster */
6068 /* Give detailed messages if visible or destroyed */
6069 if (note && seen) msg_format("%^s%s", m_name, note);
6071 /* Hack -- Pain message */
6074 message_pain(c_ptr->m_idx, dam);
6081 /* Hack -- handle sleep */
6082 if (do_sleep) m_ptr->csleep = do_sleep;
6086 else if (heal_leper)
6089 msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6091 msg_print("The Mangy looking leper is healed!");
6094 delete_monster_idx(c_ptr->m_idx);
6097 /* If the player did it, give him experience, check fear */
6102 /* Hurt the monster, check for fear and death */
6103 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6108 /* Damaged monster */
6111 /* HACK - anger the monster before showing the sleep message */
6112 if (do_sleep) anger_monster(m_ptr);
6114 /* Give detailed messages if visible or destroyed */
6117 msg_format("%s%s", m_name, note);
6119 msg_format("%^s%s", m_name, note);
6123 /* Hack -- Pain message */
6124 else if (known && (dam || !do_fear))
6126 message_pain(c_ptr->m_idx, dam);
6129 /* Anger monsters */
6130 if (((dam > 0) || get_angry) && !do_sleep)
6131 anger_monster(m_ptr);
6134 if ((fear || do_fear) && (m_ptr->ml))
6141 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6143 msg_format("%^s flees in terror!", m_name);
6148 /* Hack -- handle sleep */
6149 if (do_sleep) m_ptr->csleep = do_sleep;
6153 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6155 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6159 switch (randint1(28))
6165 msg_print("ÃÏÌ̤¬Íɤ줿...");
6167 msg_print("The ground trembles...");
6170 earthquake(ty, tx, 4 + randint0(4));
6171 if (!one_in_(6)) break;
6173 case 3: case 4: case 5: case 6:
6176 int dam = damroll(10, 10);
6178 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6180 msg_print("A portal opens to a plane of raw mana!");
6183 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6184 if (!one_in_(6)) break;
6190 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6192 msg_print("Space warps about you!");
6195 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE);
6196 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6197 if (!one_in_(6)) break;
6199 case 9: case 10: case 11:
6201 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6203 msg_print("You feel a surge of energy!");
6206 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6207 if (!one_in_(6)) break;
6208 case 12: case 13: case 14: case 15: case 16:
6209 aggravate_monsters(0);
6210 if (!one_in_(6)) break;
6212 count += activate_hi_summon(ty, tx, TRUE);
6213 if (!one_in_(6)) break;
6214 case 19: case 20: case 21: case 22:
6216 bool pet = !one_in_(3);
6217 u32b mode = PM_ALLOW_GROUP;
6219 if (pet) mode |= PM_FORCE_PET;
6220 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6222 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6223 if (!one_in_(6)) break;
6225 case 23: case 24: case 25:
6226 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6228 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6230 msg_print("You feel your life draining away...");
6233 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6234 else lose_exp(p_ptr->exp / 16);
6235 if (!one_in_(6)) break;
6236 case 26: case 27: case 28:
6245 (void)do_dec_stat(i);
6254 (void)do_dec_stat(randint0(6));
6263 if (p_ptr->inside_battle)
6265 p_ptr->health_who = c_ptr->m_idx;
6266 p_ptr->redraw |= (PR_HEALTH);
6270 /* XXX XXX XXX Verify this code */
6272 /* Update the monster */
6273 update_mon(c_ptr->m_idx, FALSE);
6275 /* Redraw the monster grid */
6279 /* Update monster recall window */
6280 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6283 p_ptr->window |= (PW_MONSTER);
6286 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6290 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6292 set_target(m_ptr, monster_target_y, monster_target_x);
6295 else if (is_pet(&m_list[who]) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6297 set_target(m_ptr, m_list[who].fy, m_list[who].fx);
6301 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6303 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6304 rakubadam_m = (dam > 200) ? 200 : dam;
6313 /* Get local object */
6316 /* Prepare to make a Blade of Chaos */
6317 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6319 q_ptr->pval = photo;
6321 /* Mark the item as fully known */
6322 q_ptr->ident |= (IDENT_MENTAL);
6324 /* Drop it in the dungeon */
6325 (void)drop_near(q_ptr, -1, py, px);
6333 /* Return "Anything seen?" */
6339 * Helper function for "project()" below.
6341 * Handle a beam/bolt/ball causing damage to the player.
6343 * This routine takes a "source monster" (by index), a "distance", a default
6344 * "damage", and a "damage type". See "project_m()" above.
6346 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6347 * is reduced (see "project_m()" above). This can happen if a monster breathes
6348 * at the player and hits a wall instead.
6350 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6351 * to know if this is actually a ball or a bolt spell
6354 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6355 * we just assume that the effects were obvious, for historical reasons.
6357 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6362 /* Hack -- assume obvious */
6363 bool obvious = TRUE;
6365 /* Player blind-ness */
6366 bool blind = (p_ptr->blind ? TRUE : FALSE);
6368 /* Player needs a "description" (he is blind) */
6371 /* Source monster */
6372 monster_type *m_ptr = NULL;
6374 /* Monster name (for attacks) */
6377 /* Monster name (for damage) */
6380 /* Hack -- messages */
6386 /* Player is not here */
6387 if (!player_bold(y, x)) return (FALSE);
6389 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6395 /* Player cannot hurt himself */
6396 if (!who) return (FALSE);
6397 if (who == p_ptr->riding) return (FALSE);
6399 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6402 int max_attempts = 10;
6405 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6406 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6407 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6409 if (blind) msg_print("Something bounces!");
6410 else msg_print("The attack bounces!");
6414 /* Choose 'new' target */
6417 t_y = m_list[who].fy - 1 + randint1(3);
6418 t_x = m_list[who].fx - 1 + randint1(3);
6421 while (max_attempts && in_bounds2u(t_y, t_x) &&
6422 !(player_has_los_bold(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 /* Permanent walls and artifacts don't get effect */
7973 /* But not protect monsters and other objects */
7974 if (!cave_valid_bold(y, x)) return TRUE;
7976 /* Destroy mirror/glyph */
7977 remove_mirror(y, x);
7979 f_ptr = &f_info[cave[y][x].feat];
7981 if (have_flag(f_ptr->flags, FF_HURT_DISI))
7983 cave_alter_feat(y, x, FF_HURT_DISI);
7985 /* Update some things -- similar to GF_KILL_WALL */
7986 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
7996 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)
8001 int brev = rad * rad / dist;
8005 int tdis = distance(y1, x1, y2, x2);
8006 int mdis = tdis + rad;
8008 while (bdis <= mdis)
8012 if ((0 < dist) && (path_n < dist))
8014 int ny = GRID_Y(path_g[path_n]);
8015 int nx = GRID_X(path_g[path_n]);
8016 int nd = distance(ny, nx, y1, x1);
8018 /* Get next base point */
8027 /* Travel from center outward */
8028 for (cdis = 0; cdis <= brad; cdis++)
8030 /* Scan the maximal blast area of radius "cdis" */
8031 for (y = by - cdis; y <= by + cdis; y++)
8033 for (x = bx - cdis; x <= bx + cdis; x++)
8035 /* Ignore "illegal" locations */
8036 if (!in_bounds(y, x)) continue;
8038 /* Enforce a circular "ripple" */
8039 if (distance(y1, x1, y, x) != bdis) continue;
8041 /* Enforce an arc */
8042 if (distance(by, bx, y, x) != cdis) continue;
8047 /* Disintegration are stopped only by perma-walls */
8050 /* Destroy terrains */
8051 if (!do_disintegration(by, bx, y, x)) continue;
8055 /* No actual disintegration */
8056 if (!in_disintegration_range(by, bx, y, x)) continue;
8061 /* The blast is stopped by walls */
8062 if (!los(by, bx, y, x)) continue;
8065 /* Save this grid */
8073 /* Encode some more "radius" info */
8074 gm[bdis + 1] = *pgrids;
8076 /* Increase the size */
8077 brad = rad * (path_n + brev) / (dist + brev);
8079 /* Find the next ripple */
8083 /* Store the effect size */
8089 * Generic "beam"/"bolt"/"ball" projection routine.
8092 * who: Index of "source" monster (zero for "player")
8093 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8094 * y,x: Target location (or location to travel "towards")
8095 * dam: Base damage roll to apply to affected monsters (or player)
8096 * typ: Type of damage to apply to monsters (and objects)
8097 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8100 * TRUE if any "effects" of the projection were observed, else FALSE
8102 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8103 * towards a given location (optionally passing over the heads of interposing
8104 * monsters), and have it do a given amount of damage to the monsters (and
8105 * optionally objects) within the given radius of the final location.
8107 * A "bolt" travels from source to target and affects only the target grid.
8108 * A "beam" travels from source to target, affecting all grids passed through.
8109 * A "ball" travels from source to the target, exploding at the target, and
8110 * affecting everything within the given radius of the target location.
8112 * Traditionally, a "bolt" does not affect anything on the ground, and does
8113 * not pass over the heads of interposing monsters, much like a traditional
8114 * missile, and will "stop" abruptly at the "target" even if no monster is
8115 * positioned there, while a "ball", on the other hand, passes over the heads
8116 * of monsters between the source and target, and affects everything except
8117 * the source monster which lies within the final radius, while a "beam"
8118 * affects every monster between the source and target, except for the casting
8119 * monster (or player), and rarely affects things on the ground.
8121 * Two special flags allow us to use this function in special ways, the
8122 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8123 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8124 * actually projecting from the source monster (or player).
8126 * The player will only get "experience" for monsters killed by himself
8127 * Unique monsters can only be destroyed by attacks from the player
8129 * Only 256 grids can be affected per projection, limiting the effective
8130 * "radius" of standard ball attacks to nine units (diameter nineteen).
8132 * One can project in a given "direction" by combining PROJECT_THRU with small
8133 * offsets to the initial location (see "line_spell()"), or by calculating
8134 * "virtual targets" far away from the player.
8136 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8137 * continuing until it actually hits somethings (useful for "stone to mud").
8139 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8141 * Balls must explode BEFORE hitting walls, or they would affect monsters
8142 * on both sides of a wall. Some bug reports indicate that this is still
8143 * happening in 2.7.8 for Windows, though it appears to be impossible.
8145 * We "pre-calculate" the blast area only in part for efficiency.
8146 * More importantly, this lets us do "explosions" from the "inside" out.
8147 * This results in a more logical distribution of "blast" treasure.
8148 * It also produces a better (in my opinion) animation of the explosion.
8149 * It could be (but is not) used to have the treasure dropped by monsters
8150 * in the middle of the explosion fall "outwards", and then be damaged by
8151 * the blast as it spreads outwards towards the treasure drop location.
8153 * Walls and doors are included in the blast area, so that they can be
8154 * "burned" or "melted" in later versions.
8156 * This algorithm is intended to maximize simplicity, not necessarily
8157 * efficiency, since this function is not a bottleneck in the code.
8159 * We apply the blast effect from ground zero outwards, in several passes,
8160 * first affecting features, then objects, then monsters, then the player.
8161 * This allows walls to be removed before checking the object or monster
8162 * in the wall, and protects objects which are dropped by monsters killed
8163 * in the blast, and allows the player to see all affects before he is
8164 * killed or teleported away. The semantics of this method are open to
8165 * various interpretations, but they seem to work well in practice.
8167 * We process the blast area from ground-zero outwards to allow for better
8168 * distribution of treasure dropped by monsters, and because it provides a
8169 * pleasing visual effect at low cost.
8171 * Note that the damage done by "ball" explosions decreases with distance.
8172 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8174 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8175 * the target, and then the damage "flows" along this beam of destruction.
8176 * The damage at every grid is the same as at the "center" of a "ball"
8177 * explosion, since the "beam" grids are treated as if they ARE at the
8178 * center of a "ball" explosion.
8180 * Currently, specifying "beam" plus "ball" means that locations which are
8181 * covered by the initial "beam", and also covered by the final "ball", except
8182 * for the final grid (the epicenter of the ball), will be "hit twice", once
8183 * by the initial beam, and once by the exploding ball. For the grid right
8184 * next to the epicenter, this results in 150% damage being done. The center
8185 * does not have this problem, for the same reason the final grid in a "beam"
8186 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8187 * grids which are covered by the "ball" will NOT work, as then they will
8188 * receive LESS damage than they should. Do not combine "beam" with "ball".
8190 * The array "gy[],gx[]" with current size "grids" is used to hold the
8191 * collected locations of all grids in the "blast area" plus "beam path".
8193 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8194 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8195 * first blast grid (see above) with radius "N" from the blast center. Note
8196 * that only the first gm[1] grids in the blast area thus take full damage.
8197 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8198 * number of blast grids.
8200 * Note that once the projection is complete, (y2,x2) holds the final location
8201 * of bolts/beams, and the "epicenter" of balls.
8203 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8204 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8205 * implementation of the "distance" function. Also, a bolt can be properly
8206 * viewed as a "ball" with a "rad" of "zero".
8208 * Note that if no "target" is reached before the beam/bolt/ball travels the
8209 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8210 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8212 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8213 * to move from point A to point B, even if the player cannot see part of the
8214 * projection path. Note that in general, the player will *always* see part
8215 * of the path, since it either starts at the player or ends on the player.
8217 * Hack -- we assume that every "projection" is "self-illuminating".
8219 * Hack -- when only a single monster is affected, we automatically track
8220 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8222 * Note that all projections now "explode" at their final destination, even
8223 * if they were being projected at a more distant destination. This means
8224 * that "ball" spells will *always* explode.
8226 * Note that we must call "handle_stuff()" after affecting terrain features
8227 * in the blast radius, in case the "illumination" of the grid was changed,
8228 * and "update_view()" and "update_monsters()" need to be called.
8230 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8240 int y_saver, x_saver; /* For reflecting monsters */
8242 int msec = delay_factor * delay_factor * delay_factor;
8244 /* Assume the player sees nothing */
8245 bool notice = FALSE;
8247 /* Assume the player has seen nothing */
8248 bool visual = FALSE;
8250 /* Assume the player has seen no blast grids */
8253 /* Assume to be a normal ball spell */
8254 bool breath = FALSE;
8256 /* Is the player blind? */
8257 bool blind = (p_ptr->blind ? TRUE : FALSE);
8259 bool old_hide = FALSE;
8261 /* Number of grids in the "path" */
8264 /* Actual grids in the "path" */
8267 /* Number of grids in the "blast area" (including the "beam" path) */
8270 /* Coordinates of the affected grids */
8271 byte gx[1024], gy[1024];
8273 /* Encoded "radius" info (see above) */
8276 /* Actual radius encoded in gm[] */
8281 /* Attacker's name (prepared before polymorph)*/
8284 /* Initialize by null string */
8290 /* Default target of monsterspell is player */
8291 monster_target_y=py;
8292 monster_target_x=px;
8294 /* Hack -- Jump to target */
8295 if (flg & (PROJECT_JUMP))
8300 /* Clear the flag */
8301 flg &= ~(PROJECT_JUMP);
8306 /* Start at player */
8313 /* Start at monster */
8316 x1 = m_list[who].fx;
8317 y1 = m_list[who].fy;
8318 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8331 /* Default "destination" */
8336 /* Hack -- verify stuff */
8337 if (flg & (PROJECT_THRU))
8339 if ((x1 == x2) && (y1 == y2))
8341 flg &= ~(PROJECT_THRU);
8345 /* Handle a breath attack */
8350 if (flg & PROJECT_HIDE) old_hide = TRUE;
8351 flg |= PROJECT_HIDE;
8355 /* Hack -- Assume there will be no blast (max radius 32) */
8356 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8364 /* Collect beam grids */
8365 if (flg & (PROJECT_BEAM))
8372 if (breath && typ == GF_DISINTEGRATE)
8374 flg |= (PROJECT_DISI);
8377 /* Calculate the projection path */
8379 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8381 /* Hack -- Handle stuff */
8384 /* Giga-Hack SEEKER & SUPER_RAY */
8386 if( typ == GF_SEEKER )
8396 for (i = 0; i < path_n; ++i)
8401 int ny = GRID_Y(path_g[i]);
8402 int nx = GRID_X(path_g[i]);
8413 /* Only do visuals if requested */
8414 if (!blind && !(flg & (PROJECT_HIDE)))
8416 /* Only do visuals if the player can "see" the bolt */
8417 if (panel_contains(y, x) && player_has_los_bold(y, x))
8424 /* Obtain the bolt pict */
8425 p = bolt_pict(oy, ox, y, x, typ);
8427 /* Extract attr/char */
8431 /* Visual effects */
8432 print_rel(c, a, y, x);
8433 move_cursor_relative(y, x);
8434 /*if (fresh_before)*/ Term_fresh();
8435 Term_xtra(TERM_XTRA_DELAY, msec);
8437 /*if (fresh_before)*/ Term_fresh();
8439 /* Display "beam" grids */
8440 if (flg & (PROJECT_BEAM))
8442 /* Obtain the explosion pict */
8443 p = bolt_pict(y, x, y, x, typ);
8445 /* Extract attr/char */
8449 /* Visual effects */
8450 print_rel(c, a, y, x);
8453 /* Hack -- Activate delay */
8457 /* Hack -- delay anyway for consistency */
8460 /* Delay for consistency */
8461 Term_xtra(TERM_XTRA_DELAY, msec);
8464 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8465 if( is_mirror_grid(&cave[y][x]))
8467 /* The target of monsterspell becomes tha mirror(broken) */
8468 monster_target_y=(s16b)y;
8469 monster_target_x=(s16b)x;
8472 next_mirror( &oy,&ox,y,x );
8474 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8475 for( j = last_i; j <=i ; j++ )
8477 y = GRID_Y(path_g[j]);
8478 x = GRID_X(path_g[j]);
8479 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8480 if(!who && (project_m_n==1) && !jump ){
8481 if(cave[project_m_y][project_m_x].m_idx >0 ){
8482 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8484 /* Hack -- auto-recall */
8485 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8487 /* Hack - auto-track */
8488 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8491 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8496 for( i = last_i ; i < path_n ; i++ )
8499 y = GRID_Y(path_g[i]);
8500 x = GRID_X(path_g[i]);
8501 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8503 if(!who && (project_m_n==1) && !jump ){
8504 if(cave[project_m_y][project_m_x].m_idx >0 ){
8505 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8507 /* Hack -- auto-recall */
8508 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8510 /* Hack - auto-track */
8511 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8514 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8518 else if(typ == GF_SUPER_RAY){
8520 int second_step = 0;
8527 for (i = 0; i < path_n; ++i)
8532 int ny = GRID_Y(path_g[i]);
8533 int nx = GRID_X(path_g[i]);
8544 /* Only do visuals if requested */
8545 if (!blind && !(flg & (PROJECT_HIDE)))
8547 /* Only do visuals if the player can "see" the bolt */
8548 if (panel_contains(y, x) && player_has_los_bold(y, x))
8555 /* Obtain the bolt pict */
8556 p = bolt_pict(oy, ox, y, x, typ);
8558 /* Extract attr/char */
8562 /* Visual effects */
8563 print_rel(c, a, y, x);
8564 move_cursor_relative(y, x);
8565 /*if (fresh_before)*/ Term_fresh();
8566 Term_xtra(TERM_XTRA_DELAY, msec);
8568 /*if (fresh_before)*/ Term_fresh();
8570 /* Display "beam" grids */
8571 if (flg & (PROJECT_BEAM))
8573 /* Obtain the explosion pict */
8574 p = bolt_pict(y, x, y, x, typ);
8576 /* Extract attr/char */
8580 /* Visual effects */
8581 print_rel(c, a, y, x);
8584 /* Hack -- Activate delay */
8588 /* Hack -- delay anyway for consistency */
8591 /* Delay for consistency */
8592 Term_xtra(TERM_XTRA_DELAY, msec);
8595 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8596 if (!have_flag(f_flags_bold(y, x), FF_PROJECT))
8598 if( second_step )continue;
8601 if( is_mirror_grid(&cave[y][x]) && !second_step )
8603 /* The target of monsterspell becomes tha mirror(broken) */
8604 monster_target_y=(s16b)y;
8605 monster_target_x=(s16b)x;
8608 for( j = 0; j <=i ; j++ )
8610 y = GRID_Y(path_g[j]);
8611 x = GRID_X(path_g[j]);
8612 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
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-1, x , flg);
8618 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8619 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8620 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8621 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8622 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8623 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8626 for( i = 0; i < path_n ; i++ )
8629 y = GRID_Y(path_g[i]);
8630 x = GRID_X(path_g[i]);
8631 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8632 if(!who && (project_m_n==1) && !jump ){
8633 if(cave[project_m_y][project_m_x].m_idx >0 ){
8634 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8636 /* Hack -- auto-recall */
8637 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8639 /* Hack - auto-track */
8640 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8643 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8648 /* Project along the path */
8649 for (i = 0; i < path_n; ++i)
8654 int ny = GRID_Y(path_g[i]);
8655 int nx = GRID_X(path_g[i]);
8657 if (flg & PROJECT_DISI)
8659 /* Hack -- Balls explode before reaching walls */
8660 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8664 /* Hack -- Balls explode before reaching walls */
8665 if (!have_flag(f_flags_bold(ny, nx), FF_PROJECT) && (rad > 0)) break;
8672 /* Collect beam grids */
8673 if (flg & (PROJECT_BEAM))
8680 /* Only do visuals if requested */
8681 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
8683 /* Only do visuals if the player can "see" the bolt */
8684 if (panel_contains(y, x) && player_has_los_bold(y, x))
8691 /* Obtain the bolt pict */
8692 p = bolt_pict(oy, ox, y, x, typ);
8694 /* Extract attr/char */
8698 /* Visual effects */
8699 print_rel(c, a, y, x);
8700 move_cursor_relative(y, x);
8701 /*if (fresh_before)*/ Term_fresh();
8702 Term_xtra(TERM_XTRA_DELAY, msec);
8704 /*if (fresh_before)*/ Term_fresh();
8706 /* Display "beam" grids */
8707 if (flg & (PROJECT_BEAM))
8709 /* Obtain the explosion pict */
8710 p = bolt_pict(y, x, y, x, typ);
8712 /* Extract attr/char */
8716 /* Visual effects */
8717 print_rel(c, a, y, x);
8720 /* Hack -- Activate delay */
8724 /* Hack -- delay anyway for consistency */
8727 /* Delay for consistency */
8728 Term_xtra(TERM_XTRA_DELAY, msec);
8733 /* Save the "blast epicenter" */
8737 if (breath && (y1 == by) && (x1 == bx))
8743 flg &= ~(PROJECT_HIDE);
8747 /* Start the "explosion" */
8750 /* Hack -- make sure beams get to "explode" */
8758 /* If we found a "target", explode there */
8759 if (dist <= MAX_RANGE)
8761 /* Mega-Hack -- remove the final "beam" grid */
8762 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8765 * Create a conical breath attack
8776 flg &= ~(PROJECT_HIDE);
8778 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, (bool)(typ == GF_DISINTEGRATE), TRUE);
8782 /* Determine the blast area, work from the inside out */
8783 for (dist = 0; dist <= rad; dist++)
8785 /* Scan the maximal blast area of radius "dist" */
8786 for (y = by - dist; y <= by + dist; y++)
8788 for (x = bx - dist; x <= bx + dist; x++)
8790 /* Ignore "illegal" locations */
8791 if (!in_bounds2(y, x)) continue;
8793 /* Enforce a "circular" explosion */
8794 if (distance(by, bx, y, x) != dist) continue;
8796 if (typ == GF_DISINTEGRATE)
8798 /* Disintegration are stopped only by perma-walls */
8799 if (!do_disintegration(by, bx, y, x)) continue;
8803 /* Ball explosions are stopped by walls */
8804 if (!los(by, bx, y, x)) continue;
8807 /* Save this grid */
8814 /* Encode some more "radius" info */
8820 /* Speed -- ignore "non-explosions" */
8821 if (!grids) return (FALSE);
8824 /* Display the "blast area" if requested */
8825 if (!blind && !(flg & (PROJECT_HIDE)))
8827 /* Then do the "blast", from inside out */
8828 for (t = 0; t <= gm_rad; t++)
8830 /* Dump everything with this radius */
8831 for (i = gm[t]; i < gm[t+1]; i++)
8833 /* Extract the location */
8837 /* Only do visuals if the player can "see" the blast */
8838 if (panel_contains(y, x) && player_has_los_bold(y, x))
8847 /* Obtain the explosion pict */
8848 p = bolt_pict(y, x, y, x, typ);
8850 /* Extract attr/char */
8854 /* Visual effects -- Display */
8855 print_rel(c, a, y, x);
8859 /* Hack -- center the cursor */
8860 move_cursor_relative(by, bx);
8862 /* Flush each "radius" seperately */
8863 /*if (fresh_before)*/ Term_fresh();
8865 /* Delay (efficiently) */
8866 if (visual || drawn)
8868 Term_xtra(TERM_XTRA_DELAY, msec);
8872 /* Flush the erasing */
8875 /* Erase the explosion drawn above */
8876 for (i = 0; i < grids; i++)
8878 /* Extract the location */
8882 /* Hack -- Erase if needed */
8883 if (panel_contains(y, x) && player_has_los_bold(y, x))
8889 /* Hack -- center the cursor */
8890 move_cursor_relative(by, bx);
8892 /* Flush the explosion */
8893 /*if (fresh_before)*/ Term_fresh();
8898 /* Update stuff if needed */
8899 if (p_ptr->update) update_stuff();
8902 /* Check features */
8903 if (flg & (PROJECT_GRID))
8905 /* Start with "dist" of zero */
8908 /* Scan for features */
8909 for (i = 0; i < grids; i++)
8911 /* Hack -- Notice new "dist" values */
8912 if (gm[dist+1] == i) dist++;
8914 /* Get the grid location */
8918 /* Find the closest point in the blast */
8921 int d = dist_to_line(y, x, y1, x1, by, bx);
8923 /* Affect the grid */
8924 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8928 /* Affect the grid */
8929 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8936 if (flg & (PROJECT_ITEM))
8938 /* Start with "dist" of zero */
8941 /* Scan for objects */
8942 for (i = 0; i < grids; i++)
8944 /* Hack -- Notice new "dist" values */
8945 if (gm[dist+1] == i) dist++;
8947 /* Get the grid location */
8951 /* Find the closest point in the blast */
8954 int d = dist_to_line(y, x, y1, x1, by, bx);
8956 /* Affect the object in the grid */
8957 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8961 /* Affect the object in the grid */
8962 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8968 /* Check monsters */
8969 if (flg & (PROJECT_KILL))
8976 /* Start with "dist" of zero */
8979 /* Scan for monsters */
8980 for (i = 0; i < grids; i++)
8984 /* Hack -- Notice new "dist" values */
8985 if (gm[dist + 1] == i) dist++;
8987 /* Get the grid location */
8991 /* A single bolt may be reflected */
8994 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
8995 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
8997 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
9000 int max_attempts = 10;
9002 /* Choose 'new' target */
9005 t_y = y_saver - 1 + randint1(3);
9006 t_x = x_saver - 1 + randint1(3);
9009 while (max_attempts && in_bounds2u(t_y, t_x) &&
9010 !(los(y, x, t_y, t_x)));
9012 if (max_attempts < 1)
9021 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
9022 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9023 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9024 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9026 msg_print("The attack bounces!");
9029 if (is_original_ap(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
9032 /* Reflected bolts randomly target either one */
9033 if (one_in_(2)) flg |= PROJECT_PLAYER;
9034 else flg &= ~(PROJECT_PLAYER);
9036 /* The bolt is reflected */
9037 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9039 /* Don't affect the monster any longer */
9045 /* Find the closest point in the blast */
9048 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9052 effective_dist = dist;
9056 /* There is the riding player on this monster */
9057 if (p_ptr->riding && player_bold(y, x))
9059 /* Aimed on the player */
9060 if (flg & PROJECT_PLAYER)
9062 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9065 * A beam or bolt is well aimed
9067 * So don't affects the mount.
9074 * The spell is not well aimed,
9075 * So partly affect the mount too.
9082 * This grid is the original target.
9083 * Or aimed on your horse.
9085 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
9087 /* Hit the mount with full damage */
9091 * Otherwise this grid is not the
9092 * original target, it means that line
9093 * of fire is obstructed by this
9097 * A beam or bolt will hit either
9098 * player or mount. Choose randomly.
9100 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9104 /* Hit the mount with full damage */
9108 /* Hit the player later */
9109 flg |= PROJECT_PLAYER;
9111 /* Don't affect the mount */
9117 * The spell is not well aimed, so
9118 * partly affect both player and
9127 /* Affect the monster in the grid */
9128 if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
9132 /* Player affected one monster (without "jumping") */
9133 if (!who && (project_m_n == 1) && !jump)
9139 /* Track if possible */
9140 if (cave[y][x].m_idx > 0)
9142 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9144 /* Hack -- auto-recall */
9145 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9147 /* Hack - auto-track */
9148 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9155 if (flg & (PROJECT_KILL))
9157 /* Start with "dist" of zero */
9160 /* Scan for player */
9161 for (i = 0; i < grids; i++)
9165 /* Hack -- Notice new "dist" values */
9166 if (gm[dist+1] == i) dist++;
9168 /* Get the grid location */
9172 /* Affect the player? */
9173 if (!player_bold(y, x)) continue;
9175 /* Find the closest point in the blast */
9178 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9182 effective_dist = dist;
9185 /* Target may be your horse */
9188 /* Aimed on the player */
9189 if (flg & PROJECT_PLAYER)
9191 /* Hit the player with full damage */
9195 * Hack -- When this grid was not the
9196 * original target, a beam or bolt
9197 * would hit either player or mount,
9198 * and should be choosen randomly.
9200 * But already choosen to hit the
9201 * mount at this point.
9203 * Or aimed on your horse.
9205 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9208 * A beam or bolt is well aimed
9210 * So don't affects the player.
9217 * The spell is not well aimed,
9218 * So partly affect the player too.
9224 /* Affect the player */
9225 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9233 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9235 if (rakubadam_m > 0)
9237 if (rakuba(rakubadam_m, FALSE))
9240 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9242 msg_format("%^s has thrown you off!", m_name);
9246 if (p_ptr->riding && rakubadam_p > 0)
9248 if(rakuba(rakubadam_p, FALSE))
9251 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9253 msg_format("You have fallen from %s.", m_name);
9259 /* Return "something was noticed" */
9263 bool binding_field( int dam )
9265 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9266 int mirror_num=0; /* ¶À¤Î¿ô */
9271 int msec= delay_factor*delay_factor*delay_factor;
9277 /* Default target of monsterspell is player */
9278 monster_target_y=py;
9279 monster_target_x=px;
9281 for( x=0 ; x < cur_wid ; x++ )
9283 for( y=0 ; y < cur_hgt ; y++ )
9285 if( is_mirror_grid(&cave[y][x]) &&
9286 distance(py,px,y,x) <= MAX_RANGE &&
9287 distance(py,px,y,x) != 0 &&
9288 player_has_los_bold(y,x)
9290 mirror_y[mirror_num]=y;
9291 mirror_x[mirror_num]=x;
9297 if( mirror_num < 2 )return FALSE;
9299 point_x[0] = randint0( mirror_num );
9301 point_x[1] = randint0( mirror_num );
9303 while( point_x[0] == point_x[1] );
9305 point_y[0]=mirror_y[point_x[0]];
9306 point_x[0]=mirror_x[point_x[0]];
9307 point_y[1]=mirror_y[point_x[1]];
9308 point_x[1]=mirror_x[point_x[1]];
9312 x=point_x[0]+point_x[1]+point_x[2];
9313 y=point_y[0]+point_y[1]+point_y[2];
9315 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9316 - (point_y[0]*3-y)*(point_x[1]*3-x);
9317 if( centersign == 0 )return FALSE;
9319 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9320 x1 = x1 < point_x[2] ? x1 : point_x[2];
9321 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9322 y1 = y1 < point_y[2] ? y1 : point_y[2];
9324 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9325 x2 = x2 > point_x[2] ? x2 : point_x[2];
9326 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9327 y2 = y2 > point_y[2] ? y2 : point_y[2];
9329 for( y=y1 ; y <=y2 ; y++ ){
9330 for( x=x1 ; x <=x2 ; x++ ){
9331 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9332 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9333 centersign*( (point_x[1]-x)*(point_y[2]-y)
9334 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9335 centersign*( (point_x[2]-x)*(point_y[0]-y)
9336 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9338 if( player_has_los_bold(y,x)){
9339 /* Visual effects */
9341 && panel_contains(y,x)){
9342 p = bolt_pict(y,x,y,x, GF_MANA );
9343 print_rel(PICT_C(p), PICT_A(p),y,x);
9344 move_cursor_relative(y, x);
9345 /*if (fresh_before)*/ Term_fresh();
9346 Term_xtra(TERM_XTRA_DELAY, msec);
9352 for( y=y1 ; y <=y2 ; y++ ){
9353 for( x=x1 ; x <=x2 ; x++ ){
9354 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9355 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9356 centersign*( (point_x[1]-x)*(point_y[2]-y)
9357 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9358 centersign*( (point_x[2]-x)*(point_y[0]-y)
9359 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9361 if( player_has_los_bold(y,x)){
9362 (void)project_f(0,0,y,x,dam,GF_MANA);
9367 for( y=y1 ; y <=y2 ; y++ ){
9368 for( x=x1 ; x <=x2 ; x++ ){
9369 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9370 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9371 centersign*( (point_x[1]-x)*(point_y[2]-y)
9372 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9373 centersign*( (point_x[2]-x)*(point_y[0]-y)
9374 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9376 if( player_has_los_bold(y,x)){
9377 (void)project_o(0,0,y,x,dam,GF_MANA);
9382 for( y=y1 ; y <=y2 ; y++ ){
9383 for( x=x1 ; x <=x2 ; x++ ){
9384 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9385 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9386 centersign*( (point_x[1]-x)*(point_y[2]-y)
9387 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9388 centersign*( (point_x[2]-x)*(point_y[0]-y)
9389 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9391 if( player_has_los_bold(y,x) ){
9392 (void)project_m(0,0,y,x,dam,GF_MANA,
9393 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9400 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9402 msg_print("The field broke a mirror");
9404 remove_mirror(point_y[0],point_x[0]);
9410 void seal_of_mirror( int dam )
9414 for( x = 0 ; x < cur_wid ; x++ )
9416 for( y = 0 ; y < cur_hgt ; y++ )
9418 if( is_mirror_grid(&cave[y][x]))
9420 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9421 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9423 if( !cave[y][x].m_idx )