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 ((y == py && x == px) || 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 ((y == py && x == px) || 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 ((y == py && x == px) || 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("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
784 /* Destroy Doors (and traps) */
787 /* Destroy all doors and traps */
788 if ((c_ptr->feat == FEAT_OPEN) ||
789 (c_ptr->feat == FEAT_BROKEN) ||
790 is_trap(c_ptr->feat) ||
791 ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
792 (c_ptr->feat <= FEAT_DOOR_TAIL)))
794 /* Check line of sight */
799 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
801 msg_print("There is a bright flash of light!");
806 /* Visibility change */
807 if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
808 (c_ptr->feat <= FEAT_DOOR_TAIL))
810 /* Update some things */
811 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
815 /* Forget the door */
816 c_ptr->info &= ~(CAVE_MARK);
818 /* Destroy the feature */
819 cave_set_feat(y, x, floor_type[randint0(100)]);
828 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
830 if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
831 (c_ptr->feat <= FEAT_DOOR_TAIL))
833 /* Convert "locked" to "stuck" XXX XXX XXX */
834 if (c_ptr->feat < FEAT_DOOR_HEAD + 0x08) c_ptr->feat += 0x08;
836 /* Add one spike to the door */
837 if (c_ptr->feat < FEAT_DOOR_TAIL) c_ptr->feat++;
839 /* Check line of sight */
844 msg_print("²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ¥É¥¢¤¬³«¤«¤Ê¤¤¡£");
846 msg_print("The door seems stuck.");
855 /* Destroy walls (and doors) */
858 /* Non-walls (etc) */
859 if (cave_floor_bold(y, x)) break;
861 /* Permanent walls */
862 if (c_ptr->feat >= FEAT_PERM_EXTRA) break;
865 if (c_ptr->feat >= FEAT_WALL_EXTRA)
868 if (known && (c_ptr->info & (CAVE_MARK)))
871 msg_print("Êɤ¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
873 msg_print("The wall turns into mud!");
879 /* Forget the wall */
880 c_ptr->info &= ~(CAVE_MARK);
882 /* Destroy the wall */
883 cave_set_feat(y, x, floor_type[randint0(100)]);
886 /* Quartz / Magma with treasure */
887 else if (c_ptr->feat >= FEAT_MAGMA_H)
890 if (known && (c_ptr->info & (CAVE_MARK)))
893 msg_print("¹ÛÌ®¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
894 msg_print("²¿¤«¤òȯ¸«¤·¤¿¡ª");
896 msg_print("The vein turns into mud!");
897 msg_print("You have found something!");
903 /* Forget the wall */
904 c_ptr->info &= ~(CAVE_MARK);
906 /* Destroy the wall */
907 cave_set_feat(y, x, floor_type[randint0(100)]);
909 /* Place some gold */
914 else if (c_ptr->feat >= FEAT_MAGMA)
917 if (known && (c_ptr->info & (CAVE_MARK)))
920 msg_print("¹ÛÌ®¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
922 msg_print("The vein turns into mud!");
928 /* Forget the wall */
929 c_ptr->info &= ~(CAVE_MARK);
931 /* Destroy the wall */
932 cave_set_feat(y, x, floor_type[randint0(100)]);
936 else if (c_ptr->feat == FEAT_RUBBLE)
939 if (known && (c_ptr->info & (CAVE_MARK)))
942 msg_print("´äÀФ¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
944 msg_print("The rubble turns into mud!");
950 /* Forget the wall */
951 c_ptr->info &= ~(CAVE_MARK);
953 /* Destroy the rubble */
954 cave_set_feat(y, x, floor_type[randint0(100)]);
956 /* Hack -- place an object */
957 if (randint0(100) < 10)
959 /* Found something */
960 if (player_can_see_bold(y, x))
963 msg_print("´äÀФβ¼¤Ë²¿¤«±£¤µ¤ì¤Æ¤¤¤¿¡ª");
965 msg_print("There was something buried in the rubble!");
972 place_object(y, x, FALSE, FALSE);
976 /* Destroy doors (and secret doors) */
977 else /* if (c_ptr->feat >= FEAT_DOOR_HEAD) */
979 /* Hack -- special message */
980 if (known && (c_ptr->info & (CAVE_MARK)))
983 msg_print("¥É¥¢¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
985 msg_print("The door turns into mud!");
991 /* Forget the wall */
992 c_ptr->info &= ~(CAVE_MARK);
994 /* Destroy the feature */
995 cave_set_feat(y, x, floor_type[randint0(100)]);
1001 /* Update some things */
1002 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
1010 /* Require a "naked" floor grid */
1011 if (!cave_naked_bold(y, x)) break;
1013 /* Not on the player */
1014 if ((y == py) && (x == px)) break;
1016 /* Create a closed door */
1017 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
1020 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
1022 /* Update some things */
1023 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1031 /* Require a "naked" floor grid */
1032 if (((cave[y][x].feat != FEAT_FLOOR) &&
1033 (cave[y][x].feat != FEAT_GRASS) &&
1034 (cave[y][x].feat != FEAT_DIRT) &&
1035 (cave[y][x].o_idx == 0) &&
1036 (cave[y][x].m_idx == 0))
1037 || is_mirror_grid(&cave[y][x]) )
1048 /* Require a "naked" floor grid */
1049 if (!cave_naked_bold(y, x)) break;
1051 /* Not on the player */
1052 if ((y == py) && (x == px)) break;
1054 /* Create a closed door */
1055 cave_set_feat(y, x, FEAT_TREES);
1058 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
1060 /* Update some things */
1061 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1068 /* Require a "naked" floor grid */
1069 if (!cave_naked_bold(y, x)) break;
1071 /* Create a glyph */
1072 cave[y][x].info |= CAVE_OBJECT;
1073 cave[y][x].mimic = FEAT_GLYPH;
1086 /* Require a "naked" floor grid */
1087 if (!cave_naked_bold(y, x)) break;
1089 /* Not on the player */
1090 if ((y == py) && (x == px)) break;
1093 cave_set_feat(y, x, FEAT_WALL_EXTRA);
1095 /* Update some things */
1096 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1107 /* Require a "naked" floor grid */
1108 if (!cave_naked_bold(y, x)) break;
1110 /* Place a shallow lava */
1111 cave_set_feat(y, x, FEAT_SHAL_LAVA);
1116 /* Require a "naked" floor grid */
1117 if (cave_perma_bold(y, x) || !dam) break;
1119 /* Place a deep lava */
1120 cave_set_feat(y, x, FEAT_DEEP_LAVA);
1122 /* Dam is used as a counter for the number of grid to convert */
1133 /* Require a "naked" floor grid */
1134 if (!cave_naked_bold(y, x)) break;
1136 /* Place a shallow lava */
1137 cave_set_feat(y, x, FEAT_SHAL_WATER);
1142 /* Require a "naked" floor grid */
1143 if (cave_perma_bold(y, x) || !dam) break;
1145 /* Place a deep lava */
1146 cave_set_feat(y, x, FEAT_DEEP_WATER);
1148 /* Dam is used as a counter for the number of grid to convert */
1154 /* Lite up the grid */
1158 /* Turn on the light */
1159 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) c_ptr->info |= (CAVE_GLOW);
1168 if (player_can_see_bold(y, x)) obvious = TRUE;
1170 /* Mega-Hack -- Update the monster in the affected grid */
1171 /* This allows "spear of light" (etc) to work "correctly" */
1172 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1177 /* Darken the grid */
1181 if (!p_ptr->inside_battle)
1184 if (player_can_see_bold(y, x)) obvious = TRUE;
1186 /* Turn off the light. */
1187 if (!is_mirror_grid(c_ptr)) c_ptr->info &= ~(CAVE_GLOW);
1189 /* Hack -- Forget "boring" grids */
1190 if ((c_ptr->feat <= FEAT_INVIS) || (c_ptr->feat == FEAT_DIRT) || (c_ptr->feat == FEAT_GRASS))
1193 c_ptr->info &= ~(CAVE_MARK);
1202 /* Mega-Hack -- Update the monster in the affected grid */
1203 /* This allows "spear of light" (etc) to work "correctly" */
1204 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1213 if (is_mirror_grid(&cave[y][x]))
1216 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1218 msg_print("The mirror was chashed!");
1221 project(0,2,y,x, p_ptr->lev /2 +5 ,GF_SHARDS,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_HANGEKI),-1);
1227 if (is_mirror_grid(&cave[y][x]) && p_ptr->lev < 40 )
1230 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1232 msg_print("The mirror was chashed!");
1234 cave_set_feat(y,x, FEAT_FLOOR);
1241 /* Return "Anything seen?" */
1248 * We are called from "project()" to "damage" objects
1250 * We are called both for "beam" effects and "ball" effects.
1252 * Perhaps we should only SOMETIMES damage things on the ground.
1254 * The "r" parameter is the "distance from ground zero".
1256 * Note that we determine if the player can "see" anything that happens
1257 * by taking into account: blindness, line-of-sight, and illumination.
1259 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1261 * We return "TRUE" if the effect of the projection is "obvious".
1263 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1265 cave_type *c_ptr = &cave[y][x];
1267 s16b this_o_idx, next_o_idx = 0;
1269 bool obvious = FALSE;
1270 bool known = player_has_los_bold(y, x);
1272 u32b flgs[TR_FLAG_SIZE];
1274 char o_name[MAX_NLEN];
1277 bool is_potion = FALSE;
1281 who = who ? who : 0;
1283 /* Reduce damage by distance */
1284 dam = (dam + r) / (r + 1);
1287 /* Scan all objects in the grid */
1288 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1292 bool is_art = FALSE;
1293 bool ignore = FALSE;
1294 bool plural = FALSE;
1295 bool do_kill = FALSE;
1297 cptr note_kill = NULL;
1299 /* Acquire object */
1300 o_ptr = &o_list[this_o_idx];
1302 /* Acquire next object */
1303 next_o_idx = o_ptr->next_o_idx;
1305 /* Extract the flags */
1306 object_flags(o_ptr, flgs);
1308 /* Get the "plural"-ness */
1309 if (o_ptr->number > 1) plural = TRUE;
1311 /* Check for artifact */
1312 if ((artifact_p(o_ptr) || o_ptr->art_name)) is_art = TRUE;
1314 /* Analyze the type */
1317 /* Acid -- Lots of things */
1320 if (hates_acid(o_ptr))
1324 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1326 note_kill = (plural ? " melt!" : " melts!");
1329 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1334 /* Elec -- Rings and Wands */
1337 if (hates_elec(o_ptr))
1341 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1343 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1346 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1351 /* Fire -- Flammable objects */
1354 if (hates_fire(o_ptr))
1358 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1360 note_kill = (plural ? " burn up!" : " burns up!");
1363 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1368 /* Cold -- potions and flasks */
1371 if (hates_cold(o_ptr))
1374 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1376 note_kill = (plural ? " shatter!" : " shatters!");
1380 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1388 if (hates_fire(o_ptr))
1392 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1394 note_kill = (plural ? " burn up!" : " burns up!");
1397 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1399 if (hates_elec(o_ptr))
1404 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1406 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1409 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1417 if (hates_fire(o_ptr))
1421 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1423 note_kill = (plural ? " burn up!" : " burns up!");
1426 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1428 if (hates_cold(o_ptr))
1433 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1435 note_kill = (plural ? " shatter!" : " shatters!");
1438 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1443 /* Hack -- break potions and such */
1449 if (hates_cold(o_ptr))
1452 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1454 note_kill = (plural ? " shatter!" : " shatters!");
1462 /* Mana and Chaos -- destroy everything */
1469 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1471 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1477 case GF_DISINTEGRATE:
1481 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1483 note_kill = (plural ? " evaporate!" : " evaporates!");
1493 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1495 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1498 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1499 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1503 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1507 if (cursed_p(o_ptr))
1511 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1513 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1522 identify_item(o_ptr);
1530 /* Chests are noticed only if trapped or locked */
1531 if (o_ptr->tval == TV_CHEST)
1533 /* Disarm/Unlock traps */
1534 if (o_ptr->pval > 0)
1536 /* Disarm or Unlock */
1537 o_ptr->pval = (0 - o_ptr->pval);
1540 object_known(o_ptr);
1543 if (known && o_ptr->marked)
1546 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1548 msg_print("Click!");
1560 if (o_ptr->tval == TV_CORPSE)
1565 if (!who || is_pet(&m_list[who]))
1566 mode |= PM_FORCE_PET;
1568 for (i = 0; i < o_ptr->number ; i++)
1570 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1571 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1576 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1578 note_kill = (plural ? " become dust." : " becomes dust.");
1583 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1586 note_kill = "À¸¤Ê֤ä¿¡£";
1588 note_kill = "rivived.";
1591 else if (!note_kill)
1594 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1596 note_kill = (plural ? " become dust." : " becomes dust.");
1608 /* Attempt to destroy the object */
1611 /* Effect "observed" */
1612 if (known && o_ptr->marked)
1615 object_desc(o_name, o_ptr, FALSE, 0);
1618 /* Artifacts, and other objects, get to resist */
1619 if (is_art || ignore)
1621 /* Observe the resist */
1622 if (known && o_ptr->marked)
1625 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1628 msg_format("The %s %s unaffected!",
1629 o_name, (plural ? "are" : "is"));
1638 /* Describe if needed */
1639 if (known && o_ptr->marked && note_kill)
1642 msg_format("%s¤Ï%s", o_name, note_kill);
1644 msg_format("The %s%s", o_name, note_kill);
1649 k_idx = o_ptr->k_idx;
1650 is_potion = object_is_potion(o_ptr);
1653 /* Delete the object */
1654 delete_object_idx(this_o_idx);
1656 /* Potions produce effects when 'shattered' */
1659 (void)potion_smash_effect(who, y, x, k_idx);
1668 /* Return "Anything seen?" */
1674 * Helper function for "project()" below.
1676 * Handle a beam/bolt/ball causing damage to a monster.
1678 * This routine takes a "source monster" (by index) which is mostly used to
1679 * determine if the player is causing the damage, and a "radius" (see below),
1680 * which is used to decrease the power of explosions with distance, and a
1681 * location, via integers which are modified by certain types of attacks
1682 * (polymorph and teleport being the obvious ones), a default damage, which
1683 * is modified as needed based on various properties, and finally a "damage
1684 * type" (see below).
1686 * Note that this routine can handle "no damage" attacks (like teleport) by
1687 * taking a "zero" damage, and can even take "parameters" to attacks (like
1688 * confuse) by accepting a "damage", using it to calculate the effect, and
1689 * then setting the damage to zero. Note that the "damage" parameter is
1690 * divided by the radius, so monsters not at the "epicenter" will not take
1691 * as much damage (or whatever)...
1693 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1694 * may result in a dereference of an invalid pointer. XXX XXX XXX
1696 * Various messages are produced, and damage is applied.
1698 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1699 * actually be "made" of that substance, or "breathe" big balls of it.
1701 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1704 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1705 * and hurts evil less. If can breath nether, then it resists it as well.
1707 * Damage reductions use the following formulas:
1708 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1709 * gives avg damage of .655, ranging from .858 to .500
1710 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1711 * gives avg damage of .544, ranging from .714 to .417
1712 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1713 * gives avg damage of .444, ranging from .556 to .333
1714 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1715 * gives avg damage of .327, ranging from .427 to .250
1716 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1717 * gives something simple.
1719 * In this function, "result" messages are postponed until the end, where
1720 * the "note" string is appended to the monster name, if not NULL. So,
1721 * to make a spell have "no effect" just set "note" to NULL. You should
1722 * also set "notice" to FALSE, or the player will learn what the spell does.
1724 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1726 /* "flg" was added. */
1727 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1731 cave_type *c_ptr = &cave[y][x];
1733 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1735 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1739 /* Is the monster "seen"? */
1740 bool seen = m_ptr->ml;
1742 bool slept = (bool)(m_ptr->csleep > 0);
1744 /* Were the effects "obvious" (if seen)? */
1745 bool obvious = FALSE;
1747 /* Can the player know about this effect? */
1748 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1750 /* Can the player see the source of this effect? */
1751 bool see_s = ((who <= 0) || m_list[who].ml);
1753 /* Were the effects "irrelevant"? */
1754 bool skipped = FALSE;
1756 /* Gets the monster angry at the source of the effect? */
1757 bool get_angry = FALSE;
1759 /* Polymorph setting (true or false) */
1762 /* Teleport setting (max distance) */
1765 /* Confusion setting (amount to confuse) */
1768 /* Stunning setting (amount to stun) */
1771 /* Sleep amount (amount to sleep) */
1774 /* Fear amount (amount to fear) */
1777 /* Time amount (amount to time) */
1780 bool heal_leper = FALSE;
1782 /* Hold the monster name */
1789 /* Assume no note */
1792 /* Assume a default death */
1794 cptr note_dies = "¤Ï»à¤ó¤À¡£";
1796 cptr note_dies = " dies.";
1804 if (!c_ptr->m_idx) return (FALSE);
1806 /* Never affect projector */
1807 if (who && (c_ptr->m_idx == who)) return (FALSE);
1808 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1809 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1811 /* Don't affect already death monsters */
1812 /* Prevents problems with chain reactions of exploding monsters */
1813 if (m_ptr->hp < 0) return (FALSE);
1815 /* Reduce damage by distance */
1816 dam = (dam + r) / (r + 1);
1819 /* Get the monster name (BEFORE polymorphing) */
1820 monster_desc(m_name, m_ptr, 0);
1822 /* Get the monster possessive ("his"/"her"/"its") */
1823 monster_desc(m_poss, m_ptr, 0x22);
1826 /* Some monsters get "destroyed" */
1827 if (!monster_living(r_ptr))
1830 bool explode = FALSE;
1832 for (i = 0; i < 4; i++)
1834 if (r_ptr->blow[i].method == RBM_EXPLODE) explode = TRUE;
1837 /* Special note at death */
1840 note_dies = "¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£";
1842 note_dies = " explodes into tiny shreds.";
1846 note_dies = "¤òÅݤ·¤¿¡£";
1848 note_dies = " is destroyed.";
1852 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1854 /* Analyze the damage type */
1857 /* Magic Missile -- pure damage */
1860 if (seen) obvious = TRUE;
1861 if (r_ptr->flags3 & (RF3_RES_ALL))
1864 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1866 note = " is immune.";
1869 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1878 if (seen) obvious = TRUE;
1879 if (r_ptr->flags3 & (RF3_RES_ALL))
1882 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1884 note = " is immune.";
1887 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1890 if (r_ptr->flags3 & (RF3_IM_ACID))
1893 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1895 note = " resists a lot.";
1899 if (seen) r_ptr->r_flags3 |= (RF3_IM_ACID);
1907 if (seen) obvious = TRUE;
1908 if (r_ptr->flags3 & (RF3_RES_ALL))
1911 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1913 note = " is immune.";
1916 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1919 if (r_ptr->flags3 & (RF3_IM_ELEC))
1922 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1924 note = " resists a lot.";
1928 if (seen) r_ptr->r_flags3 |= (RF3_IM_ELEC);
1936 if (seen) obvious = TRUE;
1937 if (r_ptr->flags3 & (RF3_RES_ALL))
1940 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1942 note = " is immune.";
1945 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1948 if (r_ptr->flags3 & (RF3_IM_FIRE))
1951 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1953 note = " resists a lot.";
1957 if (seen) r_ptr->r_flags3 |= (RF3_IM_FIRE);
1959 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1962 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1964 note = " is hit hard.";
1968 if (seen) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1976 if (seen) obvious = TRUE;
1977 if (r_ptr->flags3 & (RF3_RES_ALL))
1980 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1982 note = " is immune.";
1985 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1988 if (r_ptr->flags3 & (RF3_IM_COLD))
1991 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1993 note = " resists a lot.";
1997 if (seen) r_ptr->r_flags3 |= (RF3_IM_COLD);
1999 else if (r_ptr->flags3 & (RF3_HURT_COLD))
2002 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
2004 note = " is hit hard.";
2008 if (seen) r_ptr->r_flags3 |= (RF3_HURT_COLD);
2016 if (seen) obvious = TRUE;
2017 if (r_ptr->flags3 & (RF3_RES_ALL))
2020 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2022 note = " is immune.";
2025 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2028 if (r_ptr->flags3 & RF3_IM_POIS)
2031 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
2033 note = " resists a lot.";
2037 if (seen) r_ptr->r_flags3 |= (RF3_IM_POIS);
2045 if (seen) obvious = TRUE;
2047 if (r_ptr->flags3 & (RF3_RES_ALL))
2050 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2052 note = " is immune.";
2055 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2058 if (r_ptr->flags3 & RF3_IM_POIS)
2061 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2066 dam *= 3; dam /= randint1(6) + 6;
2067 if (seen) r_ptr->r_flags3 |= (RF3_IM_POIS);
2069 else if (one_in_(3)) do_poly = TRUE;
2073 /* Hellfire -- hurts Evil */
2076 if (seen) obvious = TRUE;
2077 if (r_ptr->flags3 & (RF3_RES_ALL))
2080 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2082 note = " is immune.";
2085 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2088 if (r_ptr->flags3 & RF3_GOOD)
2092 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2094 note = " is hit hard.";
2097 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
2102 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2105 if (seen) obvious = TRUE;
2106 if (r_ptr->flags3 & (RF3_RES_ALL))
2109 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2111 note = " is immune.";
2114 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2117 if (r_ptr->flags3 & RF3_GOOD)
2121 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2123 note = " is immune.";
2126 if (seen) r_ptr->r_flags3 |= RF3_GOOD;
2128 else if (r_ptr->flags3 & RF3_EVIL)
2132 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2134 note = " is hit hard.";
2137 if (seen) r_ptr->r_flags3 |= RF3_EVIL;
2142 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2147 dam *= 3; dam /= randint1(6) + 6;
2152 /* Arrow -- XXX no defense */
2155 if (seen) obvious = TRUE;
2156 if (r_ptr->flags3 & (RF3_RES_ALL))
2159 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2161 note = " is immune.";
2164 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2170 /* Plasma -- XXX perhaps check ELEC or FIRE */
2173 if (seen) obvious = TRUE;
2174 if (r_ptr->flags3 & (RF3_RES_ALL))
2177 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2179 note = " is immune.";
2182 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2185 if (r_ptr->flags3 & RF3_RES_PLAS)
2188 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2193 dam *= 3; dam /= randint1(6) + 6;
2195 r_ptr->r_flags3 |= (RF3_RES_PLAS);
2200 /* Nether -- see above */
2203 if (seen) obvious = TRUE;
2204 if (r_ptr->flags3 & (RF3_RES_ALL))
2207 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2209 note = " is immune.";
2212 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2215 if (r_ptr->flags3 & RF3_UNDEAD)
2218 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2220 note = " is immune.";
2224 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
2226 else if (r_ptr->flags3 & RF3_RES_NETH)
2229 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2234 dam *= 3; dam /= randint1(6) + 6;
2236 if (seen) r_ptr->r_flags3 |= (RF3_RES_NETH);
2238 else if (r_ptr->flags3 & RF3_EVIL)
2242 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2244 note = " resists somewhat.";
2247 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
2252 /* Water (acid) damage -- Water spirits/elementals are immune */
2255 if (seen) obvious = TRUE;
2256 if (r_ptr->flags3 & (RF3_RES_ALL))
2259 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2261 note = " is immune.";
2264 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2267 if (m_ptr->r_idx == MON_WATER_ELEM || m_ptr->r_idx == MON_UNMAKER)
2270 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2272 note = " is immune.";
2277 else if (r_ptr->flags3 & RF3_RES_WATE)
2280 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2285 dam *= 3; dam /= randint1(6) + 6;
2286 if (seen) r_ptr->r_flags3 |= (RF3_RES_WATE);
2291 /* Chaos -- Chaos breathers resist */
2294 if (seen) obvious = TRUE;
2295 if (r_ptr->flags3 & (RF3_RES_ALL))
2298 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2300 note = " is immune.";
2303 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2307 do_conf = (5 + randint1(11) + r) / (r + 1);
2308 if ((r_ptr->flags4 & RF4_BR_CHAO) ||
2309 (m_ptr->r_idx == MON_STORMBRINGER) ||
2310 ((r_ptr->flags3 & RF3_DEMON) && one_in_(3)))
2313 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2318 dam *= 3; dam /= randint1(6) + 6;
2324 /* Shards -- Shard breathers resist */
2327 if (seen) obvious = TRUE;
2328 if (r_ptr->flags3 & (RF3_RES_ALL))
2331 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2333 note = " is immune.";
2336 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2339 if (r_ptr->flags4 & RF4_BR_SHAR)
2342 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2347 dam *= 3; dam /= randint1(6) + 6;
2352 /* Rocket: Shard resistance helps */
2355 if (seen) obvious = TRUE;
2357 if (r_ptr->flags3 & (RF3_RES_ALL))
2360 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2362 note = " is immune.";
2365 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2368 if (r_ptr->flags4 & RF4_BR_SHAR)
2371 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2373 note = " resists somewhat.";
2382 /* Sound -- Sound breathers resist */
2385 if (seen) obvious = TRUE;
2386 if (r_ptr->flags3 & (RF3_RES_ALL))
2389 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2391 note = " is immune.";
2394 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2397 do_stun = (10 + randint1(15) + r) / (r + 1);
2398 if (r_ptr->flags4 & RF4_BR_SOUN)
2401 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2406 dam *= 2; dam /= randint1(6) + 6;
2414 if (seen) obvious = TRUE;
2415 if (r_ptr->flags3 & (RF3_RES_ALL))
2418 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2420 note = " is immune.";
2423 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2426 do_conf = (10 + randint1(15) + r) / (r + 1);
2427 if (r_ptr->flags4 & RF4_BR_CONF)
2430 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2435 dam *= 2; dam /= randint1(6) + 6;
2437 else if (r_ptr->flags3 & RF3_NO_CONF)
2440 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2442 note = " resists somewhat.";
2450 /* Disenchantment -- Breathers and Disenchanters resist */
2453 if (seen) obvious = TRUE;
2454 if (r_ptr->flags3 & (RF3_RES_ALL))
2457 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2459 note = " is immune.";
2462 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2465 if (r_ptr->flags3 & RF3_RES_DISE)
2468 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2473 dam *= 3; dam /= randint1(6) + 6;
2474 if (seen) r_ptr->r_flags3 |= (RF3_RES_DISE);
2479 /* Nexus -- Breathers and Existers resist */
2482 if (seen) obvious = TRUE;
2483 if (r_ptr->flags3 & (RF3_RES_ALL))
2486 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2488 note = " is immune.";
2491 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2494 if (r_ptr->flags3 & RF3_RES_NEXU)
2497 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2502 dam *= 3; dam /= randint1(6) + 6;
2503 if (seen) r_ptr->r_flags3 |= (RF3_RES_NEXU);
2511 if (seen) obvious = TRUE;
2512 if (r_ptr->flags3 & (RF3_RES_ALL))
2515 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2517 note = " is immune.";
2520 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2523 do_stun = (randint1(15) + r) / (r + 1);
2524 if (r_ptr->flags4 & RF4_BR_WALL)
2527 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2532 dam *= 3; dam /= randint1(6) + 6;
2537 /* Inertia -- breathers resist */
2540 if (seen) obvious = TRUE;
2541 if (r_ptr->flags3 & (RF3_RES_ALL))
2544 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2546 note = " is immune.";
2549 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2552 if (r_ptr->flags4 & (RF4_BR_INER))
2555 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2560 dam *= 3; dam /= randint1(6) + 6;
2564 /* Powerful monsters can resist */
2565 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2566 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2570 /* Normal monsters slow down */
2576 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2578 note = " starts moving slower.";
2581 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2582 if (c_ptr->m_idx == p_ptr->riding)
2583 p_ptr->update |= (PU_BONUS);
2589 /* Time -- breathers resist */
2592 if (seen) obvious = TRUE;
2593 if (r_ptr->flags3 & (RF3_RES_ALL))
2596 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2598 note = " is immune.";
2601 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2604 if (r_ptr->flags4 & (RF4_BR_TIME))
2607 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2612 dam *= 3; dam /= randint1(6) + 6;
2614 else do_time = (dam+1)/2;
2618 /* Gravity -- breathers resist */
2621 bool resist_tele = FALSE;
2623 if (seen) obvious = TRUE;
2625 if (r_ptr->flags3 & (RF3_RES_ALL))
2628 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2630 note = " is immune.";
2633 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2636 if (r_ptr->flags3 & (RF3_RES_TELE))
2638 if (r_ptr->flags1 & (RF1_UNIQUE))
2640 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
2642 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2644 note = " is unaffected!";
2649 else if (r_ptr->level > randint1(100))
2651 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
2653 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2662 if (!resist_tele) do_dist = 10;
2664 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2666 if (r_ptr->flags4 & (RF4_BR_GRAV))
2669 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2674 dam *= 3; dam /= randint1(6) + 6;
2680 /* Powerful monsters can resist */
2681 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2682 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2686 /* Normal monsters slow down */
2692 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2694 note = " starts moving slower.";
2697 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2698 if (c_ptr->m_idx == p_ptr->riding)
2699 p_ptr->update |= (PU_BONUS);
2703 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
2705 /* Attempt a saving throw */
2706 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2707 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2711 /* No obvious effect */
2713 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2715 note = " is unaffected!";
2729 if (seen) obvious = TRUE;
2730 if (r_ptr->flags3 & (RF3_RES_ALL))
2733 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2735 note = " is immune.";
2738 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2746 case GF_DISINTEGRATE:
2748 if (seen) obvious = TRUE;
2749 if (r_ptr->flags3 & (RF3_RES_ALL))
2752 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2754 note = " is immune.";
2757 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2760 if (r_ptr->flags3 & RF3_HURT_ROCK)
2762 if (seen) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2764 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2765 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2767 note = " loses some skin!";
2768 note_dies = " evaporates!";
2778 if (seen) obvious = TRUE;
2780 /* PSI only works if the monster can see you! -- RG */
2781 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2785 note = "¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª";
2787 note = " can't see you, and isn't affected!";
2792 if (r_ptr->flags3 & (RF3_RES_ALL))
2795 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2797 note = " is immune.";
2800 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2803 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2807 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2809 note = " is immune!";
2811 if (seen) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2814 else if ((r_ptr->flags2 & RF2_STUPID) ||
2815 (r_ptr->flags2 & RF2_WEIRD_MIND) ||
2816 (r_ptr->flags3 & RF3_ANIMAL) ||
2817 (r_ptr->level > randint1(3 * dam)))
2821 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2828 * Powerful demons & undead can turn a mindcrafter's
2829 * attacks back on them
2831 if (((r_ptr->flags3 & RF3_UNDEAD) ||
2832 (r_ptr->flags3 & RF3_DEMON)) &&
2833 (r_ptr->level > p_ptr->lev / 2) &&
2838 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
2841 msg_format("%^s%s corrupted mind backlashes your attack!",
2842 m_name, (seen ? "'s" : "s"));
2846 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2849 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2851 msg_print("You resist the effects!");
2857 /* Injure +/- confusion */
2858 monster_desc(killer, m_ptr, 0x288);
2859 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2862 switch (randint1(4))
2865 set_confused(p_ptr->confused + 3 + randint1(dam));
2868 set_stun(p_ptr->stun + randint1(dam));
2872 if (r_ptr->flags3 & RF3_NO_FEAR)
2874 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2876 note = " is unaffected.";
2880 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2884 if (!p_ptr->free_act)
2885 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2894 if ((dam > 0) && one_in_(4))
2896 switch (randint1(4))
2899 do_conf = 3 + randint1(dam);
2902 do_stun = 3 + randint1(dam);
2905 do_fear = 3 + randint1(dam);
2909 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2911 note = " falls asleep!";
2914 do_sleep = 3 + randint1(dam);
2920 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2922 note_dies = " collapses, a mindless husk.";
2930 if (seen) obvious = TRUE;
2931 if (r_ptr->flags3 & (RF3_RES_ALL))
2934 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2936 note = " is immune.";
2939 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2942 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2946 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2948 note = " is immune!";
2952 else if ((r_ptr->flags2 & RF2_STUPID) ||
2953 (r_ptr->flags2 & RF2_WEIRD_MIND) ||
2954 (r_ptr->flags3 & RF3_ANIMAL) ||
2955 (r_ptr->level > randint1(3 * dam)))
2959 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2966 * Powerful demons & undead can turn a mindcrafter's
2967 * attacks back on them
2969 if (((r_ptr->flags3 & RF3_UNDEAD) ||
2970 (r_ptr->flags3 & RF3_DEMON)) &&
2971 (r_ptr->level > p_ptr->lev / 2) &&
2976 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
2979 msg_format("%^s%s corrupted mind backlashes your attack!",
2980 m_name, (seen ? "'s" : "s"));
2984 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2987 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2989 msg_print("You resist the effects!");
2995 /* Injure + mana drain */
2996 monster_desc(killer, m_ptr, 0x288);
2998 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
3000 msg_print("Your psychic energy is drained!");
3003 p_ptr->csp = MAX(0, p_ptr->csp - damroll(5, dam) / 2);
3004 p_ptr->redraw |= PR_MANA;
3005 p_ptr->window |= (PW_SPELL);
3006 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
3013 int b = damroll(5, dam) / 4;
3015 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª",
3018 msg_format("You convert %s%s pain into psychic energy!",
3019 m_name, (seen ? "'s" : "s"));
3022 b = MIN(p_ptr->msp, p_ptr->csp + b);
3024 p_ptr->redraw |= PR_MANA;
3025 p_ptr->window |= (PW_SPELL);
3029 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
3031 note_dies = " collapses, a mindless husk.";
3037 case GF_TELEKINESIS:
3039 if (seen) obvious = TRUE;
3040 if (r_ptr->flags3 & (RF3_RES_ALL))
3043 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3045 note = " is immune.";
3048 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3053 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
3058 do_stun = damroll((p_ptr->lev / 10) + 3 , dam) + 1;
3060 /* Attempt a saving throw */
3061 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3062 (r_ptr->level > 5 + randint1(dam)))
3066 /* No obvious effect */
3072 /* Psycho-spear -- powerful magic missile */
3075 if (seen) obvious = TRUE;
3076 if (r_ptr->flags3 & (RF3_RES_ALL))
3079 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3081 note = " is immune.";
3084 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3090 /* Meteor -- powerful magic missile */
3093 if (seen) obvious = TRUE;
3094 if (r_ptr->flags3 & (RF3_RES_ALL))
3097 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3099 note = " is immune.";
3102 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3110 if (!is_hostile(m_ptr)) break;
3111 if (seen) obvious = TRUE;
3113 if (r_ptr->flags3 & (RF3_RES_ALL))
3116 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3118 note = " is immune.";
3121 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3124 /* Attempt a saving throw */
3125 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3126 (r_ptr->flags1 & RF1_QUESTOR) ||
3127 (r_ptr->flags3 & RF3_NO_CONF) ||
3128 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3130 /* Memorize a flag */
3131 if (r_ptr->flags3 & RF3_NO_CONF)
3133 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
3140 * Powerful demons & undead can turn a mindcrafter's
3141 * attacks back on them
3143 if (((r_ptr->flags3 & RF3_UNDEAD) ||
3144 (r_ptr->flags3 & RF3_DEMON)) &&
3145 (r_ptr->level > p_ptr->lev / 2) &&
3150 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
3153 msg_format("%^s%s corrupted mind backlashes your attack!",
3154 m_name, (seen ? "'s" : "s"));
3158 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3161 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3163 msg_print("You resist the effects!");
3169 /* Confuse, stun, terrify */
3170 switch (randint1(4))
3173 set_stun(p_ptr->stun + dam / 2);
3176 set_confused(p_ptr->confused + dam / 2);
3180 if (r_ptr->flags3 & RF3_NO_FEAR)
3182 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3184 note = " is unaffected.";
3188 set_afraid(p_ptr->afraid + dam);
3195 /* No obvious effect */
3197 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3199 note = " is unaffected!";
3207 if ((dam > 29) && (randint1(100) < dam))
3210 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3212 note = " is in your thrall!";
3219 switch (randint1(4))
3233 /* No "real" damage */
3240 /* Ice -- Cold + Cuts + Stun */
3243 if (seen) obvious = TRUE;
3244 if (r_ptr->flags3 & (RF3_RES_ALL))
3247 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3249 note = " is immune.";
3252 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3255 do_stun = (randint1(15) + 1) / (r + 1);
3256 if (r_ptr->flags3 & RF3_IM_COLD)
3259 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3261 note = " resists a lot.";
3265 if (seen) r_ptr->r_flags3 |= (RF3_IM_COLD);
3267 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3270 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3272 note = " is hit hard.";
3276 if (seen) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3285 if (seen) obvious = TRUE;
3287 if (r_ptr->flags3 & (RF3_RES_ALL))
3290 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3292 note = " is immune.";
3295 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3298 if (!monster_living(r_ptr))
3300 if (r_ptr->flags3 & RF3_UNDEAD)
3302 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
3305 if (r_ptr->flags3 & (RF3_DEMON))
3307 if (seen) r_ptr->r_flags3 |= (RF3_DEMON);
3311 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3313 note = " is unaffected!";
3319 else do_time = (dam+7)/8;
3327 if (seen) obvious = TRUE;
3329 if (r_ptr->flags3 & (RF3_RES_ALL))
3332 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3334 note = " is immune.";
3337 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3340 if ((r_ptr->flags3 & RF3_UNDEAD) ||
3341 (r_ptr->flags3 & RF3_NONLIVING))
3343 if (r_ptr->flags3 & RF3_UNDEAD)
3345 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
3349 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3351 note = " is immune.";
3357 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3358 (randint1(888) != 666)) ||
3359 (((r_ptr->level + randint1(20)) > randint1(p_ptr->lev + randint1(10))) &&
3360 randint1(100) != 66))
3363 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3375 /* Polymorph monster (Use "dam" as "power") */
3378 if (seen) obvious = TRUE;
3380 if (r_ptr->flags3 & (RF3_RES_ALL))
3383 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3385 note = " is immune.";
3388 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3391 /* Attempt to polymorph (see below) */
3394 /* Powerful monsters can resist */
3395 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3396 (r_ptr->flags1 & RF1_QUESTOR) ||
3397 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3400 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3402 note = " is unaffected!";
3409 /* No "real" damage */
3416 /* Clone monsters (Ignore "dam") */
3419 if (seen) obvious = TRUE;
3421 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)))
3424 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3426 note = " is unaffected!";
3432 m_ptr->hp = m_ptr->maxhp;
3434 /* Attempt to clone. */
3435 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3438 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3446 /* No "real" damage */
3453 /* Heal Monster (use "dam" as amount of healing) */
3456 if (seen) obvious = TRUE;
3461 if (m_ptr->maxhp < m_ptr->max_maxhp)
3464 msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3466 msg_format("%^s recovers %s vitality.", m_name, m_poss);
3468 m_ptr->maxhp = m_ptr->max_maxhp;
3474 if (seen) obvious = TRUE;
3482 msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3484 msg_format("%^s is no longer stunned.", m_name);
3488 if (m_ptr->confused)
3491 msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3493 msg_format("%^s is no longer confused.", m_name);
3495 m_ptr->confused = 0;
3500 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3502 msg_format("%^s recovers %s courage.", m_name, m_poss);
3508 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3511 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3513 chg_virtue(V_VITALITY, 1);
3515 if (r_ptr->flags1 & RF1_UNIQUE)
3516 chg_virtue(V_INDIVIDUALISM, 1);
3518 if (is_friendly(m_ptr))
3519 chg_virtue(V_HONOUR, 1);
3520 else if (!(r_ptr->flags3 & RF3_EVIL))
3522 if (r_ptr->flags3 & RF3_GOOD)
3523 chg_virtue(V_COMPASSION, 2);
3525 chg_virtue(V_COMPASSION, 1);
3528 if (m_ptr->r_idx == MON_LEPER)
3531 chg_virtue(V_COMPASSION, 5);
3534 if (r_ptr->flags3 & RF3_ANIMAL)
3535 chg_virtue(V_NATURE, 1);
3537 /* Redraw (later) if needed */
3538 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3539 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3543 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3545 note = " looks healthier.";
3549 /* No "real" damage */
3555 /* Speed Monster (Ignore "dam") */
3558 if (seen) obvious = TRUE;
3564 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3566 note = " starts moving faster.";
3569 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3571 if (c_ptr->m_idx == p_ptr->riding)
3572 p_ptr->update |= (PU_BONUS);
3574 if (r_ptr->flags1 & RF1_UNIQUE)
3575 chg_virtue(V_INDIVIDUALISM, 1);
3576 if (is_friendly(m_ptr))
3577 chg_virtue(V_HONOUR, 1);
3579 /* No "real" damage */
3585 /* Slow Monster (Use "dam" as "power") */
3588 if (seen) obvious = TRUE;
3590 if (r_ptr->flags3 & (RF3_RES_ALL))
3593 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3595 note = " is immune.";
3598 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3601 /* Powerful monsters can resist */
3602 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3603 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3606 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3608 note = " is unaffected!";
3614 /* Normal monsters slow down */
3620 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3622 note = " starts moving slower.";
3625 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3627 if (c_ptr->m_idx == p_ptr->riding)
3628 p_ptr->update |= (PU_BONUS);
3631 /* No "real" damage */
3637 /* Sleep (Use "dam" as "power") */
3640 if (seen) obvious = TRUE;
3642 if (r_ptr->flags3 & (RF3_RES_ALL))
3645 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3647 note = " is immune.";
3650 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3653 /* Attempt a saving throw */
3654 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3655 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3656 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3658 /* Memorize a flag */
3659 if (r_ptr->flags3 & RF3_NO_SLEEP)
3661 if (seen) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3664 /* No obvious effect */
3666 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3668 note = " is unaffected!";
3675 /* Go to sleep (much) later */
3677 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3679 note = " falls asleep!";
3685 /* No "real" damage */
3691 /* Sleep (Use "dam" as "power") */
3692 case GF_STASIS_EVIL:
3694 if (seen) obvious = TRUE;
3696 if (r_ptr->flags3 & (RF3_RES_ALL))
3699 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3701 note = " is immune.";
3704 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3707 /* Attempt a saving throw */
3708 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3709 !(r_ptr->flags3 & RF3_EVIL) ||
3710 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3713 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3715 note = " is unaffected!";
3722 /* Go to sleep (much) later */
3724 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3726 note = " is suspended!";
3732 /* No "real" damage */
3737 /* Sleep (Use "dam" as "power") */
3740 if (seen) obvious = TRUE;
3742 if (r_ptr->flags3 & (RF3_RES_ALL))
3745 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3747 note = " is immune.";
3750 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3753 /* Attempt a saving throw */
3754 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3755 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3758 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3760 note = " is unaffected!";
3767 /* Go to sleep (much) later */
3769 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3771 note = " is suspended!";
3777 /* No "real" damage */
3786 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3787 vir = virtue_number(V_HARMONY);
3790 dam += p_ptr->virtues[vir-1]/10;
3793 vir = virtue_number(V_INDIVIDUALISM);
3796 dam -= p_ptr->virtues[vir-1]/20;
3799 if (seen) obvious = TRUE;
3801 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3804 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3806 note = " is immune.";
3809 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3813 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3816 /* Attempt a saving throw */
3817 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3818 (r_ptr->flags3 & RF3_NO_CONF) ||
3819 (m_ptr->mflag2 & MFLAG_NOPET) ||
3820 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3822 /* Memorize a flag */
3823 if (r_ptr->flags3 & RF3_NO_CONF)
3825 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
3829 /* No obvious effect */
3831 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3833 note = " is unaffected!";
3838 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3840 else if (p_ptr->cursed & TRC_AGGRAVATE)
3843 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3845 note = " hates you too much!";
3848 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3853 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3855 note = " suddenly seems friendly!";
3860 chg_virtue(V_INDIVIDUALISM, -1);
3861 if (r_ptr->flags3 & RF3_ANIMAL)
3862 chg_virtue(V_NATURE, 1);
3865 /* No "real" damage */
3870 /* Control undead */
3871 case GF_CONTROL_UNDEAD:
3874 if (seen) obvious = TRUE;
3876 vir = virtue_number(V_UNLIFE);
3879 dam += p_ptr->virtues[vir-1]/10;
3882 vir = virtue_number(V_INDIVIDUALISM);
3885 dam -= p_ptr->virtues[vir-1]/20;
3888 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3891 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3893 note = " is immune.";
3896 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3900 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3903 /* Attempt a saving throw */
3904 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3905 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3906 (m_ptr->mflag2 & MFLAG_NOPET) ||
3907 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3909 /* No obvious effect */
3911 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3913 note = " is unaffected!";
3917 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3919 else if (p_ptr->cursed & TRC_AGGRAVATE)
3922 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3924 note = " hates you too much!";
3927 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3932 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3934 note = " is in your thrall!";
3940 /* No "real" damage */
3946 case GF_CONTROL_DEMON:
3949 if (seen) obvious = TRUE;
3951 vir = virtue_number(V_UNLIFE);
3954 dam += p_ptr->virtues[vir-1]/10;
3957 vir = virtue_number(V_INDIVIDUALISM);
3960 dam -= p_ptr->virtues[vir-1]/20;
3963 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3966 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3968 note = " is immune.";
3971 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3975 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3978 /* Attempt a saving throw */
3979 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3980 (!(r_ptr->flags3 & RF3_DEMON)) ||
3981 (m_ptr->mflag2 & MFLAG_NOPET) ||
3982 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3984 /* No obvious effect */
3986 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3988 note = " is unaffected!";
3992 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3994 else if (p_ptr->cursed & TRC_AGGRAVATE)
3997 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3999 note = " hates you too much!";
4002 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4007 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
4009 note = " is in your thrall!";
4015 /* No "real" damage */
4021 case GF_CONTROL_ANIMAL:
4025 if (seen) obvious = TRUE;
4027 vir = virtue_number(V_NATURE);
4030 dam += p_ptr->virtues[vir-1]/10;
4033 vir = virtue_number(V_INDIVIDUALISM);
4036 dam -= p_ptr->virtues[vir-1]/20;
4039 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
4042 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4044 note = " is immune.";
4047 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4051 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4054 /* Attempt a saving throw */
4055 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4056 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
4057 (m_ptr->mflag2 & MFLAG_NOPET) ||
4058 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4059 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4061 /* Memorize a flag */
4062 if (r_ptr->flags3 & (RF3_NO_CONF))
4064 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
4068 /* No obvious effect */
4070 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4072 note = " is unaffected!";
4076 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4078 else if (p_ptr->cursed & TRC_AGGRAVATE)
4081 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4083 note = " hates you too much!";
4086 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4091 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4093 note = " is tamed!";
4098 if (r_ptr->flags3 & RF3_ANIMAL)
4099 chg_virtue(V_NATURE, 1);
4102 /* No "real" damage */
4108 case GF_CONTROL_LIVING:
4112 vir = virtue_number(V_UNLIFE);
4113 if (seen) obvious = TRUE;
4115 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4116 vir = virtue_number(V_UNLIFE);
4119 dam -= p_ptr->virtues[vir-1]/10;
4122 vir = virtue_number(V_INDIVIDUALISM);
4125 dam -= p_ptr->virtues[vir-1]/20;
4128 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4129 if (dam < 1) dam = 1;
4131 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4133 msg_format("You stare into %s.", m_name);
4135 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
4138 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4140 note = " is immune.";
4143 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4147 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4150 /* Attempt a saving throw */
4151 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4152 (m_ptr->mflag2 & MFLAG_NOPET) ||
4153 (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) ||
4154 ((r_ptr->level+10) > randint1(dam)))
4157 /* No obvious effect */
4159 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4161 note = " is unaffected!";
4165 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4167 else if (p_ptr->cursed & TRC_AGGRAVATE)
4170 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4172 note = " hates you too much!";
4175 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4180 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4182 note = " is tamed!";
4187 if (r_ptr->flags3 & RF3_ANIMAL)
4188 chg_virtue(V_NATURE, 1);
4191 /* No "real" damage */
4196 /* Confusion (Use "dam" as "power") */
4199 if (seen) obvious = TRUE;
4201 if (r_ptr->flags3 & (RF3_RES_ALL))
4204 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4206 note = " is immune.";
4209 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4212 /* Get confused later */
4213 do_conf = damroll(3, (dam / 2)) + 1;
4215 /* Attempt a saving throw */
4216 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4217 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4218 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4220 /* Memorize a flag */
4221 if (r_ptr->flags3 & (RF3_NO_CONF))
4223 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
4229 /* No obvious effect */
4231 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4233 note = " is unaffected!";
4239 /* No "real" damage */
4246 if (seen) obvious = TRUE;
4248 if (r_ptr->flags3 & (RF3_RES_ALL))
4251 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4253 note = " is immune.";
4256 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4259 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
4261 /* Attempt a saving throw */
4262 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4263 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4268 /* No obvious effect */
4270 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4272 note = " is unaffected!";
4278 /* No "real" damage */
4286 /* Lite, but only hurts susceptible creatures */
4294 if (r_ptr->flags3 & (RF3_RES_ALL))
4300 if (r_ptr->flags3 & (RF3_HURT_LITE))
4302 /* Obvious effect */
4303 if (seen) obvious = TRUE;
4305 /* Memorize the effects */
4306 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4308 /* Special effect */
4310 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4311 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4313 note = " cringes from the light!";
4314 note_dies = " shrivels away in the light!";
4319 /* Normally no damage */
4331 /* Lite -- opposite of Dark */
4334 if (seen) obvious = TRUE;
4335 if (r_ptr->flags3 & (RF3_RES_ALL))
4338 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4340 note = " is immune.";
4343 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4346 if (r_ptr->flags4 & (RF4_BR_LITE))
4349 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4354 dam *= 2; dam /= (randint1(6)+6);
4356 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4358 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4360 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4361 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4363 note = " cringes from the light!";
4364 note_dies = " shrivels away in the light!";
4373 /* Dark -- opposite of Lite */
4376 if (seen) obvious = TRUE;
4378 if (r_ptr->flags3 & (RF3_RES_ALL))
4381 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4383 note = " is immune.";
4386 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4389 /* Likes darkness... */
4390 if ((r_ptr->flags4 & (RF4_BR_DARK)) ||
4391 (r_ptr->flags3 & RF3_ORC) ||
4392 (r_ptr->flags3 & RF3_HURT_LITE))
4395 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4400 dam *= 2; dam /= (randint1(6)+6);
4409 if (r_ptr->flags3 & (RF3_RES_ALL))
4414 /* Hurt by rock remover */
4415 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4418 if (seen) obvious = TRUE;
4420 /* Memorize the effects */
4421 if (seen) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4423 /* Cute little message */
4425 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4426 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4428 note = " loses some skin!";
4429 note_dies = " dissolves!";
4434 /* Usually, ignore the effects */
4445 /* Teleport undead (Use "dam" as "power") */
4446 case GF_AWAY_UNDEAD:
4448 /* Only affect undead */
4449 if (r_ptr->flags3 & (RF3_UNDEAD))
4451 bool resists_tele = FALSE;
4453 if (r_ptr->flags3 & (RF3_RES_TELE))
4455 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4457 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4459 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4461 note = " is unaffected!";
4464 resists_tele = TRUE;
4466 else if (r_ptr->level > randint1(100))
4468 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4470 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4475 resists_tele = TRUE;
4481 if (seen) obvious = TRUE;
4482 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4494 /* No "real" damage */
4500 /* Teleport evil (Use "dam" as "power") */
4503 /* Only affect evil */
4504 if (r_ptr->flags3 & (RF3_EVIL))
4506 bool resists_tele = FALSE;
4508 if (r_ptr->flags3 & (RF3_RES_TELE))
4510 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4512 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4514 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4516 note = " is unaffected!";
4519 resists_tele = TRUE;
4521 else if (r_ptr->level > randint1(100))
4523 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4525 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4530 resists_tele = TRUE;
4536 if (seen) obvious = TRUE;
4537 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4549 /* No "real" damage */
4555 /* Teleport monster (Use "dam" as "power") */
4558 bool resists_tele = FALSE;
4559 if (r_ptr->flags3 & (RF3_RES_TELE))
4561 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4563 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4565 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4567 note = " is unaffected!";
4570 resists_tele = TRUE;
4572 else if (r_ptr->level > randint1(100))
4574 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4576 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4581 resists_tele = TRUE;
4588 if (seen) obvious = TRUE;
4590 /* Prepare to teleport */
4594 /* No "real" damage */
4600 /* Turn undead (Use "dam" as "power") */
4601 case GF_TURN_UNDEAD:
4603 if (r_ptr->flags3 & (RF3_RES_ALL))
4608 /* Only affect undead */
4609 if (r_ptr->flags3 & (RF3_UNDEAD))
4611 /* Learn about type */
4612 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4615 if (seen) obvious = TRUE;
4617 /* Apply some fear */
4618 do_fear = damroll(3, (dam / 2)) + 1;
4620 /* Attempt a saving throw */
4621 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4623 /* No obvious effect */
4625 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4627 note = " is unaffected!";
4642 /* No "real" damage */
4648 /* Turn evil (Use "dam" as "power") */
4651 if (r_ptr->flags3 & (RF3_RES_ALL))
4656 /* Only affect evil */
4657 if (r_ptr->flags3 & (RF3_EVIL))
4659 /* Learn about type */
4660 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4663 if (seen) obvious = TRUE;
4665 /* Apply some fear */
4666 do_fear = damroll(3, (dam / 2)) + 1;
4668 /* Attempt a saving throw */
4669 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4671 /* No obvious effect */
4673 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4675 note = " is unaffected!";
4690 /* No "real" damage */
4696 /* Turn monster (Use "dam" as "power") */
4699 if (r_ptr->flags3 & (RF3_RES_ALL))
4705 if (seen) obvious = TRUE;
4707 /* Apply some fear */
4708 do_fear = damroll(3, (dam / 2)) + 1;
4710 /* Attempt a saving throw */
4711 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4712 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4713 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4715 /* No obvious effect */
4717 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4719 note = " is unaffected!";
4726 /* No "real" damage */
4733 case GF_DISP_UNDEAD:
4735 if (r_ptr->flags3 & (RF3_RES_ALL))
4741 /* Only affect undead */
4742 if (r_ptr->flags3 & (RF3_UNDEAD))
4744 /* Learn about type */
4745 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4748 if (seen) obvious = TRUE;
4752 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4753 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4755 note = " shudders.";
4756 note_dies = " dissolves!";
4778 if (r_ptr->flags3 & (RF3_RES_ALL))
4784 /* Only affect evil */
4785 if (r_ptr->flags3 & (RF3_EVIL))
4787 /* Learn about type */
4788 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4791 if (seen) obvious = TRUE;
4795 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4796 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4798 note = " shudders.";
4799 note_dies = " dissolves!";
4820 if (r_ptr->flags3 & (RF3_RES_ALL))
4826 /* Only affect good */
4827 if (r_ptr->flags3 & (RF3_GOOD))
4829 /* Learn about type */
4830 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
4833 if (seen) obvious = TRUE;
4837 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4838 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4840 note = " shudders.";
4841 note_dies = " dissolves!";
4860 case GF_DISP_LIVING:
4862 if (r_ptr->flags3 & (RF3_RES_ALL))
4868 /* Only affect non-undead */
4869 if (monster_living(r_ptr))
4872 if (seen) obvious = TRUE;
4876 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4877 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4879 note = " shudders.";
4880 note_dies = " dissolves!";
4901 if (r_ptr->flags3 & (RF3_RES_ALL))
4907 /* Only affect demons */
4908 if (r_ptr->flags3 & (RF3_DEMON))
4910 /* Learn about type */
4911 if (seen) r_ptr->r_flags3 |= (RF3_DEMON);
4914 if (seen) obvious = TRUE;
4918 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4919 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4921 note = " shudders.";
4922 note_dies = " dissolves!";
4940 /* Dispel monster */
4943 if (r_ptr->flags3 & (RF3_RES_ALL))
4950 if (seen) obvious = TRUE;
4954 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4955 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4957 note = " shudders.";
4958 note_dies = " dissolves!";
4968 if (seen) obvious = TRUE;
4969 if (r_ptr->flags3 & (RF3_RES_ALL))
4972 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4974 note = " is immune.";
4977 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4981 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4985 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£",m_name);
4987 msg_format("You draw psychic energy from %s.", m_name);
4990 (void)hp_player(dam);
4995 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
4997 msg_format("%s is unaffected.", m_name);
5007 if (seen) obvious = TRUE;
5010 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5012 msg_format("You gaze intently at %s.", m_name);
5015 if (r_ptr->flags3 & (RF3_RES_ALL))
5018 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5020 note = " is immune.";
5023 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5027 /* Attempt a saving throw */
5028 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5029 (r_ptr->flags3 & RF3_NO_CONF) ||
5030 (r_ptr->level > randint1((p_ptr->lev*2 - 10) < 1 ? 1 : (p_ptr->lev*2 - 10)) + 10))
5032 /* Memorize a flag */
5033 if (r_ptr->flags3 & (RF3_NO_CONF))
5035 r_ptr->r_flags3 |= (RF3_NO_CONF);
5038 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5040 note = "is unaffected!";
5047 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5048 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±¶õ¤È¤Ê¤Ã¤¿¡£";
5050 msg_format("%^s is blasted by psionic energy.", m_name);
5051 note_dies = " collapses, a mindless husk.";
5054 do_conf = randint0(8) + 8;
5060 case GF_BRAIN_SMASH:
5062 if (seen) obvious = TRUE;
5065 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5067 msg_format("You gaze intently at %s.", m_name);
5070 if (r_ptr->flags3 & (RF3_RES_ALL))
5073 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5075 note = " is immune.";
5078 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5082 /* Attempt a saving throw */
5083 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5084 (r_ptr->flags3 & RF3_NO_CONF) ||
5085 (r_ptr->level > randint1((p_ptr->lev*2 - 10) < 1 ? 1 : (p_ptr->lev*2 - 10)) + 10))
5087 /* Memorize a flag */
5088 if (r_ptr->flags3 & (RF3_NO_CONF))
5090 r_ptr->r_flags3 |= (RF3_NO_CONF);
5093 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5095 note = "is unaffected!";
5102 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5103 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±¶õ¤È¤Ê¤Ã¤¿¡£";
5105 msg_format("%^s is blasted by psionic energy.", m_name);
5106 note_dies = " collapses, a mindless husk.";
5109 do_conf = randint0(8) + 8;
5110 do_stun = randint0(8) + 8;
5111 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5112 if (c_ptr->m_idx == p_ptr->riding)
5113 p_ptr->update |= (PU_BONUS);
5121 if (seen) obvious = TRUE;
5124 msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5126 msg_format("You point at %s and curses.", m_name);
5129 if (r_ptr->flags3 & (RF3_RES_ALL))
5132 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5134 note = " is immune.";
5137 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5141 /* Attempt a saving throw */
5142 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5146 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5148 note = "is unaffected!";
5158 if (seen) obvious = TRUE;
5161 msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5163 msg_format("You point at %s and curses horribly.", m_name);
5166 if (r_ptr->flags3 & (RF3_RES_ALL))
5169 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5171 note = " is immune.";
5174 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5178 /* Attempt a saving throw */
5179 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5183 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5185 note = "is unaffected!";
5195 if (seen) obvious = TRUE;
5198 msg_format("%s¤ò»Øº¹¤·¡¢¶²¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª",m_name);
5200 msg_format("You point at %s, incanting terribly!", m_name);
5203 if (r_ptr->flags3 & (RF3_RES_ALL))
5206 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5208 note = " is immune.";
5211 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5215 /* Attempt a saving throw */
5216 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5220 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5222 note = "is unaffected!";
5232 if (seen) obvious = TRUE;
5235 msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£",m_name);
5237 msg_format("You point at %s, screaming th word, 'DIE!'.", m_name);
5240 if (r_ptr->flags3 & (RF3_RES_ALL))
5243 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5245 note = " is immune.";
5248 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5252 /* Attempt a saving throw */
5253 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5257 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5259 note = "is unaffected!";
5269 if (seen) obvious = TRUE;
5271 if (r_ptr->flags3 & (RF3_RES_ALL))
5274 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5276 note = " is immune.";
5279 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5283 if (r_ptr->flags1 & RF1_UNIQUE)
5286 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5288 note = "is unaffected!";
5294 if ((p_ptr->lev + randint1(dam)) >
5295 (r_ptr->level + randint1(200)))
5297 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5299 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5304 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5314 /* Capture monster */
5318 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5319 (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_UNIQUE_7)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR))
5322 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5324 msg_format("%^s is unaffected.", m_name);
5330 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5331 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)))
5332 nokori_hp = m_ptr->maxhp * 3 / 10;
5334 nokori_hp = m_ptr->maxhp * 3 / 20;
5336 if (m_ptr->hp >= nokori_hp)
5339 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5341 msg_format("You need to weaken %s more.", m_name);
5345 else if (m_ptr->hp < randint0(nokori_hp))
5347 if (m_ptr->mflag2 & MFLAG_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5349 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5351 msg_format("You capture %^s!", m_name);
5353 cap_mon = m_list[c_ptr->m_idx].r_idx;
5354 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5355 cap_hp = m_list[c_ptr->m_idx].hp;
5356 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5357 if (m_list[c_ptr->m_idx].nickname)
5358 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5361 if (c_ptr->m_idx == p_ptr->riding)
5363 if (rakuba(-1, FALSE))
5366 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5368 msg_format("You have fallen from %s.", m_name);
5373 delete_monster_idx(c_ptr->m_idx);
5380 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5382 msg_format("You failed to capture %s.", m_name);
5391 if (seen) obvious = TRUE;
5393 if (dam == HISSATSU_NYUSIN)
5397 bool success = FALSE;
5398 for (i = 0; i < 8; i++)
5400 if (cave_empty_bold(y+ddy[i], x+ddx[i]) || ((y+ddy[i] == py) && (x+ddx[i] == px)))
5403 if (distance(py, px, ny, nx) > distance(py, px, y+ddy[i], x+ddx[i]))
5412 if ((ny != py) || (nx != px))
5414 teleport_player_to(ny, nx, FALSE);
5416 msg_print("ÁÇÁ᤯Áê¼ê¤Î²û¤ËÆþ¤ê¹þ¤ó¤À¡ª");
5418 msg_format("You quickly jump in and attack %s!", m_name);
5425 msg_print("¼ºÇÔ¡ª");
5427 msg_print("Failed!");
5434 return (py_attack(y, x, dam));
5437 msg_print("¹¶·â¤Ï¶õ¤òÀڤä¿¡£");
5439 msg_print("You attack the empty air.");
5445 /* Sleep (Use "dam" as "power") */
5451 if (seen) obvious = TRUE;
5453 if (r_ptr->flags3 & (RF3_RES_ALL))
5456 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5458 note = " is immune.";
5461 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5464 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5467 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5469 note = " is immune!";
5473 if (seen) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5479 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5481 note = " is immune!";
5488 if (one_in_(5)) effect = 1;
5489 else if (one_in_(4)) effect = 2;
5490 else if (one_in_(3)) effect = 3;
5495 /* Powerful monsters can resist */
5496 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5497 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5500 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5502 note = " is unaffected!";
5508 /* Normal monsters slow down */
5514 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5516 note = " starts moving slower.";
5519 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5521 if (c_ptr->m_idx == p_ptr->riding)
5522 p_ptr->update |= (PU_BONUS);
5526 else if (effect == 2)
5528 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5530 /* Attempt a saving throw */
5531 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5532 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5537 /* No obvious effect */
5539 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5541 note = " is unaffected!";
5548 else if (effect == 3)
5550 /* Attempt a saving throw */
5551 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5552 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5553 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5555 /* Memorize a flag */
5556 if (r_ptr->flags3 & RF3_NO_SLEEP)
5558 if (seen) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5561 /* No obvious effect */
5563 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5565 note = " is unaffected!";
5572 /* Go to sleep (much) later */
5574 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5576 note = " falls asleep!";
5586 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5588 note = " is immune!";
5592 /* No "real" damage */
5601 if (seen) obvious = TRUE;
5603 if (r_ptr->flags3 & (RF3_RES_ALL))
5606 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5608 note = " is immune.";
5611 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5615 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)
5622 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG_NOGENO))
5629 delete_monster_idx(c_ptr->m_idx);
5631 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5633 msg_format("%^s disappered!",m_name);
5637 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5639 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5643 chg_virtue(V_VITALITY, -1);
5648 p_ptr->redraw |= (PR_HP);
5651 p_ptr->window |= (PW_PLAYER);
5658 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5660 note = "is unaffected!";
5663 if (one_in_(13)) m_ptr->mflag2 |= MFLAG_NOGENO;
5671 msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£",m_name);
5673 msg_format("You take a photograph of %s.",m_name);
5676 if (r_ptr->flags3 & (RF3_HURT_LITE))
5678 /* Obvious effect */
5679 if (seen) obvious = TRUE;
5681 /* Memorize the effects */
5682 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5684 /* Special effect */
5686 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5687 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5689 note = " cringes from the light!";
5690 note_dies = " shrivels away in the light!";
5695 /* Normally no damage */
5702 photo = m_ptr->r_idx;
5709 case GF_BLOOD_CURSE:
5711 if (seen) obvious = TRUE;
5712 if (r_ptr->flags3 & (RF3_RES_ALL))
5715 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5717 note = " is immune.";
5720 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5728 bool success = FALSE;
5729 if (seen) obvious = TRUE;
5731 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5733 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5734 if (dam < 1) dam = 1;
5736 /* No need to tame your pet */
5740 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5742 note = " starts moving faster.";
5745 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5749 /* Attempt a saving throw */
5750 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5751 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5752 (m_ptr->mflag2 & MFLAG_NOPET) ||
5753 (p_ptr->cursed & TRC_AGGRAVATE) ||
5754 ((r_ptr->level+10) > randint1(dam)))
5757 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
5762 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5764 note = " is tamed!";
5768 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5770 /* Learn about type */
5771 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
5778 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5780 do_fear = randint1(90)+10;
5784 r_ptr->r_flags3 |= (RF3_NO_FEAR);
5788 /* No "real" damage */
5795 if (seen) obvious = TRUE;
5797 if (r_ptr->flags3 & (RF3_RES_ALL))
5800 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5802 note = " is immune.";
5805 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5809 /* Attempt a saving throw */
5810 if (randint0(100 + dam) < (r_ptr->level + 50))
5814 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5816 note = "is unaffected!";
5837 /* Absolutely no effect */
5838 if (skipped) return (FALSE);
5840 /* "Unique" monsters cannot be polymorphed */
5841 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5843 /* Quest monsters cannot be polymorphed */
5844 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5846 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5848 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5849 if (((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7) || (r_ptr->flags1 & RF1_QUESTOR)) && !p_ptr->inside_battle)
5851 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5856 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5857 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5860 /* Modify the damage */
5862 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5864 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤";
5866 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5869 /* Check for death */
5870 if (dam > m_ptr->hp)
5872 /* Extract method of death */
5876 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5877 else if (do_poly && (randint1(90) > r_ptr->level))
5879 if (polymorph_monster(y, x))
5882 if (seen) obvious = TRUE;
5884 /* Monster polymorphs */
5886 note = "¤¬ÊѿȤ·¤¿¡ª";
5892 /* Turn off the damage */
5895 /* Hack -- Get new monster */
5896 m_ptr = &m_list[c_ptr->m_idx];
5898 /* Hack -- Get new race */
5899 r_ptr = &r_info[m_ptr->r_idx];
5905 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5907 note = " is unaffected!";
5913 /* Handle "teleport" */
5917 if (seen) obvious = TRUE;
5921 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5923 note = " disappears!";
5926 chg_virtue(V_VALOUR, -1);
5929 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who));
5931 /* Hack -- get new location */
5935 /* Hack -- get new grid */
5936 c_ptr = &cave[y][x];
5939 /* Sound and Impact breathers never stun */
5941 !(r_ptr->flags4 & (RF4_BR_SOUN)) &&
5942 !(r_ptr->flags4 & (RF4_BR_WALL)) &&
5943 !(r_ptr->flags3 & (RF3_NO_STUN)))
5946 if (seen) obvious = TRUE;
5952 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5954 note = " is more dazed.";
5957 tmp = m_ptr->stunned + (do_stun / 2);
5962 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5964 note = " is dazed.";
5971 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5977 /* Confusion and Chaos breathers (and sleepers) never confuse */
5979 !(r_ptr->flags3 & (RF3_NO_CONF)) &&
5980 !(r_ptr->flags4 & (RF4_BR_CONF)) &&
5981 !(r_ptr->flags4 & (RF4_BR_CHAO)))
5984 if (seen) obvious = TRUE;
5986 /* Already partially confused */
5987 if (m_ptr->confused)
5990 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5992 note = " looks more confused.";
5995 tmp = m_ptr->confused + (do_conf / 2);
5998 /* Was not confused */
6002 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
6004 note = " looks confused.";
6010 /* Apply confusion */
6011 m_ptr->confused = (tmp < 200) ? tmp : 200;
6019 if (seen) obvious = TRUE;
6021 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp-1;
6026 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
6028 note = " seems weakened.";
6030 m_ptr->maxhp -= do_time;
6031 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp-m_ptr->maxhp;
6041 tmp = m_ptr->monfear + do_fear;
6044 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6051 /* If another monster did the damage, hurt the monster by hand */
6054 /* Redraw (later) if needed */
6055 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6056 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6058 /* Wake the monster up */
6061 /* Hurt the monster */
6069 if (is_pet(m_ptr) && !(m_ptr->ml))
6072 /* Give detailed messages if destroyed */
6075 monster_desc(m_name, m_ptr, 0x100);
6078 msg_format("%^s%s", m_name, note);
6086 monster_gain_exp(who, m_ptr->r_idx);
6088 /* Generate treasure, etc */
6089 monster_death(c_ptr->m_idx, FALSE);
6091 /* Delete the monster */
6092 delete_monster_idx(c_ptr->m_idx);
6097 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6099 msg_print("You feel sad for a moment.");
6105 /* Damaged monster */
6108 /* Give detailed messages if visible or destroyed */
6109 if (note && seen) msg_format("%^s%s", m_name, note);
6111 /* Hack -- Pain message */
6114 message_pain(c_ptr->m_idx, dam);
6121 /* Hack -- handle sleep */
6122 if (do_sleep) m_ptr->csleep = do_sleep;
6126 else if (heal_leper)
6129 msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6131 msg_print("The Mangy looking leper is healed!");
6134 delete_monster_idx(c_ptr->m_idx);
6136 /* If the player did it, give him experience, check fear */
6137 else if (typ != GF_DRAIN_MANA)
6141 /* Hurt the monster, check for fear and death */
6142 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6147 /* Damaged monster */
6150 /* HACK - anger the monster before showing the sleep message */
6151 if (do_sleep) anger_monster(m_ptr);
6153 /* Give detailed messages if visible or destroyed */
6156 msg_format("%s%s", m_name, note);
6158 msg_format("%^s%s", m_name, note);
6162 /* Hack -- Pain message */
6163 else if (known && (dam || !do_fear))
6165 message_pain(c_ptr->m_idx, dam);
6168 /* Anger monsters */
6169 if (((dam > 0) || get_angry) && !do_sleep)
6170 anger_monster(m_ptr);
6173 if ((fear || do_fear) && (m_ptr->ml))
6180 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6182 msg_format("%^s flees in terror!", m_name);
6187 /* Hack -- handle sleep */
6188 if (do_sleep) m_ptr->csleep = do_sleep;
6192 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6194 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6198 switch (randint1(28))
6204 msg_print("ÃÏÌ̤¬Íɤ줿...");
6206 msg_print("The ground trembles...");
6209 earthquake(ty, tx, 4 + randint0(4));
6210 if (!one_in_(6)) break;
6212 case 3: case 4: case 5: case 6:
6215 int dam = damroll(10, 10);
6217 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6219 msg_print("A portal opens to a plane of raw mana!");
6222 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6223 if (!one_in_(6)) break;
6229 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6231 msg_print("Space warps about you!");
6234 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE);
6235 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6236 if (!one_in_(6)) break;
6238 case 9: case 10: case 11:
6240 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6242 msg_print("You feel a surge of energy!");
6245 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6246 if (!one_in_(6)) break;
6247 case 12: case 13: case 14: case 15: case 16:
6248 aggravate_monsters(0);
6249 if (!one_in_(6)) break;
6251 count += activate_hi_summon(ty, tx, TRUE);
6252 if (!one_in_(6)) break;
6253 case 19: case 20: case 21: case 22:
6255 bool pet = !one_in_(3);
6256 u32b mode = PM_ALLOW_GROUP;
6258 if (pet) mode |= PM_FORCE_PET;
6259 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6261 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6262 if (!one_in_(6)) break;
6264 case 23: case 24: case 25:
6265 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6267 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6269 msg_print("You feel your life draining away...");
6272 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6273 else lose_exp(p_ptr->exp / 16);
6274 if (!one_in_(6)) break;
6275 case 26: case 27: case 28:
6284 (void)do_dec_stat(i);
6293 (void)do_dec_stat(randint0(6));
6302 if (p_ptr->inside_battle)
6304 p_ptr->health_who = c_ptr->m_idx;
6305 p_ptr->redraw |= (PR_HEALTH);
6309 /* XXX XXX XXX Verify this code */
6311 /* Update the monster */
6312 update_mon(c_ptr->m_idx, FALSE);
6314 /* Redraw the monster grid */
6318 /* Update monster recall window */
6319 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6322 p_ptr->window |= (PW_MONSTER);
6325 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6329 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6331 set_target(m_ptr, monster_target_y, monster_target_x);
6334 else if (is_pet(&m_list[who]) && (m_ptr->target_y != py) && (m_ptr->target_x != px))
6336 set_target(m_ptr, m_list[who].fy, m_list[who].fx);
6340 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6342 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6343 rakubadam_m = (dam > 200) ? 200 : dam;
6352 /* Get local object */
6355 /* Prepare to make a Blade of Chaos */
6356 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6358 q_ptr->pval = photo;
6360 /* Mark the item as fully known */
6361 q_ptr->ident |= (IDENT_MENTAL);
6363 /* Drop it in the dungeon */
6364 (void)drop_near(q_ptr, -1, py, px);
6372 /* Return "Anything seen?" */
6378 * Helper function for "project()" below.
6380 * Handle a beam/bolt/ball causing damage to the player.
6382 * This routine takes a "source monster" (by index), a "distance", a default
6383 * "damage", and a "damage type". See "project_m()" above.
6385 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6386 * is reduced (see "project_m()" above). This can happen if a monster breathes
6387 * at the player and hits a wall instead.
6389 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6390 * to know if this is actually a ball or a bolt spell
6393 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6394 * we just assume that the effects were obvious, for historical reasons.
6396 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6401 /* Hack -- assume obvious */
6402 bool obvious = TRUE;
6404 /* Player blind-ness */
6405 bool blind = (p_ptr->blind ? TRUE : FALSE);
6407 /* Player needs a "description" (he is blind) */
6410 /* Source monster */
6411 monster_type *m_ptr = NULL;
6413 /* Monster name (for attacks) */
6416 /* Monster name (for damage) */
6419 /* Hack -- messages */
6425 /* Player is not here */
6426 if ((x != px) || (y != py)) return (FALSE);
6428 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6434 /* Player cannot hurt himself */
6435 if (!who) return (FALSE);
6436 if (who == p_ptr->riding) return (FALSE);
6438 if ((p_ptr->reflect || p_ptr->tim_reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6441 int max_attempts = 10;
6444 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6445 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6446 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6448 if (blind) msg_print("Something bounces!");
6449 else msg_print("The attack bounces!");
6453 /* Choose 'new' target */
6456 t_y = m_list[who].fy - 1 + randint1(3);
6457 t_x = m_list[who].fx - 1 + randint1(3);
6460 while (max_attempts && in_bounds2u(t_y, t_x) &&
6461 !(player_has_los_bold(t_y, t_x)));
6463 if (max_attempts < 1)
6465 t_y = m_list[who].fy;
6466 t_x = m_list[who].fx;
6469 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6476 /* Limit maximum damage */
6477 if (dam > 1600) dam = 1600;
6479 /* Reduce damage by distance */
6480 dam = (dam + r) / (r + 1);
6483 /* If the player is blind, be more descriptive */
6484 if (blind) fuzzy = TRUE;
6489 /* Get the source monster */
6490 m_ptr = &m_list[who];
6491 /* Extract the monster level */
6492 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6494 /* Get the monster name */
6495 monster_desc(m_name, m_ptr, 0);
6497 /* Get the monster's real name (gotten before polymorph!) */
6498 strcpy(killer, who_name);
6503 strcpy(killer, "æ«");
6505 strcpy(killer, "a trap");
6509 /* Analyze the damage */
6512 /* Standard damage -- hurts inventory too */
6516 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6518 if (fuzzy) msg_print("You are hit by acid!");
6521 get_damage = acid_dam(dam, killer, monspell);
6525 /* Standard damage -- hurts inventory too */
6529 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6531 if (fuzzy) msg_print("You are hit by fire!");
6534 get_damage = fire_dam(dam, killer, monspell);
6538 /* Standard damage -- hurts inventory too */
6542 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6544 if (fuzzy) msg_print("You are hit by cold!");
6547 get_damage = cold_dam(dam, killer, monspell);
6551 /* Standard damage -- hurts inventory too */
6555 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6557 if (fuzzy) msg_print("You are hit by lightning!");
6560 get_damage = elec_dam(dam, killer, monspell);
6564 /* Standard damage -- also poisons player */
6567 bool double_resist = (p_ptr->oppose_pois || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU));
6569 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6571 if (fuzzy) msg_print("You are hit by poison!");
6574 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6575 if (double_resist) dam = (dam + 2) / 3;
6577 if ((!(double_resist || p_ptr->resist_pois)) &&
6578 one_in_(HURT_CHANCE))
6583 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6585 if (!(double_resist || p_ptr->resist_pois))
6587 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6592 /* Standard damage -- also poisons / mutates player */
6595 bool double_resist = (p_ptr->oppose_pois || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU));
6597 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6599 if (fuzzy) msg_print("You are hit by radiation!");
6602 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6603 if (double_resist) dam = (2 * dam + 2) / 5;
6604 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6605 if (!(double_resist || p_ptr->resist_pois))
6607 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6609 if (one_in_(5)) /* 6 */
6612 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6614 msg_print("You undergo a freakish metamorphosis!");
6617 if (one_in_(4)) /* 4 */
6625 inven_damage(set_acid_destroy, 2);
6631 /* Standard damage */
6635 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6637 if (fuzzy) msg_print("You are hit by something!");
6640 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6644 /* Holy Orb -- Player only takes partial damage */
6648 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6650 if (fuzzy) msg_print("You are hit by something!");
6653 if (p_ptr->align > 10)
6655 else if (p_ptr->align < -10)
6657 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6664 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6666 if (fuzzy) msg_print("You are hit by something!");
6669 if (p_ptr->align > 10)
6671 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6675 /* Arrow -- XXX no dodging */
6679 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6681 if (fuzzy) msg_print("You are hit by something sharp!");
6684 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6687 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6689 msg_print("You cut down the arrow!");
6693 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6697 /* Plasma -- XXX No resist */
6701 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6703 if (fuzzy) msg_print("You are hit by something *HOT*!");
6706 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6708 if (!p_ptr->resist_sound)
6710 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6711 (void)set_stun(p_ptr->stun + k);
6714 if (!(p_ptr->resist_fire ||
6715 p_ptr->oppose_fire ||
6716 music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU) ||
6717 p_ptr->immune_fire))
6719 inven_damage(set_acid_destroy, 3);
6725 /* Nether -- drain experience */
6729 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6731 if (fuzzy) msg_print("You are hit by nether forces!");
6735 if (p_ptr->resist_neth)
6737 if (!prace_is_(RACE_SPECTRE))
6738 dam *= 6; dam /= (randint1(4) + 7);
6740 else if (p_ptr->prace != RACE_ANDROID)
6742 if (p_ptr->hold_life && (randint0(100) < 75))
6745 msg_print("¤·¤«¤·¼«¸Ê¤ÎÀ¸Ì¿ÎϤò¼é¤ê¤¤Ã¤¿¡ª");
6747 msg_print("You keep hold of your life force!");
6751 else if (p_ptr->hold_life)
6754 msg_print("À¸Ì¿ÎϤ¬¾¯¤·ÂΤ«¤éÈ´¤±Íî¤Á¤¿µ¤¤¬¤¹¤ë¡ª");
6756 msg_print("You feel your life slipping away!");
6759 lose_exp(200 + (p_ptr->exp / 1000) * MON_DRAIN_LIFE);
6764 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6766 msg_print("You feel your life draining away!");
6769 lose_exp(200 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
6773 if (prace_is_(RACE_SPECTRE))
6776 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6778 msg_print("You feel invigorated!");
6782 learn_spell(monspell);
6786 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6792 /* Water -- stun/confuse */
6796 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6798 if (fuzzy) msg_print("You are hit by something wet!");
6801 if (!p_ptr->resist_sound)
6803 set_stun(p_ptr->stun + randint1(40));
6805 if (!p_ptr->resist_conf)
6807 set_confused(p_ptr->confused + randint1(5) + 5);
6812 inven_damage(set_cold_destroy, 3);
6815 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6819 /* Chaos -- many effects */
6823 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6825 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6828 if (p_ptr->resist_chaos)
6830 dam *= 6; dam /= (randint1(4) + 7);
6832 if (!p_ptr->resist_conf)
6834 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6836 if (!p_ptr->resist_chaos)
6838 (void)set_image(p_ptr->image + randint1(10));
6842 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6844 msg_print("Your body is twisted by chaos!");
6847 (void)gain_random_mutation(0);
6850 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6852 if (p_ptr->prace == RACE_ANDROID)
6855 else if (p_ptr->hold_life && (randint0(100) < 75))
6858 msg_print("¤·¤«¤·¼«¸Ê¤ÎÀ¸Ì¿ÎϤò¼é¤ê¤¤Ã¤¿¡ª");
6860 msg_print("You keep hold of your life force!");
6864 else if (p_ptr->hold_life)
6867 msg_print("À¸Ì¿ÎϤ¬¾¯¤·ÂΤ«¤éÈ´¤±Íî¤Á¤¿µ¤¤¬¤¹¤ë¡ª");
6869 msg_print("You feel your life slipping away!");
6872 lose_exp(500 + (p_ptr->exp / 1000) * MON_DRAIN_LIFE);
6877 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6879 msg_print("You feel your life draining away!");
6882 lose_exp(5000 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
6885 if (!p_ptr->resist_chaos || one_in_(9))
6887 inven_damage(set_elec_destroy, 2);
6888 inven_damage(set_fire_destroy, 2);
6890 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6894 /* Shards -- mostly cutting */
6898 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6900 if (fuzzy) msg_print("You are hit by something sharp!");
6903 if (p_ptr->resist_shard)
6905 dam *= 6; dam /= (randint1(4) + 7);
6909 (void)set_cut(p_ptr->cut + dam);
6912 if (!p_ptr->resist_shard || one_in_(13))
6914 inven_damage(set_cold_destroy, 2);
6917 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6921 /* Sound -- mostly stunning */
6925 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6927 if (fuzzy) msg_print("You are hit by a loud noise!");
6930 if (p_ptr->resist_sound)
6932 dam *= 5; dam /= (randint1(4) + 7);
6936 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6937 (void)set_stun(p_ptr->stun + k);
6940 if (!p_ptr->resist_sound || one_in_(13))
6942 inven_damage(set_cold_destroy, 2);
6945 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6949 /* Pure confusion */
6953 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6955 if (fuzzy) msg_print("You are hit by something puzzling!");
6958 if (p_ptr->resist_conf)
6960 dam *= 5; dam /= (randint1(4) + 7);
6962 if (!p_ptr->resist_conf)
6964 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6966 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6970 /* Disenchantment -- see above */
6974 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6976 if (fuzzy) msg_print("You are hit by something static!");
6979 if (p_ptr->resist_disen)
6981 dam *= 6; dam /= (randint1(4) + 7);
6985 (void)apply_disenchant(0);
6987 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6991 /* Nexus -- see above */
6995 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6997 if (fuzzy) msg_print("You are hit by something strange!");
7000 if (p_ptr->resist_nexus)
7002 dam *= 6; dam /= (randint1(4) + 7);
7008 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7012 /* Force -- mostly stun */
7016 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7018 if (fuzzy) msg_print("You are hit by kinetic force!");
7021 if (!p_ptr->resist_sound)
7023 (void)set_stun(p_ptr->stun + randint1(20));
7025 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7030 /* Rocket -- stun, cut */
7034 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
7036 if (fuzzy) msg_print("There is an explosion!");
7039 if (!p_ptr->resist_sound)
7041 (void)set_stun(p_ptr->stun + randint1(20));
7043 if (p_ptr->resist_shard)
7049 (void)set_cut(p_ptr-> cut + ( dam / 2));
7052 if ((!p_ptr->resist_shard) || one_in_(12))
7054 inven_damage(set_cold_destroy, 3);
7057 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7061 /* Inertia -- slowness */
7065 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7067 if (fuzzy) msg_print("You are hit by something slow!");
7070 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7071 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7075 /* Lite -- blinding */
7079 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7081 if (fuzzy) msg_print("You are hit by something!");
7084 if (p_ptr->resist_lite)
7086 dam *= 4; dam /= (randint1(4) + 7);
7088 else if (!blind && !p_ptr->resist_blind)
7090 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7092 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
7095 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
7097 msg_print("The light scorches your flesh!");
7102 else if (prace_is_(RACE_S_FAIRY))
7106 if (p_ptr->wraith_form) dam *= 2;
7107 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7109 if (p_ptr->wraith_form)
7111 p_ptr->wraith_form = 0;
7113 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7115 msg_print("The light forces you out of your incorporeal shadow form.");
7118 p_ptr->redraw |= PR_MAP;
7119 /* Update monsters */
7120 p_ptr->update |= (PU_MONSTERS);
7122 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7124 /* Redraw status bar */
7125 p_ptr->redraw |= (PR_STATUS);
7132 /* Dark -- blinding */
7136 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7138 if (fuzzy) msg_print("You are hit by something!");
7141 if (p_ptr->resist_dark)
7143 dam *= 4; dam /= (randint1(4) + 7);
7145 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7147 else if (!blind && !p_ptr->resist_blind)
7149 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7151 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7155 /* Time -- bolt fewer effects XXX */
7159 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7161 if (fuzzy) msg_print("You are hit by a blast from the past!");
7164 if (p_ptr->resist_time)
7167 dam /= (randint1(4) + 7);
7169 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7171 msg_print("You feel as if time is passing you by.");
7177 switch (randint1(10))
7179 case 1: case 2: case 3: case 4: case 5:
7181 if (p_ptr->prace == RACE_ANDROID) break;
7183 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7185 msg_print("You feel life has clocked back.");
7188 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7192 case 6: case 7: case 8: case 9:
7194 switch (randint1(6))
7197 case 1: k = A_STR; act = "¶¯¤¯"; break;
7198 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7199 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7200 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7201 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7202 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7204 case 1: k = A_STR; act = "strong"; break;
7205 case 2: k = A_INT; act = "bright"; break;
7206 case 3: k = A_WIS; act = "wise"; break;
7207 case 4: k = A_DEX; act = "agile"; break;
7208 case 5: k = A_CON; act = "hale"; break;
7209 case 6: k = A_CHR; act = "beautiful"; break;
7215 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7217 msg_format("You're not as %s as you used to be...", act);
7221 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7222 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7223 p_ptr->update |= (PU_BONUS);
7230 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7232 msg_print("You're not as powerful as you used to be...");
7236 for (k = 0; k < 6; k++)
7238 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7239 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7241 p_ptr->update |= (PU_BONUS);
7247 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7251 /* Gravity -- stun plus slowness plus teleport */
7255 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7256 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7258 if (fuzzy) msg_print("You are hit by something heavy!");
7259 msg_print("Gravity warps around you.");
7264 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7265 if (!(p_ptr->resist_sound || p_ptr->ffall))
7267 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7268 (void)set_stun(p_ptr->stun + k);
7272 dam = (dam * 2) / 3;
7275 if (!p_ptr->ffall || one_in_(13))
7277 inven_damage(set_cold_destroy, 2);
7280 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7284 /* Standard damage */
7285 case GF_DISINTEGRATE:
7288 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7290 if (fuzzy) msg_print("You are hit by pure energy!");
7293 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7300 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7302 if (fuzzy) msg_print("You are hit by something invigorating!");
7305 (void)hp_player(dam);
7313 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7315 if (fuzzy) msg_print("You are hit by something!");
7318 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7326 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7328 if (fuzzy) msg_print("You are hit by something slow!");
7331 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7337 if (p_ptr->free_act) break;
7339 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7341 if (fuzzy) msg_print("You fall asleep!");
7345 if (ironman_nightmare)
7348 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7350 msg_print("A horrible vision enters your mind.");
7354 /* Pick a nightmare */
7355 get_mon_num_prep(get_nightmare, NULL);
7357 /* Have some nightmares */
7358 have_nightmare(get_mon_num(MAX_DEPTH));
7360 /* Remove the monster restriction */
7361 get_mon_num_prep(NULL, NULL);
7364 set_paralyzed(p_ptr->paralyzed + dam);
7375 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7377 if (fuzzy) msg_print("You are hit by an aura of magic!");
7380 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7388 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7390 if (fuzzy) msg_print("You are hit by an energy!");
7393 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7401 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7403 if (fuzzy) msg_print("Something falls from the sky on you!");
7406 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7407 if (!p_ptr->resist_shard || one_in_(13))
7409 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7410 inven_damage(set_cold_destroy, 2);
7416 /* Ice -- cold plus stun plus cuts */
7420 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7422 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7425 cold_dam(dam, killer, monspell);
7426 if (!p_ptr->resist_shard)
7428 (void)set_cut(p_ptr->cut + damroll(5, 8));
7430 if (!p_ptr->resist_sound)
7432 (void)set_stun(p_ptr->stun + randint1(15));
7435 if ((!(p_ptr->resist_cold || p_ptr->oppose_cold || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))) || one_in_(12))
7437 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7447 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7449 if (fuzzy) msg_print("You are hit by something extremely cold!");
7453 if (p_ptr->mimic_form)
7455 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7456 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7461 switch (p_ptr->prace)
7463 /* Some races are immune */
7477 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7489 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7492 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7494 msg_print("You resist the effects!");
7496 learn_spell(MS_MIND_BLAST);
7501 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7503 msg_print("Your mind is blasted by psyonic energy.");
7506 if (!p_ptr->resist_conf)
7508 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7511 if (!p_ptr->resist_chaos && one_in_(3))
7513 (void)set_image(p_ptr->image + randint0(250) + 150);
7520 p_ptr->csp_frac = 0;
7522 p_ptr->redraw |= PR_MANA;
7524 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_MIND_BLAST);
7529 case GF_BRAIN_SMASH:
7531 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7534 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7536 msg_print("You resist the effects!");
7538 learn_spell(MS_BRAIN_SMASH);
7543 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7545 msg_print("Your mind is blasted by psionic energy.");
7552 p_ptr->csp_frac = 0;
7554 p_ptr->redraw |= PR_MANA;
7556 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_BRAIN_SMASH);
7557 if (!p_ptr->resist_blind)
7559 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7561 if (!p_ptr->resist_conf)
7563 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7565 if (!p_ptr->free_act)
7567 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7569 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7571 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7572 (void)do_dec_stat(A_INT);
7573 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7574 (void)do_dec_stat(A_WIS);
7576 if (!p_ptr->resist_chaos)
7578 (void)set_image(p_ptr->image + randint0(250) + 150);
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_1);
7597 curse_equipment(15, 0);
7598 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_1);
7605 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7608 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7610 msg_print("You resist the effects!");
7612 learn_spell(MS_CAUSE_2);
7616 curse_equipment(25, MIN(rlev/2-15, 5));
7617 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_2);
7624 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7627 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7629 msg_print("You resist the effects!");
7631 learn_spell(MS_CAUSE_3);
7635 curse_equipment(33, MIN(rlev/2-15, 15));
7636 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_3);
7643 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7646 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7648 msg_print("You resist the effects!");
7650 learn_spell(MS_CAUSE_4);
7654 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_4);
7655 (void)set_cut(p_ptr->cut + damroll(10, 10));
7662 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7665 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7667 msg_format("You resist the effects!");
7669 learn_spell(MS_HAND_DOOM);
7675 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7677 msg_print("Your feel your life fade away!");
7680 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, MS_HAND_DOOM);
7681 curse_equipment(40, 20);
7683 if (p_ptr->chp < 1) p_ptr->chp = 1;
7698 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7701 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7703 char m_name_self[80];
7706 monster_desc(m_name_self, m_ptr, 0x23);
7708 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7710 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7711 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7714 if (p_ptr->riding && dam > 0)
7716 rakubadam_p = (dam > 200) ? 200 : dam;
7724 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7730 /* Return "Anything seen?" */
7736 * Find the distance from (x, y) to a line.
7738 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7740 /* Vector from (x, y) to (x1, y1) */
7749 int pd = distance(y1, x1, y, x);
7750 int nd = distance(y1, x1, y2, x2);
7752 if (pd > nd) return distance(y, x, y2, x2);
7754 /* Component of P on N */
7755 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7757 /* Absolute value */
7758 return((nd >= 0) ? nd : 0 - nd);
7765 * Modified version of los() for calculation of disintegration balls.
7766 * Disintegration effects are stopped by permanent walls.
7768 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7788 /* Slope, or 1/Slope, of LOS */
7792 /* Extract the offset */
7796 /* Extract the absolute offset */
7801 /* Handle adjacent (or identical) grids */
7802 if ((ax < 2) && (ay < 2)) return (TRUE);
7805 /* Paranoia -- require "safe" origin */
7806 /* if (!in_bounds(y1, x1)) return (FALSE); */
7809 /* Directly South/North */
7812 /* South -- check for walls */
7815 for (ty = y1 + 1; ty < y2; ty++)
7817 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7821 /* North -- check for walls */
7824 for (ty = y1 - 1; ty > y2; ty--)
7826 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7834 /* Directly East/West */
7837 /* East -- check for walls */
7840 for (tx = x1 + 1; tx < x2; tx++)
7842 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7846 /* West -- check for walls */
7849 for (tx = x1 - 1; tx > x2; tx--)
7851 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7860 /* Extract some signs */
7861 sx = (dx < 0) ? -1 : 1;
7862 sy = (dy < 0) ? -1 : 1;
7865 /* Vertical "knights" */
7870 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7874 /* Horizontal "knights" */
7879 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7884 /* Calculate scale factor div 2 */
7887 /* Calculate scale factor */
7891 /* Travel horizontally */
7894 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7900 /* Consider the special case where slope == 1. */
7911 /* Note (below) the case (qy == f2), where */
7912 /* the LOS exactly meets the corner of a tile. */
7915 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7926 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7939 /* Travel vertically */
7942 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7958 /* Note (below) the case (qx == f2), where */
7959 /* the LOS exactly meets the corner of a tile. */
7962 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7973 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7992 * Do disintegration effect on the terrain
7993 * before we decide the region of the effect.
7995 static bool do_disintegration(int by, int bx, int y, int x)
7999 /* Disintegration balls explosions are stopped by perma-walls */
8000 if (!in_disintegration_range(by, bx, y, x)) return FALSE;
8002 /* Permanent walls and artifacts don't get effect */
8003 /* But not protect monsters and other objects */
8004 if (!cave_valid_bold(y, x)) return TRUE;
8006 /* Destroy mirror/glyph */
8009 feat = cave[y][x].feat;
8011 if ((feat < FEAT_PATTERN_START || feat > FEAT_PATTERN_XTRA2) &&
8012 (feat < FEAT_DEEP_WATER || feat > FEAT_GRASS))
8014 if (feat == FEAT_TREES || feat == FEAT_FLOWER || feat == FEAT_DEEP_GRASS)
8015 cave_set_feat(y, x, FEAT_GRASS);
8017 cave_set_feat(y, x, floor_type[randint0(100)]);
8020 /* Update some things -- similar to GF_KILL_WALL */
8021 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
8030 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)
8037 int max_dis = distance(y1, x1, y2, x2) + rad;
8039 /* Start from origin */
8043 while (bdis <= max_dis)
8045 if ((path_n < dist) && (distance(by, bx, y1, x1) < bdis))
8047 /* Get next base point */
8048 by = GRID_Y(path_g[path_n]);
8049 bx = GRID_X(path_g[path_n]);
8053 /* Travel from center outward */
8054 for (cdis = 0; cdis <= brad; cdis++)
8057 /* Scan the maximal blast area of radius "cdis" */
8058 for (y = by - cdis; y <= by + cdis; y++)
8060 for (x = bx - cdis; x <= bx + cdis; x++)
8062 /* Ignore "illegal" locations */
8063 if (!in_bounds(y, x)) continue;
8065 /* Enforce a circular "ripple" */
8066 if (distance(y1, x1, y, x) != bdis) continue;
8068 /* Enforce an arc */
8069 if (distance(by, bx, y, x) != cdis) continue;
8074 /* Disintegration are stopped only by perma-walls */
8077 /* Destroy terrains */
8078 if (!do_disintegration(by, bx, y, x)) continue;
8082 /* No actual disintegration */
8083 if (!in_disintegration_range(by, bx, y, x)) continue;
8088 /* The blast is stopped by walls */
8089 if (!los(by, bx, y, x)) continue;
8092 /* Save this grid */
8100 /* Encode some more "radius" info */
8101 gm[bdis + 1] = *pgrids;
8103 /* Find the next ripple */
8106 /* Increase the size */
8107 brad = (rad * bdis) / max_dis;
8110 /* Store the effect size */
8116 * Generic "beam"/"bolt"/"ball" projection routine.
8119 * who: Index of "source" monster (zero for "player")
8120 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8121 * y,x: Target location (or location to travel "towards")
8122 * dam: Base damage roll to apply to affected monsters (or player)
8123 * typ: Type of damage to apply to monsters (and objects)
8124 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8127 * TRUE if any "effects" of the projection were observed, else FALSE
8129 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8130 * towards a given location (optionally passing over the heads of interposing
8131 * monsters), and have it do a given amount of damage to the monsters (and
8132 * optionally objects) within the given radius of the final location.
8134 * A "bolt" travels from source to target and affects only the target grid.
8135 * A "beam" travels from source to target, affecting all grids passed through.
8136 * A "ball" travels from source to the target, exploding at the target, and
8137 * affecting everything within the given radius of the target location.
8139 * Traditionally, a "bolt" does not affect anything on the ground, and does
8140 * not pass over the heads of interposing monsters, much like a traditional
8141 * missile, and will "stop" abruptly at the "target" even if no monster is
8142 * positioned there, while a "ball", on the other hand, passes over the heads
8143 * of monsters between the source and target, and affects everything except
8144 * the source monster which lies within the final radius, while a "beam"
8145 * affects every monster between the source and target, except for the casting
8146 * monster (or player), and rarely affects things on the ground.
8148 * Two special flags allow us to use this function in special ways, the
8149 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8150 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8151 * actually projecting from the source monster (or player).
8153 * The player will only get "experience" for monsters killed by himself
8154 * Unique monsters can only be destroyed by attacks from the player
8156 * Only 256 grids can be affected per projection, limiting the effective
8157 * "radius" of standard ball attacks to nine units (diameter nineteen).
8159 * One can project in a given "direction" by combining PROJECT_THRU with small
8160 * offsets to the initial location (see "line_spell()"), or by calculating
8161 * "virtual targets" far away from the player.
8163 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8164 * continuing until it actually hits somethings (useful for "stone to mud").
8166 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8168 * Balls must explode BEFORE hitting walls, or they would affect monsters
8169 * on both sides of a wall. Some bug reports indicate that this is still
8170 * happening in 2.7.8 for Windows, though it appears to be impossible.
8172 * We "pre-calculate" the blast area only in part for efficiency.
8173 * More importantly, this lets us do "explosions" from the "inside" out.
8174 * This results in a more logical distribution of "blast" treasure.
8175 * It also produces a better (in my opinion) animation of the explosion.
8176 * It could be (but is not) used to have the treasure dropped by monsters
8177 * in the middle of the explosion fall "outwards", and then be damaged by
8178 * the blast as it spreads outwards towards the treasure drop location.
8180 * Walls and doors are included in the blast area, so that they can be
8181 * "burned" or "melted" in later versions.
8183 * This algorithm is intended to maximize simplicity, not necessarily
8184 * efficiency, since this function is not a bottleneck in the code.
8186 * We apply the blast effect from ground zero outwards, in several passes,
8187 * first affecting features, then objects, then monsters, then the player.
8188 * This allows walls to be removed before checking the object or monster
8189 * in the wall, and protects objects which are dropped by monsters killed
8190 * in the blast, and allows the player to see all affects before he is
8191 * killed or teleported away. The semantics of this method are open to
8192 * various interpretations, but they seem to work well in practice.
8194 * We process the blast area from ground-zero outwards to allow for better
8195 * distribution of treasure dropped by monsters, and because it provides a
8196 * pleasing visual effect at low cost.
8198 * Note that the damage done by "ball" explosions decreases with distance.
8199 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8201 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8202 * the target, and then the damage "flows" along this beam of destruction.
8203 * The damage at every grid is the same as at the "center" of a "ball"
8204 * explosion, since the "beam" grids are treated as if they ARE at the
8205 * center of a "ball" explosion.
8207 * Currently, specifying "beam" plus "ball" means that locations which are
8208 * covered by the initial "beam", and also covered by the final "ball", except
8209 * for the final grid (the epicenter of the ball), will be "hit twice", once
8210 * by the initial beam, and once by the exploding ball. For the grid right
8211 * next to the epicenter, this results in 150% damage being done. The center
8212 * does not have this problem, for the same reason the final grid in a "beam"
8213 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8214 * grids which are covered by the "ball" will NOT work, as then they will
8215 * receive LESS damage than they should. Do not combine "beam" with "ball".
8217 * The array "gy[],gx[]" with current size "grids" is used to hold the
8218 * collected locations of all grids in the "blast area" plus "beam path".
8220 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8221 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8222 * first blast grid (see above) with radius "N" from the blast center. Note
8223 * that only the first gm[1] grids in the blast area thus take full damage.
8224 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8225 * number of blast grids.
8227 * Note that once the projection is complete, (y2,x2) holds the final location
8228 * of bolts/beams, and the "epicenter" of balls.
8230 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8231 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8232 * implementation of the "distance" function. Also, a bolt can be properly
8233 * viewed as a "ball" with a "rad" of "zero".
8235 * Note that if no "target" is reached before the beam/bolt/ball travels the
8236 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8237 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8239 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8240 * to move from point A to point B, even if the player cannot see part of the
8241 * projection path. Note that in general, the player will *always* see part
8242 * of the path, since it either starts at the player or ends on the player.
8244 * Hack -- we assume that every "projection" is "self-illuminating".
8246 * Hack -- when only a single monster is affected, we automatically track
8247 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8249 * Note that all projections now "explode" at their final destination, even
8250 * if they were being projected at a more distant destination. This means
8251 * that "ball" spells will *always* explode.
8253 * Note that we must call "handle_stuff()" after affecting terrain features
8254 * in the blast radius, in case the "illumination" of the grid was changed,
8255 * and "update_view()" and "update_monsters()" need to be called.
8257 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8266 int y_saver, x_saver; /* For reflecting monsters */
8268 int msec = delay_factor * delay_factor * delay_factor;
8270 /* Assume the player sees nothing */
8271 bool notice = FALSE;
8273 /* Assume the player has seen nothing */
8274 bool visual = FALSE;
8276 /* Assume the player has seen no blast grids */
8279 /* Assume to be a normal ball spell */
8280 bool breath = FALSE;
8282 /* Is the player blind? */
8283 bool blind = (p_ptr->blind ? TRUE : FALSE);
8285 bool old_hide = FALSE;
8287 /* Number of grids in the "path" */
8290 /* Actual grids in the "path" */
8293 /* Number of grids in the "blast area" (including the "beam" path) */
8296 /* Coordinates of the affected grids */
8297 byte gx[1024], gy[1024];
8299 /* Encoded "radius" info (see above) */
8302 /* Actual radius encoded in gm[] */
8307 /* Attacker's name (prepared before polymorph)*/
8310 /* Initialize by null string */
8316 /* Default target of monsterspell is player */
8317 monster_target_y=py;
8318 monster_target_x=px;
8320 /* Initialize with nul string */
8323 /* Hack -- Jump to target */
8324 if (flg & (PROJECT_JUMP))
8329 /* Clear the flag */
8330 flg &= ~(PROJECT_JUMP);
8335 /* Start at player */
8342 /* Start at monster */
8345 x1 = m_list[who].fx;
8346 y1 = m_list[who].fy;
8347 monster_desc(who_name, &m_list[who], 0x288);
8360 /* Default "destination" */
8365 /* Hack -- verify stuff */
8366 if (flg & (PROJECT_THRU))
8368 if ((x1 == x2) && (y1 == y2))
8370 flg &= ~(PROJECT_THRU);
8374 /* Handle a breath attack */
8379 if (flg & PROJECT_HIDE) old_hide = TRUE;
8380 flg |= PROJECT_HIDE;
8384 /* Hack -- Assume there will be no blast (max radius 32) */
8385 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8393 /* Collect beam grids */
8394 if (flg & (PROJECT_BEAM))
8401 if (breath && typ == GF_DISINTEGRATE)
8403 flg |= (PROJECT_DISI);
8406 /* Calculate the projection path */
8408 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8410 /* Hack -- Handle stuff */
8413 /* Giga-Hack SEEKER & SUPER_RAY */
8415 if( typ == GF_SEEKER )
8425 for (i = 0; i < path_n; ++i)
8430 int ny = GRID_Y(path_g[i]);
8431 int nx = GRID_X(path_g[i]);
8442 /* Only do visuals if requested */
8443 if (!blind && !(flg & (PROJECT_HIDE)))
8445 /* Only do visuals if the player can "see" the bolt */
8446 if (panel_contains(y, x) && player_has_los_bold(y, x))
8453 /* Obtain the bolt pict */
8454 p = bolt_pict(oy, ox, y, x, typ);
8456 /* Extract attr/char */
8460 /* Visual effects */
8461 print_rel(c, a, y, x);
8462 move_cursor_relative(y, x);
8463 /*if (fresh_before)*/ Term_fresh();
8464 Term_xtra(TERM_XTRA_DELAY, msec);
8466 /*if (fresh_before)*/ Term_fresh();
8468 /* Display "beam" grids */
8469 if (flg & (PROJECT_BEAM))
8471 /* Obtain the explosion pict */
8472 p = bolt_pict(y, x, y, x, typ);
8474 /* Extract attr/char */
8478 /* Visual effects */
8479 print_rel(c, a, y, x);
8482 /* Hack -- Activate delay */
8486 /* Hack -- delay anyway for consistency */
8489 /* Delay for consistency */
8490 Term_xtra(TERM_XTRA_DELAY, msec);
8493 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8494 if( is_mirror_grid(&cave[y][x]))
8496 /* The target of monsterspell becomes tha mirror(broken) */
8497 monster_target_y=(s16b)y;
8498 monster_target_x=(s16b)x;
8501 next_mirror( &oy,&ox,y,x );
8503 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8504 for( j = last_i; j <=i ; j++ )
8506 y = GRID_Y(path_g[j]);
8507 x = GRID_X(path_g[j]);
8508 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8509 if(!who && (project_m_n==1) && !jump ){
8510 if(cave[project_m_y][project_m_x].m_idx >0 ){
8511 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8513 /* Hack -- auto-recall */
8514 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8516 /* Hack - auto-track */
8517 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8520 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8525 for( i = last_i ; i < path_n ; i++ )
8528 y = GRID_Y(path_g[i]);
8529 x = GRID_X(path_g[i]);
8530 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8532 if(!who && (project_m_n==1) && !jump ){
8533 if(cave[project_m_y][project_m_x].m_idx >0 ){
8534 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8536 /* Hack -- auto-recall */
8537 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8539 /* Hack - auto-track */
8540 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8543 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8547 else if(typ == GF_SUPER_RAY){
8549 int second_step = 0;
8556 for (i = 0; i < path_n; ++i)
8561 int ny = GRID_Y(path_g[i]);
8562 int nx = GRID_X(path_g[i]);
8573 /* Only do visuals if requested */
8574 if (!blind && !(flg & (PROJECT_HIDE)))
8576 /* Only do visuals if the player can "see" the bolt */
8577 if (panel_contains(y, x) && player_has_los_bold(y, x))
8584 /* Obtain the bolt pict */
8585 p = bolt_pict(oy, ox, y, x, typ);
8587 /* Extract attr/char */
8591 /* Visual effects */
8592 print_rel(c, a, y, x);
8593 move_cursor_relative(y, x);
8594 /*if (fresh_before)*/ Term_fresh();
8595 Term_xtra(TERM_XTRA_DELAY, msec);
8597 /*if (fresh_before)*/ Term_fresh();
8599 /* Display "beam" grids */
8600 if (flg & (PROJECT_BEAM))
8602 /* Obtain the explosion pict */
8603 p = bolt_pict(y, x, y, x, typ);
8605 /* Extract attr/char */
8609 /* Visual effects */
8610 print_rel(c, a, y, x);
8613 /* Hack -- Activate delay */
8617 /* Hack -- delay anyway for consistency */
8620 /* Delay for consistency */
8621 Term_xtra(TERM_XTRA_DELAY, msec);
8624 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8625 if( cave[y][x].feat == FEAT_RUBBLE ||
8626 cave[y][x].feat == FEAT_DOOR_HEAD ||
8627 cave[y][x].feat == FEAT_DOOR_TAIL ||
8628 (cave[y][x].feat >= FEAT_WALL_EXTRA &&
8629 cave[y][x].feat <= FEAT_PERM_SOLID ))
8631 if( second_step )continue;
8634 if( is_mirror_grid(&cave[y][x]) && !second_step )
8636 /* The target of monsterspell becomes tha mirror(broken) */
8637 monster_target_y=(s16b)y;
8638 monster_target_x=(s16b)x;
8641 for( j = 0; j <=i ; j++ )
8643 y = GRID_Y(path_g[j]);
8644 x = GRID_X(path_g[j]);
8645 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8649 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8650 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8651 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8652 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8653 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8654 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8655 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8656 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8659 for( i = 0; i < path_n ; i++ )
8662 y = GRID_Y(path_g[i]);
8663 x = GRID_X(path_g[i]);
8664 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8665 if(!who && (project_m_n==1) && !jump ){
8666 if(cave[project_m_y][project_m_x].m_idx >0 ){
8667 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8669 /* Hack -- auto-recall */
8670 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8672 /* Hack - auto-track */
8673 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8676 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8681 /* Project along the path */
8682 for (i = 0; i < path_n; ++i)
8687 int ny = GRID_Y(path_g[i]);
8688 int nx = GRID_X(path_g[i]);
8690 if (flg & PROJECT_DISI)
8692 /* Hack -- Balls explode before reaching walls */
8693 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8697 /* Hack -- Balls explode before reaching walls */
8698 if (!cave_floor_bold(ny, nx) && (rad > 0)) break;
8705 /* Collect beam grids */
8706 if (flg & (PROJECT_BEAM))
8713 /* Only do visuals if requested */
8714 if (!blind && !(flg & (PROJECT_HIDE)) && !(flg & PROJECT_FAST))
8716 /* Only do visuals if the player can "see" the bolt */
8717 if (panel_contains(y, x) && player_has_los_bold(y, x))
8724 /* Obtain the bolt pict */
8725 p = bolt_pict(oy, ox, y, x, typ);
8727 /* Extract attr/char */
8731 /* Visual effects */
8732 print_rel(c, a, y, x);
8733 move_cursor_relative(y, x);
8734 /*if (fresh_before)*/ Term_fresh();
8735 Term_xtra(TERM_XTRA_DELAY, msec);
8737 /*if (fresh_before)*/ Term_fresh();
8739 /* Display "beam" grids */
8740 if (flg & (PROJECT_BEAM))
8742 /* Obtain the explosion pict */
8743 p = bolt_pict(y, x, y, x, typ);
8745 /* Extract attr/char */
8749 /* Visual effects */
8750 print_rel(c, a, y, x);
8753 /* Hack -- Activate delay */
8757 /* Hack -- delay anyway for consistency */
8760 /* Delay for consistency */
8761 Term_xtra(TERM_XTRA_DELAY, msec);
8764 if ((typ == GF_ATTACK) && (dam == HISSATSU_NYUSIN) && ((i+1) == path_n))
8766 if (cave_empty_bold(y, x)) teleport_player_to(ny, nx, FALSE);
8771 /* Save the "blast epicenter" */
8775 if (breath && (y1 == y2) && (x1 == x2))
8781 flg &= ~(PROJECT_HIDE);
8785 /* Start the "explosion" */
8788 /* Hack -- make sure beams get to "explode" */
8796 /* If we found a "target", explode there */
8797 if (dist <= MAX_RANGE)
8799 /* Mega-Hack -- remove the final "beam" grid */
8800 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8803 * Create a conical breath attack
8814 flg &= ~(PROJECT_HIDE);
8816 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, y2, x2, (bool)(typ == GF_DISINTEGRATE), TRUE);
8820 /* Determine the blast area, work from the inside out */
8821 for (dist = 0; dist <= rad; dist++)
8823 /* Scan the maximal blast area of radius "dist" */
8824 for (y = y2 - dist; y <= y2 + dist; y++)
8826 for (x = x2 - dist; x <= x2 + dist; x++)
8828 /* Ignore "illegal" locations */
8829 if (!in_bounds2(y, x)) continue;
8831 /* Enforce a "circular" explosion */
8832 if (distance(y2, x2, y, x) != dist) continue;
8834 if (typ == GF_DISINTEGRATE)
8836 /* Disintegration are stopped only by perma-walls */
8837 if (!do_disintegration(y2, x2, y, x)) continue;
8841 /* Ball explosions are stopped by walls */
8842 if (!los(y2, x2, y, x)) continue;
8845 /* Save this grid */
8852 /* Encode some more "radius" info */
8858 /* Speed -- ignore "non-explosions" */
8859 if (!grids) return (FALSE);
8862 /* Display the "blast area" if requested */
8863 if (!blind && !(flg & (PROJECT_HIDE)))
8865 /* Then do the "blast", from inside out */
8866 for (t = 0; t <= gm_rad; t++)
8868 /* Dump everything with this radius */
8869 for (i = gm[t]; i < gm[t+1]; i++)
8871 /* Extract the location */
8875 /* Only do visuals if the player can "see" the blast */
8876 if (panel_contains(y, x) && player_has_los_bold(y, x))
8885 /* Obtain the explosion pict */
8886 p = bolt_pict(y, x, y, x, typ);
8888 /* Extract attr/char */
8892 /* Visual effects -- Display */
8893 print_rel(c, a, y, x);
8897 /* Hack -- center the cursor */
8898 move_cursor_relative(y2, x2);
8900 /* Flush each "radius" seperately */
8901 /*if (fresh_before)*/ Term_fresh();
8903 /* Delay (efficiently) */
8904 if (visual || drawn)
8906 Term_xtra(TERM_XTRA_DELAY, msec);
8910 /* Flush the erasing */
8913 /* Erase the explosion drawn above */
8914 for (i = 0; i < grids; i++)
8916 /* Extract the location */
8920 /* Hack -- Erase if needed */
8921 if (panel_contains(y, x) && player_has_los_bold(y, x))
8927 /* Hack -- center the cursor */
8928 move_cursor_relative(y2, x2);
8930 /* Flush the explosion */
8931 /*if (fresh_before)*/ Term_fresh();
8936 /* Update stuff if needed */
8937 if (p_ptr->update) update_stuff();
8940 /* Check features */
8941 if (flg & (PROJECT_GRID))
8943 /* Start with "dist" of zero */
8946 /* Scan for features */
8947 for (i = 0; i < grids; i++)
8949 /* Hack -- Notice new "dist" values */
8950 if (gm[dist+1] == i) dist++;
8952 /* Get the grid location */
8956 /* Find the closest point in the blast */
8959 int d = dist_to_line(y, x, y1, x1, y2, x2);
8961 /* Affect the grid */
8962 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8966 /* Affect the grid */
8967 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8974 if (flg & (PROJECT_ITEM))
8976 /* Start with "dist" of zero */
8979 /* Scan for objects */
8980 for (i = 0; i < grids; i++)
8982 /* Hack -- Notice new "dist" values */
8983 if (gm[dist+1] == i) dist++;
8985 /* Get the grid location */
8989 /* Find the closest point in the blast */
8992 int d = dist_to_line(y, x, y1, x1, y2, x2);
8994 /* Affect the object in the grid */
8995 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8999 /* Affect the object in the grid */
9000 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
9006 /* Check monsters */
9007 if (flg & (PROJECT_KILL))
9014 /* Start with "dist" of zero */
9017 /* Scan for monsters */
9018 for (i = 0; i < grids; i++)
9020 /* Hack -- Notice new "dist" values */
9021 if (gm[dist + 1] == i) dist++;
9023 /* Get the grid location */
9029 /* Find the closest point in the blast */
9032 int d = dist_to_line(y, x, y1, x1, y2, x2);
9034 /* Affect the monster in the grid */
9035 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
9037 if (project_m(who, d+1, y, x, dam, typ,flg)) notice = TRUE;
9039 else if (project_m(who, d, y, x, dam, typ,flg)) notice = TRUE;
9043 /* Affect the monster in the grid */
9044 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
9046 if (!(flg & PROJECT_BEAM))
9048 if (project_m(who, dist+1, y, x, dam, typ,flg)) notice = TRUE;
9051 else if (project_m(who, dist, y, x, dam, typ,flg)) notice = TRUE;
9056 monster_race *ref_ptr = &r_info[m_list[cave[y][x].m_idx].r_idx];
9058 if ((ref_ptr->flags2 & RF2_REFLECTING) && (!one_in_(10) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1)))
9061 int max_attempts = 10;
9063 /* Choose 'new' target */
9066 t_y = y_saver - 1 + randint1(3);
9067 t_x = x_saver - 1 + randint1(3);
9071 while (max_attempts && in_bounds2u(t_y, t_x) &&
9072 !(los(y, x, t_y, t_x)));
9074 if (max_attempts < 1)
9080 if (m_list[cave[y][x].m_idx].ml)
9083 if ((m_list[cave[y][x].m_idx].r_idx == MON_KENSHIROU)
9084 || (m_list[cave[y][x].m_idx].r_idx == MON_RAOU))
9085 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9086 if (m_list[cave[y][x].m_idx].r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9087 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9089 msg_print("The attack bounces!");
9092 ref_ptr->r_flags2 |= RF2_REFLECTING;
9094 flg &= ~(PROJECT_MONSTER | PROJECT_PLAYER);
9095 if (one_in_(2)) flg |= PROJECT_MONSTER;
9096 else flg |= PROJECT_PLAYER;
9098 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9102 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
9105 else if (project_m(who, dist, y, x, dam, typ,flg)) notice = TRUE;
9110 /* Player affected one monster (without "jumping") */
9111 if (!who && (project_m_n == 1) && !jump)
9117 /* Track if possible */
9118 if (cave[y][x].m_idx > 0)
9120 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9122 /* Hack -- auto-recall */
9123 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9125 /* Hack - auto-track */
9126 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9133 if (flg & (PROJECT_KILL))
9135 /* Start with "dist" of zero */
9138 /* Scan for player */
9139 for (i = 0; i < grids; i++)
9141 /* Hack -- Notice new "dist" values */
9142 if (gm[dist+1] == i) dist++;
9144 /* Get the grid location */
9148 /* Find the closest point in the blast */
9151 int d = dist_to_line(y, x, y1, x1, y2, x2);
9153 /* Affect the player */
9154 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_MONSTER))
9156 if (project_p(who, who_name, d+1, y, x, dam, typ, flg, monspell)) notice = TRUE;
9158 else if (project_p(who, who_name, d, y, x, dam, typ, flg, monspell)) notice = TRUE;
9162 /* Affect the player */
9163 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_MONSTER))
9165 if (!((flg & PROJECT_BEAM) || (flg & PROJECT_STOP)))
9167 if (project_p(who, who_name, dist+1, y, x, dam, typ, flg, monspell)) notice = TRUE;
9170 else if (project_p(who, who_name, dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9179 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9181 if (rakubadam_m > 0)
9183 if (rakuba(rakubadam_m, FALSE))
9186 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9188 msg_format("%^s has thrown you off!", m_name);
9192 if (p_ptr->riding && rakubadam_p > 0)
9194 if(rakuba(rakubadam_p, FALSE))
9197 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9199 msg_format("You have fallen from %s.", m_name);
9205 /* Return "something was noticed" */
9209 bool binding_field( int dam )
9211 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9212 int mirror_num=0; /* ¶À¤Î¿ô */
9217 int msec= delay_factor*delay_factor*delay_factor;
9223 /* Default target of monsterspell is player */
9224 monster_target_y=py;
9225 monster_target_x=px;
9227 for( x=0 ; x < cur_wid ; x++ )
9229 for( y=0 ; y < cur_hgt ; y++ )
9231 if( is_mirror_grid(&cave[y][x]) &&
9232 distance(py,px,y,x) <= MAX_RANGE &&
9233 distance(py,px,y,x) != 0 &&
9234 player_has_los_bold(y,x)
9236 mirror_y[mirror_num]=y;
9237 mirror_x[mirror_num]=x;
9243 if( mirror_num < 2 )return FALSE;
9245 point_x[0] = randint0( mirror_num );
9247 point_x[1] = randint0( mirror_num );
9249 while( point_x[0] == point_x[1] );
9251 point_y[0]=mirror_y[point_x[0]];
9252 point_x[0]=mirror_x[point_x[0]];
9253 point_y[1]=mirror_y[point_x[1]];
9254 point_x[1]=mirror_x[point_x[1]];
9258 x=point_x[0]+point_x[1]+point_x[2];
9259 y=point_y[0]+point_y[1]+point_y[2];
9261 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9262 - (point_y[0]*3-y)*(point_x[1]*3-x);
9263 if( centersign == 0 )return FALSE;
9265 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9266 x1 = x1 < point_x[2] ? x1 : point_x[2];
9267 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9268 y1 = y1 < point_y[2] ? y1 : point_y[2];
9270 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9271 x2 = x2 > point_x[2] ? x2 : point_x[2];
9272 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9273 y2 = y2 > point_y[2] ? y2 : point_y[2];
9275 for( y=y1 ; y <=y2 ; y++ ){
9276 for( x=x1 ; x <=x2 ; x++ ){
9277 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9278 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9279 centersign*( (point_x[1]-x)*(point_y[2]-y)
9280 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9281 centersign*( (point_x[2]-x)*(point_y[0]-y)
9282 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9284 if( player_has_los_bold(y,x)){
9285 /* Visual effects */
9287 && panel_contains(y,x)){
9288 p = bolt_pict(y,x,y,x, GF_MANA );
9289 print_rel(PICT_C(p), PICT_A(p),y,x);
9290 move_cursor_relative(y, x);
9291 /*if (fresh_before)*/ Term_fresh();
9292 Term_xtra(TERM_XTRA_DELAY, msec);
9298 for( y=y1 ; y <=y2 ; y++ ){
9299 for( x=x1 ; x <=x2 ; x++ ){
9300 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9301 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9302 centersign*( (point_x[1]-x)*(point_y[2]-y)
9303 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9304 centersign*( (point_x[2]-x)*(point_y[0]-y)
9305 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9307 if( player_has_los_bold(y,x)){
9308 (void)project_f(0,0,y,x,dam,GF_MANA);
9313 for( y=y1 ; y <=y2 ; y++ ){
9314 for( x=x1 ; x <=x2 ; x++ ){
9315 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9316 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9317 centersign*( (point_x[1]-x)*(point_y[2]-y)
9318 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9319 centersign*( (point_x[2]-x)*(point_y[0]-y)
9320 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9322 if( player_has_los_bold(y,x)){
9323 (void)project_o(0,0,y,x,dam,GF_MANA);
9328 for( y=y1 ; y <=y2 ; y++ ){
9329 for( x=x1 ; x <=x2 ; x++ ){
9330 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9331 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9332 centersign*( (point_x[1]-x)*(point_y[2]-y)
9333 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9334 centersign*( (point_x[2]-x)*(point_y[0]-y)
9335 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9337 if( player_has_los_bold(y,x) ){
9338 (void)project_m(0,0,y,x,dam,GF_MANA,
9339 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9346 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9348 msg_print("The field broke a mirror");
9350 remove_mirror(point_y[0],point_x[0]);
9356 void seal_of_mirror( int dam )
9360 for( x = 0 ; x < cur_wid ; x++ )
9362 for( y = 0 ; y < cur_hgt ; y++ )
9364 if( is_mirror_grid(&cave[y][x]))
9366 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9367 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9369 if( !cave[y][x].m_idx )