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))
736 /* Check line of sight */
740 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
742 msg_print("There is a bright flash of light!");
748 /* Forget the trap */
749 c_ptr->info &= ~(CAVE_MARK);
751 /* Destroy the trap */
752 if (c_ptr->info & CAVE_TRAP) c_ptr->info &= ~(CAVE_TRAP);
755 c_ptr->feat = floor_type[randint0(100)];
759 /* Locked doors are unlocked */
760 else if ((c_ptr->feat >= FEAT_DOOR_HEAD + 0x01) &&
761 (c_ptr->feat <= FEAT_DOOR_HEAD + 0x07))
763 /* Unlock the door */
764 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
766 /* Check line of sound */
770 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
785 /* Destroy Doors (and traps) */
788 /* Destroy all doors and traps */
789 if ((c_ptr->feat == FEAT_OPEN) ||
790 (c_ptr->feat == FEAT_BROKEN) ||
791 (c_ptr->info & CAVE_TRAP) ||
792 (is_trap(c_ptr->feat)) ||
793 ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
794 (c_ptr->feat <= FEAT_DOOR_TAIL)))
796 /* Check line of sight */
801 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
803 msg_print("There is a bright flash of light!");
808 /* Visibility change */
809 if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
810 (c_ptr->feat <= FEAT_DOOR_TAIL))
812 /* Update some things */
813 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
817 /* Forget the door */
818 c_ptr->info &= ~(CAVE_MARK);
820 /* Destroy the feature */
821 if (c_ptr->info & CAVE_TRAP) c_ptr->info &= ~(CAVE_TRAP);
824 c_ptr->feat = floor_type[randint0(100)];
834 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
836 if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
837 (c_ptr->feat <= FEAT_DOOR_TAIL))
839 /* Convert "locked" to "stuck" XXX XXX XXX */
840 if (c_ptr->feat < FEAT_DOOR_HEAD + 0x08) c_ptr->feat += 0x08;
842 /* Add one spike to the door */
843 if (c_ptr->feat < FEAT_DOOR_TAIL) c_ptr->feat++;
845 /* Check line of sight */
850 msg_print("²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ¥É¥¢¤¬³«¤«¤Ê¤¤¡£");
852 msg_print("The door seems stuck.");
861 /* Destroy walls (and doors) */
864 /* Non-walls (etc) */
865 if (cave_floor_bold(y, x)) break;
867 /* Permanent walls */
868 if (c_ptr->feat >= FEAT_PERM_EXTRA) break;
871 if (c_ptr->feat >= FEAT_WALL_EXTRA)
874 if (known && (c_ptr->info & (CAVE_MARK)))
877 msg_print("Êɤ¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
879 msg_print("The wall turns into mud!");
885 /* Forget the wall */
886 c_ptr->info &= ~(CAVE_MARK);
888 /* Destroy the wall */
889 c_ptr->feat = floor_type[randint0(100)];
892 /* Quartz / Magma with treasure */
893 else if (c_ptr->feat >= FEAT_MAGMA_H)
896 if (known && (c_ptr->info & (CAVE_MARK)))
899 msg_print("¹ÛÌ®¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
900 msg_print("²¿¤«¤òȯ¸«¤·¤¿¡ª");
902 msg_print("The vein turns into mud!");
903 msg_print("You have found something!");
909 /* Forget the wall */
910 c_ptr->info &= ~(CAVE_MARK);
912 /* Destroy the wall */
913 c_ptr->feat = floor_type[randint0(100)];
915 /* Place some gold */
920 else if (c_ptr->feat >= FEAT_MAGMA)
923 if (known && (c_ptr->info & (CAVE_MARK)))
926 msg_print("¹ÛÌ®¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
928 msg_print("The vein turns into mud!");
934 /* Forget the wall */
935 c_ptr->info &= ~(CAVE_MARK);
937 /* Destroy the wall */
938 c_ptr->feat = floor_type[randint0(100)];
942 else if (c_ptr->feat == FEAT_RUBBLE)
945 if (known && (c_ptr->info & (CAVE_MARK)))
948 msg_print("´äÀФ¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
950 msg_print("The rubble turns into mud!");
956 /* Forget the wall */
957 c_ptr->info &= ~(CAVE_MARK);
959 /* Destroy the rubble */
960 c_ptr->feat = floor_type[randint0(100)];
962 /* Hack -- place an object */
963 if (randint0(100) < 10)
965 /* Found something */
966 if (player_can_see_bold(y, x))
969 msg_print("´äÀФβ¼¤Ë²¿¤«±£¤µ¤ì¤Æ¤¤¤¿¡ª");
971 msg_print("There was something buried in the rubble!");
978 place_object(y, x, FALSE, FALSE);
982 /* Destroy doors (and secret doors) */
983 else /* if (c_ptr->feat >= FEAT_DOOR_HEAD) */
985 /* Hack -- special message */
986 if (known && (c_ptr->info & (CAVE_MARK)))
989 msg_print("¥É¥¢¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
991 msg_print("The door turns into mud!");
997 /* Forget the wall */
998 c_ptr->info &= ~(CAVE_MARK);
1000 /* Destroy the feature */
1001 c_ptr->feat = floor_type[randint0(100)];
1007 /* Update some things */
1008 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
1016 /* Require a "naked" floor grid */
1017 if (!cave_naked_bold(y, x)) break;
1019 /* Not on the player */
1020 if ((y == py) && (x == px)) break;
1022 /* Create a closed door */
1023 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
1026 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
1028 /* Update some things */
1029 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1037 /* Require a "naked" floor grid */
1038 if ((cave[y][x].feat != FEAT_FLOOR) &&
1039 (cave[y][x].feat != FEAT_GRASS) &&
1040 (cave[y][x].feat != FEAT_DIRT) &&
1041 (cave[y][x].o_idx == 0) &&
1042 (cave[y][x].m_idx == 0))
1054 /* Require a "naked" floor grid */
1055 if (!cave_naked_bold(y, x)) break;
1057 /* Not on the player */
1058 if ((y == py) && (x == px)) break;
1060 /* Create a closed door */
1061 cave_set_feat(y, x, FEAT_TREES);
1064 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
1066 /* Update some things */
1067 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1074 /* Require a "naked" floor grid */
1075 if (!cave_naked_bold(y, x)) break;
1077 cave_set_feat(y, x, FEAT_GLYPH);
1084 /* Require a "naked" floor grid */
1085 if (!cave_naked_bold(y, x)) break;
1087 /* Not on the player */
1088 if ((y == py) && (x == px)) break;
1091 cave_set_feat(y, x, FEAT_WALL_EXTRA);
1093 /* Update some things */
1094 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1105 /* Require a "naked" floor grid */
1106 if (!cave_naked_bold(y, x)) break;
1108 /* Place a shallow lava */
1109 cave_set_feat(y, x, FEAT_SHAL_LAVA);
1114 /* Require a "naked" floor grid */
1115 if (cave_perma_bold(y, x) || !dam) break;
1117 /* Place a deep lava */
1118 cave_set_feat(y, x, FEAT_DEEP_LAVA);
1120 /* Dam is used as a counter for the number of grid to convert */
1131 /* Require a "naked" floor grid */
1132 if (!cave_naked_bold(y, x)) break;
1134 /* Place a shallow lava */
1135 cave_set_feat(y, x, FEAT_SHAL_WATER);
1140 /* Require a "naked" floor grid */
1141 if (cave_perma_bold(y, x) || !dam) break;
1143 /* Place a deep lava */
1144 cave_set_feat(y, x, FEAT_DEEP_WATER);
1146 /* Dam is used as a counter for the number of grid to convert */
1152 /* Lite up the grid */
1156 /* Turn on the light */
1157 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) c_ptr->info |= (CAVE_GLOW);
1166 if (player_can_see_bold(y, x)) obvious = TRUE;
1168 /* Mega-Hack -- Update the monster in the affected grid */
1169 /* This allows "spear of light" (etc) to work "correctly" */
1170 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1175 /* Darken the grid */
1179 if (!p_ptr->inside_battle)
1182 if (player_can_see_bold(y, x)) obvious = TRUE;
1184 /* Turn off the light. */
1185 c_ptr->info &= ~(CAVE_GLOW);
1187 /* Hack -- Forget "boring" grids */
1188 if ((c_ptr->feat <= FEAT_INVIS) || (c_ptr->feat == FEAT_DIRT) || (c_ptr->feat == FEAT_GRASS))
1191 c_ptr->info &= ~(CAVE_MARK);
1200 /* Mega-Hack -- Update the monster in the affected grid */
1201 /* This allows "spear of light" (etc) to work "correctly" */
1202 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1211 if( (cave[y][x].info & CAVE_IN_MIRROR))
1214 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1216 msg_print("The mirror was chashed!");
1219 project(0,2,y,x, p_ptr->lev /2 +5 ,GF_SHARDS,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_REF|PROJECT_NO_HANGEKI),-1);
1225 if( (cave[y][x].info & CAVE_IN_MIRROR) && p_ptr->lev < 40 )
1228 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1230 msg_print("The mirror was chashed!");
1232 cave_set_feat(y,x, FEAT_FLOOR);
1239 /* Return "Anything seen?" */
1246 * We are called from "project()" to "damage" objects
1248 * We are called both for "beam" effects and "ball" effects.
1250 * Perhaps we should only SOMETIMES damage things on the ground.
1252 * The "r" parameter is the "distance from ground zero".
1254 * Note that we determine if the player can "see" anything that happens
1255 * by taking into account: blindness, line-of-sight, and illumination.
1257 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1259 * We return "TRUE" if the effect of the projection is "obvious".
1261 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1263 cave_type *c_ptr = &cave[y][x];
1265 s16b this_o_idx, next_o_idx = 0;
1267 bool obvious = FALSE;
1268 bool known = player_has_los_bold(y, x);
1272 char o_name[MAX_NLEN];
1275 bool is_potion = FALSE;
1279 who = who ? who : 0;
1281 /* Reduce damage by distance */
1282 dam = (dam + r) / (r + 1);
1285 /* Scan all objects in the grid */
1286 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1290 bool is_art = FALSE;
1291 bool ignore = FALSE;
1292 bool plural = FALSE;
1293 bool do_kill = FALSE;
1295 cptr note_kill = NULL;
1297 /* Acquire object */
1298 o_ptr = &o_list[this_o_idx];
1300 /* Acquire next object */
1301 next_o_idx = o_ptr->next_o_idx;
1303 /* Extract the flags */
1304 object_flags(o_ptr, &f1, &f2, &f3);
1306 /* Get the "plural"-ness */
1307 if (o_ptr->number > 1) plural = TRUE;
1309 /* Check for artifact */
1310 if ((artifact_p(o_ptr) || o_ptr->art_name)) is_art = TRUE;
1312 /* Analyze the type */
1315 /* Acid -- Lots of things */
1318 if (hates_acid(o_ptr))
1322 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1324 note_kill = (plural ? " melt!" : " melts!");
1327 if (f3 & (TR3_IGNORE_ACID)) ignore = TRUE;
1332 /* Elec -- Rings and Wands */
1335 if (hates_elec(o_ptr))
1339 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1341 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1344 if (f3 & (TR3_IGNORE_ELEC)) ignore = TRUE;
1349 /* Fire -- Flammable objects */
1352 if (hates_fire(o_ptr))
1356 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1358 note_kill = (plural ? " burn up!" : " burns up!");
1361 if (f3 & (TR3_IGNORE_FIRE)) ignore = TRUE;
1366 /* Cold -- potions and flasks */
1369 if (hates_cold(o_ptr))
1372 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1374 note_kill = (plural ? " shatter!" : " shatters!");
1378 if (f3 & (TR3_IGNORE_COLD)) ignore = TRUE;
1386 if (hates_fire(o_ptr))
1390 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1392 note_kill = (plural ? " burn up!" : " burns up!");
1395 if (f3 & (TR3_IGNORE_FIRE)) ignore = TRUE;
1397 if (hates_elec(o_ptr))
1402 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1404 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1407 if (f3 & (TR3_IGNORE_ELEC)) ignore = TRUE;
1415 if (hates_fire(o_ptr))
1419 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1421 note_kill = (plural ? " burn up!" : " burns up!");
1424 if (f3 & (TR3_IGNORE_FIRE)) ignore = TRUE;
1426 if (hates_cold(o_ptr))
1431 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1433 note_kill = (plural ? " shatter!" : " shatters!");
1436 if (f3 & (TR3_IGNORE_COLD)) ignore = TRUE;
1441 /* Hack -- break potions and such */
1447 if (hates_cold(o_ptr))
1450 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1452 note_kill = (plural ? " shatter!" : " shatters!");
1460 /* Mana and Chaos -- destroy everything */
1467 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1469 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1475 case GF_DISINTEGRATE:
1479 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1481 note_kill = (plural ? " evaporate!" : " evaporates!");
1491 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1493 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1496 if (f2 & (TR2_RES_CHAOS)) ignore = TRUE;
1497 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1501 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1505 if (cursed_p(o_ptr))
1509 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1511 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1520 identify_item(o_ptr);
1528 /* Chests are noticed only if trapped or locked */
1529 if (o_ptr->tval == TV_CHEST)
1531 /* Disarm/Unlock traps */
1532 if (o_ptr->pval > 0)
1534 /* Disarm or Unlock */
1535 o_ptr->pval = (0 - o_ptr->pval);
1538 object_known(o_ptr);
1541 if (known && o_ptr->marked)
1544 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1546 msg_print("Click!");
1558 if (o_ptr->tval == TV_CORPSE)
1563 if (!who || is_pet(&m_list[who]))
1564 mode |= PM_FORCE_PET;
1566 for (i = 0; i < o_ptr->number ; i++)
1568 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1569 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1574 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1576 note_kill = (plural ? " become dust." : " becomes dust.");
1581 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1584 note_kill = "À¸¤Ê֤ä¿¡£";
1586 note_kill = "rivived.";
1589 else if (!note_kill)
1592 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1594 note_kill = (plural ? " become dust." : " becomes dust.");
1606 /* Attempt to destroy the object */
1609 /* Effect "observed" */
1610 if (known && o_ptr->marked)
1613 object_desc(o_name, o_ptr, FALSE, 0);
1616 /* Artifacts, and other objects, get to resist */
1617 if (is_art || ignore)
1619 /* Observe the resist */
1620 if (known && o_ptr->marked)
1623 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1626 msg_format("The %s %s unaffected!",
1627 o_name, (plural ? "are" : "is"));
1636 /* Describe if needed */
1637 if (known && o_ptr->marked && note_kill)
1640 msg_format("%s¤Ï%s", o_name, note_kill);
1642 msg_format("The %s%s", o_name, note_kill);
1647 k_idx = o_ptr->k_idx;
1648 is_potion = object_is_potion(o_ptr);
1651 /* Delete the object */
1652 delete_object_idx(this_o_idx);
1654 /* Potions produce effects when 'shattered' */
1657 (void)potion_smash_effect(who, y, x, k_idx);
1666 /* Return "Anything seen?" */
1672 * Helper function for "project()" below.
1674 * Handle a beam/bolt/ball causing damage to a monster.
1676 * This routine takes a "source monster" (by index) which is mostly used to
1677 * determine if the player is causing the damage, and a "radius" (see below),
1678 * which is used to decrease the power of explosions with distance, and a
1679 * location, via integers which are modified by certain types of attacks
1680 * (polymorph and teleport being the obvious ones), a default damage, which
1681 * is modified as needed based on various properties, and finally a "damage
1682 * type" (see below).
1684 * Note that this routine can handle "no damage" attacks (like teleport) by
1685 * taking a "zero" damage, and can even take "parameters" to attacks (like
1686 * confuse) by accepting a "damage", using it to calculate the effect, and
1687 * then setting the damage to zero. Note that the "damage" parameter is
1688 * divided by the radius, so monsters not at the "epicenter" will not take
1689 * as much damage (or whatever)...
1691 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1692 * may result in a dereference of an invalid pointer. XXX XXX XXX
1694 * Various messages are produced, and damage is applied.
1696 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1697 * actually be "made" of that substance, or "breathe" big balls of it.
1699 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1702 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1703 * and hurts evil less. If can breath nether, then it resists it as well.
1705 * Damage reductions use the following formulas:
1706 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1707 * gives avg damage of .655, ranging from .858 to .500
1708 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1709 * gives avg damage of .544, ranging from .714 to .417
1710 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1711 * gives avg damage of .444, ranging from .556 to .333
1712 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1713 * gives avg damage of .327, ranging from .427 to .250
1714 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1715 * gives something simple.
1717 * In this function, "result" messages are postponed until the end, where
1718 * the "note" string is appended to the monster name, if not NULL. So,
1719 * to make a spell have "no effect" just set "note" to NULL. You should
1720 * also set "notice" to FALSE, or the player will learn what the spell does.
1722 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1724 /* "flg" was added. */
1725 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1729 cave_type *c_ptr = &cave[y][x];
1731 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1733 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1737 /* Is the monster "seen"? */
1738 bool seen = m_ptr->ml;
1740 bool slept = (bool)(m_ptr->csleep > 0);
1742 /* Were the effects "obvious" (if seen)? */
1743 bool obvious = FALSE;
1745 /* Can the player know about this effect? */
1746 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1748 /* Can the player see the source of this effect? */
1749 bool see_s = ((who <= 0) || m_list[who].ml);
1751 /* Were the effects "irrelevant"? */
1752 bool skipped = FALSE;
1754 /* Gets the monster angry at the source of the effect? */
1755 bool get_angry = FALSE;
1757 /* Polymorph setting (true or false) */
1760 /* Teleport setting (max distance) */
1763 /* Confusion setting (amount to confuse) */
1766 /* Stunning setting (amount to stun) */
1769 /* Sleep amount (amount to sleep) */
1772 /* Fear amount (amount to fear) */
1775 /* Time amount (amount to time) */
1778 bool heal_leper = FALSE;
1780 /* Hold the monster name */
1787 /* Assume no note */
1790 /* Assume a default death */
1792 cptr note_dies = "¤Ï»à¤ó¤À¡£";
1794 cptr note_dies = " dies.";
1802 if (!c_ptr->m_idx) return (FALSE);
1804 /* Never affect projector */
1805 if (who && (c_ptr->m_idx == who)) return (FALSE);
1806 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1807 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1809 /* Don't affect already death monsters */
1810 /* Prevents problems with chain reactions of exploding monsters */
1811 if (m_ptr->hp < 0) return (FALSE);
1813 /* Reduce damage by distance */
1814 dam = (dam + r) / (r + 1);
1817 /* Get the monster name (BEFORE polymorphing) */
1818 monster_desc(m_name, m_ptr, 0);
1820 /* Get the monster possessive ("his"/"her"/"its") */
1821 monster_desc(m_poss, m_ptr, 0x22);
1824 /* Some monsters get "destroyed" */
1825 if (!monster_living(r_ptr))
1828 bool explode = FALSE;
1830 for (i = 0; i < 4; i++)
1832 if (r_ptr->blow[i].method == RBM_EXPLODE) explode = TRUE;
1835 /* Special note at death */
1838 note_dies = "¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£";
1840 note_dies = " explodes into tiny shreds.";
1844 note_dies = "¤òÅݤ·¤¿¡£";
1846 note_dies = " is destroyed.";
1850 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1852 /* Analyze the damage type */
1855 /* Magic Missile -- pure damage */
1858 if (seen) obvious = TRUE;
1859 if (r_ptr->flags3 & (RF3_RES_ALL))
1862 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1864 note = " is immune.";
1867 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1876 if (seen) obvious = TRUE;
1877 if (r_ptr->flags3 & (RF3_RES_ALL))
1880 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1882 note = " is immune.";
1885 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1888 if (r_ptr->flags3 & (RF3_IM_ACID))
1891 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1893 note = " resists a lot.";
1897 if (seen) r_ptr->r_flags3 |= (RF3_IM_ACID);
1905 if (seen) obvious = TRUE;
1906 if (r_ptr->flags3 & (RF3_RES_ALL))
1909 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1911 note = " is immune.";
1914 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1917 if (r_ptr->flags3 & (RF3_IM_ELEC))
1920 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1922 note = " resists a lot.";
1926 if (seen) r_ptr->r_flags3 |= (RF3_IM_ELEC);
1934 if (seen) obvious = TRUE;
1935 if (r_ptr->flags3 & (RF3_RES_ALL))
1938 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1940 note = " is immune.";
1943 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1946 if (r_ptr->flags3 & (RF3_IM_FIRE))
1949 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1951 note = " resists a lot.";
1955 if (seen) r_ptr->r_flags3 |= (RF3_IM_FIRE);
1957 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1960 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1962 note = " is hit hard.";
1966 if (seen) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1974 if (seen) obvious = TRUE;
1975 if (r_ptr->flags3 & (RF3_RES_ALL))
1978 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1980 note = " is immune.";
1983 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1986 if (r_ptr->flags3 & (RF3_IM_COLD))
1989 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1991 note = " resists a lot.";
1995 if (seen) r_ptr->r_flags3 |= (RF3_IM_COLD);
1997 else if (r_ptr->flags3 & (RF3_HURT_COLD))
2000 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
2002 note = " is hit hard.";
2006 if (seen) r_ptr->r_flags3 |= (RF3_HURT_COLD);
2014 if (seen) obvious = TRUE;
2015 if (r_ptr->flags3 & (RF3_RES_ALL))
2018 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2020 note = " is immune.";
2023 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2026 if (r_ptr->flags3 & RF3_IM_POIS)
2029 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
2031 note = " resists a lot.";
2035 if (seen) r_ptr->r_flags3 |= (RF3_IM_POIS);
2043 if (seen) obvious = TRUE;
2045 if (r_ptr->flags3 & (RF3_RES_ALL))
2048 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2050 note = " is immune.";
2053 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2056 if (r_ptr->flags3 & RF3_IM_POIS)
2059 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2064 dam *= 3; dam /= randint1(6) + 6;
2065 if (seen) r_ptr->r_flags3 |= (RF3_IM_POIS);
2067 else if (one_in_(3)) do_poly = TRUE;
2071 /* Hellfire -- hurts Evil */
2074 if (seen) obvious = TRUE;
2075 if (r_ptr->flags3 & (RF3_RES_ALL))
2078 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2080 note = " is immune.";
2083 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2086 if (r_ptr->flags3 & RF3_GOOD)
2090 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2092 note = " is hit hard.";
2095 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
2100 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2103 if (seen) obvious = TRUE;
2104 if (r_ptr->flags3 & (RF3_RES_ALL))
2107 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2109 note = " is immune.";
2112 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2115 if (r_ptr->flags3 & RF3_GOOD)
2119 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2121 note = " is immune.";
2124 if (seen) r_ptr->r_flags3 |= RF3_GOOD;
2126 else if (r_ptr->flags3 & RF3_EVIL)
2130 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2132 note = " is hit hard.";
2135 if (seen) r_ptr->r_flags3 |= RF3_EVIL;
2140 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2145 dam *= 3; dam /= randint1(6) + 6;
2150 /* Arrow -- XXX no defense */
2153 if (seen) obvious = TRUE;
2154 if (r_ptr->flags3 & (RF3_RES_ALL))
2157 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2159 note = " is immune.";
2162 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2168 /* Plasma -- XXX perhaps check ELEC or FIRE */
2171 if (seen) obvious = TRUE;
2172 if (r_ptr->flags3 & (RF3_RES_ALL))
2175 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2177 note = " is immune.";
2180 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2183 if (r_ptr->flags3 & RF3_RES_PLAS)
2186 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2191 dam *= 3; dam /= randint1(6) + 6;
2193 r_ptr->r_flags3 |= (RF3_RES_PLAS);
2198 /* Nether -- see above */
2201 if (seen) obvious = TRUE;
2202 if (r_ptr->flags3 & (RF3_RES_ALL))
2205 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2207 note = " is immune.";
2210 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2213 if (r_ptr->flags3 & RF3_UNDEAD)
2216 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2218 note = " is immune.";
2222 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
2224 else if (r_ptr->flags3 & RF3_RES_NETH)
2227 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2232 dam *= 3; dam /= randint1(6) + 6;
2234 if (seen) r_ptr->r_flags3 |= (RF3_RES_NETH);
2236 else if (r_ptr->flags3 & RF3_EVIL)
2240 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2242 note = " resists somewhat.";
2245 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
2250 /* Water (acid) damage -- Water spirits/elementals are immune */
2253 if (seen) obvious = TRUE;
2254 if (r_ptr->flags3 & (RF3_RES_ALL))
2257 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2259 note = " is immune.";
2262 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2265 if (m_ptr->r_idx == MON_WATER_ELEM || m_ptr->r_idx == MON_UNMAKER)
2268 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2270 note = " is immune.";
2275 else if (r_ptr->flags3 & RF3_RES_WATE)
2278 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2283 dam *= 3; dam /= randint1(6) + 6;
2284 if (seen) r_ptr->r_flags3 |= (RF3_RES_WATE);
2289 /* Chaos -- Chaos breathers resist */
2292 if (seen) obvious = TRUE;
2293 if (r_ptr->flags3 & (RF3_RES_ALL))
2296 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2298 note = " is immune.";
2301 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2305 do_conf = (5 + randint1(11) + r) / (r + 1);
2306 if ((r_ptr->flags4 & RF4_BR_CHAO) ||
2307 (m_ptr->r_idx == MON_STORMBRINGER) ||
2308 ((r_ptr->flags3 & RF3_DEMON) && one_in_(3)))
2311 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2316 dam *= 3; dam /= randint1(6) + 6;
2322 /* Shards -- Shard breathers resist */
2325 if (seen) obvious = TRUE;
2326 if (r_ptr->flags3 & (RF3_RES_ALL))
2329 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2331 note = " is immune.";
2334 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2337 if (r_ptr->flags4 & RF4_BR_SHAR)
2340 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2345 dam *= 3; dam /= randint1(6) + 6;
2350 /* Rocket: Shard resistance helps */
2353 if (seen) obvious = TRUE;
2355 if (r_ptr->flags3 & (RF3_RES_ALL))
2358 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2360 note = " is immune.";
2363 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2366 if (r_ptr->flags4 & RF4_BR_SHAR)
2369 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2371 note = " resists somewhat.";
2380 /* Sound -- Sound breathers resist */
2383 if (seen) obvious = TRUE;
2384 if (r_ptr->flags3 & (RF3_RES_ALL))
2387 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2389 note = " is immune.";
2392 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2395 do_stun = (10 + randint1(15) + r) / (r + 1);
2396 if (r_ptr->flags4 & RF4_BR_SOUN)
2399 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2404 dam *= 2; dam /= randint1(6) + 6;
2412 if (seen) obvious = TRUE;
2413 if (r_ptr->flags3 & (RF3_RES_ALL))
2416 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2418 note = " is immune.";
2421 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2424 do_conf = (10 + randint1(15) + r) / (r + 1);
2425 if (r_ptr->flags4 & RF4_BR_CONF)
2428 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2433 dam *= 2; dam /= randint1(6) + 6;
2435 else if (r_ptr->flags3 & RF3_NO_CONF)
2438 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2440 note = " resists somewhat.";
2448 /* Disenchantment -- Breathers and Disenchanters resist */
2451 if (seen) obvious = TRUE;
2452 if (r_ptr->flags3 & (RF3_RES_ALL))
2455 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2457 note = " is immune.";
2460 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2463 if (r_ptr->flags3 & RF3_RES_DISE)
2466 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2471 dam *= 3; dam /= randint1(6) + 6;
2472 if (seen) r_ptr->r_flags3 |= (RF3_RES_DISE);
2477 /* Nexus -- Breathers and Existers resist */
2480 if (seen) obvious = TRUE;
2481 if (r_ptr->flags3 & (RF3_RES_ALL))
2484 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2486 note = " is immune.";
2489 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2492 if (r_ptr->flags3 & RF3_RES_NEXU)
2495 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2500 dam *= 3; dam /= randint1(6) + 6;
2501 if (seen) r_ptr->r_flags3 |= (RF3_RES_NEXU);
2509 if (seen) obvious = TRUE;
2510 if (r_ptr->flags3 & (RF3_RES_ALL))
2513 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2515 note = " is immune.";
2518 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2521 do_stun = (randint1(15) + r) / (r + 1);
2522 if (r_ptr->flags4 & RF4_BR_WALL)
2525 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2530 dam *= 3; dam /= randint1(6) + 6;
2535 /* Inertia -- breathers resist */
2538 if (seen) obvious = TRUE;
2539 if (r_ptr->flags3 & (RF3_RES_ALL))
2542 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2544 note = " is immune.";
2547 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2550 if (r_ptr->flags4 & (RF4_BR_INER))
2553 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2558 dam *= 3; dam /= randint1(6) + 6;
2562 /* Powerful monsters can resist */
2563 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2564 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2568 /* Normal monsters slow down */
2574 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2576 note = " starts moving slower.";
2579 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2580 if (c_ptr->m_idx == p_ptr->riding)
2581 p_ptr->update |= (PU_BONUS);
2587 /* Time -- breathers resist */
2590 if (seen) obvious = TRUE;
2591 if (r_ptr->flags3 & (RF3_RES_ALL))
2594 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2596 note = " is immune.";
2599 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2602 if (r_ptr->flags4 & (RF4_BR_TIME))
2605 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2610 dam *= 3; dam /= randint1(6) + 6;
2612 else do_time = (dam+1)/2;
2616 /* Gravity -- breathers resist */
2619 bool resist_tele = FALSE;
2621 if (seen) obvious = TRUE;
2623 if (r_ptr->flags3 & (RF3_RES_ALL))
2626 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2628 note = " is immune.";
2631 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2634 if (r_ptr->flags3 & (RF3_RES_TELE))
2636 if (r_ptr->flags1 & (RF1_UNIQUE))
2638 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
2640 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2642 note = " is unaffected!";
2647 else if (r_ptr->level > randint1(100))
2649 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
2651 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2660 if (!resist_tele) do_dist = 10;
2662 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2664 if (r_ptr->flags4 & (RF4_BR_GRAV))
2667 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2672 dam *= 3; dam /= randint1(6) + 6;
2678 /* Powerful monsters can resist */
2679 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2680 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2684 /* Normal monsters slow down */
2690 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2692 note = " starts moving slower.";
2695 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2696 if (c_ptr->m_idx == p_ptr->riding)
2697 p_ptr->update |= (PU_BONUS);
2701 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
2703 /* Attempt a saving throw */
2704 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2705 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2709 /* No obvious effect */
2711 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2713 note = " is unaffected!";
2727 if (seen) obvious = TRUE;
2728 if (r_ptr->flags3 & (RF3_RES_ALL))
2731 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2733 note = " is immune.";
2736 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2744 case GF_DISINTEGRATE:
2746 if (seen) obvious = TRUE;
2747 if (r_ptr->flags3 & (RF3_RES_ALL))
2750 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2752 note = " is immune.";
2755 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2758 if (r_ptr->flags3 & RF3_HURT_ROCK)
2760 if (seen) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2762 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2763 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2765 note = " loses some skin!";
2766 note_dies = " evaporates!";
2776 if (seen) obvious = TRUE;
2778 /* PSI only works if the monster can see you! -- RG */
2779 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2783 note = "¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª";
2785 note = " can't see you, and isn't affected!";
2790 if (r_ptr->flags3 & (RF3_RES_ALL))
2793 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2795 note = " is immune.";
2798 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2801 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2805 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2807 note = " is immune!";
2809 if (seen) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2812 else if ((r_ptr->flags2 & RF2_STUPID) ||
2813 (r_ptr->flags2 & RF2_WEIRD_MIND) ||
2814 (r_ptr->flags3 & RF3_ANIMAL) ||
2815 (r_ptr->level > randint1(3 * dam)))
2819 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2826 * Powerful demons & undead can turn a mindcrafter's
2827 * attacks back on them
2829 if (((r_ptr->flags3 & RF3_UNDEAD) ||
2830 (r_ptr->flags3 & RF3_DEMON)) &&
2831 (r_ptr->level > p_ptr->lev / 2) &&
2836 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
2839 msg_format("%^s%s corrupted mind backlashes your attack!",
2840 m_name, (seen ? "'s" : "s"));
2844 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2847 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2849 msg_print("You resist the effects!");
2855 /* Injure +/- confusion */
2856 monster_desc(killer, m_ptr, 0x288);
2857 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2860 switch (randint1(4))
2863 set_confused(p_ptr->confused + 3 + randint1(dam));
2866 set_stun(p_ptr->stun + randint1(dam));
2870 if (r_ptr->flags3 & RF3_NO_FEAR)
2872 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2874 note = " is unaffected.";
2878 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2882 if (!p_ptr->free_act)
2883 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2892 if ((dam > 0) && one_in_(4))
2894 switch (randint1(4))
2897 do_conf = 3 + randint1(dam);
2900 do_stun = 3 + randint1(dam);
2903 do_fear = 3 + randint1(dam);
2907 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2909 note = " falls asleep!";
2912 do_sleep = 3 + randint1(dam);
2918 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2920 note_dies = " collapses, a mindless husk.";
2928 if (seen) obvious = TRUE;
2929 if (r_ptr->flags3 & (RF3_RES_ALL))
2932 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2934 note = " is immune.";
2937 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2940 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2944 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2946 note = " is immune!";
2950 else if ((r_ptr->flags2 & RF2_STUPID) ||
2951 (r_ptr->flags2 & RF2_WEIRD_MIND) ||
2952 (r_ptr->flags3 & RF3_ANIMAL) ||
2953 (r_ptr->level > randint1(3 * dam)))
2957 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2964 * Powerful demons & undead can turn a mindcrafter's
2965 * attacks back on them
2967 if (((r_ptr->flags3 & RF3_UNDEAD) ||
2968 (r_ptr->flags3 & RF3_DEMON)) &&
2969 (r_ptr->level > p_ptr->lev / 2) &&
2974 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
2977 msg_format("%^s%s corrupted mind backlashes your attack!",
2978 m_name, (seen ? "'s" : "s"));
2982 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2985 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2987 msg_print("You resist the effects!");
2993 /* Injure + mana drain */
2994 monster_desc(killer, m_ptr, 0x288);
2996 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
2998 msg_print("Your psychic energy is drained!");
3001 p_ptr->csp = MAX(0, p_ptr->csp - damroll(5, dam) / 2);
3002 p_ptr->redraw |= PR_MANA;
3003 p_ptr->window |= (PW_SPELL);
3004 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
3011 int b = damroll(5, dam) / 4;
3013 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª",
3016 msg_format("You convert %s%s pain into psychic energy!",
3017 m_name, (seen ? "'s" : "s"));
3020 b = MIN(p_ptr->msp, p_ptr->csp + b);
3022 p_ptr->redraw |= PR_MANA;
3023 p_ptr->window |= (PW_SPELL);
3027 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
3029 note_dies = " collapses, a mindless husk.";
3035 case GF_TELEKINESIS:
3037 if (seen) obvious = TRUE;
3038 if (r_ptr->flags3 & (RF3_RES_ALL))
3041 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3043 note = " is immune.";
3046 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3051 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
3056 do_stun = damroll((p_ptr->lev / 10) + 3 , dam) + 1;
3058 /* Attempt a saving throw */
3059 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3060 (r_ptr->level > 5 + randint1(dam)))
3064 /* No obvious effect */
3070 /* Psycho-spear -- powerful magic missile */
3073 if (seen) obvious = TRUE;
3074 if (r_ptr->flags3 & (RF3_RES_ALL))
3077 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3079 note = " is immune.";
3082 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3088 /* Meteor -- powerful magic missile */
3091 if (seen) obvious = TRUE;
3092 if (r_ptr->flags3 & (RF3_RES_ALL))
3095 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3097 note = " is immune.";
3100 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3108 if (!is_hostile(m_ptr)) break;
3109 if (seen) obvious = TRUE;
3111 if (r_ptr->flags3 & (RF3_RES_ALL))
3114 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3116 note = " is immune.";
3119 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3122 /* Attempt a saving throw */
3123 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3124 (r_ptr->flags1 & RF1_QUESTOR) ||
3125 (r_ptr->flags3 & RF3_NO_CONF) ||
3126 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3128 /* Memorize a flag */
3129 if (r_ptr->flags3 & RF3_NO_CONF)
3131 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
3138 * Powerful demons & undead can turn a mindcrafter's
3139 * attacks back on them
3141 if (((r_ptr->flags3 & RF3_UNDEAD) ||
3142 (r_ptr->flags3 & RF3_DEMON)) &&
3143 (r_ptr->level > p_ptr->lev / 2) &&
3148 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
3151 msg_format("%^s%s corrupted mind backlashes your attack!",
3152 m_name, (seen ? "'s" : "s"));
3156 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3159 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3161 msg_print("You resist the effects!");
3167 /* Confuse, stun, terrify */
3168 switch (randint1(4))
3171 set_stun(p_ptr->stun + dam / 2);
3174 set_confused(p_ptr->confused + dam / 2);
3178 if (r_ptr->flags3 & RF3_NO_FEAR)
3180 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3182 note = " is unaffected.";
3186 set_afraid(p_ptr->afraid + dam);
3193 /* No obvious effect */
3195 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3197 note = " is unaffected!";
3205 if ((dam > 29) && (randint1(100) < dam))
3208 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3210 note = " is in your thrall!";
3217 switch (randint1(4))
3231 /* No "real" damage */
3238 /* Ice -- Cold + Cuts + Stun */
3241 if (seen) obvious = TRUE;
3242 if (r_ptr->flags3 & (RF3_RES_ALL))
3245 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3247 note = " is immune.";
3250 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3253 do_stun = (randint1(15) + 1) / (r + 1);
3254 if (r_ptr->flags3 & RF3_IM_COLD)
3257 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3259 note = " resists a lot.";
3263 if (seen) r_ptr->r_flags3 |= (RF3_IM_COLD);
3265 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3268 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3270 note = " is hit hard.";
3274 if (seen) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3283 if (seen) obvious = TRUE;
3285 if (r_ptr->flags3 & (RF3_RES_ALL))
3288 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3290 note = " is immune.";
3293 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3296 if (!monster_living(r_ptr))
3298 if (r_ptr->flags3 & RF3_UNDEAD)
3300 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
3303 if (r_ptr->flags3 & (RF3_DEMON))
3305 if (seen) r_ptr->r_flags3 |= (RF3_DEMON);
3309 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3311 note = " is unaffected!";
3317 else do_time = (dam+7)/8;
3325 if (seen) obvious = TRUE;
3327 if (r_ptr->flags3 & (RF3_RES_ALL))
3330 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3332 note = " is immune.";
3335 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3338 if ((r_ptr->flags3 & RF3_UNDEAD) ||
3339 (r_ptr->flags3 & RF3_NONLIVING))
3341 if (r_ptr->flags3 & RF3_UNDEAD)
3343 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
3347 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3349 note = " is immune.";
3355 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3356 (randint1(888) != 666)) ||
3357 (((r_ptr->level + randint1(20)) > randint1(p_ptr->lev + randint1(10))) &&
3358 randint1(100) != 66))
3361 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3373 /* Polymorph monster (Use "dam" as "power") */
3376 if (seen) obvious = TRUE;
3378 if (r_ptr->flags3 & (RF3_RES_ALL))
3381 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3383 note = " is immune.";
3386 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3389 /* Attempt to polymorph (see below) */
3392 /* Powerful monsters can resist */
3393 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3394 (r_ptr->flags1 & RF1_QUESTOR) ||
3395 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3398 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3400 note = " is unaffected!";
3407 /* No "real" damage */
3414 /* Clone monsters (Ignore "dam") */
3417 if (seen) obvious = TRUE;
3419 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)))
3422 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3424 note = " is unaffected!";
3430 m_ptr->hp = m_ptr->maxhp;
3432 /* Attempt to clone. */
3433 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3436 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3444 /* No "real" damage */
3451 /* Heal Monster (use "dam" as amount of healing) */
3454 if (seen) obvious = TRUE;
3459 if (m_ptr->maxhp < m_ptr->max_maxhp)
3462 msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3464 msg_format("%^s recovers %s vitality.", m_name, m_poss);
3466 m_ptr->maxhp = m_ptr->max_maxhp;
3472 if (seen) obvious = TRUE;
3480 msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3482 msg_format("%^s is no longer stunned.", m_name);
3486 if (m_ptr->confused)
3489 msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3491 msg_format("%^s is no longer confused.", m_name);
3493 m_ptr->confused = 0;
3498 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3500 msg_format("%^s recovers %s courage.", m_name, m_poss);
3506 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3509 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3511 chg_virtue(V_VITALITY, 1);
3513 if (r_ptr->flags1 & RF1_UNIQUE)
3514 chg_virtue(V_INDIVIDUALISM, 1);
3516 if (is_friendly(m_ptr))
3517 chg_virtue(V_HONOUR, 1);
3518 else if (!(r_ptr->flags3 & RF3_EVIL))
3520 if (r_ptr->flags3 & RF3_GOOD)
3521 chg_virtue(V_COMPASSION, 2);
3523 chg_virtue(V_COMPASSION, 1);
3526 if (m_ptr->r_idx == MON_LEPER)
3529 chg_virtue(V_COMPASSION, 5);
3532 if (r_ptr->flags3 & RF3_ANIMAL)
3533 chg_virtue(V_NATURE, 1);
3535 /* Redraw (later) if needed */
3536 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3537 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3541 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3543 note = " looks healthier.";
3547 /* No "real" damage */
3553 /* Speed Monster (Ignore "dam") */
3556 if (seen) obvious = TRUE;
3562 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3564 note = " starts moving faster.";
3567 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3569 if (c_ptr->m_idx == p_ptr->riding)
3570 p_ptr->update |= (PU_BONUS);
3572 if (r_ptr->flags1 & RF1_UNIQUE)
3573 chg_virtue(V_INDIVIDUALISM, 1);
3574 if (is_friendly(m_ptr))
3575 chg_virtue(V_HONOUR, 1);
3577 /* No "real" damage */
3583 /* Slow Monster (Use "dam" as "power") */
3586 if (seen) obvious = TRUE;
3588 if (r_ptr->flags3 & (RF3_RES_ALL))
3591 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3593 note = " is immune.";
3596 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3599 /* Powerful monsters can resist */
3600 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3601 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3604 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3606 note = " is unaffected!";
3612 /* Normal monsters slow down */
3618 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3620 note = " starts moving slower.";
3623 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3625 if (c_ptr->m_idx == p_ptr->riding)
3626 p_ptr->update |= (PU_BONUS);
3629 /* No "real" damage */
3635 /* Sleep (Use "dam" as "power") */
3638 if (seen) obvious = TRUE;
3640 if (r_ptr->flags3 & (RF3_RES_ALL))
3643 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3645 note = " is immune.";
3648 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3651 /* Attempt a saving throw */
3652 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3653 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3654 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3656 /* Memorize a flag */
3657 if (r_ptr->flags3 & RF3_NO_SLEEP)
3659 if (seen) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3662 /* No obvious effect */
3664 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3666 note = " is unaffected!";
3673 /* Go to sleep (much) later */
3675 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3677 note = " falls asleep!";
3683 /* No "real" damage */
3689 /* Sleep (Use "dam" as "power") */
3690 case GF_STASIS_EVIL:
3692 if (seen) obvious = TRUE;
3694 if (r_ptr->flags3 & (RF3_RES_ALL))
3697 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3699 note = " is immune.";
3702 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3705 /* Attempt a saving throw */
3706 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3707 !(r_ptr->flags3 & RF3_EVIL) ||
3708 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3711 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3713 note = " is unaffected!";
3720 /* Go to sleep (much) later */
3722 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3724 note = " is suspended!";
3730 /* No "real" damage */
3735 /* Sleep (Use "dam" as "power") */
3738 if (seen) obvious = TRUE;
3740 if (r_ptr->flags3 & (RF3_RES_ALL))
3743 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3745 note = " is immune.";
3748 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3751 /* Attempt a saving throw */
3752 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3753 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3756 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3758 note = " is unaffected!";
3765 /* Go to sleep (much) later */
3767 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3769 note = " is suspended!";
3775 /* No "real" damage */
3784 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3785 vir = virtue_number(V_HARMONY);
3788 dam += p_ptr->virtues[vir-1]/10;
3791 vir = virtue_number(V_INDIVIDUALISM);
3794 dam -= p_ptr->virtues[vir-1]/20;
3797 if (seen) obvious = TRUE;
3799 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3802 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3804 note = " is immune.";
3807 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3811 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3814 /* Attempt a saving throw */
3815 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3816 (r_ptr->flags3 & RF3_NO_CONF) ||
3817 (m_ptr->mflag2 & MFLAG_NOPET) ||
3818 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3820 /* Memorize a flag */
3821 if (r_ptr->flags3 & RF3_NO_CONF)
3823 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
3827 /* No obvious effect */
3829 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3831 note = " is unaffected!";
3836 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3838 else if (p_ptr->cursed & TRC_AGGRAVATE)
3841 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3843 note = " hates you too much!";
3846 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3851 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3853 note = " suddenly seems friendly!";
3858 chg_virtue(V_INDIVIDUALISM, -1);
3859 if (r_ptr->flags3 & RF3_ANIMAL)
3860 chg_virtue(V_NATURE, 1);
3863 /* No "real" damage */
3868 /* Control undead */
3869 case GF_CONTROL_UNDEAD:
3872 if (seen) obvious = TRUE;
3874 vir = virtue_number(V_UNLIFE);
3877 dam += p_ptr->virtues[vir-1]/10;
3880 vir = virtue_number(V_INDIVIDUALISM);
3883 dam -= p_ptr->virtues[vir-1]/20;
3886 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3889 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3891 note = " is immune.";
3894 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3898 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3901 /* Attempt a saving throw */
3902 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3903 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3904 (m_ptr->mflag2 & MFLAG_NOPET) ||
3905 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3907 /* No obvious effect */
3909 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3911 note = " is unaffected!";
3915 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3917 else if (p_ptr->cursed & TRC_AGGRAVATE)
3920 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3922 note = " hates you too much!";
3925 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3930 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3932 note = " is in your thrall!";
3938 /* No "real" damage */
3944 case GF_CONTROL_DEMON:
3947 if (seen) obvious = TRUE;
3949 vir = virtue_number(V_UNLIFE);
3952 dam += p_ptr->virtues[vir-1]/10;
3955 vir = virtue_number(V_INDIVIDUALISM);
3958 dam -= p_ptr->virtues[vir-1]/20;
3961 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3964 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3966 note = " is immune.";
3969 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3973 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3976 /* Attempt a saving throw */
3977 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3978 (!(r_ptr->flags3 & RF3_DEMON)) ||
3979 (m_ptr->mflag2 & MFLAG_NOPET) ||
3980 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3982 /* No obvious effect */
3984 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3986 note = " is unaffected!";
3990 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3992 else if (p_ptr->cursed & TRC_AGGRAVATE)
3995 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3997 note = " hates you too much!";
4000 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4005 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
4007 note = " is in your thrall!";
4013 /* No "real" damage */
4019 case GF_CONTROL_ANIMAL:
4023 if (seen) obvious = TRUE;
4025 vir = virtue_number(V_NATURE);
4028 dam += p_ptr->virtues[vir-1]/10;
4031 vir = virtue_number(V_INDIVIDUALISM);
4034 dam -= p_ptr->virtues[vir-1]/20;
4037 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
4040 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4042 note = " is immune.";
4045 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4049 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4052 /* Attempt a saving throw */
4053 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4054 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
4055 (m_ptr->mflag2 & MFLAG_NOPET) ||
4056 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4057 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4059 /* Memorize a flag */
4060 if (r_ptr->flags3 & (RF3_NO_CONF))
4062 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
4066 /* No obvious effect */
4068 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4070 note = " is unaffected!";
4074 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4076 else if (p_ptr->cursed & TRC_AGGRAVATE)
4079 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4081 note = " hates you too much!";
4084 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4089 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4091 note = " is tamed!";
4096 if (r_ptr->flags3 & RF3_ANIMAL)
4097 chg_virtue(V_NATURE, 1);
4100 /* No "real" damage */
4106 case GF_CONTROL_LIVING:
4110 vir = virtue_number(V_UNLIFE);
4111 if (seen) obvious = TRUE;
4113 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4114 vir = virtue_number(V_UNLIFE);
4117 dam -= p_ptr->virtues[vir-1]/10;
4120 vir = virtue_number(V_INDIVIDUALISM);
4123 dam -= p_ptr->virtues[vir-1]/20;
4126 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4127 if (dam < 1) dam = 1;
4129 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4131 msg_format("You stare into %s.", m_name);
4133 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
4136 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4138 note = " is immune.";
4141 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4145 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4148 /* Attempt a saving throw */
4149 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4150 (m_ptr->mflag2 & MFLAG_NOPET) ||
4151 (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) ||
4152 ((r_ptr->level+10) > randint1(dam)))
4155 /* No obvious effect */
4157 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4159 note = " is unaffected!";
4163 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4165 else if (p_ptr->cursed & TRC_AGGRAVATE)
4168 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4170 note = " hates you too much!";
4173 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4178 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4180 note = " is tamed!";
4185 if (r_ptr->flags3 & RF3_ANIMAL)
4186 chg_virtue(V_NATURE, 1);
4189 /* No "real" damage */
4194 /* Confusion (Use "dam" as "power") */
4197 if (seen) obvious = TRUE;
4199 if (r_ptr->flags3 & (RF3_RES_ALL))
4202 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4204 note = " is immune.";
4207 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4210 /* Get confused later */
4211 do_conf = damroll(3, (dam / 2)) + 1;
4213 /* Attempt a saving throw */
4214 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4215 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4216 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4218 /* Memorize a flag */
4219 if (r_ptr->flags3 & (RF3_NO_CONF))
4221 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
4227 /* No obvious effect */
4229 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4231 note = " is unaffected!";
4237 /* No "real" damage */
4244 if (seen) obvious = TRUE;
4246 if (r_ptr->flags3 & (RF3_RES_ALL))
4249 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4251 note = " is immune.";
4254 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4257 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
4259 /* Attempt a saving throw */
4260 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4261 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4266 /* No obvious effect */
4268 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4270 note = " is unaffected!";
4276 /* No "real" damage */
4284 /* Lite, but only hurts susceptible creatures */
4292 if (r_ptr->flags3 & (RF3_RES_ALL))
4298 if (r_ptr->flags3 & (RF3_HURT_LITE))
4300 /* Obvious effect */
4301 if (seen) obvious = TRUE;
4303 /* Memorize the effects */
4304 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4306 /* Special effect */
4308 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4309 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4311 note = " cringes from the light!";
4312 note_dies = " shrivels away in the light!";
4317 /* Normally no damage */
4329 /* Lite -- opposite of Dark */
4332 if (seen) obvious = TRUE;
4333 if (r_ptr->flags3 & (RF3_RES_ALL))
4336 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4338 note = " is immune.";
4341 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4344 if (r_ptr->flags4 & (RF4_BR_LITE))
4347 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4352 dam *= 2; dam /= (randint1(6)+6);
4354 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4356 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4358 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4359 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4361 note = " cringes from the light!";
4362 note_dies = " shrivels away in the light!";
4371 /* Dark -- opposite of Lite */
4374 if (seen) obvious = TRUE;
4376 if (r_ptr->flags3 & (RF3_RES_ALL))
4379 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4381 note = " is immune.";
4384 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4387 /* Likes darkness... */
4388 if ((r_ptr->flags4 & (RF4_BR_DARK)) ||
4389 (r_ptr->flags3 & RF3_ORC) ||
4390 (r_ptr->flags3 & RF3_HURT_LITE))
4393 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4398 dam *= 2; dam /= (randint1(6)+6);
4407 if (r_ptr->flags3 & (RF3_RES_ALL))
4412 /* Hurt by rock remover */
4413 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4416 if (seen) obvious = TRUE;
4418 /* Memorize the effects */
4419 if (seen) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4421 /* Cute little message */
4423 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4424 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4426 note = " loses some skin!";
4427 note_dies = " dissolves!";
4432 /* Usually, ignore the effects */
4443 /* Teleport undead (Use "dam" as "power") */
4444 case GF_AWAY_UNDEAD:
4446 /* Only affect undead */
4447 if (r_ptr->flags3 & (RF3_UNDEAD))
4449 bool resists_tele = FALSE;
4451 if (r_ptr->flags3 & (RF3_RES_TELE))
4453 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4455 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4457 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4459 note = " is unaffected!";
4462 resists_tele = TRUE;
4464 else if (r_ptr->level > randint1(100))
4466 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4468 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4473 resists_tele = TRUE;
4479 if (seen) obvious = TRUE;
4480 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4492 /* No "real" damage */
4498 /* Teleport evil (Use "dam" as "power") */
4501 /* Only affect evil */
4502 if (r_ptr->flags3 & (RF3_EVIL))
4504 bool resists_tele = FALSE;
4506 if (r_ptr->flags3 & (RF3_RES_TELE))
4508 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4510 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4512 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4514 note = " is unaffected!";
4517 resists_tele = TRUE;
4519 else if (r_ptr->level > randint1(100))
4521 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4523 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4528 resists_tele = TRUE;
4534 if (seen) obvious = TRUE;
4535 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4547 /* No "real" damage */
4553 /* Teleport monster (Use "dam" as "power") */
4556 bool resists_tele = FALSE;
4557 if (r_ptr->flags3 & (RF3_RES_TELE))
4559 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4561 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4563 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4565 note = " is unaffected!";
4568 resists_tele = TRUE;
4570 else if (r_ptr->level > randint1(100))
4572 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4574 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4579 resists_tele = TRUE;
4586 if (seen) obvious = TRUE;
4588 /* Prepare to teleport */
4592 /* No "real" damage */
4598 /* Turn undead (Use "dam" as "power") */
4599 case GF_TURN_UNDEAD:
4601 if (r_ptr->flags3 & (RF3_RES_ALL))
4606 /* Only affect undead */
4607 if (r_ptr->flags3 & (RF3_UNDEAD))
4609 /* Learn about type */
4610 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4613 if (seen) obvious = TRUE;
4615 /* Apply some fear */
4616 do_fear = damroll(3, (dam / 2)) + 1;
4618 /* Attempt a saving throw */
4619 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4621 /* No obvious effect */
4623 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4625 note = " is unaffected!";
4640 /* No "real" damage */
4646 /* Turn evil (Use "dam" as "power") */
4649 if (r_ptr->flags3 & (RF3_RES_ALL))
4654 /* Only affect evil */
4655 if (r_ptr->flags3 & (RF3_EVIL))
4657 /* Learn about type */
4658 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4661 if (seen) obvious = TRUE;
4663 /* Apply some fear */
4664 do_fear = damroll(3, (dam / 2)) + 1;
4666 /* Attempt a saving throw */
4667 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4669 /* No obvious effect */
4671 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4673 note = " is unaffected!";
4688 /* No "real" damage */
4694 /* Turn monster (Use "dam" as "power") */
4697 if (r_ptr->flags3 & (RF3_RES_ALL))
4703 if (seen) obvious = TRUE;
4705 /* Apply some fear */
4706 do_fear = damroll(3, (dam / 2)) + 1;
4708 /* Attempt a saving throw */
4709 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4710 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4711 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4713 /* No obvious effect */
4715 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4717 note = " is unaffected!";
4724 /* No "real" damage */
4731 case GF_DISP_UNDEAD:
4733 if (r_ptr->flags3 & (RF3_RES_ALL))
4739 /* Only affect undead */
4740 if (r_ptr->flags3 & (RF3_UNDEAD))
4742 /* Learn about type */
4743 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4746 if (seen) obvious = TRUE;
4750 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4751 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4753 note = " shudders.";
4754 note_dies = " dissolves!";
4776 if (r_ptr->flags3 & (RF3_RES_ALL))
4782 /* Only affect evil */
4783 if (r_ptr->flags3 & (RF3_EVIL))
4785 /* Learn about type */
4786 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4789 if (seen) obvious = TRUE;
4793 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4794 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4796 note = " shudders.";
4797 note_dies = " dissolves!";
4818 if (r_ptr->flags3 & (RF3_RES_ALL))
4824 /* Only affect good */
4825 if (r_ptr->flags3 & (RF3_GOOD))
4827 /* Learn about type */
4828 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
4831 if (seen) obvious = TRUE;
4835 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4836 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4838 note = " shudders.";
4839 note_dies = " dissolves!";
4858 case GF_DISP_LIVING:
4860 if (r_ptr->flags3 & (RF3_RES_ALL))
4866 /* Only affect non-undead */
4867 if (monster_living(r_ptr))
4870 if (seen) obvious = TRUE;
4874 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4875 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4877 note = " shudders.";
4878 note_dies = " dissolves!";
4899 if (r_ptr->flags3 & (RF3_RES_ALL))
4905 /* Only affect demons */
4906 if (r_ptr->flags3 & (RF3_DEMON))
4908 /* Learn about type */
4909 if (seen) r_ptr->r_flags3 |= (RF3_DEMON);
4912 if (seen) obvious = TRUE;
4916 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4917 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4919 note = " shudders.";
4920 note_dies = " dissolves!";
4938 /* Dispel monster */
4941 if (r_ptr->flags3 & (RF3_RES_ALL))
4948 if (seen) obvious = TRUE;
4952 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4953 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4955 note = " shudders.";
4956 note_dies = " dissolves!";
4966 if (seen) obvious = TRUE;
4967 if (r_ptr->flags3 & (RF3_RES_ALL))
4970 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4972 note = " is immune.";
4975 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4979 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4983 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£",m_name);
4985 msg_format("You draws psychic energy from %s.", m_name);
4988 (void)hp_player(dam);
4993 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
4995 msg_format("%s is unaffected.", m_name);
5005 if (seen) obvious = TRUE;
5008 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5010 msg_format("You gazes intently at %s.", m_name);
5013 if (r_ptr->flags3 & (RF3_RES_ALL))
5016 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5018 note = " is immune.";
5021 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5025 /* Attempt a saving throw */
5026 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5027 (r_ptr->flags3 & RF3_NO_CONF) ||
5028 (r_ptr->level > randint1((p_ptr->lev*2 - 10) < 1 ? 1 : (p_ptr->lev*2 - 10)) + 10))
5030 /* Memorize a flag */
5031 if (r_ptr->flags3 & (RF3_NO_CONF))
5033 r_ptr->r_flags3 |= (RF3_NO_CONF);
5036 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5038 note = "is unaffected!";
5045 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5046 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±¶õ¤È¤Ê¤Ã¤¿¡£";
5048 msg_format("%^s is blasted by psionic energy.", m_name);
5049 note_dies = " collapses, a mindless husk.";
5052 do_conf = randint0(8) + 8;
5058 case GF_BRAIN_SMASH:
5060 if (seen) obvious = TRUE;
5063 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5065 msg_format("You gazes intently at %s.", m_name);
5068 if (r_ptr->flags3 & (RF3_RES_ALL))
5071 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5073 note = " is immune.";
5076 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5080 /* Attempt a saving throw */
5081 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5082 (r_ptr->flags3 & RF3_NO_CONF) ||
5083 (r_ptr->level > randint1((p_ptr->lev*2 - 10) < 1 ? 1 : (p_ptr->lev*2 - 10)) + 10))
5085 /* Memorize a flag */
5086 if (r_ptr->flags3 & (RF3_NO_CONF))
5088 r_ptr->r_flags3 |= (RF3_NO_CONF);
5091 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5093 note = "is unaffected!";
5100 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5101 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±¶õ¤È¤Ê¤Ã¤¿¡£";
5103 msg_format("%^s is blasted by psionic energy.", m_name);
5104 note_dies = " collapses, a mindless husk.";
5107 do_conf = randint0(8) + 8;
5108 do_stun = randint0(8) + 8;
5109 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5110 if (c_ptr->m_idx == p_ptr->riding)
5111 p_ptr->update |= (PU_BONUS);
5119 if (seen) obvious = TRUE;
5122 msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5124 msg_format("You points at %s and curses.", m_name);
5127 if (r_ptr->flags3 & (RF3_RES_ALL))
5130 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5132 note = " is immune.";
5135 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5139 /* Attempt a saving throw */
5140 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5144 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5146 note = "is unaffected!";
5156 if (seen) obvious = TRUE;
5159 msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5161 msg_format("You points at %s and curses horribly.", m_name);
5164 if (r_ptr->flags3 & (RF3_RES_ALL))
5167 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5169 note = " is immune.";
5172 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5176 /* Attempt a saving throw */
5177 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5181 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5183 note = "is unaffected!";
5193 if (seen) obvious = TRUE;
5196 msg_format("%s¤ò»Øº¹¤·¡¢¶²¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª",m_name);
5198 msg_format("You points at %s, incanting terribly!", m_name);
5201 if (r_ptr->flags3 & (RF3_RES_ALL))
5204 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5206 note = " is immune.";
5209 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5213 /* Attempt a saving throw */
5214 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5218 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5220 note = "is unaffected!";
5230 if (seen) obvious = TRUE;
5233 msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£",m_name);
5235 msg_format("You points at %s, screaming th word, 'DIE!'.", m_name);
5238 if (r_ptr->flags3 & (RF3_RES_ALL))
5241 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5243 note = " is immune.";
5246 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5250 /* Attempt a saving throw */
5251 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5255 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5257 note = "is unaffected!";
5267 if (seen) obvious = TRUE;
5269 if (r_ptr->flags3 & (RF3_RES_ALL))
5272 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5274 note = " is immune.";
5277 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5281 if (r_ptr->flags1 & RF1_UNIQUE)
5284 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5286 note = "is unaffected!";
5292 if ((p_ptr->lev + randint1(dam)) >
5293 (r_ptr->level + randint1(200)))
5295 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5297 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5302 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5312 /* Capture monster */
5316 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5317 (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_UNIQUE_7)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR))
5320 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5322 msg_format("%^s is unaffected.", m_name);
5328 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5329 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)))
5330 nokori_hp = m_ptr->maxhp * 3 / 10;
5332 nokori_hp = m_ptr->maxhp * 3 / 20;
5334 if (m_ptr->hp >= nokori_hp)
5337 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5339 msg_format("You need to weaken %s more.", m_name);
5343 else if (m_ptr->hp < randint0(nokori_hp))
5345 if (m_ptr->mflag2 & MFLAG_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5347 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5349 msg_format("You captures %^s!", m_name);
5351 cap_mon = m_list[c_ptr->m_idx].r_idx;
5352 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5353 cap_hp = m_list[c_ptr->m_idx].hp;
5354 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5355 if (m_list[c_ptr->m_idx].nickname)
5356 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5359 if (c_ptr->m_idx == p_ptr->riding)
5361 if (rakuba(-1, FALSE))
5364 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5366 msg_format("You have fallen from %s.", m_name);
5371 delete_monster_idx(c_ptr->m_idx);
5378 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5380 msg_format("You failed to capture %s.", m_name);
5389 if (seen) obvious = TRUE;
5391 if (dam == HISSATSU_NYUSIN)
5395 bool success = FALSE;
5396 for (i = 0; i < 8; i++)
5398 if (cave_empty_bold(y+ddy[i], x+ddx[i]) || ((y+ddy[i] == py) && (x+ddx[i] == px)))
5401 if (distance(py, px, ny, nx) > distance(py, px, y+ddy[i], x+ddx[i]))
5410 if ((ny != py) || (nx != px))
5412 teleport_player_to(ny, nx, FALSE);
5414 msg_print("ÁÇÁ᤯Áê¼ê¤Î²û¤ËÆþ¤ê¹þ¤ó¤À¡ª");
5416 msg_format("You quickly jump in and attack %s!", m_name);
5423 msg_print("¼ºÇÔ¡ª");
5425 msg_print("Failed!");
5432 return (py_attack(y, x, dam));
5435 msg_print("¹¶·â¤Ï¶õ¤òÀڤä¿¡£");
5437 msg_print("You attack the empty air.");
5443 /* Sleep (Use "dam" as "power") */
5449 if (seen) obvious = TRUE;
5451 if (r_ptr->flags3 & (RF3_RES_ALL))
5454 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5456 note = " is immune.";
5459 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5462 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5465 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5467 note = " is immune!";
5471 if (seen) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5477 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5479 note = " is immune!";
5486 if (one_in_(5)) effect = 1;
5487 else if (one_in_(4)) effect = 2;
5488 else if (one_in_(3)) effect = 3;
5493 /* Powerful monsters can resist */
5494 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5495 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5498 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5500 note = " is unaffected!";
5506 /* Normal monsters slow down */
5512 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5514 note = " starts moving slower.";
5517 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5519 if (c_ptr->m_idx == p_ptr->riding)
5520 p_ptr->update |= (PU_BONUS);
5524 else if (effect == 2)
5526 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5528 /* Attempt a saving throw */
5529 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5530 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5535 /* No obvious effect */
5537 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5539 note = " is unaffected!";
5546 else if (effect == 3)
5548 /* Attempt a saving throw */
5549 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5550 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5551 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5553 /* Memorize a flag */
5554 if (r_ptr->flags3 & RF3_NO_SLEEP)
5556 if (seen) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5559 /* No obvious effect */
5561 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5563 note = " is unaffected!";
5570 /* Go to sleep (much) later */
5572 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5574 note = " falls asleep!";
5584 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5586 note = " is immune!";
5590 /* No "real" damage */
5599 if (seen) obvious = TRUE;
5601 if (r_ptr->flags3 & (RF3_RES_ALL))
5604 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5606 note = " is immune.";
5609 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5613 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)
5620 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG_NOGENO))
5627 delete_monster_idx(c_ptr->m_idx);
5629 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5631 msg_format("%^s disappered!",m_name);
5635 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5637 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5641 chg_virtue(V_VITALITY, -1);
5646 p_ptr->redraw |= (PR_HP);
5649 p_ptr->window |= (PW_PLAYER);
5656 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5658 note = "is unaffected!";
5661 if (one_in_(13)) m_ptr->mflag2 |= MFLAG_NOGENO;
5669 msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£",m_name);
5671 msg_format("You take a photograph of %s.",m_name);
5674 if (r_ptr->flags3 & (RF3_HURT_LITE))
5676 /* Obvious effect */
5677 if (seen) obvious = TRUE;
5679 /* Memorize the effects */
5680 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5682 /* Special effect */
5684 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5685 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5687 note = " cringes from the light!";
5688 note_dies = " shrivels away in the light!";
5693 /* Normally no damage */
5700 photo = m_ptr->r_idx;
5707 case GF_BLOOD_CURSE:
5709 if (seen) obvious = TRUE;
5710 if (r_ptr->flags3 & (RF3_RES_ALL))
5713 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5715 note = " is immune.";
5718 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5726 bool success = FALSE;
5727 if (seen) obvious = TRUE;
5729 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5731 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5732 if (dam < 1) dam = 1;
5734 /* No need to tame your pet */
5738 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5740 note = " starts moving faster.";
5743 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5747 /* Attempt a saving throw */
5748 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5749 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5750 (m_ptr->mflag2 & MFLAG_NOPET) ||
5751 (p_ptr->cursed & TRC_AGGRAVATE) ||
5752 ((r_ptr->level+10) > randint1(dam)))
5755 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
5760 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5762 note = " is tamed!";
5766 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5768 /* Learn about type */
5769 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
5776 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5778 do_fear = randint1(90)+10;
5782 r_ptr->r_flags3 |= (RF3_NO_FEAR);
5786 /* No "real" damage */
5793 if (seen) obvious = TRUE;
5795 if (r_ptr->flags3 & (RF3_RES_ALL))
5798 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5800 note = " is immune.";
5803 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5807 /* Attempt a saving throw */
5808 if (randint0(100 + dam) < (r_ptr->level + 50))
5812 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5814 note = "is unaffected!";
5835 /* Absolutely no effect */
5836 if (skipped) return (FALSE);
5838 /* "Unique" monsters cannot be polymorphed */
5839 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5841 /* Quest monsters cannot be polymorphed */
5842 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5844 if (p_ptr->riding & (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5846 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5847 if (((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7) || (r_ptr->flags1 & RF1_QUESTOR)) && !p_ptr->inside_battle)
5849 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5854 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5855 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5858 /* Modify the damage */
5860 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5862 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤";
5864 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5867 /* Check for death */
5868 if (dam > m_ptr->hp)
5870 /* Extract method of death */
5874 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5875 else if (do_poly && (randint1(90) > r_ptr->level))
5877 if (polymorph_monster(y, x))
5880 if (seen) obvious = TRUE;
5882 /* Monster polymorphs */
5884 note = "¤¬ÊѿȤ·¤¿¡ª";
5890 /* Turn off the damage */
5893 /* Hack -- Get new monster */
5894 m_ptr = &m_list[c_ptr->m_idx];
5896 /* Hack -- Get new race */
5897 r_ptr = &r_info[m_ptr->r_idx];
5903 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5905 note = " is unaffected!";
5911 /* Handle "teleport" */
5915 if (seen) obvious = TRUE;
5919 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5921 note = " disappears!";
5924 chg_virtue(V_VALOUR, -1);
5927 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who));
5929 /* Hack -- get new location */
5933 /* Hack -- get new grid */
5934 c_ptr = &cave[y][x];
5937 /* Sound and Impact breathers never stun */
5939 !(r_ptr->flags4 & (RF4_BR_SOUN)) &&
5940 !(r_ptr->flags4 & (RF4_BR_WALL)) &&
5941 !(r_ptr->flags3 & (RF3_NO_STUN)))
5944 if (seen) obvious = TRUE;
5950 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5952 note = " is more dazed.";
5955 tmp = m_ptr->stunned + (do_stun / 2);
5960 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5962 note = " is dazed.";
5969 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5975 /* Confusion and Chaos breathers (and sleepers) never confuse */
5977 !(r_ptr->flags3 & (RF3_NO_CONF)) &&
5978 !(r_ptr->flags4 & (RF4_BR_CONF)) &&
5979 !(r_ptr->flags4 & (RF4_BR_CHAO)))
5982 if (seen) obvious = TRUE;
5984 /* Already partially confused */
5985 if (m_ptr->confused)
5988 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5990 note = " looks more confused.";
5993 tmp = m_ptr->confused + (do_conf / 2);
5996 /* Was not confused */
6000 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
6002 note = " looks confused.";
6008 /* Apply confusion */
6009 m_ptr->confused = (tmp < 200) ? tmp : 200;
6017 if (seen) obvious = TRUE;
6019 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp-1;
6024 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
6026 note = " seems weakened.";
6028 m_ptr->maxhp -= do_time;
6029 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp-m_ptr->maxhp;
6039 tmp = m_ptr->monfear + do_fear;
6042 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6049 /* If another monster did the damage, hurt the monster by hand */
6052 /* Redraw (later) if needed */
6053 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6054 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6056 /* Wake the monster up */
6059 /* Hurt the monster */
6067 if (is_pet(m_ptr) && !(m_ptr->ml))
6070 /* Give detailed messages if destroyed */
6073 monster_desc(m_name, m_ptr, 0x100);
6076 msg_format("%^s%s", m_name, note);
6084 monster_gain_exp(who, m_ptr->r_idx);
6086 /* Generate treasure, etc */
6087 monster_death(c_ptr->m_idx, FALSE);
6089 /* Delete the monster */
6090 delete_monster_idx(c_ptr->m_idx);
6095 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6097 msg_print("You feel sad for a moment.");
6103 /* Damaged monster */
6106 /* Give detailed messages if visible or destroyed */
6107 if (note && seen) msg_format("%^s%s", m_name, note);
6109 /* Hack -- Pain message */
6112 message_pain(c_ptr->m_idx, dam);
6119 /* Hack -- handle sleep */
6120 if (do_sleep) m_ptr->csleep = do_sleep;
6124 else if (heal_leper)
6127 msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6129 msg_print("The Mangy looking leper is healed!");
6132 delete_monster_idx(c_ptr->m_idx);
6134 /* If the player did it, give him experience, check fear */
6135 else if (typ != GF_DRAIN_MANA)
6139 /* Hurt the monster, check for fear and death */
6140 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6145 /* Damaged monster */
6148 /* HACK - anger the monster before showing the sleep message */
6149 if (do_sleep) anger_monster(m_ptr);
6151 /* Give detailed messages if visible or destroyed */
6154 msg_format("%s%s", m_name, note);
6156 msg_format("%^s%s", m_name, note);
6160 /* Hack -- Pain message */
6161 else if (known && (dam || !do_fear))
6163 message_pain(c_ptr->m_idx, dam);
6166 /* Anger monsters */
6167 if (((dam > 0) || get_angry) && !do_sleep)
6168 anger_monster(m_ptr);
6171 if ((fear || do_fear) && (m_ptr->ml))
6178 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6180 msg_format("%^s flees in terror!", m_name);
6185 /* Hack -- handle sleep */
6186 if (do_sleep) m_ptr->csleep = do_sleep;
6190 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6192 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6196 switch (randint1(28))
6202 msg_print("ÃÏÌ̤¬Íɤ줿...");
6204 msg_print("The ground trembles...");
6207 earthquake(ty, tx, 4 + randint0(4));
6208 if (!one_in_(6)) break;
6210 case 3: case 4: case 5: case 6:
6213 int dam = damroll(10, 10);
6215 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6217 msg_print("A portal opens to a plane of raw mana!");
6220 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6221 if (!one_in_(6)) break;
6227 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6229 msg_print("Space warps about you!");
6232 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE);
6233 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6234 if (!one_in_(6)) break;
6236 case 9: case 10: case 11:
6238 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6240 msg_print("You feel a surge of energy!");
6243 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6244 if (!one_in_(6)) break;
6245 case 12: case 13: case 14: case 15: case 16:
6246 aggravate_monsters(0);
6247 if (!one_in_(6)) break;
6249 count += activate_hi_summon(ty, tx, TRUE);
6250 if (!one_in_(6)) break;
6251 case 19: case 20: case 21: case 22:
6253 bool pet = !one_in_(3);
6254 u32b mode = PM_ALLOW_GROUP;
6256 if (pet) mode |= PM_FORCE_PET;
6257 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6259 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6260 if (!one_in_(6)) break;
6262 case 23: case 24: case 25:
6263 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6265 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6267 msg_print("You feel your life draining away...");
6270 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6271 else lose_exp(p_ptr->exp / 16);
6272 if (!one_in_(6)) break;
6273 case 26: case 27: case 28:
6282 (void)do_dec_stat(i);
6291 (void)do_dec_stat(randint0(6));
6300 if (p_ptr->inside_battle)
6302 p_ptr->health_who = c_ptr->m_idx;
6303 p_ptr->redraw |= (PR_HEALTH);
6307 /* XXX XXX XXX Verify this code */
6309 /* Update the monster */
6310 update_mon(c_ptr->m_idx, FALSE);
6312 /* Redraw the monster grid */
6316 /* Update monster recall window */
6317 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6320 p_ptr->window |= (PW_MONSTER);
6323 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6327 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6329 set_target(m_ptr, monster_target_y, monster_target_x);
6332 else if (is_pet(&m_list[who]) && (m_ptr->target_y != py) && (m_ptr->target_x != px))
6334 set_target(m_ptr, m_list[who].fy, m_list[who].fx);
6338 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6340 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6341 rakubadam_m = (dam > 200) ? 200 : dam;
6350 /* Get local object */
6353 /* Prepare to make a Blade of Chaos */
6354 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6356 q_ptr->pval = photo;
6358 /* Mark the item as fully known */
6359 q_ptr->ident |= (IDENT_MENTAL);
6361 /* Drop it in the dungeon */
6362 (void)drop_near(q_ptr, -1, py, px);
6370 /* Return "Anything seen?" */
6376 * Helper function for "project()" below.
6378 * Handle a beam/bolt/ball causing damage to the player.
6380 * This routine takes a "source monster" (by index), a "distance", a default
6381 * "damage", and a "damage type". See "project_m()" above.
6383 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6384 * is reduced (see "project_m()" above). This can happen if a monster breathes
6385 * at the player and hits a wall instead.
6387 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6388 * to know if this is actually a ball or a bolt spell
6391 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6392 * we just assume that the effects were obvious, for historical reasons.
6394 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int a_rad, int monspell)
6398 /* Hack -- assume obvious */
6399 bool obvious = TRUE;
6401 /* Player blind-ness */
6402 bool blind = (p_ptr->blind ? TRUE : FALSE);
6404 /* Player needs a "description" (he is blind) */
6407 /* Source monster */
6408 monster_type *m_ptr;
6410 /* Monster name (for attacks) */
6413 /* Monster name (for damage) */
6416 /* Hack -- messages */
6422 /* Player is not here */
6423 if ((x != px) || (y != py)) return (FALSE);
6425 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6431 /* Player cannot hurt himself */
6432 if (!who) return (FALSE);
6433 if (who == p_ptr->riding) return (FALSE);
6435 if ((p_ptr->reflect || p_ptr->tim_reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && !a_rad && !one_in_(10) && (typ != GF_PSY_SPEAR))
6438 int max_attempts = 10;
6441 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6442 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6443 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6445 if (blind) msg_print("Something bounces!");
6446 else msg_print("The attack bounces!");
6450 /* Choose 'new' target */
6453 t_y = m_list[who].fy - 1 + randint1(3);
6454 t_x = m_list[who].fx - 1 + randint1(3);
6457 while (max_attempts && in_bounds2u(t_y, t_x) &&
6458 !(player_has_los_bold(t_y, t_x)));
6460 if (max_attempts < 1)
6462 t_y = m_list[who].fy;
6463 t_x = m_list[who].fx;
6466 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL), monspell);
6473 /* Limit maximum damage */
6474 if (dam > 1600) dam = 1600;
6476 /* Reduce damage by distance */
6477 dam = (dam + r) / (r + 1);
6480 /* If the player is blind, be more descriptive */
6481 if (blind) fuzzy = TRUE;
6484 /* Get the source monster */
6485 m_ptr = &m_list[who];
6487 /* Get the monster name */
6488 monster_desc(m_name, m_ptr, 0);
6490 /* Get the monster's real name (gotten before polymorph!) */
6491 strcpy(killer, who_name);
6493 /* Analyze the damage */
6496 /* Standard damage -- hurts inventory too */
6500 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6502 if (fuzzy) msg_print("You are hit by acid!");
6505 acid_dam(dam, killer, monspell);
6509 /* Standard damage -- hurts inventory too */
6513 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6515 if (fuzzy) msg_print("You are hit by fire!");
6518 fire_dam(dam, killer, monspell);
6522 /* Standard damage -- hurts inventory too */
6526 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6528 if (fuzzy) msg_print("You are hit by cold!");
6531 cold_dam(dam, killer, monspell);
6535 /* Standard damage -- hurts inventory too */
6539 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6541 if (fuzzy) msg_print("You are hit by lightning!");
6544 elec_dam(dam, killer, monspell);
6548 /* Standard damage -- also poisons player */
6551 bool double_resist = (p_ptr->oppose_pois || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU));
6553 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6555 if (fuzzy) msg_print("You are hit by poison!");
6558 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6559 if (double_resist) dam = (dam + 2) / 3;
6561 if ((!(double_resist || p_ptr->resist_pois)) &&
6562 one_in_(HURT_CHANCE))
6567 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6569 if (!(double_resist || p_ptr->resist_pois))
6571 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6576 /* Standard damage -- also poisons / mutates player */
6579 bool double_resist = (p_ptr->oppose_pois || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU));
6581 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6583 if (fuzzy) msg_print("You are hit by radiation!");
6586 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6587 if (double_resist) dam = (2 * dam + 2) / 5;
6588 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6589 if (!(double_resist || p_ptr->resist_pois))
6591 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6593 if (one_in_(5)) /* 6 */
6596 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6598 msg_print("You undergo a freakish metamorphosis!");
6601 if (one_in_(4)) /* 4 */
6609 inven_damage(set_acid_destroy, 2);
6615 /* Standard damage */
6619 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6621 if (fuzzy) msg_print("You are hit by something!");
6624 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6628 /* Holy Orb -- Player only takes partial damage */
6632 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6634 if (fuzzy) msg_print("You are hit by something!");
6637 if (p_ptr->align > 10)
6639 else if (p_ptr->align < -10)
6641 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6648 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6650 if (fuzzy) msg_print("You are hit by something!");
6653 if (p_ptr->align > 10)
6655 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6659 /* Arrow -- XXX no dodging */
6663 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6665 if (fuzzy) msg_print("You are hit by something sharp!");
6668 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6671 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6673 msg_print("You cut down the arrow!");
6677 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6681 /* Plasma -- XXX No resist */
6685 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6687 if (fuzzy) msg_print("You are hit by something *HOT*!");
6690 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6692 if (!p_ptr->resist_sound)
6694 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6695 (void)set_stun(p_ptr->stun + k);
6698 if (!(p_ptr->resist_fire ||
6699 p_ptr->oppose_fire ||
6700 music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU) ||
6701 p_ptr->immune_fire))
6703 inven_damage(set_acid_destroy, 3);
6709 /* Nether -- drain experience */
6713 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6715 if (fuzzy) msg_print("You are hit by nether forces!");
6719 if (p_ptr->resist_neth)
6721 if (!prace_is_(RACE_SPECTRE))
6722 dam *= 6; dam /= (randint1(4) + 7);
6724 else if (p_ptr->prace != RACE_ANDROID)
6726 if (p_ptr->hold_life && (randint0(100) < 75))
6729 msg_print("¤·¤«¤·¼«¸Ê¤ÎÀ¸Ì¿ÎϤò¼é¤ê¤¤Ã¤¿¡ª");
6731 msg_print("You keep hold of your life force!");
6735 else if (p_ptr->hold_life)
6738 msg_print("À¸Ì¿ÎϤ¬¾¯¤·ÂΤ«¤éÈ´¤±Íî¤Á¤¿µ¤¤¬¤¹¤ë¡ª");
6740 msg_print("You feel your life slipping away!");
6743 lose_exp(200 + (p_ptr->exp / 1000) * MON_DRAIN_LIFE);
6748 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6750 msg_print("You feel your life draining away!");
6753 lose_exp(200 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
6757 if (prace_is_(RACE_SPECTRE))
6760 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6762 msg_print("You feel invigorated!");
6766 learn_spell(monspell);
6770 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6776 /* Water -- stun/confuse */
6780 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6782 if (fuzzy) msg_print("You are hit by something wet!");
6785 if (!p_ptr->resist_sound)
6787 set_stun(p_ptr->stun + randint1(40));
6789 if (!p_ptr->resist_conf)
6791 set_confused(p_ptr->confused + randint1(5) + 5);
6796 inven_damage(set_cold_destroy, 3);
6799 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6803 /* Chaos -- many effects */
6807 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6809 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6812 if (p_ptr->resist_chaos)
6814 dam *= 6; dam /= (randint1(4) + 7);
6816 if (!p_ptr->resist_conf)
6818 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6820 if (!p_ptr->resist_chaos)
6822 (void)set_image(p_ptr->image + randint1(10));
6826 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6828 msg_print("Your body is twisted by chaos!");
6831 (void)gain_random_mutation(0);
6834 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6836 if (p_ptr->prace == RACE_ANDROID)
6839 else if (p_ptr->hold_life && (randint0(100) < 75))
6842 msg_print("¤·¤«¤·¼«¸Ê¤ÎÀ¸Ì¿ÎϤò¼é¤ê¤¤Ã¤¿¡ª");
6844 msg_print("You keep hold of your life force!");
6848 else if (p_ptr->hold_life)
6851 msg_print("À¸Ì¿ÎϤ¬¾¯¤·ÂΤ«¤éÈ´¤±Íî¤Á¤¿µ¤¤¬¤¹¤ë¡ª");
6853 msg_print("You feel your life slipping away!");
6856 lose_exp(500 + (p_ptr->exp / 1000) * MON_DRAIN_LIFE);
6861 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6863 msg_print("You feel your life draining away!");
6866 lose_exp(5000 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
6869 if (!p_ptr->resist_chaos || one_in_(9))
6871 inven_damage(set_elec_destroy, 2);
6872 inven_damage(set_fire_destroy, 2);
6874 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6878 /* Shards -- mostly cutting */
6882 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6884 if (fuzzy) msg_print("You are hit by something sharp!");
6887 if (p_ptr->resist_shard)
6889 dam *= 6; dam /= (randint1(4) + 7);
6893 (void)set_cut(p_ptr->cut + dam);
6896 if (!p_ptr->resist_shard || one_in_(13))
6898 inven_damage(set_cold_destroy, 2);
6901 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6905 /* Sound -- mostly stunning */
6909 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6911 if (fuzzy) msg_print("You are hit by a loud noise!");
6914 if (p_ptr->resist_sound)
6916 dam *= 5; dam /= (randint1(4) + 7);
6920 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6921 (void)set_stun(p_ptr->stun + k);
6924 if (!p_ptr->resist_sound || one_in_(13))
6926 inven_damage(set_cold_destroy, 2);
6929 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6933 /* Pure confusion */
6937 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6939 if (fuzzy) msg_print("You are hit by something puzzling!");
6942 if (p_ptr->resist_conf)
6944 dam *= 5; dam /= (randint1(4) + 7);
6946 if (!p_ptr->resist_conf)
6948 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6950 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6954 /* Disenchantment -- see above */
6958 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6960 if (fuzzy) msg_print("You are hit by something static!");
6963 if (p_ptr->resist_disen)
6965 dam *= 6; dam /= (randint1(4) + 7);
6969 (void)apply_disenchant(0);
6971 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6975 /* Nexus -- see above */
6979 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6981 if (fuzzy) msg_print("You are hit by something strange!");
6984 if (p_ptr->resist_nexus)
6986 dam *= 6; dam /= (randint1(4) + 7);
6992 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6996 /* Force -- mostly stun */
7000 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7002 if (fuzzy) msg_print("You are hit by kinetic force!");
7005 if (!p_ptr->resist_sound)
7007 (void)set_stun(p_ptr->stun + randint1(20));
7009 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7014 /* Rocket -- stun, cut */
7018 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
7020 if (fuzzy) msg_print("There is an explosion!");
7023 if (!p_ptr->resist_sound)
7025 (void)set_stun(p_ptr->stun + randint1(20));
7027 if (p_ptr->resist_shard)
7033 (void)set_cut(p_ptr-> cut + ( dam / 2));
7036 if ((!p_ptr->resist_shard) || one_in_(12))
7038 inven_damage(set_cold_destroy, 3);
7041 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7045 /* Inertia -- slowness */
7049 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7051 if (fuzzy) msg_print("You are hit by something slow!");
7054 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7055 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7059 /* Lite -- blinding */
7063 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7065 if (fuzzy) msg_print("You are hit by something!");
7068 if (p_ptr->resist_lite)
7070 dam *= 4; dam /= (randint1(4) + 7);
7072 else if (!blind && !p_ptr->resist_blind)
7074 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7076 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
7079 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
7081 msg_print("The light scorches your flesh!");
7086 else if (prace_is_(RACE_S_FAIRY))
7090 if (p_ptr->wraith_form) dam *= 2;
7091 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7093 if (p_ptr->wraith_form)
7095 p_ptr->wraith_form = 0;
7097 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7099 msg_print("The light forces you out of your incorporeal shadow form.");
7102 p_ptr->redraw |= PR_MAP;
7103 /* Update monsters */
7104 p_ptr->update |= (PU_MONSTERS);
7106 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7108 /* Redraw status bar */
7109 p_ptr->redraw |= (PR_STATUS);
7116 /* Dark -- blinding */
7120 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7122 if (fuzzy) msg_print("You are hit by something!");
7125 if (p_ptr->resist_dark)
7127 dam *= 4; dam /= (randint1(4) + 7);
7129 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7131 else if (!blind && !p_ptr->resist_blind)
7133 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7135 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7139 /* Time -- bolt fewer effects XXX */
7143 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7145 if (fuzzy) msg_print("You are hit by a blast from the past!");
7148 if (p_ptr->resist_time)
7151 dam /= (randint1(4) + 7);
7153 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7155 msg_print("You feel as if time is passing you by.");
7161 switch (randint1(10))
7163 case 1: case 2: case 3: case 4: case 5:
7165 if (p_ptr->prace == RACE_ANDROID) break;
7167 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7169 msg_print("You feel life has clocked back.");
7172 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7176 case 6: case 7: case 8: case 9:
7178 switch (randint1(6))
7181 case 1: k = A_STR; act = "¶¯¤¯"; break;
7182 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7183 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7184 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7185 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7186 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7188 case 1: k = A_STR; act = "strong"; break;
7189 case 2: k = A_INT; act = "bright"; break;
7190 case 3: k = A_WIS; act = "wise"; break;
7191 case 4: k = A_DEX; act = "agile"; break;
7192 case 5: k = A_CON; act = "hale"; break;
7193 case 6: k = A_CHR; act = "beautiful"; break;
7199 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7201 msg_format("You're not as %s as you used to be...", act);
7205 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7206 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7207 p_ptr->update |= (PU_BONUS);
7214 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7216 msg_print("You're not as powerful as you used to be...");
7220 for (k = 0; k < 6; k++)
7222 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7223 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7225 p_ptr->update |= (PU_BONUS);
7231 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7235 /* Gravity -- stun plus slowness plus teleport */
7239 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7240 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7242 if (fuzzy) msg_print("You are hit by something heavy!");
7243 msg_print("Gravity warps around you.");
7248 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7249 if (!(p_ptr->resist_sound || p_ptr->ffall))
7251 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7252 (void)set_stun(p_ptr->stun + k);
7256 dam = (dam * 2) / 3;
7259 if (!p_ptr->ffall || one_in_(13))
7261 inven_damage(set_cold_destroy, 2);
7264 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7268 /* Standard damage */
7269 case GF_DISINTEGRATE:
7272 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7274 if (fuzzy) msg_print("You are hit by pure energy!");
7277 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7284 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7286 if (fuzzy) msg_print("You are hit by something invigorating!");
7289 (void)hp_player(dam);
7297 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7299 if (fuzzy) msg_print("You are hit by something!");
7302 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7310 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7312 if (fuzzy) msg_print("You are hit by something slow!");
7315 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7321 if (p_ptr->free_act) break;
7323 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7325 if (fuzzy) msg_print("You fall asleep!");
7329 if (ironman_nightmare)
7332 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7334 msg_print("A horrible vision enters your mind.");
7338 /* Pick a nightmare */
7339 get_mon_num_prep(get_nightmare, NULL);
7341 /* Have some nightmares */
7342 have_nightmare(get_mon_num(MAX_DEPTH));
7344 /* Remove the monster restriction */
7345 get_mon_num_prep(NULL, NULL);
7348 set_paralyzed(p_ptr->paralyzed + dam);
7359 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7361 if (fuzzy) msg_print("You are hit by an aura of magic!");
7364 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7372 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7374 if (fuzzy) msg_print("You are hit by an energy!");
7377 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7385 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7387 if (fuzzy) msg_print("Something falls from the sky on you!");
7390 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7391 if (!p_ptr->resist_shard || one_in_(13))
7393 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7394 inven_damage(set_cold_destroy, 2);
7400 /* Ice -- cold plus stun plus cuts */
7404 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7406 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7409 cold_dam(dam, killer, monspell);
7410 if (!p_ptr->resist_shard)
7412 (void)set_cut(p_ptr->cut + damroll(5, 8));
7414 if (!p_ptr->resist_sound)
7416 (void)set_stun(p_ptr->stun + randint1(15));
7419 if ((!(p_ptr->resist_cold || p_ptr->oppose_cold || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))) || one_in_(12))
7421 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7431 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7433 if (fuzzy) msg_print("You are hit by something extremely cold!");
7437 if (p_ptr->mimic_form)
7439 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7440 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7445 switch (p_ptr->prace)
7447 /* Some races are immune */
7461 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7481 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7484 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7486 char m_name_self[80];
7489 monster_desc(m_name_self, m_ptr, 0x23);
7491 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7493 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL | PROJECT_NO_REF, -1);
7494 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7497 if (p_ptr->riding && dam > 0)
7499 rakubadam_p = (dam > 200) ? 200 : dam;
7507 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7513 /* Return "Anything seen?" */
7519 * Find the distance from (x, y) to a line.
7521 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7523 /* Vector from (x, y) to (x1, y1) */
7532 int pd = distance(y1, x1, y, x);
7533 int nd = distance(y1, x1, y2, x2);
7535 if (pd > nd) return distance(y, x, y2, x2);
7537 /* Component of P on N */
7538 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7540 /* Absolute value */
7541 return((nd >= 0) ? nd : 0 - nd);
7548 * Modified version of los() for calculation of disintegration balls.
7549 * Disintegration effects are stopped by permanent walls.
7551 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7571 /* Slope, or 1/Slope, of LOS */
7575 /* Extract the offset */
7579 /* Extract the absolute offset */
7584 /* Handle adjacent (or identical) grids */
7585 if ((ax < 2) && (ay < 2)) return (TRUE);
7588 /* Paranoia -- require "safe" origin */
7589 /* if (!in_bounds(y1, x1)) return (FALSE); */
7592 /* Directly South/North */
7595 /* South -- check for walls */
7598 for (ty = y1 + 1; ty < y2; ty++)
7600 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7604 /* North -- check for walls */
7607 for (ty = y1 - 1; ty > y2; ty--)
7609 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7617 /* Directly East/West */
7620 /* East -- check for walls */
7623 for (tx = x1 + 1; tx < x2; tx++)
7625 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7629 /* West -- check for walls */
7632 for (tx = x1 - 1; tx > x2; tx--)
7634 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7643 /* Extract some signs */
7644 sx = (dx < 0) ? -1 : 1;
7645 sy = (dy < 0) ? -1 : 1;
7648 /* Vertical "knights" */
7653 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7657 /* Horizontal "knights" */
7662 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7667 /* Calculate scale factor div 2 */
7670 /* Calculate scale factor */
7674 /* Travel horizontally */
7677 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7683 /* Consider the special case where slope == 1. */
7694 /* Note (below) the case (qy == f2), where */
7695 /* the LOS exactly meets the corner of a tile. */
7698 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7709 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7722 /* Travel vertically */
7725 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7741 /* Note (below) the case (qx == f2), where */
7742 /* the LOS exactly meets the corner of a tile. */
7745 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7756 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7776 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)
7789 while (bdis <= distance(y1, x1, y2, x2) + rad)
7791 /* Travel from center outward */
7792 for (cdis = 0; cdis <= brad; cdis++)
7795 /* Scan the maximal blast area of radius "cdis" */
7796 for (y = by - cdis; y <= by + cdis; y++)
7798 for (x = bx - cdis; x <= bx + cdis; x++)
7800 /* Ignore "illegal" locations */
7801 if (!in_bounds(y, x)) continue;
7803 /* Enforce a circular "ripple" */
7804 if (distance(y1, x1, y, x) != bdis) continue;
7806 /* Enforce an arc */
7807 if (distance(by, bx, y, x) != cdis) continue;
7811 /* Disintegration balls explosions are stopped by perma-walls */
7812 if (!in_disintegration_range(by, bx, y, x)) continue;
7814 if (real_breath && cave_valid_bold(y, x) &&
7815 (cave[y][x].feat < FEAT_PATTERN_START ||
7816 cave[y][x].feat > FEAT_PATTERN_XTRA2) &&
7817 (cave[y][x].feat < FEAT_DEEP_WATER ||
7818 cave[y][x].feat > FEAT_GRASS))
7820 if (cave[y][x].feat == FEAT_TREES)
7821 cave_set_feat(y, x, FEAT_GRASS);
7824 cave[y][x].feat = floor_type[randint0(100)];
7827 /* Update some things -- similar to GF_KILL_WALL */
7828 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
7832 /* The blast is stopped by walls */
7833 if (!los(by, bx, y, x)) continue;
7836 /* Save this grid */
7844 /* Encode some more "radius" info */
7845 gm[bdis + 1] = *pgrids;
7848 if ((by == y2) && (bx == x2)) done = TRUE;
7857 /* Ripple outwards */
7858 /* mmove2(&by, &bx, y1, x1, y2, x2); */
7860 by = GRID_Y(path_g[bdis]);
7861 bx = GRID_X(path_g[bdis]);
7863 /* Find the next ripple */
7866 /* Increase the size */
7867 brad = (rad * bdis) / dist;
7870 /* Store the effect size */
7876 * Generic "beam"/"bolt"/"ball" projection routine.
7879 * who: Index of "source" monster (zero for "player")
7880 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
7881 * y,x: Target location (or location to travel "towards")
7882 * dam: Base damage roll to apply to affected monsters (or player)
7883 * typ: Type of damage to apply to monsters (and objects)
7884 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
7887 * TRUE if any "effects" of the projection were observed, else FALSE
7889 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
7890 * towards a given location (optionally passing over the heads of interposing
7891 * monsters), and have it do a given amount of damage to the monsters (and
7892 * optionally objects) within the given radius of the final location.
7894 * A "bolt" travels from source to target and affects only the target grid.
7895 * A "beam" travels from source to target, affecting all grids passed through.
7896 * A "ball" travels from source to the target, exploding at the target, and
7897 * affecting everything within the given radius of the target location.
7899 * Traditionally, a "bolt" does not affect anything on the ground, and does
7900 * not pass over the heads of interposing monsters, much like a traditional
7901 * missile, and will "stop" abruptly at the "target" even if no monster is
7902 * positioned there, while a "ball", on the other hand, passes over the heads
7903 * of monsters between the source and target, and affects everything except
7904 * the source monster which lies within the final radius, while a "beam"
7905 * affects every monster between the source and target, except for the casting
7906 * monster (or player), and rarely affects things on the ground.
7908 * Two special flags allow us to use this function in special ways, the
7909 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
7910 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
7911 * actually projecting from the source monster (or player).
7913 * The player will only get "experience" for monsters killed by himself
7914 * Unique monsters can only be destroyed by attacks from the player
7916 * Only 256 grids can be affected per projection, limiting the effective
7917 * "radius" of standard ball attacks to nine units (diameter nineteen).
7919 * One can project in a given "direction" by combining PROJECT_THRU with small
7920 * offsets to the initial location (see "line_spell()"), or by calculating
7921 * "virtual targets" far away from the player.
7923 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
7924 * continuing until it actually hits somethings (useful for "stone to mud").
7926 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
7928 * Balls must explode BEFORE hitting walls, or they would affect monsters
7929 * on both sides of a wall. Some bug reports indicate that this is still
7930 * happening in 2.7.8 for Windows, though it appears to be impossible.
7932 * We "pre-calculate" the blast area only in part for efficiency.
7933 * More importantly, this lets us do "explosions" from the "inside" out.
7934 * This results in a more logical distribution of "blast" treasure.
7935 * It also produces a better (in my opinion) animation of the explosion.
7936 * It could be (but is not) used to have the treasure dropped by monsters
7937 * in the middle of the explosion fall "outwards", and then be damaged by
7938 * the blast as it spreads outwards towards the treasure drop location.
7940 * Walls and doors are included in the blast area, so that they can be
7941 * "burned" or "melted" in later versions.
7943 * This algorithm is intended to maximize simplicity, not necessarily
7944 * efficiency, since this function is not a bottleneck in the code.
7946 * We apply the blast effect from ground zero outwards, in several passes,
7947 * first affecting features, then objects, then monsters, then the player.
7948 * This allows walls to be removed before checking the object or monster
7949 * in the wall, and protects objects which are dropped by monsters killed
7950 * in the blast, and allows the player to see all affects before he is
7951 * killed or teleported away. The semantics of this method are open to
7952 * various interpretations, but they seem to work well in practice.
7954 * We process the blast area from ground-zero outwards to allow for better
7955 * distribution of treasure dropped by monsters, and because it provides a
7956 * pleasing visual effect at low cost.
7958 * Note that the damage done by "ball" explosions decreases with distance.
7959 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
7961 * Notice the "napalm" effect of "beam" weapons. First they "project" to
7962 * the target, and then the damage "flows" along this beam of destruction.
7963 * The damage at every grid is the same as at the "center" of a "ball"
7964 * explosion, since the "beam" grids are treated as if they ARE at the
7965 * center of a "ball" explosion.
7967 * Currently, specifying "beam" plus "ball" means that locations which are
7968 * covered by the initial "beam", and also covered by the final "ball", except
7969 * for the final grid (the epicenter of the ball), will be "hit twice", once
7970 * by the initial beam, and once by the exploding ball. For the grid right
7971 * next to the epicenter, this results in 150% damage being done. The center
7972 * does not have this problem, for the same reason the final grid in a "beam"
7973 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
7974 * grids which are covered by the "ball" will NOT work, as then they will
7975 * receive LESS damage than they should. Do not combine "beam" with "ball".
7977 * The array "gy[],gx[]" with current size "grids" is used to hold the
7978 * collected locations of all grids in the "blast area" plus "beam path".
7980 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
7981 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
7982 * first blast grid (see above) with radius "N" from the blast center. Note
7983 * that only the first gm[1] grids in the blast area thus take full damage.
7984 * Also, note that gm[rad+1] is always equal to "grids", which is the total
7985 * number of blast grids.
7987 * Note that once the projection is complete, (y2,x2) holds the final location
7988 * of bolts/beams, and the "epicenter" of balls.
7990 * Note also that "rad" specifies the "inclusive" radius of projection blast,
7991 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
7992 * implementation of the "distance" function. Also, a bolt can be properly
7993 * viewed as a "ball" with a "rad" of "zero".
7995 * Note that if no "target" is reached before the beam/bolt/ball travels the
7996 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
7997 * may be relevant even for bolts, since they have a "1x1" mini-blast.
7999 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8000 * to move from point A to point B, even if the player cannot see part of the
8001 * projection path. Note that in general, the player will *always* see part
8002 * of the path, since it either starts at the player or ends on the player.
8004 * Hack -- we assume that every "projection" is "self-illuminating".
8006 * Hack -- when only a single monster is affected, we automatically track
8007 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8009 * Note that all projections now "explode" at their final destination, even
8010 * if they were being projected at a more distant destination. This means
8011 * that "ball" spells will *always* explode.
8013 * Note that we must call "handle_stuff()" after affecting terrain features
8014 * in the blast radius, in case the "illumination" of the grid was changed,
8015 * and "update_view()" and "update_monsters()" need to be called.
8017 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8026 int y_saver, x_saver; /* For reflecting monsters */
8028 int msec = delay_factor * delay_factor * delay_factor;
8030 /* Assume the player sees nothing */
8031 bool notice = FALSE;
8033 /* Assume the player has seen nothing */
8034 bool visual = FALSE;
8036 /* Assume the player has seen no blast grids */
8039 /* Assume to be a normal ball spell */
8040 bool breath = FALSE;
8042 /* Is the player blind? */
8043 bool blind = (p_ptr->blind ? TRUE : FALSE);
8045 bool old_hide = FALSE;
8047 /* Number of grids in the "path" */
8050 /* Actual grids in the "path" */
8053 /* Number of grids in the "blast area" (including the "beam" path) */
8056 /* Coordinates of the affected grids */
8057 byte gx[1024], gy[1024];
8059 /* Encoded "radius" info (see above) */
8062 /* Actual radius encoded in gm[] */
8067 /* Attacker's name (prepared before polymorph)*/
8073 /* Default target of monsterspell is player */
8074 monster_target_y=py;
8075 monster_target_x=px;
8077 /* Hack -- Jump to target */
8078 if (flg & (PROJECT_JUMP))
8083 /* Clear the flag */
8084 flg &= ~(PROJECT_JUMP);
8089 /* Start at player */
8096 /* Start at monster */
8099 x1 = m_list[who].fx;
8100 y1 = m_list[who].fy;
8101 monster_desc(who_name, &m_list[who], 0x288);
8114 /* Default "destination" */
8119 /* Hack -- verify stuff */
8120 if (flg & (PROJECT_THRU))
8122 if ((x1 == x2) && (y1 == y2))
8124 flg &= ~(PROJECT_THRU);
8128 /* Handle a breath attack */
8133 if (flg & PROJECT_HIDE) old_hide = TRUE;
8134 flg |= PROJECT_HIDE;
8138 /* Hack -- Assume there will be no blast (max radius 32) */
8139 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8147 /* Collect beam grids */
8148 if (flg & (PROJECT_BEAM))
8155 if (breath && typ == GF_DISINTEGRATE)
8157 flg |= (PROJECT_DISI);
8160 /* Calculate the projection path */
8162 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8164 /* Hack -- Handle stuff */
8167 /* Giga-Hack SEEKER & SUPER_RAY */
8169 if( typ == GF_SEEKER )
8179 for (i = 0; i < path_n; ++i)
8184 int ny = GRID_Y(path_g[i]);
8185 int nx = GRID_X(path_g[i]);
8196 /* Only do visuals if requested */
8197 if (!blind && !(flg & (PROJECT_HIDE)))
8199 /* Only do visuals if the player can "see" the bolt */
8200 if (panel_contains(y, x) && player_has_los_bold(y, x))
8207 /* Obtain the bolt pict */
8208 p = bolt_pict(oy, ox, y, x, typ);
8210 /* Extract attr/char */
8214 /* Visual effects */
8215 print_rel(c, a, y, x);
8216 move_cursor_relative(y, x);
8217 /*if (fresh_before)*/ Term_fresh();
8218 Term_xtra(TERM_XTRA_DELAY, msec);
8220 /*if (fresh_before)*/ Term_fresh();
8222 /* Display "beam" grids */
8223 if (flg & (PROJECT_BEAM))
8225 /* Obtain the explosion pict */
8226 p = bolt_pict(y, x, y, x, typ);
8228 /* Extract attr/char */
8232 /* Visual effects */
8233 print_rel(c, a, y, x);
8236 /* Hack -- Activate delay */
8240 /* Hack -- delay anyway for consistency */
8243 /* Delay for consistency */
8244 Term_xtra(TERM_XTRA_DELAY, msec);
8247 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8248 if( (cave[y][x].info & CAVE_IN_MIRROR))
8250 /* The target of monsterspell becomes tha mirror(broken) */
8251 monster_target_y=(s16b)y;
8252 monster_target_x=(s16b)x;
8255 next_mirror( &oy,&ox,y,x );
8257 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8258 for( j = last_i; j <=i ; j++ )
8260 y = GRID_Y(path_g[j]);
8261 x = GRID_X(path_g[j]);
8262 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8263 if(!who && (project_m_n==1) && !jump ){
8264 if(cave[project_m_y][project_m_x].m_idx >0 ){
8265 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8267 /* Hack -- auto-recall */
8268 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8270 /* Hack - auto-track */
8271 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8274 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8279 for( i = last_i ; i < path_n ; i++ )
8282 y = GRID_Y(path_g[i]);
8283 x = GRID_X(path_g[i]);
8284 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8286 if(!who && (project_m_n==1) && !jump ){
8287 if(cave[project_m_y][project_m_x].m_idx >0 ){
8288 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8290 /* Hack -- auto-recall */
8291 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8293 /* Hack - auto-track */
8294 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8297 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8301 else if(typ == GF_SUPER_RAY){
8303 int second_step = 0;
8310 for (i = 0; i < path_n; ++i)
8315 int ny = GRID_Y(path_g[i]);
8316 int nx = GRID_X(path_g[i]);
8327 /* Only do visuals if requested */
8328 if (!blind && !(flg & (PROJECT_HIDE)))
8330 /* Only do visuals if the player can "see" the bolt */
8331 if (panel_contains(y, x) && player_has_los_bold(y, x))
8338 /* Obtain the bolt pict */
8339 p = bolt_pict(oy, ox, y, x, typ);
8341 /* Extract attr/char */
8345 /* Visual effects */
8346 print_rel(c, a, y, x);
8347 move_cursor_relative(y, x);
8348 /*if (fresh_before)*/ Term_fresh();
8349 Term_xtra(TERM_XTRA_DELAY, msec);
8351 /*if (fresh_before)*/ Term_fresh();
8353 /* Display "beam" grids */
8354 if (flg & (PROJECT_BEAM))
8356 /* Obtain the explosion pict */
8357 p = bolt_pict(y, x, y, x, typ);
8359 /* Extract attr/char */
8363 /* Visual effects */
8364 print_rel(c, a, y, x);
8367 /* Hack -- Activate delay */
8371 /* Hack -- delay anyway for consistency */
8374 /* Delay for consistency */
8375 Term_xtra(TERM_XTRA_DELAY, msec);
8378 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8379 if( cave[y][x].feat == FEAT_RUBBLE ||
8380 cave[y][x].feat == FEAT_DOOR_HEAD ||
8381 cave[y][x].feat == FEAT_DOOR_TAIL ||
8382 (cave[y][x].feat >= FEAT_WALL_EXTRA &&
8383 cave[y][x].feat <= FEAT_PERM_SOLID ))
8385 if( second_step )continue;
8388 if( (cave[y][x].info & CAVE_IN_MIRROR) && !second_step )
8390 /* The target of monsterspell becomes tha mirror(broken) */
8391 monster_target_y=(s16b)y;
8392 monster_target_x=(s16b)x;
8395 for( j = 0; j <=i ; j++ )
8397 y = GRID_Y(path_g[j]);
8398 x = GRID_X(path_g[j]);
8399 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8403 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8404 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8405 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8406 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8407 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8408 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8409 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8410 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8413 for( i = 0; i < path_n ; i++ )
8416 y = GRID_Y(path_g[i]);
8417 x = GRID_X(path_g[i]);
8418 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8419 if(!who && (project_m_n==1) && !jump ){
8420 if(cave[project_m_y][project_m_x].m_idx >0 ){
8421 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8423 /* Hack -- auto-recall */
8424 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8426 /* Hack - auto-track */
8427 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8430 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8435 /* Project along the path */
8436 for (i = 0; i < path_n; ++i)
8441 int ny = GRID_Y(path_g[i]);
8442 int nx = GRID_X(path_g[i]);
8444 if (flg & PROJECT_DISI)
8446 /* Hack -- Balls explode before reaching walls */
8447 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8451 /* Hack -- Balls explode before reaching walls */
8452 if (!cave_floor_bold(ny, nx) && (rad > 0)) break;
8459 /* Collect beam grids */
8460 if (flg & (PROJECT_BEAM))
8467 /* Only do visuals if requested */
8468 if (!blind && !(flg & (PROJECT_HIDE)) && !(flg & PROJECT_FAST))
8470 /* Only do visuals if the player can "see" the bolt */
8471 if (panel_contains(y, x) && player_has_los_bold(y, x))
8478 /* Obtain the bolt pict */
8479 p = bolt_pict(oy, ox, y, x, typ);
8481 /* Extract attr/char */
8485 /* Visual effects */
8486 print_rel(c, a, y, x);
8487 move_cursor_relative(y, x);
8488 /*if (fresh_before)*/ Term_fresh();
8489 Term_xtra(TERM_XTRA_DELAY, msec);
8491 /*if (fresh_before)*/ Term_fresh();
8493 /* Display "beam" grids */
8494 if (flg & (PROJECT_BEAM))
8496 /* Obtain the explosion pict */
8497 p = bolt_pict(y, x, y, x, typ);
8499 /* Extract attr/char */
8503 /* Visual effects */
8504 print_rel(c, a, y, x);
8507 /* Hack -- Activate delay */
8511 /* Hack -- delay anyway for consistency */
8514 /* Delay for consistency */
8515 Term_xtra(TERM_XTRA_DELAY, msec);
8518 if ((typ == GF_ATTACK) && (dam == HISSATSU_NYUSIN) && ((i+1) == path_n))
8520 if (cave_empty_bold(y, x)) teleport_player_to(ny, nx, FALSE);
8525 /* Save the "blast epicenter" */
8529 if (breath && (y1 == y2) && (x1 == x2))
8535 flg &= ~(PROJECT_HIDE);
8539 /* Start the "explosion" */
8542 /* Hack -- make sure beams get to "explode" */
8550 /* If we found a "target", explode there */
8551 if (dist <= MAX_RANGE)
8553 /* Mega-Hack -- remove the final "beam" grid */
8554 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8557 * Create a conical breath attack
8568 flg &= ~(PROJECT_HIDE);
8570 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, y2, x2, (bool)(typ == GF_DISINTEGRATE), TRUE);
8574 /* Determine the blast area, work from the inside out */
8575 for (dist = 0; dist <= rad; dist++)
8577 /* Scan the maximal blast area of radius "dist" */
8578 for (y = y2 - dist; y <= y2 + dist; y++)
8580 for (x = x2 - dist; x <= x2 + dist; x++)
8582 /* Ignore "illegal" locations */
8583 if (!in_bounds2(y, x)) continue;
8585 /* Enforce a "circular" explosion */
8586 if (distance(y2, x2, y, x) != dist) continue;
8588 if (typ == GF_DISINTEGRATE)
8590 /* Disintegration balls explosions are stopped by perma-walls */
8591 if (!in_disintegration_range(y2, x2, y, x)) continue;
8593 if (cave_valid_bold(y, x) &&
8594 (cave[y][x].feat < FEAT_PATTERN_START ||
8595 cave[y][x].feat > FEAT_PATTERN_XTRA2) &&
8596 (cave[y][x].feat < FEAT_DEEP_WATER ||
8597 cave[y][x].feat > FEAT_GRASS))
8599 if (cave[y][x].feat == FEAT_TREES)
8600 cave_set_feat(y, x, FEAT_GRASS);
8603 cave[y][x].feat = floor_type[randint0(100)];
8607 /* Update some things -- similar to GF_KILL_WALL */
8608 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
8612 /* Ball explosions are stopped by walls */
8613 if (!los(y2, x2, y, x)) continue;
8616 /* Save this grid */
8623 /* Encode some more "radius" info */
8629 /* Speed -- ignore "non-explosions" */
8630 if (!grids) return (FALSE);
8633 /* Display the "blast area" if requested */
8634 if (!blind && !(flg & (PROJECT_HIDE)))
8636 /* Then do the "blast", from inside out */
8637 for (t = 0; t <= gm_rad; t++)
8639 /* Dump everything with this radius */
8640 for (i = gm[t]; i < gm[t+1]; i++)
8642 /* Extract the location */
8646 /* Only do visuals if the player can "see" the blast */
8647 if (panel_contains(y, x) && player_has_los_bold(y, x))
8656 /* Obtain the explosion pict */
8657 p = bolt_pict(y, x, y, x, typ);
8659 /* Extract attr/char */
8663 /* Visual effects -- Display */
8664 print_rel(c, a, y, x);
8668 /* Hack -- center the cursor */
8669 move_cursor_relative(y2, x2);
8671 /* Flush each "radius" seperately */
8672 /*if (fresh_before)*/ Term_fresh();
8674 /* Delay (efficiently) */
8675 if (visual || drawn)
8677 Term_xtra(TERM_XTRA_DELAY, msec);
8681 /* Flush the erasing */
8684 /* Erase the explosion drawn above */
8685 for (i = 0; i < grids; i++)
8687 /* Extract the location */
8691 /* Hack -- Erase if needed */
8692 if (panel_contains(y, x) && player_has_los_bold(y, x))
8698 /* Hack -- center the cursor */
8699 move_cursor_relative(y2, x2);
8701 /* Flush the explosion */
8702 /*if (fresh_before)*/ Term_fresh();
8707 /* Update stuff if needed */
8708 if (p_ptr->update) update_stuff();
8711 /* Check features */
8712 if (flg & (PROJECT_GRID))
8714 /* Start with "dist" of zero */
8717 /* Scan for features */
8718 for (i = 0; i < grids; i++)
8720 /* Hack -- Notice new "dist" values */
8721 if (gm[dist+1] == i) dist++;
8723 /* Get the grid location */
8727 /* Find the closest point in the blast */
8730 int d = dist_to_line(y, x, y1, x1, y2, x2);
8732 /* Affect the grid */
8733 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8737 /* Affect the grid */
8738 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8745 if (flg & (PROJECT_ITEM))
8747 /* Start with "dist" of zero */
8750 /* Scan for objects */
8751 for (i = 0; i < grids; i++)
8753 /* Hack -- Notice new "dist" values */
8754 if (gm[dist+1] == i) dist++;
8756 /* Get the grid location */
8760 /* Find the closest point in the blast */
8763 int d = dist_to_line(y, x, y1, x1, y2, x2);
8765 /* Affect the object in the grid */
8766 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8770 /* Affect the object in the grid */
8771 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8777 /* Check monsters */
8778 if (flg & (PROJECT_KILL))
8785 /* Start with "dist" of zero */
8788 /* Scan for monsters */
8789 for (i = 0; i < grids; i++)
8791 /* Hack -- Notice new "dist" values */
8792 if (gm[dist + 1] == i) dist++;
8794 /* Get the grid location */
8800 /* Find the closest point in the blast */
8803 int d = dist_to_line(y, x, y1, x1, y2, x2);
8805 /* Affect the monster in the grid */
8806 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
8808 if (project_m(who, d+1, y, x, dam, typ,flg)) notice = TRUE;
8810 else if (project_m(who, d, y, x, dam, typ,flg)) notice = TRUE;
8814 /* Affect the monster in the grid */
8815 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
8817 if (!(flg & PROJECT_BEAM))
8819 if (project_m(who, dist+1, y, x, dam, typ,flg)) notice = TRUE;
8822 else if (project_m(who, dist, y, x, dam, typ,flg)) notice = TRUE;
8827 monster_race *ref_ptr = &r_info[m_list[cave[y][x].m_idx].r_idx];
8829 if ((ref_ptr->flags2 & RF2_REFLECTING) && (!one_in_(10) && !(flg & PROJECT_NO_REF) && (!who || dist_hack > 1)))
8832 int max_attempts = 10;
8834 /* Choose 'new' target */
8837 t_y = y_saver - 1 + randint1(3);
8838 t_x = x_saver - 1 + randint1(3);
8842 while (max_attempts && in_bounds2u(t_y, t_x) &&
8843 !(los(y, x, t_y, t_x)));
8845 if (max_attempts < 1)
8851 if (m_list[cave[y][x].m_idx].ml)
8854 if ((m_list[cave[y][x].m_idx].r_idx == MON_KENSHIROU)
8855 || (m_list[cave[y][x].m_idx].r_idx == MON_RAOU))
8856 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
8857 if (m_list[cave[y][x].m_idx].r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
8858 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
8860 msg_print("The attack bounces!");
8863 ref_ptr->r_flags2 |= RF2_REFLECTING;
8865 flg &= ~(PROJECT_MONSTER | PROJECT_PLAYER);
8866 if (one_in_(2)) flg |= PROJECT_MONSTER;
8867 else flg |= PROJECT_PLAYER;
8869 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
8873 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
8876 else if (project_m(who, dist, y, x, dam, typ,flg)) notice = TRUE;
8881 /* Player affected one monster (without "jumping") */
8882 if (!who && (project_m_n == 1) && !jump)
8888 /* Track if possible */
8889 if (cave[y][x].m_idx > 0)
8891 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
8893 /* Hack -- auto-recall */
8894 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8896 /* Hack - auto-track */
8897 if (m_ptr->ml) health_track(cave[y][x].m_idx);
8904 if (flg & (PROJECT_KILL))
8906 /* Start with "dist" of zero */
8909 /* Scan for player */
8910 for (i = 0; i < grids; i++)
8912 /* Hack -- Notice new "dist" values */
8913 if (gm[dist+1] == i) dist++;
8915 /* Get the grid location */
8919 /* Find the closest point in the blast */
8922 int d = dist_to_line(y, x, y1, x1, y2, x2);
8924 /* Affect the player */
8925 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_MONSTER))
8927 if (project_p(who, who_name, d+1, y, x, dam, typ, rad, monspell)) notice = TRUE;
8929 else if (project_p(who, who_name, d, y, x, dam, typ, rad, monspell)) notice = TRUE;
8933 /* Affect the player */
8934 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_MONSTER))
8936 if (!((flg & PROJECT_BEAM) || (flg & PROJECT_STOP)))
8938 if (project_p(who, who_name, dist+1, y, x, dam, typ, rad, monspell)) notice = TRUE;
8941 else if (project_p(who, who_name, dist, y, x, dam, typ, rad, monspell)) notice = TRUE;
8950 monster_desc(m_name, &m_list[p_ptr->riding], 0);
8952 if (rakubadam_m > 0)
8954 if (rakuba(rakubadam_m, FALSE))
8957 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
8959 msg_format("%^s has thrown you off!", m_name);
8963 if (p_ptr->riding && rakubadam_p > 0)
8965 if(rakuba(rakubadam_p, FALSE))
8968 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
8970 msg_format("You have fallen from %s.", m_name);
8976 /* Return "something was noticed" */
8980 bool binding_field( int dam )
8982 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
8983 int mirror_num=0; /* ¶À¤Î¿ô */
8988 int msec= delay_factor*delay_factor*delay_factor;
8994 /* Default target of monsterspell is player */
8995 monster_target_y=py;
8996 monster_target_x=px;
8998 for( x=0 ; x < cur_wid ; x++ )
9000 for( y=0 ; y < cur_hgt ; y++ )
9002 if( (cave[y][x].info & CAVE_IN_MIRROR) &&
9003 distance(py,px,y,x) <= MAX_RANGE &&
9004 distance(py,px,y,x) != 0 &&
9005 player_has_los_bold(y,x)
9007 mirror_y[mirror_num]=y;
9008 mirror_x[mirror_num]=x;
9014 if( mirror_num < 2 )return FALSE;
9016 point_x[0] = randint0( mirror_num );
9018 point_x[1] = randint0( mirror_num );
9020 while( point_x[0] == point_x[1] );
9022 point_y[0]=mirror_y[point_x[0]];
9023 point_x[0]=mirror_x[point_x[0]];
9024 point_y[1]=mirror_y[point_x[1]];
9025 point_x[1]=mirror_x[point_x[1]];
9029 x=point_x[0]+point_x[1]+point_x[2];
9030 y=point_y[0]+point_y[1]+point_y[2];
9032 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9033 - (point_y[0]*3-y)*(point_x[1]*3-x);
9034 if( centersign == 0 )return FALSE;
9036 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9037 x1 = x1 < point_x[2] ? x1 : point_x[2];
9038 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9039 y1 = y1 < point_y[2] ? y1 : point_y[2];
9041 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9042 x2 = x2 > point_x[2] ? x2 : point_x[2];
9043 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9044 y2 = y2 > point_y[2] ? y2 : point_y[2];
9046 for( y=y1 ; y <=y2 ; y++ ){
9047 for( x=x1 ; x <=x2 ; x++ ){
9048 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9049 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9050 centersign*( (point_x[1]-x)*(point_y[2]-y)
9051 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9052 centersign*( (point_x[2]-x)*(point_y[0]-y)
9053 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9055 if( player_has_los_bold(y,x)){
9056 /* Visual effects */
9058 && panel_contains(y,x)){
9059 p = bolt_pict(y,x,y,x, GF_MANA );
9060 print_rel(PICT_C(p), PICT_A(p),y,x);
9061 move_cursor_relative(y, x);
9062 /*if (fresh_before)*/ Term_fresh();
9063 Term_xtra(TERM_XTRA_DELAY, msec);
9069 for( y=y1 ; y <=y2 ; y++ ){
9070 for( x=x1 ; x <=x2 ; x++ ){
9071 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9072 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9073 centersign*( (point_x[1]-x)*(point_y[2]-y)
9074 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9075 centersign*( (point_x[2]-x)*(point_y[0]-y)
9076 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9078 if( player_has_los_bold(y,x)){
9079 (void)project_f(0,0,y,x,dam,GF_MANA);
9084 for( y=y1 ; y <=y2 ; y++ ){
9085 for( x=x1 ; x <=x2 ; x++ ){
9086 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9087 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9088 centersign*( (point_x[1]-x)*(point_y[2]-y)
9089 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9090 centersign*( (point_x[2]-x)*(point_y[0]-y)
9091 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9093 if( player_has_los_bold(y,x)){
9094 (void)project_o(0,0,y,x,dam,GF_MANA);
9099 for( y=y1 ; y <=y2 ; y++ ){
9100 for( x=x1 ; x <=x2 ; x++ ){
9101 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9102 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9103 centersign*( (point_x[1]-x)*(point_y[2]-y)
9104 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9105 centersign*( (point_x[2]-x)*(point_y[0]-y)
9106 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9108 if( player_has_los_bold(y,x) ){
9109 (void)project_m(0,0,y,x,dam,GF_MANA,
9110 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_REF));
9117 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9119 msg_print("The field broke a mirror");
9121 remove_mirror(point_y[0],point_x[0]);
9127 void seal_of_mirror( int dam )
9131 for( x = 0 ; x < cur_wid ; x++ )
9133 for( y = 0 ; y < cur_hgt ; y++ )
9135 if( (cave[y][x].info & CAVE_IN_MIRROR))
9137 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9138 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_REF)))
9140 if( !cave[y][x].m_idx )