4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Spell projection */
15 /* ToDo: Make this global */
16 /* 1/x chance of reducing stats (for elemental attacks) */
17 #define HURT_CHANCE 16
20 static int rakubadam_m;
21 static int rakubadam_p;
23 int project_length = 0;
26 * Get another mirror. for SEEKER
28 static void next_mirror( int* next_y , int* next_x , int cury, int curx)
30 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
31 int mirror_num=0; /* ¶À¤Î¿ô */
35 for( x=0 ; x < cur_wid ; x++ )
37 for( y=0 ; y < cur_hgt ; y++ )
39 if( is_mirror_grid(&cave[y][x])){
40 mirror_y[mirror_num]=y;
41 mirror_x[mirror_num]=x;
48 num=randint0(mirror_num);
49 *next_y=mirror_y[num];
50 *next_x=mirror_x[num];
53 *next_y=cury+randint0(5)-2;
54 *next_x=curx+randint0(5)-2;
59 * Get a legal "multi-hued" color for drawing "spells"
61 static byte mh_attr(int max)
63 switch (randint1(max))
65 case 1: return (TERM_RED);
66 case 2: return (TERM_GREEN);
67 case 3: return (TERM_BLUE);
68 case 4: return (TERM_YELLOW);
69 case 5: return (TERM_ORANGE);
70 case 6: return (TERM_VIOLET);
71 case 7: return (TERM_L_RED);
72 case 8: return (TERM_L_GREEN);
73 case 9: return (TERM_L_BLUE);
74 case 10: return (TERM_UMBER);
75 case 11: return (TERM_L_UMBER);
76 case 12: return (TERM_SLATE);
77 case 13: return (TERM_WHITE);
78 case 14: return (TERM_L_WHITE);
79 case 15: return (TERM_L_DARK);
87 * Return a color to use for the bolt/ball spells
89 static byte spell_color(int type)
91 /* Check if A.B.'s new graphics should be used (rr9) */
92 if (streq(ANGBAND_GRAF, "new"))
97 case GF_PSY_SPEAR: return (0x06);
98 case GF_MISSILE: return (0x0F);
99 case GF_ACID: return (0x04);
100 case GF_ELEC: return (0x02);
101 case GF_FIRE: return (0x00);
102 case GF_COLD: return (0x01);
103 case GF_POIS: return (0x03);
104 case GF_HOLY_FIRE: return (0x00);
105 case GF_HELL_FIRE: return (0x00);
106 case GF_MANA: return (0x0E);
108 case GF_SEEKER: return (0x0E);
109 case GF_SUPER_RAY: return (0x0E);
111 case GF_ARROW: return (0x0F);
112 case GF_WATER: return (0x04);
113 case GF_NETHER: return (0x07);
114 case GF_CHAOS: return (mh_attr(15));
115 case GF_DISENCHANT: return (0x05);
116 case GF_NEXUS: return (0x0C);
117 case GF_CONFUSION: return (mh_attr(4));
118 case GF_SOUND: return (0x09);
119 case GF_SHARDS: return (0x08);
120 case GF_FORCE: return (0x09);
121 case GF_INERTIA: return (0x09);
122 case GF_GRAVITY: return (0x09);
123 case GF_TIME: return (0x09);
124 case GF_LITE_WEAK: return (0x06);
125 case GF_LITE: return (0x06);
126 case GF_DARK_WEAK: return (0x07);
127 case GF_DARK: return (0x07);
128 case GF_PLASMA: return (0x0B);
129 case GF_METEOR: return (0x00);
130 case GF_ICE: return (0x01);
131 case GF_ROCKET: return (0x0F);
132 case GF_DEATH_RAY: return (0x07);
133 case GF_NUKE: return (mh_attr(2));
134 case GF_DISINTEGRATE: return (0x05);
146 case GF_CAUSE_4: return (0x0E);
147 case GF_HAND_DOOM: return (0x07);
148 case GF_CAPTURE : return (0x0E);
149 case GF_IDENTIFY: return (0x01);
150 case GF_ATTACK: return (0x0F);
151 case GF_PHOTO : return (0x06);
154 /* Normal tiles or ASCII */
160 /* Lookup the default colors for this type */
161 cptr s = quark_str(gf_color[type]);
164 if (!s) return (TERM_WHITE);
166 /* Pick a random color */
167 c = s[randint0(strlen(s))];
169 /* Lookup this color */
170 a = my_strchr(color_char, c) - color_char;
172 /* Invalid color (note check for < 0 removed, gave a silly
173 * warning because bytes are always >= 0 -- RG) */
174 if (a > 15) return (TERM_WHITE);
180 /* Standard "color" */
186 * Find the attr/char pair to use for a spell effect
188 * It is moving (or has moved) from (x,y) to (nx,ny).
190 * If the distance is not "one", we (may) return "*".
192 u16b bolt_pict(int y, int x, int ny, int nx, int typ)
202 if ((ny == y) && (nx == x)) base = 0x30;
205 else if (nx == x) base = 0x40;
208 else if (ny == y) base = 0x50;
211 else if ((ny - y) == (x - nx)) base = 0x60;
214 else if ((ny - y) == (nx - x)) base = 0x70;
219 /* Basic spell color */
220 k = spell_color(typ);
222 /* Obtain attr/char */
223 a = misc_to_attr[base + k];
224 c = misc_to_char[base + k];
232 * Determine the path taken by a projection.
234 * The projection will always start from the grid (y1,x1), and will travel
235 * towards the grid (y2,x2), touching one grid per unit of distance along
236 * the major axis, and stopping when it enters the destination grid or a
237 * wall grid, or has travelled the maximum legal distance of "range".
239 * Note that "distance" in this function (as in the "update_view()" code)
240 * is defined as "MAX(dy,dx) + MIN(dy,dx)/2", which means that the player
241 * actually has an "octagon of projection" not a "circle of projection".
243 * The path grids are saved into the grid array pointed to by "gp", and
244 * there should be room for at least "range" grids in "gp". Note that
245 * due to the way in which distance is calculated, this function normally
246 * uses fewer than "range" grids for the projection path, so the result
247 * of this function should never be compared directly to "range". Note
248 * that the initial grid (y1,x1) is never saved into the grid array, not
249 * even if the initial grid is also the final grid. XXX XXX XXX
251 * The "flg" flags can be used to modify the behavior of this function.
253 * In particular, the "PROJECT_STOP" and "PROJECT_THRU" flags have the same
254 * semantics as they do for the "project" function, namely, that the path
255 * will stop as soon as it hits a monster, or that the path will continue
256 * through the destination grid, respectively.
258 * The "PROJECT_JUMP" flag, which for the "project()" function means to
259 * start at a special grid (which makes no sense in this function), means
260 * that the path should be "angled" slightly if needed to avoid any wall
261 * grids, allowing the player to "target" any grid which is in "view".
262 * This flag is non-trivial and has not yet been implemented, but could
263 * perhaps make use of the "vinfo" array (above). XXX XXX XXX
265 * This function returns the number of grids (if any) in the path. This
266 * function will return zero if and only if (y1,x1) and (y2,x2) are equal.
268 * This algorithm is similar to, but slightly different from, the one used
269 * by "update_view_los()", and very different from the one used by "los()".
271 sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg)
293 /* No path necessary (or allowed) */
294 if ((x1 == x2) && (y1 == y2)) return (0);
322 /* Number of "units" in one "half" grid */
325 /* Number of "units" in one "full" grid */
331 /* Let m = ((dx/dy) * full) = (dx * dx * 2) */
342 /* Advance (X) part 2 */
345 /* Advance (X) part 3 */
352 /* Create the projection path */
356 gp[n++] = GRID(y, x);
358 /* Hack -- Check maximum range */
359 if ((n + (k >> 1)) >= range) break;
361 /* Sometimes stop at destination grid */
362 if (!(flg & (PROJECT_THRU)))
364 if ((x == x2) && (y == y2)) break;
367 if (flg & (PROJECT_DISI))
369 if ((n > 0) && cave_stop_disintegration(y, x)) break;
371 else if (flg & (PROJECT_LOS))
373 if ((n > 0) && !cave_los_bold(y, x)) break;
375 else if (!(flg & (PROJECT_PATH)))
377 /* Always stop at non-initial wall grids */
378 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
381 /* Sometimes stop at non-initial monsters/players */
382 if (flg & (PROJECT_STOP))
385 (player_bold(y, x) || cave[y][x].m_idx != 0))
389 if (!in_bounds(y, x)) break;
394 /* Advance (X) part 1 */
397 /* Horizontal change */
400 /* Advance (X) part 2 */
403 /* Advance (X) part 3 */
419 /* Let m = ((dy/dx) * full) = (dy * dy * 2) */
428 /* Vertical change */
431 /* Advance (Y) part 2 */
434 /* Advance (Y) part 3 */
441 /* Create the projection path */
445 gp[n++] = GRID(y, x);
447 /* Hack -- Check maximum range */
448 if ((n + (k >> 1)) >= range) break;
450 /* Sometimes stop at destination grid */
451 if (!(flg & (PROJECT_THRU)))
453 if ((x == x2) && (y == y2)) break;
456 if (flg & (PROJECT_DISI))
458 if ((n > 0) && cave_stop_disintegration(y, x)) break;
460 else if (flg & (PROJECT_LOS))
462 if ((n > 0) && !cave_los_bold(y, x)) break;
464 else if (!(flg & (PROJECT_PATH)))
466 /* Always stop at non-initial wall grids */
467 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
470 /* Sometimes stop at non-initial monsters/players */
471 if (flg & (PROJECT_STOP))
474 (player_bold(y, x) || cave[y][x].m_idx != 0))
478 if (!in_bounds(y, x)) break;
483 /* Advance (Y) part 1 */
486 /* Vertical change */
489 /* Advance (Y) part 2 */
492 /* Advance (Y) part 3 */
512 /* Create the projection path */
516 gp[n++] = GRID(y, x);
518 /* Hack -- Check maximum range */
519 if ((n + (n >> 1)) >= range) break;
521 /* Sometimes stop at destination grid */
522 if (!(flg & (PROJECT_THRU)))
524 if ((x == x2) && (y == y2)) break;
527 if (flg & (PROJECT_DISI))
529 if ((n > 0) && cave_stop_disintegration(y, x)) break;
531 else if (flg & (PROJECT_LOS))
533 if ((n > 0) && !cave_los_bold(y, x)) break;
535 else if (!(flg & (PROJECT_PATH)))
537 /* Always stop at non-initial wall grids */
538 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
541 /* Sometimes stop at non-initial monsters/players */
542 if (flg & (PROJECT_STOP))
545 (player_bold(y, x) || cave[y][x].m_idx != 0))
549 if (!in_bounds(y, x)) break;
566 * Mega-Hack -- track "affected" monsters (see "project()" comments)
568 static int project_m_n;
569 static int project_m_x;
570 static int project_m_y;
571 /* Mega-Hack -- monsters target */
572 static s16b monster_target_x;
573 static s16b monster_target_y;
577 * We are called from "project()" to "damage" terrain features
579 * We are called both for "beam" effects and "ball" effects.
581 * The "r" parameter is the "distance from ground zero".
583 * Note that we determine if the player can "see" anything that happens
584 * by taking into account: blindness, line-of-sight, and illumination.
586 * We return "TRUE" if the effect of the projection is "obvious".
588 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
590 * XXX XXX XXX Perhaps we should affect doors?
592 static bool project_f(int who, int r, int y, int x, int dam, int typ)
594 cave_type *c_ptr = &cave[y][x];
595 feature_type *f_ptr = &f_info[c_ptr->feat];
597 bool obvious = FALSE;
598 bool known = player_has_los_bold(y, x);
604 /* Reduce damage by distance */
605 dam = (dam + r) / (r + 1);
608 if (have_flag(f_ptr->flags, FF_TREE))
617 message = "¸Ï¤ì¤¿";break;
619 message = "was blasted.";break;
623 message = "½Ì¤ó¤À";break;
625 message = "shrank.";break;
629 message = "ÍϤ±¤¿";break;
631 message = "melted.";break;
636 message = "Åà¤ê¡¢ºÕ¤±»¶¤Ã¤¿";break;
638 message = "was frozen and smashed.";break;
644 message = "dz¤¨¤¿";break;
646 message = "burns up!";break;
660 message = "Ê´ºÕ¤µ¤ì¤¿";break;
662 message = "was crushed.";break;
665 message = NULL;break;
670 msg_format("ÌÚ¤Ï%s¡£", message);
672 msg_format("A tree %s", message);
674 cave_set_feat(y, x, (one_in_(3) ? FEAT_DEEP_GRASS : FEAT_GRASS));
677 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
681 /* Analyze the type */
684 /* Ignore most effects */
719 /* Destroy Traps (and Locks) */
722 /* Reveal secret doors */
723 if (is_hidden_door(c_ptr))
728 /* Check line of sight */
736 if (is_trap(c_ptr->feat))
738 /* Check line of sight */
742 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
744 msg_print("There is a bright flash of light!");
750 /* Destroy the trap */
751 cave_alter_feat(y, x, FF_DISARM);
754 /* Locked doors are unlocked */
755 if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
757 s16b old_feat = c_ptr->feat;
759 /* Unlock the door */
760 cave_alter_feat(y, x, FF_DISARM);
762 /* Check line of sound */
763 if (known && (old_feat != c_ptr->feat))
766 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
775 /* Remove "unsafe" flag if player is not blind */
776 if (!p_ptr->blind && player_has_los_bold(y, x))
778 c_ptr->info &= ~(CAVE_UNSAFE);
789 /* Destroy Doors (and traps) */
792 /* Destroy all doors and traps */
793 if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
795 /* Check line of sight */
800 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
802 msg_print("There is a bright flash of light!");
808 /* Destroy the feature */
809 cave_alter_feat(y, x, FF_TUNNEL);
812 /* Remove "unsafe" flag if player is not blind */
813 if (!p_ptr->blind && player_has_los_bold(y, x))
815 c_ptr->info &= ~(CAVE_UNSAFE);
826 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
828 if (have_flag(f_ptr->flags, FF_SPIKE))
830 s16b old_mimic = c_ptr->mimic;
831 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
833 cave_alter_feat(y, x, FF_SPIKE);
835 c_ptr->mimic = old_mimic;
843 /* Check line of sight */
844 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
848 msg_format("%s¤Ë²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ³«¤«¤Ê¤¯¤Ê¤Ã¤¿¡£", f_name + mimic_f_ptr->name);
850 msg_format("The %s seems stuck.", f_name + mimic_f_ptr->name);
859 /* Destroy walls (and doors) */
862 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
865 if (known && (c_ptr->info & (CAVE_MARK)))
868 msg_format("%s¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª", f_name + f_info[get_feat_mimic(c_ptr)].name);
870 msg_format("The %s turns into mud!", f_name + f_info[get_feat_mimic(c_ptr)].name);
876 /* Destroy the wall */
877 cave_alter_feat(y, x, FF_HURT_ROCK);
879 /* Update some things */
880 p_ptr->update |= (PU_FLOW);
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;
916 /* Require a "naked" floor grid */
917 if (!cave_naked_bold(y, x)) break;
919 /* Not on the player */
920 if (player_bold(y, x)) break;
922 /* Create a closed door */
923 cave_set_feat(y, x, FEAT_TREES);
926 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
934 /* Require a "naked" floor grid */
935 if (!cave_naked_bold(y, x)) break;
938 c_ptr->info |= CAVE_OBJECT;
939 c_ptr->mimic = FEAT_GLYPH;
952 /* Require a "naked" floor grid */
953 if (!cave_naked_bold(y, x)) break;
955 /* Not on the player */
956 if (player_bold(y, x)) break;
959 cave_set_feat(y, x, FEAT_WALL);
967 /* Ignore permanent grid */
968 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
973 /* Ignore grid without enough space */
974 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
976 /* Place a shallow lava */
977 cave_set_feat(y, x, FEAT_SHAL_LAVA);
982 /* Place a deep lava */
983 cave_set_feat(y, x, FEAT_DEEP_LAVA);
990 /* Ignore permanent grid */
991 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
996 /* Ignore grid without enough space */
997 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
999 /* Place a shallow water */
1000 cave_set_feat(y, x, FEAT_SHAL_WATER);
1005 /* Place a deep water */
1006 cave_set_feat(y, x, FEAT_DEEP_WATER);
1011 /* Lite up the grid */
1015 /* Turn on the light */
1016 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
1018 c_ptr->info |= (CAVE_GLOW);
1026 update_local_illumination(y, x);
1029 if (player_can_see_bold(y, x)) obvious = TRUE;
1031 /* Mega-Hack -- Update the monster in the affected grid */
1032 /* This allows "spear of light" (etc) to work "correctly" */
1033 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1035 if (p_ptr->special_defense & NINJA_S_STEALTH)
1037 if (player_bold(y, x)) set_superstealth(FALSE);
1044 /* Darken the grid */
1048 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(c_ptr);
1051 /* Turn off the light. */
1054 for (j = 0; j < 9; j++)
1056 int by = y + ddy_ddd[j];
1057 int bx = x + ddx_ddd[j];
1059 if (in_bounds2(by, bx))
1061 cave_type *cc_ptr = &cave[by][bx];
1063 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
1071 if (!do_dark) break;
1073 c_ptr->info &= ~(CAVE_GLOW);
1075 /* Hack -- Forget "boring" grids */
1076 if (!have_flag(f_ptr->flags, FF_REMEMBER))
1079 c_ptr->info &= ~(CAVE_MARK);
1088 update_local_illumination(y, x);
1091 if (player_can_see_bold(y, x)) obvious = TRUE;
1093 /* Mega-Hack -- Update the monster in the affected grid */
1094 /* This allows "spear of light" (etc) to work "correctly" */
1095 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1105 if (is_mirror_grid(c_ptr))
1108 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1110 msg_print("The mirror was crashed!");
1112 remove_mirror(y, x);
1113 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1119 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
1122 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1124 msg_print("The mirror was crashed!");
1126 remove_mirror(y, x);
1127 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1132 case GF_DISINTEGRATE:
1134 /* Destroy mirror */
1135 if (is_mirror_grid(c_ptr)) remove_mirror(y, x);
1137 /* Permanent features don't get effect */
1138 /* But not protect monsters and other objects */
1139 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
1141 cave_alter_feat(y, x, FF_HURT_DISI);
1143 /* Update some things -- similar to GF_KILL_WALL */
1144 p_ptr->update |= (PU_FLOW);
1151 /* Return "Anything seen?" */
1158 * We are called from "project()" to "damage" objects
1160 * We are called both for "beam" effects and "ball" effects.
1162 * Perhaps we should only SOMETIMES damage things on the ground.
1164 * The "r" parameter is the "distance from ground zero".
1166 * Note that we determine if the player can "see" anything that happens
1167 * by taking into account: blindness, line-of-sight, and illumination.
1169 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1171 * We return "TRUE" if the effect of the projection is "obvious".
1173 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1175 cave_type *c_ptr = &cave[y][x];
1177 s16b this_o_idx, next_o_idx = 0;
1179 bool obvious = FALSE;
1180 bool known = player_has_los_bold(y, x);
1182 u32b flgs[TR_FLAG_SIZE];
1184 char o_name[MAX_NLEN];
1187 bool is_potion = FALSE;
1191 who = who ? who : 0;
1193 /* Reduce damage by distance */
1194 dam = (dam + r) / (r + 1);
1197 /* Scan all objects in the grid */
1198 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1200 /* Acquire object */
1201 object_type *o_ptr = &o_list[this_o_idx];
1203 bool is_art = FALSE;
1204 bool ignore = FALSE;
1205 bool do_kill = FALSE;
1207 cptr note_kill = NULL;
1210 /* Get the "plural"-ness */
1211 bool plural = (o_ptr->number > 1);
1214 /* Acquire next object */
1215 next_o_idx = o_ptr->next_o_idx;
1217 /* Extract the flags */
1218 object_flags(o_ptr, flgs);
1220 /* Check for artifact */
1221 if (object_is_artifact(o_ptr)) is_art = TRUE;
1223 /* Analyze the type */
1226 /* Acid -- Lots of things */
1229 if (hates_acid(o_ptr))
1233 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1235 note_kill = (plural ? " melt!" : " melts!");
1238 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1243 /* Elec -- Rings and Wands */
1246 if (hates_elec(o_ptr))
1250 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1252 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1255 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1260 /* Fire -- Flammable objects */
1263 if (hates_fire(o_ptr))
1267 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1269 note_kill = (plural ? " burn up!" : " burns up!");
1272 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1277 /* Cold -- potions and flasks */
1280 if (hates_cold(o_ptr))
1283 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1285 note_kill = (plural ? " shatter!" : " shatters!");
1289 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1297 if (hates_fire(o_ptr))
1301 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1303 note_kill = (plural ? " burn up!" : " burns up!");
1306 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1308 if (hates_elec(o_ptr))
1313 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1315 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1318 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1326 if (hates_fire(o_ptr))
1330 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1332 note_kill = (plural ? " burn up!" : " burns up!");
1335 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1337 if (hates_cold(o_ptr))
1342 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1344 note_kill = (plural ? " shatter!" : " shatters!");
1347 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1352 /* Hack -- break potions and such */
1358 if (hates_cold(o_ptr))
1361 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1363 note_kill = (plural ? " shatter!" : " shatters!");
1371 /* Mana and Chaos -- destroy everything */
1378 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1380 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1386 case GF_DISINTEGRATE:
1390 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1392 note_kill = (plural ? " evaporate!" : " evaporates!");
1402 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1404 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1407 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1408 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1412 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1416 if (object_is_cursed(o_ptr))
1420 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1422 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1431 identify_item(o_ptr);
1433 /* Auto-inscription */
1434 autopick_alter_item((-this_o_idx), FALSE);
1442 /* Chests are noticed only if trapped or locked */
1443 if (o_ptr->tval == TV_CHEST)
1445 /* Disarm/Unlock traps */
1446 if (o_ptr->pval > 0)
1448 /* Disarm or Unlock */
1449 o_ptr->pval = (0 - o_ptr->pval);
1452 object_known(o_ptr);
1455 if (known && o_ptr->marked)
1458 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1460 msg_print("Click!");
1472 if (o_ptr->tval == TV_CORPSE)
1477 if (!who || is_pet(&m_list[who]))
1478 mode |= PM_FORCE_PET;
1480 for (i = 0; i < o_ptr->number ; i++)
1482 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1483 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1488 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1490 note_kill = (plural ? " become dust." : " becomes dust.");
1495 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1498 note_kill = "À¸¤Ê֤ä¿¡£";
1500 note_kill = "rivived.";
1503 else if (!note_kill)
1506 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1508 note_kill = (plural ? " become dust." : " becomes dust.");
1520 /* Attempt to destroy the object */
1523 /* Effect "observed" */
1524 if (known && o_ptr->marked)
1527 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1530 /* Artifacts, and other objects, get to resist */
1531 if (is_art || ignore)
1533 /* Observe the resist */
1534 if (known && o_ptr->marked)
1537 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1540 msg_format("The %s %s unaffected!",
1541 o_name, (plural ? "are" : "is"));
1550 /* Describe if needed */
1551 if (known && o_ptr->marked && note_kill)
1554 msg_format("%s¤Ï%s", o_name, note_kill);
1556 msg_format("The %s%s", o_name, note_kill);
1561 k_idx = o_ptr->k_idx;
1562 is_potion = object_is_potion(o_ptr);
1565 /* Delete the object */
1566 delete_object_idx(this_o_idx);
1568 /* Potions produce effects when 'shattered' */
1571 (void)potion_smash_effect(who, y, x, k_idx);
1580 /* Return "Anything seen?" */
1586 * Helper function for "project()" below.
1588 * Handle a beam/bolt/ball causing damage to a monster.
1590 * This routine takes a "source monster" (by index) which is mostly used to
1591 * determine if the player is causing the damage, and a "radius" (see below),
1592 * which is used to decrease the power of explosions with distance, and a
1593 * location, via integers which are modified by certain types of attacks
1594 * (polymorph and teleport being the obvious ones), a default damage, which
1595 * is modified as needed based on various properties, and finally a "damage
1596 * type" (see below).
1598 * Note that this routine can handle "no damage" attacks (like teleport) by
1599 * taking a "zero" damage, and can even take "parameters" to attacks (like
1600 * confuse) by accepting a "damage", using it to calculate the effect, and
1601 * then setting the damage to zero. Note that the "damage" parameter is
1602 * divided by the radius, so monsters not at the "epicenter" will not take
1603 * as much damage (or whatever)...
1605 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1606 * may result in a dereference of an invalid pointer. XXX XXX XXX
1608 * Various messages are produced, and damage is applied.
1610 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1611 * actually be "made" of that substance, or "breathe" big balls of it.
1613 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1616 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1617 * and hurts evil less. If can breath nether, then it resists it as well.
1619 * Damage reductions use the following formulas:
1620 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1621 * gives avg damage of .655, ranging from .858 to .500
1622 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1623 * gives avg damage of .544, ranging from .714 to .417
1624 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1625 * gives avg damage of .444, ranging from .556 to .333
1626 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1627 * gives avg damage of .327, ranging from .427 to .250
1628 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1629 * gives something simple.
1631 * In this function, "result" messages are postponed until the end, where
1632 * the "note" string is appended to the monster name, if not NULL. So,
1633 * to make a spell have "no effect" just set "note" to NULL. You should
1634 * also set "notice" to FALSE, or the player will learn what the spell does.
1636 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1638 /* "flg" was added. */
1639 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1643 cave_type *c_ptr = &cave[y][x];
1645 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1646 monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
1648 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1652 /* Is the monster "seen"? */
1653 bool seen = m_ptr->ml;
1654 bool seen_msg = is_seen(m_ptr);
1656 bool slept = (bool)(m_ptr->csleep > 0);
1658 /* Were the effects "obvious" (if seen)? */
1659 bool obvious = FALSE;
1661 /* Can the player know about this effect? */
1662 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1664 /* Can the player see the source of this effect? */
1665 bool see_s_msg = ((who <= 0) || is_seen(caster_ptr));
1667 /* Were the effects "irrelevant"? */
1668 bool skipped = FALSE;
1670 /* Gets the monster angry at the source of the effect? */
1671 bool get_angry = FALSE;
1673 /* Polymorph setting (true or false) */
1674 bool do_poly = FALSE;
1676 /* Teleport setting (max distance) */
1679 /* Confusion setting (amount to confuse) */
1682 /* Stunning setting (amount to stun) */
1685 /* Sleep amount (amount to sleep) */
1688 /* Fear amount (amount to fear) */
1691 /* Time amount (amount to time) */
1694 bool heal_leper = FALSE;
1696 /* Hold the monster name */
1705 /* Assume no note */
1708 /* Assume a default death */
1709 cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
1714 int caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1717 if (!c_ptr->m_idx) return (FALSE);
1719 /* Never affect projector */
1720 if (who && (c_ptr->m_idx == who)) return (FALSE);
1721 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1722 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1724 /* Don't affect already death monsters */
1725 /* Prevents problems with chain reactions of exploding monsters */
1726 if (m_ptr->hp < 0) return (FALSE);
1728 /* Reduce damage by distance */
1729 dam = (dam + r) / (r + 1);
1732 /* Get the monster name (BEFORE polymorphing) */
1733 monster_desc(m_name, m_ptr, 0);
1736 /* Get the monster possessive ("his"/"her"/"its") */
1737 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1741 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1743 /* Analyze the damage type */
1746 /* Magic Missile -- pure damage */
1749 if (seen) obvious = TRUE;
1751 if (r_ptr->flagsr & RFR_RES_ALL)
1754 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1756 note = " is immune.";
1759 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1768 if (seen) obvious = TRUE;
1770 if (r_ptr->flagsr & RFR_RES_ALL)
1773 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1775 note = " is immune.";
1778 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1781 if (r_ptr->flagsr & RFR_IM_ACID)
1784 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1786 note = " resists a lot.";
1790 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1798 if (seen) obvious = TRUE;
1800 if (r_ptr->flagsr & RFR_RES_ALL)
1803 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1805 note = " is immune.";
1808 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1811 if (r_ptr->flagsr & RFR_IM_ELEC)
1814 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1816 note = " resists a lot.";
1820 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1828 if (seen) obvious = TRUE;
1830 if (r_ptr->flagsr & RFR_RES_ALL)
1833 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1835 note = " is immune.";
1838 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1841 if (r_ptr->flagsr & RFR_IM_FIRE)
1844 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1846 note = " resists a lot.";
1850 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1852 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1855 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1857 note = " is hit hard.";
1861 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1869 if (seen) obvious = TRUE;
1871 if (r_ptr->flagsr & RFR_RES_ALL)
1874 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1876 note = " is immune.";
1879 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1882 if (r_ptr->flagsr & RFR_IM_COLD)
1885 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1887 note = " resists a lot.";
1891 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1893 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1896 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1898 note = " is hit hard.";
1902 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1910 if (seen) obvious = TRUE;
1912 if (r_ptr->flagsr & RFR_RES_ALL)
1915 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1917 note = " is immune.";
1920 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1923 if (r_ptr->flagsr & RFR_IM_POIS)
1926 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1928 note = " resists a lot.";
1932 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1940 if (seen) obvious = TRUE;
1942 if (r_ptr->flagsr & RFR_RES_ALL)
1945 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1947 note = " is immune.";
1950 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1953 if (r_ptr->flagsr & RFR_IM_POIS)
1956 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
1961 dam *= 3; dam /= randint1(6) + 6;
1962 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1964 else if (one_in_(3)) do_poly = TRUE;
1968 /* Hellfire -- hurts Evil */
1971 if (seen) obvious = TRUE;
1973 if (r_ptr->flagsr & RFR_RES_ALL)
1976 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1978 note = " is immune.";
1981 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1984 if (r_ptr->flags3 & RF3_GOOD)
1988 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
1990 note = " is hit hard.";
1993 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1998 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2001 if (seen) obvious = TRUE;
2003 if (r_ptr->flagsr & RFR_RES_ALL)
2006 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2008 note = " is immune.";
2011 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2014 if (r_ptr->flags3 & RF3_GOOD)
2018 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2020 note = " is immune.";
2023 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
2025 else if (r_ptr->flags3 & RF3_EVIL)
2029 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2031 note = " is hit hard.";
2034 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
2039 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2044 dam *= 3; dam /= randint1(6) + 6;
2049 /* Arrow -- XXX no defense */
2052 if (seen) obvious = TRUE;
2054 if (r_ptr->flagsr & RFR_RES_ALL)
2057 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2059 note = " is immune.";
2062 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2068 /* Plasma -- XXX perhaps check ELEC or FIRE */
2071 if (seen) obvious = TRUE;
2073 if (r_ptr->flagsr & RFR_RES_ALL)
2076 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2078 note = " is immune.";
2081 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2084 if (r_ptr->flagsr & RFR_RES_PLAS)
2087 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2092 dam *= 3; dam /= randint1(6) + 6;
2093 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
2098 /* Nether -- see above */
2101 if (seen) obvious = TRUE;
2103 if (r_ptr->flagsr & RFR_RES_ALL)
2106 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2108 note = " is immune.";
2111 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2114 if (r_ptr->flagsr & RFR_RES_NETH)
2116 if (r_ptr->flags3 & RF3_UNDEAD)
2119 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2121 note = " is immune.";
2125 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2130 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2135 dam *= 3; dam /= randint1(6) + 6;
2137 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
2139 else if (r_ptr->flags3 & RF3_EVIL)
2143 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2145 note = " resists somewhat.";
2148 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2153 /* Water (acid) damage -- Water spirits/elementals are immune */
2156 if (seen) obvious = TRUE;
2158 if (r_ptr->flagsr & RFR_RES_ALL)
2161 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2163 note = " is immune.";
2166 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2169 if (r_ptr->flagsr & RFR_RES_WATE)
2171 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
2174 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2176 note = " is immune.";
2184 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2189 dam *= 3; dam /= randint1(6) + 6;
2191 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
2196 /* Chaos -- Chaos breathers resist */
2199 if (seen) obvious = TRUE;
2201 if (r_ptr->flagsr & RFR_RES_ALL)
2204 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2206 note = " is immune.";
2209 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2212 if (r_ptr->flagsr & RFR_RES_CHAO)
2215 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2220 dam *= 3; dam /= randint1(6) + 6;
2221 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
2223 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
2226 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2228 note = " resists somewhat.";
2231 dam *= 3; dam /= randint1(6) + 6;
2232 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2237 do_conf = (5 + randint1(11) + r) / (r + 1);
2242 /* Shards -- Shard breathers resist */
2245 if (seen) obvious = TRUE;
2247 if (r_ptr->flagsr & RFR_RES_ALL)
2250 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2252 note = " is immune.";
2255 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2258 if (r_ptr->flagsr & RFR_RES_SHAR)
2261 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2266 dam *= 3; dam /= randint1(6) + 6;
2267 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2272 /* Rocket: Shard resistance helps */
2275 if (seen) obvious = TRUE;
2277 if (r_ptr->flagsr & RFR_RES_ALL)
2280 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2282 note = " is immune.";
2285 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2288 if (r_ptr->flagsr & RFR_RES_SHAR)
2291 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2293 note = " resists somewhat.";
2297 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2303 /* Sound -- Sound breathers resist */
2306 if (seen) obvious = TRUE;
2308 if (r_ptr->flagsr & RFR_RES_ALL)
2311 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2313 note = " is immune.";
2316 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2319 if (r_ptr->flagsr & RFR_RES_SOUN)
2322 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2327 dam *= 2; dam /= randint1(6) + 6;
2328 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
2330 else do_stun = (10 + randint1(15) + r) / (r + 1);
2337 if (seen) obvious = TRUE;
2339 if (r_ptr->flagsr & RFR_RES_ALL)
2342 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2344 note = " is immune.";
2347 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2350 if (r_ptr->flags3 & RF3_NO_CONF)
2353 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2358 dam *= 3; dam /= randint1(6) + 6;
2359 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2361 else do_conf = (10 + randint1(15) + r) / (r + 1);
2365 /* Disenchantment -- Breathers and Disenchanters resist */
2368 if (seen) obvious = TRUE;
2370 if (r_ptr->flagsr & RFR_RES_ALL)
2373 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2375 note = " is immune.";
2378 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2381 if (r_ptr->flagsr & RFR_RES_DISE)
2384 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2389 dam *= 3; dam /= randint1(6) + 6;
2390 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
2395 /* Nexus -- Breathers and Existers resist */
2398 if (seen) obvious = TRUE;
2400 if (r_ptr->flagsr & RFR_RES_ALL)
2403 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2405 note = " is immune.";
2408 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2411 if (r_ptr->flagsr & RFR_RES_NEXU)
2414 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2419 dam *= 3; dam /= randint1(6) + 6;
2420 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
2428 if (seen) obvious = TRUE;
2430 if (r_ptr->flagsr & RFR_RES_ALL)
2433 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2435 note = " is immune.";
2438 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2441 if (r_ptr->flagsr & RFR_RES_WALL)
2444 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2449 dam *= 3; dam /= randint1(6) + 6;
2450 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
2452 else do_stun = (randint1(15) + r) / (r + 1);
2456 /* Inertia -- breathers resist */
2459 if (seen) obvious = TRUE;
2461 if (r_ptr->flagsr & RFR_RES_ALL)
2464 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2466 note = " is immune.";
2469 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2472 if (r_ptr->flagsr & RFR_RES_INER)
2475 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2480 dam *= 3; dam /= randint1(6) + 6;
2481 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
2485 /* Powerful monsters can resist */
2486 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2487 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2491 /* Normal monsters slow down */
2497 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2499 note = " starts moving slower.";
2502 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2503 if (c_ptr->m_idx == p_ptr->riding)
2504 p_ptr->update |= (PU_BONUS);
2510 /* Time -- breathers resist */
2513 if (seen) obvious = TRUE;
2515 if (r_ptr->flagsr & RFR_RES_ALL)
2518 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2520 note = " is immune.";
2523 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2526 if (r_ptr->flagsr & RFR_RES_TIME)
2529 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2534 dam *= 3; dam /= randint1(6) + 6;
2535 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
2537 else do_time = (dam + 1) / 2;
2541 /* Gravity -- breathers resist */
2544 bool resist_tele = FALSE;
2546 if (seen) obvious = TRUE;
2548 if (r_ptr->flagsr & RFR_RES_ALL)
2551 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2553 note = " is immune.";
2556 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2559 if (r_ptr->flagsr & RFR_RES_TELE)
2561 if (r_ptr->flags1 & (RF1_UNIQUE))
2563 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2565 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2567 note = " is unaffected!";
2572 else if (r_ptr->level > randint1(100))
2574 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2576 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2585 if (!resist_tele) do_dist = 10;
2587 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2589 if (r_ptr->flagsr & RFR_RES_GRAV)
2592 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2597 dam *= 3; dam /= randint1(6) + 6;
2599 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
2604 /* Powerful monsters can resist */
2605 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2606 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2610 /* Normal monsters slow down */
2616 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2618 note = " starts moving slower.";
2621 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2622 if (c_ptr->m_idx == p_ptr->riding)
2623 p_ptr->update |= (PU_BONUS);
2627 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2629 /* Attempt a saving throw */
2630 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2631 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2635 /* No obvious effect */
2637 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2639 note = " is unaffected!";
2653 if (seen) obvious = TRUE;
2655 if (r_ptr->flagsr & RFR_RES_ALL)
2658 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2660 note = " is immune.";
2663 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2671 case GF_DISINTEGRATE:
2673 if (seen) obvious = TRUE;
2675 if (r_ptr->flagsr & RFR_RES_ALL)
2678 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2680 note = " is immune.";
2683 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2686 if (r_ptr->flags3 & RF3_HURT_ROCK)
2688 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2690 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2691 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2693 note = " loses some skin!";
2694 note_dies = " evaporates!";
2704 if (seen) obvious = TRUE;
2706 /* PSI only works if the monster can see you! -- RG */
2707 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2710 if (seen_msg) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name);
2712 if (seen_msg) msg_format("%^s can't see you, and isn't affected!", m_name);
2718 if (r_ptr->flagsr & RFR_RES_ALL)
2721 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2723 note = " is immune.";
2726 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2729 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2733 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2735 note = " is immune!";
2737 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2740 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2741 (r_ptr->flags3 & RF3_ANIMAL) ||
2742 (r_ptr->level > randint1(3 * dam)))
2746 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2753 * Powerful demons & undead can turn a mindcrafter's
2754 * attacks back on them
2756 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2757 (r_ptr->level > p_ptr->lev / 2) &&
2762 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2764 msg_format("%^s%s corrupted mind backlashes your attack!",
2765 m_name, (seen ? "'s" : "s"));
2769 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2772 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2774 msg_print("You resist the effects!");
2780 /* Injure +/- confusion */
2781 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2782 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2785 switch (randint1(4))
2788 set_confused(p_ptr->confused + 3 + randint1(dam));
2791 set_stun(p_ptr->stun + randint1(dam));
2795 if (r_ptr->flags3 & RF3_NO_FEAR)
2797 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2799 note = " is unaffected.";
2803 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2807 if (!p_ptr->free_act)
2808 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2817 if ((dam > 0) && one_in_(4))
2819 switch (randint1(4))
2822 do_conf = 3 + randint1(dam);
2825 do_stun = 3 + randint1(dam);
2828 do_fear = 3 + randint1(dam);
2832 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2834 note = " falls asleep!";
2837 do_sleep = 3 + randint1(dam);
2843 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2845 note_dies = " collapses, a mindless husk.";
2853 if (seen) obvious = TRUE;
2855 if (r_ptr->flagsr & RFR_RES_ALL)
2858 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2860 note = " is immune.";
2863 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2866 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2870 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2872 note = " is immune!";
2876 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2877 (r_ptr->flags3 & RF3_ANIMAL) ||
2878 (r_ptr->level > randint1(3 * dam)))
2882 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2889 * Powerful demons & undead can turn a mindcrafter's
2890 * attacks back on them
2892 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2893 (r_ptr->level > p_ptr->lev / 2) &&
2898 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2900 msg_format("%^s%s corrupted mind backlashes your attack!",
2901 m_name, (seen ? "'s" : "s"));
2905 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2908 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2910 msg_print("You resist the effects!");
2916 /* Injure + mana drain */
2917 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2919 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
2921 msg_print("Your psychic energy is drained!");
2924 p_ptr->csp -= damroll(5, dam) / 2;
2925 if (p_ptr->csp < 0) p_ptr->csp = 0;
2926 p_ptr->redraw |= PR_MANA;
2927 p_ptr->window |= (PW_SPELL);
2928 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2935 int b = damroll(5, dam) / 4;
2937 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª", m_name);
2939 msg_format("You convert %s%s pain into psychic energy!",
2940 m_name, (seen ? "'s" : "s"));
2943 b = MIN(p_ptr->msp, p_ptr->csp + b);
2945 p_ptr->redraw |= PR_MANA;
2946 p_ptr->window |= (PW_SPELL);
2950 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2952 note_dies = " collapses, a mindless husk.";
2958 case GF_TELEKINESIS:
2960 if (seen) obvious = TRUE;
2962 if (r_ptr->flagsr & RFR_RES_ALL)
2965 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2967 note = " is immune.";
2970 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2975 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2980 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2982 /* Attempt a saving throw */
2983 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2984 (r_ptr->level > 5 + randint1(dam)))
2988 /* No obvious effect */
2994 /* Psycho-spear -- powerful magic missile */
2997 if (seen) obvious = TRUE;
2999 if (r_ptr->flagsr & RFR_RES_ALL)
3002 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3004 note = " is immune.";
3007 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3013 /* Meteor -- powerful magic missile */
3016 if (seen) obvious = TRUE;
3018 if (r_ptr->flagsr & RFR_RES_ALL)
3021 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3023 note = " is immune.";
3026 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3034 if (!is_hostile(m_ptr)) break;
3036 if (seen) obvious = TRUE;
3038 if (r_ptr->flagsr & RFR_RES_ALL)
3041 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3043 note = " is immune.";
3046 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3049 /* Attempt a saving throw */
3050 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
3051 (r_ptr->flags3 & RF3_NO_CONF) ||
3052 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3054 /* Memorize a flag */
3055 if (r_ptr->flags3 & RF3_NO_CONF)
3057 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3064 * Powerful demons & undead can turn a mindcrafter's
3065 * attacks back on them
3067 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
3068 (r_ptr->level > p_ptr->lev / 2) &&
3073 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
3075 msg_format("%^s%s corrupted mind backlashes your attack!",
3076 m_name, (seen ? "'s" : "s"));
3080 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3083 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3085 msg_print("You resist the effects!");
3091 /* Confuse, stun, terrify */
3092 switch (randint1(4))
3095 set_stun(p_ptr->stun + dam / 2);
3098 set_confused(p_ptr->confused + dam / 2);
3102 if (r_ptr->flags3 & RF3_NO_FEAR)
3104 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3106 note = " is unaffected.";
3110 set_afraid(p_ptr->afraid + dam);
3117 /* No obvious effect */
3119 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3121 note = " is unaffected!";
3129 if ((dam > 29) && (randint1(100) < dam))
3132 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3134 note = " is in your thrall!";
3141 switch (randint1(4))
3155 /* No "real" damage */
3162 /* Ice -- Cold + Cuts + Stun */
3165 if (seen) obvious = TRUE;
3167 if (r_ptr->flagsr & RFR_RES_ALL)
3170 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3172 note = " is immune.";
3175 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3178 do_stun = (randint1(15) + 1) / (r + 1);
3179 if (r_ptr->flagsr & RFR_IM_COLD)
3182 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3184 note = " resists a lot.";
3188 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
3190 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3193 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3195 note = " is hit hard.";
3199 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3208 if (seen) obvious = TRUE;
3210 if (r_ptr->flagsr & RFR_RES_ALL)
3213 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3215 note = " is immune.";
3218 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3221 if (!monster_living(r_ptr))
3223 if (is_original_ap_and_seen(m_ptr))
3225 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3226 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3227 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3231 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3233 note = " is unaffected!";
3239 else do_time = (dam+7)/8;
3247 if (seen) obvious = TRUE;
3249 if (r_ptr->flagsr & RFR_RES_ALL)
3252 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3254 note = " is immune.";
3257 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3260 if (!monster_living(r_ptr))
3262 if (is_original_ap_and_seen(m_ptr))
3264 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3265 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3266 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3270 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3272 note = " is immune.";
3278 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3279 (randint1(888) != 666)) ||
3280 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
3281 randint1(100) != 66))
3284 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3296 /* Polymorph monster (Use "dam" as "power") */
3299 if (seen) obvious = TRUE;
3301 if (r_ptr->flagsr & RFR_RES_ALL)
3304 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3306 note = " is immune.";
3309 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3312 /* Attempt to polymorph (see below) */
3315 /* Powerful monsters can resist */
3316 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3317 (r_ptr->flags1 & RF1_QUESTOR) ||
3318 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3321 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3323 note = " is unaffected!";
3330 /* No "real" damage */
3337 /* Clone monsters (Ignore "dam") */
3340 if (seen) obvious = TRUE;
3342 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
3345 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3347 note = " is unaffected!";
3353 m_ptr->hp = m_ptr->maxhp;
3355 /* Attempt to clone. */
3356 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3359 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3367 /* No "real" damage */
3374 /* Heal Monster (use "dam" as amount of healing) */
3377 if (seen) obvious = TRUE;
3382 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3384 if (m_ptr->maxhp < m_ptr->max_maxhp)
3387 if (seen_msg) msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3389 if (seen_msg) msg_format("%^s recovers %s vitality.", m_name, m_poss);
3391 m_ptr->maxhp = m_ptr->max_maxhp;
3396 /* Redraw (later) if needed */
3397 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3398 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3406 if (seen) obvious = TRUE;
3411 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3416 if (seen_msg) msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3418 if (seen_msg) msg_format("%^s is no longer stunned.", m_name);
3422 if (m_ptr->confused)
3425 if (seen_msg) msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3427 if (seen_msg) msg_format("%^s is no longer confused.", m_name);
3429 m_ptr->confused = 0;
3434 if (seen_msg) msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3436 if (seen_msg) msg_format("%^s recovers %s courage.", m_name, m_poss);
3442 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3445 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3449 chg_virtue(V_VITALITY, 1);
3451 if (r_ptr->flags1 & RF1_UNIQUE)
3452 chg_virtue(V_INDIVIDUALISM, 1);
3454 if (is_friendly(m_ptr))
3455 chg_virtue(V_HONOUR, 1);
3456 else if (!(r_ptr->flags3 & RF3_EVIL))
3458 if (r_ptr->flags3 & RF3_GOOD)
3459 chg_virtue(V_COMPASSION, 2);
3461 chg_virtue(V_COMPASSION, 1);
3464 if (r_ptr->flags3 & RF3_ANIMAL)
3465 chg_virtue(V_NATURE, 1);
3468 if (m_ptr->r_idx == MON_LEPER)
3471 if (!who) chg_virtue(V_COMPASSION, 5);
3474 /* Redraw (later) if needed */
3475 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3476 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3480 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3482 note = " looks healthier.";
3485 /* No "real" damage */
3491 /* Speed Monster (Ignore "dam") */
3494 if (seen) obvious = TRUE;
3500 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3502 note = " starts moving faster.";
3505 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3507 if (c_ptr->m_idx == p_ptr->riding)
3508 p_ptr->update |= (PU_BONUS);
3512 if (r_ptr->flags1 & RF1_UNIQUE)
3513 chg_virtue(V_INDIVIDUALISM, 1);
3514 if (is_friendly(m_ptr))
3515 chg_virtue(V_HONOUR, 1);
3518 /* No "real" damage */
3524 /* Slow Monster (Use "dam" as "power") */
3527 if (seen) obvious = TRUE;
3529 if (r_ptr->flagsr & RFR_RES_ALL)
3532 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3534 note = " is immune.";
3537 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3540 /* Powerful monsters can resist */
3541 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3542 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3545 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3547 note = " is unaffected!";
3553 /* Normal monsters slow down */
3559 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3561 note = " starts moving slower.";
3564 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3566 if (c_ptr->m_idx == p_ptr->riding)
3567 p_ptr->update |= (PU_BONUS);
3570 /* No "real" damage */
3576 /* Sleep (Use "dam" as "power") */
3579 if (seen) obvious = TRUE;
3581 if (r_ptr->flagsr & RFR_RES_ALL)
3584 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3586 note = " is immune.";
3589 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3592 /* Attempt a saving throw */
3593 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3594 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3595 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3597 /* Memorize a flag */
3598 if (r_ptr->flags3 & RF3_NO_SLEEP)
3600 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3603 /* No obvious effect */
3605 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3607 note = " is unaffected!";
3614 /* Go to sleep (much) later */
3616 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3618 note = " falls asleep!";
3624 /* No "real" damage */
3630 /* Sleep (Use "dam" as "power") */
3631 case GF_STASIS_EVIL:
3633 if (seen) obvious = TRUE;
3635 if (r_ptr->flagsr & RFR_RES_ALL)
3638 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3640 note = " is immune.";
3643 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3646 /* Attempt a saving throw */
3647 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3648 !(r_ptr->flags3 & RF3_EVIL) ||
3649 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3652 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3654 note = " is unaffected!";
3661 /* Go to sleep (much) later */
3663 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3665 note = " is suspended!";
3671 /* No "real" damage */
3676 /* Sleep (Use "dam" as "power") */
3679 if (seen) obvious = TRUE;
3681 if (r_ptr->flagsr & RFR_RES_ALL)
3684 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3686 note = " is immune.";
3689 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3692 /* Attempt a saving throw */
3693 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3694 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3697 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3699 note = " is unaffected!";
3706 /* Go to sleep (much) later */
3708 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3710 note = " is suspended!";
3716 /* No "real" damage */
3725 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3726 vir = virtue_number(V_HARMONY);
3729 dam += p_ptr->virtues[vir-1]/10;
3732 vir = virtue_number(V_INDIVIDUALISM);
3735 dam -= p_ptr->virtues[vir-1]/20;
3738 if (seen) obvious = TRUE;
3740 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3743 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3745 note = " is immune.";
3748 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3752 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3755 /* Attempt a saving throw */
3756 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3757 (r_ptr->flags3 & RF3_NO_CONF) ||
3758 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3759 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3761 /* Memorize a flag */
3762 if (r_ptr->flags3 & RF3_NO_CONF)
3764 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3768 /* No obvious effect */
3770 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3772 note = " is unaffected!";
3777 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3779 else if (p_ptr->cursed & TRC_AGGRAVATE)
3782 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3784 note = " hates you too much!";
3787 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3792 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3794 note = " suddenly seems friendly!";
3799 chg_virtue(V_INDIVIDUALISM, -1);
3800 if (r_ptr->flags3 & RF3_ANIMAL)
3801 chg_virtue(V_NATURE, 1);
3804 /* No "real" damage */
3809 /* Control undead */
3810 case GF_CONTROL_UNDEAD:
3813 if (seen) obvious = TRUE;
3815 vir = virtue_number(V_UNLIFE);
3818 dam += p_ptr->virtues[vir-1]/10;
3821 vir = virtue_number(V_INDIVIDUALISM);
3824 dam -= p_ptr->virtues[vir-1]/20;
3827 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3830 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3832 note = " is immune.";
3835 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3839 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3842 /* Attempt a saving throw */
3843 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3844 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3845 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3846 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3848 /* No obvious effect */
3850 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3852 note = " is unaffected!";
3856 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3858 else if (p_ptr->cursed & TRC_AGGRAVATE)
3861 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3863 note = " hates you too much!";
3866 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3871 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3873 note = " is in your thrall!";
3879 /* No "real" damage */
3885 case GF_CONTROL_DEMON:
3888 if (seen) obvious = TRUE;
3890 vir = virtue_number(V_UNLIFE);
3893 dam += p_ptr->virtues[vir-1]/10;
3896 vir = virtue_number(V_INDIVIDUALISM);
3899 dam -= p_ptr->virtues[vir-1]/20;
3902 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3905 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3907 note = " is immune.";
3910 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3914 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3917 /* Attempt a saving throw */
3918 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3919 (!(r_ptr->flags3 & RF3_DEMON)) ||
3920 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3921 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3923 /* No obvious effect */
3925 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3927 note = " is unaffected!";
3931 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3933 else if (p_ptr->cursed & TRC_AGGRAVATE)
3936 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3938 note = " hates you too much!";
3941 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3946 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3948 note = " is in your thrall!";
3954 /* No "real" damage */
3960 case GF_CONTROL_ANIMAL:
3964 if (seen) obvious = TRUE;
3966 vir = virtue_number(V_NATURE);
3969 dam += p_ptr->virtues[vir-1]/10;
3972 vir = virtue_number(V_INDIVIDUALISM);
3975 dam -= p_ptr->virtues[vir-1]/20;
3978 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3981 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3983 note = " is immune.";
3986 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3990 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3993 /* Attempt a saving throw */
3994 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3995 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
3996 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3997 (r_ptr->flags3 & (RF3_NO_CONF)) ||
3998 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4000 /* Memorize a flag */
4001 if (r_ptr->flags3 & (RF3_NO_CONF))
4003 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4007 /* No obvious effect */
4009 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4011 note = " is unaffected!";
4015 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4017 else if (p_ptr->cursed & TRC_AGGRAVATE)
4020 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4022 note = " hates you too much!";
4025 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4030 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4032 note = " is tamed!";
4037 if (r_ptr->flags3 & RF3_ANIMAL)
4038 chg_virtue(V_NATURE, 1);
4041 /* No "real" damage */
4047 case GF_CONTROL_LIVING:
4051 vir = virtue_number(V_UNLIFE);
4052 if (seen) obvious = TRUE;
4054 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4055 vir = virtue_number(V_UNLIFE);
4058 dam -= p_ptr->virtues[vir-1]/10;
4061 vir = virtue_number(V_INDIVIDUALISM);
4064 dam -= p_ptr->virtues[vir-1]/20;
4067 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4068 if (dam < 1) dam = 1;
4070 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4072 msg_format("You stare into %s.", m_name);
4074 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4077 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4079 note = " is immune.";
4082 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4086 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4089 /* Attempt a saving throw */
4090 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4091 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4092 !monster_living(r_ptr) ||
4093 ((r_ptr->level+10) > randint1(dam)))
4096 /* No obvious effect */
4098 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4100 note = " is unaffected!";
4104 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4106 else if (p_ptr->cursed & TRC_AGGRAVATE)
4109 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4111 note = " hates you too much!";
4114 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4119 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4121 note = " is tamed!";
4126 if (r_ptr->flags3 & RF3_ANIMAL)
4127 chg_virtue(V_NATURE, 1);
4130 /* No "real" damage */
4135 /* Confusion (Use "dam" as "power") */
4138 if (seen) obvious = TRUE;
4140 if (r_ptr->flagsr & RFR_RES_ALL)
4143 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4145 note = " is immune.";
4148 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4151 /* Get confused later */
4152 do_conf = damroll(3, (dam / 2)) + 1;
4154 /* Attempt a saving throw */
4155 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4156 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4157 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4159 /* Memorize a flag */
4160 if (r_ptr->flags3 & (RF3_NO_CONF))
4162 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4168 /* No obvious effect */
4170 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4172 note = " is unaffected!";
4178 /* No "real" damage */
4185 if (seen) obvious = TRUE;
4187 if (r_ptr->flagsr & RFR_RES_ALL)
4190 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4192 note = " is immune.";
4195 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4198 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
4200 /* Attempt a saving throw */
4201 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4202 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4207 /* No obvious effect */
4209 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4211 note = " is unaffected!";
4217 /* No "real" damage */
4225 /* Lite, but only hurts susceptible creatures */
4233 if (r_ptr->flagsr & RFR_RES_ALL)
4239 if (r_ptr->flags3 & (RF3_HURT_LITE))
4241 /* Obvious effect */
4242 if (seen) obvious = TRUE;
4244 /* Memorize the effects */
4245 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4247 /* Special effect */
4249 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4250 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4252 note = " cringes from the light!";
4253 note_dies = " shrivels away in the light!";
4258 /* Normally no damage */
4270 /* Lite -- opposite of Dark */
4273 if (seen) obvious = TRUE;
4275 if (r_ptr->flagsr & RFR_RES_ALL)
4278 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4280 note = " is immune.";
4283 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4286 if (r_ptr->flagsr & RFR_RES_LITE)
4289 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4294 dam *= 2; dam /= (randint1(6)+6);
4295 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4297 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4299 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4301 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4302 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4304 note = " cringes from the light!";
4305 note_dies = " shrivels away in the light!";
4314 /* Dark -- opposite of Lite */
4317 if (seen) obvious = TRUE;
4319 if (r_ptr->flagsr & RFR_RES_ALL)
4322 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4324 note = " is immune.";
4327 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4330 if (r_ptr->flagsr & RFR_RES_DARK)
4333 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4338 dam *= 2; dam /= (randint1(6)+6);
4339 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4348 if (r_ptr->flagsr & RFR_RES_ALL)
4353 /* Hurt by rock remover */
4354 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4357 if (seen) obvious = TRUE;
4359 /* Memorize the effects */
4360 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4362 /* Cute little message */
4364 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4365 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4367 note = " loses some skin!";
4368 note_dies = " dissolves!";
4373 /* Usually, ignore the effects */
4384 /* Teleport undead (Use "dam" as "power") */
4385 case GF_AWAY_UNDEAD:
4387 /* Only affect undead */
4388 if (r_ptr->flags3 & (RF3_UNDEAD))
4390 bool resists_tele = FALSE;
4392 if (r_ptr->flagsr & RFR_RES_TELE)
4394 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4396 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4398 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4400 note = " is unaffected!";
4403 resists_tele = TRUE;
4405 else if (r_ptr->level > randint1(100))
4407 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4409 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4414 resists_tele = TRUE;
4420 if (seen) obvious = TRUE;
4421 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4433 /* No "real" damage */
4439 /* Teleport evil (Use "dam" as "power") */
4442 /* Only affect evil */
4443 if (r_ptr->flags3 & (RF3_EVIL))
4445 bool resists_tele = FALSE;
4447 if (r_ptr->flagsr & RFR_RES_TELE)
4449 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4451 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4453 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4455 note = " is unaffected!";
4458 resists_tele = TRUE;
4460 else if (r_ptr->level > randint1(100))
4462 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4464 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4469 resists_tele = TRUE;
4475 if (seen) obvious = TRUE;
4476 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4488 /* No "real" damage */
4494 /* Teleport monster (Use "dam" as "power") */
4497 bool resists_tele = FALSE;
4498 if (r_ptr->flagsr & RFR_RES_TELE)
4500 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4502 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4504 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4506 note = " is unaffected!";
4509 resists_tele = TRUE;
4511 else if (r_ptr->level > randint1(100))
4513 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4515 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4520 resists_tele = TRUE;
4527 if (seen) obvious = TRUE;
4529 /* Prepare to teleport */
4533 /* No "real" damage */
4539 /* Turn undead (Use "dam" as "power") */
4540 case GF_TURN_UNDEAD:
4542 if (r_ptr->flagsr & RFR_RES_ALL)
4547 /* Only affect undead */
4548 if (r_ptr->flags3 & (RF3_UNDEAD))
4551 if (seen) obvious = TRUE;
4553 /* Learn about type */
4554 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4556 /* Apply some fear */
4557 do_fear = damroll(3, (dam / 2)) + 1;
4559 /* Attempt a saving throw */
4560 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4562 /* No obvious effect */
4564 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4566 note = " is unaffected!";
4581 /* No "real" damage */
4587 /* Turn evil (Use "dam" as "power") */
4590 if (r_ptr->flagsr & RFR_RES_ALL)
4595 /* Only affect evil */
4596 if (r_ptr->flags3 & (RF3_EVIL))
4599 if (seen) obvious = TRUE;
4601 /* Learn about type */
4602 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4604 /* Apply some fear */
4605 do_fear = damroll(3, (dam / 2)) + 1;
4607 /* Attempt a saving throw */
4608 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4610 /* No obvious effect */
4612 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4614 note = " is unaffected!";
4629 /* No "real" damage */
4635 /* Turn monster (Use "dam" as "power") */
4638 if (r_ptr->flagsr & RFR_RES_ALL)
4644 if (seen) obvious = TRUE;
4646 /* Apply some fear */
4647 do_fear = damroll(3, (dam / 2)) + 1;
4649 /* Attempt a saving throw */
4650 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4651 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4652 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4654 /* No obvious effect */
4656 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4658 note = " is unaffected!";
4665 /* No "real" damage */
4672 case GF_DISP_UNDEAD:
4674 if (r_ptr->flagsr & RFR_RES_ALL)
4680 /* Only affect undead */
4681 if (r_ptr->flags3 & (RF3_UNDEAD))
4684 if (seen) obvious = TRUE;
4686 /* Learn about type */
4687 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4691 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4692 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4694 note = " shudders.";
4695 note_dies = " dissolves!";
4716 if (r_ptr->flagsr & RFR_RES_ALL)
4722 /* Only affect evil */
4723 if (r_ptr->flags3 & (RF3_EVIL))
4726 if (seen) obvious = TRUE;
4728 /* Learn about type */
4729 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4733 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4734 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4736 note = " shudders.";
4737 note_dies = " dissolves!";
4757 if (r_ptr->flagsr & RFR_RES_ALL)
4763 /* Only affect good */
4764 if (r_ptr->flags3 & (RF3_GOOD))
4767 if (seen) obvious = TRUE;
4769 /* Learn about type */
4770 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4774 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4775 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4777 note = " shudders.";
4778 note_dies = " dissolves!";
4796 case GF_DISP_LIVING:
4798 if (r_ptr->flagsr & RFR_RES_ALL)
4804 /* Only affect non-undead */
4805 if (monster_living(r_ptr))
4808 if (seen) obvious = TRUE;
4812 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4813 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4815 note = " shudders.";
4816 note_dies = " dissolves!";
4837 if (r_ptr->flagsr & RFR_RES_ALL)
4843 /* Only affect demons */
4844 if (r_ptr->flags3 & (RF3_DEMON))
4847 if (seen) obvious = TRUE;
4849 /* Learn about type */
4850 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4854 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4855 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4857 note = " shudders.";
4858 note_dies = " dissolves!";
4875 /* Dispel monster */
4878 if (r_ptr->flagsr & RFR_RES_ALL)
4885 if (seen) obvious = TRUE;
4889 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4890 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4892 note = " shudders.";
4893 note_dies = " dissolves!";
4903 if (seen) obvious = TRUE;
4905 if (r_ptr->flagsr & RFR_RES_ALL)
4908 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4910 note = " is immune.";
4913 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4917 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4921 /* Heal the monster */
4922 if (caster_ptr->hp < caster_ptr->maxhp)
4925 caster_ptr->hp += 6 * dam;
4926 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
4928 /* Redraw (later) if needed */
4929 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4930 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4932 /* Special message */
4935 /* Get the monster name */
4936 monster_desc(killer, caster_ptr, 0);
4938 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", killer);
4940 msg_format("%^s appears healthier.", killer);
4949 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£", m_name);
4951 msg_format("You draw psychic energy from %s.", m_name);
4954 (void)hp_player(dam);
4960 if (see_s_msg) msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
4962 if (see_s_msg) msg_format("%s is unaffected.", m_name);
4972 if (seen) obvious = TRUE;
4975 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
4977 if (!who) msg_format("You gaze intently at %s.", m_name);
4980 if (r_ptr->flagsr & RFR_RES_ALL)
4983 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4985 note = " is immune.";
4988 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4992 /* Attempt a saving throw */
4993 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4994 (r_ptr->flags3 & RF3_NO_CONF) ||
4995 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
4997 /* Memorize a flag */
4998 if (r_ptr->flags3 & (RF3_NO_CONF))
5000 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5003 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5005 note = "is unaffected!";
5009 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5011 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5013 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5015 note = " is immune!";
5019 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5021 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5023 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5032 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5033 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5035 note = " is blasted by psionic energy.";
5036 note_dies = " collapses, a mindless husk.";
5039 if (who > 0) do_conf = randint0(4) + 4;
5040 else do_conf = randint0(8) + 8;
5046 case GF_BRAIN_SMASH:
5048 if (seen) obvious = TRUE;
5051 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5053 if (!who) msg_format("You gaze intently at %s.", m_name);
5056 if (r_ptr->flagsr & RFR_RES_ALL)
5059 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5061 note = " is immune.";
5064 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5068 /* Attempt a saving throw */
5069 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5070 (r_ptr->flags3 & RF3_NO_CONF) ||
5071 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5073 /* Memorize a flag */
5074 if (r_ptr->flags3 & (RF3_NO_CONF))
5076 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5079 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5081 note = "is unaffected!";
5085 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5087 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5089 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5091 note = " is immune!";
5095 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5097 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5099 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5108 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5109 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5111 note = " is blasted by psionic energy.";
5112 note_dies = " collapses, a mindless husk.";
5117 do_conf = randint0(4) + 4;
5118 do_stun = randint0(4) + 4;
5122 do_conf = randint0(8) + 8;
5123 do_stun = randint0(8) + 8;
5125 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5126 if (c_ptr->m_idx == p_ptr->riding)
5127 p_ptr->update |= (PU_BONUS);
5135 if (seen) obvious = TRUE;
5138 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5140 if (!who) msg_format("You point at %s and curses.", m_name);
5143 if (r_ptr->flagsr & RFR_RES_ALL)
5146 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5148 note = " is immune.";
5151 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5155 /* Attempt a saving throw */
5156 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5159 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5161 note = "is unaffected!";
5171 if (seen) obvious = TRUE;
5174 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5176 if (!who) msg_format("You point at %s and curses horribly.", m_name);
5179 if (r_ptr->flagsr & RFR_RES_ALL)
5182 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5184 note = " is immune.";
5187 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5191 /* Attempt a saving throw */
5192 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5195 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5197 note = "is unaffected!";
5207 if (seen) obvious = TRUE;
5210 if (!who) msg_format("%s¤ò»Øº¹¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
5212 if (!who) msg_format("You point at %s, incanting terribly!", m_name);
5215 if (r_ptr->flagsr & RFR_RES_ALL)
5218 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5220 note = " is immune.";
5223 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5227 /* Attempt a saving throw */
5228 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5231 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5233 note = "is unaffected!";
5243 if (seen) obvious = TRUE;
5246 if (!who) msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
5248 if (!who) msg_format("You point at %s, screaming the word, 'DIE!'.", m_name);
5251 if (r_ptr->flagsr & RFR_RES_ALL)
5254 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5256 note = " is immune.";
5259 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5263 /* Attempt a saving throw */
5264 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
5267 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5269 note = "is unaffected!";
5279 if (seen) obvious = TRUE;
5281 if (r_ptr->flagsr & RFR_RES_ALL)
5284 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5286 note = " is immune.";
5289 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5293 if (r_ptr->flags1 & RF1_UNIQUE)
5296 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5298 note = "is unaffected!";
5304 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
5305 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
5307 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5309 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5314 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5324 /* Capture monster */
5328 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5329 (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)
5332 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5334 msg_format("%^s is unaffected.", m_name);
5340 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5341 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5342 nokori_hp = m_ptr->maxhp * 3 / 10;
5344 nokori_hp = m_ptr->maxhp * 3 / 20;
5346 if (m_ptr->hp >= nokori_hp)
5349 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5351 msg_format("You need to weaken %s more.", m_name);
5355 else if (m_ptr->hp < randint0(nokori_hp))
5357 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5359 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5361 msg_format("You capture %^s!", m_name);
5363 cap_mon = m_list[c_ptr->m_idx].r_idx;
5364 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5365 cap_hp = m_list[c_ptr->m_idx].hp;
5366 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5367 if (m_list[c_ptr->m_idx].nickname)
5368 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5371 if (c_ptr->m_idx == p_ptr->riding)
5373 if (rakuba(-1, FALSE))
5376 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5378 msg_format("You have fallen from %s.", m_name);
5383 delete_monster_idx(c_ptr->m_idx);
5390 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5392 msg_format("You failed to capture %s.", m_name);
5399 /* Attack (Use "dam" as attack type) */
5402 /* Return this monster's death */
5403 return py_attack(y, x, dam);
5406 /* Sleep (Use "dam" as "power") */
5412 if (seen) obvious = TRUE;
5414 if (r_ptr->flagsr & RFR_RES_ALL)
5417 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5419 note = " is immune.";
5422 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5425 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5428 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5430 note = " is immune!";
5434 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5440 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5442 note = " is immune!";
5449 if (one_in_(5)) effect = 1;
5450 else if (one_in_(4)) effect = 2;
5451 else if (one_in_(3)) effect = 3;
5456 /* Powerful monsters can resist */
5457 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5458 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5461 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5463 note = " is unaffected!";
5469 /* Normal monsters slow down */
5475 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5477 note = " starts moving slower.";
5480 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5482 if (c_ptr->m_idx == p_ptr->riding)
5483 p_ptr->update |= (PU_BONUS);
5487 else if (effect == 2)
5489 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5491 /* Attempt a saving throw */
5492 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5493 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5498 /* No obvious effect */
5500 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5502 note = " is unaffected!";
5509 else if (effect == 3)
5511 /* Attempt a saving throw */
5512 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5513 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5514 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5516 /* Memorize a flag */
5517 if (r_ptr->flags3 & RF3_NO_SLEEP)
5519 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5522 /* No obvious effect */
5524 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5526 note = " is unaffected!";
5533 /* Go to sleep (much) later */
5535 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5537 note = " falls asleep!";
5547 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5549 note = " is immune!";
5553 /* No "real" damage */
5561 if (seen) obvious = TRUE;
5563 if (r_ptr->flagsr & RFR_RES_ALL)
5566 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5568 note = " is immune.";
5571 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5576 if (genocide_aux(c_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, "¥â¥ó¥¹¥¿¡¼¾ÃÌÇ"))
5578 if (genocide_aux(c_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, "Genocide One"))
5582 if (seen_msg) msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª", m_name);
5584 if (seen_msg) msg_format("%^s disappered!", m_name);
5586 chg_virtue(V_VITALITY, -1);
5597 if (!who) msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£", m_name);
5599 if (!who) msg_format("You take a photograph of %s.", m_name);
5602 if (r_ptr->flags3 & (RF3_HURT_LITE))
5604 /* Obvious effect */
5605 if (seen) obvious = TRUE;
5607 /* Memorize the effects */
5608 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5610 /* Special effect */
5612 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5613 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5615 note = " cringes from the light!";
5616 note_dies = " shrivels away in the light!";
5620 /* Normally no damage */
5627 photo = m_ptr->r_idx;
5634 case GF_BLOOD_CURSE:
5636 if (seen) obvious = TRUE;
5638 if (r_ptr->flagsr & RFR_RES_ALL)
5641 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5643 note = " is immune.";
5646 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5654 bool success = FALSE;
5655 if (seen) obvious = TRUE;
5657 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5659 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5660 if (dam < 1) dam = 1;
5662 /* No need to tame your pet */
5666 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5668 note = " starts moving faster.";
5671 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5675 /* Attempt a saving throw */
5676 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5677 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5678 (m_ptr->mflag2 & MFLAG2_NOPET) ||
5679 (p_ptr->cursed & TRC_AGGRAVATE) ||
5680 ((r_ptr->level+10) > randint1(dam)))
5683 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5688 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5690 note = " is tamed!";
5694 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5696 /* Learn about type */
5697 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5704 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5706 do_fear = randint1(90)+10;
5708 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5711 /* No "real" damage */
5718 if (seen) obvious = TRUE;
5720 if (r_ptr->flagsr & RFR_RES_ALL)
5723 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5725 note = " is immune.";
5728 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5732 /* Attempt a saving throw */
5733 if (randint0(100 + dam) < (r_ptr->level + 50))
5737 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5739 note = "is unaffected!";
5760 /* Absolutely no effect */
5761 if (skipped) return (FALSE);
5763 /* "Unique" monsters cannot be polymorphed */
5764 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5766 /* Quest monsters cannot be polymorphed */
5767 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5769 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5771 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5772 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
5774 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5779 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5780 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5783 /* Modify the damage */
5785 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5787 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤¡£";
5789 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5792 /* Check for death */
5793 if (dam > m_ptr->hp)
5795 /* Extract method of death */
5800 /* Sound and Impact resisters never stun */
5802 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5803 !(r_ptr->flags3 & RF3_NO_STUN))
5806 if (seen) obvious = TRUE;
5812 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5814 note = " is more dazed.";
5817 tmp = m_ptr->stunned + (do_stun / 2);
5822 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5824 note = " is dazed.";
5831 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5837 /* Confusion and Chaos resisters (and sleepers) never confuse */
5839 !(r_ptr->flags3 & RF3_NO_CONF) &&
5840 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
5843 if (seen) obvious = TRUE;
5845 /* Already partially confused */
5846 if (m_ptr->confused)
5849 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5851 note = " looks more confused.";
5854 tmp = m_ptr->confused + (do_conf / 2);
5857 /* Was not confused */
5861 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
5863 note = " looks confused.";
5869 /* Apply confusion */
5870 m_ptr->confused = (tmp < 200) ? tmp : 200;
5879 if (seen) obvious = TRUE;
5881 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
5886 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
5888 note = " seems weakened.";
5890 m_ptr->maxhp -= do_time;
5891 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
5896 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5897 if (do_poly && (randint1(90) > r_ptr->level))
5899 if (polymorph_monster(y, x))
5902 if (seen) obvious = TRUE;
5904 /* Monster polymorphs */
5906 note = "¤¬ÊѿȤ·¤¿¡ª";
5911 /* Turn off the damage */
5914 /* Hack -- Get new monster */
5915 m_ptr = &m_list[c_ptr->m_idx];
5917 /* Hack -- Get new race */
5918 r_ptr = &r_info[m_ptr->r_idx];
5924 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5926 note = " is unaffected!";
5931 /* Handle "teleport" */
5935 if (seen) obvious = TRUE;
5939 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5941 note = " disappears!";
5944 if (!who) chg_virtue(V_VALOUR, -1);
5947 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who), TRUE);
5949 /* Hack -- get new location */
5953 /* Hack -- get new grid */
5954 c_ptr = &cave[y][x];
5961 tmp = m_ptr->monfear + do_fear;
5964 m_ptr->monfear = (tmp < 200) ? tmp : 200;
5971 if (typ == GF_DRAIN_MANA)
5973 /* Drain mana does nothing */
5976 /* If another monster did the damage, hurt the monster by hand */
5979 /* Redraw (later) if needed */
5980 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
5981 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
5983 /* Wake the monster up */
5986 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
5988 /* Hurt the monster */
5996 if (is_pet(m_ptr) && !(m_ptr->ml))
5999 /* Give detailed messages if destroyed */
6002 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
6005 msg_format("%^s%s", m_name, note);
6013 monster_gain_exp(who, m_ptr->r_idx);
6015 /* Generate treasure, etc */
6016 monster_death(c_ptr->m_idx, FALSE);
6018 /* Delete the monster */
6019 delete_monster_idx(c_ptr->m_idx);
6024 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6026 msg_print("You feel sad for a moment.");
6032 /* Damaged monster */
6035 /* Give detailed messages if visible or destroyed */
6036 if (note && seen_msg) msg_format("%^s%s", m_name, note);
6038 /* Hack -- Pain message */
6041 message_pain(c_ptr->m_idx, dam);
6048 /* Hack -- handle sleep */
6049 if (do_sleep) m_ptr->csleep = do_sleep;
6053 else if (heal_leper)
6056 if (seen_msg) msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6058 if (seen_msg) msg_print("The Mangy looking leper is healed!");
6061 delete_monster_idx(c_ptr->m_idx);
6064 /* If the player did it, give him experience, check fear */
6069 /* Hurt the monster, check for fear and death */
6070 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6075 /* Damaged monster */
6078 /* HACK - anger the monster before showing the sleep message */
6079 if (do_sleep) anger_monster(m_ptr);
6081 /* Give detailed messages if visible or destroyed */
6082 if (note && seen_msg)
6084 msg_format("%s%s", m_name, note);
6086 msg_format("%^s%s", m_name, note);
6090 /* Hack -- Pain message */
6091 else if (known && (dam || !do_fear))
6093 message_pain(c_ptr->m_idx, dam);
6096 /* Anger monsters */
6097 if (((dam > 0) || get_angry) && !do_sleep)
6098 anger_monster(m_ptr);
6101 if ((fear || do_fear) && seen)
6108 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6110 msg_format("%^s flees in terror!", m_name);
6114 /* Hack -- handle sleep */
6115 if (do_sleep) m_ptr->csleep = do_sleep;
6119 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6121 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6125 switch (randint1(28))
6131 msg_print("ÃÏÌ̤¬Íɤ줿...");
6133 msg_print("The ground trembles...");
6136 earthquake(ty, tx, 4 + randint0(4));
6137 if (!one_in_(6)) break;
6139 case 3: case 4: case 5: case 6:
6142 int dam = damroll(10, 10);
6144 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6146 msg_print("A portal opens to a plane of raw mana!");
6149 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6150 if (!one_in_(6)) break;
6156 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6158 msg_print("Space warps about you!");
6161 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE, TRUE);
6162 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6163 if (!one_in_(6)) break;
6165 case 9: case 10: case 11:
6167 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6169 msg_print("You feel a surge of energy!");
6172 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6173 if (!one_in_(6)) break;
6174 case 12: case 13: case 14: case 15: case 16:
6175 aggravate_monsters(0);
6176 if (!one_in_(6)) break;
6178 count += activate_hi_summon(ty, tx, TRUE);
6179 if (!one_in_(6)) break;
6180 case 19: case 20: case 21: case 22:
6182 bool pet = !one_in_(3);
6183 u32b mode = PM_ALLOW_GROUP;
6185 if (pet) mode |= PM_FORCE_PET;
6186 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6188 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6189 if (!one_in_(6)) break;
6191 case 23: case 24: case 25:
6192 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6194 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6196 msg_print("You feel your life draining away...");
6199 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6200 else lose_exp(p_ptr->exp / 16);
6201 if (!one_in_(6)) break;
6202 case 26: case 27: case 28:
6211 (void)do_dec_stat(i);
6220 (void)do_dec_stat(randint0(6));
6229 if (p_ptr->inside_battle)
6231 p_ptr->health_who = c_ptr->m_idx;
6232 p_ptr->redraw |= (PR_HEALTH);
6236 /* XXX XXX XXX Verify this code */
6238 /* Update the monster */
6239 update_mon(c_ptr->m_idx, FALSE);
6241 /* Redraw the monster grid */
6245 /* Update monster recall window */
6246 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6249 p_ptr->window |= (PW_MONSTER);
6252 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6256 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6258 set_target(m_ptr, monster_target_y, monster_target_x);
6261 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6263 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
6267 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6269 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6270 rakubadam_m = (dam > 200) ? 200 : dam;
6279 /* Get local object */
6282 /* Prepare to make a Blade of Chaos */
6283 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6285 q_ptr->pval = photo;
6287 /* Mark the item as fully known */
6288 q_ptr->ident |= (IDENT_MENTAL);
6290 /* Drop it in the dungeon */
6291 (void)drop_near(q_ptr, -1, py, px);
6299 /* Return "Anything seen?" */
6305 * Helper function for "project()" below.
6307 * Handle a beam/bolt/ball causing damage to the player.
6309 * This routine takes a "source monster" (by index), a "distance", a default
6310 * "damage", and a "damage type". See "project_m()" above.
6312 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6313 * is reduced (see "project_m()" above). This can happen if a monster breathes
6314 * at the player and hits a wall instead.
6316 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6317 * to know if this is actually a ball or a bolt spell
6320 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6321 * we just assume that the effects were obvious, for historical reasons.
6323 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6328 /* Hack -- assume obvious */
6329 bool obvious = TRUE;
6331 /* Player blind-ness */
6332 bool blind = (p_ptr->blind ? TRUE : FALSE);
6334 /* Player needs a "description" (he is blind) */
6337 /* Source monster */
6338 monster_type *m_ptr = NULL;
6340 /* Monster name (for attacks) */
6343 /* Monster name (for damage) */
6346 /* Hack -- messages */
6352 /* Player is not here */
6353 if (!player_bold(y, x)) return (FALSE);
6355 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6361 /* Player cannot hurt himself */
6362 if (!who) return (FALSE);
6363 if (who == p_ptr->riding) return (FALSE);
6365 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6368 int max_attempts = 10;
6371 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6372 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6373 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6375 if (blind) msg_print("Something bounces!");
6376 else msg_print("The attack bounces!");
6380 /* Choose 'new' target */
6383 t_y = m_list[who].fy - 1 + randint1(3);
6384 t_x = m_list[who].fx - 1 + randint1(3);
6387 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
6389 if (max_attempts < 1)
6391 t_y = m_list[who].fy;
6392 t_x = m_list[who].fx;
6395 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6402 /* Limit maximum damage */
6403 if (dam > 1600) dam = 1600;
6405 /* Reduce damage by distance */
6406 dam = (dam + r) / (r + 1);
6409 /* If the player is blind, be more descriptive */
6410 if (blind) fuzzy = TRUE;
6415 /* Get the source monster */
6416 m_ptr = &m_list[who];
6417 /* Extract the monster level */
6418 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6420 /* Get the monster name */
6421 monster_desc(m_name, m_ptr, 0);
6423 /* Get the monster's real name (gotten before polymorph!) */
6424 strcpy(killer, who_name);
6429 strcpy(killer, "æ«");
6431 strcpy(killer, "a trap");
6435 /* Analyze the damage */
6438 /* Standard damage -- hurts inventory too */
6442 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6444 if (fuzzy) msg_print("You are hit by acid!");
6447 get_damage = acid_dam(dam, killer, monspell);
6451 /* Standard damage -- hurts inventory too */
6455 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6457 if (fuzzy) msg_print("You are hit by fire!");
6460 get_damage = fire_dam(dam, killer, monspell);
6464 /* Standard damage -- hurts inventory too */
6468 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6470 if (fuzzy) msg_print("You are hit by cold!");
6473 get_damage = cold_dam(dam, killer, monspell);
6477 /* Standard damage -- hurts inventory too */
6481 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6483 if (fuzzy) msg_print("You are hit by lightning!");
6486 get_damage = elec_dam(dam, killer, monspell);
6490 /* Standard damage -- also poisons player */
6493 bool double_resist = IS_OPPOSE_POIS();
6495 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6497 if (fuzzy) msg_print("You are hit by poison!");
6500 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6501 if (double_resist) dam = (dam + 2) / 3;
6503 if ((!(double_resist || p_ptr->resist_pois)) &&
6504 one_in_(HURT_CHANCE))
6509 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6511 if (!(double_resist || p_ptr->resist_pois))
6513 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6518 /* Standard damage -- also poisons / mutates player */
6521 bool double_resist = IS_OPPOSE_POIS();
6523 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6525 if (fuzzy) msg_print("You are hit by radiation!");
6528 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6529 if (double_resist) dam = (2 * dam + 2) / 5;
6530 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6531 if (!(double_resist || p_ptr->resist_pois))
6533 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6535 if (one_in_(5)) /* 6 */
6538 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6540 msg_print("You undergo a freakish metamorphosis!");
6543 if (one_in_(4)) /* 4 */
6551 inven_damage(set_acid_destroy, 2);
6557 /* Standard damage */
6561 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6563 if (fuzzy) msg_print("You are hit by something!");
6566 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6570 /* Holy Orb -- Player only takes partial damage */
6574 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6576 if (fuzzy) msg_print("You are hit by something!");
6579 if (p_ptr->align > 10)
6581 else if (p_ptr->align < -10)
6583 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6590 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6592 if (fuzzy) msg_print("You are hit by something!");
6595 if (p_ptr->align > 10)
6597 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6601 /* Arrow -- XXX no dodging */
6605 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6607 if (fuzzy) msg_print("You are hit by something sharp!");
6610 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6613 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6615 msg_print("You cut down the arrow!");
6619 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6623 /* Plasma -- XXX No resist */
6627 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6629 if (fuzzy) msg_print("You are hit by something *HOT*!");
6632 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6634 if (!p_ptr->resist_sound)
6636 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6637 (void)set_stun(p_ptr->stun + k);
6640 if (!(p_ptr->resist_fire ||
6642 p_ptr->immune_fire))
6644 inven_damage(set_acid_destroy, 3);
6650 /* Nether -- drain experience */
6654 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6656 if (fuzzy) msg_print("You are hit by nether forces!");
6660 if (p_ptr->resist_neth)
6662 if (!prace_is_(RACE_SPECTRE))
6663 dam *= 6; dam /= (randint1(4) + 7);
6665 else drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
6667 if (prace_is_(RACE_SPECTRE))
6670 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6672 msg_print("You feel invigorated!");
6676 learn_spell(monspell);
6680 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6686 /* Water -- stun/confuse */
6690 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6692 if (fuzzy) msg_print("You are hit by something wet!");
6695 if (!p_ptr->resist_sound)
6697 set_stun(p_ptr->stun + randint1(40));
6699 if (!p_ptr->resist_conf)
6701 set_confused(p_ptr->confused + randint1(5) + 5);
6706 inven_damage(set_cold_destroy, 3);
6709 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6713 /* Chaos -- many effects */
6717 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6719 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6722 if (p_ptr->resist_chaos)
6724 dam *= 6; dam /= (randint1(4) + 7);
6726 if (!p_ptr->resist_conf)
6728 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6730 if (!p_ptr->resist_chaos)
6732 (void)set_image(p_ptr->image + randint1(10));
6736 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6738 msg_print("Your body is twisted by chaos!");
6741 (void)gain_random_mutation(0);
6744 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6746 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
6748 if (!p_ptr->resist_chaos || one_in_(9))
6750 inven_damage(set_elec_destroy, 2);
6751 inven_damage(set_fire_destroy, 2);
6753 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6757 /* Shards -- mostly cutting */
6761 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6763 if (fuzzy) msg_print("You are hit by something sharp!");
6766 if (p_ptr->resist_shard)
6768 dam *= 6; dam /= (randint1(4) + 7);
6772 (void)set_cut(p_ptr->cut + dam);
6775 if (!p_ptr->resist_shard || one_in_(13))
6777 inven_damage(set_cold_destroy, 2);
6780 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6784 /* Sound -- mostly stunning */
6788 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6790 if (fuzzy) msg_print("You are hit by a loud noise!");
6793 if (p_ptr->resist_sound)
6795 dam *= 5; dam /= (randint1(4) + 7);
6799 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6800 (void)set_stun(p_ptr->stun + k);
6803 if (!p_ptr->resist_sound || one_in_(13))
6805 inven_damage(set_cold_destroy, 2);
6808 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6812 /* Pure confusion */
6816 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6818 if (fuzzy) msg_print("You are hit by something puzzling!");
6821 if (p_ptr->resist_conf)
6823 dam *= 5; dam /= (randint1(4) + 7);
6825 if (!p_ptr->resist_conf)
6827 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6829 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6833 /* Disenchantment -- see above */
6837 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6839 if (fuzzy) msg_print("You are hit by something static!");
6842 if (p_ptr->resist_disen)
6844 dam *= 6; dam /= (randint1(4) + 7);
6848 (void)apply_disenchant(0);
6850 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6854 /* Nexus -- see above */
6858 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6860 if (fuzzy) msg_print("You are hit by something strange!");
6863 if (p_ptr->resist_nexus)
6865 dam *= 6; dam /= (randint1(4) + 7);
6871 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6875 /* Force -- mostly stun */
6879 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6881 if (fuzzy) msg_print("You are hit by kinetic force!");
6884 if (!p_ptr->resist_sound)
6886 (void)set_stun(p_ptr->stun + randint1(20));
6888 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6893 /* Rocket -- stun, cut */
6897 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
6899 if (fuzzy) msg_print("There is an explosion!");
6902 if (!p_ptr->resist_sound)
6904 (void)set_stun(p_ptr->stun + randint1(20));
6906 if (p_ptr->resist_shard)
6912 (void)set_cut(p_ptr-> cut + ( dam / 2));
6915 if ((!p_ptr->resist_shard) || one_in_(12))
6917 inven_damage(set_cold_destroy, 3);
6920 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6924 /* Inertia -- slowness */
6928 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6930 if (fuzzy) msg_print("You are hit by something slow!");
6933 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
6934 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6938 /* Lite -- blinding */
6942 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6944 if (fuzzy) msg_print("You are hit by something!");
6947 if (p_ptr->resist_lite)
6949 dam *= 4; dam /= (randint1(4) + 7);
6951 else if (!blind && !p_ptr->resist_blind)
6953 (void)set_blind(p_ptr->blind + randint1(5) + 2);
6955 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
6958 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
6960 msg_print("The light scorches your flesh!");
6965 else if (prace_is_(RACE_S_FAIRY))
6969 if (p_ptr->wraith_form) dam *= 2;
6970 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6972 if (p_ptr->wraith_form)
6974 p_ptr->wraith_form = 0;
6976 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
6978 msg_print("The light forces you out of your incorporeal shadow form.");
6981 p_ptr->redraw |= PR_MAP;
6982 /* Update monsters */
6983 p_ptr->update |= (PU_MONSTERS);
6985 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
6987 /* Redraw status bar */
6988 p_ptr->redraw |= (PR_STATUS);
6995 /* Dark -- blinding */
6999 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7001 if (fuzzy) msg_print("You are hit by something!");
7004 if (p_ptr->resist_dark)
7006 dam *= 4; dam /= (randint1(4) + 7);
7008 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7010 else if (!blind && !p_ptr->resist_blind)
7012 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7014 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7018 /* Time -- bolt fewer effects XXX */
7022 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7024 if (fuzzy) msg_print("You are hit by a blast from the past!");
7027 if (p_ptr->resist_time)
7030 dam /= (randint1(4) + 7);
7032 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7034 msg_print("You feel as if time is passing you by.");
7040 switch (randint1(10))
7042 case 1: case 2: case 3: case 4: case 5:
7044 if (p_ptr->prace == RACE_ANDROID) break;
7046 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7048 msg_print("You feel life has clocked back.");
7051 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7055 case 6: case 7: case 8: case 9:
7057 switch (randint1(6))
7060 case 1: k = A_STR; act = "¶¯¤¯"; break;
7061 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7062 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7063 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7064 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7065 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7067 case 1: k = A_STR; act = "strong"; break;
7068 case 2: k = A_INT; act = "bright"; break;
7069 case 3: k = A_WIS; act = "wise"; break;
7070 case 4: k = A_DEX; act = "agile"; break;
7071 case 5: k = A_CON; act = "hale"; break;
7072 case 6: k = A_CHR; act = "beautiful"; break;
7078 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7080 msg_format("You're not as %s as you used to be...", act);
7084 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7085 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7086 p_ptr->update |= (PU_BONUS);
7093 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7095 msg_print("You're not as powerful as you used to be...");
7099 for (k = 0; k < 6; k++)
7101 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7102 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7104 p_ptr->update |= (PU_BONUS);
7110 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7114 /* Gravity -- stun plus slowness plus teleport */
7118 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7119 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7121 if (fuzzy) msg_print("You are hit by something heavy!");
7122 msg_print("Gravity warps around you.");
7125 teleport_player(5, TRUE);
7126 if (!p_ptr->levitation)
7127 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7128 if (!(p_ptr->resist_sound || p_ptr->levitation))
7130 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7131 (void)set_stun(p_ptr->stun + k);
7133 if (p_ptr->levitation)
7135 dam = (dam * 2) / 3;
7138 if (!p_ptr->levitation || one_in_(13))
7140 inven_damage(set_cold_destroy, 2);
7143 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7147 /* Standard damage */
7148 case GF_DISINTEGRATE:
7151 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7153 if (fuzzy) msg_print("You are hit by pure energy!");
7156 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7163 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7165 if (fuzzy) msg_print("You are hit by something invigorating!");
7168 (void)hp_player(dam);
7176 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7178 if (fuzzy) msg_print("You are hit by something!");
7181 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7189 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7191 if (fuzzy) msg_print("You are hit by something slow!");
7194 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7200 if (p_ptr->free_act) break;
7202 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7204 if (fuzzy) msg_print("You fall asleep!");
7208 if (ironman_nightmare)
7211 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7213 msg_print("A horrible vision enters your mind.");
7217 /* Pick a nightmare */
7218 get_mon_num_prep(get_nightmare, NULL);
7220 /* Have some nightmares */
7221 have_nightmare(get_mon_num(MAX_DEPTH));
7223 /* Remove the monster restriction */
7224 get_mon_num_prep(NULL, NULL);
7227 set_paralyzed(p_ptr->paralyzed + dam);
7238 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7240 if (fuzzy) msg_print("You are hit by an aura of magic!");
7243 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7251 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7253 if (fuzzy) msg_print("You are hit by an energy!");
7256 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7264 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7266 if (fuzzy) msg_print("Something falls from the sky on you!");
7269 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7270 if (!p_ptr->resist_shard || one_in_(13))
7272 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7273 inven_damage(set_cold_destroy, 2);
7279 /* Ice -- cold plus stun plus cuts */
7283 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7285 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7288 cold_dam(dam, killer, monspell);
7289 if (!p_ptr->resist_shard)
7291 (void)set_cut(p_ptr->cut + damroll(5, 8));
7293 if (!p_ptr->resist_sound)
7295 (void)set_stun(p_ptr->stun + randint1(15));
7298 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
7300 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7310 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7312 if (fuzzy) msg_print("You are hit by something extremely cold!");
7316 if (p_ptr->mimic_form)
7318 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7319 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7324 switch (p_ptr->prace)
7326 /* Some races are immune */
7340 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7356 if (who > 0) msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
7357 else msg_print("Àº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
7359 if (who > 0) msg_format("%^s draws psychic energy from you!", m_name);
7360 else msg_print("Your psychic energy is drawn!");
7364 if (dam >= p_ptr->csp)
7368 p_ptr->csp_frac = 0;
7377 learn_spell(monspell);
7380 p_ptr->redraw |= (PR_MANA);
7383 p_ptr->window |= (PW_PLAYER);
7384 p_ptr->window |= (PW_SPELL);
7388 /* Heal the monster */
7389 if (m_ptr->hp < m_ptr->maxhp)
7392 m_ptr->hp += (6 * dam);
7393 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
7395 /* Redraw (later) if needed */
7396 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
7397 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
7399 /* Special message */
7403 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
7405 msg_format("%^s appears healthier.", m_name);
7419 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7422 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7424 msg_print("You resist the effects!");
7426 learn_spell(monspell);
7431 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7433 msg_print("Your mind is blasted by psyonic energy.");
7436 if (!p_ptr->resist_conf)
7438 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7441 if (!p_ptr->resist_chaos && one_in_(3))
7443 (void)set_image(p_ptr->image + randint0(250) + 150);
7450 p_ptr->csp_frac = 0;
7452 p_ptr->redraw |= PR_MANA;
7454 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7460 case GF_BRAIN_SMASH:
7462 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7465 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7467 msg_print("You resist the effects!");
7469 learn_spell(monspell);
7474 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7476 msg_print("Your mind is blasted by psionic energy.");
7483 p_ptr->csp_frac = 0;
7485 p_ptr->redraw |= PR_MANA;
7487 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7488 if (!p_ptr->resist_blind)
7490 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7492 if (!p_ptr->resist_conf)
7494 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7496 if (!p_ptr->free_act)
7498 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7500 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7502 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7503 (void)do_dec_stat(A_INT);
7504 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7505 (void)do_dec_stat(A_WIS);
7507 if (!p_ptr->resist_chaos)
7509 (void)set_image(p_ptr->image + randint0(250) + 150);
7518 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7521 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7523 msg_print("You resist the effects!");
7525 learn_spell(monspell);
7529 curse_equipment(15, 0);
7530 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7538 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7541 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7543 msg_print("You resist the effects!");
7545 learn_spell(monspell);
7549 curse_equipment(25, MIN(rlev/2-15, 5));
7550 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7558 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7561 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7563 msg_print("You resist the effects!");
7565 learn_spell(monspell);
7569 curse_equipment(33, MIN(rlev/2-15, 15));
7570 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7578 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7581 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7583 msg_print("You resist the effects!");
7585 learn_spell(monspell);
7589 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7590 (void)set_cut(p_ptr->cut + damroll(10, 10));
7598 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7601 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7603 msg_format("You resist the effects!");
7605 learn_spell(monspell);
7610 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7612 msg_print("You feel your life fade away!");
7615 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
7616 curse_equipment(40, 20);
7618 if (p_ptr->chp < 1) p_ptr->chp = 1;
7633 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7636 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7638 char m_name_self[80];
7641 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
7643 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7645 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7646 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7649 if (p_ptr->riding && dam > 0)
7651 rakubadam_p = (dam > 200) ? 200 : dam;
7659 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7665 /* Return "Anything seen?" */
7671 * Find the distance from (x, y) to a line.
7673 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7675 /* Vector from (x, y) to (x1, y1) */
7684 int pd = distance(y1, x1, y, x);
7685 int nd = distance(y1, x1, y2, x2);
7687 if (pd > nd) return distance(y, x, y2, x2);
7689 /* Component of P on N */
7690 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7692 /* Absolute value */
7693 return((nd >= 0) ? nd : 0 - nd);
7700 * Modified version of los() for calculation of disintegration balls.
7701 * Disintegration effects are stopped by permanent walls.
7703 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7723 /* Slope, or 1/Slope, of LOS */
7727 /* Extract the offset */
7731 /* Extract the absolute offset */
7736 /* Handle adjacent (or identical) grids */
7737 if ((ax < 2) && (ay < 2)) return (TRUE);
7740 /* Paranoia -- require "safe" origin */
7741 /* if (!in_bounds(y1, x1)) return (FALSE); */
7744 /* Directly South/North */
7747 /* South -- check for walls */
7750 for (ty = y1 + 1; ty < y2; ty++)
7752 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7756 /* North -- check for walls */
7759 for (ty = y1 - 1; ty > y2; ty--)
7761 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7769 /* Directly East/West */
7772 /* East -- check for walls */
7775 for (tx = x1 + 1; tx < x2; tx++)
7777 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7781 /* West -- check for walls */
7784 for (tx = x1 - 1; tx > x2; tx--)
7786 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7795 /* Extract some signs */
7796 sx = (dx < 0) ? -1 : 1;
7797 sy = (dy < 0) ? -1 : 1;
7800 /* Vertical "knights" */
7805 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7809 /* Horizontal "knights" */
7814 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7819 /* Calculate scale factor div 2 */
7822 /* Calculate scale factor */
7826 /* Travel horizontally */
7829 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7835 /* Consider the special case where slope == 1. */
7846 /* Note (below) the case (qy == f2), where */
7847 /* the LOS exactly meets the corner of a tile. */
7850 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7861 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7874 /* Travel vertically */
7877 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7893 /* Note (below) the case (qx == f2), where */
7894 /* the LOS exactly meets the corner of a tile. */
7897 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7908 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7929 void breath_shape(u16b *path_g, int dist, int *pgrids, byte *gx, byte *gy, byte *gm, int *pgm_rad, int rad, int y1, int x1, int y2, int x2, int typ)
7934 int brev = rad * rad / dist;
7938 int mdis = distance(y1, x1, y2, x2) + rad;
7940 while (bdis <= mdis)
7944 if ((0 < dist) && (path_n < dist))
7946 int ny = GRID_Y(path_g[path_n]);
7947 int nx = GRID_X(path_g[path_n]);
7948 int nd = distance(ny, nx, y1, x1);
7950 /* Get next base point */
7959 /* Travel from center outward */
7960 for (cdis = 0; cdis <= brad; cdis++)
7962 /* Scan the maximal blast area of radius "cdis" */
7963 for (y = by - cdis; y <= by + cdis; y++)
7965 for (x = bx - cdis; x <= bx + cdis; x++)
7967 /* Ignore "illegal" locations */
7968 if (!in_bounds(y, x)) continue;
7970 /* Enforce a circular "ripple" */
7971 if (distance(y1, x1, y, x) != bdis) continue;
7973 /* Enforce an arc */
7974 if (distance(by, bx, y, x) != cdis) continue;
7980 /* Lights are stopped by opaque terrains */
7981 if (!los(by, bx, y, x)) continue;
7983 case GF_DISINTEGRATE:
7984 /* Disintegration are stopped only by perma-walls */
7985 if (!in_disintegration_range(by, bx, y, x)) continue;
7988 /* Ball explosions are stopped by walls */
7989 if (!projectable(by, bx, y, x)) continue;
7993 /* Save this grid */
8001 /* Encode some more "radius" info */
8002 gm[bdis + 1] = *pgrids;
8004 /* Increase the size */
8005 brad = rad * (path_n + brev) / (dist + brev);
8007 /* Find the next ripple */
8011 /* Store the effect size */
8017 * Generic "beam"/"bolt"/"ball" projection routine.
8020 * who: Index of "source" monster (zero for "player")
8021 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8022 * y,x: Target location (or location to travel "towards")
8023 * dam: Base damage roll to apply to affected monsters (or player)
8024 * typ: Type of damage to apply to monsters (and objects)
8025 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8028 * TRUE if any "effects" of the projection were observed, else FALSE
8030 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8031 * towards a given location (optionally passing over the heads of interposing
8032 * monsters), and have it do a given amount of damage to the monsters (and
8033 * optionally objects) within the given radius of the final location.
8035 * A "bolt" travels from source to target and affects only the target grid.
8036 * A "beam" travels from source to target, affecting all grids passed through.
8037 * A "ball" travels from source to the target, exploding at the target, and
8038 * affecting everything within the given radius of the target location.
8040 * Traditionally, a "bolt" does not affect anything on the ground, and does
8041 * not pass over the heads of interposing monsters, much like a traditional
8042 * missile, and will "stop" abruptly at the "target" even if no monster is
8043 * positioned there, while a "ball", on the other hand, passes over the heads
8044 * of monsters between the source and target, and affects everything except
8045 * the source monster which lies within the final radius, while a "beam"
8046 * affects every monster between the source and target, except for the casting
8047 * monster (or player), and rarely affects things on the ground.
8049 * Two special flags allow us to use this function in special ways, the
8050 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8051 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8052 * actually projecting from the source monster (or player).
8054 * The player will only get "experience" for monsters killed by himself
8055 * Unique monsters can only be destroyed by attacks from the player
8057 * Only 256 grids can be affected per projection, limiting the effective
8058 * "radius" of standard ball attacks to nine units (diameter nineteen).
8060 * One can project in a given "direction" by combining PROJECT_THRU with small
8061 * offsets to the initial location (see "line_spell()"), or by calculating
8062 * "virtual targets" far away from the player.
8064 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8065 * continuing until it actually hits somethings (useful for "stone to mud").
8067 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8069 * Balls must explode BEFORE hitting walls, or they would affect monsters
8070 * on both sides of a wall. Some bug reports indicate that this is still
8071 * happening in 2.7.8 for Windows, though it appears to be impossible.
8073 * We "pre-calculate" the blast area only in part for efficiency.
8074 * More importantly, this lets us do "explosions" from the "inside" out.
8075 * This results in a more logical distribution of "blast" treasure.
8076 * It also produces a better (in my opinion) animation of the explosion.
8077 * It could be (but is not) used to have the treasure dropped by monsters
8078 * in the middle of the explosion fall "outwards", and then be damaged by
8079 * the blast as it spreads outwards towards the treasure drop location.
8081 * Walls and doors are included in the blast area, so that they can be
8082 * "burned" or "melted" in later versions.
8084 * This algorithm is intended to maximize simplicity, not necessarily
8085 * efficiency, since this function is not a bottleneck in the code.
8087 * We apply the blast effect from ground zero outwards, in several passes,
8088 * first affecting features, then objects, then monsters, then the player.
8089 * This allows walls to be removed before checking the object or monster
8090 * in the wall, and protects objects which are dropped by monsters killed
8091 * in the blast, and allows the player to see all affects before he is
8092 * killed or teleported away. The semantics of this method are open to
8093 * various interpretations, but they seem to work well in practice.
8095 * We process the blast area from ground-zero outwards to allow for better
8096 * distribution of treasure dropped by monsters, and because it provides a
8097 * pleasing visual effect at low cost.
8099 * Note that the damage done by "ball" explosions decreases with distance.
8100 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8102 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8103 * the target, and then the damage "flows" along this beam of destruction.
8104 * The damage at every grid is the same as at the "center" of a "ball"
8105 * explosion, since the "beam" grids are treated as if they ARE at the
8106 * center of a "ball" explosion.
8108 * Currently, specifying "beam" plus "ball" means that locations which are
8109 * covered by the initial "beam", and also covered by the final "ball", except
8110 * for the final grid (the epicenter of the ball), will be "hit twice", once
8111 * by the initial beam, and once by the exploding ball. For the grid right
8112 * next to the epicenter, this results in 150% damage being done. The center
8113 * does not have this problem, for the same reason the final grid in a "beam"
8114 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8115 * grids which are covered by the "ball" will NOT work, as then they will
8116 * receive LESS damage than they should. Do not combine "beam" with "ball".
8118 * The array "gy[],gx[]" with current size "grids" is used to hold the
8119 * collected locations of all grids in the "blast area" plus "beam path".
8121 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8122 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8123 * first blast grid (see above) with radius "N" from the blast center. Note
8124 * that only the first gm[1] grids in the blast area thus take full damage.
8125 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8126 * number of blast grids.
8128 * Note that once the projection is complete, (y2,x2) holds the final location
8129 * of bolts/beams, and the "epicenter" of balls.
8131 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8132 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8133 * implementation of the "distance" function. Also, a bolt can be properly
8134 * viewed as a "ball" with a "rad" of "zero".
8136 * Note that if no "target" is reached before the beam/bolt/ball travels the
8137 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8138 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8140 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8141 * to move from point A to point B, even if the player cannot see part of the
8142 * projection path. Note that in general, the player will *always* see part
8143 * of the path, since it either starts at the player or ends on the player.
8145 * Hack -- we assume that every "projection" is "self-illuminating".
8147 * Hack -- when only a single monster is affected, we automatically track
8148 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8150 * Note that all projections now "explode" at their final destination, even
8151 * if they were being projected at a more distant destination. This means
8152 * that "ball" spells will *always* explode.
8154 * Note that we must call "handle_stuff()" after affecting terrain features
8155 * in the blast radius, in case the "illumination" of the grid was changed,
8156 * and "update_view()" and "update_monsters()" need to be called.
8158 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8168 int y_saver, x_saver; /* For reflecting monsters */
8170 int msec = delay_factor * delay_factor * delay_factor;
8172 /* Assume the player sees nothing */
8173 bool notice = FALSE;
8175 /* Assume the player has seen nothing */
8176 bool visual = FALSE;
8178 /* Assume the player has seen no blast grids */
8181 /* Assume to be a normal ball spell */
8182 bool breath = FALSE;
8184 /* Is the player blind? */
8185 bool blind = (p_ptr->blind ? TRUE : FALSE);
8187 bool old_hide = FALSE;
8189 /* Number of grids in the "path" */
8192 /* Actual grids in the "path" */
8195 /* Number of grids in the "blast area" (including the "beam" path) */
8198 /* Coordinates of the affected grids */
8199 byte gx[1024], gy[1024];
8201 /* Encoded "radius" info (see above) */
8204 /* Actual radius encoded in gm[] */
8209 /* Attacker's name (prepared before polymorph)*/
8212 /* Initialize by null string */
8218 /* Default target of monsterspell is player */
8219 monster_target_y=py;
8220 monster_target_x=px;
8222 /* Hack -- Jump to target */
8223 if (flg & (PROJECT_JUMP))
8228 /* Clear the flag */
8229 flg &= ~(PROJECT_JUMP);
8234 /* Start at player */
8241 /* Start at monster */
8244 x1 = m_list[who].fx;
8245 y1 = m_list[who].fy;
8246 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8259 /* Default "destination" */
8264 /* Hack -- verify stuff */
8265 if (flg & (PROJECT_THRU))
8267 if ((x1 == x2) && (y1 == y2))
8269 flg &= ~(PROJECT_THRU);
8273 /* Handle a breath attack */
8278 if (flg & PROJECT_HIDE) old_hide = TRUE;
8279 flg |= PROJECT_HIDE;
8283 /* Hack -- Assume there will be no blast (max radius 32) */
8284 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8292 /* Collect beam grids */
8293 if (flg & (PROJECT_BEAM))
8304 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
8306 case GF_DISINTEGRATE:
8307 flg |= (PROJECT_GRID);
8308 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
8312 /* Calculate the projection path */
8314 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8316 /* Hack -- Handle stuff */
8319 /* Giga-Hack SEEKER & SUPER_RAY */
8321 if( typ == GF_SEEKER )
8331 for (i = 0; i < path_n; ++i)
8336 int ny = GRID_Y(path_g[i]);
8337 int nx = GRID_X(path_g[i]);
8348 /* Only do visuals if requested */
8349 if (!blind && !(flg & (PROJECT_HIDE)))
8351 /* Only do visuals if the player can "see" the bolt */
8352 if (panel_contains(y, x) && player_has_los_bold(y, x))
8359 /* Obtain the bolt pict */
8360 p = bolt_pict(oy, ox, y, x, typ);
8362 /* Extract attr/char */
8366 /* Visual effects */
8367 print_rel(c, a, y, x);
8368 move_cursor_relative(y, x);
8369 /*if (fresh_before)*/ Term_fresh();
8370 Term_xtra(TERM_XTRA_DELAY, msec);
8372 /*if (fresh_before)*/ Term_fresh();
8374 /* Display "beam" grids */
8375 if (flg & (PROJECT_BEAM))
8377 /* Obtain the explosion pict */
8378 p = bolt_pict(y, x, y, x, typ);
8380 /* Extract attr/char */
8384 /* Visual effects */
8385 print_rel(c, a, y, x);
8388 /* Hack -- Activate delay */
8392 /* Hack -- delay anyway for consistency */
8395 /* Delay for consistency */
8396 Term_xtra(TERM_XTRA_DELAY, msec);
8399 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8400 if( is_mirror_grid(&cave[y][x]))
8402 /* The target of monsterspell becomes tha mirror(broken) */
8403 monster_target_y=(s16b)y;
8404 monster_target_x=(s16b)x;
8407 next_mirror( &oy,&ox,y,x );
8409 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8410 for( j = last_i; j <=i ; j++ )
8412 y = GRID_Y(path_g[j]);
8413 x = GRID_X(path_g[j]);
8414 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8415 if(!who && (project_m_n==1) && !jump ){
8416 if(cave[project_m_y][project_m_x].m_idx >0 ){
8417 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8419 /* Hack -- auto-recall */
8420 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8422 /* Hack - auto-track */
8423 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8426 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8431 for( i = last_i ; i < path_n ; i++ )
8434 y = GRID_Y(path_g[i]);
8435 x = GRID_X(path_g[i]);
8436 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8438 if(!who && (project_m_n==1) && !jump ){
8439 if(cave[project_m_y][project_m_x].m_idx >0 ){
8440 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8442 /* Hack -- auto-recall */
8443 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8445 /* Hack - auto-track */
8446 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8449 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8453 else if(typ == GF_SUPER_RAY){
8455 int second_step = 0;
8462 for (i = 0; i < path_n; ++i)
8467 int ny = GRID_Y(path_g[i]);
8468 int nx = GRID_X(path_g[i]);
8479 /* Only do visuals if requested */
8480 if (!blind && !(flg & (PROJECT_HIDE)))
8482 /* Only do visuals if the player can "see" the bolt */
8483 if (panel_contains(y, x) && player_has_los_bold(y, x))
8490 /* Obtain the bolt pict */
8491 p = bolt_pict(oy, ox, y, x, typ);
8493 /* Extract attr/char */
8497 /* Visual effects */
8498 print_rel(c, a, y, x);
8499 move_cursor_relative(y, x);
8500 /*if (fresh_before)*/ Term_fresh();
8501 Term_xtra(TERM_XTRA_DELAY, msec);
8503 /*if (fresh_before)*/ Term_fresh();
8505 /* Display "beam" grids */
8506 if (flg & (PROJECT_BEAM))
8508 /* Obtain the explosion pict */
8509 p = bolt_pict(y, x, y, x, typ);
8511 /* Extract attr/char */
8515 /* Visual effects */
8516 print_rel(c, a, y, x);
8519 /* Hack -- Activate delay */
8523 /* Hack -- delay anyway for consistency */
8526 /* Delay for consistency */
8527 Term_xtra(TERM_XTRA_DELAY, msec);
8530 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8531 if (!cave_have_flag_bold(y, x, FF_PROJECT))
8533 if( second_step )continue;
8536 if( is_mirror_grid(&cave[y][x]) && !second_step )
8538 /* The target of monsterspell becomes tha mirror(broken) */
8539 monster_target_y=(s16b)y;
8540 monster_target_x=(s16b)x;
8543 for( j = 0; j <=i ; j++ )
8545 y = GRID_Y(path_g[j]);
8546 x = GRID_X(path_g[j]);
8547 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8551 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8552 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8553 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8554 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8555 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8556 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8557 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8558 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8561 for( i = 0; i < path_n ; i++ )
8564 y = GRID_Y(path_g[i]);
8565 x = GRID_X(path_g[i]);
8566 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8567 if(!who && (project_m_n==1) && !jump ){
8568 if(cave[project_m_y][project_m_x].m_idx >0 ){
8569 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8571 /* Hack -- auto-recall */
8572 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8574 /* Hack - auto-track */
8575 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8578 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8583 /* Project along the path */
8584 for (i = 0; i < path_n; ++i)
8589 int ny = GRID_Y(path_g[i]);
8590 int nx = GRID_X(path_g[i]);
8592 if (flg & PROJECT_DISI)
8594 /* Hack -- Balls explode before reaching walls */
8595 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8597 else if (flg & PROJECT_LOS)
8599 /* Hack -- Balls explode before reaching walls */
8600 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
8604 /* Hack -- Balls explode before reaching walls */
8605 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
8612 /* Collect beam grids */
8613 if (flg & (PROJECT_BEAM))
8620 /* Only do visuals if requested */
8621 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
8623 /* Only do visuals if the player can "see" the bolt */
8624 if (panel_contains(y, x) && player_has_los_bold(y, x))
8631 /* Obtain the bolt pict */
8632 p = bolt_pict(oy, ox, y, x, typ);
8634 /* Extract attr/char */
8638 /* Visual effects */
8639 print_rel(c, a, y, x);
8640 move_cursor_relative(y, x);
8641 /*if (fresh_before)*/ Term_fresh();
8642 Term_xtra(TERM_XTRA_DELAY, msec);
8644 /*if (fresh_before)*/ Term_fresh();
8646 /* Display "beam" grids */
8647 if (flg & (PROJECT_BEAM))
8649 /* Obtain the explosion pict */
8650 p = bolt_pict(y, x, y, x, typ);
8652 /* Extract attr/char */
8656 /* Visual effects */
8657 print_rel(c, a, y, x);
8660 /* Hack -- Activate delay */
8664 /* Hack -- delay anyway for consistency */
8667 /* Delay for consistency */
8668 Term_xtra(TERM_XTRA_DELAY, msec);
8675 /* Save the "blast epicenter" */
8679 if (breath && !path_n)
8685 flg &= ~(PROJECT_HIDE);
8689 /* Start the "explosion" */
8692 /* Hack -- make sure beams get to "explode" */
8700 /* If we found a "target", explode there */
8701 if (dist <= MAX_RANGE)
8703 /* Mega-Hack -- remove the final "beam" grid */
8704 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8707 * Create a conical breath attack
8718 flg &= ~(PROJECT_HIDE);
8720 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
8724 /* Determine the blast area, work from the inside out */
8725 for (dist = 0; dist <= rad; dist++)
8727 /* Scan the maximal blast area of radius "dist" */
8728 for (y = by - dist; y <= by + dist; y++)
8730 for (x = bx - dist; x <= bx + dist; x++)
8732 /* Ignore "illegal" locations */
8733 if (!in_bounds2(y, x)) continue;
8735 /* Enforce a "circular" explosion */
8736 if (distance(by, bx, y, x) != dist) continue;
8742 /* Lights are stopped by opaque terrains */
8743 if (!los(by, bx, y, x)) continue;
8745 case GF_DISINTEGRATE:
8746 /* Disintegration are stopped only by perma-walls */
8747 if (!in_disintegration_range(by, bx, y, x)) continue;
8750 /* Ball explosions are stopped by walls */
8751 if (!projectable(by, bx, y, x)) continue;
8755 /* Save this grid */
8762 /* Encode some more "radius" info */
8768 /* Speed -- ignore "non-explosions" */
8769 if (!grids) return (FALSE);
8772 /* Display the "blast area" if requested */
8773 if (!blind && !(flg & (PROJECT_HIDE)))
8775 /* Then do the "blast", from inside out */
8776 for (t = 0; t <= gm_rad; t++)
8778 /* Dump everything with this radius */
8779 for (i = gm[t]; i < gm[t+1]; i++)
8781 /* Extract the location */
8785 /* Only do visuals if the player can "see" the blast */
8786 if (panel_contains(y, x) && player_has_los_bold(y, x))
8795 /* Obtain the explosion pict */
8796 p = bolt_pict(y, x, y, x, typ);
8798 /* Extract attr/char */
8802 /* Visual effects -- Display */
8803 print_rel(c, a, y, x);
8807 /* Hack -- center the cursor */
8808 move_cursor_relative(by, bx);
8810 /* Flush each "radius" seperately */
8811 /*if (fresh_before)*/ Term_fresh();
8813 /* Delay (efficiently) */
8814 if (visual || drawn)
8816 Term_xtra(TERM_XTRA_DELAY, msec);
8820 /* Flush the erasing */
8823 /* Erase the explosion drawn above */
8824 for (i = 0; i < grids; i++)
8826 /* Extract the location */
8830 /* Hack -- Erase if needed */
8831 if (panel_contains(y, x) && player_has_los_bold(y, x))
8837 /* Hack -- center the cursor */
8838 move_cursor_relative(by, bx);
8840 /* Flush the explosion */
8841 /*if (fresh_before)*/ Term_fresh();
8846 /* Update stuff if needed */
8847 if (p_ptr->update) update_stuff();
8850 /* Check features */
8851 if (flg & (PROJECT_GRID))
8853 /* Start with "dist" of zero */
8856 /* Scan for features */
8857 for (i = 0; i < grids; i++)
8859 /* Hack -- Notice new "dist" values */
8860 if (gm[dist+1] == i) dist++;
8862 /* Get the grid location */
8866 /* Find the closest point in the blast */
8869 int d = dist_to_line(y, x, y1, x1, by, bx);
8871 /* Affect the grid */
8872 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8876 /* Affect the grid */
8877 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8882 /* Update stuff if needed */
8883 if (p_ptr->update) update_stuff();
8886 if (flg & (PROJECT_ITEM))
8888 /* Start with "dist" of zero */
8891 /* Scan for objects */
8892 for (i = 0; i < grids; i++)
8894 /* Hack -- Notice new "dist" values */
8895 if (gm[dist+1] == i) dist++;
8897 /* Get the grid location */
8901 /* Find the closest point in the blast */
8904 int d = dist_to_line(y, x, y1, x1, by, bx);
8906 /* Affect the object in the grid */
8907 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8911 /* Affect the object in the grid */
8912 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8918 /* Check monsters */
8919 if (flg & (PROJECT_KILL))
8926 /* Start with "dist" of zero */
8929 /* Scan for monsters */
8930 for (i = 0; i < grids; i++)
8934 /* Hack -- Notice new "dist" values */
8935 if (gm[dist + 1] == i) dist++;
8937 /* Get the grid location */
8941 /* A single bolt may be reflected */
8944 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
8945 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
8947 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
8950 int max_attempts = 10;
8952 /* Choose 'new' target */
8955 t_y = y_saver - 1 + randint1(3);
8956 t_x = x_saver - 1 + randint1(3);
8959 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
8961 if (max_attempts < 1)
8970 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
8971 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
8972 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
8973 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
8975 msg_print("The attack bounces!");
8978 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
8980 /* Reflected bolts randomly target either one */
8981 if (one_in_(2)) flg |= PROJECT_PLAYER;
8982 else flg &= ~(PROJECT_PLAYER);
8984 /* The bolt is reflected */
8985 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
8987 /* Don't affect the monster any longer */
8993 /* Find the closest point in the blast */
8996 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9000 effective_dist = dist;
9004 /* There is the riding player on this monster */
9005 if (p_ptr->riding && player_bold(y, x))
9007 /* Aimed on the player */
9008 if (flg & PROJECT_PLAYER)
9010 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9013 * A beam or bolt is well aimed
9015 * So don't affects the mount.
9022 * The spell is not well aimed,
9023 * So partly affect the mount too.
9030 * This grid is the original target.
9031 * Or aimed on your horse.
9033 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
9035 /* Hit the mount with full damage */
9039 * Otherwise this grid is not the
9040 * original target, it means that line
9041 * of fire is obstructed by this
9045 * A beam or bolt will hit either
9046 * player or mount. Choose randomly.
9048 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9052 /* Hit the mount with full damage */
9056 /* Hit the player later */
9057 flg |= PROJECT_PLAYER;
9059 /* Don't affect the mount */
9065 * The spell is not well aimed, so
9066 * partly affect both player and
9075 /* Affect the monster in the grid */
9076 if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
9080 /* Player affected one monster (without "jumping") */
9081 if (!who && (project_m_n == 1) && !jump)
9087 /* Track if possible */
9088 if (cave[y][x].m_idx > 0)
9090 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9092 /* Hack -- auto-recall */
9093 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9095 /* Hack - auto-track */
9096 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9103 if (flg & (PROJECT_KILL))
9105 /* Start with "dist" of zero */
9108 /* Scan for player */
9109 for (i = 0; i < grids; i++)
9113 /* Hack -- Notice new "dist" values */
9114 if (gm[dist+1] == i) dist++;
9116 /* Get the grid location */
9120 /* Affect the player? */
9121 if (!player_bold(y, x)) continue;
9123 /* Find the closest point in the blast */
9126 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9130 effective_dist = dist;
9133 /* Target may be your horse */
9136 /* Aimed on the player */
9137 if (flg & PROJECT_PLAYER)
9139 /* Hit the player with full damage */
9143 * Hack -- When this grid was not the
9144 * original target, a beam or bolt
9145 * would hit either player or mount,
9146 * and should be choosen randomly.
9148 * But already choosen to hit the
9149 * mount at this point.
9151 * Or aimed on your horse.
9153 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9156 * A beam or bolt is well aimed
9158 * So don't affects the player.
9165 * The spell is not well aimed,
9166 * So partly affect the player too.
9172 /* Affect the player */
9173 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9181 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9183 if (rakubadam_m > 0)
9185 if (rakuba(rakubadam_m, FALSE))
9188 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9190 msg_format("%^s has thrown you off!", m_name);
9194 if (p_ptr->riding && rakubadam_p > 0)
9196 if(rakuba(rakubadam_p, FALSE))
9199 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9201 msg_format("You have fallen from %s.", m_name);
9207 /* Return "something was noticed" */
9211 bool binding_field( int dam )
9213 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9214 int mirror_num=0; /* ¶À¤Î¿ô */
9219 int msec= delay_factor*delay_factor*delay_factor;
9225 /* Default target of monsterspell is player */
9226 monster_target_y=py;
9227 monster_target_x=px;
9229 for( x=0 ; x < cur_wid ; x++ )
9231 for( y=0 ; y < cur_hgt ; y++ )
9233 if( is_mirror_grid(&cave[y][x]) &&
9234 distance(py,px,y,x) <= MAX_RANGE &&
9235 distance(py,px,y,x) != 0 &&
9236 player_has_los_bold(y,x) &&
9237 projectable(py, px, y, x)
9239 mirror_y[mirror_num]=y;
9240 mirror_x[mirror_num]=x;
9246 if( mirror_num < 2 )return FALSE;
9248 point_x[0] = randint0( mirror_num );
9250 point_x[1] = randint0( mirror_num );
9252 while( point_x[0] == point_x[1] );
9254 point_y[0]=mirror_y[point_x[0]];
9255 point_x[0]=mirror_x[point_x[0]];
9256 point_y[1]=mirror_y[point_x[1]];
9257 point_x[1]=mirror_x[point_x[1]];
9261 x=point_x[0]+point_x[1]+point_x[2];
9262 y=point_y[0]+point_y[1]+point_y[2];
9264 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9265 - (point_y[0]*3-y)*(point_x[1]*3-x);
9266 if( centersign == 0 )return FALSE;
9268 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9269 x1 = x1 < point_x[2] ? x1 : point_x[2];
9270 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9271 y1 = y1 < point_y[2] ? y1 : point_y[2];
9273 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9274 x2 = x2 > point_x[2] ? x2 : point_x[2];
9275 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9276 y2 = y2 > point_y[2] ? y2 : point_y[2];
9278 for( y=y1 ; y <=y2 ; y++ ){
9279 for( x=x1 ; x <=x2 ; x++ ){
9280 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9281 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9282 centersign*( (point_x[1]-x)*(point_y[2]-y)
9283 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9284 centersign*( (point_x[2]-x)*(point_y[0]-y)
9285 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9287 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9288 /* Visual effects */
9290 && panel_contains(y,x)){
9291 p = bolt_pict(y,x,y,x, GF_MANA );
9292 print_rel(PICT_C(p), PICT_A(p),y,x);
9293 move_cursor_relative(y, x);
9294 /*if (fresh_before)*/ Term_fresh();
9295 Term_xtra(TERM_XTRA_DELAY, msec);
9301 for( y=y1 ; y <=y2 ; y++ ){
9302 for( x=x1 ; x <=x2 ; x++ ){
9303 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9304 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9305 centersign*( (point_x[1]-x)*(point_y[2]-y)
9306 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9307 centersign*( (point_x[2]-x)*(point_y[0]-y)
9308 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9310 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9311 (void)project_f(0,0,y,x,dam,GF_MANA);
9316 for( y=y1 ; y <=y2 ; y++ ){
9317 for( x=x1 ; x <=x2 ; x++ ){
9318 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9319 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9320 centersign*( (point_x[1]-x)*(point_y[2]-y)
9321 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9322 centersign*( (point_x[2]-x)*(point_y[0]-y)
9323 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9325 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9326 (void)project_o(0,0,y,x,dam,GF_MANA);
9331 for( y=y1 ; y <=y2 ; y++ ){
9332 for( x=x1 ; x <=x2 ; x++ ){
9333 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9334 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9335 centersign*( (point_x[1]-x)*(point_y[2]-y)
9336 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9337 centersign*( (point_x[2]-x)*(point_y[0]-y)
9338 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9340 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9341 (void)project_m(0,0,y,x,dam,GF_MANA,
9342 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9349 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9351 msg_print("The field broke a mirror");
9353 remove_mirror(point_y[0],point_x[0]);
9359 void seal_of_mirror( int dam )
9363 for( x = 0 ; x < cur_wid ; x++ )
9365 for( y = 0 ; y < cur_hgt ; y++ )
9367 if( is_mirror_grid(&cave[y][x]))
9369 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9370 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9372 if( !cave[y][x].m_idx )