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
21 * Does the grid stop disintegration?
23 #define cave_stop_disintegration(Y,X) \
24 (((cave[Y][X].feat >= FEAT_PERM_EXTRA) && \
25 (cave[Y][X].feat <= FEAT_PERM_SOLID)) || \
26 (cave[Y][X].feat == FEAT_MOUNTAIN) || \
27 ((cave[Y][X].feat >= FEAT_SHOP_HEAD) && \
28 (cave[Y][X].feat <= FEAT_SHOP_TAIL)) || \
29 ((cave[Y][X].feat >= FEAT_BLDG_HEAD) && \
30 (cave[Y][X].feat <= FEAT_BLDG_TAIL)) || \
31 (cave[Y][X].feat == FEAT_MUSEUM))
33 static int rakubadam_m;
34 static int rakubadam_p;
36 int project_length = 0;
39 * Get another mirror. for SEEKER
41 static void next_mirror( int* next_y , int* next_x , int cury, int curx)
43 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
44 int mirror_num=0; /* ¶À¤Î¿ô */
48 for( x=0 ; x < cur_wid ; x++ )
50 for( y=0 ; y < cur_hgt ; y++ )
52 if( is_mirror_grid(&cave[y][x])){
53 mirror_y[mirror_num]=y;
54 mirror_x[mirror_num]=x;
61 num=randint0(mirror_num);
62 *next_y=mirror_y[num];
63 *next_x=mirror_x[num];
66 *next_y=cury+randint0(5)-2;
67 *next_x=curx+randint0(5)-2;
72 * Get a legal "multi-hued" color for drawing "spells"
74 static byte mh_attr(int max)
76 switch (randint1(max))
78 case 1: return (TERM_RED);
79 case 2: return (TERM_GREEN);
80 case 3: return (TERM_BLUE);
81 case 4: return (TERM_YELLOW);
82 case 5: return (TERM_ORANGE);
83 case 6: return (TERM_VIOLET);
84 case 7: return (TERM_L_RED);
85 case 8: return (TERM_L_GREEN);
86 case 9: return (TERM_L_BLUE);
87 case 10: return (TERM_UMBER);
88 case 11: return (TERM_L_UMBER);
89 case 12: return (TERM_SLATE);
90 case 13: return (TERM_WHITE);
91 case 14: return (TERM_L_WHITE);
92 case 15: return (TERM_L_DARK);
100 * Return a color to use for the bolt/ball spells
102 static byte spell_color(int type)
104 /* Check if A.B.'s new graphics should be used (rr9) */
105 if (streq(ANGBAND_GRAF, "new"))
110 case GF_PSY_SPEAR: return (0x06);
111 case GF_MISSILE: return (0x0F);
112 case GF_ACID: return (0x04);
113 case GF_ELEC: return (0x02);
114 case GF_FIRE: return (0x00);
115 case GF_COLD: return (0x01);
116 case GF_POIS: return (0x03);
117 case GF_HOLY_FIRE: return (0x00);
118 case GF_HELL_FIRE: return (0x00);
119 case GF_MANA: return (0x0E);
121 case GF_SEEKER: return (0x0E);
122 case GF_SUPER_RAY: return (0x0E);
124 case GF_ARROW: return (0x0F);
125 case GF_WATER: return (0x04);
126 case GF_NETHER: return (0x07);
127 case GF_CHAOS: return (mh_attr(15));
128 case GF_DISENCHANT: return (0x05);
129 case GF_NEXUS: return (0x0C);
130 case GF_CONFUSION: return (mh_attr(4));
131 case GF_SOUND: return (0x09);
132 case GF_SHARDS: return (0x08);
133 case GF_FORCE: return (0x09);
134 case GF_INERTIA: return (0x09);
135 case GF_GRAVITY: return (0x09);
136 case GF_TIME: return (0x09);
137 case GF_LITE_WEAK: return (0x06);
138 case GF_LITE: return (0x06);
139 case GF_DARK_WEAK: return (0x07);
140 case GF_DARK: return (0x07);
141 case GF_PLASMA: return (0x0B);
142 case GF_METEOR: return (0x00);
143 case GF_ICE: return (0x01);
144 case GF_ROCKET: return (0x0F);
145 case GF_DEATH_RAY: return (0x07);
146 case GF_NUKE: return (mh_attr(2));
147 case GF_DISINTEGRATE: return (0x05);
159 case GF_CAUSE_4: return (0x0E);
160 case GF_HAND_DOOM: return (0x07);
161 case GF_CAPTURE : return (0x0E);
162 case GF_IDENTIFY: return (0x01);
163 case GF_ATTACK: return (0x0F);
164 case GF_PHOTO : return (0x06);
167 /* Normal tiles or ASCII */
173 /* Lookup the default colors for this type */
174 cptr s = quark_str(gf_color[type]);
177 if (!s) return (TERM_WHITE);
179 /* Pick a random color */
180 c = s[randint0(strlen(s))];
182 /* Lookup this color */
183 a = strchr(color_char, c) - color_char;
185 /* Invalid color (note check for < 0 removed, gave a silly
186 * warning because bytes are always >= 0 -- RG) */
187 if (a > 15) return (TERM_WHITE);
193 /* Standard "color" */
199 * Find the attr/char pair to use for a spell effect
201 * It is moving (or has moved) from (x,y) to (nx,ny).
203 * If the distance is not "one", we (may) return "*".
205 u16b bolt_pict(int y, int x, int ny, int nx, int typ)
215 if ((ny == y) && (nx == x)) base = 0x30;
218 else if (nx == x) base = 0x40;
221 else if (ny == y) base = 0x50;
224 else if ((ny - y) == (x - nx)) base = 0x60;
227 else if ((ny - y) == (nx - x)) base = 0x70;
232 /* Basic spell color */
233 k = spell_color(typ);
235 /* Obtain attr/char */
236 a = misc_to_attr[base + k];
237 c = misc_to_char[base + k];
245 * Determine the path taken by a projection.
247 * The projection will always start from the grid (y1,x1), and will travel
248 * towards the grid (y2,x2), touching one grid per unit of distance along
249 * the major axis, and stopping when it enters the destination grid or a
250 * wall grid, or has travelled the maximum legal distance of "range".
252 * Note that "distance" in this function (as in the "update_view()" code)
253 * is defined as "MAX(dy,dx) + MIN(dy,dx)/2", which means that the player
254 * actually has an "octagon of projection" not a "circle of projection".
256 * The path grids are saved into the grid array pointed to by "gp", and
257 * there should be room for at least "range" grids in "gp". Note that
258 * due to the way in which distance is calculated, this function normally
259 * uses fewer than "range" grids for the projection path, so the result
260 * of this function should never be compared directly to "range". Note
261 * that the initial grid (y1,x1) is never saved into the grid array, not
262 * even if the initial grid is also the final grid. XXX XXX XXX
264 * The "flg" flags can be used to modify the behavior of this function.
266 * In particular, the "PROJECT_STOP" and "PROJECT_THRU" flags have the same
267 * semantics as they do for the "project" function, namely, that the path
268 * will stop as soon as it hits a monster, or that the path will continue
269 * through the destination grid, respectively.
271 * The "PROJECT_JUMP" flag, which for the "project()" function means to
272 * start at a special grid (which makes no sense in this function), means
273 * that the path should be "angled" slightly if needed to avoid any wall
274 * grids, allowing the player to "target" any grid which is in "view".
275 * This flag is non-trivial and has not yet been implemented, but could
276 * perhaps make use of the "vinfo" array (above). XXX XXX XXX
278 * This function returns the number of grids (if any) in the path. This
279 * function will return zero if and only if (y1,x1) and (y2,x2) are equal.
281 * This algorithm is similar to, but slightly different from, the one used
282 * by "update_view_los()", and very different from the one used by "los()".
284 sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg)
306 /* No path necessary (or allowed) */
307 if ((x1 == x2) && (y1 == y2)) return (0);
335 /* Number of "units" in one "half" grid */
338 /* Number of "units" in one "full" grid */
344 /* Let m = ((dx/dy) * full) = (dx * dx * 2) */
355 /* Advance (X) part 2 */
358 /* Advance (X) part 3 */
365 /* Create the projection path */
369 gp[n++] = GRID(y, x);
371 /* Hack -- Check maximum range */
372 if ((n + (k >> 1)) >= range) break;
374 /* Sometimes stop at destination grid */
375 if (!(flg & (PROJECT_THRU)))
377 if ((x == x2) && (y == y2)) break;
380 if (flg & (PROJECT_DISI))
382 if ((n > 0) && cave_stop_disintegration(y, x)) break;
384 else if (!(flg & (PROJECT_PATH)))
386 /* Always stop at non-initial wall grids */
387 if ((n > 0) && !cave_floor_bold(y, x)) break;
390 /* Sometimes stop at non-initial monsters/players */
391 if (flg & (PROJECT_STOP))
394 (player_bold(y, x) || cave[y][x].m_idx != 0))
398 if (!in_bounds(y, x)) break;
403 /* Advance (X) part 1 */
406 /* Horizontal change */
409 /* Advance (X) part 2 */
412 /* Advance (X) part 3 */
428 /* Let m = ((dy/dx) * full) = (dy * dy * 2) */
437 /* Vertical change */
440 /* Advance (Y) part 2 */
443 /* Advance (Y) part 3 */
450 /* Create the projection path */
454 gp[n++] = GRID(y, x);
456 /* Hack -- Check maximum range */
457 if ((n + (k >> 1)) >= range) break;
459 /* Sometimes stop at destination grid */
460 if (!(flg & (PROJECT_THRU)))
462 if ((x == x2) && (y == y2)) break;
465 if (flg & (PROJECT_DISI))
467 if ((n > 0) && cave_stop_disintegration(y, x)) break;
469 else if (!(flg & (PROJECT_PATH)))
471 /* Always stop at non-initial wall grids */
472 if ((n > 0) && !cave_floor_bold(y, x)) break;
475 /* Sometimes stop at non-initial monsters/players */
476 if (flg & (PROJECT_STOP))
479 (player_bold(y, x) || cave[y][x].m_idx != 0))
483 if (!in_bounds(y, x)) break;
488 /* Advance (Y) part 1 */
491 /* Vertical change */
494 /* Advance (Y) part 2 */
497 /* Advance (Y) part 3 */
517 /* Create the projection path */
521 gp[n++] = GRID(y, x);
523 /* Hack -- Check maximum range */
524 if ((n + (n >> 1)) >= range) break;
526 /* Sometimes stop at destination grid */
527 if (!(flg & (PROJECT_THRU)))
529 if ((x == x2) && (y == y2)) break;
532 if (flg & (PROJECT_DISI))
534 if ((n > 0) && cave_stop_disintegration(y, x)) break;
536 else if (!(flg & (PROJECT_PATH)))
538 /* Always stop at non-initial wall grids */
539 if ((n > 0) && !cave_floor_bold(y, x)) break;
542 /* Sometimes stop at non-initial monsters/players */
543 if (flg & (PROJECT_STOP))
546 (player_bold(y, x) || cave[y][x].m_idx != 0))
550 if (!in_bounds(y, x)) break;
567 * Mega-Hack -- track "affected" monsters (see "project()" comments)
569 static int project_m_n;
570 static int project_m_x;
571 static int project_m_y;
572 /* Mega-Hack -- monsters target */
573 static s16b monster_target_x;
574 static s16b monster_target_y;
578 * We are called from "project()" to "damage" terrain features
580 * We are called both for "beam" effects and "ball" effects.
582 * The "r" parameter is the "distance from ground zero".
584 * Note that we determine if the player can "see" anything that happens
585 * by taking into account: blindness, line-of-sight, and illumination.
587 * We return "TRUE" if the effect of the projection is "obvious".
589 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
591 * XXX XXX XXX Perhaps we should affect doors?
593 static bool project_f(int who, int r, int y, int x, int dam, int typ)
595 cave_type *c_ptr = &cave[y][x];
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 (c_ptr->feat == FEAT_TREES)
617 message = "¸Ï¤ì¤¿";break;
619 message = "was blasted.";break;
623 message = "½Ì¤ó¤À";break;
625 message = "shrank.";break;
629 message = "ÍϤ±¤¿";break;
631 message = "melted.";break;
636 message = "Åà¤ê¡¢ºÕ¤±»¶¤Ã¤¿";break;
638 message = "was frozen and smashed.";break;
644 message = "dz¤¨¤¿";break;
646 message = "burns up!";break;
660 message = "Ê´ºÕ¤µ¤ì¤¿";break;
662 message = "was crushed.";break;
665 message = NULL;break;
670 msg_format("ÌÚ¤Ï%s¡£", message);
672 msg_format("A tree %s", message);
674 cave_set_feat(y, x, (one_in_(3) ? FEAT_DEEP_GRASS : FEAT_GRASS));
677 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
679 /* Update some things */
680 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
684 /* Analyze the type */
687 /* Ignore most effects */
701 case GF_DISINTEGRATE:
723 /* Destroy Traps (and Locks) */
726 /* Reveal secret doors */
727 if (is_hidden_door(c_ptr))
732 /* Check line of sight */
740 if (is_trap(c_ptr->feat))
742 /* Check line of sight */
746 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
748 msg_print("There is a bright flash of light!");
754 /* Forget the trap */
755 c_ptr->info &= ~(CAVE_MARK);
757 /* Destroy the trap */
758 cave_set_feat(y, x, floor_type[randint0(100)]);
761 /* Locked doors are unlocked */
762 else if ((c_ptr->feat >= FEAT_DOOR_HEAD + 0x01) &&
763 (c_ptr->feat <= FEAT_DOOR_HEAD + 0x07))
765 /* Unlock the door */
766 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
768 /* Check line of sound */
772 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
781 /* Remove "unsafe" flag if player is not blind */
782 if (!p_ptr->blind && player_has_los_bold(y, x))
784 obvious = (c_ptr->info & CAVE_UNSAFE) ? TRUE : FALSE;
786 c_ptr->info &= ~(CAVE_UNSAFE);
795 /* Destroy Doors (and traps) */
798 /* Destroy all doors and traps */
799 if ((c_ptr->feat == FEAT_OPEN) ||
800 (c_ptr->feat == FEAT_BROKEN) ||
801 is_trap(c_ptr->feat) ||
802 ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
803 (c_ptr->feat <= FEAT_DOOR_TAIL)))
805 /* Check line of sight */
810 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
812 msg_print("There is a bright flash of light!");
817 /* Visibility change */
818 if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
819 (c_ptr->feat <= FEAT_DOOR_TAIL))
821 /* Update some things */
822 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
826 /* Forget the door */
827 c_ptr->info &= ~(CAVE_MARK);
829 /* Destroy the feature */
830 cave_set_feat(y, x, floor_type[randint0(100)]);
836 /* Remove "unsafe" flag if player is not blind */
837 if (!p_ptr->blind && player_has_los_bold(y, x))
839 obvious = (c_ptr->info & CAVE_UNSAFE) ? TRUE : FALSE;
841 c_ptr->info &= ~(CAVE_UNSAFE);
850 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
852 if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
853 (c_ptr->feat <= FEAT_DOOR_TAIL))
855 /* Convert "locked" to "stuck" XXX XXX XXX */
856 if (c_ptr->feat < FEAT_DOOR_HEAD + 0x08) c_ptr->feat += 0x08;
858 /* Add one spike to the door */
859 if (c_ptr->feat < FEAT_DOOR_TAIL) c_ptr->feat++;
861 /* Check line of sight */
866 msg_print("²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ¥É¥¢¤¬³«¤«¤Ê¤¤¡£");
868 msg_print("The door seems stuck.");
877 /* Destroy walls (and doors) */
880 /* Non-walls (etc) */
881 if (cave_floor_bold(y, x)) break;
883 /* Permanent walls */
884 if (c_ptr->feat >= FEAT_PERM_EXTRA) break;
887 if (c_ptr->feat >= FEAT_WALL_EXTRA)
890 if (known && (c_ptr->info & (CAVE_MARK)))
893 msg_print("Êɤ¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
895 msg_print("The wall turns into mud!");
901 /* Forget the wall */
902 c_ptr->info &= ~(CAVE_MARK);
904 /* Destroy the wall */
905 cave_set_feat(y, x, floor_type[randint0(100)]);
908 /* Quartz / Magma with treasure */
909 else if (c_ptr->feat >= FEAT_MAGMA_H)
912 if (known && (c_ptr->info & (CAVE_MARK)))
915 msg_print("¹ÛÌ®¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
916 msg_print("²¿¤«¤òȯ¸«¤·¤¿¡ª");
918 msg_print("The vein turns into mud!");
919 msg_print("You have found something!");
925 /* Forget the wall */
926 c_ptr->info &= ~(CAVE_MARK);
928 /* Destroy the wall */
929 cave_set_feat(y, x, floor_type[randint0(100)]);
931 /* Place some gold */
936 else if (c_ptr->feat >= FEAT_MAGMA)
939 if (known && (c_ptr->info & (CAVE_MARK)))
942 msg_print("¹ÛÌ®¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
944 msg_print("The vein turns into mud!");
950 /* Forget the wall */
951 c_ptr->info &= ~(CAVE_MARK);
953 /* Destroy the wall */
954 cave_set_feat(y, x, floor_type[randint0(100)]);
958 else if (c_ptr->feat == FEAT_RUBBLE)
961 if (known && (c_ptr->info & (CAVE_MARK)))
964 msg_print("´äÀФ¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
966 msg_print("The rubble turns into mud!");
972 /* Forget the wall */
973 c_ptr->info &= ~(CAVE_MARK);
975 /* Destroy the rubble */
976 cave_set_feat(y, x, floor_type[randint0(100)]);
978 /* Hack -- place an object */
979 if (randint0(100) < 10)
981 /* Found something */
982 if (player_can_see_bold(y, x))
985 msg_print("´äÀФβ¼¤Ë²¿¤«±£¤µ¤ì¤Æ¤¤¤¿¡ª");
987 msg_print("There was something buried in the rubble!");
994 place_object(y, x, 0L);
998 /* Destroy doors (and secret doors) */
999 else /* if (c_ptr->feat >= FEAT_DOOR_HEAD) */
1001 /* Hack -- special message */
1002 if (known && (c_ptr->info & (CAVE_MARK)))
1005 msg_print("¥É¥¢¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
1007 msg_print("The door turns into mud!");
1013 /* Forget the wall */
1014 c_ptr->info &= ~(CAVE_MARK);
1016 /* Destroy the feature */
1017 cave_set_feat(y, x, floor_type[randint0(100)]);
1023 /* Update some things */
1024 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
1032 /* Require a "naked" floor grid */
1033 if (!cave_naked_bold(y, x)) break;
1035 /* Not on the player */
1036 if (player_bold(y, x)) break;
1038 /* Create a closed door */
1039 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
1042 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
1044 /* Update some things */
1045 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1053 /* Require a "naked" floor grid */
1054 if (((cave[y][x].feat != FEAT_FLOOR) &&
1055 (cave[y][x].feat != FEAT_GRASS) &&
1056 (cave[y][x].feat != FEAT_DIRT) &&
1057 (cave[y][x].o_idx == 0) &&
1058 (cave[y][x].m_idx == 0))
1059 || is_mirror_grid(&cave[y][x]) )
1070 /* Require a "naked" floor grid */
1071 if (!cave_naked_bold(y, x)) break;
1073 /* Not on the player */
1074 if (player_bold(y, x)) break;
1076 /* Create a closed door */
1077 cave_set_feat(y, x, FEAT_TREES);
1080 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
1082 /* Update some things */
1083 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1090 /* Require a "naked" floor grid */
1091 if (!cave_naked_bold(y, x)) break;
1093 /* Create a glyph */
1094 cave[y][x].info |= CAVE_OBJECT;
1095 cave[y][x].mimic = FEAT_GLYPH;
1108 /* Require a "naked" floor grid */
1109 if (!cave_naked_bold(y, x)) break;
1111 /* Not on the player */
1112 if (player_bold(y, x)) break;
1115 cave_set_feat(y, x, FEAT_WALL_EXTRA);
1117 /* Update some things */
1118 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1129 /* Require a "naked" floor grid */
1130 if (!cave_naked_bold(y, x)) break;
1132 /* Place a shallow lava */
1133 cave_set_feat(y, x, FEAT_SHAL_LAVA);
1138 /* Require a "naked" floor grid */
1139 if (cave_perma_bold(y, x) || !dam) break;
1141 /* Place a deep lava */
1142 cave_set_feat(y, x, FEAT_DEEP_LAVA);
1144 /* Dam is used as a counter for the number of grid to convert */
1155 /* Require a "naked" floor grid */
1156 if (!cave_naked_bold(y, x)) break;
1158 /* Place a shallow lava */
1159 cave_set_feat(y, x, FEAT_SHAL_WATER);
1164 /* Require a "naked" floor grid */
1165 if (cave_perma_bold(y, x) || !dam) break;
1167 /* Place a deep lava */
1168 cave_set_feat(y, x, FEAT_DEEP_WATER);
1170 /* Dam is used as a counter for the number of grid to convert */
1176 /* Lite up the grid */
1180 /* Turn on the light */
1181 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) c_ptr->info |= (CAVE_GLOW);
1190 if (player_can_see_bold(y, x)) obvious = TRUE;
1192 /* Mega-Hack -- Update the monster in the affected grid */
1193 /* This allows "spear of light" (etc) to work "correctly" */
1194 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1199 /* Darken the grid */
1203 if (!p_ptr->inside_battle)
1206 if (player_can_see_bold(y, x)) obvious = TRUE;
1208 /* Turn off the light. */
1209 if (!is_mirror_grid(c_ptr)) c_ptr->info &= ~(CAVE_GLOW);
1211 /* Hack -- Forget "boring" grids */
1212 if ((c_ptr->feat <= FEAT_INVIS) || (c_ptr->feat == FEAT_DIRT) || (c_ptr->feat == FEAT_GRASS))
1215 c_ptr->info &= ~(CAVE_MARK);
1224 /* Mega-Hack -- Update the monster in the affected grid */
1225 /* This allows "spear of light" (etc) to work "correctly" */
1226 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1235 if (is_mirror_grid(&cave[y][x]))
1238 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1240 msg_print("The mirror was chashed!");
1243 project(0,2,y,x, p_ptr->lev /2 +5 ,GF_SHARDS,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_HANGEKI),-1);
1249 if (is_mirror_grid(&cave[y][x]) && p_ptr->lev < 40 )
1252 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1254 msg_print("The mirror was chashed!");
1256 cave_set_feat(y,x, FEAT_FLOOR);
1263 /* Return "Anything seen?" */
1270 * We are called from "project()" to "damage" objects
1272 * We are called both for "beam" effects and "ball" effects.
1274 * Perhaps we should only SOMETIMES damage things on the ground.
1276 * The "r" parameter is the "distance from ground zero".
1278 * Note that we determine if the player can "see" anything that happens
1279 * by taking into account: blindness, line-of-sight, and illumination.
1281 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1283 * We return "TRUE" if the effect of the projection is "obvious".
1285 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1287 cave_type *c_ptr = &cave[y][x];
1289 s16b this_o_idx, next_o_idx = 0;
1291 bool obvious = FALSE;
1292 bool known = player_has_los_bold(y, x);
1294 u32b flgs[TR_FLAG_SIZE];
1296 char o_name[MAX_NLEN];
1299 bool is_potion = FALSE;
1303 who = who ? who : 0;
1305 /* Reduce damage by distance */
1306 dam = (dam + r) / (r + 1);
1309 /* Scan all objects in the grid */
1310 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1312 /* Acquire object */
1313 object_type *o_ptr = &o_list[this_o_idx];
1315 bool is_art = FALSE;
1316 bool ignore = FALSE;
1317 bool do_kill = FALSE;
1319 cptr note_kill = NULL;
1322 /* Get the "plural"-ness */
1323 bool plural = (o_ptr->number > 1);
1326 /* Acquire next object */
1327 next_o_idx = o_ptr->next_o_idx;
1329 /* Extract the flags */
1330 object_flags(o_ptr, flgs);
1332 /* Check for artifact */
1333 if ((artifact_p(o_ptr) || o_ptr->art_name)) is_art = TRUE;
1335 /* Analyze the type */
1338 /* Acid -- Lots of things */
1341 if (hates_acid(o_ptr))
1345 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1347 note_kill = (plural ? " melt!" : " melts!");
1350 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1355 /* Elec -- Rings and Wands */
1358 if (hates_elec(o_ptr))
1362 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1364 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1367 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1372 /* Fire -- Flammable objects */
1375 if (hates_fire(o_ptr))
1379 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1381 note_kill = (plural ? " burn up!" : " burns up!");
1384 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1389 /* Cold -- potions and flasks */
1392 if (hates_cold(o_ptr))
1395 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1397 note_kill = (plural ? " shatter!" : " shatters!");
1401 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1409 if (hates_fire(o_ptr))
1413 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1415 note_kill = (plural ? " burn up!" : " burns up!");
1418 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1420 if (hates_elec(o_ptr))
1425 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1427 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1430 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1438 if (hates_fire(o_ptr))
1442 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1444 note_kill = (plural ? " burn up!" : " burns up!");
1447 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1449 if (hates_cold(o_ptr))
1454 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1456 note_kill = (plural ? " shatter!" : " shatters!");
1459 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1464 /* Hack -- break potions and such */
1470 if (hates_cold(o_ptr))
1473 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1475 note_kill = (plural ? " shatter!" : " shatters!");
1483 /* Mana and Chaos -- destroy everything */
1490 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1492 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1498 case GF_DISINTEGRATE:
1502 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1504 note_kill = (plural ? " evaporate!" : " evaporates!");
1514 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1516 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1519 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1520 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1524 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1528 if (cursed_p(o_ptr))
1532 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1534 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1543 identify_item(o_ptr);
1551 /* Chests are noticed only if trapped or locked */
1552 if (o_ptr->tval == TV_CHEST)
1554 /* Disarm/Unlock traps */
1555 if (o_ptr->pval > 0)
1557 /* Disarm or Unlock */
1558 o_ptr->pval = (0 - o_ptr->pval);
1561 object_known(o_ptr);
1564 if (known && o_ptr->marked)
1567 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1569 msg_print("Click!");
1581 if (o_ptr->tval == TV_CORPSE)
1586 if (!who || is_pet(&m_list[who]))
1587 mode |= PM_FORCE_PET;
1589 for (i = 0; i < o_ptr->number ; i++)
1591 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1592 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1597 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1599 note_kill = (plural ? " become dust." : " becomes dust.");
1604 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1607 note_kill = "À¸¤Ê֤ä¿¡£";
1609 note_kill = "rivived.";
1612 else if (!note_kill)
1615 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1617 note_kill = (plural ? " become dust." : " becomes dust.");
1629 /* Attempt to destroy the object */
1632 /* Effect "observed" */
1633 if (known && o_ptr->marked)
1636 object_desc(o_name, o_ptr, FALSE, 0);
1639 /* Artifacts, and other objects, get to resist */
1640 if (is_art || ignore)
1642 /* Observe the resist */
1643 if (known && o_ptr->marked)
1646 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1649 msg_format("The %s %s unaffected!",
1650 o_name, (plural ? "are" : "is"));
1659 /* Describe if needed */
1660 if (known && o_ptr->marked && note_kill)
1663 msg_format("%s¤Ï%s", o_name, note_kill);
1665 msg_format("The %s%s", o_name, note_kill);
1670 k_idx = o_ptr->k_idx;
1671 is_potion = object_is_potion(o_ptr);
1674 /* Delete the object */
1675 delete_object_idx(this_o_idx);
1677 /* Potions produce effects when 'shattered' */
1680 (void)potion_smash_effect(who, y, x, k_idx);
1689 /* Return "Anything seen?" */
1695 * Helper function for "project()" below.
1697 * Handle a beam/bolt/ball causing damage to a monster.
1699 * This routine takes a "source monster" (by index) which is mostly used to
1700 * determine if the player is causing the damage, and a "radius" (see below),
1701 * which is used to decrease the power of explosions with distance, and a
1702 * location, via integers which are modified by certain types of attacks
1703 * (polymorph and teleport being the obvious ones), a default damage, which
1704 * is modified as needed based on various properties, and finally a "damage
1705 * type" (see below).
1707 * Note that this routine can handle "no damage" attacks (like teleport) by
1708 * taking a "zero" damage, and can even take "parameters" to attacks (like
1709 * confuse) by accepting a "damage", using it to calculate the effect, and
1710 * then setting the damage to zero. Note that the "damage" parameter is
1711 * divided by the radius, so monsters not at the "epicenter" will not take
1712 * as much damage (or whatever)...
1714 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1715 * may result in a dereference of an invalid pointer. XXX XXX XXX
1717 * Various messages are produced, and damage is applied.
1719 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1720 * actually be "made" of that substance, or "breathe" big balls of it.
1722 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1725 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1726 * and hurts evil less. If can breath nether, then it resists it as well.
1728 * Damage reductions use the following formulas:
1729 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1730 * gives avg damage of .655, ranging from .858 to .500
1731 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1732 * gives avg damage of .544, ranging from .714 to .417
1733 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1734 * gives avg damage of .444, ranging from .556 to .333
1735 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1736 * gives avg damage of .327, ranging from .427 to .250
1737 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1738 * gives something simple.
1740 * In this function, "result" messages are postponed until the end, where
1741 * the "note" string is appended to the monster name, if not NULL. So,
1742 * to make a spell have "no effect" just set "note" to NULL. You should
1743 * also set "notice" to FALSE, or the player will learn what the spell does.
1745 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1747 /* "flg" was added. */
1748 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1752 cave_type *c_ptr = &cave[y][x];
1754 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1756 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1760 /* Is the monster "seen"? */
1761 bool seen = m_ptr->ml;
1763 bool slept = (bool)(m_ptr->csleep > 0);
1765 /* Were the effects "obvious" (if seen)? */
1766 bool obvious = FALSE;
1768 /* Can the player know about this effect? */
1769 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1771 /* Can the player see the source of this effect? */
1772 bool see_s = ((who <= 0) || m_list[who].ml);
1774 /* Were the effects "irrelevant"? */
1775 bool skipped = FALSE;
1777 /* Gets the monster angry at the source of the effect? */
1778 bool get_angry = FALSE;
1780 /* Polymorph setting (true or false) */
1781 bool do_poly = FALSE;
1783 /* Teleport setting (max distance) */
1786 /* Confusion setting (amount to confuse) */
1789 /* Stunning setting (amount to stun) */
1792 /* Sleep amount (amount to sleep) */
1795 /* Fear amount (amount to fear) */
1798 /* Time amount (amount to time) */
1801 bool heal_leper = FALSE;
1803 /* Hold the monster name */
1812 /* Assume no note */
1815 /* Assume a default death */
1816 cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
1821 int caster_lev = (who > 0) ? (r_info[m_list[who].r_idx].level / 2) : p_ptr->lev;
1824 if (!c_ptr->m_idx) return (FALSE);
1826 /* Never affect projector */
1827 if (who && (c_ptr->m_idx == who)) return (FALSE);
1828 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1829 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1831 /* Don't affect already death monsters */
1832 /* Prevents problems with chain reactions of exploding monsters */
1833 if (m_ptr->hp < 0) return (FALSE);
1835 /* Reduce damage by distance */
1836 dam = (dam + r) / (r + 1);
1839 /* Get the monster name (BEFORE polymorphing) */
1840 monster_desc(m_name, m_ptr, 0);
1843 /* Get the monster possessive ("his"/"her"/"its") */
1844 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1848 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1850 /* Analyze the damage type */
1853 /* Magic Missile -- pure damage */
1856 if (seen) obvious = TRUE;
1858 if (r_ptr->flagsr & RFR_RES_ALL)
1861 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1863 note = " is immune.";
1866 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1875 if (seen) obvious = TRUE;
1877 if (r_ptr->flagsr & RFR_RES_ALL)
1880 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1882 note = " is immune.";
1885 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1888 if (r_ptr->flagsr & RFR_IM_ACID)
1891 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1893 note = " resists a lot.";
1897 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1905 if (seen) obvious = TRUE;
1907 if (r_ptr->flagsr & RFR_RES_ALL)
1910 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1912 note = " is immune.";
1915 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1918 if (r_ptr->flagsr & RFR_IM_ELEC)
1921 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1923 note = " resists a lot.";
1927 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1935 if (seen) obvious = TRUE;
1937 if (r_ptr->flagsr & RFR_RES_ALL)
1940 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1942 note = " is immune.";
1945 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1948 if (r_ptr->flagsr & RFR_IM_FIRE)
1951 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1953 note = " resists a lot.";
1957 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1959 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1962 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1964 note = " is hit hard.";
1968 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1976 if (seen) obvious = TRUE;
1978 if (r_ptr->flagsr & RFR_RES_ALL)
1981 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1983 note = " is immune.";
1986 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1989 if (r_ptr->flagsr & RFR_IM_COLD)
1992 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1994 note = " resists a lot.";
1998 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
2000 else if (r_ptr->flags3 & (RF3_HURT_COLD))
2003 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
2005 note = " is hit hard.";
2009 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
2017 if (seen) obvious = TRUE;
2019 if (r_ptr->flagsr & RFR_RES_ALL)
2022 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2024 note = " is immune.";
2027 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2030 if (r_ptr->flagsr & RFR_IM_POIS)
2033 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
2035 note = " resists a lot.";
2039 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
2047 if (seen) obvious = TRUE;
2049 if (r_ptr->flagsr & RFR_RES_ALL)
2052 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2054 note = " is immune.";
2057 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2060 if (r_ptr->flagsr & RFR_IM_POIS)
2063 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2068 dam *= 3; dam /= randint1(6) + 6;
2069 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
2071 else if (one_in_(3)) do_poly = TRUE;
2075 /* Hellfire -- hurts Evil */
2078 if (seen) obvious = TRUE;
2080 if (r_ptr->flagsr & RFR_RES_ALL)
2083 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2085 note = " is immune.";
2088 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2091 if (r_ptr->flags3 & RF3_GOOD)
2095 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2097 note = " is hit hard.";
2100 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
2105 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2108 if (seen) obvious = TRUE;
2110 if (r_ptr->flagsr & RFR_RES_ALL)
2113 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2115 note = " is immune.";
2118 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2121 if (r_ptr->flags3 & RF3_GOOD)
2125 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2127 note = " is immune.";
2130 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
2132 else if (r_ptr->flags3 & RF3_EVIL)
2136 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2138 note = " is hit hard.";
2141 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
2146 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2151 dam *= 3; dam /= randint1(6) + 6;
2156 /* Arrow -- XXX no defense */
2159 if (seen) obvious = TRUE;
2161 if (r_ptr->flagsr & RFR_RES_ALL)
2164 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2166 note = " is immune.";
2169 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2175 /* Plasma -- XXX perhaps check ELEC or FIRE */
2178 if (seen) obvious = TRUE;
2180 if (r_ptr->flagsr & RFR_RES_ALL)
2183 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2185 note = " is immune.";
2188 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2191 if (r_ptr->flagsr & RFR_RES_PLAS)
2194 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2199 dam *= 3; dam /= randint1(6) + 6;
2200 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
2205 /* Nether -- see above */
2208 if (seen) obvious = TRUE;
2210 if (r_ptr->flagsr & RFR_RES_ALL)
2213 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2215 note = " is immune.";
2218 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2221 if (r_ptr->flagsr & RFR_RES_NETH)
2223 if (r_ptr->flags3 & RF3_UNDEAD)
2226 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2228 note = " is immune.";
2232 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2237 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2242 dam *= 3; dam /= randint1(6) + 6;
2244 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
2246 else if (r_ptr->flags3 & RF3_EVIL)
2250 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2252 note = " resists somewhat.";
2255 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2260 /* Water (acid) damage -- Water spirits/elementals are immune */
2263 if (seen) obvious = TRUE;
2265 if (r_ptr->flagsr & RFR_RES_ALL)
2268 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2270 note = " is immune.";
2273 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2276 if (r_ptr->flagsr & RFR_RES_WATE)
2278 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
2281 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2283 note = " is immune.";
2291 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2296 dam *= 3; dam /= randint1(6) + 6;
2298 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
2303 /* Chaos -- Chaos breathers resist */
2306 if (seen) obvious = TRUE;
2308 if (r_ptr->flagsr & RFR_RES_ALL)
2311 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2313 note = " is immune.";
2316 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2319 if (r_ptr->flagsr & RFR_RES_CHAO)
2322 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2327 dam *= 3; dam /= randint1(6) + 6;
2328 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
2330 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
2333 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2335 note = " resists somewhat.";
2338 dam *= 3; dam /= randint1(6) + 6;
2339 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2344 do_conf = (5 + randint1(11) + r) / (r + 1);
2349 /* Shards -- Shard breathers resist */
2352 if (seen) obvious = TRUE;
2354 if (r_ptr->flagsr & RFR_RES_ALL)
2357 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2359 note = " is immune.";
2362 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2365 if (r_ptr->flagsr & RFR_RES_SHAR)
2368 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2373 dam *= 3; dam /= randint1(6) + 6;
2374 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2379 /* Rocket: Shard resistance helps */
2382 if (seen) obvious = TRUE;
2384 if (r_ptr->flagsr & RFR_RES_ALL)
2387 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2389 note = " is immune.";
2392 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2395 if (r_ptr->flagsr & RFR_RES_SHAR)
2398 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2400 note = " resists somewhat.";
2404 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2410 /* Sound -- Sound breathers resist */
2413 if (seen) obvious = TRUE;
2415 if (r_ptr->flagsr & RFR_RES_ALL)
2418 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2420 note = " is immune.";
2423 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2426 if (r_ptr->flagsr & RFR_RES_SOUN)
2429 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2434 dam *= 2; dam /= randint1(6) + 6;
2435 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
2437 else do_stun = (10 + randint1(15) + r) / (r + 1);
2444 if (seen) obvious = TRUE;
2446 if (r_ptr->flagsr & RFR_RES_ALL)
2449 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2451 note = " is immune.";
2454 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2457 if (r_ptr->flags3 & RF3_NO_CONF)
2460 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2465 dam *= 3; dam /= randint1(6) + 6;
2466 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2468 else do_conf = (10 + randint1(15) + r) / (r + 1);
2472 /* Disenchantment -- Breathers and Disenchanters resist */
2475 if (seen) obvious = TRUE;
2477 if (r_ptr->flagsr & RFR_RES_ALL)
2480 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2482 note = " is immune.";
2485 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2488 if (r_ptr->flagsr & RFR_RES_DISE)
2491 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2496 dam *= 3; dam /= randint1(6) + 6;
2497 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
2502 /* Nexus -- Breathers and Existers resist */
2505 if (seen) obvious = TRUE;
2507 if (r_ptr->flagsr & RFR_RES_ALL)
2510 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2512 note = " is immune.";
2515 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2518 if (r_ptr->flagsr & RFR_RES_NEXU)
2521 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2526 dam *= 3; dam /= randint1(6) + 6;
2527 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
2535 if (seen) obvious = TRUE;
2537 if (r_ptr->flagsr & RFR_RES_ALL)
2540 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2542 note = " is immune.";
2545 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2548 if (r_ptr->flagsr & RFR_RES_WALL)
2551 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2556 dam *= 3; dam /= randint1(6) + 6;
2557 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
2559 else do_stun = (randint1(15) + r) / (r + 1);
2563 /* Inertia -- breathers resist */
2566 if (seen) obvious = TRUE;
2568 if (r_ptr->flagsr & RFR_RES_ALL)
2571 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2573 note = " is immune.";
2576 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2579 if (r_ptr->flagsr & RFR_RES_INER)
2582 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2587 dam *= 3; dam /= randint1(6) + 6;
2588 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
2592 /* Powerful monsters can resist */
2593 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2594 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2598 /* Normal monsters slow down */
2604 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2606 note = " starts moving slower.";
2609 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2610 if (c_ptr->m_idx == p_ptr->riding)
2611 p_ptr->update |= (PU_BONUS);
2617 /* Time -- breathers resist */
2620 if (seen) obvious = TRUE;
2622 if (r_ptr->flagsr & RFR_RES_ALL)
2625 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2627 note = " is immune.";
2630 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2633 if (r_ptr->flagsr & RFR_RES_TIME)
2636 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2641 dam *= 3; dam /= randint1(6) + 6;
2642 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
2644 else do_time = (dam + 1) / 2;
2648 /* Gravity -- breathers resist */
2651 bool resist_tele = FALSE;
2653 if (seen) obvious = TRUE;
2655 if (r_ptr->flagsr & RFR_RES_ALL)
2658 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2660 note = " is immune.";
2663 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2666 if (r_ptr->flagsr & RFR_RES_TELE)
2668 if (r_ptr->flags1 & (RF1_UNIQUE))
2670 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2672 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2674 note = " is unaffected!";
2679 else if (r_ptr->level > randint1(100))
2681 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2683 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2692 if (!resist_tele) do_dist = 10;
2694 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2696 if (r_ptr->flagsr & RFR_RES_GRAV)
2699 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2704 dam *= 3; dam /= randint1(6) + 6;
2706 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
2711 /* Powerful monsters can resist */
2712 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2713 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2717 /* Normal monsters slow down */
2723 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2725 note = " starts moving slower.";
2728 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2729 if (c_ptr->m_idx == p_ptr->riding)
2730 p_ptr->update |= (PU_BONUS);
2734 do_stun = damroll((caster_lev / 10) + 3 , (dam)) + 1;
2736 /* Attempt a saving throw */
2737 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2738 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2742 /* No obvious effect */
2744 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2746 note = " is unaffected!";
2760 if (seen) obvious = TRUE;
2762 if (r_ptr->flagsr & RFR_RES_ALL)
2765 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2767 note = " is immune.";
2770 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2778 case GF_DISINTEGRATE:
2780 if (seen) obvious = TRUE;
2782 if (r_ptr->flagsr & RFR_RES_ALL)
2785 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2787 note = " is immune.";
2790 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2793 if (r_ptr->flags3 & RF3_HURT_ROCK)
2795 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2797 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2798 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2800 note = " loses some skin!";
2801 note_dies = " evaporates!";
2811 if (seen) obvious = TRUE;
2813 /* PSI only works if the monster can see you! -- RG */
2814 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2817 if (seen) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name);
2819 if (seen) msg_format("%^s can't see you, and isn't affected!", m_name);
2825 if (r_ptr->flagsr & RFR_RES_ALL)
2828 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2830 note = " is immune.";
2833 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2836 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2840 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2842 note = " is immune!";
2844 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2847 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2848 (r_ptr->flags3 & RF3_ANIMAL) ||
2849 (r_ptr->level > randint1(3 * dam)))
2853 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2860 * Powerful demons & undead can turn a mindcrafter's
2861 * attacks back on them
2863 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2864 (r_ptr->level > p_ptr->lev / 2) &&
2869 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2871 msg_format("%^s%s corrupted mind backlashes your attack!",
2872 m_name, (seen ? "'s" : "s"));
2876 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2879 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2881 msg_print("You resist the effects!");
2887 /* Injure +/- confusion */
2888 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2889 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2892 switch (randint1(4))
2895 set_confused(p_ptr->confused + 3 + randint1(dam));
2898 set_stun(p_ptr->stun + randint1(dam));
2902 if (r_ptr->flags3 & RF3_NO_FEAR)
2904 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2906 note = " is unaffected.";
2910 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2914 if (!p_ptr->free_act)
2915 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2924 if ((dam > 0) && one_in_(4))
2926 switch (randint1(4))
2929 do_conf = 3 + randint1(dam);
2932 do_stun = 3 + randint1(dam);
2935 do_fear = 3 + randint1(dam);
2939 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2941 note = " falls asleep!";
2944 do_sleep = 3 + randint1(dam);
2950 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2952 note_dies = " collapses, a mindless husk.";
2960 if (seen) obvious = TRUE;
2962 if (r_ptr->flagsr & RFR_RES_ALL)
2965 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2967 note = " is immune.";
2970 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2973 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2977 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2979 note = " is immune!";
2983 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2984 (r_ptr->flags3 & RF3_ANIMAL) ||
2985 (r_ptr->level > randint1(3 * dam)))
2989 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2996 * Powerful demons & undead can turn a mindcrafter's
2997 * attacks back on them
2999 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
3000 (r_ptr->level > p_ptr->lev / 2) &&
3005 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
3007 msg_format("%^s%s corrupted mind backlashes your attack!",
3008 m_name, (seen ? "'s" : "s"));
3012 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3015 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3017 msg_print("You resist the effects!");
3023 /* Injure + mana drain */
3024 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
3026 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
3028 msg_print("Your psychic energy is drained!");
3031 p_ptr->csp -= damroll(5, dam) / 2;
3032 if (p_ptr->csp < 0) p_ptr->csp = 0;
3033 p_ptr->redraw |= PR_MANA;
3034 p_ptr->window |= (PW_SPELL);
3035 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
3042 int b = damroll(5, dam) / 4;
3044 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª", m_name);
3046 msg_format("You convert %s%s pain into psychic energy!",
3047 m_name, (seen ? "'s" : "s"));
3050 b = MIN(p_ptr->msp, p_ptr->csp + b);
3052 p_ptr->redraw |= PR_MANA;
3053 p_ptr->window |= (PW_SPELL);
3057 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
3059 note_dies = " collapses, a mindless husk.";
3065 case GF_TELEKINESIS:
3067 if (seen) obvious = TRUE;
3069 if (r_ptr->flagsr & RFR_RES_ALL)
3072 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3074 note = " is immune.";
3077 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3082 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
3087 do_stun = damroll((caster_lev / 10) + 3 , dam) + 1;
3089 /* Attempt a saving throw */
3090 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3091 (r_ptr->level > 5 + randint1(dam)))
3095 /* No obvious effect */
3101 /* Psycho-spear -- powerful magic missile */
3104 if (seen) obvious = TRUE;
3106 if (r_ptr->flagsr & RFR_RES_ALL)
3109 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3111 note = " is immune.";
3114 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3120 /* Meteor -- powerful magic missile */
3123 if (seen) obvious = TRUE;
3125 if (r_ptr->flagsr & RFR_RES_ALL)
3128 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3130 note = " is immune.";
3133 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3141 if (!is_hostile(m_ptr)) break;
3143 if (seen) obvious = TRUE;
3145 if (r_ptr->flagsr & RFR_RES_ALL)
3148 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3150 note = " is immune.";
3153 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3156 /* Attempt a saving throw */
3157 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
3158 (r_ptr->flags3 & RF3_NO_CONF) ||
3159 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3161 /* Memorize a flag */
3162 if (r_ptr->flags3 & RF3_NO_CONF)
3164 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3171 * Powerful demons & undead can turn a mindcrafter's
3172 * attacks back on them
3174 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
3175 (r_ptr->level > p_ptr->lev / 2) &&
3180 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
3182 msg_format("%^s%s corrupted mind backlashes your attack!",
3183 m_name, (seen ? "'s" : "s"));
3187 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3190 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3192 msg_print("You resist the effects!");
3198 /* Confuse, stun, terrify */
3199 switch (randint1(4))
3202 set_stun(p_ptr->stun + dam / 2);
3205 set_confused(p_ptr->confused + dam / 2);
3209 if (r_ptr->flags3 & RF3_NO_FEAR)
3211 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3213 note = " is unaffected.";
3217 set_afraid(p_ptr->afraid + dam);
3224 /* No obvious effect */
3226 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3228 note = " is unaffected!";
3236 if ((dam > 29) && (randint1(100) < dam))
3239 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3241 note = " is in your thrall!";
3248 switch (randint1(4))
3262 /* No "real" damage */
3269 /* Ice -- Cold + Cuts + Stun */
3272 if (seen) obvious = TRUE;
3274 if (r_ptr->flagsr & RFR_RES_ALL)
3277 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3279 note = " is immune.";
3282 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3285 do_stun = (randint1(15) + 1) / (r + 1);
3286 if (r_ptr->flagsr & RFR_IM_COLD)
3289 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3291 note = " resists a lot.";
3295 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
3297 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3300 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3302 note = " is hit hard.";
3306 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3315 if (seen) obvious = TRUE;
3317 if (r_ptr->flagsr & RFR_RES_ALL)
3320 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3322 note = " is immune.";
3325 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3328 if (!monster_living(r_ptr))
3332 if (is_original_ap(m_ptr))
3334 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3335 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3336 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3341 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3343 note = " is unaffected!";
3349 else do_time = (dam+7)/8;
3357 if (seen) obvious = TRUE;
3359 if (r_ptr->flagsr & RFR_RES_ALL)
3362 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3364 note = " is immune.";
3367 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3370 if (!monster_living(r_ptr))
3374 if (is_original_ap(m_ptr))
3376 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3377 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3378 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3383 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3385 note = " is immune.";
3391 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3392 (randint1(888) != 666)) ||
3393 (((r_ptr->level + randint1(20)) > randint1(caster_lev + randint1(10))) &&
3394 randint1(100) != 66))
3397 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3409 /* Polymorph monster (Use "dam" as "power") */
3412 if (seen) obvious = TRUE;
3414 if (r_ptr->flagsr & RFR_RES_ALL)
3417 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3419 note = " is immune.";
3422 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3425 /* Attempt to polymorph (see below) */
3428 /* Powerful monsters can resist */
3429 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3430 (r_ptr->flags1 & RF1_QUESTOR) ||
3431 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3434 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3436 note = " is unaffected!";
3443 /* No "real" damage */
3450 /* Clone monsters (Ignore "dam") */
3453 if (seen) obvious = TRUE;
3455 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)))
3458 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3460 note = " is unaffected!";
3466 m_ptr->hp = m_ptr->maxhp;
3468 /* Attempt to clone. */
3469 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3472 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3480 /* No "real" damage */
3487 /* Heal Monster (use "dam" as amount of healing) */
3490 if (seen) obvious = TRUE;
3495 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3497 if (m_ptr->maxhp < m_ptr->max_maxhp)
3500 msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3502 msg_format("%^s recovers %s vitality.", m_name, m_poss);
3504 m_ptr->maxhp = m_ptr->max_maxhp;
3510 if (seen) obvious = TRUE;
3515 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3520 msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3522 msg_format("%^s is no longer stunned.", m_name);
3526 if (m_ptr->confused)
3529 msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3531 msg_format("%^s is no longer confused.", m_name);
3533 m_ptr->confused = 0;
3538 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3540 msg_format("%^s recovers %s courage.", m_name, m_poss);
3546 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3549 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3551 chg_virtue(V_VITALITY, 1);
3553 if (r_ptr->flags1 & RF1_UNIQUE)
3554 chg_virtue(V_INDIVIDUALISM, 1);
3556 if (is_friendly(m_ptr))
3557 chg_virtue(V_HONOUR, 1);
3558 else if (!(r_ptr->flags3 & RF3_EVIL))
3560 if (r_ptr->flags3 & RF3_GOOD)
3561 chg_virtue(V_COMPASSION, 2);
3563 chg_virtue(V_COMPASSION, 1);
3566 if (m_ptr->r_idx == MON_LEPER)
3569 chg_virtue(V_COMPASSION, 5);
3572 if (r_ptr->flags3 & RF3_ANIMAL)
3573 chg_virtue(V_NATURE, 1);
3575 /* Redraw (later) if needed */
3576 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3577 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3581 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3583 note = " looks healthier.";
3587 /* No "real" damage */
3593 /* Speed Monster (Ignore "dam") */
3596 if (seen) obvious = TRUE;
3602 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3604 note = " starts moving faster.";
3607 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3609 if (c_ptr->m_idx == p_ptr->riding)
3610 p_ptr->update |= (PU_BONUS);
3612 if (r_ptr->flags1 & RF1_UNIQUE)
3613 chg_virtue(V_INDIVIDUALISM, 1);
3614 if (is_friendly(m_ptr))
3615 chg_virtue(V_HONOUR, 1);
3617 /* No "real" damage */
3623 /* Slow Monster (Use "dam" as "power") */
3626 if (seen) obvious = TRUE;
3628 if (r_ptr->flagsr & RFR_RES_ALL)
3631 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3633 note = " is immune.";
3636 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3639 /* Powerful monsters can resist */
3640 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3641 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3644 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3646 note = " is unaffected!";
3652 /* Normal monsters slow down */
3658 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3660 note = " starts moving slower.";
3663 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3665 if (c_ptr->m_idx == p_ptr->riding)
3666 p_ptr->update |= (PU_BONUS);
3669 /* No "real" damage */
3675 /* Sleep (Use "dam" as "power") */
3678 if (seen) obvious = TRUE;
3680 if (r_ptr->flagsr & RFR_RES_ALL)
3683 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3685 note = " is immune.";
3688 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3691 /* Attempt a saving throw */
3692 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3693 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3694 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3696 /* Memorize a flag */
3697 if (r_ptr->flags3 & RF3_NO_SLEEP)
3699 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3702 /* No obvious effect */
3704 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3706 note = " is unaffected!";
3713 /* Go to sleep (much) later */
3715 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3717 note = " falls asleep!";
3723 /* No "real" damage */
3729 /* Sleep (Use "dam" as "power") */
3730 case GF_STASIS_EVIL:
3732 if (seen) obvious = TRUE;
3734 if (r_ptr->flagsr & RFR_RES_ALL)
3737 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3739 note = " is immune.";
3742 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3745 /* Attempt a saving throw */
3746 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3747 !(r_ptr->flags3 & RF3_EVIL) ||
3748 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3751 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3753 note = " is unaffected!";
3760 /* Go to sleep (much) later */
3762 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3764 note = " is suspended!";
3770 /* No "real" damage */
3775 /* Sleep (Use "dam" as "power") */
3778 if (seen) obvious = TRUE;
3780 if (r_ptr->flagsr & RFR_RES_ALL)
3783 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3785 note = " is immune.";
3788 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3791 /* Attempt a saving throw */
3792 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3793 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3796 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3798 note = " is unaffected!";
3805 /* Go to sleep (much) later */
3807 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3809 note = " is suspended!";
3815 /* No "real" damage */
3824 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3825 vir = virtue_number(V_HARMONY);
3828 dam += p_ptr->virtues[vir-1]/10;
3831 vir = virtue_number(V_INDIVIDUALISM);
3834 dam -= p_ptr->virtues[vir-1]/20;
3837 if (seen) obvious = TRUE;
3839 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3842 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3844 note = " is immune.";
3847 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3851 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3854 /* Attempt a saving throw */
3855 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3856 (r_ptr->flags3 & RF3_NO_CONF) ||
3857 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3858 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3860 /* Memorize a flag */
3861 if (r_ptr->flags3 & RF3_NO_CONF)
3863 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3867 /* No obvious effect */
3869 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3871 note = " is unaffected!";
3876 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3878 else if (p_ptr->cursed & TRC_AGGRAVATE)
3881 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3883 note = " hates you too much!";
3886 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3891 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3893 note = " suddenly seems friendly!";
3898 chg_virtue(V_INDIVIDUALISM, -1);
3899 if (r_ptr->flags3 & RF3_ANIMAL)
3900 chg_virtue(V_NATURE, 1);
3903 /* No "real" damage */
3908 /* Control undead */
3909 case GF_CONTROL_UNDEAD:
3912 if (seen) obvious = TRUE;
3914 vir = virtue_number(V_UNLIFE);
3917 dam += p_ptr->virtues[vir-1]/10;
3920 vir = virtue_number(V_INDIVIDUALISM);
3923 dam -= p_ptr->virtues[vir-1]/20;
3926 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3929 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3931 note = " is immune.";
3934 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3938 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3941 /* Attempt a saving throw */
3942 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3943 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3944 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3945 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3947 /* No obvious effect */
3949 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3951 note = " is unaffected!";
3955 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3957 else if (p_ptr->cursed & TRC_AGGRAVATE)
3960 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3962 note = " hates you too much!";
3965 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3970 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3972 note = " is in your thrall!";
3978 /* No "real" damage */
3984 case GF_CONTROL_DEMON:
3987 if (seen) obvious = TRUE;
3989 vir = virtue_number(V_UNLIFE);
3992 dam += p_ptr->virtues[vir-1]/10;
3995 vir = virtue_number(V_INDIVIDUALISM);
3998 dam -= p_ptr->virtues[vir-1]/20;
4001 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4004 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4006 note = " is immune.";
4009 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4013 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4016 /* Attempt a saving throw */
4017 if ((r_ptr->flags1 & RF1_QUESTOR) ||
4018 (!(r_ptr->flags3 & RF3_DEMON)) ||
4019 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4020 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4022 /* No obvious effect */
4024 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4026 note = " is unaffected!";
4030 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4032 else if (p_ptr->cursed & TRC_AGGRAVATE)
4035 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4037 note = " hates you too much!";
4040 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4045 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
4047 note = " is in your thrall!";
4053 /* No "real" damage */
4059 case GF_CONTROL_ANIMAL:
4063 if (seen) obvious = TRUE;
4065 vir = virtue_number(V_NATURE);
4068 dam += p_ptr->virtues[vir-1]/10;
4071 vir = virtue_number(V_INDIVIDUALISM);
4074 dam -= p_ptr->virtues[vir-1]/20;
4077 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4080 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4082 note = " is immune.";
4085 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4089 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4092 /* Attempt a saving throw */
4093 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4094 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
4095 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4096 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4097 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4099 /* Memorize a flag */
4100 if (r_ptr->flags3 & (RF3_NO_CONF))
4102 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4106 /* No obvious effect */
4108 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4110 note = " is unaffected!";
4114 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4116 else if (p_ptr->cursed & TRC_AGGRAVATE)
4119 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4121 note = " hates you too much!";
4124 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4129 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4131 note = " is tamed!";
4136 if (r_ptr->flags3 & RF3_ANIMAL)
4137 chg_virtue(V_NATURE, 1);
4140 /* No "real" damage */
4146 case GF_CONTROL_LIVING:
4150 vir = virtue_number(V_UNLIFE);
4151 if (seen) obvious = TRUE;
4153 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4154 vir = virtue_number(V_UNLIFE);
4157 dam -= p_ptr->virtues[vir-1]/10;
4160 vir = virtue_number(V_INDIVIDUALISM);
4163 dam -= p_ptr->virtues[vir-1]/20;
4166 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4167 if (dam < 1) dam = 1;
4169 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4171 msg_format("You stare into %s.", m_name);
4173 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4176 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4178 note = " is immune.";
4181 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4185 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4188 /* Attempt a saving throw */
4189 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4190 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4191 !monster_living(r_ptr) ||
4192 ((r_ptr->level+10) > randint1(dam)))
4195 /* No obvious effect */
4197 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4199 note = " is unaffected!";
4203 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4205 else if (p_ptr->cursed & TRC_AGGRAVATE)
4208 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4210 note = " hates you too much!";
4213 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4218 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4220 note = " is tamed!";
4225 if (r_ptr->flags3 & RF3_ANIMAL)
4226 chg_virtue(V_NATURE, 1);
4229 /* No "real" damage */
4234 /* Confusion (Use "dam" as "power") */
4237 if (seen) obvious = TRUE;
4239 if (r_ptr->flagsr & RFR_RES_ALL)
4242 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4244 note = " is immune.";
4247 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4250 /* Get confused later */
4251 do_conf = damroll(3, (dam / 2)) + 1;
4253 /* Attempt a saving throw */
4254 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4255 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4256 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4258 /* Memorize a flag */
4259 if (r_ptr->flags3 & (RF3_NO_CONF))
4261 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4267 /* No obvious effect */
4269 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4271 note = " is unaffected!";
4277 /* No "real" damage */
4284 if (seen) obvious = TRUE;
4286 if (r_ptr->flagsr & RFR_RES_ALL)
4289 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4291 note = " is immune.";
4294 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4297 do_stun = damroll((caster_lev / 10) + 3 , (dam)) + 1;
4299 /* Attempt a saving throw */
4300 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4301 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4306 /* No obvious effect */
4308 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4310 note = " is unaffected!";
4316 /* No "real" damage */
4324 /* Lite, but only hurts susceptible creatures */
4332 if (r_ptr->flagsr & RFR_RES_ALL)
4338 if (r_ptr->flags3 & (RF3_HURT_LITE))
4342 /* Obvious effect */
4345 /* Memorize the effects */
4346 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4349 /* Special effect */
4351 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4352 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4354 note = " cringes from the light!";
4355 note_dies = " shrivels away in the light!";
4360 /* Normally no damage */
4372 /* Lite -- opposite of Dark */
4375 if (seen) obvious = TRUE;
4377 if (r_ptr->flagsr & RFR_RES_ALL)
4380 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4382 note = " is immune.";
4385 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4388 if (r_ptr->flagsr & RFR_RES_LITE)
4391 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4396 dam *= 2; dam /= (randint1(6)+6);
4397 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4399 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4401 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4403 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4404 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4406 note = " cringes from the light!";
4407 note_dies = " shrivels away in the light!";
4416 /* Dark -- opposite of Lite */
4419 if (seen) obvious = TRUE;
4421 if (r_ptr->flagsr & RFR_RES_ALL)
4424 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4426 note = " is immune.";
4429 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4432 if (r_ptr->flagsr & RFR_RES_DARK)
4435 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4440 dam *= 2; dam /= (randint1(6)+6);
4441 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4450 if (r_ptr->flagsr & RFR_RES_ALL)
4455 /* Hurt by rock remover */
4456 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4463 /* Memorize the effects */
4464 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4467 /* Cute little message */
4469 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4470 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4472 note = " loses some skin!";
4473 note_dies = " dissolves!";
4478 /* Usually, ignore the effects */
4489 /* Teleport undead (Use "dam" as "power") */
4490 case GF_AWAY_UNDEAD:
4492 /* Only affect undead */
4493 if (r_ptr->flags3 & (RF3_UNDEAD))
4495 bool resists_tele = FALSE;
4497 if (r_ptr->flagsr & RFR_RES_TELE)
4499 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4501 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4503 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4505 note = " is unaffected!";
4508 resists_tele = TRUE;
4510 else if (r_ptr->level > randint1(100))
4512 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4514 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4519 resists_tele = TRUE;
4528 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4541 /* No "real" damage */
4547 /* Teleport evil (Use "dam" as "power") */
4550 /* Only affect evil */
4551 if (r_ptr->flags3 & (RF3_EVIL))
4553 bool resists_tele = FALSE;
4555 if (r_ptr->flagsr & RFR_RES_TELE)
4557 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4559 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4561 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4563 note = " is unaffected!";
4566 resists_tele = TRUE;
4568 else if (r_ptr->level > randint1(100))
4570 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4572 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4577 resists_tele = TRUE;
4586 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4599 /* No "real" damage */
4605 /* Teleport monster (Use "dam" as "power") */
4608 bool resists_tele = FALSE;
4609 if (r_ptr->flagsr & RFR_RES_TELE)
4611 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4613 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4615 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4617 note = " is unaffected!";
4620 resists_tele = TRUE;
4622 else if (r_ptr->level > randint1(100))
4624 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4626 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4631 resists_tele = TRUE;
4638 if (seen) obvious = TRUE;
4640 /* Prepare to teleport */
4644 /* No "real" damage */
4650 /* Turn undead (Use "dam" as "power") */
4651 case GF_TURN_UNDEAD:
4653 if (r_ptr->flagsr & RFR_RES_ALL)
4658 /* Only affect undead */
4659 if (r_ptr->flags3 & (RF3_UNDEAD))
4663 /* Learn about type */
4664 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4670 /* Apply some fear */
4671 do_fear = damroll(3, (dam / 2)) + 1;
4673 /* Attempt a saving throw */
4674 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4676 /* No obvious effect */
4678 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4680 note = " is unaffected!";
4695 /* No "real" damage */
4701 /* Turn evil (Use "dam" as "power") */
4704 if (r_ptr->flagsr & RFR_RES_ALL)
4709 /* Only affect evil */
4710 if (r_ptr->flags3 & (RF3_EVIL))
4714 /* Learn about type */
4715 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4721 /* Apply some fear */
4722 do_fear = damroll(3, (dam / 2)) + 1;
4724 /* Attempt a saving throw */
4725 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4727 /* No obvious effect */
4729 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4731 note = " is unaffected!";
4746 /* No "real" damage */
4752 /* Turn monster (Use "dam" as "power") */
4755 if (r_ptr->flagsr & RFR_RES_ALL)
4761 if (seen) obvious = TRUE;
4763 /* Apply some fear */
4764 do_fear = damroll(3, (dam / 2)) + 1;
4766 /* Attempt a saving throw */
4767 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4768 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4769 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4771 /* No obvious effect */
4773 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4775 note = " is unaffected!";
4782 /* No "real" damage */
4789 case GF_DISP_UNDEAD:
4791 if (r_ptr->flagsr & RFR_RES_ALL)
4797 /* Only affect undead */
4798 if (r_ptr->flags3 & (RF3_UNDEAD))
4802 /* Learn about type */
4803 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4811 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4812 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4814 note = " shudders.";
4815 note_dies = " dissolves!";
4837 if (r_ptr->flagsr & RFR_RES_ALL)
4843 /* Only affect evil */
4844 if (r_ptr->flags3 & (RF3_EVIL))
4848 /* Learn about type */
4849 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4857 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4858 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4860 note = " shudders.";
4861 note_dies = " dissolves!";
4882 if (r_ptr->flagsr & RFR_RES_ALL)
4888 /* Only affect good */
4889 if (r_ptr->flags3 & (RF3_GOOD))
4893 /* Learn about type */
4894 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4902 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4903 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4905 note = " shudders.";
4906 note_dies = " dissolves!";
4925 case GF_DISP_LIVING:
4927 if (r_ptr->flagsr & RFR_RES_ALL)
4933 /* Only affect non-undead */
4934 if (monster_living(r_ptr))
4937 if (seen) obvious = TRUE;
4941 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4942 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4944 note = " shudders.";
4945 note_dies = " dissolves!";
4966 if (r_ptr->flagsr & RFR_RES_ALL)
4972 /* Only affect demons */
4973 if (r_ptr->flags3 & (RF3_DEMON))
4977 /* Learn about type */
4978 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4986 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4987 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4989 note = " shudders.";
4990 note_dies = " dissolves!";
5008 /* Dispel monster */
5011 if (r_ptr->flagsr & RFR_RES_ALL)
5018 if (seen) obvious = TRUE;
5022 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
5023 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
5025 note = " shudders.";
5026 note_dies = " dissolves!";
5036 if (seen) obvious = TRUE;
5038 if (r_ptr->flagsr & RFR_RES_ALL)
5041 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5043 note = " is immune.";
5046 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5050 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
5054 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£",m_name);
5056 msg_format("You draw psychic energy from %s.", m_name);
5059 (void)hp_player(dam);
5064 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5066 msg_format("%s is unaffected.", m_name);
5076 if (seen) obvious = TRUE;
5079 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5081 msg_format("You gaze intently at %s.", m_name);
5084 if (r_ptr->flagsr & RFR_RES_ALL)
5087 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5089 note = " is immune.";
5092 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5096 /* Attempt a saving throw */
5097 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5098 (r_ptr->flags3 & RF3_NO_CONF) ||
5099 (r_ptr->level > randint1((caster_lev*2 - 10) < 1 ? 1 : (caster_lev*2 - 10)) + 10))
5101 /* Memorize a flag */
5102 if (r_ptr->flags3 & (RF3_NO_CONF))
5104 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5107 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5109 note = "is unaffected!";
5116 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5117 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5119 msg_format("%^s is blasted by psionic energy.", m_name);
5120 note_dies = " collapses, a mindless husk.";
5123 do_conf = randint0(8) + 8;
5129 case GF_BRAIN_SMASH:
5131 if (seen) obvious = TRUE;
5134 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5136 msg_format("You gaze intently at %s.", m_name);
5139 if (r_ptr->flagsr & RFR_RES_ALL)
5142 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5144 note = " is immune.";
5147 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5151 /* Attempt a saving throw */
5152 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5153 (r_ptr->flags3 & RF3_NO_CONF) ||
5154 (r_ptr->level > randint1((caster_lev*2 - 10) < 1 ? 1 : (caster_lev*2 - 10)) + 10))
5156 /* Memorize a flag */
5157 if (r_ptr->flags3 & (RF3_NO_CONF))
5159 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5162 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5164 note = "is unaffected!";
5171 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5172 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5174 msg_format("%^s is blasted by psionic energy.", m_name);
5175 note_dies = " collapses, a mindless husk.";
5178 do_conf = randint0(8) + 8;
5179 do_stun = randint0(8) + 8;
5180 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5181 if (c_ptr->m_idx == p_ptr->riding)
5182 p_ptr->update |= (PU_BONUS);
5190 if (seen) obvious = TRUE;
5193 msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5195 msg_format("You point at %s and curses.", m_name);
5198 if (r_ptr->flagsr & RFR_RES_ALL)
5201 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5203 note = " is immune.";
5206 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5210 /* Attempt a saving throw */
5211 if (randint0(100 + caster_lev) < (r_ptr->level + 35))
5215 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5217 note = "is unaffected!";
5227 if (seen) obvious = TRUE;
5230 msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5232 msg_format("You point at %s and curses horribly.", m_name);
5235 if (r_ptr->flagsr & RFR_RES_ALL)
5238 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5240 note = " is immune.";
5243 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5247 /* Attempt a saving throw */
5248 if (randint0(100 + caster_lev) < (r_ptr->level + 35))
5252 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5254 note = "is unaffected!";
5264 if (seen) obvious = TRUE;
5267 msg_format("%s¤ò»Øº¹¤·¡¢¶²¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª",m_name);
5269 msg_format("You point at %s, incanting terribly!", m_name);
5272 if (r_ptr->flagsr & RFR_RES_ALL)
5275 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5277 note = " is immune.";
5280 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5284 /* Attempt a saving throw */
5285 if (randint0(100 + caster_lev) < (r_ptr->level + 35))
5289 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5291 note = "is unaffected!";
5301 if (seen) obvious = TRUE;
5304 msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£",m_name);
5306 msg_format("You point at %s, screaming th word, 'DIE!'.", m_name);
5309 if (r_ptr->flagsr & RFR_RES_ALL)
5312 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5314 note = " is immune.";
5317 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5321 /* Attempt a saving throw */
5322 if (randint0(100 + caster_lev) < (r_ptr->level + 35))
5326 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5328 note = "is unaffected!";
5338 if (seen) obvious = TRUE;
5340 if (r_ptr->flagsr & RFR_RES_ALL)
5343 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5345 note = " is immune.";
5348 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5352 if (r_ptr->flags1 & RF1_UNIQUE)
5355 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5357 note = "is unaffected!";
5363 if ((caster_lev + randint1(dam)) >
5364 (r_ptr->level + randint1(200)))
5366 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5368 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5373 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5383 /* Capture monster */
5387 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5388 (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_UNIQUE_7)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR))
5391 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5393 msg_format("%^s is unaffected.", m_name);
5399 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5400 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5401 nokori_hp = m_ptr->maxhp * 3 / 10;
5403 nokori_hp = m_ptr->maxhp * 3 / 20;
5405 if (m_ptr->hp >= nokori_hp)
5408 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5410 msg_format("You need to weaken %s more.", m_name);
5414 else if (m_ptr->hp < randint0(nokori_hp))
5416 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5418 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5420 msg_format("You capture %^s!", m_name);
5422 cap_mon = m_list[c_ptr->m_idx].r_idx;
5423 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5424 cap_hp = m_list[c_ptr->m_idx].hp;
5425 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5426 if (m_list[c_ptr->m_idx].nickname)
5427 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5430 if (c_ptr->m_idx == p_ptr->riding)
5432 if (rakuba(-1, FALSE))
5435 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5437 msg_format("You have fallen from %s.", m_name);
5442 delete_monster_idx(c_ptr->m_idx);
5449 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5451 msg_format("You failed to capture %s.", m_name);
5458 /* Attack (Use "dam" as attack type) */
5461 /* Return this monster's death */
5462 return py_attack(y, x, dam);
5465 /* Sleep (Use "dam" as "power") */
5471 if (seen) obvious = TRUE;
5473 if (r_ptr->flagsr & RFR_RES_ALL)
5476 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5478 note = " is immune.";
5481 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5484 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5487 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5489 note = " is immune!";
5493 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5499 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5501 note = " is immune!";
5508 if (one_in_(5)) effect = 1;
5509 else if (one_in_(4)) effect = 2;
5510 else if (one_in_(3)) effect = 3;
5515 /* Powerful monsters can resist */
5516 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5517 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5520 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5522 note = " is unaffected!";
5528 /* Normal monsters slow down */
5534 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5536 note = " starts moving slower.";
5539 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5541 if (c_ptr->m_idx == p_ptr->riding)
5542 p_ptr->update |= (PU_BONUS);
5546 else if (effect == 2)
5548 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5550 /* Attempt a saving throw */
5551 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5552 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5557 /* No obvious effect */
5559 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5561 note = " is unaffected!";
5568 else if (effect == 3)
5570 /* Attempt a saving throw */
5571 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5572 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5573 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5575 /* Memorize a flag */
5576 if (r_ptr->flags3 & RF3_NO_SLEEP)
5578 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5581 /* No obvious effect */
5583 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5585 note = " is unaffected!";
5592 /* Go to sleep (much) later */
5594 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5596 note = " falls asleep!";
5606 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5608 note = " is immune!";
5612 /* No "real" damage */
5621 if (seen) obvious = TRUE;
5623 if (r_ptr->flagsr & RFR_RES_ALL)
5626 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5628 note = " is immune.";
5631 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5635 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (c_ptr->m_idx == p_ptr->riding)) || p_ptr->inside_arena || p_ptr->inside_quest)
5642 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG2_NOGENO))
5649 delete_monster_idx(c_ptr->m_idx);
5651 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5653 msg_format("%^s disappered!",m_name);
5657 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5659 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5663 chg_virtue(V_VITALITY, -1);
5668 p_ptr->redraw |= (PR_HP);
5671 p_ptr->window |= (PW_PLAYER);
5678 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5680 note = "is unaffected!";
5683 if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
5691 msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£",m_name);
5693 msg_format("You take a photograph of %s.",m_name);
5696 if (r_ptr->flags3 & (RF3_HURT_LITE))
5700 /* Obvious effect */
5703 /* Memorize the effects */
5704 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5707 /* Special effect */
5709 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5710 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5712 note = " cringes from the light!";
5713 note_dies = " shrivels away in the light!";
5718 /* Normally no damage */
5725 photo = m_ptr->r_idx;
5732 case GF_BLOOD_CURSE:
5734 if (seen) obvious = TRUE;
5736 if (r_ptr->flagsr & RFR_RES_ALL)
5739 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5741 note = " is immune.";
5744 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5752 bool success = FALSE;
5753 if (seen) obvious = TRUE;
5755 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5757 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5758 if (dam < 1) dam = 1;
5760 /* No need to tame your pet */
5764 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5766 note = " starts moving faster.";
5769 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5773 /* Attempt a saving throw */
5774 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5775 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5776 (m_ptr->mflag2 & MFLAG2_NOPET) ||
5777 (p_ptr->cursed & TRC_AGGRAVATE) ||
5778 ((r_ptr->level+10) > randint1(dam)))
5781 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5786 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5788 note = " is tamed!";
5792 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5794 /* Learn about type */
5795 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5802 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5804 do_fear = randint1(90)+10;
5808 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5812 /* No "real" damage */
5819 if (seen) obvious = TRUE;
5821 if (r_ptr->flagsr & RFR_RES_ALL)
5824 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5826 note = " is immune.";
5829 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5833 /* Attempt a saving throw */
5834 if (randint0(100 + dam) < (r_ptr->level + 50))
5838 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5840 note = "is unaffected!";
5861 /* Absolutely no effect */
5862 if (skipped) return (FALSE);
5864 /* "Unique" monsters cannot be polymorphed */
5865 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5867 /* Quest monsters cannot be polymorphed */
5868 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5870 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5872 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5873 if (((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7) || (r_ptr->flags1 & RF1_QUESTOR)) && !p_ptr->inside_battle)
5875 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5880 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5881 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5884 /* Modify the damage */
5886 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5888 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤¡£";
5890 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5893 /* Check for death */
5894 if (dam > m_ptr->hp)
5896 /* Extract method of death */
5900 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5901 else if (do_poly && (randint1(90) > r_ptr->level))
5903 if (polymorph_monster(y, x))
5906 if (seen) obvious = TRUE;
5908 /* Monster polymorphs */
5910 note = "¤¬ÊѿȤ·¤¿¡ª";
5916 /* Turn off the damage */
5919 /* Hack -- Get new monster */
5920 m_ptr = &m_list[c_ptr->m_idx];
5922 /* Hack -- Get new race */
5923 r_ptr = &r_info[m_ptr->r_idx];
5929 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5931 note = " is unaffected!";
5937 /* Handle "teleport" */
5941 if (seen) obvious = TRUE;
5945 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5947 note = " disappears!";
5950 chg_virtue(V_VALOUR, -1);
5953 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who));
5955 /* Hack -- get new location */
5959 /* Hack -- get new grid */
5960 c_ptr = &cave[y][x];
5963 /* Sound and Impact resisters never stun */
5965 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5966 !(r_ptr->flags3 & RF3_NO_STUN))
5969 if (seen) obvious = TRUE;
5975 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5977 note = " is more dazed.";
5980 tmp = m_ptr->stunned + (do_stun / 2);
5985 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5987 note = " is dazed.";
5994 m_ptr->stunned = (tmp < 200) ? tmp : 200;
6000 /* Confusion and Chaos resisters (and sleepers) never confuse */
6002 !(r_ptr->flags3 & RF3_NO_CONF) &&
6003 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
6006 if (seen) obvious = TRUE;
6008 /* Already partially confused */
6009 if (m_ptr->confused)
6012 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
6014 note = " looks more confused.";
6017 tmp = m_ptr->confused + (do_conf / 2);
6020 /* Was not confused */
6024 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
6026 note = " looks confused.";
6032 /* Apply confusion */
6033 m_ptr->confused = (tmp < 200) ? tmp : 200;
6042 if (seen) obvious = TRUE;
6044 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
6049 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
6051 note = " seems weakened.";
6053 m_ptr->maxhp -= do_time;
6054 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
6064 tmp = m_ptr->monfear + do_fear;
6067 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6074 /* If another monster did the damage, hurt the monster by hand */
6077 /* Redraw (later) if needed */
6078 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6079 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6081 /* Wake the monster up */
6084 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
6086 /* Hurt the monster */
6094 if (is_pet(m_ptr) && !(m_ptr->ml))
6097 /* Give detailed messages if destroyed */
6100 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
6103 msg_format("%^s%s", m_name, note);
6111 monster_gain_exp(who, m_ptr->r_idx);
6113 /* Generate treasure, etc */
6114 monster_death(c_ptr->m_idx, FALSE);
6116 /* Delete the monster */
6117 delete_monster_idx(c_ptr->m_idx);
6122 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6124 msg_print("You feel sad for a moment.");
6130 /* Damaged monster */
6133 /* Give detailed messages if visible or destroyed */
6134 if (note && seen) msg_format("%^s%s", m_name, note);
6136 /* Hack -- Pain message */
6139 message_pain(c_ptr->m_idx, dam);
6146 /* Hack -- handle sleep */
6147 if (do_sleep) m_ptr->csleep = do_sleep;
6151 else if (heal_leper)
6154 msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6156 msg_print("The Mangy looking leper is healed!");
6159 delete_monster_idx(c_ptr->m_idx);
6161 /* If the player did it, give him experience, check fear */
6162 else if (typ != GF_DRAIN_MANA)
6166 /* Hurt the monster, check for fear and death */
6167 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6172 /* Damaged monster */
6175 /* HACK - anger the monster before showing the sleep message */
6176 if (do_sleep) anger_monster(m_ptr);
6178 /* Give detailed messages if visible or destroyed */
6181 msg_format("%s%s", m_name, note);
6183 msg_format("%^s%s", m_name, note);
6187 /* Hack -- Pain message */
6188 else if (known && (dam || !do_fear))
6190 message_pain(c_ptr->m_idx, dam);
6193 /* Anger monsters */
6194 if (((dam > 0) || get_angry) && !do_sleep)
6195 anger_monster(m_ptr);
6198 if ((fear || do_fear) && (m_ptr->ml))
6205 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6207 msg_format("%^s flees in terror!", m_name);
6212 /* Hack -- handle sleep */
6213 if (do_sleep) m_ptr->csleep = do_sleep;
6217 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6219 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6223 switch (randint1(28))
6229 msg_print("ÃÏÌ̤¬Íɤ줿...");
6231 msg_print("The ground trembles...");
6234 earthquake(ty, tx, 4 + randint0(4));
6235 if (!one_in_(6)) break;
6237 case 3: case 4: case 5: case 6:
6240 int dam = damroll(10, 10);
6242 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6244 msg_print("A portal opens to a plane of raw mana!");
6247 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6248 if (!one_in_(6)) break;
6254 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6256 msg_print("Space warps about you!");
6259 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE);
6260 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6261 if (!one_in_(6)) break;
6263 case 9: case 10: case 11:
6265 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6267 msg_print("You feel a surge of energy!");
6270 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6271 if (!one_in_(6)) break;
6272 case 12: case 13: case 14: case 15: case 16:
6273 aggravate_monsters(0);
6274 if (!one_in_(6)) break;
6276 count += activate_hi_summon(ty, tx, TRUE);
6277 if (!one_in_(6)) break;
6278 case 19: case 20: case 21: case 22:
6280 bool pet = !one_in_(3);
6281 u32b mode = PM_ALLOW_GROUP;
6283 if (pet) mode |= PM_FORCE_PET;
6284 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6286 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6287 if (!one_in_(6)) break;
6289 case 23: case 24: case 25:
6290 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6292 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6294 msg_print("You feel your life draining away...");
6297 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6298 else lose_exp(p_ptr->exp / 16);
6299 if (!one_in_(6)) break;
6300 case 26: case 27: case 28:
6309 (void)do_dec_stat(i);
6318 (void)do_dec_stat(randint0(6));
6327 if (p_ptr->inside_battle)
6329 p_ptr->health_who = c_ptr->m_idx;
6330 p_ptr->redraw |= (PR_HEALTH);
6334 /* XXX XXX XXX Verify this code */
6336 /* Update the monster */
6337 update_mon(c_ptr->m_idx, FALSE);
6339 /* Redraw the monster grid */
6343 /* Update monster recall window */
6344 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6347 p_ptr->window |= (PW_MONSTER);
6350 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6354 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6356 set_target(m_ptr, monster_target_y, monster_target_x);
6359 else if (is_pet(&m_list[who]) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6361 set_target(m_ptr, m_list[who].fy, m_list[who].fx);
6365 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6367 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6368 rakubadam_m = (dam > 200) ? 200 : dam;
6377 /* Get local object */
6380 /* Prepare to make a Blade of Chaos */
6381 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6383 q_ptr->pval = photo;
6385 /* Mark the item as fully known */
6386 q_ptr->ident |= (IDENT_MENTAL);
6388 /* Drop it in the dungeon */
6389 (void)drop_near(q_ptr, -1, py, px);
6397 /* Return "Anything seen?" */
6403 * Helper function for "project()" below.
6405 * Handle a beam/bolt/ball causing damage to the player.
6407 * This routine takes a "source monster" (by index), a "distance", a default
6408 * "damage", and a "damage type". See "project_m()" above.
6410 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6411 * is reduced (see "project_m()" above). This can happen if a monster breathes
6412 * at the player and hits a wall instead.
6414 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6415 * to know if this is actually a ball or a bolt spell
6418 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6419 * we just assume that the effects were obvious, for historical reasons.
6421 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6426 /* Hack -- assume obvious */
6427 bool obvious = TRUE;
6429 /* Player blind-ness */
6430 bool blind = (p_ptr->blind ? TRUE : FALSE);
6432 /* Player needs a "description" (he is blind) */
6435 /* Source monster */
6436 monster_type *m_ptr = NULL;
6438 /* Monster name (for attacks) */
6441 /* Monster name (for damage) */
6444 /* Hack -- messages */
6450 /* Player is not here */
6451 if (!player_bold(y, x)) return (FALSE);
6453 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6459 /* Player cannot hurt himself */
6460 if (!who) return (FALSE);
6461 if (who == p_ptr->riding) return (FALSE);
6463 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6466 int max_attempts = 10;
6469 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6470 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6471 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6473 if (blind) msg_print("Something bounces!");
6474 else msg_print("The attack bounces!");
6478 /* Choose 'new' target */
6481 t_y = m_list[who].fy - 1 + randint1(3);
6482 t_x = m_list[who].fx - 1 + randint1(3);
6485 while (max_attempts && in_bounds2u(t_y, t_x) &&
6486 !(player_has_los_bold(t_y, t_x)));
6488 if (max_attempts < 1)
6490 t_y = m_list[who].fy;
6491 t_x = m_list[who].fx;
6494 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6501 /* Limit maximum damage */
6502 if (dam > 1600) dam = 1600;
6504 /* Reduce damage by distance */
6505 dam = (dam + r) / (r + 1);
6508 /* If the player is blind, be more descriptive */
6509 if (blind) fuzzy = TRUE;
6514 /* Get the source monster */
6515 m_ptr = &m_list[who];
6516 /* Extract the monster level */
6517 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6519 /* Get the monster name */
6520 monster_desc(m_name, m_ptr, 0);
6522 /* Get the monster's real name (gotten before polymorph!) */
6523 strcpy(killer, who_name);
6528 strcpy(killer, "æ«");
6530 strcpy(killer, "a trap");
6534 /* Analyze the damage */
6537 /* Standard damage -- hurts inventory too */
6541 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6543 if (fuzzy) msg_print("You are hit by acid!");
6546 get_damage = acid_dam(dam, killer, monspell);
6550 /* Standard damage -- hurts inventory too */
6554 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6556 if (fuzzy) msg_print("You are hit by fire!");
6559 get_damage = fire_dam(dam, killer, monspell);
6563 /* Standard damage -- hurts inventory too */
6567 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6569 if (fuzzy) msg_print("You are hit by cold!");
6572 get_damage = cold_dam(dam, killer, monspell);
6576 /* Standard damage -- hurts inventory too */
6580 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6582 if (fuzzy) msg_print("You are hit by lightning!");
6585 get_damage = elec_dam(dam, killer, monspell);
6589 /* Standard damage -- also poisons player */
6592 bool double_resist = IS_OPPOSE_POIS();
6594 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6596 if (fuzzy) msg_print("You are hit by poison!");
6599 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6600 if (double_resist) dam = (dam + 2) / 3;
6602 if ((!(double_resist || p_ptr->resist_pois)) &&
6603 one_in_(HURT_CHANCE))
6608 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6610 if (!(double_resist || p_ptr->resist_pois))
6612 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6617 /* Standard damage -- also poisons / mutates player */
6620 bool double_resist = IS_OPPOSE_POIS();
6622 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6624 if (fuzzy) msg_print("You are hit by radiation!");
6627 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6628 if (double_resist) dam = (2 * dam + 2) / 5;
6629 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6630 if (!(double_resist || p_ptr->resist_pois))
6632 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6634 if (one_in_(5)) /* 6 */
6637 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6639 msg_print("You undergo a freakish metamorphosis!");
6642 if (one_in_(4)) /* 4 */
6650 inven_damage(set_acid_destroy, 2);
6656 /* Standard damage */
6660 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6662 if (fuzzy) msg_print("You are hit by something!");
6665 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6669 /* Holy Orb -- Player only takes partial damage */
6673 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6675 if (fuzzy) msg_print("You are hit by something!");
6678 if (p_ptr->align > 10)
6680 else if (p_ptr->align < -10)
6682 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6689 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6691 if (fuzzy) msg_print("You are hit by something!");
6694 if (p_ptr->align > 10)
6696 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6700 /* Arrow -- XXX no dodging */
6704 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6706 if (fuzzy) msg_print("You are hit by something sharp!");
6709 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6712 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6714 msg_print("You cut down the arrow!");
6718 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6722 /* Plasma -- XXX No resist */
6726 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6728 if (fuzzy) msg_print("You are hit by something *HOT*!");
6731 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6733 if (!p_ptr->resist_sound)
6735 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6736 (void)set_stun(p_ptr->stun + k);
6739 if (!(p_ptr->resist_fire ||
6741 p_ptr->immune_fire))
6743 inven_damage(set_acid_destroy, 3);
6749 /* Nether -- drain experience */
6753 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6755 if (fuzzy) msg_print("You are hit by nether forces!");
6759 if (p_ptr->resist_neth)
6761 if (!prace_is_(RACE_SPECTRE))
6762 dam *= 6; dam /= (randint1(4) + 7);
6764 else drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
6766 if (prace_is_(RACE_SPECTRE))
6769 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6771 msg_print("You feel invigorated!");
6775 learn_spell(monspell);
6779 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6785 /* Water -- stun/confuse */
6789 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6791 if (fuzzy) msg_print("You are hit by something wet!");
6794 if (!p_ptr->resist_sound)
6796 set_stun(p_ptr->stun + randint1(40));
6798 if (!p_ptr->resist_conf)
6800 set_confused(p_ptr->confused + randint1(5) + 5);
6805 inven_damage(set_cold_destroy, 3);
6808 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6812 /* Chaos -- many effects */
6816 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6818 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6821 if (p_ptr->resist_chaos)
6823 dam *= 6; dam /= (randint1(4) + 7);
6825 if (!p_ptr->resist_conf)
6827 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6829 if (!p_ptr->resist_chaos)
6831 (void)set_image(p_ptr->image + randint1(10));
6835 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6837 msg_print("Your body is twisted by chaos!");
6840 (void)gain_random_mutation(0);
6843 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6845 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
6847 if (!p_ptr->resist_chaos || one_in_(9))
6849 inven_damage(set_elec_destroy, 2);
6850 inven_damage(set_fire_destroy, 2);
6852 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6856 /* Shards -- mostly cutting */
6860 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6862 if (fuzzy) msg_print("You are hit by something sharp!");
6865 if (p_ptr->resist_shard)
6867 dam *= 6; dam /= (randint1(4) + 7);
6871 (void)set_cut(p_ptr->cut + dam);
6874 if (!p_ptr->resist_shard || one_in_(13))
6876 inven_damage(set_cold_destroy, 2);
6879 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6883 /* Sound -- mostly stunning */
6887 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6889 if (fuzzy) msg_print("You are hit by a loud noise!");
6892 if (p_ptr->resist_sound)
6894 dam *= 5; dam /= (randint1(4) + 7);
6898 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6899 (void)set_stun(p_ptr->stun + k);
6902 if (!p_ptr->resist_sound || one_in_(13))
6904 inven_damage(set_cold_destroy, 2);
6907 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6911 /* Pure confusion */
6915 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6917 if (fuzzy) msg_print("You are hit by something puzzling!");
6920 if (p_ptr->resist_conf)
6922 dam *= 5; dam /= (randint1(4) + 7);
6924 if (!p_ptr->resist_conf)
6926 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6928 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6932 /* Disenchantment -- see above */
6936 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6938 if (fuzzy) msg_print("You are hit by something static!");
6941 if (p_ptr->resist_disen)
6943 dam *= 6; dam /= (randint1(4) + 7);
6947 (void)apply_disenchant(0);
6949 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6953 /* Nexus -- see above */
6957 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6959 if (fuzzy) msg_print("You are hit by something strange!");
6962 if (p_ptr->resist_nexus)
6964 dam *= 6; dam /= (randint1(4) + 7);
6970 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6974 /* Force -- mostly stun */
6978 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6980 if (fuzzy) msg_print("You are hit by kinetic force!");
6983 if (!p_ptr->resist_sound)
6985 (void)set_stun(p_ptr->stun + randint1(20));
6987 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6992 /* Rocket -- stun, cut */
6996 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
6998 if (fuzzy) msg_print("There is an explosion!");
7001 if (!p_ptr->resist_sound)
7003 (void)set_stun(p_ptr->stun + randint1(20));
7005 if (p_ptr->resist_shard)
7011 (void)set_cut(p_ptr-> cut + ( dam / 2));
7014 if ((!p_ptr->resist_shard) || one_in_(12))
7016 inven_damage(set_cold_destroy, 3);
7019 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7023 /* Inertia -- slowness */
7027 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7029 if (fuzzy) msg_print("You are hit by something slow!");
7032 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7033 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7037 /* Lite -- blinding */
7041 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7043 if (fuzzy) msg_print("You are hit by something!");
7046 if (p_ptr->resist_lite)
7048 dam *= 4; dam /= (randint1(4) + 7);
7050 else if (!blind && !p_ptr->resist_blind)
7052 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7054 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
7057 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
7059 msg_print("The light scorches your flesh!");
7064 else if (prace_is_(RACE_S_FAIRY))
7068 if (p_ptr->wraith_form) dam *= 2;
7069 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7071 if (p_ptr->wraith_form)
7073 p_ptr->wraith_form = 0;
7075 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7077 msg_print("The light forces you out of your incorporeal shadow form.");
7080 p_ptr->redraw |= PR_MAP;
7081 /* Update monsters */
7082 p_ptr->update |= (PU_MONSTERS);
7084 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7086 /* Redraw status bar */
7087 p_ptr->redraw |= (PR_STATUS);
7094 /* Dark -- blinding */
7098 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7100 if (fuzzy) msg_print("You are hit by something!");
7103 if (p_ptr->resist_dark)
7105 dam *= 4; dam /= (randint1(4) + 7);
7107 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7109 else if (!blind && !p_ptr->resist_blind)
7111 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7113 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7117 /* Time -- bolt fewer effects XXX */
7121 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7123 if (fuzzy) msg_print("You are hit by a blast from the past!");
7126 if (p_ptr->resist_time)
7129 dam /= (randint1(4) + 7);
7131 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7133 msg_print("You feel as if time is passing you by.");
7139 switch (randint1(10))
7141 case 1: case 2: case 3: case 4: case 5:
7143 if (p_ptr->prace == RACE_ANDROID) break;
7145 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7147 msg_print("You feel life has clocked back.");
7150 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7154 case 6: case 7: case 8: case 9:
7156 switch (randint1(6))
7159 case 1: k = A_STR; act = "¶¯¤¯"; break;
7160 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7161 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7162 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7163 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7164 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7166 case 1: k = A_STR; act = "strong"; break;
7167 case 2: k = A_INT; act = "bright"; break;
7168 case 3: k = A_WIS; act = "wise"; break;
7169 case 4: k = A_DEX; act = "agile"; break;
7170 case 5: k = A_CON; act = "hale"; break;
7171 case 6: k = A_CHR; act = "beautiful"; break;
7177 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7179 msg_format("You're not as %s as you used to be...", act);
7183 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7184 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7185 p_ptr->update |= (PU_BONUS);
7192 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7194 msg_print("You're not as powerful as you used to be...");
7198 for (k = 0; k < 6; k++)
7200 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7201 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7203 p_ptr->update |= (PU_BONUS);
7209 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7213 /* Gravity -- stun plus slowness plus teleport */
7217 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7218 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7220 if (fuzzy) msg_print("You are hit by something heavy!");
7221 msg_print("Gravity warps around you.");
7226 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7227 if (!(p_ptr->resist_sound || p_ptr->ffall))
7229 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7230 (void)set_stun(p_ptr->stun + k);
7234 dam = (dam * 2) / 3;
7237 if (!p_ptr->ffall || one_in_(13))
7239 inven_damage(set_cold_destroy, 2);
7242 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7246 /* Standard damage */
7247 case GF_DISINTEGRATE:
7250 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7252 if (fuzzy) msg_print("You are hit by pure energy!");
7255 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7262 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7264 if (fuzzy) msg_print("You are hit by something invigorating!");
7267 (void)hp_player(dam);
7275 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7277 if (fuzzy) msg_print("You are hit by something!");
7280 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7288 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7290 if (fuzzy) msg_print("You are hit by something slow!");
7293 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7299 if (p_ptr->free_act) break;
7301 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7303 if (fuzzy) msg_print("You fall asleep!");
7307 if (ironman_nightmare)
7310 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7312 msg_print("A horrible vision enters your mind.");
7316 /* Pick a nightmare */
7317 get_mon_num_prep(get_nightmare, NULL);
7319 /* Have some nightmares */
7320 have_nightmare(get_mon_num(MAX_DEPTH));
7322 /* Remove the monster restriction */
7323 get_mon_num_prep(NULL, NULL);
7326 set_paralyzed(p_ptr->paralyzed + dam);
7337 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7339 if (fuzzy) msg_print("You are hit by an aura of magic!");
7342 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7350 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7352 if (fuzzy) msg_print("You are hit by an energy!");
7355 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7363 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7365 if (fuzzy) msg_print("Something falls from the sky on you!");
7368 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7369 if (!p_ptr->resist_shard || one_in_(13))
7371 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7372 inven_damage(set_cold_destroy, 2);
7378 /* Ice -- cold plus stun plus cuts */
7382 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7384 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7387 cold_dam(dam, killer, monspell);
7388 if (!p_ptr->resist_shard)
7390 (void)set_cut(p_ptr->cut + damroll(5, 8));
7392 if (!p_ptr->resist_sound)
7394 (void)set_stun(p_ptr->stun + randint1(15));
7397 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
7399 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7409 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7411 if (fuzzy) msg_print("You are hit by something extremely cold!");
7415 if (p_ptr->mimic_form)
7417 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7418 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7423 switch (p_ptr->prace)
7425 /* Some races are immune */
7439 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7451 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7454 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7456 msg_print("You resist the effects!");
7458 learn_spell(MS_MIND_BLAST);
7463 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7465 msg_print("Your mind is blasted by psyonic energy.");
7468 if (!p_ptr->resist_conf)
7470 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7473 if (!p_ptr->resist_chaos && one_in_(3))
7475 (void)set_image(p_ptr->image + randint0(250) + 150);
7482 p_ptr->csp_frac = 0;
7484 p_ptr->redraw |= PR_MANA;
7486 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_MIND_BLAST);
7491 case GF_BRAIN_SMASH:
7493 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7496 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7498 msg_print("You resist the effects!");
7500 learn_spell(MS_BRAIN_SMASH);
7505 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7507 msg_print("Your mind is blasted by psionic energy.");
7514 p_ptr->csp_frac = 0;
7516 p_ptr->redraw |= PR_MANA;
7518 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_BRAIN_SMASH);
7519 if (!p_ptr->resist_blind)
7521 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7523 if (!p_ptr->resist_conf)
7525 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7527 if (!p_ptr->free_act)
7529 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7531 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7533 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7534 (void)do_dec_stat(A_INT);
7535 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7536 (void)do_dec_stat(A_WIS);
7538 if (!p_ptr->resist_chaos)
7540 (void)set_image(p_ptr->image + randint0(250) + 150);
7548 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7551 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7553 msg_print("You resist the effects!");
7555 learn_spell(MS_CAUSE_1);
7559 curse_equipment(15, 0);
7560 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_1);
7567 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7570 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7572 msg_print("You resist the effects!");
7574 learn_spell(MS_CAUSE_2);
7578 curse_equipment(25, MIN(rlev/2-15, 5));
7579 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_2);
7586 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7589 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7591 msg_print("You resist the effects!");
7593 learn_spell(MS_CAUSE_3);
7597 curse_equipment(33, MIN(rlev/2-15, 15));
7598 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_3);
7605 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7608 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7610 msg_print("You resist the effects!");
7612 learn_spell(MS_CAUSE_4);
7616 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_4);
7617 (void)set_cut(p_ptr->cut + damroll(10, 10));
7624 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7627 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7629 msg_format("You resist the effects!");
7631 learn_spell(MS_HAND_DOOM);
7637 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7639 msg_print("Your feel your life fade away!");
7642 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, MS_HAND_DOOM);
7643 curse_equipment(40, 20);
7645 if (p_ptr->chp < 1) p_ptr->chp = 1;
7660 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7663 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7665 char m_name_self[80];
7668 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
7670 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7672 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7673 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7676 if (p_ptr->riding && dam > 0)
7678 rakubadam_p = (dam > 200) ? 200 : dam;
7686 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7692 /* Return "Anything seen?" */
7698 * Find the distance from (x, y) to a line.
7700 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7702 /* Vector from (x, y) to (x1, y1) */
7711 int pd = distance(y1, x1, y, x);
7712 int nd = distance(y1, x1, y2, x2);
7714 if (pd > nd) return distance(y, x, y2, x2);
7716 /* Component of P on N */
7717 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7719 /* Absolute value */
7720 return((nd >= 0) ? nd : 0 - nd);
7727 * Modified version of los() for calculation of disintegration balls.
7728 * Disintegration effects are stopped by permanent walls.
7730 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7750 /* Slope, or 1/Slope, of LOS */
7754 /* Extract the offset */
7758 /* Extract the absolute offset */
7763 /* Handle adjacent (or identical) grids */
7764 if ((ax < 2) && (ay < 2)) return (TRUE);
7767 /* Paranoia -- require "safe" origin */
7768 /* if (!in_bounds(y1, x1)) return (FALSE); */
7771 /* Directly South/North */
7774 /* South -- check for walls */
7777 for (ty = y1 + 1; ty < y2; ty++)
7779 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7783 /* North -- check for walls */
7786 for (ty = y1 - 1; ty > y2; ty--)
7788 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7796 /* Directly East/West */
7799 /* East -- check for walls */
7802 for (tx = x1 + 1; tx < x2; tx++)
7804 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7808 /* West -- check for walls */
7811 for (tx = x1 - 1; tx > x2; tx--)
7813 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7822 /* Extract some signs */
7823 sx = (dx < 0) ? -1 : 1;
7824 sy = (dy < 0) ? -1 : 1;
7827 /* Vertical "knights" */
7832 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7836 /* Horizontal "knights" */
7841 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7846 /* Calculate scale factor div 2 */
7849 /* Calculate scale factor */
7853 /* Travel horizontally */
7856 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7862 /* Consider the special case where slope == 1. */
7873 /* Note (below) the case (qy == f2), where */
7874 /* the LOS exactly meets the corner of a tile. */
7877 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7888 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7901 /* Travel vertically */
7904 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7920 /* Note (below) the case (qx == f2), where */
7921 /* the LOS exactly meets the corner of a tile. */
7924 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7935 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7954 * Do disintegration effect on the terrain
7955 * before we decide the region of the effect.
7957 static bool do_disintegration(int by, int bx, int y, int x)
7961 /* Disintegration balls explosions are stopped by perma-walls */
7962 if (!in_disintegration_range(by, bx, y, x)) return FALSE;
7964 /* Permanent walls and artifacts don't get effect */
7965 /* But not protect monsters and other objects */
7966 if (!cave_valid_bold(y, x)) return TRUE;
7968 /* Destroy mirror/glyph */
7971 feat = cave[y][x].feat;
7973 if ((feat < FEAT_PATTERN_START || feat > FEAT_PATTERN_XTRA2) &&
7974 (feat < FEAT_DEEP_WATER || feat > FEAT_GRASS))
7976 if (feat == FEAT_TREES || feat == FEAT_FLOWER || feat == FEAT_DEEP_GRASS)
7977 cave_set_feat(y, x, FEAT_GRASS);
7979 cave_set_feat(y, x, floor_type[randint0(100)]);
7982 /* Update some things -- similar to GF_KILL_WALL */
7983 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
7992 void breath_shape(u16b *path_g, int dist, int *pgrids, byte *gx, byte *gy, byte *gm, int *pgm_rad, int rad, int y1, int x1, int y2, int x2, bool disint_ball, bool real_breath)
7997 int brev = rad * rad / dist;
8001 int tdis = distance(y1, x1, y2, x2);
8002 int mdis = tdis + rad;
8004 while (bdis <= mdis)
8008 if ((0 < dist) && (path_n < dist))
8010 int ny = GRID_Y(path_g[path_n]);
8011 int nx = GRID_X(path_g[path_n]);
8012 int nd = distance(ny, nx, y1, x1);
8014 /* Get next base point */
8023 /* Travel from center outward */
8024 for (cdis = 0; cdis <= brad; cdis++)
8026 /* Scan the maximal blast area of radius "cdis" */
8027 for (y = by - cdis; y <= by + cdis; y++)
8029 for (x = bx - cdis; x <= bx + cdis; x++)
8031 /* Ignore "illegal" locations */
8032 if (!in_bounds(y, x)) continue;
8034 /* Enforce a circular "ripple" */
8035 if (distance(y1, x1, y, x) != bdis) continue;
8037 /* Enforce an arc */
8038 if (distance(by, bx, y, x) != cdis) continue;
8043 /* Disintegration are stopped only by perma-walls */
8046 /* Destroy terrains */
8047 if (!do_disintegration(by, bx, y, x)) continue;
8051 /* No actual disintegration */
8052 if (!in_disintegration_range(by, bx, y, x)) continue;
8057 /* The blast is stopped by walls */
8058 if (!los(by, bx, y, x)) continue;
8061 /* Save this grid */
8069 /* Encode some more "radius" info */
8070 gm[bdis + 1] = *pgrids;
8072 /* Increase the size */
8073 brad = rad * (path_n + brev) / (dist + brev);
8075 /* Find the next ripple */
8079 /* Store the effect size */
8085 * Generic "beam"/"bolt"/"ball" projection routine.
8088 * who: Index of "source" monster (zero for "player")
8089 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8090 * y,x: Target location (or location to travel "towards")
8091 * dam: Base damage roll to apply to affected monsters (or player)
8092 * typ: Type of damage to apply to monsters (and objects)
8093 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8096 * TRUE if any "effects" of the projection were observed, else FALSE
8098 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8099 * towards a given location (optionally passing over the heads of interposing
8100 * monsters), and have it do a given amount of damage to the monsters (and
8101 * optionally objects) within the given radius of the final location.
8103 * A "bolt" travels from source to target and affects only the target grid.
8104 * A "beam" travels from source to target, affecting all grids passed through.
8105 * A "ball" travels from source to the target, exploding at the target, and
8106 * affecting everything within the given radius of the target location.
8108 * Traditionally, a "bolt" does not affect anything on the ground, and does
8109 * not pass over the heads of interposing monsters, much like a traditional
8110 * missile, and will "stop" abruptly at the "target" even if no monster is
8111 * positioned there, while a "ball", on the other hand, passes over the heads
8112 * of monsters between the source and target, and affects everything except
8113 * the source monster which lies within the final radius, while a "beam"
8114 * affects every monster between the source and target, except for the casting
8115 * monster (or player), and rarely affects things on the ground.
8117 * Two special flags allow us to use this function in special ways, the
8118 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8119 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8120 * actually projecting from the source monster (or player).
8122 * The player will only get "experience" for monsters killed by himself
8123 * Unique monsters can only be destroyed by attacks from the player
8125 * Only 256 grids can be affected per projection, limiting the effective
8126 * "radius" of standard ball attacks to nine units (diameter nineteen).
8128 * One can project in a given "direction" by combining PROJECT_THRU with small
8129 * offsets to the initial location (see "line_spell()"), or by calculating
8130 * "virtual targets" far away from the player.
8132 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8133 * continuing until it actually hits somethings (useful for "stone to mud").
8135 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8137 * Balls must explode BEFORE hitting walls, or they would affect monsters
8138 * on both sides of a wall. Some bug reports indicate that this is still
8139 * happening in 2.7.8 for Windows, though it appears to be impossible.
8141 * We "pre-calculate" the blast area only in part for efficiency.
8142 * More importantly, this lets us do "explosions" from the "inside" out.
8143 * This results in a more logical distribution of "blast" treasure.
8144 * It also produces a better (in my opinion) animation of the explosion.
8145 * It could be (but is not) used to have the treasure dropped by monsters
8146 * in the middle of the explosion fall "outwards", and then be damaged by
8147 * the blast as it spreads outwards towards the treasure drop location.
8149 * Walls and doors are included in the blast area, so that they can be
8150 * "burned" or "melted" in later versions.
8152 * This algorithm is intended to maximize simplicity, not necessarily
8153 * efficiency, since this function is not a bottleneck in the code.
8155 * We apply the blast effect from ground zero outwards, in several passes,
8156 * first affecting features, then objects, then monsters, then the player.
8157 * This allows walls to be removed before checking the object or monster
8158 * in the wall, and protects objects which are dropped by monsters killed
8159 * in the blast, and allows the player to see all affects before he is
8160 * killed or teleported away. The semantics of this method are open to
8161 * various interpretations, but they seem to work well in practice.
8163 * We process the blast area from ground-zero outwards to allow for better
8164 * distribution of treasure dropped by monsters, and because it provides a
8165 * pleasing visual effect at low cost.
8167 * Note that the damage done by "ball" explosions decreases with distance.
8168 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8170 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8171 * the target, and then the damage "flows" along this beam of destruction.
8172 * The damage at every grid is the same as at the "center" of a "ball"
8173 * explosion, since the "beam" grids are treated as if they ARE at the
8174 * center of a "ball" explosion.
8176 * Currently, specifying "beam" plus "ball" means that locations which are
8177 * covered by the initial "beam", and also covered by the final "ball", except
8178 * for the final grid (the epicenter of the ball), will be "hit twice", once
8179 * by the initial beam, and once by the exploding ball. For the grid right
8180 * next to the epicenter, this results in 150% damage being done. The center
8181 * does not have this problem, for the same reason the final grid in a "beam"
8182 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8183 * grids which are covered by the "ball" will NOT work, as then they will
8184 * receive LESS damage than they should. Do not combine "beam" with "ball".
8186 * The array "gy[],gx[]" with current size "grids" is used to hold the
8187 * collected locations of all grids in the "blast area" plus "beam path".
8189 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8190 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8191 * first blast grid (see above) with radius "N" from the blast center. Note
8192 * that only the first gm[1] grids in the blast area thus take full damage.
8193 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8194 * number of blast grids.
8196 * Note that once the projection is complete, (y2,x2) holds the final location
8197 * of bolts/beams, and the "epicenter" of balls.
8199 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8200 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8201 * implementation of the "distance" function. Also, a bolt can be properly
8202 * viewed as a "ball" with a "rad" of "zero".
8204 * Note that if no "target" is reached before the beam/bolt/ball travels the
8205 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8206 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8208 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8209 * to move from point A to point B, even if the player cannot see part of the
8210 * projection path. Note that in general, the player will *always* see part
8211 * of the path, since it either starts at the player or ends on the player.
8213 * Hack -- we assume that every "projection" is "self-illuminating".
8215 * Hack -- when only a single monster is affected, we automatically track
8216 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8218 * Note that all projections now "explode" at their final destination, even
8219 * if they were being projected at a more distant destination. This means
8220 * that "ball" spells will *always* explode.
8222 * Note that we must call "handle_stuff()" after affecting terrain features
8223 * in the blast radius, in case the "illumination" of the grid was changed,
8224 * and "update_view()" and "update_monsters()" need to be called.
8226 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8236 int y_saver, x_saver; /* For reflecting monsters */
8238 int msec = delay_factor * delay_factor * delay_factor;
8240 /* Assume the player sees nothing */
8241 bool notice = FALSE;
8243 /* Assume the player has seen nothing */
8244 bool visual = FALSE;
8246 /* Assume the player has seen no blast grids */
8249 /* Assume to be a normal ball spell */
8250 bool breath = FALSE;
8252 /* Is the player blind? */
8253 bool blind = (p_ptr->blind ? TRUE : FALSE);
8255 bool old_hide = FALSE;
8257 /* Number of grids in the "path" */
8260 /* Actual grids in the "path" */
8263 /* Number of grids in the "blast area" (including the "beam" path) */
8266 /* Coordinates of the affected grids */
8267 byte gx[1024], gy[1024];
8269 /* Encoded "radius" info (see above) */
8272 /* Actual radius encoded in gm[] */
8277 /* Attacker's name (prepared before polymorph)*/
8280 /* Initialize by null string */
8286 /* Default target of monsterspell is player */
8287 monster_target_y=py;
8288 monster_target_x=px;
8290 /* Initialize with nul string */
8293 /* Hack -- Jump to target */
8294 if (flg & (PROJECT_JUMP))
8299 /* Clear the flag */
8300 flg &= ~(PROJECT_JUMP);
8305 /* Start at player */
8312 /* Start at monster */
8315 x1 = m_list[who].fx;
8316 y1 = m_list[who].fy;
8317 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8330 /* Default "destination" */
8335 /* Hack -- verify stuff */
8336 if (flg & (PROJECT_THRU))
8338 if ((x1 == x2) && (y1 == y2))
8340 flg &= ~(PROJECT_THRU);
8344 /* Handle a breath attack */
8349 if (flg & PROJECT_HIDE) old_hide = TRUE;
8350 flg |= PROJECT_HIDE;
8354 /* Hack -- Assume there will be no blast (max radius 32) */
8355 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8363 /* Collect beam grids */
8364 if (flg & (PROJECT_BEAM))
8371 if (breath && typ == GF_DISINTEGRATE)
8373 flg |= (PROJECT_DISI);
8376 /* Calculate the projection path */
8378 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8380 /* Hack -- Handle stuff */
8383 /* Giga-Hack SEEKER & SUPER_RAY */
8385 if( typ == GF_SEEKER )
8395 for (i = 0; i < path_n; ++i)
8400 int ny = GRID_Y(path_g[i]);
8401 int nx = GRID_X(path_g[i]);
8412 /* Only do visuals if requested */
8413 if (!blind && !(flg & (PROJECT_HIDE)))
8415 /* Only do visuals if the player can "see" the bolt */
8416 if (panel_contains(y, x) && player_has_los_bold(y, x))
8423 /* Obtain the bolt pict */
8424 p = bolt_pict(oy, ox, y, x, typ);
8426 /* Extract attr/char */
8430 /* Visual effects */
8431 print_rel(c, a, y, x);
8432 move_cursor_relative(y, x);
8433 /*if (fresh_before)*/ Term_fresh();
8434 Term_xtra(TERM_XTRA_DELAY, msec);
8436 /*if (fresh_before)*/ Term_fresh();
8438 /* Display "beam" grids */
8439 if (flg & (PROJECT_BEAM))
8441 /* Obtain the explosion pict */
8442 p = bolt_pict(y, x, y, x, typ);
8444 /* Extract attr/char */
8448 /* Visual effects */
8449 print_rel(c, a, y, x);
8452 /* Hack -- Activate delay */
8456 /* Hack -- delay anyway for consistency */
8459 /* Delay for consistency */
8460 Term_xtra(TERM_XTRA_DELAY, msec);
8463 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8464 if( is_mirror_grid(&cave[y][x]))
8466 /* The target of monsterspell becomes tha mirror(broken) */
8467 monster_target_y=(s16b)y;
8468 monster_target_x=(s16b)x;
8471 next_mirror( &oy,&ox,y,x );
8473 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8474 for( j = last_i; j <=i ; j++ )
8476 y = GRID_Y(path_g[j]);
8477 x = GRID_X(path_g[j]);
8478 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8479 if(!who && (project_m_n==1) && !jump ){
8480 if(cave[project_m_y][project_m_x].m_idx >0 ){
8481 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8483 /* Hack -- auto-recall */
8484 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8486 /* Hack - auto-track */
8487 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8490 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8495 for( i = last_i ; i < path_n ; i++ )
8498 y = GRID_Y(path_g[i]);
8499 x = GRID_X(path_g[i]);
8500 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8502 if(!who && (project_m_n==1) && !jump ){
8503 if(cave[project_m_y][project_m_x].m_idx >0 ){
8504 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8506 /* Hack -- auto-recall */
8507 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8509 /* Hack - auto-track */
8510 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8513 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8517 else if(typ == GF_SUPER_RAY){
8519 int second_step = 0;
8526 for (i = 0; i < path_n; ++i)
8531 int ny = GRID_Y(path_g[i]);
8532 int nx = GRID_X(path_g[i]);
8543 /* Only do visuals if requested */
8544 if (!blind && !(flg & (PROJECT_HIDE)))
8546 /* Only do visuals if the player can "see" the bolt */
8547 if (panel_contains(y, x) && player_has_los_bold(y, x))
8554 /* Obtain the bolt pict */
8555 p = bolt_pict(oy, ox, y, x, typ);
8557 /* Extract attr/char */
8561 /* Visual effects */
8562 print_rel(c, a, y, x);
8563 move_cursor_relative(y, x);
8564 /*if (fresh_before)*/ Term_fresh();
8565 Term_xtra(TERM_XTRA_DELAY, msec);
8567 /*if (fresh_before)*/ Term_fresh();
8569 /* Display "beam" grids */
8570 if (flg & (PROJECT_BEAM))
8572 /* Obtain the explosion pict */
8573 p = bolt_pict(y, x, y, x, typ);
8575 /* Extract attr/char */
8579 /* Visual effects */
8580 print_rel(c, a, y, x);
8583 /* Hack -- Activate delay */
8587 /* Hack -- delay anyway for consistency */
8590 /* Delay for consistency */
8591 Term_xtra(TERM_XTRA_DELAY, msec);
8594 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8595 if( cave[y][x].feat == FEAT_RUBBLE ||
8596 cave[y][x].feat == FEAT_DOOR_HEAD ||
8597 cave[y][x].feat == FEAT_DOOR_TAIL ||
8598 (cave[y][x].feat >= FEAT_WALL_EXTRA &&
8599 cave[y][x].feat <= FEAT_PERM_SOLID ))
8601 if( second_step )continue;
8604 if( is_mirror_grid(&cave[y][x]) && !second_step )
8606 /* The target of monsterspell becomes tha mirror(broken) */
8607 monster_target_y=(s16b)y;
8608 monster_target_x=(s16b)x;
8611 for( j = 0; j <=i ; j++ )
8613 y = GRID_Y(path_g[j]);
8614 x = GRID_X(path_g[j]);
8615 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8619 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8620 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8621 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8622 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8623 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8624 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8625 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8626 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8629 for( i = 0; i < path_n ; i++ )
8632 y = GRID_Y(path_g[i]);
8633 x = GRID_X(path_g[i]);
8634 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8635 if(!who && (project_m_n==1) && !jump ){
8636 if(cave[project_m_y][project_m_x].m_idx >0 ){
8637 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8639 /* Hack -- auto-recall */
8640 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8642 /* Hack - auto-track */
8643 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8646 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8651 /* Project along the path */
8652 for (i = 0; i < path_n; ++i)
8657 int ny = GRID_Y(path_g[i]);
8658 int nx = GRID_X(path_g[i]);
8660 if (flg & PROJECT_DISI)
8662 /* Hack -- Balls explode before reaching walls */
8663 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8667 /* Hack -- Balls explode before reaching walls */
8668 if (!cave_floor_bold(ny, nx) && (rad > 0)) break;
8675 /* Collect beam grids */
8676 if (flg & (PROJECT_BEAM))
8683 /* Only do visuals if requested */
8684 if (!blind && !(flg & (PROJECT_HIDE)) && !(flg & PROJECT_FAST))
8686 /* Only do visuals if the player can "see" the bolt */
8687 if (panel_contains(y, x) && player_has_los_bold(y, x))
8694 /* Obtain the bolt pict */
8695 p = bolt_pict(oy, ox, y, x, typ);
8697 /* Extract attr/char */
8701 /* Visual effects */
8702 print_rel(c, a, y, x);
8703 move_cursor_relative(y, x);
8704 /*if (fresh_before)*/ Term_fresh();
8705 Term_xtra(TERM_XTRA_DELAY, msec);
8707 /*if (fresh_before)*/ Term_fresh();
8709 /* Display "beam" grids */
8710 if (flg & (PROJECT_BEAM))
8712 /* Obtain the explosion pict */
8713 p = bolt_pict(y, x, y, x, typ);
8715 /* Extract attr/char */
8719 /* Visual effects */
8720 print_rel(c, a, y, x);
8723 /* Hack -- Activate delay */
8727 /* Hack -- delay anyway for consistency */
8730 /* Delay for consistency */
8731 Term_xtra(TERM_XTRA_DELAY, msec);
8736 /* Save the "blast epicenter" */
8740 if (breath && (y1 == by) && (x1 == bx))
8746 flg &= ~(PROJECT_HIDE);
8750 /* Start the "explosion" */
8753 /* Hack -- make sure beams get to "explode" */
8761 /* If we found a "target", explode there */
8762 if (dist <= MAX_RANGE)
8764 /* Mega-Hack -- remove the final "beam" grid */
8765 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8768 * Create a conical breath attack
8779 flg &= ~(PROJECT_HIDE);
8781 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, (bool)(typ == GF_DISINTEGRATE), TRUE);
8785 /* Determine the blast area, work from the inside out */
8786 for (dist = 0; dist <= rad; dist++)
8788 /* Scan the maximal blast area of radius "dist" */
8789 for (y = by - dist; y <= by + dist; y++)
8791 for (x = bx - dist; x <= bx + dist; x++)
8793 /* Ignore "illegal" locations */
8794 if (!in_bounds2(y, x)) continue;
8796 /* Enforce a "circular" explosion */
8797 if (distance(by, bx, y, x) != dist) continue;
8799 if (typ == GF_DISINTEGRATE)
8801 /* Disintegration are stopped only by perma-walls */
8802 if (!do_disintegration(by, bx, y, x)) continue;
8806 /* Ball explosions are stopped by walls */
8807 if (!los(by, bx, y, x)) continue;
8810 /* Save this grid */
8817 /* Encode some more "radius" info */
8823 /* Speed -- ignore "non-explosions" */
8824 if (!grids) return (FALSE);
8827 /* Display the "blast area" if requested */
8828 if (!blind && !(flg & (PROJECT_HIDE)))
8830 /* Then do the "blast", from inside out */
8831 for (t = 0; t <= gm_rad; t++)
8833 /* Dump everything with this radius */
8834 for (i = gm[t]; i < gm[t+1]; i++)
8836 /* Extract the location */
8840 /* Only do visuals if the player can "see" the blast */
8841 if (panel_contains(y, x) && player_has_los_bold(y, x))
8850 /* Obtain the explosion pict */
8851 p = bolt_pict(y, x, y, x, typ);
8853 /* Extract attr/char */
8857 /* Visual effects -- Display */
8858 print_rel(c, a, y, x);
8862 /* Hack -- center the cursor */
8863 move_cursor_relative(by, bx);
8865 /* Flush each "radius" seperately */
8866 /*if (fresh_before)*/ Term_fresh();
8868 /* Delay (efficiently) */
8869 if (visual || drawn)
8871 Term_xtra(TERM_XTRA_DELAY, msec);
8875 /* Flush the erasing */
8878 /* Erase the explosion drawn above */
8879 for (i = 0; i < grids; i++)
8881 /* Extract the location */
8885 /* Hack -- Erase if needed */
8886 if (panel_contains(y, x) && player_has_los_bold(y, x))
8892 /* Hack -- center the cursor */
8893 move_cursor_relative(by, bx);
8895 /* Flush the explosion */
8896 /*if (fresh_before)*/ Term_fresh();
8901 /* Update stuff if needed */
8902 if (p_ptr->update) update_stuff();
8905 /* Check features */
8906 if (flg & (PROJECT_GRID))
8908 /* Start with "dist" of zero */
8911 /* Scan for features */
8912 for (i = 0; i < grids; i++)
8914 /* Hack -- Notice new "dist" values */
8915 if (gm[dist+1] == i) dist++;
8917 /* Get the grid location */
8921 /* Find the closest point in the blast */
8924 int d = dist_to_line(y, x, y1, x1, by, bx);
8926 /* Affect the grid */
8927 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8931 /* Affect the grid */
8932 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8939 if (flg & (PROJECT_ITEM))
8941 /* Start with "dist" of zero */
8944 /* Scan for objects */
8945 for (i = 0; i < grids; i++)
8947 /* Hack -- Notice new "dist" values */
8948 if (gm[dist+1] == i) dist++;
8950 /* Get the grid location */
8954 /* Find the closest point in the blast */
8957 int d = dist_to_line(y, x, y1, x1, by, bx);
8959 /* Affect the object in the grid */
8960 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8964 /* Affect the object in the grid */
8965 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8971 /* Check monsters */
8972 if (flg & (PROJECT_KILL))
8979 /* Start with "dist" of zero */
8982 /* Scan for monsters */
8983 for (i = 0; i < grids; i++)
8987 /* Hack -- Notice new "dist" values */
8988 if (gm[dist + 1] == i) dist++;
8990 /* Get the grid location */
8994 /* A single bolt may be reflected */
8997 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
8998 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
9000 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
9003 int max_attempts = 10;
9005 /* Choose 'new' target */
9008 t_y = y_saver - 1 + randint1(3);
9009 t_x = x_saver - 1 + randint1(3);
9012 while (max_attempts && in_bounds2u(t_y, t_x) &&
9013 !(los(y, x, t_y, t_x)));
9015 if (max_attempts < 1)
9024 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
9025 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9026 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9027 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9029 msg_print("The attack bounces!");
9032 if (is_original_ap(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
9035 /* Reflected bolts randomly target either one */
9036 flg &= ~(PROJECT_MONSTER | PROJECT_PLAYER);
9037 if (one_in_(2)) flg |= PROJECT_MONSTER;
9038 else flg |= PROJECT_PLAYER;
9040 /* The bolt is reflected */
9041 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9043 /* Don't affect the monster any longer */
9049 /* Find the closest point in the blast */
9052 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9056 effective_dist = dist;
9060 /* There is the riding player on this monster */
9061 if (p_ptr->riding && player_bold(y, x))
9063 /* Aimed on the player */
9064 if (flg & PROJECT_PLAYER)
9066 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9069 * A beam or bolt is well aimed
9071 * So don't affects the mount.
9078 * The spell is not well aimed,
9079 * So partly affect the mount too.
9086 * This grid is the original target.
9088 else if ((y == y2) || (x == x2))
9090 /* Hit the mount with full damage */
9094 * Otherwise this grid is not the
9095 * original target, it means that line
9096 * of fire is obstructed by this
9100 * A beam or bolt will hit either
9101 * player or mount. Choose randomly.
9103 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9107 /* Hit the mount with full damage */
9111 /* Hit the player later */
9112 flg &= ~(PROJECT_MONSTER);
9113 flg |= PROJECT_PLAYER;
9115 /* Don't affect the mount */
9121 * The spell is not well aimed, so
9122 * partly affect both player and
9131 /* Affect the monster in the grid */
9132 if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
9136 /* Player affected one monster (without "jumping") */
9137 if (!who && (project_m_n == 1) && !jump)
9143 /* Track if possible */
9144 if (cave[y][x].m_idx > 0)
9146 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9148 /* Hack -- auto-recall */
9149 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9151 /* Hack - auto-track */
9152 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9159 if (flg & (PROJECT_KILL))
9161 /* Start with "dist" of zero */
9164 /* Scan for player */
9165 for (i = 0; i < grids; i++)
9169 /* Hack -- Notice new "dist" values */
9170 if (gm[dist+1] == i) dist++;
9172 /* Get the grid location */
9176 /* Affect the player? */
9177 if (!player_bold(y, x)) continue;
9179 /* Find the closest point in the blast */
9182 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9186 effective_dist = dist;
9189 /* Target may be your horse */
9192 /* Aimed on the player */
9193 if (flg & PROJECT_PLAYER)
9195 /* Hit the player with full damage */
9199 * Hack -- When this grid was not the
9200 * original target, a beam or bolt
9201 * would hit either player or mount,
9202 * and should be choosen randomly.
9204 * But already choosen to hit the
9205 * mount at this point.
9207 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9210 * A beam or bolt is well aimed
9212 * So don't affects the player.
9219 * The spell is not well aimed,
9220 * So partly affect the player too.
9226 /* Affect the player */
9227 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9235 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9237 if (rakubadam_m > 0)
9239 if (rakuba(rakubadam_m, FALSE))
9242 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9244 msg_format("%^s has thrown you off!", m_name);
9248 if (p_ptr->riding && rakubadam_p > 0)
9250 if(rakuba(rakubadam_p, FALSE))
9253 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9255 msg_format("You have fallen from %s.", m_name);
9261 /* Return "something was noticed" */
9265 bool binding_field( int dam )
9267 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9268 int mirror_num=0; /* ¶À¤Î¿ô */
9273 int msec= delay_factor*delay_factor*delay_factor;
9279 /* Default target of monsterspell is player */
9280 monster_target_y=py;
9281 monster_target_x=px;
9283 for( x=0 ; x < cur_wid ; x++ )
9285 for( y=0 ; y < cur_hgt ; y++ )
9287 if( is_mirror_grid(&cave[y][x]) &&
9288 distance(py,px,y,x) <= MAX_RANGE &&
9289 distance(py,px,y,x) != 0 &&
9290 player_has_los_bold(y,x)
9292 mirror_y[mirror_num]=y;
9293 mirror_x[mirror_num]=x;
9299 if( mirror_num < 2 )return FALSE;
9301 point_x[0] = randint0( mirror_num );
9303 point_x[1] = randint0( mirror_num );
9305 while( point_x[0] == point_x[1] );
9307 point_y[0]=mirror_y[point_x[0]];
9308 point_x[0]=mirror_x[point_x[0]];
9309 point_y[1]=mirror_y[point_x[1]];
9310 point_x[1]=mirror_x[point_x[1]];
9314 x=point_x[0]+point_x[1]+point_x[2];
9315 y=point_y[0]+point_y[1]+point_y[2];
9317 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9318 - (point_y[0]*3-y)*(point_x[1]*3-x);
9319 if( centersign == 0 )return FALSE;
9321 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9322 x1 = x1 < point_x[2] ? x1 : point_x[2];
9323 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9324 y1 = y1 < point_y[2] ? y1 : point_y[2];
9326 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9327 x2 = x2 > point_x[2] ? x2 : point_x[2];
9328 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9329 y2 = y2 > point_y[2] ? y2 : point_y[2];
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)){
9341 /* Visual effects */
9343 && panel_contains(y,x)){
9344 p = bolt_pict(y,x,y,x, GF_MANA );
9345 print_rel(PICT_C(p), PICT_A(p),y,x);
9346 move_cursor_relative(y, x);
9347 /*if (fresh_before)*/ Term_fresh();
9348 Term_xtra(TERM_XTRA_DELAY, msec);
9354 for( y=y1 ; y <=y2 ; y++ ){
9355 for( x=x1 ; x <=x2 ; x++ ){
9356 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9357 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9358 centersign*( (point_x[1]-x)*(point_y[2]-y)
9359 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9360 centersign*( (point_x[2]-x)*(point_y[0]-y)
9361 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9363 if( player_has_los_bold(y,x)){
9364 (void)project_f(0,0,y,x,dam,GF_MANA);
9369 for( y=y1 ; y <=y2 ; y++ ){
9370 for( x=x1 ; x <=x2 ; x++ ){
9371 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9372 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9373 centersign*( (point_x[1]-x)*(point_y[2]-y)
9374 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9375 centersign*( (point_x[2]-x)*(point_y[0]-y)
9376 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9378 if( player_has_los_bold(y,x)){
9379 (void)project_o(0,0,y,x,dam,GF_MANA);
9384 for( y=y1 ; y <=y2 ; y++ ){
9385 for( x=x1 ; x <=x2 ; x++ ){
9386 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9387 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9388 centersign*( (point_x[1]-x)*(point_y[2]-y)
9389 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9390 centersign*( (point_x[2]-x)*(point_y[0]-y)
9391 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9393 if( player_has_los_bold(y,x) ){
9394 (void)project_m(0,0,y,x,dam,GF_MANA,
9395 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9402 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9404 msg_print("The field broke a mirror");
9406 remove_mirror(point_y[0],point_x[0]);
9412 void seal_of_mirror( int dam )
9416 for( x = 0 ; x < cur_wid ; x++ )
9418 for( y = 0 ; y < cur_hgt ; y++ )
9420 if( is_mirror_grid(&cave[y][x]))
9422 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9423 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9425 if( !cave[y][x].m_idx )