3 /* Purpose: Spell projection */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
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))
393 if ((n > 0) && (cave[y][x].m_idx != 0)) break;
396 if (!in_bounds(y, x)) break;
401 /* Advance (X) part 1 */
404 /* Horizontal change */
407 /* Advance (X) part 2 */
410 /* Advance (X) part 3 */
426 /* Let m = ((dy/dx) * full) = (dy * dy * 2) */
435 /* Vertical change */
438 /* Advance (Y) part 2 */
441 /* Advance (Y) part 3 */
448 /* Create the projection path */
452 gp[n++] = GRID(y, x);
454 /* Hack -- Check maximum range */
455 if ((n + (k >> 1)) >= range) break;
457 /* Sometimes stop at destination grid */
458 if (!(flg & (PROJECT_THRU)))
460 if ((x == x2) && (y == y2)) break;
463 if (flg & (PROJECT_DISI))
465 if ((n > 0) && cave_stop_disintegration(y, x)) break;
467 else if (!(flg & (PROJECT_PATH)))
469 /* Always stop at non-initial wall grids */
470 if ((n > 0) && !cave_floor_bold(y, x)) break;
473 /* Sometimes stop at non-initial monsters/players */
474 if (flg & (PROJECT_STOP))
476 if ((n > 0) && (cave[y][x].m_idx != 0)) break;
479 if (!in_bounds(y, x)) break;
484 /* Advance (Y) part 1 */
487 /* Vertical change */
490 /* Advance (Y) part 2 */
493 /* Advance (Y) part 3 */
513 /* Create the projection path */
517 gp[n++] = GRID(y, x);
519 /* Hack -- Check maximum range */
520 if ((n + (n >> 1)) >= range) break;
522 /* Sometimes stop at destination grid */
523 if (!(flg & (PROJECT_THRU)))
525 if ((x == x2) && (y == y2)) break;
528 if (flg & (PROJECT_DISI))
530 if ((n > 0) && cave_stop_disintegration(y, x)) break;
532 else if (!(flg & (PROJECT_PATH)))
534 /* Always stop at non-initial wall grids */
535 if ((n > 0) && !cave_floor_bold(y, x)) break;
538 /* Sometimes stop at non-initial monsters/players */
539 if (flg & (PROJECT_STOP))
541 if ((n > 0) && (cave[y][x].m_idx != 0)) break;
544 if (!in_bounds(y, x)) break;
561 * Mega-Hack -- track "affected" monsters (see "project()" comments)
563 static int project_m_n;
564 static int project_m_x;
565 static int project_m_y;
566 /* Mega-Hack -- monsters target */
567 static s16b monster_target_x;
568 static s16b monster_target_y;
572 * We are called from "project()" to "damage" terrain features
574 * We are called both for "beam" effects and "ball" effects.
576 * The "r" parameter is the "distance from ground zero".
578 * Note that we determine if the player can "see" anything that happens
579 * by taking into account: blindness, line-of-sight, and illumination.
581 * We return "TRUE" if the effect of the projection is "obvious".
583 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
585 * XXX XXX XXX Perhaps we should affect doors?
587 static bool project_f(int who, int r, int y, int x, int dam, int typ)
589 cave_type *c_ptr = &cave[y][x];
591 bool obvious = FALSE;
592 bool known = player_has_los_bold(y, x);
598 /* Reduce damage by distance */
599 dam = (dam + r) / (r + 1);
602 if (c_ptr->feat == FEAT_TREES)
611 message = "¸Ï¤ì¤¿";break;
613 message = "was blasted.";break;
617 message = "½Ì¤ó¤À";break;
619 message = "shrank.";break;
623 message = "ÍϤ±¤¿";break;
625 message = "melted.";break;
630 message = "Åà¤ê¡¢ºÕ¤±»¶¤Ã¤¿";break;
632 message = "was frozen and smashed.";break;
638 message = "dz¤¨¤¿";break;
640 message = "burns up!";break;
654 message = "Ê´ºÕ¤µ¤ì¤¿";break;
656 message = "was crushed.";break;
659 message = NULL;break;
664 msg_format("ÌÚ¤Ï%s¡£", message);
666 msg_format("A tree %s", message);
668 c_ptr->feat = (one_in_(3) ? FEAT_DEEP_GRASS : FEAT_GRASS);
671 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
673 /* Update some things */
674 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
678 /* Analyze the type */
681 /* Ignore most effects */
695 case GF_DISINTEGRATE:
717 /* Destroy Traps (and Locks) */
720 /* Reveal secret doors */
721 if (is_hidden_door(c_ptr))
726 /* Check line of sight */
734 if (is_trap(c_ptr->feat))
736 /* Check line of sight */
740 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
742 msg_print("There is a bright flash of light!");
748 /* Forget the trap */
749 c_ptr->info &= ~(CAVE_MARK);
751 /* Destroy the trap */
752 cave_set_feat(y, x, floor_type[randint0(100)]);
755 /* Locked doors are unlocked */
756 else if ((c_ptr->feat >= FEAT_DOOR_HEAD + 0x01) &&
757 (c_ptr->feat <= FEAT_DOOR_HEAD + 0x07))
759 /* Unlock the door */
760 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
762 /* Check line of sound */
766 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
778 /* Destroy Doors (and traps) */
781 /* Destroy all doors and traps */
782 if ((c_ptr->feat == FEAT_OPEN) ||
783 (c_ptr->feat == FEAT_BROKEN) ||
784 is_trap(c_ptr->feat) ||
785 ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
786 (c_ptr->feat <= FEAT_DOOR_TAIL)))
788 /* Check line of sight */
793 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
795 msg_print("There is a bright flash of light!");
800 /* Visibility change */
801 if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
802 (c_ptr->feat <= FEAT_DOOR_TAIL))
804 /* Update some things */
805 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
809 /* Forget the door */
810 c_ptr->info &= ~(CAVE_MARK);
812 /* Destroy the feature */
813 cave_set_feat(y, x, floor_type[randint0(100)]);
822 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
824 if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
825 (c_ptr->feat <= FEAT_DOOR_TAIL))
827 /* Convert "locked" to "stuck" XXX XXX XXX */
828 if (c_ptr->feat < FEAT_DOOR_HEAD + 0x08) c_ptr->feat += 0x08;
830 /* Add one spike to the door */
831 if (c_ptr->feat < FEAT_DOOR_TAIL) c_ptr->feat++;
833 /* Check line of sight */
838 msg_print("²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ¥É¥¢¤¬³«¤«¤Ê¤¤¡£");
840 msg_print("The door seems stuck.");
849 /* Destroy walls (and doors) */
852 /* Non-walls (etc) */
853 if (cave_floor_bold(y, x)) break;
855 /* Permanent walls */
856 if (c_ptr->feat >= FEAT_PERM_EXTRA) break;
859 if (c_ptr->feat >= FEAT_WALL_EXTRA)
862 if (known && (c_ptr->info & (CAVE_MARK)))
865 msg_print("Êɤ¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
867 msg_print("The wall turns into mud!");
873 /* Forget the wall */
874 c_ptr->info &= ~(CAVE_MARK);
876 /* Destroy the wall */
877 c_ptr->feat = floor_type[randint0(100)];
880 /* Quartz / Magma with treasure */
881 else if (c_ptr->feat >= FEAT_MAGMA_H)
884 if (known && (c_ptr->info & (CAVE_MARK)))
887 msg_print("¹ÛÌ®¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
888 msg_print("²¿¤«¤òȯ¸«¤·¤¿¡ª");
890 msg_print("The vein turns into mud!");
891 msg_print("You have found something!");
897 /* Forget the wall */
898 c_ptr->info &= ~(CAVE_MARK);
900 /* Destroy the wall */
901 c_ptr->feat = floor_type[randint0(100)];
903 /* Place some gold */
908 else if (c_ptr->feat >= FEAT_MAGMA)
911 if (known && (c_ptr->info & (CAVE_MARK)))
914 msg_print("¹ÛÌ®¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
916 msg_print("The vein turns into mud!");
922 /* Forget the wall */
923 c_ptr->info &= ~(CAVE_MARK);
925 /* Destroy the wall */
926 c_ptr->feat = floor_type[randint0(100)];
930 else if (c_ptr->feat == FEAT_RUBBLE)
933 if (known && (c_ptr->info & (CAVE_MARK)))
936 msg_print("´äÀФ¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
938 msg_print("The rubble turns into mud!");
944 /* Forget the wall */
945 c_ptr->info &= ~(CAVE_MARK);
947 /* Destroy the rubble */
948 c_ptr->feat = floor_type[randint0(100)];
950 /* Hack -- place an object */
951 if (randint0(100) < 10)
953 /* Found something */
954 if (player_can_see_bold(y, x))
957 msg_print("´äÀФβ¼¤Ë²¿¤«±£¤µ¤ì¤Æ¤¤¤¿¡ª");
959 msg_print("There was something buried in the rubble!");
966 place_object(y, x, FALSE, FALSE);
970 /* Destroy doors (and secret doors) */
971 else /* if (c_ptr->feat >= FEAT_DOOR_HEAD) */
973 /* Hack -- special message */
974 if (known && (c_ptr->info & (CAVE_MARK)))
977 msg_print("¥É¥¢¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
979 msg_print("The door turns into mud!");
985 /* Forget the wall */
986 c_ptr->info &= ~(CAVE_MARK);
988 /* Destroy the feature */
989 c_ptr->feat = floor_type[randint0(100)];
995 /* Update some things */
996 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
1004 /* Require a "naked" floor grid */
1005 if (!cave_naked_bold(y, x)) break;
1007 /* Not on the player */
1008 if ((y == py) && (x == px)) break;
1010 /* Create a closed door */
1011 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
1014 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
1016 /* Update some things */
1017 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1025 /* Require a "naked" floor grid */
1026 if (((cave[y][x].feat != FEAT_FLOOR) &&
1027 (cave[y][x].feat != FEAT_GRASS) &&
1028 (cave[y][x].feat != FEAT_DIRT) &&
1029 (cave[y][x].o_idx == 0) &&
1030 (cave[y][x].m_idx == 0))
1031 || is_mirror_grid(&cave[y][x]) )
1042 /* Require a "naked" floor grid */
1043 if (!cave_naked_bold(y, x)) break;
1045 /* Not on the player */
1046 if ((y == py) && (x == px)) break;
1048 /* Create a closed door */
1049 cave_set_feat(y, x, FEAT_TREES);
1052 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
1054 /* Update some things */
1055 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1062 /* Require a "naked" floor grid */
1063 if (!cave_naked_bold(y, x)) break;
1065 /* Create a glyph */
1066 cave[py][px].info |= CAVE_OBJECT;
1067 cave[py][px].mimic = FEAT_GLYPH;
1080 /* Require a "naked" floor grid */
1081 if (!cave_naked_bold(y, x)) break;
1083 /* Not on the player */
1084 if ((y == py) && (x == px)) break;
1087 cave_set_feat(y, x, FEAT_WALL_EXTRA);
1089 /* Update some things */
1090 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1101 /* Require a "naked" floor grid */
1102 if (!cave_naked_bold(y, x)) break;
1104 /* Place a shallow lava */
1105 cave_set_feat(y, x, FEAT_SHAL_LAVA);
1110 /* Require a "naked" floor grid */
1111 if (cave_perma_bold(y, x) || !dam) break;
1113 /* Place a deep lava */
1114 cave_set_feat(y, x, FEAT_DEEP_LAVA);
1116 /* Dam is used as a counter for the number of grid to convert */
1127 /* Require a "naked" floor grid */
1128 if (!cave_naked_bold(y, x)) break;
1130 /* Place a shallow lava */
1131 cave_set_feat(y, x, FEAT_SHAL_WATER);
1136 /* Require a "naked" floor grid */
1137 if (cave_perma_bold(y, x) || !dam) break;
1139 /* Place a deep lava */
1140 cave_set_feat(y, x, FEAT_DEEP_WATER);
1142 /* Dam is used as a counter for the number of grid to convert */
1148 /* Lite up the grid */
1152 /* Turn on the light */
1153 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) c_ptr->info |= (CAVE_GLOW);
1162 if (player_can_see_bold(y, x)) obvious = TRUE;
1164 /* Mega-Hack -- Update the monster in the affected grid */
1165 /* This allows "spear of light" (etc) to work "correctly" */
1166 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1171 /* Darken the grid */
1175 if (!p_ptr->inside_battle)
1178 if (player_can_see_bold(y, x)) obvious = TRUE;
1180 /* Turn off the light. */
1181 if (!is_mirror_grid(c_ptr)) c_ptr->info &= ~(CAVE_GLOW);
1183 /* Hack -- Forget "boring" grids */
1184 if ((c_ptr->feat <= FEAT_INVIS) || (c_ptr->feat == FEAT_DIRT) || (c_ptr->feat == FEAT_GRASS))
1187 c_ptr->info &= ~(CAVE_MARK);
1196 /* Mega-Hack -- Update the monster in the affected grid */
1197 /* This allows "spear of light" (etc) to work "correctly" */
1198 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1207 if (is_mirror_grid(&cave[y][x]))
1210 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1212 msg_print("The mirror was chashed!");
1215 project(0,2,y,x, p_ptr->lev /2 +5 ,GF_SHARDS,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_HANGEKI),-1);
1221 if (is_mirror_grid(&cave[y][x]) && p_ptr->lev < 40 )
1224 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1226 msg_print("The mirror was chashed!");
1228 cave_set_feat(y,x, FEAT_FLOOR);
1235 /* Return "Anything seen?" */
1242 * We are called from "project()" to "damage" objects
1244 * We are called both for "beam" effects and "ball" effects.
1246 * Perhaps we should only SOMETIMES damage things on the ground.
1248 * The "r" parameter is the "distance from ground zero".
1250 * Note that we determine if the player can "see" anything that happens
1251 * by taking into account: blindness, line-of-sight, and illumination.
1253 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1255 * We return "TRUE" if the effect of the projection is "obvious".
1257 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1259 cave_type *c_ptr = &cave[y][x];
1261 s16b this_o_idx, next_o_idx = 0;
1263 bool obvious = FALSE;
1264 bool known = player_has_los_bold(y, x);
1266 u32b flgs[TR_FLAG_SIZE];
1268 char o_name[MAX_NLEN];
1271 bool is_potion = FALSE;
1275 who = who ? who : 0;
1277 /* Reduce damage by distance */
1278 dam = (dam + r) / (r + 1);
1281 /* Scan all objects in the grid */
1282 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1286 bool is_art = FALSE;
1287 bool ignore = FALSE;
1288 bool plural = FALSE;
1289 bool do_kill = FALSE;
1291 cptr note_kill = NULL;
1293 /* Acquire object */
1294 o_ptr = &o_list[this_o_idx];
1296 /* Acquire next object */
1297 next_o_idx = o_ptr->next_o_idx;
1299 /* Extract the flags */
1300 object_flags(o_ptr, flgs);
1302 /* Get the "plural"-ness */
1303 if (o_ptr->number > 1) plural = TRUE;
1305 /* Check for artifact */
1306 if ((artifact_p(o_ptr) || o_ptr->art_name)) is_art = TRUE;
1308 /* Analyze the type */
1311 /* Acid -- Lots of things */
1314 if (hates_acid(o_ptr))
1318 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1320 note_kill = (plural ? " melt!" : " melts!");
1323 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1328 /* Elec -- Rings and Wands */
1331 if (hates_elec(o_ptr))
1335 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1337 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1340 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1345 /* Fire -- Flammable objects */
1348 if (hates_fire(o_ptr))
1352 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1354 note_kill = (plural ? " burn up!" : " burns up!");
1357 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1362 /* Cold -- potions and flasks */
1365 if (hates_cold(o_ptr))
1368 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1370 note_kill = (plural ? " shatter!" : " shatters!");
1374 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1382 if (hates_fire(o_ptr))
1386 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1388 note_kill = (plural ? " burn up!" : " burns up!");
1391 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1393 if (hates_elec(o_ptr))
1398 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1400 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1403 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1411 if (hates_fire(o_ptr))
1415 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1417 note_kill = (plural ? " burn up!" : " burns up!");
1420 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1422 if (hates_cold(o_ptr))
1427 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1429 note_kill = (plural ? " shatter!" : " shatters!");
1432 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1437 /* Hack -- break potions and such */
1443 if (hates_cold(o_ptr))
1446 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1448 note_kill = (plural ? " shatter!" : " shatters!");
1456 /* Mana and Chaos -- destroy everything */
1463 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1465 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1471 case GF_DISINTEGRATE:
1475 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1477 note_kill = (plural ? " evaporate!" : " evaporates!");
1487 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1489 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1492 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1493 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1497 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1501 if (cursed_p(o_ptr))
1505 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1507 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1516 identify_item(o_ptr);
1524 /* Chests are noticed only if trapped or locked */
1525 if (o_ptr->tval == TV_CHEST)
1527 /* Disarm/Unlock traps */
1528 if (o_ptr->pval > 0)
1530 /* Disarm or Unlock */
1531 o_ptr->pval = (0 - o_ptr->pval);
1534 object_known(o_ptr);
1537 if (known && o_ptr->marked)
1540 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1542 msg_print("Click!");
1554 if (o_ptr->tval == TV_CORPSE)
1559 if (!who || is_pet(&m_list[who]))
1560 mode |= PM_FORCE_PET;
1562 for (i = 0; i < o_ptr->number ; i++)
1564 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1565 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1570 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1572 note_kill = (plural ? " become dust." : " becomes dust.");
1577 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1580 note_kill = "À¸¤Ê֤ä¿¡£";
1582 note_kill = "rivived.";
1585 else if (!note_kill)
1588 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1590 note_kill = (plural ? " become dust." : " becomes dust.");
1602 /* Attempt to destroy the object */
1605 /* Effect "observed" */
1606 if (known && o_ptr->marked)
1609 object_desc(o_name, o_ptr, FALSE, 0);
1612 /* Artifacts, and other objects, get to resist */
1613 if (is_art || ignore)
1615 /* Observe the resist */
1616 if (known && o_ptr->marked)
1619 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1622 msg_format("The %s %s unaffected!",
1623 o_name, (plural ? "are" : "is"));
1632 /* Describe if needed */
1633 if (known && o_ptr->marked && note_kill)
1636 msg_format("%s¤Ï%s", o_name, note_kill);
1638 msg_format("The %s%s", o_name, note_kill);
1643 k_idx = o_ptr->k_idx;
1644 is_potion = object_is_potion(o_ptr);
1647 /* Delete the object */
1648 delete_object_idx(this_o_idx);
1650 /* Potions produce effects when 'shattered' */
1653 (void)potion_smash_effect(who, y, x, k_idx);
1662 /* Return "Anything seen?" */
1668 * Helper function for "project()" below.
1670 * Handle a beam/bolt/ball causing damage to a monster.
1672 * This routine takes a "source monster" (by index) which is mostly used to
1673 * determine if the player is causing the damage, and a "radius" (see below),
1674 * which is used to decrease the power of explosions with distance, and a
1675 * location, via integers which are modified by certain types of attacks
1676 * (polymorph and teleport being the obvious ones), a default damage, which
1677 * is modified as needed based on various properties, and finally a "damage
1678 * type" (see below).
1680 * Note that this routine can handle "no damage" attacks (like teleport) by
1681 * taking a "zero" damage, and can even take "parameters" to attacks (like
1682 * confuse) by accepting a "damage", using it to calculate the effect, and
1683 * then setting the damage to zero. Note that the "damage" parameter is
1684 * divided by the radius, so monsters not at the "epicenter" will not take
1685 * as much damage (or whatever)...
1687 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1688 * may result in a dereference of an invalid pointer. XXX XXX XXX
1690 * Various messages are produced, and damage is applied.
1692 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1693 * actually be "made" of that substance, or "breathe" big balls of it.
1695 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1698 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1699 * and hurts evil less. If can breath nether, then it resists it as well.
1701 * Damage reductions use the following formulas:
1702 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1703 * gives avg damage of .655, ranging from .858 to .500
1704 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1705 * gives avg damage of .544, ranging from .714 to .417
1706 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1707 * gives avg damage of .444, ranging from .556 to .333
1708 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1709 * gives avg damage of .327, ranging from .427 to .250
1710 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1711 * gives something simple.
1713 * In this function, "result" messages are postponed until the end, where
1714 * the "note" string is appended to the monster name, if not NULL. So,
1715 * to make a spell have "no effect" just set "note" to NULL. You should
1716 * also set "notice" to FALSE, or the player will learn what the spell does.
1718 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1720 /* "flg" was added. */
1721 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1725 cave_type *c_ptr = &cave[y][x];
1727 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1729 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1733 /* Is the monster "seen"? */
1734 bool seen = m_ptr->ml;
1736 bool slept = (bool)(m_ptr->csleep > 0);
1738 /* Were the effects "obvious" (if seen)? */
1739 bool obvious = FALSE;
1741 /* Can the player know about this effect? */
1742 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1744 /* Can the player see the source of this effect? */
1745 bool see_s = ((who <= 0) || m_list[who].ml);
1747 /* Were the effects "irrelevant"? */
1748 bool skipped = FALSE;
1750 /* Gets the monster angry at the source of the effect? */
1751 bool get_angry = FALSE;
1753 /* Polymorph setting (true or false) */
1756 /* Teleport setting (max distance) */
1759 /* Confusion setting (amount to confuse) */
1762 /* Stunning setting (amount to stun) */
1765 /* Sleep amount (amount to sleep) */
1768 /* Fear amount (amount to fear) */
1771 /* Time amount (amount to time) */
1774 bool heal_leper = FALSE;
1776 /* Hold the monster name */
1783 /* Assume no note */
1786 /* Assume a default death */
1788 cptr note_dies = "¤Ï»à¤ó¤À¡£";
1790 cptr note_dies = " dies.";
1798 if (!c_ptr->m_idx) return (FALSE);
1800 /* Never affect projector */
1801 if (who && (c_ptr->m_idx == who)) return (FALSE);
1802 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1803 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1805 /* Don't affect already death monsters */
1806 /* Prevents problems with chain reactions of exploding monsters */
1807 if (m_ptr->hp < 0) return (FALSE);
1809 /* Reduce damage by distance */
1810 dam = (dam + r) / (r + 1);
1813 /* Get the monster name (BEFORE polymorphing) */
1814 monster_desc(m_name, m_ptr, 0);
1816 /* Get the monster possessive ("his"/"her"/"its") */
1817 monster_desc(m_poss, m_ptr, 0x22);
1820 /* Some monsters get "destroyed" */
1821 if (!monster_living(r_ptr))
1824 bool explode = FALSE;
1826 for (i = 0; i < 4; i++)
1828 if (r_ptr->blow[i].method == RBM_EXPLODE) explode = TRUE;
1831 /* Special note at death */
1834 note_dies = "¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£";
1836 note_dies = " explodes into tiny shreds.";
1840 note_dies = "¤òÅݤ·¤¿¡£";
1842 note_dies = " is destroyed.";
1846 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1848 /* Analyze the damage type */
1851 /* Magic Missile -- pure damage */
1854 if (seen) obvious = TRUE;
1855 if (r_ptr->flags3 & (RF3_RES_ALL))
1858 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1860 note = " is immune.";
1863 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1872 if (seen) obvious = TRUE;
1873 if (r_ptr->flags3 & (RF3_RES_ALL))
1876 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1878 note = " is immune.";
1881 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1884 if (r_ptr->flags3 & (RF3_IM_ACID))
1887 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1889 note = " resists a lot.";
1893 if (seen) r_ptr->r_flags3 |= (RF3_IM_ACID);
1901 if (seen) obvious = TRUE;
1902 if (r_ptr->flags3 & (RF3_RES_ALL))
1905 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1907 note = " is immune.";
1910 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1913 if (r_ptr->flags3 & (RF3_IM_ELEC))
1916 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1918 note = " resists a lot.";
1922 if (seen) r_ptr->r_flags3 |= (RF3_IM_ELEC);
1930 if (seen) obvious = TRUE;
1931 if (r_ptr->flags3 & (RF3_RES_ALL))
1934 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1936 note = " is immune.";
1939 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1942 if (r_ptr->flags3 & (RF3_IM_FIRE))
1945 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1947 note = " resists a lot.";
1951 if (seen) r_ptr->r_flags3 |= (RF3_IM_FIRE);
1953 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1956 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1958 note = " is hit hard.";
1962 if (seen) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1970 if (seen) obvious = TRUE;
1971 if (r_ptr->flags3 & (RF3_RES_ALL))
1974 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1976 note = " is immune.";
1979 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1982 if (r_ptr->flags3 & (RF3_IM_COLD))
1985 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1987 note = " resists a lot.";
1991 if (seen) r_ptr->r_flags3 |= (RF3_IM_COLD);
1993 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1996 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1998 note = " is hit hard.";
2002 if (seen) r_ptr->r_flags3 |= (RF3_HURT_COLD);
2010 if (seen) obvious = TRUE;
2011 if (r_ptr->flags3 & (RF3_RES_ALL))
2014 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2016 note = " is immune.";
2019 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2022 if (r_ptr->flags3 & RF3_IM_POIS)
2025 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
2027 note = " resists a lot.";
2031 if (seen) r_ptr->r_flags3 |= (RF3_IM_POIS);
2039 if (seen) obvious = TRUE;
2041 if (r_ptr->flags3 & (RF3_RES_ALL))
2044 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2046 note = " is immune.";
2049 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2052 if (r_ptr->flags3 & RF3_IM_POIS)
2055 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2060 dam *= 3; dam /= randint1(6) + 6;
2061 if (seen) r_ptr->r_flags3 |= (RF3_IM_POIS);
2063 else if (one_in_(3)) do_poly = TRUE;
2067 /* Hellfire -- hurts Evil */
2070 if (seen) obvious = TRUE;
2071 if (r_ptr->flags3 & (RF3_RES_ALL))
2074 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2076 note = " is immune.";
2079 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2082 if (r_ptr->flags3 & RF3_GOOD)
2086 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2088 note = " is hit hard.";
2091 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
2096 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2099 if (seen) obvious = TRUE;
2100 if (r_ptr->flags3 & (RF3_RES_ALL))
2103 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2105 note = " is immune.";
2108 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2111 if (r_ptr->flags3 & RF3_GOOD)
2115 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2117 note = " is immune.";
2120 if (seen) r_ptr->r_flags3 |= RF3_GOOD;
2122 else if (r_ptr->flags3 & RF3_EVIL)
2126 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2128 note = " is hit hard.";
2131 if (seen) r_ptr->r_flags3 |= RF3_EVIL;
2136 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2141 dam *= 3; dam /= randint1(6) + 6;
2146 /* Arrow -- XXX no defense */
2149 if (seen) obvious = TRUE;
2150 if (r_ptr->flags3 & (RF3_RES_ALL))
2153 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2155 note = " is immune.";
2158 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2164 /* Plasma -- XXX perhaps check ELEC or FIRE */
2167 if (seen) obvious = TRUE;
2168 if (r_ptr->flags3 & (RF3_RES_ALL))
2171 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2173 note = " is immune.";
2176 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2179 if (r_ptr->flags3 & RF3_RES_PLAS)
2182 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2187 dam *= 3; dam /= randint1(6) + 6;
2189 r_ptr->r_flags3 |= (RF3_RES_PLAS);
2194 /* Nether -- see above */
2197 if (seen) obvious = TRUE;
2198 if (r_ptr->flags3 & (RF3_RES_ALL))
2201 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2203 note = " is immune.";
2206 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2209 if (r_ptr->flags3 & RF3_UNDEAD)
2212 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2214 note = " is immune.";
2218 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
2220 else if (r_ptr->flags3 & RF3_RES_NETH)
2223 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2228 dam *= 3; dam /= randint1(6) + 6;
2230 if (seen) r_ptr->r_flags3 |= (RF3_RES_NETH);
2232 else if (r_ptr->flags3 & RF3_EVIL)
2236 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2238 note = " resists somewhat.";
2241 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
2246 /* Water (acid) damage -- Water spirits/elementals are immune */
2249 if (seen) obvious = TRUE;
2250 if (r_ptr->flags3 & (RF3_RES_ALL))
2253 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2255 note = " is immune.";
2258 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2261 if (m_ptr->r_idx == MON_WATER_ELEM || m_ptr->r_idx == MON_UNMAKER)
2264 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2266 note = " is immune.";
2271 else if (r_ptr->flags3 & RF3_RES_WATE)
2274 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2279 dam *= 3; dam /= randint1(6) + 6;
2280 if (seen) r_ptr->r_flags3 |= (RF3_RES_WATE);
2285 /* Chaos -- Chaos breathers resist */
2288 if (seen) obvious = TRUE;
2289 if (r_ptr->flags3 & (RF3_RES_ALL))
2292 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2294 note = " is immune.";
2297 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2301 do_conf = (5 + randint1(11) + r) / (r + 1);
2302 if ((r_ptr->flags4 & RF4_BR_CHAO) ||
2303 (m_ptr->r_idx == MON_STORMBRINGER) ||
2304 ((r_ptr->flags3 & RF3_DEMON) && one_in_(3)))
2307 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2312 dam *= 3; dam /= randint1(6) + 6;
2318 /* Shards -- Shard breathers resist */
2321 if (seen) obvious = TRUE;
2322 if (r_ptr->flags3 & (RF3_RES_ALL))
2325 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2327 note = " is immune.";
2330 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2333 if (r_ptr->flags4 & RF4_BR_SHAR)
2336 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2341 dam *= 3; dam /= randint1(6) + 6;
2346 /* Rocket: Shard resistance helps */
2349 if (seen) obvious = TRUE;
2351 if (r_ptr->flags3 & (RF3_RES_ALL))
2354 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2356 note = " is immune.";
2359 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2362 if (r_ptr->flags4 & RF4_BR_SHAR)
2365 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2367 note = " resists somewhat.";
2376 /* Sound -- Sound breathers resist */
2379 if (seen) obvious = TRUE;
2380 if (r_ptr->flags3 & (RF3_RES_ALL))
2383 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2385 note = " is immune.";
2388 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2391 do_stun = (10 + randint1(15) + r) / (r + 1);
2392 if (r_ptr->flags4 & RF4_BR_SOUN)
2395 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2400 dam *= 2; dam /= randint1(6) + 6;
2408 if (seen) obvious = TRUE;
2409 if (r_ptr->flags3 & (RF3_RES_ALL))
2412 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2414 note = " is immune.";
2417 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2420 do_conf = (10 + randint1(15) + r) / (r + 1);
2421 if (r_ptr->flags4 & RF4_BR_CONF)
2424 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2429 dam *= 2; dam /= randint1(6) + 6;
2431 else if (r_ptr->flags3 & RF3_NO_CONF)
2434 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2436 note = " resists somewhat.";
2444 /* Disenchantment -- Breathers and Disenchanters resist */
2447 if (seen) obvious = TRUE;
2448 if (r_ptr->flags3 & (RF3_RES_ALL))
2451 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2453 note = " is immune.";
2456 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2459 if (r_ptr->flags3 & RF3_RES_DISE)
2462 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2467 dam *= 3; dam /= randint1(6) + 6;
2468 if (seen) r_ptr->r_flags3 |= (RF3_RES_DISE);
2473 /* Nexus -- Breathers and Existers resist */
2476 if (seen) obvious = TRUE;
2477 if (r_ptr->flags3 & (RF3_RES_ALL))
2480 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2482 note = " is immune.";
2485 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2488 if (r_ptr->flags3 & RF3_RES_NEXU)
2491 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2496 dam *= 3; dam /= randint1(6) + 6;
2497 if (seen) r_ptr->r_flags3 |= (RF3_RES_NEXU);
2505 if (seen) obvious = TRUE;
2506 if (r_ptr->flags3 & (RF3_RES_ALL))
2509 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2511 note = " is immune.";
2514 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2517 do_stun = (randint1(15) + r) / (r + 1);
2518 if (r_ptr->flags4 & RF4_BR_WALL)
2521 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2526 dam *= 3; dam /= randint1(6) + 6;
2531 /* Inertia -- breathers resist */
2534 if (seen) obvious = TRUE;
2535 if (r_ptr->flags3 & (RF3_RES_ALL))
2538 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2540 note = " is immune.";
2543 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2546 if (r_ptr->flags4 & (RF4_BR_INER))
2549 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2554 dam *= 3; dam /= randint1(6) + 6;
2558 /* Powerful monsters can resist */
2559 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2560 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2564 /* Normal monsters slow down */
2570 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2572 note = " starts moving slower.";
2575 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2576 if (c_ptr->m_idx == p_ptr->riding)
2577 p_ptr->update |= (PU_BONUS);
2583 /* Time -- breathers resist */
2586 if (seen) obvious = TRUE;
2587 if (r_ptr->flags3 & (RF3_RES_ALL))
2590 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2592 note = " is immune.";
2595 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2598 if (r_ptr->flags4 & (RF4_BR_TIME))
2601 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2606 dam *= 3; dam /= randint1(6) + 6;
2608 else do_time = (dam+1)/2;
2612 /* Gravity -- breathers resist */
2615 bool resist_tele = FALSE;
2617 if (seen) obvious = TRUE;
2619 if (r_ptr->flags3 & (RF3_RES_ALL))
2622 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2624 note = " is immune.";
2627 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2630 if (r_ptr->flags3 & (RF3_RES_TELE))
2632 if (r_ptr->flags1 & (RF1_UNIQUE))
2634 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
2636 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2638 note = " is unaffected!";
2643 else if (r_ptr->level > randint1(100))
2645 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
2647 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2656 if (!resist_tele) do_dist = 10;
2658 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2660 if (r_ptr->flags4 & (RF4_BR_GRAV))
2663 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2668 dam *= 3; dam /= randint1(6) + 6;
2674 /* Powerful monsters can resist */
2675 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2676 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2680 /* Normal monsters slow down */
2686 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2688 note = " starts moving slower.";
2691 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2692 if (c_ptr->m_idx == p_ptr->riding)
2693 p_ptr->update |= (PU_BONUS);
2697 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
2699 /* Attempt a saving throw */
2700 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2701 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2705 /* No obvious effect */
2707 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2709 note = " is unaffected!";
2723 if (seen) obvious = TRUE;
2724 if (r_ptr->flags3 & (RF3_RES_ALL))
2727 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2729 note = " is immune.";
2732 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2740 case GF_DISINTEGRATE:
2742 if (seen) obvious = TRUE;
2743 if (r_ptr->flags3 & (RF3_RES_ALL))
2746 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2748 note = " is immune.";
2751 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2754 if (r_ptr->flags3 & RF3_HURT_ROCK)
2756 if (seen) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2758 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2759 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2761 note = " loses some skin!";
2762 note_dies = " evaporates!";
2772 if (seen) obvious = TRUE;
2774 /* PSI only works if the monster can see you! -- RG */
2775 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2779 note = "¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª";
2781 note = " can't see you, and isn't affected!";
2786 if (r_ptr->flags3 & (RF3_RES_ALL))
2789 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2791 note = " is immune.";
2794 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2797 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2801 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2803 note = " is immune!";
2805 if (seen) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2808 else if ((r_ptr->flags2 & RF2_STUPID) ||
2809 (r_ptr->flags2 & RF2_WEIRD_MIND) ||
2810 (r_ptr->flags3 & RF3_ANIMAL) ||
2811 (r_ptr->level > randint1(3 * dam)))
2815 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2822 * Powerful demons & undead can turn a mindcrafter's
2823 * attacks back on them
2825 if (((r_ptr->flags3 & RF3_UNDEAD) ||
2826 (r_ptr->flags3 & RF3_DEMON)) &&
2827 (r_ptr->level > p_ptr->lev / 2) &&
2832 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
2835 msg_format("%^s%s corrupted mind backlashes your attack!",
2836 m_name, (seen ? "'s" : "s"));
2840 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2843 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2845 msg_print("You resist the effects!");
2851 /* Injure +/- confusion */
2852 monster_desc(killer, m_ptr, 0x288);
2853 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2856 switch (randint1(4))
2859 set_confused(p_ptr->confused + 3 + randint1(dam));
2862 set_stun(p_ptr->stun + randint1(dam));
2866 if (r_ptr->flags3 & RF3_NO_FEAR)
2868 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2870 note = " is unaffected.";
2874 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2878 if (!p_ptr->free_act)
2879 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2888 if ((dam > 0) && one_in_(4))
2890 switch (randint1(4))
2893 do_conf = 3 + randint1(dam);
2896 do_stun = 3 + randint1(dam);
2899 do_fear = 3 + randint1(dam);
2903 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2905 note = " falls asleep!";
2908 do_sleep = 3 + randint1(dam);
2914 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2916 note_dies = " collapses, a mindless husk.";
2924 if (seen) obvious = TRUE;
2925 if (r_ptr->flags3 & (RF3_RES_ALL))
2928 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2930 note = " is immune.";
2933 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2936 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2940 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2942 note = " is immune!";
2946 else if ((r_ptr->flags2 & RF2_STUPID) ||
2947 (r_ptr->flags2 & RF2_WEIRD_MIND) ||
2948 (r_ptr->flags3 & RF3_ANIMAL) ||
2949 (r_ptr->level > randint1(3 * dam)))
2953 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2960 * Powerful demons & undead can turn a mindcrafter's
2961 * attacks back on them
2963 if (((r_ptr->flags3 & RF3_UNDEAD) ||
2964 (r_ptr->flags3 & RF3_DEMON)) &&
2965 (r_ptr->level > p_ptr->lev / 2) &&
2970 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
2973 msg_format("%^s%s corrupted mind backlashes your attack!",
2974 m_name, (seen ? "'s" : "s"));
2978 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2981 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2983 msg_print("You resist the effects!");
2989 /* Injure + mana drain */
2990 monster_desc(killer, m_ptr, 0x288);
2992 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
2994 msg_print("Your psychic energy is drained!");
2997 p_ptr->csp = MAX(0, p_ptr->csp - damroll(5, dam) / 2);
2998 p_ptr->redraw |= PR_MANA;
2999 p_ptr->window |= (PW_SPELL);
3000 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
3007 int b = damroll(5, dam) / 4;
3009 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª",
3012 msg_format("You convert %s%s pain into psychic energy!",
3013 m_name, (seen ? "'s" : "s"));
3016 b = MIN(p_ptr->msp, p_ptr->csp + b);
3018 p_ptr->redraw |= PR_MANA;
3019 p_ptr->window |= (PW_SPELL);
3023 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
3025 note_dies = " collapses, a mindless husk.";
3031 case GF_TELEKINESIS:
3033 if (seen) obvious = TRUE;
3034 if (r_ptr->flags3 & (RF3_RES_ALL))
3037 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3039 note = " is immune.";
3042 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3047 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
3052 do_stun = damroll((p_ptr->lev / 10) + 3 , dam) + 1;
3054 /* Attempt a saving throw */
3055 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3056 (r_ptr->level > 5 + randint1(dam)))
3060 /* No obvious effect */
3066 /* Psycho-spear -- powerful magic missile */
3069 if (seen) obvious = TRUE;
3070 if (r_ptr->flags3 & (RF3_RES_ALL))
3073 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3075 note = " is immune.";
3078 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3084 /* Meteor -- powerful magic missile */
3087 if (seen) obvious = TRUE;
3088 if (r_ptr->flags3 & (RF3_RES_ALL))
3091 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3093 note = " is immune.";
3096 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3104 if (!is_hostile(m_ptr)) break;
3105 if (seen) obvious = TRUE;
3107 if (r_ptr->flags3 & (RF3_RES_ALL))
3110 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3112 note = " is immune.";
3115 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3118 /* Attempt a saving throw */
3119 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3120 (r_ptr->flags1 & RF1_QUESTOR) ||
3121 (r_ptr->flags3 & RF3_NO_CONF) ||
3122 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3124 /* Memorize a flag */
3125 if (r_ptr->flags3 & RF3_NO_CONF)
3127 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
3134 * Powerful demons & undead can turn a mindcrafter's
3135 * attacks back on them
3137 if (((r_ptr->flags3 & RF3_UNDEAD) ||
3138 (r_ptr->flags3 & RF3_DEMON)) &&
3139 (r_ptr->level > p_ptr->lev / 2) &&
3144 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
3147 msg_format("%^s%s corrupted mind backlashes your attack!",
3148 m_name, (seen ? "'s" : "s"));
3152 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3155 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3157 msg_print("You resist the effects!");
3163 /* Confuse, stun, terrify */
3164 switch (randint1(4))
3167 set_stun(p_ptr->stun + dam / 2);
3170 set_confused(p_ptr->confused + dam / 2);
3174 if (r_ptr->flags3 & RF3_NO_FEAR)
3176 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3178 note = " is unaffected.";
3182 set_afraid(p_ptr->afraid + dam);
3189 /* No obvious effect */
3191 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3193 note = " is unaffected!";
3201 if ((dam > 29) && (randint1(100) < dam))
3204 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3206 note = " is in your thrall!";
3213 switch (randint1(4))
3227 /* No "real" damage */
3234 /* Ice -- Cold + Cuts + Stun */
3237 if (seen) obvious = TRUE;
3238 if (r_ptr->flags3 & (RF3_RES_ALL))
3241 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3243 note = " is immune.";
3246 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3249 do_stun = (randint1(15) + 1) / (r + 1);
3250 if (r_ptr->flags3 & RF3_IM_COLD)
3253 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3255 note = " resists a lot.";
3259 if (seen) r_ptr->r_flags3 |= (RF3_IM_COLD);
3261 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3264 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3266 note = " is hit hard.";
3270 if (seen) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3279 if (seen) obvious = TRUE;
3281 if (r_ptr->flags3 & (RF3_RES_ALL))
3284 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3286 note = " is immune.";
3289 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3292 if (!monster_living(r_ptr))
3294 if (r_ptr->flags3 & RF3_UNDEAD)
3296 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
3299 if (r_ptr->flags3 & (RF3_DEMON))
3301 if (seen) r_ptr->r_flags3 |= (RF3_DEMON);
3305 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3307 note = " is unaffected!";
3313 else do_time = (dam+7)/8;
3321 if (seen) obvious = TRUE;
3323 if (r_ptr->flags3 & (RF3_RES_ALL))
3326 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3328 note = " is immune.";
3331 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3334 if ((r_ptr->flags3 & RF3_UNDEAD) ||
3335 (r_ptr->flags3 & RF3_NONLIVING))
3337 if (r_ptr->flags3 & RF3_UNDEAD)
3339 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
3343 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3345 note = " is immune.";
3351 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3352 (randint1(888) != 666)) ||
3353 (((r_ptr->level + randint1(20)) > randint1(p_ptr->lev + randint1(10))) &&
3354 randint1(100) != 66))
3357 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3369 /* Polymorph monster (Use "dam" as "power") */
3372 if (seen) obvious = TRUE;
3374 if (r_ptr->flags3 & (RF3_RES_ALL))
3377 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3379 note = " is immune.";
3382 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3385 /* Attempt to polymorph (see below) */
3388 /* Powerful monsters can resist */
3389 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3390 (r_ptr->flags1 & RF1_QUESTOR) ||
3391 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3394 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3396 note = " is unaffected!";
3403 /* No "real" damage */
3410 /* Clone monsters (Ignore "dam") */
3413 if (seen) obvious = TRUE;
3415 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)))
3418 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3420 note = " is unaffected!";
3426 m_ptr->hp = m_ptr->maxhp;
3428 /* Attempt to clone. */
3429 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3432 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3440 /* No "real" damage */
3447 /* Heal Monster (use "dam" as amount of healing) */
3450 if (seen) obvious = TRUE;
3455 if (m_ptr->maxhp < m_ptr->max_maxhp)
3458 msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3460 msg_format("%^s recovers %s vitality.", m_name, m_poss);
3462 m_ptr->maxhp = m_ptr->max_maxhp;
3468 if (seen) obvious = TRUE;
3476 msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3478 msg_format("%^s is no longer stunned.", m_name);
3482 if (m_ptr->confused)
3485 msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3487 msg_format("%^s is no longer confused.", m_name);
3489 m_ptr->confused = 0;
3494 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3496 msg_format("%^s recovers %s courage.", m_name, m_poss);
3502 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3505 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3507 chg_virtue(V_VITALITY, 1);
3509 if (r_ptr->flags1 & RF1_UNIQUE)
3510 chg_virtue(V_INDIVIDUALISM, 1);
3512 if (is_friendly(m_ptr))
3513 chg_virtue(V_HONOUR, 1);
3514 else if (!(r_ptr->flags3 & RF3_EVIL))
3516 if (r_ptr->flags3 & RF3_GOOD)
3517 chg_virtue(V_COMPASSION, 2);
3519 chg_virtue(V_COMPASSION, 1);
3522 if (m_ptr->r_idx == MON_LEPER)
3525 chg_virtue(V_COMPASSION, 5);
3528 if (r_ptr->flags3 & RF3_ANIMAL)
3529 chg_virtue(V_NATURE, 1);
3531 /* Redraw (later) if needed */
3532 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3533 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3537 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3539 note = " looks healthier.";
3543 /* No "real" damage */
3549 /* Speed Monster (Ignore "dam") */
3552 if (seen) obvious = TRUE;
3558 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3560 note = " starts moving faster.";
3563 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3565 if (c_ptr->m_idx == p_ptr->riding)
3566 p_ptr->update |= (PU_BONUS);
3568 if (r_ptr->flags1 & RF1_UNIQUE)
3569 chg_virtue(V_INDIVIDUALISM, 1);
3570 if (is_friendly(m_ptr))
3571 chg_virtue(V_HONOUR, 1);
3573 /* No "real" damage */
3579 /* Slow Monster (Use "dam" as "power") */
3582 if (seen) obvious = TRUE;
3584 if (r_ptr->flags3 & (RF3_RES_ALL))
3587 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3589 note = " is immune.";
3592 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3595 /* Powerful monsters can resist */
3596 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3597 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3600 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3602 note = " is unaffected!";
3608 /* Normal monsters slow down */
3614 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3616 note = " starts moving slower.";
3619 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3621 if (c_ptr->m_idx == p_ptr->riding)
3622 p_ptr->update |= (PU_BONUS);
3625 /* No "real" damage */
3631 /* Sleep (Use "dam" as "power") */
3634 if (seen) obvious = TRUE;
3636 if (r_ptr->flags3 & (RF3_RES_ALL))
3639 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3641 note = " is immune.";
3644 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3647 /* Attempt a saving throw */
3648 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3649 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3650 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3652 /* Memorize a flag */
3653 if (r_ptr->flags3 & RF3_NO_SLEEP)
3655 if (seen) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3658 /* No obvious effect */
3660 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3662 note = " is unaffected!";
3669 /* Go to sleep (much) later */
3671 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3673 note = " falls asleep!";
3679 /* No "real" damage */
3685 /* Sleep (Use "dam" as "power") */
3686 case GF_STASIS_EVIL:
3688 if (seen) obvious = TRUE;
3690 if (r_ptr->flags3 & (RF3_RES_ALL))
3693 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3695 note = " is immune.";
3698 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3701 /* Attempt a saving throw */
3702 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3703 !(r_ptr->flags3 & RF3_EVIL) ||
3704 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3707 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3709 note = " is unaffected!";
3716 /* Go to sleep (much) later */
3718 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3720 note = " is suspended!";
3726 /* No "real" damage */
3731 /* Sleep (Use "dam" as "power") */
3734 if (seen) obvious = TRUE;
3736 if (r_ptr->flags3 & (RF3_RES_ALL))
3739 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3741 note = " is immune.";
3744 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3747 /* Attempt a saving throw */
3748 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3749 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3752 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3754 note = " is unaffected!";
3761 /* Go to sleep (much) later */
3763 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3765 note = " is suspended!";
3771 /* No "real" damage */
3780 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3781 vir = virtue_number(V_HARMONY);
3784 dam += p_ptr->virtues[vir-1]/10;
3787 vir = virtue_number(V_INDIVIDUALISM);
3790 dam -= p_ptr->virtues[vir-1]/20;
3793 if (seen) obvious = TRUE;
3795 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3798 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3800 note = " is immune.";
3803 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3807 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3810 /* Attempt a saving throw */
3811 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3812 (r_ptr->flags3 & RF3_NO_CONF) ||
3813 (m_ptr->mflag2 & MFLAG_NOPET) ||
3814 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3816 /* Memorize a flag */
3817 if (r_ptr->flags3 & RF3_NO_CONF)
3819 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
3823 /* No obvious effect */
3825 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3827 note = " is unaffected!";
3832 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3834 else if (p_ptr->cursed & TRC_AGGRAVATE)
3837 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3839 note = " hates you too much!";
3842 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3847 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3849 note = " suddenly seems friendly!";
3854 chg_virtue(V_INDIVIDUALISM, -1);
3855 if (r_ptr->flags3 & RF3_ANIMAL)
3856 chg_virtue(V_NATURE, 1);
3859 /* No "real" damage */
3864 /* Control undead */
3865 case GF_CONTROL_UNDEAD:
3868 if (seen) obvious = TRUE;
3870 vir = virtue_number(V_UNLIFE);
3873 dam += p_ptr->virtues[vir-1]/10;
3876 vir = virtue_number(V_INDIVIDUALISM);
3879 dam -= p_ptr->virtues[vir-1]/20;
3882 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3885 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3887 note = " is immune.";
3890 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3894 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3897 /* Attempt a saving throw */
3898 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3899 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3900 (m_ptr->mflag2 & MFLAG_NOPET) ||
3901 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3903 /* No obvious effect */
3905 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3907 note = " is unaffected!";
3911 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3913 else if (p_ptr->cursed & TRC_AGGRAVATE)
3916 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3918 note = " hates you too much!";
3921 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3926 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3928 note = " is in your thrall!";
3934 /* No "real" damage */
3940 case GF_CONTROL_DEMON:
3943 if (seen) obvious = TRUE;
3945 vir = virtue_number(V_UNLIFE);
3948 dam += p_ptr->virtues[vir-1]/10;
3951 vir = virtue_number(V_INDIVIDUALISM);
3954 dam -= p_ptr->virtues[vir-1]/20;
3957 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3960 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3962 note = " is immune.";
3965 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3969 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3972 /* Attempt a saving throw */
3973 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3974 (!(r_ptr->flags3 & RF3_DEMON)) ||
3975 (m_ptr->mflag2 & MFLAG_NOPET) ||
3976 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3978 /* No obvious effect */
3980 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3982 note = " is unaffected!";
3986 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3988 else if (p_ptr->cursed & TRC_AGGRAVATE)
3991 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3993 note = " hates you too much!";
3996 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4001 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
4003 note = " is in your thrall!";
4009 /* No "real" damage */
4015 case GF_CONTROL_ANIMAL:
4019 if (seen) obvious = TRUE;
4021 vir = virtue_number(V_NATURE);
4024 dam += p_ptr->virtues[vir-1]/10;
4027 vir = virtue_number(V_INDIVIDUALISM);
4030 dam -= p_ptr->virtues[vir-1]/20;
4033 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
4036 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4038 note = " is immune.";
4041 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4045 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4048 /* Attempt a saving throw */
4049 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4050 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
4051 (m_ptr->mflag2 & MFLAG_NOPET) ||
4052 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4053 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4055 /* Memorize a flag */
4056 if (r_ptr->flags3 & (RF3_NO_CONF))
4058 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
4062 /* No obvious effect */
4064 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4066 note = " is unaffected!";
4070 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4072 else if (p_ptr->cursed & TRC_AGGRAVATE)
4075 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4077 note = " hates you too much!";
4080 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4085 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4087 note = " is tamed!";
4092 if (r_ptr->flags3 & RF3_ANIMAL)
4093 chg_virtue(V_NATURE, 1);
4096 /* No "real" damage */
4102 case GF_CONTROL_LIVING:
4106 vir = virtue_number(V_UNLIFE);
4107 if (seen) obvious = TRUE;
4109 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4110 vir = virtue_number(V_UNLIFE);
4113 dam -= p_ptr->virtues[vir-1]/10;
4116 vir = virtue_number(V_INDIVIDUALISM);
4119 dam -= p_ptr->virtues[vir-1]/20;
4122 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4123 if (dam < 1) dam = 1;
4125 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4127 msg_format("You stare into %s.", m_name);
4129 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
4132 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4134 note = " is immune.";
4137 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4141 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4144 /* Attempt a saving throw */
4145 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4146 (m_ptr->mflag2 & MFLAG_NOPET) ||
4147 (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) ||
4148 ((r_ptr->level+10) > randint1(dam)))
4151 /* No obvious effect */
4153 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4155 note = " is unaffected!";
4159 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4161 else if (p_ptr->cursed & TRC_AGGRAVATE)
4164 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4166 note = " hates you too much!";
4169 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4174 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4176 note = " is tamed!";
4181 if (r_ptr->flags3 & RF3_ANIMAL)
4182 chg_virtue(V_NATURE, 1);
4185 /* No "real" damage */
4190 /* Confusion (Use "dam" as "power") */
4193 if (seen) obvious = TRUE;
4195 if (r_ptr->flags3 & (RF3_RES_ALL))
4198 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4200 note = " is immune.";
4203 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4206 /* Get confused later */
4207 do_conf = damroll(3, (dam / 2)) + 1;
4209 /* Attempt a saving throw */
4210 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4211 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4212 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4214 /* Memorize a flag */
4215 if (r_ptr->flags3 & (RF3_NO_CONF))
4217 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
4223 /* No obvious effect */
4225 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4227 note = " is unaffected!";
4233 /* No "real" damage */
4240 if (seen) obvious = TRUE;
4242 if (r_ptr->flags3 & (RF3_RES_ALL))
4245 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4247 note = " is immune.";
4250 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4253 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
4255 /* Attempt a saving throw */
4256 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4257 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4262 /* No obvious effect */
4264 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4266 note = " is unaffected!";
4272 /* No "real" damage */
4280 /* Lite, but only hurts susceptible creatures */
4288 if (r_ptr->flags3 & (RF3_RES_ALL))
4294 if (r_ptr->flags3 & (RF3_HURT_LITE))
4296 /* Obvious effect */
4297 if (seen) obvious = TRUE;
4299 /* Memorize the effects */
4300 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4302 /* Special effect */
4304 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4305 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4307 note = " cringes from the light!";
4308 note_dies = " shrivels away in the light!";
4313 /* Normally no damage */
4325 /* Lite -- opposite of Dark */
4328 if (seen) obvious = TRUE;
4329 if (r_ptr->flags3 & (RF3_RES_ALL))
4332 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4334 note = " is immune.";
4337 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4340 if (r_ptr->flags4 & (RF4_BR_LITE))
4343 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4348 dam *= 2; dam /= (randint1(6)+6);
4350 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4352 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4354 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4355 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4357 note = " cringes from the light!";
4358 note_dies = " shrivels away in the light!";
4367 /* Dark -- opposite of Lite */
4370 if (seen) obvious = TRUE;
4372 if (r_ptr->flags3 & (RF3_RES_ALL))
4375 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4377 note = " is immune.";
4380 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4383 /* Likes darkness... */
4384 if ((r_ptr->flags4 & (RF4_BR_DARK)) ||
4385 (r_ptr->flags3 & RF3_ORC) ||
4386 (r_ptr->flags3 & RF3_HURT_LITE))
4389 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4394 dam *= 2; dam /= (randint1(6)+6);
4403 if (r_ptr->flags3 & (RF3_RES_ALL))
4408 /* Hurt by rock remover */
4409 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4412 if (seen) obvious = TRUE;
4414 /* Memorize the effects */
4415 if (seen) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4417 /* Cute little message */
4419 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4420 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4422 note = " loses some skin!";
4423 note_dies = " dissolves!";
4428 /* Usually, ignore the effects */
4439 /* Teleport undead (Use "dam" as "power") */
4440 case GF_AWAY_UNDEAD:
4442 /* Only affect undead */
4443 if (r_ptr->flags3 & (RF3_UNDEAD))
4445 bool resists_tele = FALSE;
4447 if (r_ptr->flags3 & (RF3_RES_TELE))
4449 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4451 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4453 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4455 note = " is unaffected!";
4458 resists_tele = TRUE;
4460 else if (r_ptr->level > randint1(100))
4462 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4464 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4469 resists_tele = TRUE;
4475 if (seen) obvious = TRUE;
4476 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4488 /* No "real" damage */
4494 /* Teleport evil (Use "dam" as "power") */
4497 /* Only affect evil */
4498 if (r_ptr->flags3 & (RF3_EVIL))
4500 bool resists_tele = FALSE;
4502 if (r_ptr->flags3 & (RF3_RES_TELE))
4504 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4506 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4508 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4510 note = " is unaffected!";
4513 resists_tele = TRUE;
4515 else if (r_ptr->level > randint1(100))
4517 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4519 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4524 resists_tele = TRUE;
4530 if (seen) obvious = TRUE;
4531 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4543 /* No "real" damage */
4549 /* Teleport monster (Use "dam" as "power") */
4552 bool resists_tele = FALSE;
4553 if (r_ptr->flags3 & (RF3_RES_TELE))
4555 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4557 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4559 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4561 note = " is unaffected!";
4564 resists_tele = TRUE;
4566 else if (r_ptr->level > randint1(100))
4568 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4570 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4575 resists_tele = TRUE;
4582 if (seen) obvious = TRUE;
4584 /* Prepare to teleport */
4588 /* No "real" damage */
4594 /* Turn undead (Use "dam" as "power") */
4595 case GF_TURN_UNDEAD:
4597 if (r_ptr->flags3 & (RF3_RES_ALL))
4602 /* Only affect undead */
4603 if (r_ptr->flags3 & (RF3_UNDEAD))
4605 /* Learn about type */
4606 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4609 if (seen) obvious = TRUE;
4611 /* Apply some fear */
4612 do_fear = damroll(3, (dam / 2)) + 1;
4614 /* Attempt a saving throw */
4615 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4617 /* No obvious effect */
4619 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4621 note = " is unaffected!";
4636 /* No "real" damage */
4642 /* Turn evil (Use "dam" as "power") */
4645 if (r_ptr->flags3 & (RF3_RES_ALL))
4650 /* Only affect evil */
4651 if (r_ptr->flags3 & (RF3_EVIL))
4653 /* Learn about type */
4654 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4657 if (seen) obvious = TRUE;
4659 /* Apply some fear */
4660 do_fear = damroll(3, (dam / 2)) + 1;
4662 /* Attempt a saving throw */
4663 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4665 /* No obvious effect */
4667 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4669 note = " is unaffected!";
4684 /* No "real" damage */
4690 /* Turn monster (Use "dam" as "power") */
4693 if (r_ptr->flags3 & (RF3_RES_ALL))
4699 if (seen) obvious = TRUE;
4701 /* Apply some fear */
4702 do_fear = damroll(3, (dam / 2)) + 1;
4704 /* Attempt a saving throw */
4705 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4706 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4707 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4709 /* No obvious effect */
4711 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4713 note = " is unaffected!";
4720 /* No "real" damage */
4727 case GF_DISP_UNDEAD:
4729 if (r_ptr->flags3 & (RF3_RES_ALL))
4735 /* Only affect undead */
4736 if (r_ptr->flags3 & (RF3_UNDEAD))
4738 /* Learn about type */
4739 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4742 if (seen) obvious = TRUE;
4746 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4747 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4749 note = " shudders.";
4750 note_dies = " dissolves!";
4772 if (r_ptr->flags3 & (RF3_RES_ALL))
4778 /* Only affect evil */
4779 if (r_ptr->flags3 & (RF3_EVIL))
4781 /* Learn about type */
4782 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4785 if (seen) obvious = TRUE;
4789 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4790 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4792 note = " shudders.";
4793 note_dies = " dissolves!";
4814 if (r_ptr->flags3 & (RF3_RES_ALL))
4820 /* Only affect good */
4821 if (r_ptr->flags3 & (RF3_GOOD))
4823 /* Learn about type */
4824 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
4827 if (seen) obvious = TRUE;
4831 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4832 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4834 note = " shudders.";
4835 note_dies = " dissolves!";
4854 case GF_DISP_LIVING:
4856 if (r_ptr->flags3 & (RF3_RES_ALL))
4862 /* Only affect non-undead */
4863 if (monster_living(r_ptr))
4866 if (seen) obvious = TRUE;
4870 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4871 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4873 note = " shudders.";
4874 note_dies = " dissolves!";
4895 if (r_ptr->flags3 & (RF3_RES_ALL))
4901 /* Only affect demons */
4902 if (r_ptr->flags3 & (RF3_DEMON))
4904 /* Learn about type */
4905 if (seen) r_ptr->r_flags3 |= (RF3_DEMON);
4908 if (seen) obvious = TRUE;
4912 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4913 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4915 note = " shudders.";
4916 note_dies = " dissolves!";
4934 /* Dispel monster */
4937 if (r_ptr->flags3 & (RF3_RES_ALL))
4944 if (seen) obvious = TRUE;
4948 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4949 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4951 note = " shudders.";
4952 note_dies = " dissolves!";
4962 if (seen) obvious = TRUE;
4963 if (r_ptr->flags3 & (RF3_RES_ALL))
4966 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4968 note = " is immune.";
4971 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4975 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4979 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£",m_name);
4981 msg_format("You draws psychic energy from %s.", m_name);
4984 (void)hp_player(dam);
4989 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
4991 msg_format("%s is unaffected.", m_name);
5001 if (seen) obvious = TRUE;
5004 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5006 msg_format("You gazes intently at %s.", m_name);
5009 if (r_ptr->flags3 & (RF3_RES_ALL))
5012 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5014 note = " is immune.";
5017 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5021 /* Attempt a saving throw */
5022 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5023 (r_ptr->flags3 & RF3_NO_CONF) ||
5024 (r_ptr->level > randint1((p_ptr->lev*2 - 10) < 1 ? 1 : (p_ptr->lev*2 - 10)) + 10))
5026 /* Memorize a flag */
5027 if (r_ptr->flags3 & (RF3_NO_CONF))
5029 r_ptr->r_flags3 |= (RF3_NO_CONF);
5032 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5034 note = "is unaffected!";
5041 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5042 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±¶õ¤È¤Ê¤Ã¤¿¡£";
5044 msg_format("%^s is blasted by psionic energy.", m_name);
5045 note_dies = " collapses, a mindless husk.";
5048 do_conf = randint0(8) + 8;
5054 case GF_BRAIN_SMASH:
5056 if (seen) obvious = TRUE;
5059 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5061 msg_format("You gazes intently at %s.", m_name);
5064 if (r_ptr->flags3 & (RF3_RES_ALL))
5067 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5069 note = " is immune.";
5072 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5076 /* Attempt a saving throw */
5077 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5078 (r_ptr->flags3 & RF3_NO_CONF) ||
5079 (r_ptr->level > randint1((p_ptr->lev*2 - 10) < 1 ? 1 : (p_ptr->lev*2 - 10)) + 10))
5081 /* Memorize a flag */
5082 if (r_ptr->flags3 & (RF3_NO_CONF))
5084 r_ptr->r_flags3 |= (RF3_NO_CONF);
5087 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5089 note = "is unaffected!";
5096 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5097 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±¶õ¤È¤Ê¤Ã¤¿¡£";
5099 msg_format("%^s is blasted by psionic energy.", m_name);
5100 note_dies = " collapses, a mindless husk.";
5103 do_conf = randint0(8) + 8;
5104 do_stun = randint0(8) + 8;
5105 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5106 if (c_ptr->m_idx == p_ptr->riding)
5107 p_ptr->update |= (PU_BONUS);
5115 if (seen) obvious = TRUE;
5118 msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5120 msg_format("You points at %s and curses.", m_name);
5123 if (r_ptr->flags3 & (RF3_RES_ALL))
5126 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5128 note = " is immune.";
5131 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5135 /* Attempt a saving throw */
5136 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5140 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5142 note = "is unaffected!";
5152 if (seen) obvious = TRUE;
5155 msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5157 msg_format("You points at %s and curses horribly.", m_name);
5160 if (r_ptr->flags3 & (RF3_RES_ALL))
5163 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5165 note = " is immune.";
5168 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5172 /* Attempt a saving throw */
5173 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5177 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5179 note = "is unaffected!";
5189 if (seen) obvious = TRUE;
5192 msg_format("%s¤ò»Øº¹¤·¡¢¶²¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª",m_name);
5194 msg_format("You points at %s, incanting terribly!", m_name);
5197 if (r_ptr->flags3 & (RF3_RES_ALL))
5200 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5202 note = " is immune.";
5205 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5209 /* Attempt a saving throw */
5210 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5214 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5216 note = "is unaffected!";
5226 if (seen) obvious = TRUE;
5229 msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£",m_name);
5231 msg_format("You points at %s, screaming th word, 'DIE!'.", m_name);
5234 if (r_ptr->flags3 & (RF3_RES_ALL))
5237 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5239 note = " is immune.";
5242 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5246 /* Attempt a saving throw */
5247 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5251 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5253 note = "is unaffected!";
5263 if (seen) obvious = TRUE;
5265 if (r_ptr->flags3 & (RF3_RES_ALL))
5268 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5270 note = " is immune.";
5273 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5277 if (r_ptr->flags1 & RF1_UNIQUE)
5280 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5282 note = "is unaffected!";
5288 if ((p_ptr->lev + randint1(dam)) >
5289 (r_ptr->level + randint1(200)))
5291 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5293 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5298 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5308 /* Capture monster */
5312 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5313 (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_UNIQUE_7)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR))
5316 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5318 msg_format("%^s is unaffected.", m_name);
5324 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5325 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)))
5326 nokori_hp = m_ptr->maxhp * 3 / 10;
5328 nokori_hp = m_ptr->maxhp * 3 / 20;
5330 if (m_ptr->hp >= nokori_hp)
5333 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5335 msg_format("You need to weaken %s more.", m_name);
5339 else if (m_ptr->hp < randint0(nokori_hp))
5341 if (m_ptr->mflag2 & MFLAG_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5343 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5345 msg_format("You captures %^s!", m_name);
5347 cap_mon = m_list[c_ptr->m_idx].r_idx;
5348 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5349 cap_hp = m_list[c_ptr->m_idx].hp;
5350 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5351 if (m_list[c_ptr->m_idx].nickname)
5352 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5355 if (c_ptr->m_idx == p_ptr->riding)
5357 if (rakuba(-1, FALSE))
5360 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5362 msg_format("You have fallen from %s.", m_name);
5367 delete_monster_idx(c_ptr->m_idx);
5374 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5376 msg_format("You failed to capture %s.", m_name);
5385 if (seen) obvious = TRUE;
5387 if (dam == HISSATSU_NYUSIN)
5391 bool success = FALSE;
5392 for (i = 0; i < 8; i++)
5394 if (cave_empty_bold(y+ddy[i], x+ddx[i]) || ((y+ddy[i] == py) && (x+ddx[i] == px)))
5397 if (distance(py, px, ny, nx) > distance(py, px, y+ddy[i], x+ddx[i]))
5406 if ((ny != py) || (nx != px))
5408 teleport_player_to(ny, nx, FALSE);
5410 msg_print("ÁÇÁ᤯Áê¼ê¤Î²û¤ËÆþ¤ê¹þ¤ó¤À¡ª");
5412 msg_format("You quickly jump in and attack %s!", m_name);
5419 msg_print("¼ºÇÔ¡ª");
5421 msg_print("Failed!");
5428 return (py_attack(y, x, dam));
5431 msg_print("¹¶·â¤Ï¶õ¤òÀڤä¿¡£");
5433 msg_print("You attack the empty air.");
5439 /* Sleep (Use "dam" as "power") */
5445 if (seen) obvious = TRUE;
5447 if (r_ptr->flags3 & (RF3_RES_ALL))
5450 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5452 note = " is immune.";
5455 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5458 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5461 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5463 note = " is immune!";
5467 if (seen) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5473 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5475 note = " is immune!";
5482 if (one_in_(5)) effect = 1;
5483 else if (one_in_(4)) effect = 2;
5484 else if (one_in_(3)) effect = 3;
5489 /* Powerful monsters can resist */
5490 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5491 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5494 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5496 note = " is unaffected!";
5502 /* Normal monsters slow down */
5508 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5510 note = " starts moving slower.";
5513 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5515 if (c_ptr->m_idx == p_ptr->riding)
5516 p_ptr->update |= (PU_BONUS);
5520 else if (effect == 2)
5522 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5524 /* Attempt a saving throw */
5525 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5526 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5531 /* No obvious effect */
5533 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5535 note = " is unaffected!";
5542 else if (effect == 3)
5544 /* Attempt a saving throw */
5545 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5546 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5547 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5549 /* Memorize a flag */
5550 if (r_ptr->flags3 & RF3_NO_SLEEP)
5552 if (seen) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5555 /* No obvious effect */
5557 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5559 note = " is unaffected!";
5566 /* Go to sleep (much) later */
5568 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5570 note = " falls asleep!";
5580 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5582 note = " is immune!";
5586 /* No "real" damage */
5595 if (seen) obvious = TRUE;
5597 if (r_ptr->flags3 & (RF3_RES_ALL))
5600 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5602 note = " is immune.";
5605 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5609 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)
5616 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG_NOGENO))
5623 delete_monster_idx(c_ptr->m_idx);
5625 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5627 msg_format("%^s disappered!",m_name);
5631 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5633 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5637 chg_virtue(V_VITALITY, -1);
5642 p_ptr->redraw |= (PR_HP);
5645 p_ptr->window |= (PW_PLAYER);
5652 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5654 note = "is unaffected!";
5657 if (one_in_(13)) m_ptr->mflag2 |= MFLAG_NOGENO;
5665 msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£",m_name);
5667 msg_format("You take a photograph of %s.",m_name);
5670 if (r_ptr->flags3 & (RF3_HURT_LITE))
5672 /* Obvious effect */
5673 if (seen) obvious = TRUE;
5675 /* Memorize the effects */
5676 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5678 /* Special effect */
5680 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5681 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5683 note = " cringes from the light!";
5684 note_dies = " shrivels away in the light!";
5689 /* Normally no damage */
5696 photo = m_ptr->r_idx;
5703 case GF_BLOOD_CURSE:
5705 if (seen) obvious = TRUE;
5706 if (r_ptr->flags3 & (RF3_RES_ALL))
5709 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5711 note = " is immune.";
5714 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5722 bool success = FALSE;
5723 if (seen) obvious = TRUE;
5725 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5727 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5728 if (dam < 1) dam = 1;
5730 /* No need to tame your pet */
5734 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5736 note = " starts moving faster.";
5739 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5743 /* Attempt a saving throw */
5744 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5745 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5746 (m_ptr->mflag2 & MFLAG_NOPET) ||
5747 (p_ptr->cursed & TRC_AGGRAVATE) ||
5748 ((r_ptr->level+10) > randint1(dam)))
5751 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
5756 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5758 note = " is tamed!";
5762 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5764 /* Learn about type */
5765 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
5772 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5774 do_fear = randint1(90)+10;
5778 r_ptr->r_flags3 |= (RF3_NO_FEAR);
5782 /* No "real" damage */
5789 if (seen) obvious = TRUE;
5791 if (r_ptr->flags3 & (RF3_RES_ALL))
5794 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5796 note = " is immune.";
5799 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5803 /* Attempt a saving throw */
5804 if (randint0(100 + dam) < (r_ptr->level + 50))
5808 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5810 note = "is unaffected!";
5831 /* Absolutely no effect */
5832 if (skipped) return (FALSE);
5834 /* "Unique" monsters cannot be polymorphed */
5835 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5837 /* Quest monsters cannot be polymorphed */
5838 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5840 if (p_ptr->riding & (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5842 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5843 if (((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7) || (r_ptr->flags1 & RF1_QUESTOR)) && !p_ptr->inside_battle)
5845 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5850 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5851 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5854 /* Modify the damage */
5856 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5858 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤";
5860 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5863 /* Check for death */
5864 if (dam > m_ptr->hp)
5866 /* Extract method of death */
5870 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5871 else if (do_poly && (randint1(90) > r_ptr->level))
5873 if (polymorph_monster(y, x))
5876 if (seen) obvious = TRUE;
5878 /* Monster polymorphs */
5880 note = "¤¬ÊѿȤ·¤¿¡ª";
5886 /* Turn off the damage */
5889 /* Hack -- Get new monster */
5890 m_ptr = &m_list[c_ptr->m_idx];
5892 /* Hack -- Get new race */
5893 r_ptr = &r_info[m_ptr->r_idx];
5899 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5901 note = " is unaffected!";
5907 /* Handle "teleport" */
5911 if (seen) obvious = TRUE;
5915 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5917 note = " disappears!";
5920 chg_virtue(V_VALOUR, -1);
5923 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who));
5925 /* Hack -- get new location */
5929 /* Hack -- get new grid */
5930 c_ptr = &cave[y][x];
5933 /* Sound and Impact breathers never stun */
5935 !(r_ptr->flags4 & (RF4_BR_SOUN)) &&
5936 !(r_ptr->flags4 & (RF4_BR_WALL)) &&
5937 !(r_ptr->flags3 & (RF3_NO_STUN)))
5940 if (seen) obvious = TRUE;
5946 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5948 note = " is more dazed.";
5951 tmp = m_ptr->stunned + (do_stun / 2);
5956 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5958 note = " is dazed.";
5965 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5971 /* Confusion and Chaos breathers (and sleepers) never confuse */
5973 !(r_ptr->flags3 & (RF3_NO_CONF)) &&
5974 !(r_ptr->flags4 & (RF4_BR_CONF)) &&
5975 !(r_ptr->flags4 & (RF4_BR_CHAO)))
5978 if (seen) obvious = TRUE;
5980 /* Already partially confused */
5981 if (m_ptr->confused)
5984 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5986 note = " looks more confused.";
5989 tmp = m_ptr->confused + (do_conf / 2);
5992 /* Was not confused */
5996 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
5998 note = " looks confused.";
6004 /* Apply confusion */
6005 m_ptr->confused = (tmp < 200) ? tmp : 200;
6013 if (seen) obvious = TRUE;
6015 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp-1;
6020 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
6022 note = " seems weakened.";
6024 m_ptr->maxhp -= do_time;
6025 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp-m_ptr->maxhp;
6035 tmp = m_ptr->monfear + do_fear;
6038 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6045 /* If another monster did the damage, hurt the monster by hand */
6048 /* Redraw (later) if needed */
6049 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6050 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6052 /* Wake the monster up */
6055 /* Hurt the monster */
6063 if (is_pet(m_ptr) && !(m_ptr->ml))
6066 /* Give detailed messages if destroyed */
6069 monster_desc(m_name, m_ptr, 0x100);
6072 msg_format("%^s%s", m_name, note);
6080 monster_gain_exp(who, m_ptr->r_idx);
6082 /* Generate treasure, etc */
6083 monster_death(c_ptr->m_idx, FALSE);
6085 /* Delete the monster */
6086 delete_monster_idx(c_ptr->m_idx);
6091 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6093 msg_print("You feel sad for a moment.");
6099 /* Damaged monster */
6102 /* Give detailed messages if visible or destroyed */
6103 if (note && seen) msg_format("%^s%s", m_name, note);
6105 /* Hack -- Pain message */
6108 message_pain(c_ptr->m_idx, dam);
6115 /* Hack -- handle sleep */
6116 if (do_sleep) m_ptr->csleep = do_sleep;
6120 else if (heal_leper)
6123 msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6125 msg_print("The Mangy looking leper is healed!");
6128 delete_monster_idx(c_ptr->m_idx);
6130 /* If the player did it, give him experience, check fear */
6131 else if (typ != GF_DRAIN_MANA)
6135 /* Hurt the monster, check for fear and death */
6136 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6141 /* Damaged monster */
6144 /* HACK - anger the monster before showing the sleep message */
6145 if (do_sleep) anger_monster(m_ptr);
6147 /* Give detailed messages if visible or destroyed */
6150 msg_format("%s%s", m_name, note);
6152 msg_format("%^s%s", m_name, note);
6156 /* Hack -- Pain message */
6157 else if (known && (dam || !do_fear))
6159 message_pain(c_ptr->m_idx, dam);
6162 /* Anger monsters */
6163 if (((dam > 0) || get_angry) && !do_sleep)
6164 anger_monster(m_ptr);
6167 if ((fear || do_fear) && (m_ptr->ml))
6174 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6176 msg_format("%^s flees in terror!", m_name);
6181 /* Hack -- handle sleep */
6182 if (do_sleep) m_ptr->csleep = do_sleep;
6186 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6188 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6192 switch (randint1(28))
6198 msg_print("ÃÏÌ̤¬Íɤ줿...");
6200 msg_print("The ground trembles...");
6203 earthquake(ty, tx, 4 + randint0(4));
6204 if (!one_in_(6)) break;
6206 case 3: case 4: case 5: case 6:
6209 int dam = damroll(10, 10);
6211 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6213 msg_print("A portal opens to a plane of raw mana!");
6216 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6217 if (!one_in_(6)) break;
6223 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6225 msg_print("Space warps about you!");
6228 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE);
6229 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6230 if (!one_in_(6)) break;
6232 case 9: case 10: case 11:
6234 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6236 msg_print("You feel a surge of energy!");
6239 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6240 if (!one_in_(6)) break;
6241 case 12: case 13: case 14: case 15: case 16:
6242 aggravate_monsters(0);
6243 if (!one_in_(6)) break;
6245 count += activate_hi_summon(ty, tx, TRUE);
6246 if (!one_in_(6)) break;
6247 case 19: case 20: case 21: case 22:
6249 bool pet = !one_in_(3);
6250 u32b mode = PM_ALLOW_GROUP;
6252 if (pet) mode |= PM_FORCE_PET;
6253 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6255 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6256 if (!one_in_(6)) break;
6258 case 23: case 24: case 25:
6259 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6261 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6263 msg_print("You feel your life draining away...");
6266 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6267 else lose_exp(p_ptr->exp / 16);
6268 if (!one_in_(6)) break;
6269 case 26: case 27: case 28:
6278 (void)do_dec_stat(i);
6287 (void)do_dec_stat(randint0(6));
6296 if (p_ptr->inside_battle)
6298 p_ptr->health_who = c_ptr->m_idx;
6299 p_ptr->redraw |= (PR_HEALTH);
6303 /* XXX XXX XXX Verify this code */
6305 /* Update the monster */
6306 update_mon(c_ptr->m_idx, FALSE);
6308 /* Redraw the monster grid */
6312 /* Update monster recall window */
6313 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6316 p_ptr->window |= (PW_MONSTER);
6319 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6323 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6325 set_target(m_ptr, monster_target_y, monster_target_x);
6328 else if (is_pet(&m_list[who]) && (m_ptr->target_y != py) && (m_ptr->target_x != px))
6330 set_target(m_ptr, m_list[who].fy, m_list[who].fx);
6334 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6336 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6337 rakubadam_m = (dam > 200) ? 200 : dam;
6346 /* Get local object */
6349 /* Prepare to make a Blade of Chaos */
6350 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6352 q_ptr->pval = photo;
6354 /* Mark the item as fully known */
6355 q_ptr->ident |= (IDENT_MENTAL);
6357 /* Drop it in the dungeon */
6358 (void)drop_near(q_ptr, -1, py, px);
6366 /* Return "Anything seen?" */
6372 * Helper function for "project()" below.
6374 * Handle a beam/bolt/ball causing damage to the player.
6376 * This routine takes a "source monster" (by index), a "distance", a default
6377 * "damage", and a "damage type". See "project_m()" above.
6379 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6380 * is reduced (see "project_m()" above). This can happen if a monster breathes
6381 * at the player and hits a wall instead.
6383 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6384 * to know if this is actually a ball or a bolt spell
6387 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6388 * we just assume that the effects were obvious, for historical reasons.
6390 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6395 /* Hack -- assume obvious */
6396 bool obvious = TRUE;
6398 /* Player blind-ness */
6399 bool blind = (p_ptr->blind ? TRUE : FALSE);
6401 /* Player needs a "description" (he is blind) */
6404 /* Source monster */
6405 monster_type *m_ptr = NULL;
6407 /* Monster name (for attacks) */
6410 /* Monster name (for damage) */
6413 /* Hack -- messages */
6419 /* Player is not here */
6420 if ((x != px) || (y != py)) return (FALSE);
6422 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6428 /* Player cannot hurt himself */
6429 if (!who) return (FALSE);
6430 if (who == p_ptr->riding) return (FALSE);
6432 if ((p_ptr->reflect || p_ptr->tim_reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6435 int max_attempts = 10;
6438 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6439 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6440 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6442 if (blind) msg_print("Something bounces!");
6443 else msg_print("The attack bounces!");
6447 /* Choose 'new' target */
6450 t_y = m_list[who].fy - 1 + randint1(3);
6451 t_x = m_list[who].fx - 1 + randint1(3);
6454 while (max_attempts && in_bounds2u(t_y, t_x) &&
6455 !(player_has_los_bold(t_y, t_x)));
6457 if (max_attempts < 1)
6459 t_y = m_list[who].fy;
6460 t_x = m_list[who].fx;
6463 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6470 /* Limit maximum damage */
6471 if (dam > 1600) dam = 1600;
6473 /* Reduce damage by distance */
6474 dam = (dam + r) / (r + 1);
6477 /* If the player is blind, be more descriptive */
6478 if (blind) fuzzy = TRUE;
6483 /* Get the source monster */
6484 m_ptr = &m_list[who];
6485 /* Extract the monster level */
6486 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6488 /* Get the monster name */
6489 monster_desc(m_name, m_ptr, 0);
6491 /* Get the monster's real name (gotten before polymorph!) */
6492 strcpy(killer, who_name);
6497 strcpy(killer, "æ«");
6499 strcpy(killer, "a trap");
6503 /* Analyze the damage */
6506 /* Standard damage -- hurts inventory too */
6510 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6512 if (fuzzy) msg_print("You are hit by acid!");
6515 get_damage = acid_dam(dam, killer, monspell);
6519 /* Standard damage -- hurts inventory too */
6523 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6525 if (fuzzy) msg_print("You are hit by fire!");
6528 get_damage = fire_dam(dam, killer, monspell);
6532 /* Standard damage -- hurts inventory too */
6536 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6538 if (fuzzy) msg_print("You are hit by cold!");
6541 get_damage = cold_dam(dam, killer, monspell);
6545 /* Standard damage -- hurts inventory too */
6549 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6551 if (fuzzy) msg_print("You are hit by lightning!");
6554 get_damage = elec_dam(dam, killer, monspell);
6558 /* Standard damage -- also poisons player */
6561 bool double_resist = (p_ptr->oppose_pois || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU));
6563 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6565 if (fuzzy) msg_print("You are hit by poison!");
6568 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6569 if (double_resist) dam = (dam + 2) / 3;
6571 if ((!(double_resist || p_ptr->resist_pois)) &&
6572 one_in_(HURT_CHANCE))
6577 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6579 if (!(double_resist || p_ptr->resist_pois))
6581 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6586 /* Standard damage -- also poisons / mutates player */
6589 bool double_resist = (p_ptr->oppose_pois || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU));
6591 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6593 if (fuzzy) msg_print("You are hit by radiation!");
6596 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6597 if (double_resist) dam = (2 * dam + 2) / 5;
6598 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6599 if (!(double_resist || p_ptr->resist_pois))
6601 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6603 if (one_in_(5)) /* 6 */
6606 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6608 msg_print("You undergo a freakish metamorphosis!");
6611 if (one_in_(4)) /* 4 */
6619 inven_damage(set_acid_destroy, 2);
6625 /* Standard damage */
6629 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6631 if (fuzzy) msg_print("You are hit by something!");
6634 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6638 /* Holy Orb -- Player only takes partial damage */
6642 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6644 if (fuzzy) msg_print("You are hit by something!");
6647 if (p_ptr->align > 10)
6649 else if (p_ptr->align < -10)
6651 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6658 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6660 if (fuzzy) msg_print("You are hit by something!");
6663 if (p_ptr->align > 10)
6665 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6669 /* Arrow -- XXX no dodging */
6673 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6675 if (fuzzy) msg_print("You are hit by something sharp!");
6678 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6681 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6683 msg_print("You cut down the arrow!");
6687 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6691 /* Plasma -- XXX No resist */
6695 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6697 if (fuzzy) msg_print("You are hit by something *HOT*!");
6700 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6702 if (!p_ptr->resist_sound)
6704 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6705 (void)set_stun(p_ptr->stun + k);
6708 if (!(p_ptr->resist_fire ||
6709 p_ptr->oppose_fire ||
6710 music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU) ||
6711 p_ptr->immune_fire))
6713 inven_damage(set_acid_destroy, 3);
6719 /* Nether -- drain experience */
6723 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6725 if (fuzzy) msg_print("You are hit by nether forces!");
6729 if (p_ptr->resist_neth)
6731 if (!prace_is_(RACE_SPECTRE))
6732 dam *= 6; dam /= (randint1(4) + 7);
6734 else if (p_ptr->prace != RACE_ANDROID)
6736 if (p_ptr->hold_life && (randint0(100) < 75))
6739 msg_print("¤·¤«¤·¼«¸Ê¤ÎÀ¸Ì¿ÎϤò¼é¤ê¤¤Ã¤¿¡ª");
6741 msg_print("You keep hold of your life force!");
6745 else if (p_ptr->hold_life)
6748 msg_print("À¸Ì¿ÎϤ¬¾¯¤·ÂΤ«¤éÈ´¤±Íî¤Á¤¿µ¤¤¬¤¹¤ë¡ª");
6750 msg_print("You feel your life slipping away!");
6753 lose_exp(200 + (p_ptr->exp / 1000) * MON_DRAIN_LIFE);
6758 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6760 msg_print("You feel your life draining away!");
6763 lose_exp(200 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
6767 if (prace_is_(RACE_SPECTRE))
6770 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6772 msg_print("You feel invigorated!");
6776 learn_spell(monspell);
6780 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6786 /* Water -- stun/confuse */
6790 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6792 if (fuzzy) msg_print("You are hit by something wet!");
6795 if (!p_ptr->resist_sound)
6797 set_stun(p_ptr->stun + randint1(40));
6799 if (!p_ptr->resist_conf)
6801 set_confused(p_ptr->confused + randint1(5) + 5);
6806 inven_damage(set_cold_destroy, 3);
6809 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6813 /* Chaos -- many effects */
6817 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6819 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6822 if (p_ptr->resist_chaos)
6824 dam *= 6; dam /= (randint1(4) + 7);
6826 if (!p_ptr->resist_conf)
6828 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6830 if (!p_ptr->resist_chaos)
6832 (void)set_image(p_ptr->image + randint1(10));
6836 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6838 msg_print("Your body is twisted by chaos!");
6841 (void)gain_random_mutation(0);
6844 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6846 if (p_ptr->prace == RACE_ANDROID)
6849 else if (p_ptr->hold_life && (randint0(100) < 75))
6852 msg_print("¤·¤«¤·¼«¸Ê¤ÎÀ¸Ì¿ÎϤò¼é¤ê¤¤Ã¤¿¡ª");
6854 msg_print("You keep hold of your life force!");
6858 else if (p_ptr->hold_life)
6861 msg_print("À¸Ì¿ÎϤ¬¾¯¤·ÂΤ«¤éÈ´¤±Íî¤Á¤¿µ¤¤¬¤¹¤ë¡ª");
6863 msg_print("You feel your life slipping away!");
6866 lose_exp(500 + (p_ptr->exp / 1000) * MON_DRAIN_LIFE);
6871 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6873 msg_print("You feel your life draining away!");
6876 lose_exp(5000 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
6879 if (!p_ptr->resist_chaos || one_in_(9))
6881 inven_damage(set_elec_destroy, 2);
6882 inven_damage(set_fire_destroy, 2);
6884 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6888 /* Shards -- mostly cutting */
6892 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6894 if (fuzzy) msg_print("You are hit by something sharp!");
6897 if (p_ptr->resist_shard)
6899 dam *= 6; dam /= (randint1(4) + 7);
6903 (void)set_cut(p_ptr->cut + dam);
6906 if (!p_ptr->resist_shard || one_in_(13))
6908 inven_damage(set_cold_destroy, 2);
6911 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6915 /* Sound -- mostly stunning */
6919 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6921 if (fuzzy) msg_print("You are hit by a loud noise!");
6924 if (p_ptr->resist_sound)
6926 dam *= 5; dam /= (randint1(4) + 7);
6930 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6931 (void)set_stun(p_ptr->stun + k);
6934 if (!p_ptr->resist_sound || one_in_(13))
6936 inven_damage(set_cold_destroy, 2);
6939 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6943 /* Pure confusion */
6947 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6949 if (fuzzy) msg_print("You are hit by something puzzling!");
6952 if (p_ptr->resist_conf)
6954 dam *= 5; dam /= (randint1(4) + 7);
6956 if (!p_ptr->resist_conf)
6958 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6960 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6964 /* Disenchantment -- see above */
6968 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6970 if (fuzzy) msg_print("You are hit by something static!");
6973 if (p_ptr->resist_disen)
6975 dam *= 6; dam /= (randint1(4) + 7);
6979 (void)apply_disenchant(0);
6981 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6985 /* Nexus -- see above */
6989 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6991 if (fuzzy) msg_print("You are hit by something strange!");
6994 if (p_ptr->resist_nexus)
6996 dam *= 6; dam /= (randint1(4) + 7);
7002 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7006 /* Force -- mostly stun */
7010 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7012 if (fuzzy) msg_print("You are hit by kinetic force!");
7015 if (!p_ptr->resist_sound)
7017 (void)set_stun(p_ptr->stun + randint1(20));
7019 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7024 /* Rocket -- stun, cut */
7028 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
7030 if (fuzzy) msg_print("There is an explosion!");
7033 if (!p_ptr->resist_sound)
7035 (void)set_stun(p_ptr->stun + randint1(20));
7037 if (p_ptr->resist_shard)
7043 (void)set_cut(p_ptr-> cut + ( dam / 2));
7046 if ((!p_ptr->resist_shard) || one_in_(12))
7048 inven_damage(set_cold_destroy, 3);
7051 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7055 /* Inertia -- slowness */
7059 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7061 if (fuzzy) msg_print("You are hit by something slow!");
7064 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7065 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7069 /* Lite -- blinding */
7073 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7075 if (fuzzy) msg_print("You are hit by something!");
7078 if (p_ptr->resist_lite)
7080 dam *= 4; dam /= (randint1(4) + 7);
7082 else if (!blind && !p_ptr->resist_blind)
7084 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7086 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
7089 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
7091 msg_print("The light scorches your flesh!");
7096 else if (prace_is_(RACE_S_FAIRY))
7100 if (p_ptr->wraith_form) dam *= 2;
7101 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7103 if (p_ptr->wraith_form)
7105 p_ptr->wraith_form = 0;
7107 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7109 msg_print("The light forces you out of your incorporeal shadow form.");
7112 p_ptr->redraw |= PR_MAP;
7113 /* Update monsters */
7114 p_ptr->update |= (PU_MONSTERS);
7116 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7118 /* Redraw status bar */
7119 p_ptr->redraw |= (PR_STATUS);
7126 /* Dark -- blinding */
7130 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7132 if (fuzzy) msg_print("You are hit by something!");
7135 if (p_ptr->resist_dark)
7137 dam *= 4; dam /= (randint1(4) + 7);
7139 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7141 else if (!blind && !p_ptr->resist_blind)
7143 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7145 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7149 /* Time -- bolt fewer effects XXX */
7153 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7155 if (fuzzy) msg_print("You are hit by a blast from the past!");
7158 if (p_ptr->resist_time)
7161 dam /= (randint1(4) + 7);
7163 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7165 msg_print("You feel as if time is passing you by.");
7171 switch (randint1(10))
7173 case 1: case 2: case 3: case 4: case 5:
7175 if (p_ptr->prace == RACE_ANDROID) break;
7177 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7179 msg_print("You feel life has clocked back.");
7182 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7186 case 6: case 7: case 8: case 9:
7188 switch (randint1(6))
7191 case 1: k = A_STR; act = "¶¯¤¯"; break;
7192 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7193 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7194 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7195 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7196 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7198 case 1: k = A_STR; act = "strong"; break;
7199 case 2: k = A_INT; act = "bright"; break;
7200 case 3: k = A_WIS; act = "wise"; break;
7201 case 4: k = A_DEX; act = "agile"; break;
7202 case 5: k = A_CON; act = "hale"; break;
7203 case 6: k = A_CHR; act = "beautiful"; break;
7209 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7211 msg_format("You're not as %s as you used to be...", act);
7215 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7216 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7217 p_ptr->update |= (PU_BONUS);
7224 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7226 msg_print("You're not as powerful as you used to be...");
7230 for (k = 0; k < 6; k++)
7232 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7233 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7235 p_ptr->update |= (PU_BONUS);
7241 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7245 /* Gravity -- stun plus slowness plus teleport */
7249 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7250 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7252 if (fuzzy) msg_print("You are hit by something heavy!");
7253 msg_print("Gravity warps around you.");
7258 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7259 if (!(p_ptr->resist_sound || p_ptr->ffall))
7261 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7262 (void)set_stun(p_ptr->stun + k);
7266 dam = (dam * 2) / 3;
7269 if (!p_ptr->ffall || one_in_(13))
7271 inven_damage(set_cold_destroy, 2);
7274 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7278 /* Standard damage */
7279 case GF_DISINTEGRATE:
7282 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7284 if (fuzzy) msg_print("You are hit by pure energy!");
7287 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7294 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7296 if (fuzzy) msg_print("You are hit by something invigorating!");
7299 (void)hp_player(dam);
7307 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7309 if (fuzzy) msg_print("You are hit by something!");
7312 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7320 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7322 if (fuzzy) msg_print("You are hit by something slow!");
7325 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7331 if (p_ptr->free_act) break;
7333 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7335 if (fuzzy) msg_print("You fall asleep!");
7339 if (ironman_nightmare)
7342 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7344 msg_print("A horrible vision enters your mind.");
7348 /* Pick a nightmare */
7349 get_mon_num_prep(get_nightmare, NULL);
7351 /* Have some nightmares */
7352 have_nightmare(get_mon_num(MAX_DEPTH));
7354 /* Remove the monster restriction */
7355 get_mon_num_prep(NULL, NULL);
7358 set_paralyzed(p_ptr->paralyzed + dam);
7369 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7371 if (fuzzy) msg_print("You are hit by an aura of magic!");
7374 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7382 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7384 if (fuzzy) msg_print("You are hit by an energy!");
7387 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7395 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7397 if (fuzzy) msg_print("Something falls from the sky on you!");
7400 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7401 if (!p_ptr->resist_shard || one_in_(13))
7403 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7404 inven_damage(set_cold_destroy, 2);
7410 /* Ice -- cold plus stun plus cuts */
7414 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7416 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7419 cold_dam(dam, killer, monspell);
7420 if (!p_ptr->resist_shard)
7422 (void)set_cut(p_ptr->cut + damroll(5, 8));
7424 if (!p_ptr->resist_sound)
7426 (void)set_stun(p_ptr->stun + randint1(15));
7429 if ((!(p_ptr->resist_cold || p_ptr->oppose_cold || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))) || one_in_(12))
7431 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7441 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7443 if (fuzzy) msg_print("You are hit by something extremely cold!");
7447 if (p_ptr->mimic_form)
7449 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7450 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7455 switch (p_ptr->prace)
7457 /* Some races are immune */
7471 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7483 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7486 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7488 msg_print("You resist the effects!");
7490 learn_spell(MS_MIND_BLAST);
7495 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7497 msg_print("Your mind is blasted by psyonic energy.");
7500 if (!p_ptr->resist_conf)
7502 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7505 if (!p_ptr->resist_chaos && one_in_(3))
7507 (void)set_image(p_ptr->image + randint0(250) + 150);
7514 p_ptr->csp_frac = 0;
7516 p_ptr->redraw |= PR_MANA;
7518 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_MIND_BLAST);
7523 case GF_BRAIN_SMASH:
7525 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7528 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7530 msg_print("You resist the effects!");
7532 learn_spell(MS_BRAIN_SMASH);
7537 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7539 msg_print("Your mind is blasted by psionic energy.");
7546 p_ptr->csp_frac = 0;
7548 p_ptr->redraw |= PR_MANA;
7550 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_BRAIN_SMASH);
7551 if (!p_ptr->resist_blind)
7553 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7555 if (!p_ptr->resist_conf)
7557 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7559 if (!p_ptr->free_act)
7561 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7563 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7565 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7566 (void)do_dec_stat(A_INT);
7567 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7568 (void)do_dec_stat(A_WIS);
7570 if (!p_ptr->resist_chaos)
7572 (void)set_image(p_ptr->image + randint0(250) + 150);
7580 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7583 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7585 msg_print("You resist the effects!");
7587 learn_spell(MS_CAUSE_1);
7591 curse_equipment(15, 0);
7592 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_1);
7599 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7602 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7604 msg_print("You resist the effects!");
7606 learn_spell(MS_CAUSE_2);
7610 curse_equipment(25, MIN(rlev/2-15, 5));
7611 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_2);
7618 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7621 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7623 msg_print("You resist the effects!");
7625 learn_spell(MS_CAUSE_3);
7629 curse_equipment(33, MIN(rlev/2-15, 15));
7630 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_3);
7637 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7640 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7642 msg_print("You resist the effects!");
7644 learn_spell(MS_CAUSE_4);
7648 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_4);
7649 (void)set_cut(p_ptr->cut + damroll(10, 10));
7656 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7659 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7661 msg_format("You resist the effects!");
7663 learn_spell(MS_HAND_DOOM);
7669 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7671 msg_print("Your feel your life fade away!");
7674 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, MS_HAND_DOOM);
7675 curse_equipment(40, 20);
7677 if (p_ptr->chp < 1) p_ptr->chp = 1;
7692 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7695 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7697 char m_name_self[80];
7700 monster_desc(m_name_self, m_ptr, 0x23);
7702 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7704 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7705 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7708 if (p_ptr->riding && dam > 0)
7710 rakubadam_p = (dam > 200) ? 200 : dam;
7718 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7724 /* Return "Anything seen?" */
7730 * Find the distance from (x, y) to a line.
7732 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7734 /* Vector from (x, y) to (x1, y1) */
7743 int pd = distance(y1, x1, y, x);
7744 int nd = distance(y1, x1, y2, x2);
7746 if (pd > nd) return distance(y, x, y2, x2);
7748 /* Component of P on N */
7749 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7751 /* Absolute value */
7752 return((nd >= 0) ? nd : 0 - nd);
7759 * Modified version of los() for calculation of disintegration balls.
7760 * Disintegration effects are stopped by permanent walls.
7762 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7782 /* Slope, or 1/Slope, of LOS */
7786 /* Extract the offset */
7790 /* Extract the absolute offset */
7795 /* Handle adjacent (or identical) grids */
7796 if ((ax < 2) && (ay < 2)) return (TRUE);
7799 /* Paranoia -- require "safe" origin */
7800 /* if (!in_bounds(y1, x1)) return (FALSE); */
7803 /* Directly South/North */
7806 /* South -- check for walls */
7809 for (ty = y1 + 1; ty < y2; ty++)
7811 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7815 /* North -- check for walls */
7818 for (ty = y1 - 1; ty > y2; ty--)
7820 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7828 /* Directly East/West */
7831 /* East -- check for walls */
7834 for (tx = x1 + 1; tx < x2; tx++)
7836 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7840 /* West -- check for walls */
7843 for (tx = x1 - 1; tx > x2; tx--)
7845 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7854 /* Extract some signs */
7855 sx = (dx < 0) ? -1 : 1;
7856 sy = (dy < 0) ? -1 : 1;
7859 /* Vertical "knights" */
7864 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7868 /* Horizontal "knights" */
7873 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7878 /* Calculate scale factor div 2 */
7881 /* Calculate scale factor */
7885 /* Travel horizontally */
7888 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7894 /* Consider the special case where slope == 1. */
7905 /* Note (below) the case (qy == f2), where */
7906 /* the LOS exactly meets the corner of a tile. */
7909 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7920 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7933 /* Travel vertically */
7936 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7952 /* Note (below) the case (qx == f2), where */
7953 /* the LOS exactly meets the corner of a tile. */
7956 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7967 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7987 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)
8000 while (bdis <= distance(y1, x1, y2, x2) + rad)
8002 /* Travel from center outward */
8003 for (cdis = 0; cdis <= brad; cdis++)
8006 /* Scan the maximal blast area of radius "cdis" */
8007 for (y = by - cdis; y <= by + cdis; y++)
8009 for (x = bx - cdis; x <= bx + cdis; x++)
8011 /* Ignore "illegal" locations */
8012 if (!in_bounds(y, x)) continue;
8014 /* Enforce a circular "ripple" */
8015 if (distance(y1, x1, y, x) != bdis) continue;
8017 /* Enforce an arc */
8018 if (distance(by, bx, y, x) != cdis) continue;
8022 /* Disintegration balls explosions are stopped by perma-walls */
8023 if (!in_disintegration_range(by, bx, y, x)) continue;
8025 /* Disintegration destroys mirrors. */
8027 if (real_breath && cave_valid_bold(y, x) &&
8028 (cave[y][x].feat < FEAT_PATTERN_START ||
8029 cave[y][x].feat > FEAT_PATTERN_XTRA2) &&
8030 (cave[y][x].feat < FEAT_DEEP_WATER ||
8031 cave[y][x].feat > FEAT_GRASS))
8033 if (cave[y][x].feat == FEAT_TREES)
8034 cave_set_feat(y, x, FEAT_GRASS);
8037 cave[y][x].feat = floor_type[randint0(100)];
8040 /* Update some things -- similar to GF_KILL_WALL */
8041 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
8045 /* The blast is stopped by walls */
8046 if (!los(by, bx, y, x)) continue;
8049 /* Save this grid */
8057 /* Encode some more "radius" info */
8058 gm[bdis + 1] = *pgrids;
8061 if ((by == y2) && (bx == x2)) done = TRUE;
8070 /* Ripple outwards */
8071 /* mmove2(&by, &bx, y1, x1, y2, x2); */
8073 by = GRID_Y(path_g[bdis]);
8074 bx = GRID_X(path_g[bdis]);
8076 /* Find the next ripple */
8079 /* Increase the size */
8080 brad = (rad * bdis) / dist;
8083 /* Store the effect size */
8089 * Generic "beam"/"bolt"/"ball" projection routine.
8092 * who: Index of "source" monster (zero for "player")
8093 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8094 * y,x: Target location (or location to travel "towards")
8095 * dam: Base damage roll to apply to affected monsters (or player)
8096 * typ: Type of damage to apply to monsters (and objects)
8097 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8100 * TRUE if any "effects" of the projection were observed, else FALSE
8102 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8103 * towards a given location (optionally passing over the heads of interposing
8104 * monsters), and have it do a given amount of damage to the monsters (and
8105 * optionally objects) within the given radius of the final location.
8107 * A "bolt" travels from source to target and affects only the target grid.
8108 * A "beam" travels from source to target, affecting all grids passed through.
8109 * A "ball" travels from source to the target, exploding at the target, and
8110 * affecting everything within the given radius of the target location.
8112 * Traditionally, a "bolt" does not affect anything on the ground, and does
8113 * not pass over the heads of interposing monsters, much like a traditional
8114 * missile, and will "stop" abruptly at the "target" even if no monster is
8115 * positioned there, while a "ball", on the other hand, passes over the heads
8116 * of monsters between the source and target, and affects everything except
8117 * the source monster which lies within the final radius, while a "beam"
8118 * affects every monster between the source and target, except for the casting
8119 * monster (or player), and rarely affects things on the ground.
8121 * Two special flags allow us to use this function in special ways, the
8122 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8123 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8124 * actually projecting from the source monster (or player).
8126 * The player will only get "experience" for monsters killed by himself
8127 * Unique monsters can only be destroyed by attacks from the player
8129 * Only 256 grids can be affected per projection, limiting the effective
8130 * "radius" of standard ball attacks to nine units (diameter nineteen).
8132 * One can project in a given "direction" by combining PROJECT_THRU with small
8133 * offsets to the initial location (see "line_spell()"), or by calculating
8134 * "virtual targets" far away from the player.
8136 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8137 * continuing until it actually hits somethings (useful for "stone to mud").
8139 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8141 * Balls must explode BEFORE hitting walls, or they would affect monsters
8142 * on both sides of a wall. Some bug reports indicate that this is still
8143 * happening in 2.7.8 for Windows, though it appears to be impossible.
8145 * We "pre-calculate" the blast area only in part for efficiency.
8146 * More importantly, this lets us do "explosions" from the "inside" out.
8147 * This results in a more logical distribution of "blast" treasure.
8148 * It also produces a better (in my opinion) animation of the explosion.
8149 * It could be (but is not) used to have the treasure dropped by monsters
8150 * in the middle of the explosion fall "outwards", and then be damaged by
8151 * the blast as it spreads outwards towards the treasure drop location.
8153 * Walls and doors are included in the blast area, so that they can be
8154 * "burned" or "melted" in later versions.
8156 * This algorithm is intended to maximize simplicity, not necessarily
8157 * efficiency, since this function is not a bottleneck in the code.
8159 * We apply the blast effect from ground zero outwards, in several passes,
8160 * first affecting features, then objects, then monsters, then the player.
8161 * This allows walls to be removed before checking the object or monster
8162 * in the wall, and protects objects which are dropped by monsters killed
8163 * in the blast, and allows the player to see all affects before he is
8164 * killed or teleported away. The semantics of this method are open to
8165 * various interpretations, but they seem to work well in practice.
8167 * We process the blast area from ground-zero outwards to allow for better
8168 * distribution of treasure dropped by monsters, and because it provides a
8169 * pleasing visual effect at low cost.
8171 * Note that the damage done by "ball" explosions decreases with distance.
8172 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8174 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8175 * the target, and then the damage "flows" along this beam of destruction.
8176 * The damage at every grid is the same as at the "center" of a "ball"
8177 * explosion, since the "beam" grids are treated as if they ARE at the
8178 * center of a "ball" explosion.
8180 * Currently, specifying "beam" plus "ball" means that locations which are
8181 * covered by the initial "beam", and also covered by the final "ball", except
8182 * for the final grid (the epicenter of the ball), will be "hit twice", once
8183 * by the initial beam, and once by the exploding ball. For the grid right
8184 * next to the epicenter, this results in 150% damage being done. The center
8185 * does not have this problem, for the same reason the final grid in a "beam"
8186 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8187 * grids which are covered by the "ball" will NOT work, as then they will
8188 * receive LESS damage than they should. Do not combine "beam" with "ball".
8190 * The array "gy[],gx[]" with current size "grids" is used to hold the
8191 * collected locations of all grids in the "blast area" plus "beam path".
8193 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8194 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8195 * first blast grid (see above) with radius "N" from the blast center. Note
8196 * that only the first gm[1] grids in the blast area thus take full damage.
8197 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8198 * number of blast grids.
8200 * Note that once the projection is complete, (y2,x2) holds the final location
8201 * of bolts/beams, and the "epicenter" of balls.
8203 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8204 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8205 * implementation of the "distance" function. Also, a bolt can be properly
8206 * viewed as a "ball" with a "rad" of "zero".
8208 * Note that if no "target" is reached before the beam/bolt/ball travels the
8209 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8210 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8212 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8213 * to move from point A to point B, even if the player cannot see part of the
8214 * projection path. Note that in general, the player will *always* see part
8215 * of the path, since it either starts at the player or ends on the player.
8217 * Hack -- we assume that every "projection" is "self-illuminating".
8219 * Hack -- when only a single monster is affected, we automatically track
8220 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8222 * Note that all projections now "explode" at their final destination, even
8223 * if they were being projected at a more distant destination. This means
8224 * that "ball" spells will *always* explode.
8226 * Note that we must call "handle_stuff()" after affecting terrain features
8227 * in the blast radius, in case the "illumination" of the grid was changed,
8228 * and "update_view()" and "update_monsters()" need to be called.
8230 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8239 int y_saver, x_saver; /* For reflecting monsters */
8241 int msec = delay_factor * delay_factor * delay_factor;
8243 /* Assume the player sees nothing */
8244 bool notice = FALSE;
8246 /* Assume the player has seen nothing */
8247 bool visual = FALSE;
8249 /* Assume the player has seen no blast grids */
8252 /* Assume to be a normal ball spell */
8253 bool breath = FALSE;
8255 /* Is the player blind? */
8256 bool blind = (p_ptr->blind ? TRUE : FALSE);
8258 bool old_hide = FALSE;
8260 /* Number of grids in the "path" */
8263 /* Actual grids in the "path" */
8266 /* Number of grids in the "blast area" (including the "beam" path) */
8269 /* Coordinates of the affected grids */
8270 byte gx[1024], gy[1024];
8272 /* Encoded "radius" info (see above) */
8275 /* Actual radius encoded in gm[] */
8280 /* Attacker's name (prepared before polymorph)*/
8283 /* Initialize by null string */
8289 /* Default target of monsterspell is player */
8290 monster_target_y=py;
8291 monster_target_x=px;
8293 /* Initialize with nul string */
8296 /* Hack -- Jump to target */
8297 if (flg & (PROJECT_JUMP))
8302 /* Clear the flag */
8303 flg &= ~(PROJECT_JUMP);
8308 /* Start at player */
8315 /* Start at monster */
8318 x1 = m_list[who].fx;
8319 y1 = m_list[who].fy;
8320 monster_desc(who_name, &m_list[who], 0x288);
8333 /* Default "destination" */
8338 /* Hack -- verify stuff */
8339 if (flg & (PROJECT_THRU))
8341 if ((x1 == x2) && (y1 == y2))
8343 flg &= ~(PROJECT_THRU);
8347 /* Handle a breath attack */
8352 if (flg & PROJECT_HIDE) old_hide = TRUE;
8353 flg |= PROJECT_HIDE;
8357 /* Hack -- Assume there will be no blast (max radius 32) */
8358 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8366 /* Collect beam grids */
8367 if (flg & (PROJECT_BEAM))
8374 if (breath && typ == GF_DISINTEGRATE)
8376 flg |= (PROJECT_DISI);
8379 /* Calculate the projection path */
8381 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8383 /* Hack -- Handle stuff */
8386 /* Giga-Hack SEEKER & SUPER_RAY */
8388 if( typ == GF_SEEKER )
8398 for (i = 0; i < path_n; ++i)
8403 int ny = GRID_Y(path_g[i]);
8404 int nx = GRID_X(path_g[i]);
8415 /* Only do visuals if requested */
8416 if (!blind && !(flg & (PROJECT_HIDE)))
8418 /* Only do visuals if the player can "see" the bolt */
8419 if (panel_contains(y, x) && player_has_los_bold(y, x))
8426 /* Obtain the bolt pict */
8427 p = bolt_pict(oy, ox, y, x, typ);
8429 /* Extract attr/char */
8433 /* Visual effects */
8434 print_rel(c, a, y, x);
8435 move_cursor_relative(y, x);
8436 /*if (fresh_before)*/ Term_fresh();
8437 Term_xtra(TERM_XTRA_DELAY, msec);
8439 /*if (fresh_before)*/ Term_fresh();
8441 /* Display "beam" grids */
8442 if (flg & (PROJECT_BEAM))
8444 /* Obtain the explosion pict */
8445 p = bolt_pict(y, x, y, x, typ);
8447 /* Extract attr/char */
8451 /* Visual effects */
8452 print_rel(c, a, y, x);
8455 /* Hack -- Activate delay */
8459 /* Hack -- delay anyway for consistency */
8462 /* Delay for consistency */
8463 Term_xtra(TERM_XTRA_DELAY, msec);
8466 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8467 if( is_mirror_grid(&cave[y][x]))
8469 /* The target of monsterspell becomes tha mirror(broken) */
8470 monster_target_y=(s16b)y;
8471 monster_target_x=(s16b)x;
8474 next_mirror( &oy,&ox,y,x );
8476 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8477 for( j = last_i; j <=i ; j++ )
8479 y = GRID_Y(path_g[j]);
8480 x = GRID_X(path_g[j]);
8481 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8482 if(!who && (project_m_n==1) && !jump ){
8483 if(cave[project_m_y][project_m_x].m_idx >0 ){
8484 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8486 /* Hack -- auto-recall */
8487 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8489 /* Hack - auto-track */
8490 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8493 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8498 for( i = last_i ; i < path_n ; i++ )
8501 y = GRID_Y(path_g[i]);
8502 x = GRID_X(path_g[i]);
8503 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8505 if(!who && (project_m_n==1) && !jump ){
8506 if(cave[project_m_y][project_m_x].m_idx >0 ){
8507 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8509 /* Hack -- auto-recall */
8510 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8512 /* Hack - auto-track */
8513 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8516 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8520 else if(typ == GF_SUPER_RAY){
8522 int second_step = 0;
8529 for (i = 0; i < path_n; ++i)
8534 int ny = GRID_Y(path_g[i]);
8535 int nx = GRID_X(path_g[i]);
8546 /* Only do visuals if requested */
8547 if (!blind && !(flg & (PROJECT_HIDE)))
8549 /* Only do visuals if the player can "see" the bolt */
8550 if (panel_contains(y, x) && player_has_los_bold(y, x))
8557 /* Obtain the bolt pict */
8558 p = bolt_pict(oy, ox, y, x, typ);
8560 /* Extract attr/char */
8564 /* Visual effects */
8565 print_rel(c, a, y, x);
8566 move_cursor_relative(y, x);
8567 /*if (fresh_before)*/ Term_fresh();
8568 Term_xtra(TERM_XTRA_DELAY, msec);
8570 /*if (fresh_before)*/ Term_fresh();
8572 /* Display "beam" grids */
8573 if (flg & (PROJECT_BEAM))
8575 /* Obtain the explosion pict */
8576 p = bolt_pict(y, x, y, x, typ);
8578 /* Extract attr/char */
8582 /* Visual effects */
8583 print_rel(c, a, y, x);
8586 /* Hack -- Activate delay */
8590 /* Hack -- delay anyway for consistency */
8593 /* Delay for consistency */
8594 Term_xtra(TERM_XTRA_DELAY, msec);
8597 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8598 if( cave[y][x].feat == FEAT_RUBBLE ||
8599 cave[y][x].feat == FEAT_DOOR_HEAD ||
8600 cave[y][x].feat == FEAT_DOOR_TAIL ||
8601 (cave[y][x].feat >= FEAT_WALL_EXTRA &&
8602 cave[y][x].feat <= FEAT_PERM_SOLID ))
8604 if( second_step )continue;
8607 if( is_mirror_grid(&cave[y][x]) && !second_step )
8609 /* The target of monsterspell becomes tha mirror(broken) */
8610 monster_target_y=(s16b)y;
8611 monster_target_x=(s16b)x;
8614 for( j = 0; j <=i ; j++ )
8616 y = GRID_Y(path_g[j]);
8617 x = GRID_X(path_g[j]);
8618 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8622 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8623 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8624 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8625 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8626 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8627 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8628 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8629 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8632 for( i = 0; i < path_n ; i++ )
8635 y = GRID_Y(path_g[i]);
8636 x = GRID_X(path_g[i]);
8637 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8638 if(!who && (project_m_n==1) && !jump ){
8639 if(cave[project_m_y][project_m_x].m_idx >0 ){
8640 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8642 /* Hack -- auto-recall */
8643 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8645 /* Hack - auto-track */
8646 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8649 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8654 /* Project along the path */
8655 for (i = 0; i < path_n; ++i)
8660 int ny = GRID_Y(path_g[i]);
8661 int nx = GRID_X(path_g[i]);
8663 if (flg & PROJECT_DISI)
8665 /* Hack -- Balls explode before reaching walls */
8666 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8670 /* Hack -- Balls explode before reaching walls */
8671 if (!cave_floor_bold(ny, nx) && (rad > 0)) break;
8678 /* Collect beam grids */
8679 if (flg & (PROJECT_BEAM))
8686 /* Only do visuals if requested */
8687 if (!blind && !(flg & (PROJECT_HIDE)) && !(flg & PROJECT_FAST))
8689 /* Only do visuals if the player can "see" the bolt */
8690 if (panel_contains(y, x) && player_has_los_bold(y, x))
8697 /* Obtain the bolt pict */
8698 p = bolt_pict(oy, ox, y, x, typ);
8700 /* Extract attr/char */
8704 /* Visual effects */
8705 print_rel(c, a, y, x);
8706 move_cursor_relative(y, x);
8707 /*if (fresh_before)*/ Term_fresh();
8708 Term_xtra(TERM_XTRA_DELAY, msec);
8710 /*if (fresh_before)*/ Term_fresh();
8712 /* Display "beam" grids */
8713 if (flg & (PROJECT_BEAM))
8715 /* Obtain the explosion pict */
8716 p = bolt_pict(y, x, y, x, typ);
8718 /* Extract attr/char */
8722 /* Visual effects */
8723 print_rel(c, a, y, x);
8726 /* Hack -- Activate delay */
8730 /* Hack -- delay anyway for consistency */
8733 /* Delay for consistency */
8734 Term_xtra(TERM_XTRA_DELAY, msec);
8737 if ((typ == GF_ATTACK) && (dam == HISSATSU_NYUSIN) && ((i+1) == path_n))
8739 if (cave_empty_bold(y, x)) teleport_player_to(ny, nx, FALSE);
8744 /* Save the "blast epicenter" */
8748 if (breath && (y1 == y2) && (x1 == x2))
8754 flg &= ~(PROJECT_HIDE);
8758 /* Start the "explosion" */
8761 /* Hack -- make sure beams get to "explode" */
8769 /* If we found a "target", explode there */
8770 if (dist <= MAX_RANGE)
8772 /* Mega-Hack -- remove the final "beam" grid */
8773 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8776 * Create a conical breath attack
8787 flg &= ~(PROJECT_HIDE);
8789 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, y2, x2, (bool)(typ == GF_DISINTEGRATE), TRUE);
8793 /* Determine the blast area, work from the inside out */
8794 for (dist = 0; dist <= rad; dist++)
8796 /* Scan the maximal blast area of radius "dist" */
8797 for (y = y2 - dist; y <= y2 + dist; y++)
8799 for (x = x2 - dist; x <= x2 + dist; x++)
8801 /* Ignore "illegal" locations */
8802 if (!in_bounds2(y, x)) continue;
8804 /* Enforce a "circular" explosion */
8805 if (distance(y2, x2, y, x) != dist) continue;
8807 if (typ == GF_DISINTEGRATE)
8809 /* Disintegration balls explosions are stopped by perma-walls */
8810 if (!in_disintegration_range(y2, x2, y, x)) continue;
8812 if (cave_valid_bold(y, x) &&
8813 (cave[y][x].feat < FEAT_PATTERN_START ||
8814 cave[y][x].feat > FEAT_PATTERN_XTRA2) &&
8815 (cave[y][x].feat < FEAT_DEEP_WATER ||
8816 cave[y][x].feat > FEAT_GRASS))
8818 if (cave[y][x].feat == FEAT_TREES)
8819 cave_set_feat(y, x, FEAT_GRASS);
8822 cave[y][x].feat = floor_type[randint0(100)];
8826 /* Update some things -- similar to GF_KILL_WALL */
8827 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
8831 /* Ball explosions are stopped by walls */
8832 if (!los(y2, x2, y, x)) continue;
8835 /* Save this grid */
8842 /* Encode some more "radius" info */
8848 /* Speed -- ignore "non-explosions" */
8849 if (!grids) return (FALSE);
8852 /* Display the "blast area" if requested */
8853 if (!blind && !(flg & (PROJECT_HIDE)))
8855 /* Then do the "blast", from inside out */
8856 for (t = 0; t <= gm_rad; t++)
8858 /* Dump everything with this radius */
8859 for (i = gm[t]; i < gm[t+1]; i++)
8861 /* Extract the location */
8865 /* Only do visuals if the player can "see" the blast */
8866 if (panel_contains(y, x) && player_has_los_bold(y, x))
8875 /* Obtain the explosion pict */
8876 p = bolt_pict(y, x, y, x, typ);
8878 /* Extract attr/char */
8882 /* Visual effects -- Display */
8883 print_rel(c, a, y, x);
8887 /* Hack -- center the cursor */
8888 move_cursor_relative(y2, x2);
8890 /* Flush each "radius" seperately */
8891 /*if (fresh_before)*/ Term_fresh();
8893 /* Delay (efficiently) */
8894 if (visual || drawn)
8896 Term_xtra(TERM_XTRA_DELAY, msec);
8900 /* Flush the erasing */
8903 /* Erase the explosion drawn above */
8904 for (i = 0; i < grids; i++)
8906 /* Extract the location */
8910 /* Hack -- Erase if needed */
8911 if (panel_contains(y, x) && player_has_los_bold(y, x))
8917 /* Hack -- center the cursor */
8918 move_cursor_relative(y2, x2);
8920 /* Flush the explosion */
8921 /*if (fresh_before)*/ Term_fresh();
8926 /* Update stuff if needed */
8927 if (p_ptr->update) update_stuff();
8930 /* Check features */
8931 if (flg & (PROJECT_GRID))
8933 /* Start with "dist" of zero */
8936 /* Scan for features */
8937 for (i = 0; i < grids; i++)
8939 /* Hack -- Notice new "dist" values */
8940 if (gm[dist+1] == i) dist++;
8942 /* Get the grid location */
8946 /* Find the closest point in the blast */
8949 int d = dist_to_line(y, x, y1, x1, y2, x2);
8951 /* Affect the grid */
8952 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8956 /* Affect the grid */
8957 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8964 if (flg & (PROJECT_ITEM))
8966 /* Start with "dist" of zero */
8969 /* Scan for objects */
8970 for (i = 0; i < grids; i++)
8972 /* Hack -- Notice new "dist" values */
8973 if (gm[dist+1] == i) dist++;
8975 /* Get the grid location */
8979 /* Find the closest point in the blast */
8982 int d = dist_to_line(y, x, y1, x1, y2, x2);
8984 /* Affect the object in the grid */
8985 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8989 /* Affect the object in the grid */
8990 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8996 /* Check monsters */
8997 if (flg & (PROJECT_KILL))
9004 /* Start with "dist" of zero */
9007 /* Scan for monsters */
9008 for (i = 0; i < grids; i++)
9010 /* Hack -- Notice new "dist" values */
9011 if (gm[dist + 1] == i) dist++;
9013 /* Get the grid location */
9019 /* Find the closest point in the blast */
9022 int d = dist_to_line(y, x, y1, x1, y2, x2);
9024 /* Affect the monster in the grid */
9025 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
9027 if (project_m(who, d+1, y, x, dam, typ,flg)) notice = TRUE;
9029 else if (project_m(who, d, y, x, dam, typ,flg)) notice = TRUE;
9033 /* Affect the monster in the grid */
9034 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
9036 if (!(flg & PROJECT_BEAM))
9038 if (project_m(who, dist+1, y, x, dam, typ,flg)) notice = TRUE;
9041 else if (project_m(who, dist, y, x, dam, typ,flg)) notice = TRUE;
9046 monster_race *ref_ptr = &r_info[m_list[cave[y][x].m_idx].r_idx];
9048 if ((ref_ptr->flags2 & RF2_REFLECTING) && (!one_in_(10) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1)))
9051 int max_attempts = 10;
9053 /* Choose 'new' target */
9056 t_y = y_saver - 1 + randint1(3);
9057 t_x = x_saver - 1 + randint1(3);
9061 while (max_attempts && in_bounds2u(t_y, t_x) &&
9062 !(los(y, x, t_y, t_x)));
9064 if (max_attempts < 1)
9070 if (m_list[cave[y][x].m_idx].ml)
9073 if ((m_list[cave[y][x].m_idx].r_idx == MON_KENSHIROU)
9074 || (m_list[cave[y][x].m_idx].r_idx == MON_RAOU))
9075 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9076 if (m_list[cave[y][x].m_idx].r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9077 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9079 msg_print("The attack bounces!");
9082 ref_ptr->r_flags2 |= RF2_REFLECTING;
9084 flg &= ~(PROJECT_MONSTER | PROJECT_PLAYER);
9085 if (one_in_(2)) flg |= PROJECT_MONSTER;
9086 else flg |= PROJECT_PLAYER;
9088 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9092 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
9095 else if (project_m(who, dist, y, x, dam, typ,flg)) notice = TRUE;
9100 /* Player affected one monster (without "jumping") */
9101 if (!who && (project_m_n == 1) && !jump)
9107 /* Track if possible */
9108 if (cave[y][x].m_idx > 0)
9110 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9112 /* Hack -- auto-recall */
9113 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9115 /* Hack - auto-track */
9116 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9123 if (flg & (PROJECT_KILL))
9125 /* Start with "dist" of zero */
9128 /* Scan for player */
9129 for (i = 0; i < grids; i++)
9131 /* Hack -- Notice new "dist" values */
9132 if (gm[dist+1] == i) dist++;
9134 /* Get the grid location */
9138 /* Find the closest point in the blast */
9141 int d = dist_to_line(y, x, y1, x1, y2, x2);
9143 /* Affect the player */
9144 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_MONSTER))
9146 if (project_p(who, who_name, d+1, y, x, dam, typ, flg, monspell)) notice = TRUE;
9148 else if (project_p(who, who_name, d, y, x, dam, typ, flg, monspell)) notice = TRUE;
9152 /* Affect the player */
9153 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_MONSTER))
9155 if (!((flg & PROJECT_BEAM) || (flg & PROJECT_STOP)))
9157 if (project_p(who, who_name, dist+1, y, x, dam, typ, flg, monspell)) notice = TRUE;
9160 else if (project_p(who, who_name, dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9169 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9171 if (rakubadam_m > 0)
9173 if (rakuba(rakubadam_m, FALSE))
9176 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9178 msg_format("%^s has thrown you off!", m_name);
9182 if (p_ptr->riding && rakubadam_p > 0)
9184 if(rakuba(rakubadam_p, FALSE))
9187 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9189 msg_format("You have fallen from %s.", m_name);
9195 /* Return "something was noticed" */
9199 bool binding_field( int dam )
9201 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9202 int mirror_num=0; /* ¶À¤Î¿ô */
9207 int msec= delay_factor*delay_factor*delay_factor;
9213 /* Default target of monsterspell is player */
9214 monster_target_y=py;
9215 monster_target_x=px;
9217 for( x=0 ; x < cur_wid ; x++ )
9219 for( y=0 ; y < cur_hgt ; y++ )
9221 if( is_mirror_grid(&cave[y][x]) &&
9222 distance(py,px,y,x) <= MAX_RANGE &&
9223 distance(py,px,y,x) != 0 &&
9224 player_has_los_bold(y,x)
9226 mirror_y[mirror_num]=y;
9227 mirror_x[mirror_num]=x;
9233 if( mirror_num < 2 )return FALSE;
9235 point_x[0] = randint0( mirror_num );
9237 point_x[1] = randint0( mirror_num );
9239 while( point_x[0] == point_x[1] );
9241 point_y[0]=mirror_y[point_x[0]];
9242 point_x[0]=mirror_x[point_x[0]];
9243 point_y[1]=mirror_y[point_x[1]];
9244 point_x[1]=mirror_x[point_x[1]];
9248 x=point_x[0]+point_x[1]+point_x[2];
9249 y=point_y[0]+point_y[1]+point_y[2];
9251 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9252 - (point_y[0]*3-y)*(point_x[1]*3-x);
9253 if( centersign == 0 )return FALSE;
9255 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9256 x1 = x1 < point_x[2] ? x1 : point_x[2];
9257 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9258 y1 = y1 < point_y[2] ? y1 : point_y[2];
9260 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9261 x2 = x2 > point_x[2] ? x2 : point_x[2];
9262 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9263 y2 = y2 > point_y[2] ? y2 : point_y[2];
9265 for( y=y1 ; y <=y2 ; y++ ){
9266 for( x=x1 ; x <=x2 ; x++ ){
9267 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9268 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9269 centersign*( (point_x[1]-x)*(point_y[2]-y)
9270 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9271 centersign*( (point_x[2]-x)*(point_y[0]-y)
9272 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9274 if( player_has_los_bold(y,x)){
9275 /* Visual effects */
9277 && panel_contains(y,x)){
9278 p = bolt_pict(y,x,y,x, GF_MANA );
9279 print_rel(PICT_C(p), PICT_A(p),y,x);
9280 move_cursor_relative(y, x);
9281 /*if (fresh_before)*/ Term_fresh();
9282 Term_xtra(TERM_XTRA_DELAY, msec);
9288 for( y=y1 ; y <=y2 ; y++ ){
9289 for( x=x1 ; x <=x2 ; x++ ){
9290 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9291 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9292 centersign*( (point_x[1]-x)*(point_y[2]-y)
9293 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9294 centersign*( (point_x[2]-x)*(point_y[0]-y)
9295 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9297 if( player_has_los_bold(y,x)){
9298 (void)project_f(0,0,y,x,dam,GF_MANA);
9303 for( y=y1 ; y <=y2 ; y++ ){
9304 for( x=x1 ; x <=x2 ; x++ ){
9305 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9306 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9307 centersign*( (point_x[1]-x)*(point_y[2]-y)
9308 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9309 centersign*( (point_x[2]-x)*(point_y[0]-y)
9310 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9312 if( player_has_los_bold(y,x)){
9313 (void)project_o(0,0,y,x,dam,GF_MANA);
9318 for( y=y1 ; y <=y2 ; y++ ){
9319 for( x=x1 ; x <=x2 ; x++ ){
9320 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9321 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9322 centersign*( (point_x[1]-x)*(point_y[2]-y)
9323 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9324 centersign*( (point_x[2]-x)*(point_y[0]-y)
9325 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9327 if( player_has_los_bold(y,x) ){
9328 (void)project_m(0,0,y,x,dam,GF_MANA,
9329 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9336 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9338 msg_print("The field broke a mirror");
9340 remove_mirror(point_y[0],point_x[0]);
9346 void seal_of_mirror( int dam )
9350 for( x = 0 ; x < cur_wid ; x++ )
9352 for( y = 0 ; y < cur_hgt ; y++ )
9354 if( is_mirror_grid(&cave[y][x]))
9356 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9357 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9359 if( !cave[y][x].m_idx )