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( (cave[y][x].info & CAVE_IN_MIRROR)){
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 (c_ptr->feat == FEAT_SECRET)
724 place_closed_door(y, x);
726 /* Check line of sight */
734 if ((c_ptr->info & CAVE_TRAP) || is_trap(c_ptr->feat) ||
735 c_ptr->feat == FEAT_INVIS)
737 /* Check line of sight */
741 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
743 msg_print("There is a bright flash of light!");
749 /* Forget the trap */
750 c_ptr->info &= ~(CAVE_MARK);
752 /* Destroy the trap */
753 if (c_ptr->info & CAVE_TRAP) c_ptr->info &= ~(CAVE_TRAP);
756 c_ptr->feat = floor_type[randint0(100)];
760 /* Locked doors are unlocked */
761 else if ((c_ptr->feat >= FEAT_DOOR_HEAD + 0x01) &&
762 (c_ptr->feat <= FEAT_DOOR_HEAD + 0x07))
764 /* Unlock the door */
765 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
767 /* Check line of sound */
771 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
786 /* Destroy Doors (and traps) */
789 /* Destroy all doors and traps */
790 if ((c_ptr->feat == FEAT_OPEN) ||
791 (c_ptr->feat == FEAT_BROKEN) ||
792 (c_ptr->info & CAVE_TRAP) ||
793 is_trap(c_ptr->feat) ||
794 (c_ptr->feat == FEAT_INVIS) ||
795 ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
796 (c_ptr->feat <= FEAT_DOOR_TAIL)))
798 /* Check line of sight */
803 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
805 msg_print("There is a bright flash of light!");
810 /* Visibility change */
811 if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
812 (c_ptr->feat <= FEAT_DOOR_TAIL))
814 /* Update some things */
815 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
819 /* Forget the door */
820 c_ptr->info &= ~(CAVE_MARK);
822 /* Destroy the feature */
823 if (c_ptr->info & CAVE_TRAP) c_ptr->info &= ~(CAVE_TRAP);
826 c_ptr->feat = floor_type[randint0(100)];
836 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
838 if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
839 (c_ptr->feat <= FEAT_DOOR_TAIL))
841 /* Convert "locked" to "stuck" XXX XXX XXX */
842 if (c_ptr->feat < FEAT_DOOR_HEAD + 0x08) c_ptr->feat += 0x08;
844 /* Add one spike to the door */
845 if (c_ptr->feat < FEAT_DOOR_TAIL) c_ptr->feat++;
847 /* Check line of sight */
852 msg_print("²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ¥É¥¢¤¬³«¤«¤Ê¤¤¡£");
854 msg_print("The door seems stuck.");
863 /* Destroy walls (and doors) */
866 /* Non-walls (etc) */
867 if (cave_floor_bold(y, x)) break;
869 /* Permanent walls */
870 if (c_ptr->feat >= FEAT_PERM_EXTRA) break;
873 if (c_ptr->feat >= FEAT_WALL_EXTRA)
876 if (known && (c_ptr->info & (CAVE_MARK)))
879 msg_print("Êɤ¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
881 msg_print("The wall turns into mud!");
887 /* Forget the wall */
888 c_ptr->info &= ~(CAVE_MARK);
890 /* Destroy the wall */
891 c_ptr->feat = floor_type[randint0(100)];
894 /* Quartz / Magma with treasure */
895 else if (c_ptr->feat >= FEAT_MAGMA_H)
898 if (known && (c_ptr->info & (CAVE_MARK)))
901 msg_print("¹ÛÌ®¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
902 msg_print("²¿¤«¤òȯ¸«¤·¤¿¡ª");
904 msg_print("The vein turns into mud!");
905 msg_print("You have found something!");
911 /* Forget the wall */
912 c_ptr->info &= ~(CAVE_MARK);
914 /* Destroy the wall */
915 c_ptr->feat = floor_type[randint0(100)];
917 /* Place some gold */
922 else if (c_ptr->feat >= FEAT_MAGMA)
925 if (known && (c_ptr->info & (CAVE_MARK)))
928 msg_print("¹ÛÌ®¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
930 msg_print("The vein turns into mud!");
936 /* Forget the wall */
937 c_ptr->info &= ~(CAVE_MARK);
939 /* Destroy the wall */
940 c_ptr->feat = floor_type[randint0(100)];
944 else if (c_ptr->feat == FEAT_RUBBLE)
947 if (known && (c_ptr->info & (CAVE_MARK)))
950 msg_print("´äÀФ¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
952 msg_print("The rubble turns into mud!");
958 /* Forget the wall */
959 c_ptr->info &= ~(CAVE_MARK);
961 /* Destroy the rubble */
962 c_ptr->feat = floor_type[randint0(100)];
964 /* Hack -- place an object */
965 if (randint0(100) < 10)
967 /* Found something */
968 if (player_can_see_bold(y, x))
971 msg_print("´äÀФβ¼¤Ë²¿¤«±£¤µ¤ì¤Æ¤¤¤¿¡ª");
973 msg_print("There was something buried in the rubble!");
980 place_object(y, x, FALSE, FALSE);
984 /* Destroy doors (and secret doors) */
985 else /* if (c_ptr->feat >= FEAT_DOOR_HEAD) */
987 /* Hack -- special message */
988 if (known && (c_ptr->info & (CAVE_MARK)))
991 msg_print("¥É¥¢¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
993 msg_print("The door turns into mud!");
999 /* Forget the wall */
1000 c_ptr->info &= ~(CAVE_MARK);
1002 /* Destroy the feature */
1003 c_ptr->feat = floor_type[randint0(100)];
1009 /* Update some things */
1010 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
1018 /* Require a "naked" floor grid */
1019 if (!cave_naked_bold(y, x)) break;
1021 /* Not on the player */
1022 if ((y == py) && (x == px)) break;
1024 /* Create a closed door */
1025 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
1028 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
1030 /* Update some things */
1031 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1039 /* Require a "naked" floor grid */
1040 if (((cave[y][x].feat != FEAT_FLOOR) &&
1041 (cave[y][x].feat != FEAT_GRASS) &&
1042 (cave[y][x].feat != FEAT_DIRT) &&
1043 (cave[y][x].o_idx == 0) &&
1044 (cave[y][x].m_idx == 0))
1045 || (cave[y][x].info & CAVE_IN_MIRROR) )
1056 /* Require a "naked" floor grid */
1057 if (!cave_naked_bold(y, x)) break;
1059 /* Not on the player */
1060 if ((y == py) && (x == px)) break;
1062 /* Create a closed door */
1063 cave_set_feat(y, x, FEAT_TREES);
1066 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
1068 /* Update some things */
1069 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1076 /* Require a "naked" floor grid */
1077 if (!cave_naked_bold(y, x)) break;
1079 cave_set_feat(y, x, FEAT_GLYPH);
1086 /* Require a "naked" floor grid */
1087 if (!cave_naked_bold(y, x)) break;
1089 /* Not on the player */
1090 if ((y == py) && (x == px)) break;
1093 cave_set_feat(y, x, FEAT_WALL_EXTRA);
1095 /* Update some things */
1096 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1107 /* Require a "naked" floor grid */
1108 if (!cave_naked_bold(y, x)) break;
1110 /* Place a shallow lava */
1111 cave_set_feat(y, x, FEAT_SHAL_LAVA);
1116 /* Require a "naked" floor grid */
1117 if (cave_perma_bold(y, x) || !dam) break;
1119 /* Place a deep lava */
1120 cave_set_feat(y, x, FEAT_DEEP_LAVA);
1122 /* Dam is used as a counter for the number of grid to convert */
1133 /* Require a "naked" floor grid */
1134 if (!cave_naked_bold(y, x)) break;
1136 /* Place a shallow lava */
1137 cave_set_feat(y, x, FEAT_SHAL_WATER);
1142 /* Require a "naked" floor grid */
1143 if (cave_perma_bold(y, x) || !dam) break;
1145 /* Place a deep lava */
1146 cave_set_feat(y, x, FEAT_DEEP_WATER);
1148 /* Dam is used as a counter for the number of grid to convert */
1154 /* Lite up the grid */
1158 /* Turn on the light */
1159 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) c_ptr->info |= (CAVE_GLOW);
1168 if (player_can_see_bold(y, x)) obvious = TRUE;
1170 /* Mega-Hack -- Update the monster in the affected grid */
1171 /* This allows "spear of light" (etc) to work "correctly" */
1172 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1177 /* Darken the grid */
1181 if (!p_ptr->inside_battle)
1184 if (player_can_see_bold(y, x)) obvious = TRUE;
1186 /* Turn off the light. */
1187 if(!(c_ptr->info & CAVE_IN_MIRROR))c_ptr->info &= ~(CAVE_GLOW);
1189 /* Hack -- Forget "boring" grids */
1190 if ((c_ptr->feat <= FEAT_INVIS) || (c_ptr->feat == FEAT_DIRT) || (c_ptr->feat == FEAT_GRASS))
1193 c_ptr->info &= ~(CAVE_MARK);
1202 /* Mega-Hack -- Update the monster in the affected grid */
1203 /* This allows "spear of light" (etc) to work "correctly" */
1204 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1213 if( (cave[y][x].info & CAVE_IN_MIRROR))
1216 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1218 msg_print("The mirror was chashed!");
1221 project(0,2,y,x, p_ptr->lev /2 +5 ,GF_SHARDS,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_HANGEKI),-1);
1227 if( (cave[y][x].info & CAVE_IN_MIRROR) && p_ptr->lev < 40 )
1230 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1232 msg_print("The mirror was chashed!");
1234 cave_set_feat(y,x, FEAT_FLOOR);
1241 /* Return "Anything seen?" */
1248 * We are called from "project()" to "damage" objects
1250 * We are called both for "beam" effects and "ball" effects.
1252 * Perhaps we should only SOMETIMES damage things on the ground.
1254 * The "r" parameter is the "distance from ground zero".
1256 * Note that we determine if the player can "see" anything that happens
1257 * by taking into account: blindness, line-of-sight, and illumination.
1259 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1261 * We return "TRUE" if the effect of the projection is "obvious".
1263 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1265 cave_type *c_ptr = &cave[y][x];
1267 s16b this_o_idx, next_o_idx = 0;
1269 bool obvious = FALSE;
1270 bool known = player_has_los_bold(y, x);
1272 u32b flgs[TR_FLAG_SIZE];
1274 char o_name[MAX_NLEN];
1277 bool is_potion = FALSE;
1281 who = who ? who : 0;
1283 /* Reduce damage by distance */
1284 dam = (dam + r) / (r + 1);
1287 /* Scan all objects in the grid */
1288 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1292 bool is_art = FALSE;
1293 bool ignore = FALSE;
1294 bool plural = FALSE;
1295 bool do_kill = FALSE;
1297 cptr note_kill = NULL;
1299 /* Acquire object */
1300 o_ptr = &o_list[this_o_idx];
1302 /* Acquire next object */
1303 next_o_idx = o_ptr->next_o_idx;
1305 /* Extract the flags */
1306 object_flags(o_ptr, flgs);
1308 /* Get the "plural"-ness */
1309 if (o_ptr->number > 1) plural = TRUE;
1311 /* Check for artifact */
1312 if ((artifact_p(o_ptr) || o_ptr->art_name)) is_art = TRUE;
1314 /* Analyze the type */
1317 /* Acid -- Lots of things */
1320 if (hates_acid(o_ptr))
1324 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1326 note_kill = (plural ? " melt!" : " melts!");
1329 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1334 /* Elec -- Rings and Wands */
1337 if (hates_elec(o_ptr))
1341 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1343 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1346 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1351 /* Fire -- Flammable objects */
1354 if (hates_fire(o_ptr))
1358 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1360 note_kill = (plural ? " burn up!" : " burns up!");
1363 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1368 /* Cold -- potions and flasks */
1371 if (hates_cold(o_ptr))
1374 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1376 note_kill = (plural ? " shatter!" : " shatters!");
1380 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1388 if (hates_fire(o_ptr))
1392 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1394 note_kill = (plural ? " burn up!" : " burns up!");
1397 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1399 if (hates_elec(o_ptr))
1404 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1406 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1409 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1417 if (hates_fire(o_ptr))
1421 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1423 note_kill = (plural ? " burn up!" : " burns up!");
1426 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1428 if (hates_cold(o_ptr))
1433 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1435 note_kill = (plural ? " shatter!" : " shatters!");
1438 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1443 /* Hack -- break potions and such */
1449 if (hates_cold(o_ptr))
1452 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1454 note_kill = (plural ? " shatter!" : " shatters!");
1462 /* Mana and Chaos -- destroy everything */
1469 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1471 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1477 case GF_DISINTEGRATE:
1481 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1483 note_kill = (plural ? " evaporate!" : " evaporates!");
1493 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1495 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1498 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1499 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1503 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1507 if (cursed_p(o_ptr))
1511 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1513 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1522 identify_item(o_ptr);
1530 /* Chests are noticed only if trapped or locked */
1531 if (o_ptr->tval == TV_CHEST)
1533 /* Disarm/Unlock traps */
1534 if (o_ptr->pval > 0)
1536 /* Disarm or Unlock */
1537 o_ptr->pval = (0 - o_ptr->pval);
1540 object_known(o_ptr);
1543 if (known && o_ptr->marked)
1546 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1548 msg_print("Click!");
1560 if (o_ptr->tval == TV_CORPSE)
1565 if (!who || is_pet(&m_list[who]))
1566 mode |= PM_FORCE_PET;
1568 for (i = 0; i < o_ptr->number ; i++)
1570 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1571 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1576 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1578 note_kill = (plural ? " become dust." : " becomes dust.");
1583 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1586 note_kill = "À¸¤Ê֤ä¿¡£";
1588 note_kill = "rivived.";
1591 else if (!note_kill)
1594 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1596 note_kill = (plural ? " become dust." : " becomes dust.");
1608 /* Attempt to destroy the object */
1611 /* Effect "observed" */
1612 if (known && o_ptr->marked)
1615 object_desc(o_name, o_ptr, FALSE, 0);
1618 /* Artifacts, and other objects, get to resist */
1619 if (is_art || ignore)
1621 /* Observe the resist */
1622 if (known && o_ptr->marked)
1625 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1628 msg_format("The %s %s unaffected!",
1629 o_name, (plural ? "are" : "is"));
1638 /* Describe if needed */
1639 if (known && o_ptr->marked && note_kill)
1642 msg_format("%s¤Ï%s", o_name, note_kill);
1644 msg_format("The %s%s", o_name, note_kill);
1649 k_idx = o_ptr->k_idx;
1650 is_potion = object_is_potion(o_ptr);
1653 /* Delete the object */
1654 delete_object_idx(this_o_idx);
1656 /* Potions produce effects when 'shattered' */
1659 (void)potion_smash_effect(who, y, x, k_idx);
1668 /* Return "Anything seen?" */
1674 * Helper function for "project()" below.
1676 * Handle a beam/bolt/ball causing damage to a monster.
1678 * This routine takes a "source monster" (by index) which is mostly used to
1679 * determine if the player is causing the damage, and a "radius" (see below),
1680 * which is used to decrease the power of explosions with distance, and a
1681 * location, via integers which are modified by certain types of attacks
1682 * (polymorph and teleport being the obvious ones), a default damage, which
1683 * is modified as needed based on various properties, and finally a "damage
1684 * type" (see below).
1686 * Note that this routine can handle "no damage" attacks (like teleport) by
1687 * taking a "zero" damage, and can even take "parameters" to attacks (like
1688 * confuse) by accepting a "damage", using it to calculate the effect, and
1689 * then setting the damage to zero. Note that the "damage" parameter is
1690 * divided by the radius, so monsters not at the "epicenter" will not take
1691 * as much damage (or whatever)...
1693 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1694 * may result in a dereference of an invalid pointer. XXX XXX XXX
1696 * Various messages are produced, and damage is applied.
1698 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1699 * actually be "made" of that substance, or "breathe" big balls of it.
1701 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1704 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1705 * and hurts evil less. If can breath nether, then it resists it as well.
1707 * Damage reductions use the following formulas:
1708 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1709 * gives avg damage of .655, ranging from .858 to .500
1710 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1711 * gives avg damage of .544, ranging from .714 to .417
1712 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1713 * gives avg damage of .444, ranging from .556 to .333
1714 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1715 * gives avg damage of .327, ranging from .427 to .250
1716 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1717 * gives something simple.
1719 * In this function, "result" messages are postponed until the end, where
1720 * the "note" string is appended to the monster name, if not NULL. So,
1721 * to make a spell have "no effect" just set "note" to NULL. You should
1722 * also set "notice" to FALSE, or the player will learn what the spell does.
1724 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1726 /* "flg" was added. */
1727 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1731 cave_type *c_ptr = &cave[y][x];
1733 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1735 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1739 /* Is the monster "seen"? */
1740 bool seen = m_ptr->ml;
1742 bool slept = (bool)(m_ptr->csleep > 0);
1744 /* Were the effects "obvious" (if seen)? */
1745 bool obvious = FALSE;
1747 /* Can the player know about this effect? */
1748 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1750 /* Can the player see the source of this effect? */
1751 bool see_s = ((who <= 0) || m_list[who].ml);
1753 /* Were the effects "irrelevant"? */
1754 bool skipped = FALSE;
1756 /* Gets the monster angry at the source of the effect? */
1757 bool get_angry = FALSE;
1759 /* Polymorph setting (true or false) */
1762 /* Teleport setting (max distance) */
1765 /* Confusion setting (amount to confuse) */
1768 /* Stunning setting (amount to stun) */
1771 /* Sleep amount (amount to sleep) */
1774 /* Fear amount (amount to fear) */
1777 /* Time amount (amount to time) */
1780 bool heal_leper = FALSE;
1782 /* Hold the monster name */
1789 /* Assume no note */
1792 /* Assume a default death */
1794 cptr note_dies = "¤Ï»à¤ó¤À¡£";
1796 cptr note_dies = " dies.";
1804 if (!c_ptr->m_idx) return (FALSE);
1806 /* Never affect projector */
1807 if (who && (c_ptr->m_idx == who)) return (FALSE);
1808 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1809 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1811 /* Don't affect already death monsters */
1812 /* Prevents problems with chain reactions of exploding monsters */
1813 if (m_ptr->hp < 0) return (FALSE);
1815 /* Reduce damage by distance */
1816 dam = (dam + r) / (r + 1);
1819 /* Get the monster name (BEFORE polymorphing) */
1820 monster_desc(m_name, m_ptr, 0);
1822 /* Get the monster possessive ("his"/"her"/"its") */
1823 monster_desc(m_poss, m_ptr, 0x22);
1826 /* Some monsters get "destroyed" */
1827 if (!monster_living(r_ptr))
1830 bool explode = FALSE;
1832 for (i = 0; i < 4; i++)
1834 if (r_ptr->blow[i].method == RBM_EXPLODE) explode = TRUE;
1837 /* Special note at death */
1840 note_dies = "¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£";
1842 note_dies = " explodes into tiny shreds.";
1846 note_dies = "¤òÅݤ·¤¿¡£";
1848 note_dies = " is destroyed.";
1852 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1854 /* Analyze the damage type */
1857 /* Magic Missile -- pure damage */
1860 if (seen) obvious = TRUE;
1861 if (r_ptr->flags3 & (RF3_RES_ALL))
1864 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1866 note = " is immune.";
1869 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1878 if (seen) obvious = TRUE;
1879 if (r_ptr->flags3 & (RF3_RES_ALL))
1882 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1884 note = " is immune.";
1887 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1890 if (r_ptr->flags3 & (RF3_IM_ACID))
1893 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1895 note = " resists a lot.";
1899 if (seen) r_ptr->r_flags3 |= (RF3_IM_ACID);
1907 if (seen) obvious = TRUE;
1908 if (r_ptr->flags3 & (RF3_RES_ALL))
1911 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1913 note = " is immune.";
1916 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1919 if (r_ptr->flags3 & (RF3_IM_ELEC))
1922 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1924 note = " resists a lot.";
1928 if (seen) r_ptr->r_flags3 |= (RF3_IM_ELEC);
1936 if (seen) obvious = TRUE;
1937 if (r_ptr->flags3 & (RF3_RES_ALL))
1940 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1942 note = " is immune.";
1945 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1948 if (r_ptr->flags3 & (RF3_IM_FIRE))
1951 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1953 note = " resists a lot.";
1957 if (seen) r_ptr->r_flags3 |= (RF3_IM_FIRE);
1959 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1962 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1964 note = " is hit hard.";
1968 if (seen) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1976 if (seen) obvious = TRUE;
1977 if (r_ptr->flags3 & (RF3_RES_ALL))
1980 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1982 note = " is immune.";
1985 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1988 if (r_ptr->flags3 & (RF3_IM_COLD))
1991 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1993 note = " resists a lot.";
1997 if (seen) r_ptr->r_flags3 |= (RF3_IM_COLD);
1999 else if (r_ptr->flags3 & (RF3_HURT_COLD))
2002 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
2004 note = " is hit hard.";
2008 if (seen) r_ptr->r_flags3 |= (RF3_HURT_COLD);
2016 if (seen) obvious = TRUE;
2017 if (r_ptr->flags3 & (RF3_RES_ALL))
2020 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2022 note = " is immune.";
2025 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2028 if (r_ptr->flags3 & RF3_IM_POIS)
2031 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
2033 note = " resists a lot.";
2037 if (seen) r_ptr->r_flags3 |= (RF3_IM_POIS);
2045 if (seen) obvious = TRUE;
2047 if (r_ptr->flags3 & (RF3_RES_ALL))
2050 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2052 note = " is immune.";
2055 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2058 if (r_ptr->flags3 & RF3_IM_POIS)
2061 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2066 dam *= 3; dam /= randint1(6) + 6;
2067 if (seen) r_ptr->r_flags3 |= (RF3_IM_POIS);
2069 else if (one_in_(3)) do_poly = TRUE;
2073 /* Hellfire -- hurts Evil */
2076 if (seen) obvious = TRUE;
2077 if (r_ptr->flags3 & (RF3_RES_ALL))
2080 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2082 note = " is immune.";
2085 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2088 if (r_ptr->flags3 & RF3_GOOD)
2092 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2094 note = " is hit hard.";
2097 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
2102 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2105 if (seen) obvious = TRUE;
2106 if (r_ptr->flags3 & (RF3_RES_ALL))
2109 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2111 note = " is immune.";
2114 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2117 if (r_ptr->flags3 & RF3_GOOD)
2121 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2123 note = " is immune.";
2126 if (seen) r_ptr->r_flags3 |= RF3_GOOD;
2128 else if (r_ptr->flags3 & RF3_EVIL)
2132 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2134 note = " is hit hard.";
2137 if (seen) r_ptr->r_flags3 |= RF3_EVIL;
2142 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2147 dam *= 3; dam /= randint1(6) + 6;
2152 /* Arrow -- XXX no defense */
2155 if (seen) obvious = TRUE;
2156 if (r_ptr->flags3 & (RF3_RES_ALL))
2159 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2161 note = " is immune.";
2164 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2170 /* Plasma -- XXX perhaps check ELEC or FIRE */
2173 if (seen) obvious = TRUE;
2174 if (r_ptr->flags3 & (RF3_RES_ALL))
2177 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2179 note = " is immune.";
2182 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2185 if (r_ptr->flags3 & RF3_RES_PLAS)
2188 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2193 dam *= 3; dam /= randint1(6) + 6;
2195 r_ptr->r_flags3 |= (RF3_RES_PLAS);
2200 /* Nether -- see above */
2203 if (seen) obvious = TRUE;
2204 if (r_ptr->flags3 & (RF3_RES_ALL))
2207 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2209 note = " is immune.";
2212 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2215 if (r_ptr->flags3 & RF3_UNDEAD)
2218 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2220 note = " is immune.";
2224 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
2226 else if (r_ptr->flags3 & RF3_RES_NETH)
2229 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2234 dam *= 3; dam /= randint1(6) + 6;
2236 if (seen) r_ptr->r_flags3 |= (RF3_RES_NETH);
2238 else if (r_ptr->flags3 & RF3_EVIL)
2242 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2244 note = " resists somewhat.";
2247 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
2252 /* Water (acid) damage -- Water spirits/elementals are immune */
2255 if (seen) obvious = TRUE;
2256 if (r_ptr->flags3 & (RF3_RES_ALL))
2259 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2261 note = " is immune.";
2264 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2267 if (m_ptr->r_idx == MON_WATER_ELEM || m_ptr->r_idx == MON_UNMAKER)
2270 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2272 note = " is immune.";
2277 else if (r_ptr->flags3 & RF3_RES_WATE)
2280 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2285 dam *= 3; dam /= randint1(6) + 6;
2286 if (seen) r_ptr->r_flags3 |= (RF3_RES_WATE);
2291 /* Chaos -- Chaos breathers resist */
2294 if (seen) obvious = TRUE;
2295 if (r_ptr->flags3 & (RF3_RES_ALL))
2298 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2300 note = " is immune.";
2303 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2307 do_conf = (5 + randint1(11) + r) / (r + 1);
2308 if ((r_ptr->flags4 & RF4_BR_CHAO) ||
2309 (m_ptr->r_idx == MON_STORMBRINGER) ||
2310 ((r_ptr->flags3 & RF3_DEMON) && one_in_(3)))
2313 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2318 dam *= 3; dam /= randint1(6) + 6;
2324 /* Shards -- Shard breathers resist */
2327 if (seen) obvious = TRUE;
2328 if (r_ptr->flags3 & (RF3_RES_ALL))
2331 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2333 note = " is immune.";
2336 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2339 if (r_ptr->flags4 & RF4_BR_SHAR)
2342 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2347 dam *= 3; dam /= randint1(6) + 6;
2352 /* Rocket: Shard resistance helps */
2355 if (seen) obvious = TRUE;
2357 if (r_ptr->flags3 & (RF3_RES_ALL))
2360 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2362 note = " is immune.";
2365 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2368 if (r_ptr->flags4 & RF4_BR_SHAR)
2371 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2373 note = " resists somewhat.";
2382 /* Sound -- Sound breathers resist */
2385 if (seen) obvious = TRUE;
2386 if (r_ptr->flags3 & (RF3_RES_ALL))
2389 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2391 note = " is immune.";
2394 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2397 do_stun = (10 + randint1(15) + r) / (r + 1);
2398 if (r_ptr->flags4 & RF4_BR_SOUN)
2401 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2406 dam *= 2; dam /= randint1(6) + 6;
2414 if (seen) obvious = TRUE;
2415 if (r_ptr->flags3 & (RF3_RES_ALL))
2418 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2420 note = " is immune.";
2423 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2426 do_conf = (10 + randint1(15) + r) / (r + 1);
2427 if (r_ptr->flags4 & RF4_BR_CONF)
2430 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2435 dam *= 2; dam /= randint1(6) + 6;
2437 else if (r_ptr->flags3 & RF3_NO_CONF)
2440 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2442 note = " resists somewhat.";
2450 /* Disenchantment -- Breathers and Disenchanters resist */
2453 if (seen) obvious = TRUE;
2454 if (r_ptr->flags3 & (RF3_RES_ALL))
2457 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2459 note = " is immune.";
2462 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2465 if (r_ptr->flags3 & RF3_RES_DISE)
2468 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2473 dam *= 3; dam /= randint1(6) + 6;
2474 if (seen) r_ptr->r_flags3 |= (RF3_RES_DISE);
2479 /* Nexus -- Breathers and Existers resist */
2482 if (seen) obvious = TRUE;
2483 if (r_ptr->flags3 & (RF3_RES_ALL))
2486 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2488 note = " is immune.";
2491 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2494 if (r_ptr->flags3 & RF3_RES_NEXU)
2497 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2502 dam *= 3; dam /= randint1(6) + 6;
2503 if (seen) r_ptr->r_flags3 |= (RF3_RES_NEXU);
2511 if (seen) obvious = TRUE;
2512 if (r_ptr->flags3 & (RF3_RES_ALL))
2515 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2517 note = " is immune.";
2520 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2523 do_stun = (randint1(15) + r) / (r + 1);
2524 if (r_ptr->flags4 & RF4_BR_WALL)
2527 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2532 dam *= 3; dam /= randint1(6) + 6;
2537 /* Inertia -- breathers resist */
2540 if (seen) obvious = TRUE;
2541 if (r_ptr->flags3 & (RF3_RES_ALL))
2544 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2546 note = " is immune.";
2549 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2552 if (r_ptr->flags4 & (RF4_BR_INER))
2555 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2560 dam *= 3; dam /= randint1(6) + 6;
2564 /* Powerful monsters can resist */
2565 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2566 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2570 /* Normal monsters slow down */
2576 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2578 note = " starts moving slower.";
2581 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2582 if (c_ptr->m_idx == p_ptr->riding)
2583 p_ptr->update |= (PU_BONUS);
2589 /* Time -- breathers resist */
2592 if (seen) obvious = TRUE;
2593 if (r_ptr->flags3 & (RF3_RES_ALL))
2596 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2598 note = " is immune.";
2601 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2604 if (r_ptr->flags4 & (RF4_BR_TIME))
2607 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2612 dam *= 3; dam /= randint1(6) + 6;
2614 else do_time = (dam+1)/2;
2618 /* Gravity -- breathers resist */
2621 bool resist_tele = FALSE;
2623 if (seen) obvious = TRUE;
2625 if (r_ptr->flags3 & (RF3_RES_ALL))
2628 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2630 note = " is immune.";
2633 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2636 if (r_ptr->flags3 & (RF3_RES_TELE))
2638 if (r_ptr->flags1 & (RF1_UNIQUE))
2640 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
2642 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2644 note = " is unaffected!";
2649 else if (r_ptr->level > randint1(100))
2651 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
2653 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2662 if (!resist_tele) do_dist = 10;
2664 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2666 if (r_ptr->flags4 & (RF4_BR_GRAV))
2669 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2674 dam *= 3; dam /= randint1(6) + 6;
2680 /* Powerful monsters can resist */
2681 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2682 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2686 /* Normal monsters slow down */
2692 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2694 note = " starts moving slower.";
2697 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2698 if (c_ptr->m_idx == p_ptr->riding)
2699 p_ptr->update |= (PU_BONUS);
2703 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
2705 /* Attempt a saving throw */
2706 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2707 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2711 /* No obvious effect */
2713 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2715 note = " is unaffected!";
2729 if (seen) obvious = TRUE;
2730 if (r_ptr->flags3 & (RF3_RES_ALL))
2733 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2735 note = " is immune.";
2738 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2746 case GF_DISINTEGRATE:
2748 if (seen) obvious = TRUE;
2749 if (r_ptr->flags3 & (RF3_RES_ALL))
2752 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2754 note = " is immune.";
2757 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2760 if (r_ptr->flags3 & RF3_HURT_ROCK)
2762 if (seen) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2764 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2765 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2767 note = " loses some skin!";
2768 note_dies = " evaporates!";
2778 if (seen) obvious = TRUE;
2780 /* PSI only works if the monster can see you! -- RG */
2781 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2785 note = "¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª";
2787 note = " can't see you, and isn't affected!";
2792 if (r_ptr->flags3 & (RF3_RES_ALL))
2795 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2797 note = " is immune.";
2800 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2803 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2807 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2809 note = " is immune!";
2811 if (seen) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2814 else if ((r_ptr->flags2 & RF2_STUPID) ||
2815 (r_ptr->flags2 & RF2_WEIRD_MIND) ||
2816 (r_ptr->flags3 & RF3_ANIMAL) ||
2817 (r_ptr->level > randint1(3 * dam)))
2821 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2828 * Powerful demons & undead can turn a mindcrafter's
2829 * attacks back on them
2831 if (((r_ptr->flags3 & RF3_UNDEAD) ||
2832 (r_ptr->flags3 & RF3_DEMON)) &&
2833 (r_ptr->level > p_ptr->lev / 2) &&
2838 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
2841 msg_format("%^s%s corrupted mind backlashes your attack!",
2842 m_name, (seen ? "'s" : "s"));
2846 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2849 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2851 msg_print("You resist the effects!");
2857 /* Injure +/- confusion */
2858 monster_desc(killer, m_ptr, 0x288);
2859 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2862 switch (randint1(4))
2865 set_confused(p_ptr->confused + 3 + randint1(dam));
2868 set_stun(p_ptr->stun + randint1(dam));
2872 if (r_ptr->flags3 & RF3_NO_FEAR)
2874 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2876 note = " is unaffected.";
2880 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2884 if (!p_ptr->free_act)
2885 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2894 if ((dam > 0) && one_in_(4))
2896 switch (randint1(4))
2899 do_conf = 3 + randint1(dam);
2902 do_stun = 3 + randint1(dam);
2905 do_fear = 3 + randint1(dam);
2909 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2911 note = " falls asleep!";
2914 do_sleep = 3 + randint1(dam);
2920 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2922 note_dies = " collapses, a mindless husk.";
2930 if (seen) obvious = TRUE;
2931 if (r_ptr->flags3 & (RF3_RES_ALL))
2934 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2936 note = " is immune.";
2939 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2942 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2946 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2948 note = " is immune!";
2952 else if ((r_ptr->flags2 & RF2_STUPID) ||
2953 (r_ptr->flags2 & RF2_WEIRD_MIND) ||
2954 (r_ptr->flags3 & RF3_ANIMAL) ||
2955 (r_ptr->level > randint1(3 * dam)))
2959 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2966 * Powerful demons & undead can turn a mindcrafter's
2967 * attacks back on them
2969 if (((r_ptr->flags3 & RF3_UNDEAD) ||
2970 (r_ptr->flags3 & RF3_DEMON)) &&
2971 (r_ptr->level > p_ptr->lev / 2) &&
2976 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
2979 msg_format("%^s%s corrupted mind backlashes your attack!",
2980 m_name, (seen ? "'s" : "s"));
2984 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2987 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2989 msg_print("You resist the effects!");
2995 /* Injure + mana drain */
2996 monster_desc(killer, m_ptr, 0x288);
2998 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
3000 msg_print("Your psychic energy is drained!");
3003 p_ptr->csp = MAX(0, p_ptr->csp - damroll(5, dam) / 2);
3004 p_ptr->redraw |= PR_MANA;
3005 p_ptr->window |= (PW_SPELL);
3006 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
3013 int b = damroll(5, dam) / 4;
3015 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª",
3018 msg_format("You convert %s%s pain into psychic energy!",
3019 m_name, (seen ? "'s" : "s"));
3022 b = MIN(p_ptr->msp, p_ptr->csp + b);
3024 p_ptr->redraw |= PR_MANA;
3025 p_ptr->window |= (PW_SPELL);
3029 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
3031 note_dies = " collapses, a mindless husk.";
3037 case GF_TELEKINESIS:
3039 if (seen) obvious = TRUE;
3040 if (r_ptr->flags3 & (RF3_RES_ALL))
3043 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3045 note = " is immune.";
3048 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3053 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
3058 do_stun = damroll((p_ptr->lev / 10) + 3 , dam) + 1;
3060 /* Attempt a saving throw */
3061 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3062 (r_ptr->level > 5 + randint1(dam)))
3066 /* No obvious effect */
3072 /* Psycho-spear -- powerful magic missile */
3075 if (seen) obvious = TRUE;
3076 if (r_ptr->flags3 & (RF3_RES_ALL))
3079 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3081 note = " is immune.";
3084 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3090 /* Meteor -- powerful magic missile */
3093 if (seen) obvious = TRUE;
3094 if (r_ptr->flags3 & (RF3_RES_ALL))
3097 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3099 note = " is immune.";
3102 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3110 if (!is_hostile(m_ptr)) break;
3111 if (seen) obvious = TRUE;
3113 if (r_ptr->flags3 & (RF3_RES_ALL))
3116 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3118 note = " is immune.";
3121 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3124 /* Attempt a saving throw */
3125 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3126 (r_ptr->flags1 & RF1_QUESTOR) ||
3127 (r_ptr->flags3 & RF3_NO_CONF) ||
3128 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3130 /* Memorize a flag */
3131 if (r_ptr->flags3 & RF3_NO_CONF)
3133 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
3140 * Powerful demons & undead can turn a mindcrafter's
3141 * attacks back on them
3143 if (((r_ptr->flags3 & RF3_UNDEAD) ||
3144 (r_ptr->flags3 & RF3_DEMON)) &&
3145 (r_ptr->level > p_ptr->lev / 2) &&
3150 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
3153 msg_format("%^s%s corrupted mind backlashes your attack!",
3154 m_name, (seen ? "'s" : "s"));
3158 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3161 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3163 msg_print("You resist the effects!");
3169 /* Confuse, stun, terrify */
3170 switch (randint1(4))
3173 set_stun(p_ptr->stun + dam / 2);
3176 set_confused(p_ptr->confused + dam / 2);
3180 if (r_ptr->flags3 & RF3_NO_FEAR)
3182 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3184 note = " is unaffected.";
3188 set_afraid(p_ptr->afraid + dam);
3195 /* No obvious effect */
3197 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3199 note = " is unaffected!";
3207 if ((dam > 29) && (randint1(100) < dam))
3210 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3212 note = " is in your thrall!";
3219 switch (randint1(4))
3233 /* No "real" damage */
3240 /* Ice -- Cold + Cuts + Stun */
3243 if (seen) obvious = TRUE;
3244 if (r_ptr->flags3 & (RF3_RES_ALL))
3247 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3249 note = " is immune.";
3252 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3255 do_stun = (randint1(15) + 1) / (r + 1);
3256 if (r_ptr->flags3 & RF3_IM_COLD)
3259 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3261 note = " resists a lot.";
3265 if (seen) r_ptr->r_flags3 |= (RF3_IM_COLD);
3267 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3270 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3272 note = " is hit hard.";
3276 if (seen) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3285 if (seen) obvious = TRUE;
3287 if (r_ptr->flags3 & (RF3_RES_ALL))
3290 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3292 note = " is immune.";
3295 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3298 if (!monster_living(r_ptr))
3300 if (r_ptr->flags3 & RF3_UNDEAD)
3302 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
3305 if (r_ptr->flags3 & (RF3_DEMON))
3307 if (seen) r_ptr->r_flags3 |= (RF3_DEMON);
3311 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3313 note = " is unaffected!";
3319 else do_time = (dam+7)/8;
3327 if (seen) obvious = TRUE;
3329 if (r_ptr->flags3 & (RF3_RES_ALL))
3332 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3334 note = " is immune.";
3337 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3340 if ((r_ptr->flags3 & RF3_UNDEAD) ||
3341 (r_ptr->flags3 & RF3_NONLIVING))
3343 if (r_ptr->flags3 & RF3_UNDEAD)
3345 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
3349 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3351 note = " is immune.";
3357 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3358 (randint1(888) != 666)) ||
3359 (((r_ptr->level + randint1(20)) > randint1(p_ptr->lev + randint1(10))) &&
3360 randint1(100) != 66))
3363 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3375 /* Polymorph monster (Use "dam" as "power") */
3378 if (seen) obvious = TRUE;
3380 if (r_ptr->flags3 & (RF3_RES_ALL))
3383 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3385 note = " is immune.";
3388 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3391 /* Attempt to polymorph (see below) */
3394 /* Powerful monsters can resist */
3395 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3396 (r_ptr->flags1 & RF1_QUESTOR) ||
3397 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3400 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3402 note = " is unaffected!";
3409 /* No "real" damage */
3416 /* Clone monsters (Ignore "dam") */
3419 if (seen) obvious = TRUE;
3421 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)))
3424 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3426 note = " is unaffected!";
3432 m_ptr->hp = m_ptr->maxhp;
3434 /* Attempt to clone. */
3435 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3438 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3446 /* No "real" damage */
3453 /* Heal Monster (use "dam" as amount of healing) */
3456 if (seen) obvious = TRUE;
3461 if (m_ptr->maxhp < m_ptr->max_maxhp)
3464 msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3466 msg_format("%^s recovers %s vitality.", m_name, m_poss);
3468 m_ptr->maxhp = m_ptr->max_maxhp;
3474 if (seen) obvious = TRUE;
3482 msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3484 msg_format("%^s is no longer stunned.", m_name);
3488 if (m_ptr->confused)
3491 msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3493 msg_format("%^s is no longer confused.", m_name);
3495 m_ptr->confused = 0;
3500 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3502 msg_format("%^s recovers %s courage.", m_name, m_poss);
3508 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3511 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3513 chg_virtue(V_VITALITY, 1);
3515 if (r_ptr->flags1 & RF1_UNIQUE)
3516 chg_virtue(V_INDIVIDUALISM, 1);
3518 if (is_friendly(m_ptr))
3519 chg_virtue(V_HONOUR, 1);
3520 else if (!(r_ptr->flags3 & RF3_EVIL))
3522 if (r_ptr->flags3 & RF3_GOOD)
3523 chg_virtue(V_COMPASSION, 2);
3525 chg_virtue(V_COMPASSION, 1);
3528 if (m_ptr->r_idx == MON_LEPER)
3531 chg_virtue(V_COMPASSION, 5);
3534 if (r_ptr->flags3 & RF3_ANIMAL)
3535 chg_virtue(V_NATURE, 1);
3537 /* Redraw (later) if needed */
3538 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3539 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3543 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3545 note = " looks healthier.";
3549 /* No "real" damage */
3555 /* Speed Monster (Ignore "dam") */
3558 if (seen) obvious = TRUE;
3564 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3566 note = " starts moving faster.";
3569 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3571 if (c_ptr->m_idx == p_ptr->riding)
3572 p_ptr->update |= (PU_BONUS);
3574 if (r_ptr->flags1 & RF1_UNIQUE)
3575 chg_virtue(V_INDIVIDUALISM, 1);
3576 if (is_friendly(m_ptr))
3577 chg_virtue(V_HONOUR, 1);
3579 /* No "real" damage */
3585 /* Slow Monster (Use "dam" as "power") */
3588 if (seen) obvious = TRUE;
3590 if (r_ptr->flags3 & (RF3_RES_ALL))
3593 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3595 note = " is immune.";
3598 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3601 /* Powerful monsters can resist */
3602 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3603 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3606 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3608 note = " is unaffected!";
3614 /* Normal monsters slow down */
3620 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3622 note = " starts moving slower.";
3625 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3627 if (c_ptr->m_idx == p_ptr->riding)
3628 p_ptr->update |= (PU_BONUS);
3631 /* No "real" damage */
3637 /* Sleep (Use "dam" as "power") */
3640 if (seen) obvious = TRUE;
3642 if (r_ptr->flags3 & (RF3_RES_ALL))
3645 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3647 note = " is immune.";
3650 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3653 /* Attempt a saving throw */
3654 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3655 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3656 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3658 /* Memorize a flag */
3659 if (r_ptr->flags3 & RF3_NO_SLEEP)
3661 if (seen) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3664 /* No obvious effect */
3666 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3668 note = " is unaffected!";
3675 /* Go to sleep (much) later */
3677 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3679 note = " falls asleep!";
3685 /* No "real" damage */
3691 /* Sleep (Use "dam" as "power") */
3692 case GF_STASIS_EVIL:
3694 if (seen) obvious = TRUE;
3696 if (r_ptr->flags3 & (RF3_RES_ALL))
3699 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3701 note = " is immune.";
3704 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3707 /* Attempt a saving throw */
3708 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3709 !(r_ptr->flags3 & RF3_EVIL) ||
3710 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3713 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3715 note = " is unaffected!";
3722 /* Go to sleep (much) later */
3724 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3726 note = " is suspended!";
3732 /* No "real" damage */
3737 /* Sleep (Use "dam" as "power") */
3740 if (seen) obvious = TRUE;
3742 if (r_ptr->flags3 & (RF3_RES_ALL))
3745 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3747 note = " is immune.";
3750 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3753 /* Attempt a saving throw */
3754 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3755 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3758 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3760 note = " is unaffected!";
3767 /* Go to sleep (much) later */
3769 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3771 note = " is suspended!";
3777 /* No "real" damage */
3786 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3787 vir = virtue_number(V_HARMONY);
3790 dam += p_ptr->virtues[vir-1]/10;
3793 vir = virtue_number(V_INDIVIDUALISM);
3796 dam -= p_ptr->virtues[vir-1]/20;
3799 if (seen) obvious = TRUE;
3801 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3804 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3806 note = " is immune.";
3809 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3813 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3816 /* Attempt a saving throw */
3817 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3818 (r_ptr->flags3 & RF3_NO_CONF) ||
3819 (m_ptr->mflag2 & MFLAG_NOPET) ||
3820 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3822 /* Memorize a flag */
3823 if (r_ptr->flags3 & RF3_NO_CONF)
3825 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
3829 /* No obvious effect */
3831 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3833 note = " is unaffected!";
3838 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3840 else if (p_ptr->cursed & TRC_AGGRAVATE)
3843 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3845 note = " hates you too much!";
3848 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3853 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3855 note = " suddenly seems friendly!";
3860 chg_virtue(V_INDIVIDUALISM, -1);
3861 if (r_ptr->flags3 & RF3_ANIMAL)
3862 chg_virtue(V_NATURE, 1);
3865 /* No "real" damage */
3870 /* Control undead */
3871 case GF_CONTROL_UNDEAD:
3874 if (seen) obvious = TRUE;
3876 vir = virtue_number(V_UNLIFE);
3879 dam += p_ptr->virtues[vir-1]/10;
3882 vir = virtue_number(V_INDIVIDUALISM);
3885 dam -= p_ptr->virtues[vir-1]/20;
3888 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3891 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3893 note = " is immune.";
3896 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3900 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3903 /* Attempt a saving throw */
3904 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3905 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3906 (m_ptr->mflag2 & MFLAG_NOPET) ||
3907 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3909 /* No obvious effect */
3911 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3913 note = " is unaffected!";
3917 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3919 else if (p_ptr->cursed & TRC_AGGRAVATE)
3922 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3924 note = " hates you too much!";
3927 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3932 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3934 note = " is in your thrall!";
3940 /* No "real" damage */
3946 case GF_CONTROL_DEMON:
3949 if (seen) obvious = TRUE;
3951 vir = virtue_number(V_UNLIFE);
3954 dam += p_ptr->virtues[vir-1]/10;
3957 vir = virtue_number(V_INDIVIDUALISM);
3960 dam -= p_ptr->virtues[vir-1]/20;
3963 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3966 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3968 note = " is immune.";
3971 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3975 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3978 /* Attempt a saving throw */
3979 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3980 (!(r_ptr->flags3 & RF3_DEMON)) ||
3981 (m_ptr->mflag2 & MFLAG_NOPET) ||
3982 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3984 /* No obvious effect */
3986 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3988 note = " is unaffected!";
3992 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3994 else if (p_ptr->cursed & TRC_AGGRAVATE)
3997 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3999 note = " hates you too much!";
4002 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4007 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
4009 note = " is in your thrall!";
4015 /* No "real" damage */
4021 case GF_CONTROL_ANIMAL:
4025 if (seen) obvious = TRUE;
4027 vir = virtue_number(V_NATURE);
4030 dam += p_ptr->virtues[vir-1]/10;
4033 vir = virtue_number(V_INDIVIDUALISM);
4036 dam -= p_ptr->virtues[vir-1]/20;
4039 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
4042 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4044 note = " is immune.";
4047 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4051 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4054 /* Attempt a saving throw */
4055 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4056 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
4057 (m_ptr->mflag2 & MFLAG_NOPET) ||
4058 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4059 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4061 /* Memorize a flag */
4062 if (r_ptr->flags3 & (RF3_NO_CONF))
4064 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
4068 /* No obvious effect */
4070 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4072 note = " is unaffected!";
4076 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4078 else if (p_ptr->cursed & TRC_AGGRAVATE)
4081 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4083 note = " hates you too much!";
4086 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4091 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4093 note = " is tamed!";
4098 if (r_ptr->flags3 & RF3_ANIMAL)
4099 chg_virtue(V_NATURE, 1);
4102 /* No "real" damage */
4108 case GF_CONTROL_LIVING:
4112 vir = virtue_number(V_UNLIFE);
4113 if (seen) obvious = TRUE;
4115 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4116 vir = virtue_number(V_UNLIFE);
4119 dam -= p_ptr->virtues[vir-1]/10;
4122 vir = virtue_number(V_INDIVIDUALISM);
4125 dam -= p_ptr->virtues[vir-1]/20;
4128 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4129 if (dam < 1) dam = 1;
4131 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4133 msg_format("You stare into %s.", m_name);
4135 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
4138 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4140 note = " is immune.";
4143 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4147 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4150 /* Attempt a saving throw */
4151 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4152 (m_ptr->mflag2 & MFLAG_NOPET) ||
4153 (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) ||
4154 ((r_ptr->level+10) > randint1(dam)))
4157 /* No obvious effect */
4159 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4161 note = " is unaffected!";
4165 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4167 else if (p_ptr->cursed & TRC_AGGRAVATE)
4170 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4172 note = " hates you too much!";
4175 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4180 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4182 note = " is tamed!";
4187 if (r_ptr->flags3 & RF3_ANIMAL)
4188 chg_virtue(V_NATURE, 1);
4191 /* No "real" damage */
4196 /* Confusion (Use "dam" as "power") */
4199 if (seen) obvious = TRUE;
4201 if (r_ptr->flags3 & (RF3_RES_ALL))
4204 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4206 note = " is immune.";
4209 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4212 /* Get confused later */
4213 do_conf = damroll(3, (dam / 2)) + 1;
4215 /* Attempt a saving throw */
4216 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4217 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4218 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4220 /* Memorize a flag */
4221 if (r_ptr->flags3 & (RF3_NO_CONF))
4223 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
4229 /* No obvious effect */
4231 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4233 note = " is unaffected!";
4239 /* No "real" damage */
4246 if (seen) obvious = TRUE;
4248 if (r_ptr->flags3 & (RF3_RES_ALL))
4251 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4253 note = " is immune.";
4256 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4259 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
4261 /* Attempt a saving throw */
4262 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4263 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4268 /* No obvious effect */
4270 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4272 note = " is unaffected!";
4278 /* No "real" damage */
4286 /* Lite, but only hurts susceptible creatures */
4294 if (r_ptr->flags3 & (RF3_RES_ALL))
4300 if (r_ptr->flags3 & (RF3_HURT_LITE))
4302 /* Obvious effect */
4303 if (seen) obvious = TRUE;
4305 /* Memorize the effects */
4306 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4308 /* Special effect */
4310 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4311 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4313 note = " cringes from the light!";
4314 note_dies = " shrivels away in the light!";
4319 /* Normally no damage */
4331 /* Lite -- opposite of Dark */
4334 if (seen) obvious = TRUE;
4335 if (r_ptr->flags3 & (RF3_RES_ALL))
4338 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4340 note = " is immune.";
4343 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4346 if (r_ptr->flags4 & (RF4_BR_LITE))
4349 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4354 dam *= 2; dam /= (randint1(6)+6);
4356 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4358 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4360 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4361 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4363 note = " cringes from the light!";
4364 note_dies = " shrivels away in the light!";
4373 /* Dark -- opposite of Lite */
4376 if (seen) obvious = TRUE;
4378 if (r_ptr->flags3 & (RF3_RES_ALL))
4381 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4383 note = " is immune.";
4386 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4389 /* Likes darkness... */
4390 if ((r_ptr->flags4 & (RF4_BR_DARK)) ||
4391 (r_ptr->flags3 & RF3_ORC) ||
4392 (r_ptr->flags3 & RF3_HURT_LITE))
4395 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4400 dam *= 2; dam /= (randint1(6)+6);
4409 if (r_ptr->flags3 & (RF3_RES_ALL))
4414 /* Hurt by rock remover */
4415 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4418 if (seen) obvious = TRUE;
4420 /* Memorize the effects */
4421 if (seen) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4423 /* Cute little message */
4425 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4426 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4428 note = " loses some skin!";
4429 note_dies = " dissolves!";
4434 /* Usually, ignore the effects */
4445 /* Teleport undead (Use "dam" as "power") */
4446 case GF_AWAY_UNDEAD:
4448 /* Only affect undead */
4449 if (r_ptr->flags3 & (RF3_UNDEAD))
4451 bool resists_tele = FALSE;
4453 if (r_ptr->flags3 & (RF3_RES_TELE))
4455 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4457 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4459 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4461 note = " is unaffected!";
4464 resists_tele = TRUE;
4466 else if (r_ptr->level > randint1(100))
4468 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4470 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4475 resists_tele = TRUE;
4481 if (seen) obvious = TRUE;
4482 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4494 /* No "real" damage */
4500 /* Teleport evil (Use "dam" as "power") */
4503 /* Only affect evil */
4504 if (r_ptr->flags3 & (RF3_EVIL))
4506 bool resists_tele = FALSE;
4508 if (r_ptr->flags3 & (RF3_RES_TELE))
4510 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4512 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4514 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4516 note = " is unaffected!";
4519 resists_tele = TRUE;
4521 else if (r_ptr->level > randint1(100))
4523 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4525 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4530 resists_tele = TRUE;
4536 if (seen) obvious = TRUE;
4537 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4549 /* No "real" damage */
4555 /* Teleport monster (Use "dam" as "power") */
4558 bool resists_tele = FALSE;
4559 if (r_ptr->flags3 & (RF3_RES_TELE))
4561 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4563 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4565 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4567 note = " is unaffected!";
4570 resists_tele = TRUE;
4572 else if (r_ptr->level > randint1(100))
4574 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4576 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4581 resists_tele = TRUE;
4588 if (seen) obvious = TRUE;
4590 /* Prepare to teleport */
4594 /* No "real" damage */
4600 /* Turn undead (Use "dam" as "power") */
4601 case GF_TURN_UNDEAD:
4603 if (r_ptr->flags3 & (RF3_RES_ALL))
4608 /* Only affect undead */
4609 if (r_ptr->flags3 & (RF3_UNDEAD))
4611 /* Learn about type */
4612 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4615 if (seen) obvious = TRUE;
4617 /* Apply some fear */
4618 do_fear = damroll(3, (dam / 2)) + 1;
4620 /* Attempt a saving throw */
4621 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4623 /* No obvious effect */
4625 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4627 note = " is unaffected!";
4642 /* No "real" damage */
4648 /* Turn evil (Use "dam" as "power") */
4651 if (r_ptr->flags3 & (RF3_RES_ALL))
4656 /* Only affect evil */
4657 if (r_ptr->flags3 & (RF3_EVIL))
4659 /* Learn about type */
4660 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4663 if (seen) obvious = TRUE;
4665 /* Apply some fear */
4666 do_fear = damroll(3, (dam / 2)) + 1;
4668 /* Attempt a saving throw */
4669 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4671 /* No obvious effect */
4673 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4675 note = " is unaffected!";
4690 /* No "real" damage */
4696 /* Turn monster (Use "dam" as "power") */
4699 if (r_ptr->flags3 & (RF3_RES_ALL))
4705 if (seen) obvious = TRUE;
4707 /* Apply some fear */
4708 do_fear = damroll(3, (dam / 2)) + 1;
4710 /* Attempt a saving throw */
4711 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4712 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4713 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4715 /* No obvious effect */
4717 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4719 note = " is unaffected!";
4726 /* No "real" damage */
4733 case GF_DISP_UNDEAD:
4735 if (r_ptr->flags3 & (RF3_RES_ALL))
4741 /* Only affect undead */
4742 if (r_ptr->flags3 & (RF3_UNDEAD))
4744 /* Learn about type */
4745 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4748 if (seen) obvious = TRUE;
4752 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4753 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4755 note = " shudders.";
4756 note_dies = " dissolves!";
4778 if (r_ptr->flags3 & (RF3_RES_ALL))
4784 /* Only affect evil */
4785 if (r_ptr->flags3 & (RF3_EVIL))
4787 /* Learn about type */
4788 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4791 if (seen) obvious = TRUE;
4795 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4796 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4798 note = " shudders.";
4799 note_dies = " dissolves!";
4820 if (r_ptr->flags3 & (RF3_RES_ALL))
4826 /* Only affect good */
4827 if (r_ptr->flags3 & (RF3_GOOD))
4829 /* Learn about type */
4830 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
4833 if (seen) obvious = TRUE;
4837 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4838 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4840 note = " shudders.";
4841 note_dies = " dissolves!";
4860 case GF_DISP_LIVING:
4862 if (r_ptr->flags3 & (RF3_RES_ALL))
4868 /* Only affect non-undead */
4869 if (monster_living(r_ptr))
4872 if (seen) obvious = TRUE;
4876 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4877 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4879 note = " shudders.";
4880 note_dies = " dissolves!";
4901 if (r_ptr->flags3 & (RF3_RES_ALL))
4907 /* Only affect demons */
4908 if (r_ptr->flags3 & (RF3_DEMON))
4910 /* Learn about type */
4911 if (seen) r_ptr->r_flags3 |= (RF3_DEMON);
4914 if (seen) obvious = TRUE;
4918 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4919 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4921 note = " shudders.";
4922 note_dies = " dissolves!";
4940 /* Dispel monster */
4943 if (r_ptr->flags3 & (RF3_RES_ALL))
4950 if (seen) obvious = TRUE;
4954 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4955 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4957 note = " shudders.";
4958 note_dies = " dissolves!";
4968 if (seen) obvious = TRUE;
4969 if (r_ptr->flags3 & (RF3_RES_ALL))
4972 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4974 note = " is immune.";
4977 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4981 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4985 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£",m_name);
4987 msg_format("You draws psychic energy from %s.", m_name);
4990 (void)hp_player(dam);
4995 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
4997 msg_format("%s is unaffected.", m_name);
5007 if (seen) obvious = TRUE;
5010 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5012 msg_format("You gazes intently at %s.", m_name);
5015 if (r_ptr->flags3 & (RF3_RES_ALL))
5018 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5020 note = " is immune.";
5023 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5027 /* Attempt a saving throw */
5028 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5029 (r_ptr->flags3 & RF3_NO_CONF) ||
5030 (r_ptr->level > randint1((p_ptr->lev*2 - 10) < 1 ? 1 : (p_ptr->lev*2 - 10)) + 10))
5032 /* Memorize a flag */
5033 if (r_ptr->flags3 & (RF3_NO_CONF))
5035 r_ptr->r_flags3 |= (RF3_NO_CONF);
5038 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5040 note = "is unaffected!";
5047 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5048 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±¶õ¤È¤Ê¤Ã¤¿¡£";
5050 msg_format("%^s is blasted by psionic energy.", m_name);
5051 note_dies = " collapses, a mindless husk.";
5054 do_conf = randint0(8) + 8;
5060 case GF_BRAIN_SMASH:
5062 if (seen) obvious = TRUE;
5065 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5067 msg_format("You gazes intently at %s.", m_name);
5070 if (r_ptr->flags3 & (RF3_RES_ALL))
5073 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5075 note = " is immune.";
5078 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5082 /* Attempt a saving throw */
5083 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5084 (r_ptr->flags3 & RF3_NO_CONF) ||
5085 (r_ptr->level > randint1((p_ptr->lev*2 - 10) < 1 ? 1 : (p_ptr->lev*2 - 10)) + 10))
5087 /* Memorize a flag */
5088 if (r_ptr->flags3 & (RF3_NO_CONF))
5090 r_ptr->r_flags3 |= (RF3_NO_CONF);
5093 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5095 note = "is unaffected!";
5102 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5103 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±¶õ¤È¤Ê¤Ã¤¿¡£";
5105 msg_format("%^s is blasted by psionic energy.", m_name);
5106 note_dies = " collapses, a mindless husk.";
5109 do_conf = randint0(8) + 8;
5110 do_stun = randint0(8) + 8;
5111 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5112 if (c_ptr->m_idx == p_ptr->riding)
5113 p_ptr->update |= (PU_BONUS);
5121 if (seen) obvious = TRUE;
5124 msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5126 msg_format("You points at %s and curses.", m_name);
5129 if (r_ptr->flags3 & (RF3_RES_ALL))
5132 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5134 note = " is immune.";
5137 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5141 /* Attempt a saving throw */
5142 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5146 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5148 note = "is unaffected!";
5158 if (seen) obvious = TRUE;
5161 msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5163 msg_format("You points at %s and curses horribly.", m_name);
5166 if (r_ptr->flags3 & (RF3_RES_ALL))
5169 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5171 note = " is immune.";
5174 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5178 /* Attempt a saving throw */
5179 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5183 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5185 note = "is unaffected!";
5195 if (seen) obvious = TRUE;
5198 msg_format("%s¤ò»Øº¹¤·¡¢¶²¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª",m_name);
5200 msg_format("You points at %s, incanting terribly!", m_name);
5203 if (r_ptr->flags3 & (RF3_RES_ALL))
5206 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5208 note = " is immune.";
5211 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5215 /* Attempt a saving throw */
5216 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5220 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5222 note = "is unaffected!";
5232 if (seen) obvious = TRUE;
5235 msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£",m_name);
5237 msg_format("You points at %s, screaming th word, 'DIE!'.", m_name);
5240 if (r_ptr->flags3 & (RF3_RES_ALL))
5243 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5245 note = " is immune.";
5248 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5252 /* Attempt a saving throw */
5253 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5257 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5259 note = "is unaffected!";
5269 if (seen) obvious = TRUE;
5271 if (r_ptr->flags3 & (RF3_RES_ALL))
5274 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5276 note = " is immune.";
5279 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5283 if (r_ptr->flags1 & RF1_UNIQUE)
5286 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5288 note = "is unaffected!";
5294 if ((p_ptr->lev + randint1(dam)) >
5295 (r_ptr->level + randint1(200)))
5297 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5299 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5304 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5314 /* Capture monster */
5318 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5319 (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_UNIQUE_7)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR))
5322 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5324 msg_format("%^s is unaffected.", m_name);
5330 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5331 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)))
5332 nokori_hp = m_ptr->maxhp * 3 / 10;
5334 nokori_hp = m_ptr->maxhp * 3 / 20;
5336 if (m_ptr->hp >= nokori_hp)
5339 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5341 msg_format("You need to weaken %s more.", m_name);
5345 else if (m_ptr->hp < randint0(nokori_hp))
5347 if (m_ptr->mflag2 & MFLAG_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5349 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5351 msg_format("You captures %^s!", m_name);
5353 cap_mon = m_list[c_ptr->m_idx].r_idx;
5354 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5355 cap_hp = m_list[c_ptr->m_idx].hp;
5356 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5357 if (m_list[c_ptr->m_idx].nickname)
5358 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5361 if (c_ptr->m_idx == p_ptr->riding)
5363 if (rakuba(-1, FALSE))
5366 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5368 msg_format("You have fallen from %s.", m_name);
5373 delete_monster_idx(c_ptr->m_idx);
5380 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5382 msg_format("You failed to capture %s.", m_name);
5391 if (seen) obvious = TRUE;
5393 if (dam == HISSATSU_NYUSIN)
5397 bool success = FALSE;
5398 for (i = 0; i < 8; i++)
5400 if (cave_empty_bold(y+ddy[i], x+ddx[i]) || ((y+ddy[i] == py) && (x+ddx[i] == px)))
5403 if (distance(py, px, ny, nx) > distance(py, px, y+ddy[i], x+ddx[i]))
5412 if ((ny != py) || (nx != px))
5414 teleport_player_to(ny, nx, FALSE);
5416 msg_print("ÁÇÁ᤯Áê¼ê¤Î²û¤ËÆþ¤ê¹þ¤ó¤À¡ª");
5418 msg_format("You quickly jump in and attack %s!", m_name);
5425 msg_print("¼ºÇÔ¡ª");
5427 msg_print("Failed!");
5434 return (py_attack(y, x, dam));
5437 msg_print("¹¶·â¤Ï¶õ¤òÀڤä¿¡£");
5439 msg_print("You attack the empty air.");
5445 /* Sleep (Use "dam" as "power") */
5451 if (seen) obvious = TRUE;
5453 if (r_ptr->flags3 & (RF3_RES_ALL))
5456 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5458 note = " is immune.";
5461 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5464 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5467 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5469 note = " is immune!";
5473 if (seen) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5479 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5481 note = " is immune!";
5488 if (one_in_(5)) effect = 1;
5489 else if (one_in_(4)) effect = 2;
5490 else if (one_in_(3)) effect = 3;
5495 /* Powerful monsters can resist */
5496 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5497 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5500 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5502 note = " is unaffected!";
5508 /* Normal monsters slow down */
5514 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5516 note = " starts moving slower.";
5519 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5521 if (c_ptr->m_idx == p_ptr->riding)
5522 p_ptr->update |= (PU_BONUS);
5526 else if (effect == 2)
5528 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5530 /* Attempt a saving throw */
5531 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5532 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5537 /* No obvious effect */
5539 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5541 note = " is unaffected!";
5548 else if (effect == 3)
5550 /* Attempt a saving throw */
5551 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5552 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5553 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5555 /* Memorize a flag */
5556 if (r_ptr->flags3 & RF3_NO_SLEEP)
5558 if (seen) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5561 /* No obvious effect */
5563 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5565 note = " is unaffected!";
5572 /* Go to sleep (much) later */
5574 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5576 note = " falls asleep!";
5586 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5588 note = " is immune!";
5592 /* No "real" damage */
5601 if (seen) obvious = TRUE;
5603 if (r_ptr->flags3 & (RF3_RES_ALL))
5606 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5608 note = " is immune.";
5611 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5615 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (c_ptr->m_idx == p_ptr->riding)) || p_ptr->inside_arena || p_ptr->inside_quest)
5622 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG_NOGENO))
5629 delete_monster_idx(c_ptr->m_idx);
5631 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5633 msg_format("%^s disappered!",m_name);
5637 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5639 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5643 chg_virtue(V_VITALITY, -1);
5648 p_ptr->redraw |= (PR_HP);
5651 p_ptr->window |= (PW_PLAYER);
5658 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5660 note = "is unaffected!";
5663 if (one_in_(13)) m_ptr->mflag2 |= MFLAG_NOGENO;
5671 msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£",m_name);
5673 msg_format("You take a photograph of %s.",m_name);
5676 if (r_ptr->flags3 & (RF3_HURT_LITE))
5678 /* Obvious effect */
5679 if (seen) obvious = TRUE;
5681 /* Memorize the effects */
5682 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5684 /* Special effect */
5686 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5687 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5689 note = " cringes from the light!";
5690 note_dies = " shrivels away in the light!";
5695 /* Normally no damage */
5702 photo = m_ptr->r_idx;
5709 case GF_BLOOD_CURSE:
5711 if (seen) obvious = TRUE;
5712 if (r_ptr->flags3 & (RF3_RES_ALL))
5715 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5717 note = " is immune.";
5720 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5728 bool success = FALSE;
5729 if (seen) obvious = TRUE;
5731 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5733 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5734 if (dam < 1) dam = 1;
5736 /* No need to tame your pet */
5740 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5742 note = " starts moving faster.";
5745 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5749 /* Attempt a saving throw */
5750 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5751 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5752 (m_ptr->mflag2 & MFLAG_NOPET) ||
5753 (p_ptr->cursed & TRC_AGGRAVATE) ||
5754 ((r_ptr->level+10) > randint1(dam)))
5757 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
5762 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5764 note = " is tamed!";
5768 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5770 /* Learn about type */
5771 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
5778 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5780 do_fear = randint1(90)+10;
5784 r_ptr->r_flags3 |= (RF3_NO_FEAR);
5788 /* No "real" damage */
5795 if (seen) obvious = TRUE;
5797 if (r_ptr->flags3 & (RF3_RES_ALL))
5800 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5802 note = " is immune.";
5805 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5809 /* Attempt a saving throw */
5810 if (randint0(100 + dam) < (r_ptr->level + 50))
5814 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5816 note = "is unaffected!";
5837 /* Absolutely no effect */
5838 if (skipped) return (FALSE);
5840 /* "Unique" monsters cannot be polymorphed */
5841 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5843 /* Quest monsters cannot be polymorphed */
5844 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5846 if (p_ptr->riding & (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5848 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5849 if (((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7) || (r_ptr->flags1 & RF1_QUESTOR)) && !p_ptr->inside_battle)
5851 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5856 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5857 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5860 /* Modify the damage */
5862 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5864 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤";
5866 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5869 /* Check for death */
5870 if (dam > m_ptr->hp)
5872 /* Extract method of death */
5876 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5877 else if (do_poly && (randint1(90) > r_ptr->level))
5879 if (polymorph_monster(y, x))
5882 if (seen) obvious = TRUE;
5884 /* Monster polymorphs */
5886 note = "¤¬ÊѿȤ·¤¿¡ª";
5892 /* Turn off the damage */
5895 /* Hack -- Get new monster */
5896 m_ptr = &m_list[c_ptr->m_idx];
5898 /* Hack -- Get new race */
5899 r_ptr = &r_info[m_ptr->r_idx];
5905 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5907 note = " is unaffected!";
5913 /* Handle "teleport" */
5917 if (seen) obvious = TRUE;
5921 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5923 note = " disappears!";
5926 chg_virtue(V_VALOUR, -1);
5929 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who));
5931 /* Hack -- get new location */
5935 /* Hack -- get new grid */
5936 c_ptr = &cave[y][x];
5939 /* Sound and Impact breathers never stun */
5941 !(r_ptr->flags4 & (RF4_BR_SOUN)) &&
5942 !(r_ptr->flags4 & (RF4_BR_WALL)) &&
5943 !(r_ptr->flags3 & (RF3_NO_STUN)))
5946 if (seen) obvious = TRUE;
5952 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5954 note = " is more dazed.";
5957 tmp = m_ptr->stunned + (do_stun / 2);
5962 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5964 note = " is dazed.";
5971 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5977 /* Confusion and Chaos breathers (and sleepers) never confuse */
5979 !(r_ptr->flags3 & (RF3_NO_CONF)) &&
5980 !(r_ptr->flags4 & (RF4_BR_CONF)) &&
5981 !(r_ptr->flags4 & (RF4_BR_CHAO)))
5984 if (seen) obvious = TRUE;
5986 /* Already partially confused */
5987 if (m_ptr->confused)
5990 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5992 note = " looks more confused.";
5995 tmp = m_ptr->confused + (do_conf / 2);
5998 /* Was not confused */
6002 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
6004 note = " looks confused.";
6010 /* Apply confusion */
6011 m_ptr->confused = (tmp < 200) ? tmp : 200;
6019 if (seen) obvious = TRUE;
6021 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp-1;
6026 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
6028 note = " seems weakened.";
6030 m_ptr->maxhp -= do_time;
6031 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp-m_ptr->maxhp;
6041 tmp = m_ptr->monfear + do_fear;
6044 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6051 /* If another monster did the damage, hurt the monster by hand */
6054 /* Redraw (later) if needed */
6055 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6056 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6058 /* Wake the monster up */
6061 /* Hurt the monster */
6069 if (is_pet(m_ptr) && !(m_ptr->ml))
6072 /* Give detailed messages if destroyed */
6075 monster_desc(m_name, m_ptr, 0x100);
6078 msg_format("%^s%s", m_name, note);
6086 monster_gain_exp(who, m_ptr->r_idx);
6088 /* Generate treasure, etc */
6089 monster_death(c_ptr->m_idx, FALSE);
6091 /* Delete the monster */
6092 delete_monster_idx(c_ptr->m_idx);
6097 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6099 msg_print("You feel sad for a moment.");
6105 /* Damaged monster */
6108 /* Give detailed messages if visible or destroyed */
6109 if (note && seen) msg_format("%^s%s", m_name, note);
6111 /* Hack -- Pain message */
6114 message_pain(c_ptr->m_idx, dam);
6121 /* Hack -- handle sleep */
6122 if (do_sleep) m_ptr->csleep = do_sleep;
6126 else if (heal_leper)
6129 msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6131 msg_print("The Mangy looking leper is healed!");
6134 delete_monster_idx(c_ptr->m_idx);
6136 /* If the player did it, give him experience, check fear */
6137 else if (typ != GF_DRAIN_MANA)
6141 /* Hurt the monster, check for fear and death */
6142 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6147 /* Damaged monster */
6150 /* HACK - anger the monster before showing the sleep message */
6151 if (do_sleep) anger_monster(m_ptr);
6153 /* Give detailed messages if visible or destroyed */
6156 msg_format("%s%s", m_name, note);
6158 msg_format("%^s%s", m_name, note);
6162 /* Hack -- Pain message */
6163 else if (known && (dam || !do_fear))
6165 message_pain(c_ptr->m_idx, dam);
6168 /* Anger monsters */
6169 if (((dam > 0) || get_angry) && !do_sleep)
6170 anger_monster(m_ptr);
6173 if ((fear || do_fear) && (m_ptr->ml))
6180 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6182 msg_format("%^s flees in terror!", m_name);
6187 /* Hack -- handle sleep */
6188 if (do_sleep) m_ptr->csleep = do_sleep;
6192 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6194 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6198 switch (randint1(28))
6204 msg_print("ÃÏÌ̤¬Íɤ줿...");
6206 msg_print("The ground trembles...");
6209 earthquake(ty, tx, 4 + randint0(4));
6210 if (!one_in_(6)) break;
6212 case 3: case 4: case 5: case 6:
6215 int dam = damroll(10, 10);
6217 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6219 msg_print("A portal opens to a plane of raw mana!");
6222 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6223 if (!one_in_(6)) break;
6229 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6231 msg_print("Space warps about you!");
6234 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE);
6235 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6236 if (!one_in_(6)) break;
6238 case 9: case 10: case 11:
6240 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6242 msg_print("You feel a surge of energy!");
6245 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6246 if (!one_in_(6)) break;
6247 case 12: case 13: case 14: case 15: case 16:
6248 aggravate_monsters(0);
6249 if (!one_in_(6)) break;
6251 count += activate_hi_summon(ty, tx, TRUE);
6252 if (!one_in_(6)) break;
6253 case 19: case 20: case 21: case 22:
6255 bool pet = !one_in_(3);
6256 u32b mode = PM_ALLOW_GROUP;
6258 if (pet) mode |= PM_FORCE_PET;
6259 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6261 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6262 if (!one_in_(6)) break;
6264 case 23: case 24: case 25:
6265 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6267 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6269 msg_print("You feel your life draining away...");
6272 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6273 else lose_exp(p_ptr->exp / 16);
6274 if (!one_in_(6)) break;
6275 case 26: case 27: case 28:
6284 (void)do_dec_stat(i);
6293 (void)do_dec_stat(randint0(6));
6302 if (p_ptr->inside_battle)
6304 p_ptr->health_who = c_ptr->m_idx;
6305 p_ptr->redraw |= (PR_HEALTH);
6309 /* XXX XXX XXX Verify this code */
6311 /* Update the monster */
6312 update_mon(c_ptr->m_idx, FALSE);
6314 /* Redraw the monster grid */
6318 /* Update monster recall window */
6319 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6322 p_ptr->window |= (PW_MONSTER);
6325 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6329 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6331 set_target(m_ptr, monster_target_y, monster_target_x);
6334 else if (is_pet(&m_list[who]) && (m_ptr->target_y != py) && (m_ptr->target_x != px))
6336 set_target(m_ptr, m_list[who].fy, m_list[who].fx);
6340 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6342 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6343 rakubadam_m = (dam > 200) ? 200 : dam;
6352 /* Get local object */
6355 /* Prepare to make a Blade of Chaos */
6356 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6358 q_ptr->pval = photo;
6360 /* Mark the item as fully known */
6361 q_ptr->ident |= (IDENT_MENTAL);
6363 /* Drop it in the dungeon */
6364 (void)drop_near(q_ptr, -1, py, px);
6372 /* Return "Anything seen?" */
6378 * Helper function for "project()" below.
6380 * Handle a beam/bolt/ball causing damage to the player.
6382 * This routine takes a "source monster" (by index), a "distance", a default
6383 * "damage", and a "damage type". See "project_m()" above.
6385 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6386 * is reduced (see "project_m()" above). This can happen if a monster breathes
6387 * at the player and hits a wall instead.
6389 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6390 * to know if this is actually a ball or a bolt spell
6393 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6394 * we just assume that the effects were obvious, for historical reasons.
6396 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6401 /* Hack -- assume obvious */
6402 bool obvious = TRUE;
6404 /* Player blind-ness */
6405 bool blind = (p_ptr->blind ? TRUE : FALSE);
6407 /* Player needs a "description" (he is blind) */
6410 /* Source monster */
6411 monster_type *m_ptr;
6413 /* Monster name (for attacks) */
6416 /* Monster name (for damage) */
6419 /* Hack -- messages */
6425 /* Player is not here */
6426 if ((x != px) || (y != py)) return (FALSE);
6428 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6434 /* Player cannot hurt himself */
6435 if (!who) return (FALSE);
6436 if (who == p_ptr->riding) return (FALSE);
6438 if ((p_ptr->reflect || p_ptr->tim_reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6441 int max_attempts = 10;
6444 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6445 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6446 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6448 if (blind) msg_print("Something bounces!");
6449 else msg_print("The attack bounces!");
6453 /* Choose 'new' target */
6456 t_y = m_list[who].fy - 1 + randint1(3);
6457 t_x = m_list[who].fx - 1 + randint1(3);
6460 while (max_attempts && in_bounds2u(t_y, t_x) &&
6461 !(player_has_los_bold(t_y, t_x)));
6463 if (max_attempts < 1)
6465 t_y = m_list[who].fy;
6466 t_x = m_list[who].fx;
6469 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6476 /* Limit maximum damage */
6477 if (dam > 1600) dam = 1600;
6479 /* Reduce damage by distance */
6480 dam = (dam + r) / (r + 1);
6483 /* If the player is blind, be more descriptive */
6484 if (blind) fuzzy = TRUE;
6487 /* Get the source monster */
6488 m_ptr = &m_list[who];
6489 /* Extract the monster level */
6490 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6492 /* Get the monster name */
6493 monster_desc(m_name, m_ptr, 0);
6495 /* Get the monster's real name (gotten before polymorph!) */
6496 strcpy(killer, who_name);
6498 /* Analyze the damage */
6501 /* Standard damage -- hurts inventory too */
6505 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6507 if (fuzzy) msg_print("You are hit by acid!");
6510 get_damage = acid_dam(dam, killer, monspell);
6514 /* Standard damage -- hurts inventory too */
6518 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6520 if (fuzzy) msg_print("You are hit by fire!");
6523 get_damage = fire_dam(dam, killer, monspell);
6527 /* Standard damage -- hurts inventory too */
6531 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6533 if (fuzzy) msg_print("You are hit by cold!");
6536 get_damage = cold_dam(dam, killer, monspell);
6540 /* Standard damage -- hurts inventory too */
6544 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6546 if (fuzzy) msg_print("You are hit by lightning!");
6549 get_damage = elec_dam(dam, killer, monspell);
6553 /* Standard damage -- also poisons player */
6556 bool double_resist = (p_ptr->oppose_pois || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU));
6558 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6560 if (fuzzy) msg_print("You are hit by poison!");
6563 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6564 if (double_resist) dam = (dam + 2) / 3;
6566 if ((!(double_resist || p_ptr->resist_pois)) &&
6567 one_in_(HURT_CHANCE))
6572 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6574 if (!(double_resist || p_ptr->resist_pois))
6576 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6581 /* Standard damage -- also poisons / mutates player */
6584 bool double_resist = (p_ptr->oppose_pois || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU));
6586 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6588 if (fuzzy) msg_print("You are hit by radiation!");
6591 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6592 if (double_resist) dam = (2 * dam + 2) / 5;
6593 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6594 if (!(double_resist || p_ptr->resist_pois))
6596 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6598 if (one_in_(5)) /* 6 */
6601 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6603 msg_print("You undergo a freakish metamorphosis!");
6606 if (one_in_(4)) /* 4 */
6614 inven_damage(set_acid_destroy, 2);
6620 /* Standard damage */
6624 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6626 if (fuzzy) msg_print("You are hit by something!");
6629 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6633 /* Holy Orb -- Player only takes partial damage */
6637 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6639 if (fuzzy) msg_print("You are hit by something!");
6642 if (p_ptr->align > 10)
6644 else if (p_ptr->align < -10)
6646 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6653 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6655 if (fuzzy) msg_print("You are hit by something!");
6658 if (p_ptr->align > 10)
6660 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6664 /* Arrow -- XXX no dodging */
6668 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6670 if (fuzzy) msg_print("You are hit by something sharp!");
6673 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6676 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6678 msg_print("You cut down the arrow!");
6682 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6686 /* Plasma -- XXX No resist */
6690 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6692 if (fuzzy) msg_print("You are hit by something *HOT*!");
6695 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6697 if (!p_ptr->resist_sound)
6699 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6700 (void)set_stun(p_ptr->stun + k);
6703 if (!(p_ptr->resist_fire ||
6704 p_ptr->oppose_fire ||
6705 music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU) ||
6706 p_ptr->immune_fire))
6708 inven_damage(set_acid_destroy, 3);
6714 /* Nether -- drain experience */
6718 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6720 if (fuzzy) msg_print("You are hit by nether forces!");
6724 if (p_ptr->resist_neth)
6726 if (!prace_is_(RACE_SPECTRE))
6727 dam *= 6; dam /= (randint1(4) + 7);
6729 else if (p_ptr->prace != RACE_ANDROID)
6731 if (p_ptr->hold_life && (randint0(100) < 75))
6734 msg_print("¤·¤«¤·¼«¸Ê¤ÎÀ¸Ì¿ÎϤò¼é¤ê¤¤Ã¤¿¡ª");
6736 msg_print("You keep hold of your life force!");
6740 else if (p_ptr->hold_life)
6743 msg_print("À¸Ì¿ÎϤ¬¾¯¤·ÂΤ«¤éÈ´¤±Íî¤Á¤¿µ¤¤¬¤¹¤ë¡ª");
6745 msg_print("You feel your life slipping away!");
6748 lose_exp(200 + (p_ptr->exp / 1000) * MON_DRAIN_LIFE);
6753 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6755 msg_print("You feel your life draining away!");
6758 lose_exp(200 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
6762 if (prace_is_(RACE_SPECTRE))
6765 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6767 msg_print("You feel invigorated!");
6771 learn_spell(monspell);
6775 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6781 /* Water -- stun/confuse */
6785 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6787 if (fuzzy) msg_print("You are hit by something wet!");
6790 if (!p_ptr->resist_sound)
6792 set_stun(p_ptr->stun + randint1(40));
6794 if (!p_ptr->resist_conf)
6796 set_confused(p_ptr->confused + randint1(5) + 5);
6801 inven_damage(set_cold_destroy, 3);
6804 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6808 /* Chaos -- many effects */
6812 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6814 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6817 if (p_ptr->resist_chaos)
6819 dam *= 6; dam /= (randint1(4) + 7);
6821 if (!p_ptr->resist_conf)
6823 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6825 if (!p_ptr->resist_chaos)
6827 (void)set_image(p_ptr->image + randint1(10));
6831 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6833 msg_print("Your body is twisted by chaos!");
6836 (void)gain_random_mutation(0);
6839 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6841 if (p_ptr->prace == RACE_ANDROID)
6844 else if (p_ptr->hold_life && (randint0(100) < 75))
6847 msg_print("¤·¤«¤·¼«¸Ê¤ÎÀ¸Ì¿ÎϤò¼é¤ê¤¤Ã¤¿¡ª");
6849 msg_print("You keep hold of your life force!");
6853 else if (p_ptr->hold_life)
6856 msg_print("À¸Ì¿ÎϤ¬¾¯¤·ÂΤ«¤éÈ´¤±Íî¤Á¤¿µ¤¤¬¤¹¤ë¡ª");
6858 msg_print("You feel your life slipping away!");
6861 lose_exp(500 + (p_ptr->exp / 1000) * MON_DRAIN_LIFE);
6866 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6868 msg_print("You feel your life draining away!");
6871 lose_exp(5000 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
6874 if (!p_ptr->resist_chaos || one_in_(9))
6876 inven_damage(set_elec_destroy, 2);
6877 inven_damage(set_fire_destroy, 2);
6879 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6883 /* Shards -- mostly cutting */
6887 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6889 if (fuzzy) msg_print("You are hit by something sharp!");
6892 if (p_ptr->resist_shard)
6894 dam *= 6; dam /= (randint1(4) + 7);
6898 (void)set_cut(p_ptr->cut + dam);
6901 if (!p_ptr->resist_shard || one_in_(13))
6903 inven_damage(set_cold_destroy, 2);
6906 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6910 /* Sound -- mostly stunning */
6914 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6916 if (fuzzy) msg_print("You are hit by a loud noise!");
6919 if (p_ptr->resist_sound)
6921 dam *= 5; dam /= (randint1(4) + 7);
6925 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6926 (void)set_stun(p_ptr->stun + k);
6929 if (!p_ptr->resist_sound || one_in_(13))
6931 inven_damage(set_cold_destroy, 2);
6934 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6938 /* Pure confusion */
6942 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6944 if (fuzzy) msg_print("You are hit by something puzzling!");
6947 if (p_ptr->resist_conf)
6949 dam *= 5; dam /= (randint1(4) + 7);
6951 if (!p_ptr->resist_conf)
6953 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6955 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6959 /* Disenchantment -- see above */
6963 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6965 if (fuzzy) msg_print("You are hit by something static!");
6968 if (p_ptr->resist_disen)
6970 dam *= 6; dam /= (randint1(4) + 7);
6974 (void)apply_disenchant(0);
6976 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6980 /* Nexus -- see above */
6984 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6986 if (fuzzy) msg_print("You are hit by something strange!");
6989 if (p_ptr->resist_nexus)
6991 dam *= 6; dam /= (randint1(4) + 7);
6997 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7001 /* Force -- mostly stun */
7005 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7007 if (fuzzy) msg_print("You are hit by kinetic force!");
7010 if (!p_ptr->resist_sound)
7012 (void)set_stun(p_ptr->stun + randint1(20));
7014 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7019 /* Rocket -- stun, cut */
7023 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
7025 if (fuzzy) msg_print("There is an explosion!");
7028 if (!p_ptr->resist_sound)
7030 (void)set_stun(p_ptr->stun + randint1(20));
7032 if (p_ptr->resist_shard)
7038 (void)set_cut(p_ptr-> cut + ( dam / 2));
7041 if ((!p_ptr->resist_shard) || one_in_(12))
7043 inven_damage(set_cold_destroy, 3);
7046 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7050 /* Inertia -- slowness */
7054 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7056 if (fuzzy) msg_print("You are hit by something slow!");
7059 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7060 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7064 /* Lite -- blinding */
7068 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7070 if (fuzzy) msg_print("You are hit by something!");
7073 if (p_ptr->resist_lite)
7075 dam *= 4; dam /= (randint1(4) + 7);
7077 else if (!blind && !p_ptr->resist_blind)
7079 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7081 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
7084 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
7086 msg_print("The light scorches your flesh!");
7091 else if (prace_is_(RACE_S_FAIRY))
7095 if (p_ptr->wraith_form) dam *= 2;
7096 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7098 if (p_ptr->wraith_form)
7100 p_ptr->wraith_form = 0;
7102 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7104 msg_print("The light forces you out of your incorporeal shadow form.");
7107 p_ptr->redraw |= PR_MAP;
7108 /* Update monsters */
7109 p_ptr->update |= (PU_MONSTERS);
7111 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7113 /* Redraw status bar */
7114 p_ptr->redraw |= (PR_STATUS);
7121 /* Dark -- blinding */
7125 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7127 if (fuzzy) msg_print("You are hit by something!");
7130 if (p_ptr->resist_dark)
7132 dam *= 4; dam /= (randint1(4) + 7);
7134 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7136 else if (!blind && !p_ptr->resist_blind)
7138 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7140 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7144 /* Time -- bolt fewer effects XXX */
7148 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7150 if (fuzzy) msg_print("You are hit by a blast from the past!");
7153 if (p_ptr->resist_time)
7156 dam /= (randint1(4) + 7);
7158 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7160 msg_print("You feel as if time is passing you by.");
7166 switch (randint1(10))
7168 case 1: case 2: case 3: case 4: case 5:
7170 if (p_ptr->prace == RACE_ANDROID) break;
7172 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7174 msg_print("You feel life has clocked back.");
7177 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7181 case 6: case 7: case 8: case 9:
7183 switch (randint1(6))
7186 case 1: k = A_STR; act = "¶¯¤¯"; break;
7187 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7188 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7189 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7190 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7191 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7193 case 1: k = A_STR; act = "strong"; break;
7194 case 2: k = A_INT; act = "bright"; break;
7195 case 3: k = A_WIS; act = "wise"; break;
7196 case 4: k = A_DEX; act = "agile"; break;
7197 case 5: k = A_CON; act = "hale"; break;
7198 case 6: k = A_CHR; act = "beautiful"; break;
7204 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7206 msg_format("You're not as %s as you used to be...", act);
7210 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7211 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7212 p_ptr->update |= (PU_BONUS);
7219 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7221 msg_print("You're not as powerful as you used to be...");
7225 for (k = 0; k < 6; k++)
7227 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7228 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7230 p_ptr->update |= (PU_BONUS);
7236 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7240 /* Gravity -- stun plus slowness plus teleport */
7244 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7245 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7247 if (fuzzy) msg_print("You are hit by something heavy!");
7248 msg_print("Gravity warps around you.");
7253 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7254 if (!(p_ptr->resist_sound || p_ptr->ffall))
7256 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7257 (void)set_stun(p_ptr->stun + k);
7261 dam = (dam * 2) / 3;
7264 if (!p_ptr->ffall || one_in_(13))
7266 inven_damage(set_cold_destroy, 2);
7269 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7273 /* Standard damage */
7274 case GF_DISINTEGRATE:
7277 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7279 if (fuzzy) msg_print("You are hit by pure energy!");
7282 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7289 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7291 if (fuzzy) msg_print("You are hit by something invigorating!");
7294 (void)hp_player(dam);
7302 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7304 if (fuzzy) msg_print("You are hit by something!");
7307 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7315 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7317 if (fuzzy) msg_print("You are hit by something slow!");
7320 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7326 if (p_ptr->free_act) break;
7328 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7330 if (fuzzy) msg_print("You fall asleep!");
7334 if (ironman_nightmare)
7337 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7339 msg_print("A horrible vision enters your mind.");
7343 /* Pick a nightmare */
7344 get_mon_num_prep(get_nightmare, NULL);
7346 /* Have some nightmares */
7347 have_nightmare(get_mon_num(MAX_DEPTH));
7349 /* Remove the monster restriction */
7350 get_mon_num_prep(NULL, NULL);
7353 set_paralyzed(p_ptr->paralyzed + dam);
7364 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7366 if (fuzzy) msg_print("You are hit by an aura of magic!");
7369 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7377 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7379 if (fuzzy) msg_print("You are hit by an energy!");
7382 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7390 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7392 if (fuzzy) msg_print("Something falls from the sky on you!");
7395 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7396 if (!p_ptr->resist_shard || one_in_(13))
7398 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7399 inven_damage(set_cold_destroy, 2);
7405 /* Ice -- cold plus stun plus cuts */
7409 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7411 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7414 cold_dam(dam, killer, monspell);
7415 if (!p_ptr->resist_shard)
7417 (void)set_cut(p_ptr->cut + damroll(5, 8));
7419 if (!p_ptr->resist_sound)
7421 (void)set_stun(p_ptr->stun + randint1(15));
7424 if ((!(p_ptr->resist_cold || p_ptr->oppose_cold || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))) || one_in_(12))
7426 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7436 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7438 if (fuzzy) msg_print("You are hit by something extremely cold!");
7442 if (p_ptr->mimic_form)
7444 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7445 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7450 switch (p_ptr->prace)
7452 /* Some races are immune */
7466 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7478 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7481 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7483 msg_print("You resist the effects!");
7485 learn_spell(MS_MIND_BLAST);
7490 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7492 msg_print("Your mind is blasted by psyonic energy.");
7495 if (!p_ptr->resist_conf)
7497 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7500 if (!p_ptr->resist_chaos && one_in_(3))
7502 (void)set_image(p_ptr->image + randint0(250) + 150);
7509 p_ptr->csp_frac = 0;
7511 p_ptr->redraw |= PR_MANA;
7513 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_MIND_BLAST);
7518 case GF_BRAIN_SMASH:
7520 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7523 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7525 msg_print("You resist the effects!");
7527 learn_spell(MS_BRAIN_SMASH);
7532 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7534 msg_print("Your mind is blasted by psionic energy.");
7541 p_ptr->csp_frac = 0;
7543 p_ptr->redraw |= PR_MANA;
7545 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_BRAIN_SMASH);
7546 if (!p_ptr->resist_blind)
7548 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7550 if (!p_ptr->resist_conf)
7552 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7554 if (!p_ptr->free_act)
7556 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7558 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7560 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7561 (void)do_dec_stat(A_INT);
7562 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7563 (void)do_dec_stat(A_WIS);
7565 if (!p_ptr->resist_chaos)
7567 (void)set_image(p_ptr->image + randint0(250) + 150);
7575 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7578 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7580 msg_print("You resist the effects!");
7582 learn_spell(MS_CAUSE_1);
7586 curse_equipment(15, 0);
7587 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_1);
7594 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7597 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7599 msg_print("You resist the effects!");
7601 learn_spell(MS_CAUSE_2);
7605 curse_equipment(25, MIN(rlev/2-15, 5));
7606 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_2);
7613 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7616 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7618 msg_print("You resist the effects!");
7620 learn_spell(MS_CAUSE_3);
7624 curse_equipment(33, MIN(rlev/2-15, 15));
7625 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_3);
7632 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7635 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7637 msg_print("You resist the effects!");
7639 learn_spell(MS_CAUSE_4);
7643 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_4);
7644 (void)set_cut(p_ptr->cut + damroll(10, 10));
7651 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7654 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7656 msg_format("You resist the effects!");
7658 learn_spell(MS_HAND_DOOM);
7664 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7666 msg_print("Your feel your life fade away!");
7669 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, MS_HAND_DOOM);
7670 curse_equipment(40, 20);
7672 if (p_ptr->chp < 1) p_ptr->chp = 1;
7687 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7690 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7692 char m_name_self[80];
7695 monster_desc(m_name_self, m_ptr, 0x23);
7697 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7699 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7700 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7703 if (p_ptr->riding && dam > 0)
7705 rakubadam_p = (dam > 200) ? 200 : dam;
7713 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7719 /* Return "Anything seen?" */
7725 * Find the distance from (x, y) to a line.
7727 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7729 /* Vector from (x, y) to (x1, y1) */
7738 int pd = distance(y1, x1, y, x);
7739 int nd = distance(y1, x1, y2, x2);
7741 if (pd > nd) return distance(y, x, y2, x2);
7743 /* Component of P on N */
7744 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7746 /* Absolute value */
7747 return((nd >= 0) ? nd : 0 - nd);
7754 * Modified version of los() for calculation of disintegration balls.
7755 * Disintegration effects are stopped by permanent walls.
7757 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7777 /* Slope, or 1/Slope, of LOS */
7781 /* Extract the offset */
7785 /* Extract the absolute offset */
7790 /* Handle adjacent (or identical) grids */
7791 if ((ax < 2) && (ay < 2)) return (TRUE);
7794 /* Paranoia -- require "safe" origin */
7795 /* if (!in_bounds(y1, x1)) return (FALSE); */
7798 /* Directly South/North */
7801 /* South -- check for walls */
7804 for (ty = y1 + 1; ty < y2; ty++)
7806 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7810 /* North -- check for walls */
7813 for (ty = y1 - 1; ty > y2; ty--)
7815 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7823 /* Directly East/West */
7826 /* East -- check for walls */
7829 for (tx = x1 + 1; tx < x2; tx++)
7831 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7835 /* West -- check for walls */
7838 for (tx = x1 - 1; tx > x2; tx--)
7840 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7849 /* Extract some signs */
7850 sx = (dx < 0) ? -1 : 1;
7851 sy = (dy < 0) ? -1 : 1;
7854 /* Vertical "knights" */
7859 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7863 /* Horizontal "knights" */
7868 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7873 /* Calculate scale factor div 2 */
7876 /* Calculate scale factor */
7880 /* Travel horizontally */
7883 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7889 /* Consider the special case where slope == 1. */
7900 /* Note (below) the case (qy == f2), where */
7901 /* the LOS exactly meets the corner of a tile. */
7904 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7915 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7928 /* Travel vertically */
7931 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7947 /* Note (below) the case (qx == f2), where */
7948 /* the LOS exactly meets the corner of a tile. */
7951 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7962 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7982 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)
7995 while (bdis <= distance(y1, x1, y2, x2) + rad)
7997 /* Travel from center outward */
7998 for (cdis = 0; cdis <= brad; cdis++)
8001 /* Scan the maximal blast area of radius "cdis" */
8002 for (y = by - cdis; y <= by + cdis; y++)
8004 for (x = bx - cdis; x <= bx + cdis; x++)
8006 /* Ignore "illegal" locations */
8007 if (!in_bounds(y, x)) continue;
8009 /* Enforce a circular "ripple" */
8010 if (distance(y1, x1, y, x) != bdis) continue;
8012 /* Enforce an arc */
8013 if (distance(by, bx, y, x) != cdis) continue;
8017 /* Disintegration balls explosions are stopped by perma-walls */
8018 if (!in_disintegration_range(by, bx, y, x)) continue;
8020 /* Disintegration destroys mirrors. */
8022 if (real_breath && cave_valid_bold(y, x) &&
8023 (cave[y][x].feat < FEAT_PATTERN_START ||
8024 cave[y][x].feat > FEAT_PATTERN_XTRA2) &&
8025 (cave[y][x].feat < FEAT_DEEP_WATER ||
8026 cave[y][x].feat > FEAT_GRASS))
8028 if (cave[y][x].feat == FEAT_TREES)
8029 cave_set_feat(y, x, FEAT_GRASS);
8032 cave[y][x].feat = floor_type[randint0(100)];
8035 /* Update some things -- similar to GF_KILL_WALL */
8036 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
8040 /* The blast is stopped by walls */
8041 if (!los(by, bx, y, x)) continue;
8044 /* Save this grid */
8052 /* Encode some more "radius" info */
8053 gm[bdis + 1] = *pgrids;
8056 if ((by == y2) && (bx == x2)) done = TRUE;
8065 /* Ripple outwards */
8066 /* mmove2(&by, &bx, y1, x1, y2, x2); */
8068 by = GRID_Y(path_g[bdis]);
8069 bx = GRID_X(path_g[bdis]);
8071 /* Find the next ripple */
8074 /* Increase the size */
8075 brad = (rad * bdis) / dist;
8078 /* Store the effect size */
8084 * Generic "beam"/"bolt"/"ball" projection routine.
8087 * who: Index of "source" monster (zero for "player")
8088 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8089 * y,x: Target location (or location to travel "towards")
8090 * dam: Base damage roll to apply to affected monsters (or player)
8091 * typ: Type of damage to apply to monsters (and objects)
8092 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8095 * TRUE if any "effects" of the projection were observed, else FALSE
8097 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8098 * towards a given location (optionally passing over the heads of interposing
8099 * monsters), and have it do a given amount of damage to the monsters (and
8100 * optionally objects) within the given radius of the final location.
8102 * A "bolt" travels from source to target and affects only the target grid.
8103 * A "beam" travels from source to target, affecting all grids passed through.
8104 * A "ball" travels from source to the target, exploding at the target, and
8105 * affecting everything within the given radius of the target location.
8107 * Traditionally, a "bolt" does not affect anything on the ground, and does
8108 * not pass over the heads of interposing monsters, much like a traditional
8109 * missile, and will "stop" abruptly at the "target" even if no monster is
8110 * positioned there, while a "ball", on the other hand, passes over the heads
8111 * of monsters between the source and target, and affects everything except
8112 * the source monster which lies within the final radius, while a "beam"
8113 * affects every monster between the source and target, except for the casting
8114 * monster (or player), and rarely affects things on the ground.
8116 * Two special flags allow us to use this function in special ways, the
8117 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8118 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8119 * actually projecting from the source monster (or player).
8121 * The player will only get "experience" for monsters killed by himself
8122 * Unique monsters can only be destroyed by attacks from the player
8124 * Only 256 grids can be affected per projection, limiting the effective
8125 * "radius" of standard ball attacks to nine units (diameter nineteen).
8127 * One can project in a given "direction" by combining PROJECT_THRU with small
8128 * offsets to the initial location (see "line_spell()"), or by calculating
8129 * "virtual targets" far away from the player.
8131 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8132 * continuing until it actually hits somethings (useful for "stone to mud").
8134 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8136 * Balls must explode BEFORE hitting walls, or they would affect monsters
8137 * on both sides of a wall. Some bug reports indicate that this is still
8138 * happening in 2.7.8 for Windows, though it appears to be impossible.
8140 * We "pre-calculate" the blast area only in part for efficiency.
8141 * More importantly, this lets us do "explosions" from the "inside" out.
8142 * This results in a more logical distribution of "blast" treasure.
8143 * It also produces a better (in my opinion) animation of the explosion.
8144 * It could be (but is not) used to have the treasure dropped by monsters
8145 * in the middle of the explosion fall "outwards", and then be damaged by
8146 * the blast as it spreads outwards towards the treasure drop location.
8148 * Walls and doors are included in the blast area, so that they can be
8149 * "burned" or "melted" in later versions.
8151 * This algorithm is intended to maximize simplicity, not necessarily
8152 * efficiency, since this function is not a bottleneck in the code.
8154 * We apply the blast effect from ground zero outwards, in several passes,
8155 * first affecting features, then objects, then monsters, then the player.
8156 * This allows walls to be removed before checking the object or monster
8157 * in the wall, and protects objects which are dropped by monsters killed
8158 * in the blast, and allows the player to see all affects before he is
8159 * killed or teleported away. The semantics of this method are open to
8160 * various interpretations, but they seem to work well in practice.
8162 * We process the blast area from ground-zero outwards to allow for better
8163 * distribution of treasure dropped by monsters, and because it provides a
8164 * pleasing visual effect at low cost.
8166 * Note that the damage done by "ball" explosions decreases with distance.
8167 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8169 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8170 * the target, and then the damage "flows" along this beam of destruction.
8171 * The damage at every grid is the same as at the "center" of a "ball"
8172 * explosion, since the "beam" grids are treated as if they ARE at the
8173 * center of a "ball" explosion.
8175 * Currently, specifying "beam" plus "ball" means that locations which are
8176 * covered by the initial "beam", and also covered by the final "ball", except
8177 * for the final grid (the epicenter of the ball), will be "hit twice", once
8178 * by the initial beam, and once by the exploding ball. For the grid right
8179 * next to the epicenter, this results in 150% damage being done. The center
8180 * does not have this problem, for the same reason the final grid in a "beam"
8181 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8182 * grids which are covered by the "ball" will NOT work, as then they will
8183 * receive LESS damage than they should. Do not combine "beam" with "ball".
8185 * The array "gy[],gx[]" with current size "grids" is used to hold the
8186 * collected locations of all grids in the "blast area" plus "beam path".
8188 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8189 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8190 * first blast grid (see above) with radius "N" from the blast center. Note
8191 * that only the first gm[1] grids in the blast area thus take full damage.
8192 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8193 * number of blast grids.
8195 * Note that once the projection is complete, (y2,x2) holds the final location
8196 * of bolts/beams, and the "epicenter" of balls.
8198 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8199 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8200 * implementation of the "distance" function. Also, a bolt can be properly
8201 * viewed as a "ball" with a "rad" of "zero".
8203 * Note that if no "target" is reached before the beam/bolt/ball travels the
8204 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8205 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8207 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8208 * to move from point A to point B, even if the player cannot see part of the
8209 * projection path. Note that in general, the player will *always* see part
8210 * of the path, since it either starts at the player or ends on the player.
8212 * Hack -- we assume that every "projection" is "self-illuminating".
8214 * Hack -- when only a single monster is affected, we automatically track
8215 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8217 * Note that all projections now "explode" at their final destination, even
8218 * if they were being projected at a more distant destination. This means
8219 * that "ball" spells will *always* explode.
8221 * Note that we must call "handle_stuff()" after affecting terrain features
8222 * in the blast radius, in case the "illumination" of the grid was changed,
8223 * and "update_view()" and "update_monsters()" need to be called.
8225 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8234 int y_saver, x_saver; /* For reflecting monsters */
8236 int msec = delay_factor * delay_factor * delay_factor;
8238 /* Assume the player sees nothing */
8239 bool notice = FALSE;
8241 /* Assume the player has seen nothing */
8242 bool visual = FALSE;
8244 /* Assume the player has seen no blast grids */
8247 /* Assume to be a normal ball spell */
8248 bool breath = FALSE;
8250 /* Is the player blind? */
8251 bool blind = (p_ptr->blind ? TRUE : FALSE);
8253 bool old_hide = FALSE;
8255 /* Number of grids in the "path" */
8258 /* Actual grids in the "path" */
8261 /* Number of grids in the "blast area" (including the "beam" path) */
8264 /* Coordinates of the affected grids */
8265 byte gx[1024], gy[1024];
8267 /* Encoded "radius" info (see above) */
8270 /* Actual radius encoded in gm[] */
8275 /* Attacker's name (prepared before polymorph)*/
8278 /* Initialize by null string */
8284 /* Default target of monsterspell is player */
8285 monster_target_y=py;
8286 monster_target_x=px;
8288 /* Hack -- Jump to target */
8289 if (flg & (PROJECT_JUMP))
8294 /* Clear the flag */
8295 flg &= ~(PROJECT_JUMP);
8300 /* Start at player */
8307 /* Start at monster */
8310 x1 = m_list[who].fx;
8311 y1 = m_list[who].fy;
8312 monster_desc(who_name, &m_list[who], 0x288);
8325 /* Default "destination" */
8330 /* Hack -- verify stuff */
8331 if (flg & (PROJECT_THRU))
8333 if ((x1 == x2) && (y1 == y2))
8335 flg &= ~(PROJECT_THRU);
8339 /* Handle a breath attack */
8344 if (flg & PROJECT_HIDE) old_hide = TRUE;
8345 flg |= PROJECT_HIDE;
8349 /* Hack -- Assume there will be no blast (max radius 32) */
8350 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8358 /* Collect beam grids */
8359 if (flg & (PROJECT_BEAM))
8366 if (breath && typ == GF_DISINTEGRATE)
8368 flg |= (PROJECT_DISI);
8371 /* Calculate the projection path */
8373 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8375 /* Hack -- Handle stuff */
8378 /* Giga-Hack SEEKER & SUPER_RAY */
8380 if( typ == GF_SEEKER )
8390 for (i = 0; i < path_n; ++i)
8395 int ny = GRID_Y(path_g[i]);
8396 int nx = GRID_X(path_g[i]);
8407 /* Only do visuals if requested */
8408 if (!blind && !(flg & (PROJECT_HIDE)))
8410 /* Only do visuals if the player can "see" the bolt */
8411 if (panel_contains(y, x) && player_has_los_bold(y, x))
8418 /* Obtain the bolt pict */
8419 p = bolt_pict(oy, ox, y, x, typ);
8421 /* Extract attr/char */
8425 /* Visual effects */
8426 print_rel(c, a, y, x);
8427 move_cursor_relative(y, x);
8428 /*if (fresh_before)*/ Term_fresh();
8429 Term_xtra(TERM_XTRA_DELAY, msec);
8431 /*if (fresh_before)*/ Term_fresh();
8433 /* Display "beam" grids */
8434 if (flg & (PROJECT_BEAM))
8436 /* Obtain the explosion pict */
8437 p = bolt_pict(y, x, y, x, typ);
8439 /* Extract attr/char */
8443 /* Visual effects */
8444 print_rel(c, a, y, x);
8447 /* Hack -- Activate delay */
8451 /* Hack -- delay anyway for consistency */
8454 /* Delay for consistency */
8455 Term_xtra(TERM_XTRA_DELAY, msec);
8458 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8459 if( (cave[y][x].info & CAVE_IN_MIRROR))
8461 /* The target of monsterspell becomes tha mirror(broken) */
8462 monster_target_y=(s16b)y;
8463 monster_target_x=(s16b)x;
8466 next_mirror( &oy,&ox,y,x );
8468 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8469 for( j = last_i; j <=i ; j++ )
8471 y = GRID_Y(path_g[j]);
8472 x = GRID_X(path_g[j]);
8473 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8474 if(!who && (project_m_n==1) && !jump ){
8475 if(cave[project_m_y][project_m_x].m_idx >0 ){
8476 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8478 /* Hack -- auto-recall */
8479 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8481 /* Hack - auto-track */
8482 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8485 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8490 for( i = last_i ; i < path_n ; i++ )
8493 y = GRID_Y(path_g[i]);
8494 x = GRID_X(path_g[i]);
8495 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8497 if(!who && (project_m_n==1) && !jump ){
8498 if(cave[project_m_y][project_m_x].m_idx >0 ){
8499 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8501 /* Hack -- auto-recall */
8502 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8504 /* Hack - auto-track */
8505 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8508 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8512 else if(typ == GF_SUPER_RAY){
8514 int second_step = 0;
8521 for (i = 0; i < path_n; ++i)
8526 int ny = GRID_Y(path_g[i]);
8527 int nx = GRID_X(path_g[i]);
8538 /* Only do visuals if requested */
8539 if (!blind && !(flg & (PROJECT_HIDE)))
8541 /* Only do visuals if the player can "see" the bolt */
8542 if (panel_contains(y, x) && player_has_los_bold(y, x))
8549 /* Obtain the bolt pict */
8550 p = bolt_pict(oy, ox, y, x, typ);
8552 /* Extract attr/char */
8556 /* Visual effects */
8557 print_rel(c, a, y, x);
8558 move_cursor_relative(y, x);
8559 /*if (fresh_before)*/ Term_fresh();
8560 Term_xtra(TERM_XTRA_DELAY, msec);
8562 /*if (fresh_before)*/ Term_fresh();
8564 /* Display "beam" grids */
8565 if (flg & (PROJECT_BEAM))
8567 /* Obtain the explosion pict */
8568 p = bolt_pict(y, x, y, x, typ);
8570 /* Extract attr/char */
8574 /* Visual effects */
8575 print_rel(c, a, y, x);
8578 /* Hack -- Activate delay */
8582 /* Hack -- delay anyway for consistency */
8585 /* Delay for consistency */
8586 Term_xtra(TERM_XTRA_DELAY, msec);
8589 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8590 if( cave[y][x].feat == FEAT_RUBBLE ||
8591 cave[y][x].feat == FEAT_DOOR_HEAD ||
8592 cave[y][x].feat == FEAT_DOOR_TAIL ||
8593 (cave[y][x].feat >= FEAT_WALL_EXTRA &&
8594 cave[y][x].feat <= FEAT_PERM_SOLID ))
8596 if( second_step )continue;
8599 if( (cave[y][x].info & CAVE_IN_MIRROR) && !second_step )
8601 /* The target of monsterspell becomes tha mirror(broken) */
8602 monster_target_y=(s16b)y;
8603 monster_target_x=(s16b)x;
8606 for( j = 0; j <=i ; j++ )
8608 y = GRID_Y(path_g[j]);
8609 x = GRID_X(path_g[j]);
8610 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8614 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8615 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8616 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8617 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8618 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8619 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8620 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8621 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8624 for( i = 0; i < path_n ; i++ )
8627 y = GRID_Y(path_g[i]);
8628 x = GRID_X(path_g[i]);
8629 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8630 if(!who && (project_m_n==1) && !jump ){
8631 if(cave[project_m_y][project_m_x].m_idx >0 ){
8632 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8634 /* Hack -- auto-recall */
8635 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8637 /* Hack - auto-track */
8638 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8641 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8646 /* Project along the path */
8647 for (i = 0; i < path_n; ++i)
8652 int ny = GRID_Y(path_g[i]);
8653 int nx = GRID_X(path_g[i]);
8655 if (flg & PROJECT_DISI)
8657 /* Hack -- Balls explode before reaching walls */
8658 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8662 /* Hack -- Balls explode before reaching walls */
8663 if (!cave_floor_bold(ny, nx) && (rad > 0)) break;
8670 /* Collect beam grids */
8671 if (flg & (PROJECT_BEAM))
8678 /* Only do visuals if requested */
8679 if (!blind && !(flg & (PROJECT_HIDE)) && !(flg & PROJECT_FAST))
8681 /* Only do visuals if the player can "see" the bolt */
8682 if (panel_contains(y, x) && player_has_los_bold(y, x))
8689 /* Obtain the bolt pict */
8690 p = bolt_pict(oy, ox, y, x, typ);
8692 /* Extract attr/char */
8696 /* Visual effects */
8697 print_rel(c, a, y, x);
8698 move_cursor_relative(y, x);
8699 /*if (fresh_before)*/ Term_fresh();
8700 Term_xtra(TERM_XTRA_DELAY, msec);
8702 /*if (fresh_before)*/ Term_fresh();
8704 /* Display "beam" grids */
8705 if (flg & (PROJECT_BEAM))
8707 /* Obtain the explosion pict */
8708 p = bolt_pict(y, x, y, x, typ);
8710 /* Extract attr/char */
8714 /* Visual effects */
8715 print_rel(c, a, y, x);
8718 /* Hack -- Activate delay */
8722 /* Hack -- delay anyway for consistency */
8725 /* Delay for consistency */
8726 Term_xtra(TERM_XTRA_DELAY, msec);
8729 if ((typ == GF_ATTACK) && (dam == HISSATSU_NYUSIN) && ((i+1) == path_n))
8731 if (cave_empty_bold(y, x)) teleport_player_to(ny, nx, FALSE);
8736 /* Save the "blast epicenter" */
8740 if (breath && (y1 == y2) && (x1 == x2))
8746 flg &= ~(PROJECT_HIDE);
8750 /* Start the "explosion" */
8753 /* Hack -- make sure beams get to "explode" */
8761 /* If we found a "target", explode there */
8762 if (dist <= MAX_RANGE)
8764 /* Mega-Hack -- remove the final "beam" grid */
8765 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8768 * Create a conical breath attack
8779 flg &= ~(PROJECT_HIDE);
8781 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, y2, x2, (bool)(typ == GF_DISINTEGRATE), TRUE);
8785 /* Determine the blast area, work from the inside out */
8786 for (dist = 0; dist <= rad; dist++)
8788 /* Scan the maximal blast area of radius "dist" */
8789 for (y = y2 - dist; y <= y2 + dist; y++)
8791 for (x = x2 - dist; x <= x2 + dist; x++)
8793 /* Ignore "illegal" locations */
8794 if (!in_bounds2(y, x)) continue;
8796 /* Enforce a "circular" explosion */
8797 if (distance(y2, x2, y, x) != dist) continue;
8799 if (typ == GF_DISINTEGRATE)
8801 /* Disintegration balls explosions are stopped by perma-walls */
8802 if (!in_disintegration_range(y2, x2, y, x)) continue;
8804 if (cave_valid_bold(y, x) &&
8805 (cave[y][x].feat < FEAT_PATTERN_START ||
8806 cave[y][x].feat > FEAT_PATTERN_XTRA2) &&
8807 (cave[y][x].feat < FEAT_DEEP_WATER ||
8808 cave[y][x].feat > FEAT_GRASS))
8810 if (cave[y][x].feat == FEAT_TREES)
8811 cave_set_feat(y, x, FEAT_GRASS);
8814 cave[y][x].feat = floor_type[randint0(100)];
8818 /* Update some things -- similar to GF_KILL_WALL */
8819 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
8823 /* Ball explosions are stopped by walls */
8824 if (!los(y2, x2, y, x)) continue;
8827 /* Save this grid */
8834 /* Encode some more "radius" info */
8840 /* Speed -- ignore "non-explosions" */
8841 if (!grids) return (FALSE);
8844 /* Display the "blast area" if requested */
8845 if (!blind && !(flg & (PROJECT_HIDE)))
8847 /* Then do the "blast", from inside out */
8848 for (t = 0; t <= gm_rad; t++)
8850 /* Dump everything with this radius */
8851 for (i = gm[t]; i < gm[t+1]; i++)
8853 /* Extract the location */
8857 /* Only do visuals if the player can "see" the blast */
8858 if (panel_contains(y, x) && player_has_los_bold(y, x))
8867 /* Obtain the explosion pict */
8868 p = bolt_pict(y, x, y, x, typ);
8870 /* Extract attr/char */
8874 /* Visual effects -- Display */
8875 print_rel(c, a, y, x);
8879 /* Hack -- center the cursor */
8880 move_cursor_relative(y2, x2);
8882 /* Flush each "radius" seperately */
8883 /*if (fresh_before)*/ Term_fresh();
8885 /* Delay (efficiently) */
8886 if (visual || drawn)
8888 Term_xtra(TERM_XTRA_DELAY, msec);
8892 /* Flush the erasing */
8895 /* Erase the explosion drawn above */
8896 for (i = 0; i < grids; i++)
8898 /* Extract the location */
8902 /* Hack -- Erase if needed */
8903 if (panel_contains(y, x) && player_has_los_bold(y, x))
8909 /* Hack -- center the cursor */
8910 move_cursor_relative(y2, x2);
8912 /* Flush the explosion */
8913 /*if (fresh_before)*/ Term_fresh();
8918 /* Update stuff if needed */
8919 if (p_ptr->update) update_stuff();
8922 /* Check features */
8923 if (flg & (PROJECT_GRID))
8925 /* Start with "dist" of zero */
8928 /* Scan for features */
8929 for (i = 0; i < grids; i++)
8931 /* Hack -- Notice new "dist" values */
8932 if (gm[dist+1] == i) dist++;
8934 /* Get the grid location */
8938 /* Find the closest point in the blast */
8941 int d = dist_to_line(y, x, y1, x1, y2, x2);
8943 /* Affect the grid */
8944 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8948 /* Affect the grid */
8949 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8956 if (flg & (PROJECT_ITEM))
8958 /* Start with "dist" of zero */
8961 /* Scan for objects */
8962 for (i = 0; i < grids; i++)
8964 /* Hack -- Notice new "dist" values */
8965 if (gm[dist+1] == i) dist++;
8967 /* Get the grid location */
8971 /* Find the closest point in the blast */
8974 int d = dist_to_line(y, x, y1, x1, y2, x2);
8976 /* Affect the object in the grid */
8977 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8981 /* Affect the object in the grid */
8982 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8988 /* Check monsters */
8989 if (flg & (PROJECT_KILL))
8996 /* Start with "dist" of zero */
8999 /* Scan for monsters */
9000 for (i = 0; i < grids; i++)
9002 /* Hack -- Notice new "dist" values */
9003 if (gm[dist + 1] == i) dist++;
9005 /* Get the grid location */
9011 /* Find the closest point in the blast */
9014 int d = dist_to_line(y, x, y1, x1, y2, x2);
9016 /* Affect the monster in the grid */
9017 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
9019 if (project_m(who, d+1, y, x, dam, typ,flg)) notice = TRUE;
9021 else if (project_m(who, d, y, x, dam, typ,flg)) notice = TRUE;
9025 /* Affect the monster in the grid */
9026 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
9028 if (!(flg & PROJECT_BEAM))
9030 if (project_m(who, dist+1, y, x, dam, typ,flg)) notice = TRUE;
9033 else if (project_m(who, dist, y, x, dam, typ,flg)) notice = TRUE;
9038 monster_race *ref_ptr = &r_info[m_list[cave[y][x].m_idx].r_idx];
9040 if ((ref_ptr->flags2 & RF2_REFLECTING) && (!one_in_(10) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1)))
9043 int max_attempts = 10;
9045 /* Choose 'new' target */
9048 t_y = y_saver - 1 + randint1(3);
9049 t_x = x_saver - 1 + randint1(3);
9053 while (max_attempts && in_bounds2u(t_y, t_x) &&
9054 !(los(y, x, t_y, t_x)));
9056 if (max_attempts < 1)
9062 if (m_list[cave[y][x].m_idx].ml)
9065 if ((m_list[cave[y][x].m_idx].r_idx == MON_KENSHIROU)
9066 || (m_list[cave[y][x].m_idx].r_idx == MON_RAOU))
9067 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9068 if (m_list[cave[y][x].m_idx].r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9069 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9071 msg_print("The attack bounces!");
9074 ref_ptr->r_flags2 |= RF2_REFLECTING;
9076 flg &= ~(PROJECT_MONSTER | PROJECT_PLAYER);
9077 if (one_in_(2)) flg |= PROJECT_MONSTER;
9078 else flg |= PROJECT_PLAYER;
9080 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9084 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
9087 else if (project_m(who, dist, y, x, dam, typ,flg)) notice = TRUE;
9092 /* Player affected one monster (without "jumping") */
9093 if (!who && (project_m_n == 1) && !jump)
9099 /* Track if possible */
9100 if (cave[y][x].m_idx > 0)
9102 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9104 /* Hack -- auto-recall */
9105 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9107 /* Hack - auto-track */
9108 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9115 if (flg & (PROJECT_KILL))
9117 /* Start with "dist" of zero */
9120 /* Scan for player */
9121 for (i = 0; i < grids; i++)
9123 /* Hack -- Notice new "dist" values */
9124 if (gm[dist+1] == i) dist++;
9126 /* Get the grid location */
9130 /* Find the closest point in the blast */
9133 int d = dist_to_line(y, x, y1, x1, y2, x2);
9135 /* Affect the player */
9136 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_MONSTER))
9138 if (project_p(who, who_name, d+1, y, x, dam, typ, flg, monspell)) notice = TRUE;
9140 else if (project_p(who, who_name, d, y, x, dam, typ, flg, monspell)) notice = TRUE;
9144 /* Affect the player */
9145 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_MONSTER))
9147 if (!((flg & PROJECT_BEAM) || (flg & PROJECT_STOP)))
9149 if (project_p(who, who_name, dist+1, y, x, dam, typ, flg, monspell)) notice = TRUE;
9152 else if (project_p(who, who_name, dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9161 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9163 if (rakubadam_m > 0)
9165 if (rakuba(rakubadam_m, FALSE))
9168 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9170 msg_format("%^s has thrown you off!", m_name);
9174 if (p_ptr->riding && rakubadam_p > 0)
9176 if(rakuba(rakubadam_p, FALSE))
9179 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9181 msg_format("You have fallen from %s.", m_name);
9187 /* Return "something was noticed" */
9191 bool binding_field( int dam )
9193 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9194 int mirror_num=0; /* ¶À¤Î¿ô */
9199 int msec= delay_factor*delay_factor*delay_factor;
9205 /* Default target of monsterspell is player */
9206 monster_target_y=py;
9207 monster_target_x=px;
9209 for( x=0 ; x < cur_wid ; x++ )
9211 for( y=0 ; y < cur_hgt ; y++ )
9213 if( (cave[y][x].info & CAVE_IN_MIRROR) &&
9214 distance(py,px,y,x) <= MAX_RANGE &&
9215 distance(py,px,y,x) != 0 &&
9216 player_has_los_bold(y,x)
9218 mirror_y[mirror_num]=y;
9219 mirror_x[mirror_num]=x;
9225 if( mirror_num < 2 )return FALSE;
9227 point_x[0] = randint0( mirror_num );
9229 point_x[1] = randint0( mirror_num );
9231 while( point_x[0] == point_x[1] );
9233 point_y[0]=mirror_y[point_x[0]];
9234 point_x[0]=mirror_x[point_x[0]];
9235 point_y[1]=mirror_y[point_x[1]];
9236 point_x[1]=mirror_x[point_x[1]];
9240 x=point_x[0]+point_x[1]+point_x[2];
9241 y=point_y[0]+point_y[1]+point_y[2];
9243 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9244 - (point_y[0]*3-y)*(point_x[1]*3-x);
9245 if( centersign == 0 )return FALSE;
9247 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9248 x1 = x1 < point_x[2] ? x1 : point_x[2];
9249 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9250 y1 = y1 < point_y[2] ? y1 : point_y[2];
9252 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9253 x2 = x2 > point_x[2] ? x2 : point_x[2];
9254 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9255 y2 = y2 > point_y[2] ? y2 : point_y[2];
9257 for( y=y1 ; y <=y2 ; y++ ){
9258 for( x=x1 ; x <=x2 ; x++ ){
9259 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9260 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9261 centersign*( (point_x[1]-x)*(point_y[2]-y)
9262 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9263 centersign*( (point_x[2]-x)*(point_y[0]-y)
9264 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9266 if( player_has_los_bold(y,x)){
9267 /* Visual effects */
9269 && panel_contains(y,x)){
9270 p = bolt_pict(y,x,y,x, GF_MANA );
9271 print_rel(PICT_C(p), PICT_A(p),y,x);
9272 move_cursor_relative(y, x);
9273 /*if (fresh_before)*/ Term_fresh();
9274 Term_xtra(TERM_XTRA_DELAY, msec);
9280 for( y=y1 ; y <=y2 ; y++ ){
9281 for( x=x1 ; x <=x2 ; x++ ){
9282 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9283 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9284 centersign*( (point_x[1]-x)*(point_y[2]-y)
9285 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9286 centersign*( (point_x[2]-x)*(point_y[0]-y)
9287 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9289 if( player_has_los_bold(y,x)){
9290 (void)project_f(0,0,y,x,dam,GF_MANA);
9295 for( y=y1 ; y <=y2 ; y++ ){
9296 for( x=x1 ; x <=x2 ; x++ ){
9297 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9298 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9299 centersign*( (point_x[1]-x)*(point_y[2]-y)
9300 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9301 centersign*( (point_x[2]-x)*(point_y[0]-y)
9302 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9304 if( player_has_los_bold(y,x)){
9305 (void)project_o(0,0,y,x,dam,GF_MANA);
9310 for( y=y1 ; y <=y2 ; y++ ){
9311 for( x=x1 ; x <=x2 ; x++ ){
9312 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9313 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9314 centersign*( (point_x[1]-x)*(point_y[2]-y)
9315 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9316 centersign*( (point_x[2]-x)*(point_y[0]-y)
9317 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9319 if( player_has_los_bold(y,x) ){
9320 (void)project_m(0,0,y,x,dam,GF_MANA,
9321 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9328 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9330 msg_print("The field broke a mirror");
9332 remove_mirror(point_y[0],point_x[0]);
9338 void seal_of_mirror( int dam )
9342 for( x = 0 ; x < cur_wid ; x++ )
9344 for( y = 0 ; y < cur_hgt ; y++ )
9346 if( (cave[y][x].info & CAVE_IN_MIRROR))
9348 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9349 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9351 if( !cave[y][x].m_idx )