4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Spell projection */
15 /* ToDo: Make this global */
16 /* 1/x chance of reducing stats (for elemental attacks) */
17 #define HURT_CHANCE 16
21 * Does the grid stop disintegration?
23 #define cave_stop_disintegration(Y,X) \
24 (((cave[Y][X].feat >= FEAT_PERM_EXTRA) && \
25 (cave[Y][X].feat <= FEAT_PERM_SOLID)) || \
26 (cave[Y][X].feat == FEAT_MOUNTAIN) || \
27 ((cave[Y][X].feat >= FEAT_SHOP_HEAD) && \
28 (cave[Y][X].feat <= FEAT_SHOP_TAIL)) || \
29 ((cave[Y][X].feat >= FEAT_BLDG_HEAD) && \
30 (cave[Y][X].feat <= FEAT_BLDG_TAIL)) || \
31 (cave[Y][X].feat == FEAT_MUSEUM))
33 static int rakubadam_m;
34 static int rakubadam_p;
36 int project_length = 0;
39 * Get another mirror. for SEEKER
41 static void next_mirror( int* next_y , int* next_x , int cury, int curx)
43 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
44 int mirror_num=0; /* ¶À¤Î¿ô */
48 for( x=0 ; x < cur_wid ; x++ )
50 for( y=0 ; y < cur_hgt ; y++ )
52 if( is_mirror_grid(&cave[y][x])){
53 mirror_y[mirror_num]=y;
54 mirror_x[mirror_num]=x;
61 num=randint0(mirror_num);
62 *next_y=mirror_y[num];
63 *next_x=mirror_x[num];
66 *next_y=cury+randint0(5)-2;
67 *next_x=curx+randint0(5)-2;
72 * Get a legal "multi-hued" color for drawing "spells"
74 static byte mh_attr(int max)
76 switch (randint1(max))
78 case 1: return (TERM_RED);
79 case 2: return (TERM_GREEN);
80 case 3: return (TERM_BLUE);
81 case 4: return (TERM_YELLOW);
82 case 5: return (TERM_ORANGE);
83 case 6: return (TERM_VIOLET);
84 case 7: return (TERM_L_RED);
85 case 8: return (TERM_L_GREEN);
86 case 9: return (TERM_L_BLUE);
87 case 10: return (TERM_UMBER);
88 case 11: return (TERM_L_UMBER);
89 case 12: return (TERM_SLATE);
90 case 13: return (TERM_WHITE);
91 case 14: return (TERM_L_WHITE);
92 case 15: return (TERM_L_DARK);
100 * Return a color to use for the bolt/ball spells
102 static byte spell_color(int type)
104 /* Check if A.B.'s new graphics should be used (rr9) */
105 if (streq(ANGBAND_GRAF, "new"))
110 case GF_PSY_SPEAR: return (0x06);
111 case GF_MISSILE: return (0x0F);
112 case GF_ACID: return (0x04);
113 case GF_ELEC: return (0x02);
114 case GF_FIRE: return (0x00);
115 case GF_COLD: return (0x01);
116 case GF_POIS: return (0x03);
117 case GF_HOLY_FIRE: return (0x00);
118 case GF_HELL_FIRE: return (0x00);
119 case GF_MANA: return (0x0E);
121 case GF_SEEKER: return (0x0E);
122 case GF_SUPER_RAY: return (0x0E);
124 case GF_ARROW: return (0x0F);
125 case GF_WATER: return (0x04);
126 case GF_NETHER: return (0x07);
127 case GF_CHAOS: return (mh_attr(15));
128 case GF_DISENCHANT: return (0x05);
129 case GF_NEXUS: return (0x0C);
130 case GF_CONFUSION: return (mh_attr(4));
131 case GF_SOUND: return (0x09);
132 case GF_SHARDS: return (0x08);
133 case GF_FORCE: return (0x09);
134 case GF_INERTIA: return (0x09);
135 case GF_GRAVITY: return (0x09);
136 case GF_TIME: return (0x09);
137 case GF_LITE_WEAK: return (0x06);
138 case GF_LITE: return (0x06);
139 case GF_DARK_WEAK: return (0x07);
140 case GF_DARK: return (0x07);
141 case GF_PLASMA: return (0x0B);
142 case GF_METEOR: return (0x00);
143 case GF_ICE: return (0x01);
144 case GF_ROCKET: return (0x0F);
145 case GF_DEATH_RAY: return (0x07);
146 case GF_NUKE: return (mh_attr(2));
147 case GF_DISINTEGRATE: return (0x05);
159 case GF_CAUSE_4: return (0x0E);
160 case GF_HAND_DOOM: return (0x07);
161 case GF_CAPTURE : return (0x0E);
162 case GF_IDENTIFY: return (0x01);
163 case GF_ATTACK: return (0x0F);
164 case GF_PHOTO : return (0x06);
167 /* Normal tiles or ASCII */
173 /* Lookup the default colors for this type */
174 cptr s = quark_str(gf_color[type]);
177 if (!s) return (TERM_WHITE);
179 /* Pick a random color */
180 c = s[randint0(strlen(s))];
182 /* Lookup this color */
183 a = strchr(color_char, c) - color_char;
185 /* Invalid color (note check for < 0 removed, gave a silly
186 * warning because bytes are always >= 0 -- RG) */
187 if (a > 15) return (TERM_WHITE);
193 /* Standard "color" */
199 * Find the attr/char pair to use for a spell effect
201 * It is moving (or has moved) from (x,y) to (nx,ny).
203 * If the distance is not "one", we (may) return "*".
205 u16b bolt_pict(int y, int x, int ny, int nx, int typ)
215 if ((ny == y) && (nx == x)) base = 0x30;
218 else if (nx == x) base = 0x40;
221 else if (ny == y) base = 0x50;
224 else if ((ny - y) == (x - nx)) base = 0x60;
227 else if ((ny - y) == (nx - x)) base = 0x70;
232 /* Basic spell color */
233 k = spell_color(typ);
235 /* Obtain attr/char */
236 a = misc_to_attr[base + k];
237 c = misc_to_char[base + k];
245 * Determine the path taken by a projection.
247 * The projection will always start from the grid (y1,x1), and will travel
248 * towards the grid (y2,x2), touching one grid per unit of distance along
249 * the major axis, and stopping when it enters the destination grid or a
250 * wall grid, or has travelled the maximum legal distance of "range".
252 * Note that "distance" in this function (as in the "update_view()" code)
253 * is defined as "MAX(dy,dx) + MIN(dy,dx)/2", which means that the player
254 * actually has an "octagon of projection" not a "circle of projection".
256 * The path grids are saved into the grid array pointed to by "gp", and
257 * there should be room for at least "range" grids in "gp". Note that
258 * due to the way in which distance is calculated, this function normally
259 * uses fewer than "range" grids for the projection path, so the result
260 * of this function should never be compared directly to "range". Note
261 * that the initial grid (y1,x1) is never saved into the grid array, not
262 * even if the initial grid is also the final grid. XXX XXX XXX
264 * The "flg" flags can be used to modify the behavior of this function.
266 * In particular, the "PROJECT_STOP" and "PROJECT_THRU" flags have the same
267 * semantics as they do for the "project" function, namely, that the path
268 * will stop as soon as it hits a monster, or that the path will continue
269 * through the destination grid, respectively.
271 * The "PROJECT_JUMP" flag, which for the "project()" function means to
272 * start at a special grid (which makes no sense in this function), means
273 * that the path should be "angled" slightly if needed to avoid any wall
274 * grids, allowing the player to "target" any grid which is in "view".
275 * This flag is non-trivial and has not yet been implemented, but could
276 * perhaps make use of the "vinfo" array (above). XXX XXX XXX
278 * This function returns the number of grids (if any) in the path. This
279 * function will return zero if and only if (y1,x1) and (y2,x2) are equal.
281 * This algorithm is similar to, but slightly different from, the one used
282 * by "update_view_los()", and very different from the one used by "los()".
284 sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg)
306 /* No path necessary (or allowed) */
307 if ((x1 == x2) && (y1 == y2)) return (0);
335 /* Number of "units" in one "half" grid */
338 /* Number of "units" in one "full" grid */
344 /* Let m = ((dx/dy) * full) = (dx * dx * 2) */
355 /* Advance (X) part 2 */
358 /* Advance (X) part 3 */
365 /* Create the projection path */
369 gp[n++] = GRID(y, x);
371 /* Hack -- Check maximum range */
372 if ((n + (k >> 1)) >= range) break;
374 /* Sometimes stop at destination grid */
375 if (!(flg & (PROJECT_THRU)))
377 if ((x == x2) && (y == y2)) break;
380 if (flg & (PROJECT_DISI))
382 if ((n > 0) && cave_stop_disintegration(y, x)) break;
384 else if (!(flg & (PROJECT_PATH)))
386 /* Always stop at non-initial wall grids */
387 if ((n > 0) && !cave_floor_bold(y, x)) break;
390 /* Sometimes stop at non-initial monsters/players */
391 if (flg & (PROJECT_STOP))
394 ((y == py && x == px) || cave[y][x].m_idx != 0))
398 if (!in_bounds(y, x)) break;
403 /* Advance (X) part 1 */
406 /* Horizontal change */
409 /* Advance (X) part 2 */
412 /* Advance (X) part 3 */
428 /* Let m = ((dy/dx) * full) = (dy * dy * 2) */
437 /* Vertical change */
440 /* Advance (Y) part 2 */
443 /* Advance (Y) part 3 */
450 /* Create the projection path */
454 gp[n++] = GRID(y, x);
456 /* Hack -- Check maximum range */
457 if ((n + (k >> 1)) >= range) break;
459 /* Sometimes stop at destination grid */
460 if (!(flg & (PROJECT_THRU)))
462 if ((x == x2) && (y == y2)) break;
465 if (flg & (PROJECT_DISI))
467 if ((n > 0) && cave_stop_disintegration(y, x)) break;
469 else if (!(flg & (PROJECT_PATH)))
471 /* Always stop at non-initial wall grids */
472 if ((n > 0) && !cave_floor_bold(y, x)) break;
475 /* Sometimes stop at non-initial monsters/players */
476 if (flg & (PROJECT_STOP))
479 ((y == py && x == px) || cave[y][x].m_idx != 0))
483 if (!in_bounds(y, x)) break;
488 /* Advance (Y) part 1 */
491 /* Vertical change */
494 /* Advance (Y) part 2 */
497 /* Advance (Y) part 3 */
517 /* Create the projection path */
521 gp[n++] = GRID(y, x);
523 /* Hack -- Check maximum range */
524 if ((n + (n >> 1)) >= range) break;
526 /* Sometimes stop at destination grid */
527 if (!(flg & (PROJECT_THRU)))
529 if ((x == x2) && (y == y2)) break;
532 if (flg & (PROJECT_DISI))
534 if ((n > 0) && cave_stop_disintegration(y, x)) break;
536 else if (!(flg & (PROJECT_PATH)))
538 /* Always stop at non-initial wall grids */
539 if ((n > 0) && !cave_floor_bold(y, x)) break;
542 /* Sometimes stop at non-initial monsters/players */
543 if (flg & (PROJECT_STOP))
546 ((y == py && x == px) || cave[y][x].m_idx != 0))
550 if (!in_bounds(y, x)) break;
567 * Mega-Hack -- track "affected" monsters (see "project()" comments)
569 static int project_m_n;
570 static int project_m_x;
571 static int project_m_y;
572 /* Mega-Hack -- monsters target */
573 static s16b monster_target_x;
574 static s16b monster_target_y;
578 * We are called from "project()" to "damage" terrain features
580 * We are called both for "beam" effects and "ball" effects.
582 * The "r" parameter is the "distance from ground zero".
584 * Note that we determine if the player can "see" anything that happens
585 * by taking into account: blindness, line-of-sight, and illumination.
587 * We return "TRUE" if the effect of the projection is "obvious".
589 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
591 * XXX XXX XXX Perhaps we should affect doors?
593 static bool project_f(int who, int r, int y, int x, int dam, int typ)
595 cave_type *c_ptr = &cave[y][x];
597 bool obvious = FALSE;
598 bool known = player_has_los_bold(y, x);
604 /* Reduce damage by distance */
605 dam = (dam + r) / (r + 1);
608 if (c_ptr->feat == FEAT_TREES)
617 message = "¸Ï¤ì¤¿";break;
619 message = "was blasted.";break;
623 message = "½Ì¤ó¤À";break;
625 message = "shrank.";break;
629 message = "ÍϤ±¤¿";break;
631 message = "melted.";break;
636 message = "Åà¤ê¡¢ºÕ¤±»¶¤Ã¤¿";break;
638 message = "was frozen and smashed.";break;
644 message = "dz¤¨¤¿";break;
646 message = "burns up!";break;
660 message = "Ê´ºÕ¤µ¤ì¤¿";break;
662 message = "was crushed.";break;
665 message = NULL;break;
670 msg_format("ÌÚ¤Ï%s¡£", message);
672 msg_format("A tree %s", message);
674 cave_set_feat(y, x, (one_in_(3) ? FEAT_DEEP_GRASS : FEAT_GRASS));
677 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
679 /* Update some things */
680 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
684 /* Analyze the type */
687 /* Ignore most effects */
701 case GF_DISINTEGRATE:
723 /* Destroy Traps (and Locks) */
726 /* Reveal secret doors */
727 if (is_hidden_door(c_ptr))
732 /* Check line of sight */
740 if (is_trap(c_ptr->feat))
742 /* Check line of sight */
746 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
748 msg_print("There is a bright flash of light!");
754 /* Forget the trap */
755 c_ptr->info &= ~(CAVE_MARK);
757 /* Destroy the trap */
758 cave_set_feat(y, x, floor_type[randint0(100)]);
761 /* Locked doors are unlocked */
762 else if ((c_ptr->feat >= FEAT_DOOR_HEAD + 0x01) &&
763 (c_ptr->feat <= FEAT_DOOR_HEAD + 0x07))
765 /* Unlock the door */
766 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
768 /* Check line of sound */
772 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
784 /* Destroy Doors (and traps) */
787 /* Destroy all doors and traps */
788 if ((c_ptr->feat == FEAT_OPEN) ||
789 (c_ptr->feat == FEAT_BROKEN) ||
790 is_trap(c_ptr->feat) ||
791 ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
792 (c_ptr->feat <= FEAT_DOOR_TAIL)))
794 /* Check line of sight */
799 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
801 msg_print("There is a bright flash of light!");
806 /* Visibility change */
807 if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
808 (c_ptr->feat <= FEAT_DOOR_TAIL))
810 /* Update some things */
811 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
815 /* Forget the door */
816 c_ptr->info &= ~(CAVE_MARK);
818 /* Destroy the feature */
819 cave_set_feat(y, x, floor_type[randint0(100)]);
828 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
830 if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
831 (c_ptr->feat <= FEAT_DOOR_TAIL))
833 /* Convert "locked" to "stuck" XXX XXX XXX */
834 if (c_ptr->feat < FEAT_DOOR_HEAD + 0x08) c_ptr->feat += 0x08;
836 /* Add one spike to the door */
837 if (c_ptr->feat < FEAT_DOOR_TAIL) c_ptr->feat++;
839 /* Check line of sight */
844 msg_print("²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ¥É¥¢¤¬³«¤«¤Ê¤¤¡£");
846 msg_print("The door seems stuck.");
855 /* Destroy walls (and doors) */
858 /* Non-walls (etc) */
859 if (cave_floor_bold(y, x)) break;
861 /* Permanent walls */
862 if (c_ptr->feat >= FEAT_PERM_EXTRA) break;
865 if (c_ptr->feat >= FEAT_WALL_EXTRA)
868 if (known && (c_ptr->info & (CAVE_MARK)))
871 msg_print("Êɤ¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
873 msg_print("The wall turns into mud!");
879 /* Forget the wall */
880 c_ptr->info &= ~(CAVE_MARK);
882 /* Destroy the wall */
883 cave_set_feat(y, x, floor_type[randint0(100)]);
886 /* Quartz / Magma with treasure */
887 else if (c_ptr->feat >= FEAT_MAGMA_H)
890 if (known && (c_ptr->info & (CAVE_MARK)))
893 msg_print("¹ÛÌ®¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
894 msg_print("²¿¤«¤òȯ¸«¤·¤¿¡ª");
896 msg_print("The vein turns into mud!");
897 msg_print("You have found something!");
903 /* Forget the wall */
904 c_ptr->info &= ~(CAVE_MARK);
906 /* Destroy the wall */
907 cave_set_feat(y, x, floor_type[randint0(100)]);
909 /* Place some gold */
914 else if (c_ptr->feat >= FEAT_MAGMA)
917 if (known && (c_ptr->info & (CAVE_MARK)))
920 msg_print("¹ÛÌ®¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
922 msg_print("The vein turns into mud!");
928 /* Forget the wall */
929 c_ptr->info &= ~(CAVE_MARK);
931 /* Destroy the wall */
932 cave_set_feat(y, x, floor_type[randint0(100)]);
936 else if (c_ptr->feat == FEAT_RUBBLE)
939 if (known && (c_ptr->info & (CAVE_MARK)))
942 msg_print("´äÀФ¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
944 msg_print("The rubble turns into mud!");
950 /* Forget the wall */
951 c_ptr->info &= ~(CAVE_MARK);
953 /* Destroy the rubble */
954 cave_set_feat(y, x, floor_type[randint0(100)]);
956 /* Hack -- place an object */
957 if (randint0(100) < 10)
959 /* Found something */
960 if (player_can_see_bold(y, x))
963 msg_print("´äÀФβ¼¤Ë²¿¤«±£¤µ¤ì¤Æ¤¤¤¿¡ª");
965 msg_print("There was something buried in the rubble!");
972 place_object(y, x, FALSE, FALSE);
976 /* Destroy doors (and secret doors) */
977 else /* if (c_ptr->feat >= FEAT_DOOR_HEAD) */
979 /* Hack -- special message */
980 if (known && (c_ptr->info & (CAVE_MARK)))
983 msg_print("¥É¥¢¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
985 msg_print("The door turns into mud!");
991 /* Forget the wall */
992 c_ptr->info &= ~(CAVE_MARK);
994 /* Destroy the feature */
995 cave_set_feat(y, x, floor_type[randint0(100)]);
1001 /* Update some things */
1002 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
1010 /* Require a "naked" floor grid */
1011 if (!cave_naked_bold(y, x)) break;
1013 /* Not on the player */
1014 if ((y == py) && (x == px)) break;
1016 /* Create a closed door */
1017 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
1020 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
1022 /* Update some things */
1023 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1031 /* Require a "naked" floor grid */
1032 if (((cave[y][x].feat != FEAT_FLOOR) &&
1033 (cave[y][x].feat != FEAT_GRASS) &&
1034 (cave[y][x].feat != FEAT_DIRT) &&
1035 (cave[y][x].o_idx == 0) &&
1036 (cave[y][x].m_idx == 0))
1037 || is_mirror_grid(&cave[y][x]) )
1048 /* Require a "naked" floor grid */
1049 if (!cave_naked_bold(y, x)) break;
1051 /* Not on the player */
1052 if ((y == py) && (x == px)) break;
1054 /* Create a closed door */
1055 cave_set_feat(y, x, FEAT_TREES);
1058 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
1060 /* Update some things */
1061 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1068 /* Require a "naked" floor grid */
1069 if (!cave_naked_bold(y, x)) break;
1071 /* Create a glyph */
1072 cave[y][x].info |= CAVE_OBJECT;
1073 cave[y][x].mimic = FEAT_GLYPH;
1086 /* Require a "naked" floor grid */
1087 if (!cave_naked_bold(y, x)) break;
1089 /* Not on the player */
1090 if ((y == py) && (x == px)) break;
1093 cave_set_feat(y, x, FEAT_WALL_EXTRA);
1095 /* Update some things */
1096 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
1107 /* Require a "naked" floor grid */
1108 if (!cave_naked_bold(y, x)) break;
1110 /* Place a shallow lava */
1111 cave_set_feat(y, x, FEAT_SHAL_LAVA);
1116 /* Require a "naked" floor grid */
1117 if (cave_perma_bold(y, x) || !dam) break;
1119 /* Place a deep lava */
1120 cave_set_feat(y, x, FEAT_DEEP_LAVA);
1122 /* Dam is used as a counter for the number of grid to convert */
1133 /* Require a "naked" floor grid */
1134 if (!cave_naked_bold(y, x)) break;
1136 /* Place a shallow lava */
1137 cave_set_feat(y, x, FEAT_SHAL_WATER);
1142 /* Require a "naked" floor grid */
1143 if (cave_perma_bold(y, x) || !dam) break;
1145 /* Place a deep lava */
1146 cave_set_feat(y, x, FEAT_DEEP_WATER);
1148 /* Dam is used as a counter for the number of grid to convert */
1154 /* Lite up the grid */
1158 /* Turn on the light */
1159 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) c_ptr->info |= (CAVE_GLOW);
1168 if (player_can_see_bold(y, x)) obvious = TRUE;
1170 /* Mega-Hack -- Update the monster in the affected grid */
1171 /* This allows "spear of light" (etc) to work "correctly" */
1172 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1177 /* Darken the grid */
1181 if (!p_ptr->inside_battle)
1184 if (player_can_see_bold(y, x)) obvious = TRUE;
1186 /* Turn off the light. */
1187 if (!is_mirror_grid(c_ptr)) c_ptr->info &= ~(CAVE_GLOW);
1189 /* Hack -- Forget "boring" grids */
1190 if ((c_ptr->feat <= FEAT_INVIS) || (c_ptr->feat == FEAT_DIRT) || (c_ptr->feat == FEAT_GRASS))
1193 c_ptr->info &= ~(CAVE_MARK);
1202 /* Mega-Hack -- Update the monster in the affected grid */
1203 /* This allows "spear of light" (etc) to work "correctly" */
1204 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1213 if (is_mirror_grid(&cave[y][x]))
1216 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1218 msg_print("The mirror was chashed!");
1221 project(0,2,y,x, p_ptr->lev /2 +5 ,GF_SHARDS,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_HANGEKI),-1);
1227 if (is_mirror_grid(&cave[y][x]) && p_ptr->lev < 40 )
1230 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1232 msg_print("The mirror was chashed!");
1234 cave_set_feat(y,x, FEAT_FLOOR);
1241 /* Return "Anything seen?" */
1248 * We are called from "project()" to "damage" objects
1250 * We are called both for "beam" effects and "ball" effects.
1252 * Perhaps we should only SOMETIMES damage things on the ground.
1254 * The "r" parameter is the "distance from ground zero".
1256 * Note that we determine if the player can "see" anything that happens
1257 * by taking into account: blindness, line-of-sight, and illumination.
1259 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1261 * We return "TRUE" if the effect of the projection is "obvious".
1263 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1265 cave_type *c_ptr = &cave[y][x];
1267 s16b this_o_idx, next_o_idx = 0;
1269 bool obvious = FALSE;
1270 bool known = player_has_los_bold(y, x);
1272 u32b flgs[TR_FLAG_SIZE];
1274 char o_name[MAX_NLEN];
1277 bool is_potion = FALSE;
1281 who = who ? who : 0;
1283 /* Reduce damage by distance */
1284 dam = (dam + r) / (r + 1);
1287 /* Scan all objects in the grid */
1288 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1292 bool is_art = FALSE;
1293 bool ignore = FALSE;
1294 bool do_kill = FALSE;
1296 cptr note_kill = NULL;
1299 /* Get the "plural"-ness */
1300 bool plural = (o_ptr->number > 1);
1303 /* Acquire object */
1304 o_ptr = &o_list[this_o_idx];
1306 /* Acquire next object */
1307 next_o_idx = o_ptr->next_o_idx;
1309 /* Extract the flags */
1310 object_flags(o_ptr, flgs);
1312 /* Check for artifact */
1313 if ((artifact_p(o_ptr) || o_ptr->art_name)) is_art = TRUE;
1315 /* Analyze the type */
1318 /* Acid -- Lots of things */
1321 if (hates_acid(o_ptr))
1325 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1327 note_kill = (plural ? " melt!" : " melts!");
1330 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1335 /* Elec -- Rings and Wands */
1338 if (hates_elec(o_ptr))
1342 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1344 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1347 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1352 /* Fire -- Flammable objects */
1355 if (hates_fire(o_ptr))
1359 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1361 note_kill = (plural ? " burn up!" : " burns up!");
1364 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1369 /* Cold -- potions and flasks */
1372 if (hates_cold(o_ptr))
1375 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1377 note_kill = (plural ? " shatter!" : " shatters!");
1381 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1389 if (hates_fire(o_ptr))
1393 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1395 note_kill = (plural ? " burn up!" : " burns up!");
1398 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1400 if (hates_elec(o_ptr))
1405 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1407 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1410 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1418 if (hates_fire(o_ptr))
1422 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1424 note_kill = (plural ? " burn up!" : " burns up!");
1427 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1429 if (hates_cold(o_ptr))
1434 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1436 note_kill = (plural ? " shatter!" : " shatters!");
1439 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1444 /* Hack -- break potions and such */
1450 if (hates_cold(o_ptr))
1453 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1455 note_kill = (plural ? " shatter!" : " shatters!");
1463 /* Mana and Chaos -- destroy everything */
1470 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1472 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1478 case GF_DISINTEGRATE:
1482 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1484 note_kill = (plural ? " evaporate!" : " evaporates!");
1494 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1496 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1499 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1500 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1504 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1508 if (cursed_p(o_ptr))
1512 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1514 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1523 identify_item(o_ptr);
1531 /* Chests are noticed only if trapped or locked */
1532 if (o_ptr->tval == TV_CHEST)
1534 /* Disarm/Unlock traps */
1535 if (o_ptr->pval > 0)
1537 /* Disarm or Unlock */
1538 o_ptr->pval = (0 - o_ptr->pval);
1541 object_known(o_ptr);
1544 if (known && o_ptr->marked)
1547 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1549 msg_print("Click!");
1561 if (o_ptr->tval == TV_CORPSE)
1566 if (!who || is_pet(&m_list[who]))
1567 mode |= PM_FORCE_PET;
1569 for (i = 0; i < o_ptr->number ; i++)
1571 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1572 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1577 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1579 note_kill = (plural ? " become dust." : " becomes dust.");
1584 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1587 note_kill = "À¸¤Ê֤ä¿¡£";
1589 note_kill = "rivived.";
1592 else if (!note_kill)
1595 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1597 note_kill = (plural ? " become dust." : " becomes dust.");
1609 /* Attempt to destroy the object */
1612 /* Effect "observed" */
1613 if (known && o_ptr->marked)
1616 object_desc(o_name, o_ptr, FALSE, 0);
1619 /* Artifacts, and other objects, get to resist */
1620 if (is_art || ignore)
1622 /* Observe the resist */
1623 if (known && o_ptr->marked)
1626 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1629 msg_format("The %s %s unaffected!",
1630 o_name, (plural ? "are" : "is"));
1639 /* Describe if needed */
1640 if (known && o_ptr->marked && note_kill)
1643 msg_format("%s¤Ï%s", o_name, note_kill);
1645 msg_format("The %s%s", o_name, note_kill);
1650 k_idx = o_ptr->k_idx;
1651 is_potion = object_is_potion(o_ptr);
1654 /* Delete the object */
1655 delete_object_idx(this_o_idx);
1657 /* Potions produce effects when 'shattered' */
1660 (void)potion_smash_effect(who, y, x, k_idx);
1669 /* Return "Anything seen?" */
1675 * Helper function for "project()" below.
1677 * Handle a beam/bolt/ball causing damage to a monster.
1679 * This routine takes a "source monster" (by index) which is mostly used to
1680 * determine if the player is causing the damage, and a "radius" (see below),
1681 * which is used to decrease the power of explosions with distance, and a
1682 * location, via integers which are modified by certain types of attacks
1683 * (polymorph and teleport being the obvious ones), a default damage, which
1684 * is modified as needed based on various properties, and finally a "damage
1685 * type" (see below).
1687 * Note that this routine can handle "no damage" attacks (like teleport) by
1688 * taking a "zero" damage, and can even take "parameters" to attacks (like
1689 * confuse) by accepting a "damage", using it to calculate the effect, and
1690 * then setting the damage to zero. Note that the "damage" parameter is
1691 * divided by the radius, so monsters not at the "epicenter" will not take
1692 * as much damage (or whatever)...
1694 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1695 * may result in a dereference of an invalid pointer. XXX XXX XXX
1697 * Various messages are produced, and damage is applied.
1699 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1700 * actually be "made" of that substance, or "breathe" big balls of it.
1702 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1705 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1706 * and hurts evil less. If can breath nether, then it resists it as well.
1708 * Damage reductions use the following formulas:
1709 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1710 * gives avg damage of .655, ranging from .858 to .500
1711 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1712 * gives avg damage of .544, ranging from .714 to .417
1713 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1714 * gives avg damage of .444, ranging from .556 to .333
1715 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1716 * gives avg damage of .327, ranging from .427 to .250
1717 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1718 * gives something simple.
1720 * In this function, "result" messages are postponed until the end, where
1721 * the "note" string is appended to the monster name, if not NULL. So,
1722 * to make a spell have "no effect" just set "note" to NULL. You should
1723 * also set "notice" to FALSE, or the player will learn what the spell does.
1725 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1727 /* "flg" was added. */
1728 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1732 cave_type *c_ptr = &cave[y][x];
1734 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1736 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1740 /* Is the monster "seen"? */
1741 bool seen = m_ptr->ml;
1743 bool slept = (bool)(m_ptr->csleep > 0);
1745 /* Were the effects "obvious" (if seen)? */
1746 bool obvious = FALSE;
1748 /* Can the player know about this effect? */
1749 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1751 /* Can the player see the source of this effect? */
1752 bool see_s = ((who <= 0) || m_list[who].ml);
1754 /* Were the effects "irrelevant"? */
1755 bool skipped = FALSE;
1757 /* Gets the monster angry at the source of the effect? */
1758 bool get_angry = FALSE;
1760 /* Polymorph setting (true or false) */
1763 /* Teleport setting (max distance) */
1766 /* Confusion setting (amount to confuse) */
1769 /* Stunning setting (amount to stun) */
1772 /* Sleep amount (amount to sleep) */
1775 /* Fear amount (amount to fear) */
1778 /* Time amount (amount to time) */
1781 bool heal_leper = FALSE;
1783 /* Hold the monster name */
1790 /* Assume no note */
1793 /* Assume a default death */
1795 cptr note_dies = "¤Ï»à¤ó¤À¡£";
1797 cptr note_dies = " dies.";
1805 if (!c_ptr->m_idx) return (FALSE);
1807 /* Never affect projector */
1808 if (who && (c_ptr->m_idx == who)) return (FALSE);
1809 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1810 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1812 /* Don't affect already death monsters */
1813 /* Prevents problems with chain reactions of exploding monsters */
1814 if (m_ptr->hp < 0) return (FALSE);
1816 /* Reduce damage by distance */
1817 dam = (dam + r) / (r + 1);
1820 /* Get the monster name (BEFORE polymorphing) */
1821 monster_desc(m_name, m_ptr, 0);
1823 /* Get the monster possessive ("his"/"her"/"its") */
1824 monster_desc(m_poss, m_ptr, 0x22);
1827 /* Some monsters get "destroyed" */
1828 if (!monster_living(r_ptr))
1831 bool explode = FALSE;
1833 for (i = 0; i < 4; i++)
1835 if (r_ptr->blow[i].method == RBM_EXPLODE) explode = TRUE;
1838 /* Special note at death */
1841 note_dies = "¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£";
1843 note_dies = " explodes into tiny shreds.";
1847 note_dies = "¤òÅݤ·¤¿¡£";
1849 note_dies = " is destroyed.";
1853 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1855 /* Analyze the damage type */
1858 /* Magic Missile -- pure damage */
1861 if (seen) obvious = TRUE;
1862 if (r_ptr->flags3 & (RF3_RES_ALL))
1865 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1867 note = " is immune.";
1870 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1879 if (seen) obvious = TRUE;
1880 if (r_ptr->flags3 & (RF3_RES_ALL))
1883 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1885 note = " is immune.";
1888 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1891 if (r_ptr->flags3 & (RF3_IM_ACID))
1894 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1896 note = " resists a lot.";
1900 if (seen) r_ptr->r_flags3 |= (RF3_IM_ACID);
1908 if (seen) obvious = TRUE;
1909 if (r_ptr->flags3 & (RF3_RES_ALL))
1912 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1914 note = " is immune.";
1917 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1920 if (r_ptr->flags3 & (RF3_IM_ELEC))
1923 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1925 note = " resists a lot.";
1929 if (seen) r_ptr->r_flags3 |= (RF3_IM_ELEC);
1937 if (seen) obvious = TRUE;
1938 if (r_ptr->flags3 & (RF3_RES_ALL))
1941 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1943 note = " is immune.";
1946 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1949 if (r_ptr->flags3 & (RF3_IM_FIRE))
1952 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1954 note = " resists a lot.";
1958 if (seen) r_ptr->r_flags3 |= (RF3_IM_FIRE);
1960 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1963 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1965 note = " is hit hard.";
1969 if (seen) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1977 if (seen) obvious = TRUE;
1978 if (r_ptr->flags3 & (RF3_RES_ALL))
1981 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1983 note = " is immune.";
1986 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
1989 if (r_ptr->flags3 & (RF3_IM_COLD))
1992 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1994 note = " resists a lot.";
1998 if (seen) r_ptr->r_flags3 |= (RF3_IM_COLD);
2000 else if (r_ptr->flags3 & (RF3_HURT_COLD))
2003 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
2005 note = " is hit hard.";
2009 if (seen) r_ptr->r_flags3 |= (RF3_HURT_COLD);
2017 if (seen) obvious = TRUE;
2018 if (r_ptr->flags3 & (RF3_RES_ALL))
2021 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2023 note = " is immune.";
2026 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2029 if (r_ptr->flags3 & RF3_IM_POIS)
2032 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
2034 note = " resists a lot.";
2038 if (seen) r_ptr->r_flags3 |= (RF3_IM_POIS);
2046 if (seen) obvious = TRUE;
2048 if (r_ptr->flags3 & (RF3_RES_ALL))
2051 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2053 note = " is immune.";
2056 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2059 if (r_ptr->flags3 & RF3_IM_POIS)
2062 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2067 dam *= 3; dam /= randint1(6) + 6;
2068 if (seen) r_ptr->r_flags3 |= (RF3_IM_POIS);
2070 else if (one_in_(3)) do_poly = TRUE;
2074 /* Hellfire -- hurts Evil */
2077 if (seen) obvious = TRUE;
2078 if (r_ptr->flags3 & (RF3_RES_ALL))
2081 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2083 note = " is immune.";
2086 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2089 if (r_ptr->flags3 & RF3_GOOD)
2093 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2095 note = " is hit hard.";
2098 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
2103 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2106 if (seen) obvious = TRUE;
2107 if (r_ptr->flags3 & (RF3_RES_ALL))
2110 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2112 note = " is immune.";
2115 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2118 if (r_ptr->flags3 & RF3_GOOD)
2122 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2124 note = " is immune.";
2127 if (seen) r_ptr->r_flags3 |= RF3_GOOD;
2129 else if (r_ptr->flags3 & RF3_EVIL)
2133 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2135 note = " is hit hard.";
2138 if (seen) r_ptr->r_flags3 |= RF3_EVIL;
2143 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2148 dam *= 3; dam /= randint1(6) + 6;
2153 /* Arrow -- XXX no defense */
2156 if (seen) obvious = TRUE;
2157 if (r_ptr->flags3 & (RF3_RES_ALL))
2160 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2162 note = " is immune.";
2165 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2171 /* Plasma -- XXX perhaps check ELEC or FIRE */
2174 if (seen) obvious = TRUE;
2175 if (r_ptr->flags3 & (RF3_RES_ALL))
2178 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2180 note = " is immune.";
2183 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2186 if (r_ptr->flags3 & RF3_RES_PLAS)
2189 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2194 dam *= 3; dam /= randint1(6) + 6;
2196 r_ptr->r_flags3 |= (RF3_RES_PLAS);
2201 /* Nether -- see above */
2204 if (seen) obvious = TRUE;
2205 if (r_ptr->flags3 & (RF3_RES_ALL))
2208 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2210 note = " is immune.";
2213 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2216 if (r_ptr->flags3 & RF3_UNDEAD)
2219 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2221 note = " is immune.";
2225 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
2227 else if (r_ptr->flags3 & RF3_RES_NETH)
2230 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2235 dam *= 3; dam /= randint1(6) + 6;
2237 if (seen) r_ptr->r_flags3 |= (RF3_RES_NETH);
2239 else if (r_ptr->flags3 & RF3_EVIL)
2243 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2245 note = " resists somewhat.";
2248 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
2253 /* Water (acid) damage -- Water spirits/elementals are immune */
2256 if (seen) obvious = TRUE;
2257 if (r_ptr->flags3 & (RF3_RES_ALL))
2260 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2262 note = " is immune.";
2265 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2268 if (m_ptr->r_idx == MON_WATER_ELEM || m_ptr->r_idx == MON_UNMAKER)
2271 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2273 note = " is immune.";
2278 else if (r_ptr->flags3 & RF3_RES_WATE)
2281 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2286 dam *= 3; dam /= randint1(6) + 6;
2287 if (seen) r_ptr->r_flags3 |= (RF3_RES_WATE);
2292 /* Chaos -- Chaos breathers resist */
2295 if (seen) obvious = TRUE;
2296 if (r_ptr->flags3 & (RF3_RES_ALL))
2299 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2301 note = " is immune.";
2304 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2308 do_conf = (5 + randint1(11) + r) / (r + 1);
2309 if ((r_ptr->flags4 & RF4_BR_CHAO) ||
2310 (m_ptr->r_idx == MON_STORMBRINGER) ||
2311 ((r_ptr->flags3 & RF3_DEMON) && one_in_(3)))
2314 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2319 dam *= 3; dam /= randint1(6) + 6;
2325 /* Shards -- Shard breathers resist */
2328 if (seen) obvious = TRUE;
2329 if (r_ptr->flags3 & (RF3_RES_ALL))
2332 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2334 note = " is immune.";
2337 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2340 if (r_ptr->flags4 & RF4_BR_SHAR)
2343 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2348 dam *= 3; dam /= randint1(6) + 6;
2353 /* Rocket: Shard resistance helps */
2356 if (seen) obvious = TRUE;
2358 if (r_ptr->flags3 & (RF3_RES_ALL))
2361 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2363 note = " is immune.";
2366 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2369 if (r_ptr->flags4 & RF4_BR_SHAR)
2372 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2374 note = " resists somewhat.";
2383 /* Sound -- Sound breathers resist */
2386 if (seen) obvious = TRUE;
2387 if (r_ptr->flags3 & (RF3_RES_ALL))
2390 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2392 note = " is immune.";
2395 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2398 do_stun = (10 + randint1(15) + r) / (r + 1);
2399 if (r_ptr->flags4 & RF4_BR_SOUN)
2402 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2407 dam *= 2; dam /= randint1(6) + 6;
2415 if (seen) obvious = TRUE;
2416 if (r_ptr->flags3 & (RF3_RES_ALL))
2419 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2421 note = " is immune.";
2424 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2427 do_conf = (10 + randint1(15) + r) / (r + 1);
2428 if (r_ptr->flags4 & RF4_BR_CONF)
2431 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2436 dam *= 2; dam /= randint1(6) + 6;
2438 else if (r_ptr->flags3 & RF3_NO_CONF)
2441 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2443 note = " resists somewhat.";
2451 /* Disenchantment -- Breathers and Disenchanters resist */
2454 if (seen) obvious = TRUE;
2455 if (r_ptr->flags3 & (RF3_RES_ALL))
2458 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2460 note = " is immune.";
2463 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2466 if (r_ptr->flags3 & RF3_RES_DISE)
2469 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2474 dam *= 3; dam /= randint1(6) + 6;
2475 if (seen) r_ptr->r_flags3 |= (RF3_RES_DISE);
2480 /* Nexus -- Breathers and Existers resist */
2483 if (seen) obvious = TRUE;
2484 if (r_ptr->flags3 & (RF3_RES_ALL))
2487 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2489 note = " is immune.";
2492 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2495 if (r_ptr->flags3 & RF3_RES_NEXU)
2498 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2503 dam *= 3; dam /= randint1(6) + 6;
2504 if (seen) r_ptr->r_flags3 |= (RF3_RES_NEXU);
2512 if (seen) obvious = TRUE;
2513 if (r_ptr->flags3 & (RF3_RES_ALL))
2516 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2518 note = " is immune.";
2521 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2524 do_stun = (randint1(15) + r) / (r + 1);
2525 if (r_ptr->flags4 & RF4_BR_WALL)
2528 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2533 dam *= 3; dam /= randint1(6) + 6;
2538 /* Inertia -- breathers resist */
2541 if (seen) obvious = TRUE;
2542 if (r_ptr->flags3 & (RF3_RES_ALL))
2545 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2547 note = " is immune.";
2550 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2553 if (r_ptr->flags4 & (RF4_BR_INER))
2556 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2561 dam *= 3; dam /= randint1(6) + 6;
2565 /* Powerful monsters can resist */
2566 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2567 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2571 /* Normal monsters slow down */
2577 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2579 note = " starts moving slower.";
2582 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2583 if (c_ptr->m_idx == p_ptr->riding)
2584 p_ptr->update |= (PU_BONUS);
2590 /* Time -- breathers resist */
2593 if (seen) obvious = TRUE;
2594 if (r_ptr->flags3 & (RF3_RES_ALL))
2597 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2599 note = " is immune.";
2602 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2605 if (r_ptr->flags4 & (RF4_BR_TIME))
2608 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2613 dam *= 3; dam /= randint1(6) + 6;
2615 else do_time = (dam+1)/2;
2619 /* Gravity -- breathers resist */
2622 bool resist_tele = FALSE;
2624 if (seen) obvious = TRUE;
2626 if (r_ptr->flags3 & (RF3_RES_ALL))
2629 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2631 note = " is immune.";
2634 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2637 if (r_ptr->flags3 & (RF3_RES_TELE))
2639 if (r_ptr->flags1 & (RF1_UNIQUE))
2641 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
2643 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2645 note = " is unaffected!";
2650 else if (r_ptr->level > randint1(100))
2652 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
2654 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2663 if (!resist_tele) do_dist = 10;
2665 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2667 if (r_ptr->flags4 & (RF4_BR_GRAV))
2670 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2675 dam *= 3; dam /= randint1(6) + 6;
2681 /* Powerful monsters can resist */
2682 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2683 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2687 /* Normal monsters slow down */
2693 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2695 note = " starts moving slower.";
2698 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2699 if (c_ptr->m_idx == p_ptr->riding)
2700 p_ptr->update |= (PU_BONUS);
2704 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
2706 /* Attempt a saving throw */
2707 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2708 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2712 /* No obvious effect */
2714 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2716 note = " is unaffected!";
2730 if (seen) obvious = TRUE;
2731 if (r_ptr->flags3 & (RF3_RES_ALL))
2734 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2736 note = " is immune.";
2739 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2747 case GF_DISINTEGRATE:
2749 if (seen) obvious = TRUE;
2750 if (r_ptr->flags3 & (RF3_RES_ALL))
2753 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2755 note = " is immune.";
2758 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2761 if (r_ptr->flags3 & RF3_HURT_ROCK)
2763 if (seen) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2765 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2766 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2768 note = " loses some skin!";
2769 note_dies = " evaporates!";
2779 if (seen) obvious = TRUE;
2781 /* PSI only works if the monster can see you! -- RG */
2782 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2786 note = "¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª";
2788 note = " can't see you, and isn't affected!";
2793 if (r_ptr->flags3 & (RF3_RES_ALL))
2796 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2798 note = " is immune.";
2801 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2804 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2808 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2810 note = " is immune!";
2812 if (seen) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2815 else if ((r_ptr->flags2 & RF2_STUPID) ||
2816 (r_ptr->flags2 & RF2_WEIRD_MIND) ||
2817 (r_ptr->flags3 & RF3_ANIMAL) ||
2818 (r_ptr->level > randint1(3 * dam)))
2822 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2829 * Powerful demons & undead can turn a mindcrafter's
2830 * attacks back on them
2832 if (((r_ptr->flags3 & RF3_UNDEAD) ||
2833 (r_ptr->flags3 & RF3_DEMON)) &&
2834 (r_ptr->level > p_ptr->lev / 2) &&
2839 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
2842 msg_format("%^s%s corrupted mind backlashes your attack!",
2843 m_name, (seen ? "'s" : "s"));
2847 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2850 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2852 msg_print("You resist the effects!");
2858 /* Injure +/- confusion */
2859 monster_desc(killer, m_ptr, 0x288);
2860 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2863 switch (randint1(4))
2866 set_confused(p_ptr->confused + 3 + randint1(dam));
2869 set_stun(p_ptr->stun + randint1(dam));
2873 if (r_ptr->flags3 & RF3_NO_FEAR)
2875 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2877 note = " is unaffected.";
2881 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2885 if (!p_ptr->free_act)
2886 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2895 if ((dam > 0) && one_in_(4))
2897 switch (randint1(4))
2900 do_conf = 3 + randint1(dam);
2903 do_stun = 3 + randint1(dam);
2906 do_fear = 3 + randint1(dam);
2910 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2912 note = " falls asleep!";
2915 do_sleep = 3 + randint1(dam);
2921 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2923 note_dies = " collapses, a mindless husk.";
2931 if (seen) obvious = TRUE;
2932 if (r_ptr->flags3 & (RF3_RES_ALL))
2935 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2937 note = " is immune.";
2940 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
2943 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2947 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2949 note = " is immune!";
2953 else if ((r_ptr->flags2 & RF2_STUPID) ||
2954 (r_ptr->flags2 & RF2_WEIRD_MIND) ||
2955 (r_ptr->flags3 & RF3_ANIMAL) ||
2956 (r_ptr->level > randint1(3 * dam)))
2960 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2967 * Powerful demons & undead can turn a mindcrafter's
2968 * attacks back on them
2970 if (((r_ptr->flags3 & RF3_UNDEAD) ||
2971 (r_ptr->flags3 & RF3_DEMON)) &&
2972 (r_ptr->level > p_ptr->lev / 2) &&
2977 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
2980 msg_format("%^s%s corrupted mind backlashes your attack!",
2981 m_name, (seen ? "'s" : "s"));
2985 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2988 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2990 msg_print("You resist the effects!");
2996 /* Injure + mana drain */
2997 monster_desc(killer, m_ptr, 0x288);
2999 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
3001 msg_print("Your psychic energy is drained!");
3004 p_ptr->csp -= damroll(5, dam) / 2;
3005 if (p_ptr->csp < 0) p_ptr->csp = 0;
3006 p_ptr->redraw |= PR_MANA;
3007 p_ptr->window |= (PW_SPELL);
3008 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
3015 int b = damroll(5, dam) / 4;
3017 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª",
3020 msg_format("You convert %s%s pain into psychic energy!",
3021 m_name, (seen ? "'s" : "s"));
3024 b = MIN(p_ptr->msp, p_ptr->csp + b);
3026 p_ptr->redraw |= PR_MANA;
3027 p_ptr->window |= (PW_SPELL);
3031 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
3033 note_dies = " collapses, a mindless husk.";
3039 case GF_TELEKINESIS:
3041 if (seen) obvious = TRUE;
3042 if (r_ptr->flags3 & (RF3_RES_ALL))
3045 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3047 note = " is immune.";
3050 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3055 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
3060 do_stun = damroll((p_ptr->lev / 10) + 3 , dam) + 1;
3062 /* Attempt a saving throw */
3063 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3064 (r_ptr->level > 5 + randint1(dam)))
3068 /* No obvious effect */
3074 /* Psycho-spear -- powerful magic missile */
3077 if (seen) obvious = TRUE;
3078 if (r_ptr->flags3 & (RF3_RES_ALL))
3081 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3083 note = " is immune.";
3086 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3092 /* Meteor -- powerful magic missile */
3095 if (seen) obvious = TRUE;
3096 if (r_ptr->flags3 & (RF3_RES_ALL))
3099 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3101 note = " is immune.";
3104 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3112 if (!is_hostile(m_ptr)) break;
3113 if (seen) obvious = TRUE;
3115 if (r_ptr->flags3 & (RF3_RES_ALL))
3118 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3120 note = " is immune.";
3123 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3126 /* Attempt a saving throw */
3127 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3128 (r_ptr->flags1 & RF1_QUESTOR) ||
3129 (r_ptr->flags3 & RF3_NO_CONF) ||
3130 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3132 /* Memorize a flag */
3133 if (r_ptr->flags3 & RF3_NO_CONF)
3135 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
3142 * Powerful demons & undead can turn a mindcrafter's
3143 * attacks back on them
3145 if (((r_ptr->flags3 & RF3_UNDEAD) ||
3146 (r_ptr->flags3 & RF3_DEMON)) &&
3147 (r_ptr->level > p_ptr->lev / 2) &&
3152 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª",
3155 msg_format("%^s%s corrupted mind backlashes your attack!",
3156 m_name, (seen ? "'s" : "s"));
3160 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3163 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3165 msg_print("You resist the effects!");
3171 /* Confuse, stun, terrify */
3172 switch (randint1(4))
3175 set_stun(p_ptr->stun + dam / 2);
3178 set_confused(p_ptr->confused + dam / 2);
3182 if (r_ptr->flags3 & RF3_NO_FEAR)
3184 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3186 note = " is unaffected.";
3190 set_afraid(p_ptr->afraid + dam);
3197 /* No obvious effect */
3199 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3201 note = " is unaffected!";
3209 if ((dam > 29) && (randint1(100) < dam))
3212 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3214 note = " is in your thrall!";
3221 switch (randint1(4))
3235 /* No "real" damage */
3242 /* Ice -- Cold + Cuts + Stun */
3245 if (seen) obvious = TRUE;
3246 if (r_ptr->flags3 & (RF3_RES_ALL))
3249 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3251 note = " is immune.";
3254 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3257 do_stun = (randint1(15) + 1) / (r + 1);
3258 if (r_ptr->flags3 & RF3_IM_COLD)
3261 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3263 note = " resists a lot.";
3267 if (seen) r_ptr->r_flags3 |= (RF3_IM_COLD);
3269 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3272 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3274 note = " is hit hard.";
3278 if (seen) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3287 if (seen) obvious = TRUE;
3289 if (r_ptr->flags3 & (RF3_RES_ALL))
3292 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3294 note = " is immune.";
3297 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3300 if (!monster_living(r_ptr))
3302 if (r_ptr->flags3 & RF3_UNDEAD)
3304 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
3307 if (r_ptr->flags3 & (RF3_DEMON))
3309 if (seen) r_ptr->r_flags3 |= (RF3_DEMON);
3313 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3315 note = " is unaffected!";
3321 else do_time = (dam+7)/8;
3329 if (seen) obvious = TRUE;
3331 if (r_ptr->flags3 & (RF3_RES_ALL))
3334 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3336 note = " is immune.";
3339 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3342 if ((r_ptr->flags3 & RF3_UNDEAD) ||
3343 (r_ptr->flags3 & RF3_NONLIVING))
3345 if (r_ptr->flags3 & RF3_UNDEAD)
3347 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
3351 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3353 note = " is immune.";
3359 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3360 (randint1(888) != 666)) ||
3361 (((r_ptr->level + randint1(20)) > randint1(p_ptr->lev + randint1(10))) &&
3362 randint1(100) != 66))
3365 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3377 /* Polymorph monster (Use "dam" as "power") */
3380 if (seen) obvious = TRUE;
3382 if (r_ptr->flags3 & (RF3_RES_ALL))
3385 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3387 note = " is immune.";
3390 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3393 /* Attempt to polymorph (see below) */
3396 /* Powerful monsters can resist */
3397 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3398 (r_ptr->flags1 & RF1_QUESTOR) ||
3399 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3402 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3404 note = " is unaffected!";
3411 /* No "real" damage */
3418 /* Clone monsters (Ignore "dam") */
3421 if (seen) obvious = TRUE;
3423 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)))
3426 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3428 note = " is unaffected!";
3434 m_ptr->hp = m_ptr->maxhp;
3436 /* Attempt to clone. */
3437 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3440 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3448 /* No "real" damage */
3455 /* Heal Monster (use "dam" as amount of healing) */
3458 if (seen) obvious = TRUE;
3463 if (m_ptr->maxhp < m_ptr->max_maxhp)
3466 msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3468 msg_format("%^s recovers %s vitality.", m_name, m_poss);
3470 m_ptr->maxhp = m_ptr->max_maxhp;
3476 if (seen) obvious = TRUE;
3484 msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3486 msg_format("%^s is no longer stunned.", m_name);
3490 if (m_ptr->confused)
3493 msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3495 msg_format("%^s is no longer confused.", m_name);
3497 m_ptr->confused = 0;
3502 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3504 msg_format("%^s recovers %s courage.", m_name, m_poss);
3510 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3513 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3515 chg_virtue(V_VITALITY, 1);
3517 if (r_ptr->flags1 & RF1_UNIQUE)
3518 chg_virtue(V_INDIVIDUALISM, 1);
3520 if (is_friendly(m_ptr))
3521 chg_virtue(V_HONOUR, 1);
3522 else if (!(r_ptr->flags3 & RF3_EVIL))
3524 if (r_ptr->flags3 & RF3_GOOD)
3525 chg_virtue(V_COMPASSION, 2);
3527 chg_virtue(V_COMPASSION, 1);
3530 if (m_ptr->r_idx == MON_LEPER)
3533 chg_virtue(V_COMPASSION, 5);
3536 if (r_ptr->flags3 & RF3_ANIMAL)
3537 chg_virtue(V_NATURE, 1);
3539 /* Redraw (later) if needed */
3540 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3541 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3545 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3547 note = " looks healthier.";
3551 /* No "real" damage */
3557 /* Speed Monster (Ignore "dam") */
3560 if (seen) obvious = TRUE;
3566 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3568 note = " starts moving faster.";
3571 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3573 if (c_ptr->m_idx == p_ptr->riding)
3574 p_ptr->update |= (PU_BONUS);
3576 if (r_ptr->flags1 & RF1_UNIQUE)
3577 chg_virtue(V_INDIVIDUALISM, 1);
3578 if (is_friendly(m_ptr))
3579 chg_virtue(V_HONOUR, 1);
3581 /* No "real" damage */
3587 /* Slow Monster (Use "dam" as "power") */
3590 if (seen) obvious = TRUE;
3592 if (r_ptr->flags3 & (RF3_RES_ALL))
3595 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3597 note = " is immune.";
3600 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3603 /* Powerful monsters can resist */
3604 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3605 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3608 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3610 note = " is unaffected!";
3616 /* Normal monsters slow down */
3622 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3624 note = " starts moving slower.";
3627 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3629 if (c_ptr->m_idx == p_ptr->riding)
3630 p_ptr->update |= (PU_BONUS);
3633 /* No "real" damage */
3639 /* Sleep (Use "dam" as "power") */
3642 if (seen) obvious = TRUE;
3644 if (r_ptr->flags3 & (RF3_RES_ALL))
3647 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3649 note = " is immune.";
3652 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3655 /* Attempt a saving throw */
3656 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3657 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3658 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3660 /* Memorize a flag */
3661 if (r_ptr->flags3 & RF3_NO_SLEEP)
3663 if (seen) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3666 /* No obvious effect */
3668 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3670 note = " is unaffected!";
3677 /* Go to sleep (much) later */
3679 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3681 note = " falls asleep!";
3687 /* No "real" damage */
3693 /* Sleep (Use "dam" as "power") */
3694 case GF_STASIS_EVIL:
3696 if (seen) obvious = TRUE;
3698 if (r_ptr->flags3 & (RF3_RES_ALL))
3701 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3703 note = " is immune.";
3706 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3709 /* Attempt a saving throw */
3710 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3711 !(r_ptr->flags3 & RF3_EVIL) ||
3712 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3715 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3717 note = " is unaffected!";
3724 /* Go to sleep (much) later */
3726 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3728 note = " is suspended!";
3734 /* No "real" damage */
3739 /* Sleep (Use "dam" as "power") */
3742 if (seen) obvious = TRUE;
3744 if (r_ptr->flags3 & (RF3_RES_ALL))
3747 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3749 note = " is immune.";
3752 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3755 /* Attempt a saving throw */
3756 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3757 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3760 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3762 note = " is unaffected!";
3769 /* Go to sleep (much) later */
3771 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3773 note = " is suspended!";
3779 /* No "real" damage */
3788 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3789 vir = virtue_number(V_HARMONY);
3792 dam += p_ptr->virtues[vir-1]/10;
3795 vir = virtue_number(V_INDIVIDUALISM);
3798 dam -= p_ptr->virtues[vir-1]/20;
3801 if (seen) obvious = TRUE;
3803 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3806 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3808 note = " is immune.";
3811 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3815 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3818 /* Attempt a saving throw */
3819 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3820 (r_ptr->flags3 & RF3_NO_CONF) ||
3821 (m_ptr->mflag2 & MFLAG_NOPET) ||
3822 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3824 /* Memorize a flag */
3825 if (r_ptr->flags3 & RF3_NO_CONF)
3827 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
3831 /* No obvious effect */
3833 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3835 note = " is unaffected!";
3840 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3842 else if (p_ptr->cursed & TRC_AGGRAVATE)
3845 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3847 note = " hates you too much!";
3850 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3855 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3857 note = " suddenly seems friendly!";
3862 chg_virtue(V_INDIVIDUALISM, -1);
3863 if (r_ptr->flags3 & RF3_ANIMAL)
3864 chg_virtue(V_NATURE, 1);
3867 /* No "real" damage */
3872 /* Control undead */
3873 case GF_CONTROL_UNDEAD:
3876 if (seen) obvious = TRUE;
3878 vir = virtue_number(V_UNLIFE);
3881 dam += p_ptr->virtues[vir-1]/10;
3884 vir = virtue_number(V_INDIVIDUALISM);
3887 dam -= p_ptr->virtues[vir-1]/20;
3890 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3893 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3895 note = " is immune.";
3898 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3902 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3905 /* Attempt a saving throw */
3906 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3907 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3908 (m_ptr->mflag2 & MFLAG_NOPET) ||
3909 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3911 /* No obvious effect */
3913 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3915 note = " is unaffected!";
3919 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3921 else if (p_ptr->cursed & TRC_AGGRAVATE)
3924 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3926 note = " hates you too much!";
3929 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3934 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3936 note = " is in your thrall!";
3942 /* No "real" damage */
3948 case GF_CONTROL_DEMON:
3951 if (seen) obvious = TRUE;
3953 vir = virtue_number(V_UNLIFE);
3956 dam += p_ptr->virtues[vir-1]/10;
3959 vir = virtue_number(V_INDIVIDUALISM);
3962 dam -= p_ptr->virtues[vir-1]/20;
3965 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
3968 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3970 note = " is immune.";
3973 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
3977 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3980 /* Attempt a saving throw */
3981 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3982 (!(r_ptr->flags3 & RF3_DEMON)) ||
3983 (m_ptr->mflag2 & MFLAG_NOPET) ||
3984 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3986 /* No obvious effect */
3988 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3990 note = " is unaffected!";
3994 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
3996 else if (p_ptr->cursed & TRC_AGGRAVATE)
3999 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4001 note = " hates you too much!";
4004 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4009 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
4011 note = " is in your thrall!";
4017 /* No "real" damage */
4023 case GF_CONTROL_ANIMAL:
4027 if (seen) obvious = TRUE;
4029 vir = virtue_number(V_NATURE);
4032 dam += p_ptr->virtues[vir-1]/10;
4035 vir = virtue_number(V_INDIVIDUALISM);
4038 dam -= p_ptr->virtues[vir-1]/20;
4041 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
4044 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4046 note = " is immune.";
4049 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4053 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4056 /* Attempt a saving throw */
4057 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4058 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
4059 (m_ptr->mflag2 & MFLAG_NOPET) ||
4060 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4061 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4063 /* Memorize a flag */
4064 if (r_ptr->flags3 & (RF3_NO_CONF))
4066 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
4070 /* No obvious effect */
4072 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4074 note = " is unaffected!";
4078 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4080 else if (p_ptr->cursed & TRC_AGGRAVATE)
4083 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4085 note = " hates you too much!";
4088 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4093 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4095 note = " is tamed!";
4100 if (r_ptr->flags3 & RF3_ANIMAL)
4101 chg_virtue(V_NATURE, 1);
4104 /* No "real" damage */
4110 case GF_CONTROL_LIVING:
4114 vir = virtue_number(V_UNLIFE);
4115 if (seen) obvious = TRUE;
4117 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4118 vir = virtue_number(V_UNLIFE);
4121 dam -= p_ptr->virtues[vir-1]/10;
4124 vir = virtue_number(V_INDIVIDUALISM);
4127 dam -= p_ptr->virtues[vir-1]/20;
4130 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4131 if (dam < 1) dam = 1;
4133 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4135 msg_format("You stare into %s.", m_name);
4137 if ((r_ptr->flags3 & (RF3_RES_ALL)) || p_ptr->inside_arena)
4140 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4142 note = " is immune.";
4145 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4149 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4152 /* Attempt a saving throw */
4153 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4154 (m_ptr->mflag2 & MFLAG_NOPET) ||
4155 (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) ||
4156 ((r_ptr->level+10) > randint1(dam)))
4159 /* No obvious effect */
4161 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4163 note = " is unaffected!";
4167 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4169 else if (p_ptr->cursed & TRC_AGGRAVATE)
4172 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4174 note = " hates you too much!";
4177 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
4182 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4184 note = " is tamed!";
4189 if (r_ptr->flags3 & RF3_ANIMAL)
4190 chg_virtue(V_NATURE, 1);
4193 /* No "real" damage */
4198 /* Confusion (Use "dam" as "power") */
4201 if (seen) obvious = TRUE;
4203 if (r_ptr->flags3 & (RF3_RES_ALL))
4206 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4208 note = " is immune.";
4211 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4214 /* Get confused later */
4215 do_conf = damroll(3, (dam / 2)) + 1;
4217 /* Attempt a saving throw */
4218 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4219 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4220 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4222 /* Memorize a flag */
4223 if (r_ptr->flags3 & (RF3_NO_CONF))
4225 if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF);
4231 /* No obvious effect */
4233 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4235 note = " is unaffected!";
4241 /* No "real" damage */
4248 if (seen) obvious = TRUE;
4250 if (r_ptr->flags3 & (RF3_RES_ALL))
4253 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4255 note = " is immune.";
4258 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4261 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
4263 /* Attempt a saving throw */
4264 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4265 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4270 /* No obvious effect */
4272 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4274 note = " is unaffected!";
4280 /* No "real" damage */
4288 /* Lite, but only hurts susceptible creatures */
4296 if (r_ptr->flags3 & (RF3_RES_ALL))
4302 if (r_ptr->flags3 & (RF3_HURT_LITE))
4304 /* Obvious effect */
4305 if (seen) obvious = TRUE;
4307 /* Memorize the effects */
4308 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4310 /* Special effect */
4312 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4313 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4315 note = " cringes from the light!";
4316 note_dies = " shrivels away in the light!";
4321 /* Normally no damage */
4333 /* Lite -- opposite of Dark */
4336 if (seen) obvious = TRUE;
4337 if (r_ptr->flags3 & (RF3_RES_ALL))
4340 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4342 note = " is immune.";
4345 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4348 if (r_ptr->flags4 & (RF4_BR_LITE))
4351 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4356 dam *= 2; dam /= (randint1(6)+6);
4358 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4360 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4362 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4363 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4365 note = " cringes from the light!";
4366 note_dies = " shrivels away in the light!";
4375 /* Dark -- opposite of Lite */
4378 if (seen) obvious = TRUE;
4380 if (r_ptr->flags3 & (RF3_RES_ALL))
4383 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4385 note = " is immune.";
4388 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4391 /* Likes darkness... */
4392 if ((r_ptr->flags4 & (RF4_BR_DARK)) ||
4393 (r_ptr->flags3 & RF3_ORC) ||
4394 (r_ptr->flags3 & RF3_HURT_LITE))
4397 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4402 dam *= 2; dam /= (randint1(6)+6);
4411 if (r_ptr->flags3 & (RF3_RES_ALL))
4416 /* Hurt by rock remover */
4417 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4420 if (seen) obvious = TRUE;
4422 /* Memorize the effects */
4423 if (seen) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4425 /* Cute little message */
4427 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4428 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4430 note = " loses some skin!";
4431 note_dies = " dissolves!";
4436 /* Usually, ignore the effects */
4447 /* Teleport undead (Use "dam" as "power") */
4448 case GF_AWAY_UNDEAD:
4450 /* Only affect undead */
4451 if (r_ptr->flags3 & (RF3_UNDEAD))
4453 bool resists_tele = FALSE;
4455 if (r_ptr->flags3 & (RF3_RES_TELE))
4457 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4459 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4461 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4463 note = " is unaffected!";
4466 resists_tele = TRUE;
4468 else if (r_ptr->level > randint1(100))
4470 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4472 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4477 resists_tele = TRUE;
4483 if (seen) obvious = TRUE;
4484 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4496 /* No "real" damage */
4502 /* Teleport evil (Use "dam" as "power") */
4505 /* Only affect evil */
4506 if (r_ptr->flags3 & (RF3_EVIL))
4508 bool resists_tele = FALSE;
4510 if (r_ptr->flags3 & (RF3_RES_TELE))
4512 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4514 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4516 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4518 note = " is unaffected!";
4521 resists_tele = TRUE;
4523 else if (r_ptr->level > randint1(100))
4525 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4527 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4532 resists_tele = TRUE;
4538 if (seen) obvious = TRUE;
4539 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4551 /* No "real" damage */
4557 /* Teleport monster (Use "dam" as "power") */
4560 bool resists_tele = FALSE;
4561 if (r_ptr->flags3 & (RF3_RES_TELE))
4563 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags3 & (RF3_RES_ALL)))
4565 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4567 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4569 note = " is unaffected!";
4572 resists_tele = TRUE;
4574 else if (r_ptr->level > randint1(100))
4576 if (seen) r_ptr->r_flags3 |= RF3_RES_TELE;
4578 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4583 resists_tele = TRUE;
4590 if (seen) obvious = TRUE;
4592 /* Prepare to teleport */
4596 /* No "real" damage */
4602 /* Turn undead (Use "dam" as "power") */
4603 case GF_TURN_UNDEAD:
4605 if (r_ptr->flags3 & (RF3_RES_ALL))
4610 /* Only affect undead */
4611 if (r_ptr->flags3 & (RF3_UNDEAD))
4613 /* Learn about type */
4614 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4617 if (seen) obvious = TRUE;
4619 /* Apply some fear */
4620 do_fear = damroll(3, (dam / 2)) + 1;
4622 /* Attempt a saving throw */
4623 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4625 /* No obvious effect */
4627 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4629 note = " is unaffected!";
4644 /* No "real" damage */
4650 /* Turn evil (Use "dam" as "power") */
4653 if (r_ptr->flags3 & (RF3_RES_ALL))
4658 /* Only affect evil */
4659 if (r_ptr->flags3 & (RF3_EVIL))
4661 /* Learn about type */
4662 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4665 if (seen) obvious = TRUE;
4667 /* Apply some fear */
4668 do_fear = damroll(3, (dam / 2)) + 1;
4670 /* Attempt a saving throw */
4671 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4673 /* No obvious effect */
4675 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4677 note = " is unaffected!";
4692 /* No "real" damage */
4698 /* Turn monster (Use "dam" as "power") */
4701 if (r_ptr->flags3 & (RF3_RES_ALL))
4707 if (seen) obvious = TRUE;
4709 /* Apply some fear */
4710 do_fear = damroll(3, (dam / 2)) + 1;
4712 /* Attempt a saving throw */
4713 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4714 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4715 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4717 /* No obvious effect */
4719 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4721 note = " is unaffected!";
4728 /* No "real" damage */
4735 case GF_DISP_UNDEAD:
4737 if (r_ptr->flags3 & (RF3_RES_ALL))
4743 /* Only affect undead */
4744 if (r_ptr->flags3 & (RF3_UNDEAD))
4746 /* Learn about type */
4747 if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
4750 if (seen) obvious = TRUE;
4754 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4755 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4757 note = " shudders.";
4758 note_dies = " dissolves!";
4780 if (r_ptr->flags3 & (RF3_RES_ALL))
4786 /* Only affect evil */
4787 if (r_ptr->flags3 & (RF3_EVIL))
4789 /* Learn about type */
4790 if (seen) r_ptr->r_flags3 |= (RF3_EVIL);
4793 if (seen) obvious = TRUE;
4797 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4798 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4800 note = " shudders.";
4801 note_dies = " dissolves!";
4822 if (r_ptr->flags3 & (RF3_RES_ALL))
4828 /* Only affect good */
4829 if (r_ptr->flags3 & (RF3_GOOD))
4831 /* Learn about type */
4832 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
4835 if (seen) obvious = TRUE;
4839 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4840 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4842 note = " shudders.";
4843 note_dies = " dissolves!";
4862 case GF_DISP_LIVING:
4864 if (r_ptr->flags3 & (RF3_RES_ALL))
4870 /* Only affect non-undead */
4871 if (monster_living(r_ptr))
4874 if (seen) obvious = TRUE;
4878 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4879 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4881 note = " shudders.";
4882 note_dies = " dissolves!";
4903 if (r_ptr->flags3 & (RF3_RES_ALL))
4909 /* Only affect demons */
4910 if (r_ptr->flags3 & (RF3_DEMON))
4912 /* Learn about type */
4913 if (seen) r_ptr->r_flags3 |= (RF3_DEMON);
4916 if (seen) obvious = TRUE;
4920 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4921 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4923 note = " shudders.";
4924 note_dies = " dissolves!";
4942 /* Dispel monster */
4945 if (r_ptr->flags3 & (RF3_RES_ALL))
4952 if (seen) obvious = TRUE;
4956 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4957 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4959 note = " shudders.";
4960 note_dies = " dissolves!";
4970 if (seen) obvious = TRUE;
4971 if (r_ptr->flags3 & (RF3_RES_ALL))
4974 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4976 note = " is immune.";
4979 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
4983 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4987 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£",m_name);
4989 msg_format("You draw psychic energy from %s.", m_name);
4992 (void)hp_player(dam);
4997 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
4999 msg_format("%s is unaffected.", m_name);
5009 if (seen) obvious = TRUE;
5012 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5014 msg_format("You gaze intently at %s.", m_name);
5017 if (r_ptr->flags3 & (RF3_RES_ALL))
5020 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5022 note = " is immune.";
5025 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5029 /* Attempt a saving throw */
5030 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5031 (r_ptr->flags3 & RF3_NO_CONF) ||
5032 (r_ptr->level > randint1((p_ptr->lev*2 - 10) < 1 ? 1 : (p_ptr->lev*2 - 10)) + 10))
5034 /* Memorize a flag */
5035 if (r_ptr->flags3 & (RF3_NO_CONF))
5037 r_ptr->r_flags3 |= (RF3_NO_CONF);
5040 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5042 note = "is unaffected!";
5049 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5050 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±¶õ¤È¤Ê¤Ã¤¿¡£";
5052 msg_format("%^s is blasted by psionic energy.", m_name);
5053 note_dies = " collapses, a mindless husk.";
5056 do_conf = randint0(8) + 8;
5062 case GF_BRAIN_SMASH:
5064 if (seen) obvious = TRUE;
5067 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5069 msg_format("You gaze intently at %s.", m_name);
5072 if (r_ptr->flags3 & (RF3_RES_ALL))
5075 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5077 note = " is immune.";
5080 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5084 /* Attempt a saving throw */
5085 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5086 (r_ptr->flags3 & RF3_NO_CONF) ||
5087 (r_ptr->level > randint1((p_ptr->lev*2 - 10) < 1 ? 1 : (p_ptr->lev*2 - 10)) + 10))
5089 /* Memorize a flag */
5090 if (r_ptr->flags3 & (RF3_NO_CONF))
5092 r_ptr->r_flags3 |= (RF3_NO_CONF);
5095 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5097 note = "is unaffected!";
5104 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5105 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±¶õ¤È¤Ê¤Ã¤¿¡£";
5107 msg_format("%^s is blasted by psionic energy.", m_name);
5108 note_dies = " collapses, a mindless husk.";
5111 do_conf = randint0(8) + 8;
5112 do_stun = randint0(8) + 8;
5113 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5114 if (c_ptr->m_idx == p_ptr->riding)
5115 p_ptr->update |= (PU_BONUS);
5123 if (seen) obvious = TRUE;
5126 msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5128 msg_format("You point at %s and curses.", m_name);
5131 if (r_ptr->flags3 & (RF3_RES_ALL))
5134 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5136 note = " is immune.";
5139 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5143 /* Attempt a saving throw */
5144 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5148 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5150 note = "is unaffected!";
5160 if (seen) obvious = TRUE;
5163 msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5165 msg_format("You point at %s and curses horribly.", m_name);
5168 if (r_ptr->flags3 & (RF3_RES_ALL))
5171 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5173 note = " is immune.";
5176 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5180 /* Attempt a saving throw */
5181 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5185 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5187 note = "is unaffected!";
5197 if (seen) obvious = TRUE;
5200 msg_format("%s¤ò»Øº¹¤·¡¢¶²¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª",m_name);
5202 msg_format("You point at %s, incanting terribly!", m_name);
5205 if (r_ptr->flags3 & (RF3_RES_ALL))
5208 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5210 note = " is immune.";
5213 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5217 /* Attempt a saving throw */
5218 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5222 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5224 note = "is unaffected!";
5234 if (seen) obvious = TRUE;
5237 msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£",m_name);
5239 msg_format("You point at %s, screaming th word, 'DIE!'.", m_name);
5242 if (r_ptr->flags3 & (RF3_RES_ALL))
5245 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5247 note = " is immune.";
5250 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5254 /* Attempt a saving throw */
5255 if (randint0(100 + p_ptr->lev) < (r_ptr->level + 35))
5259 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5261 note = "is unaffected!";
5271 if (seen) obvious = TRUE;
5273 if (r_ptr->flags3 & (RF3_RES_ALL))
5276 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5278 note = " is immune.";
5281 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5285 if (r_ptr->flags1 & RF1_UNIQUE)
5288 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5290 note = "is unaffected!";
5296 if ((p_ptr->lev + randint1(dam)) >
5297 (r_ptr->level + randint1(200)))
5299 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5301 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5306 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5316 /* Capture monster */
5320 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5321 (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_UNIQUE_7)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR))
5324 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5326 msg_format("%^s is unaffected.", m_name);
5332 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5333 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)))
5334 nokori_hp = m_ptr->maxhp * 3 / 10;
5336 nokori_hp = m_ptr->maxhp * 3 / 20;
5338 if (m_ptr->hp >= nokori_hp)
5341 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5343 msg_format("You need to weaken %s more.", m_name);
5347 else if (m_ptr->hp < randint0(nokori_hp))
5349 if (m_ptr->mflag2 & MFLAG_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5351 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5353 msg_format("You capture %^s!", m_name);
5355 cap_mon = m_list[c_ptr->m_idx].r_idx;
5356 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5357 cap_hp = m_list[c_ptr->m_idx].hp;
5358 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5359 if (m_list[c_ptr->m_idx].nickname)
5360 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5363 if (c_ptr->m_idx == p_ptr->riding)
5365 if (rakuba(-1, FALSE))
5368 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5370 msg_format("You have fallen from %s.", m_name);
5375 delete_monster_idx(c_ptr->m_idx);
5382 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5384 msg_format("You failed to capture %s.", m_name);
5393 if (seen) obvious = TRUE;
5395 if (dam == HISSATSU_NYUSIN)
5399 bool success = FALSE;
5400 for (i = 0; i < 8; i++)
5402 if (cave_empty_bold(y+ddy[i], x+ddx[i]) || ((y+ddy[i] == py) && (x+ddx[i] == px)))
5405 if (distance(py, px, ny, nx) > distance(py, px, y+ddy[i], x+ddx[i]))
5414 if ((ny != py) || (nx != px))
5416 teleport_player_to(ny, nx, FALSE);
5418 msg_print("ÁÇÁ᤯Áê¼ê¤Î²û¤ËÆþ¤ê¹þ¤ó¤À¡ª");
5420 msg_format("You quickly jump in and attack %s!", m_name);
5427 msg_print("¼ºÇÔ¡ª");
5429 msg_print("Failed!");
5436 return (py_attack(y, x, dam));
5439 msg_print("¹¶·â¤Ï¶õ¤òÀڤä¿¡£");
5441 msg_print("You attack the empty air.");
5447 /* Sleep (Use "dam" as "power") */
5453 if (seen) obvious = TRUE;
5455 if (r_ptr->flags3 & (RF3_RES_ALL))
5458 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5460 note = " is immune.";
5463 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5466 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5469 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5471 note = " is immune!";
5475 if (seen) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5481 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5483 note = " is immune!";
5490 if (one_in_(5)) effect = 1;
5491 else if (one_in_(4)) effect = 2;
5492 else if (one_in_(3)) effect = 3;
5497 /* Powerful monsters can resist */
5498 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5499 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5502 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5504 note = " is unaffected!";
5510 /* Normal monsters slow down */
5516 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5518 note = " starts moving slower.";
5521 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5523 if (c_ptr->m_idx == p_ptr->riding)
5524 p_ptr->update |= (PU_BONUS);
5528 else if (effect == 2)
5530 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5532 /* Attempt a saving throw */
5533 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5534 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5539 /* No obvious effect */
5541 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5543 note = " is unaffected!";
5550 else if (effect == 3)
5552 /* Attempt a saving throw */
5553 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5554 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5555 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5557 /* Memorize a flag */
5558 if (r_ptr->flags3 & RF3_NO_SLEEP)
5560 if (seen) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5563 /* No obvious effect */
5565 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5567 note = " is unaffected!";
5574 /* Go to sleep (much) later */
5576 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5578 note = " falls asleep!";
5588 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5590 note = " is immune!";
5594 /* No "real" damage */
5603 if (seen) obvious = TRUE;
5605 if (r_ptr->flags3 & (RF3_RES_ALL))
5608 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5610 note = " is immune.";
5613 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5617 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)
5624 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG_NOGENO))
5631 delete_monster_idx(c_ptr->m_idx);
5633 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5635 msg_format("%^s disappered!",m_name);
5639 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5641 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5645 chg_virtue(V_VITALITY, -1);
5650 p_ptr->redraw |= (PR_HP);
5653 p_ptr->window |= (PW_PLAYER);
5660 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5662 note = "is unaffected!";
5665 if (one_in_(13)) m_ptr->mflag2 |= MFLAG_NOGENO;
5673 msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£",m_name);
5675 msg_format("You take a photograph of %s.",m_name);
5678 if (r_ptr->flags3 & (RF3_HURT_LITE))
5680 /* Obvious effect */
5681 if (seen) obvious = TRUE;
5683 /* Memorize the effects */
5684 if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5686 /* Special effect */
5688 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5689 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5691 note = " cringes from the light!";
5692 note_dies = " shrivels away in the light!";
5697 /* Normally no damage */
5704 photo = m_ptr->r_idx;
5711 case GF_BLOOD_CURSE:
5713 if (seen) obvious = TRUE;
5714 if (r_ptr->flags3 & (RF3_RES_ALL))
5717 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5719 note = " is immune.";
5722 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5730 bool success = FALSE;
5731 if (seen) obvious = TRUE;
5733 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5735 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5736 if (dam < 1) dam = 1;
5738 /* No need to tame your pet */
5742 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5744 note = " starts moving faster.";
5747 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5751 /* Attempt a saving throw */
5752 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5753 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5754 (m_ptr->mflag2 & MFLAG_NOPET) ||
5755 (p_ptr->cursed & TRC_AGGRAVATE) ||
5756 ((r_ptr->level+10) > randint1(dam)))
5759 if (one_in_(4)) m_ptr->mflag2 |= MFLAG_NOPET;
5764 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5766 note = " is tamed!";
5770 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5772 /* Learn about type */
5773 if (seen) r_ptr->r_flags3 |= (RF3_GOOD);
5780 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5782 do_fear = randint1(90)+10;
5786 r_ptr->r_flags3 |= (RF3_NO_FEAR);
5790 /* No "real" damage */
5797 if (seen) obvious = TRUE;
5799 if (r_ptr->flags3 & (RF3_RES_ALL))
5802 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5804 note = " is immune.";
5807 if (seen) r_ptr->r_flags3 |= (RF3_RES_ALL);
5811 /* Attempt a saving throw */
5812 if (randint0(100 + dam) < (r_ptr->level + 50))
5816 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5818 note = "is unaffected!";
5839 /* Absolutely no effect */
5840 if (skipped) return (FALSE);
5842 /* "Unique" monsters cannot be polymorphed */
5843 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5845 /* Quest monsters cannot be polymorphed */
5846 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5848 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5850 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5851 if (((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7) || (r_ptr->flags1 & RF1_QUESTOR)) && !p_ptr->inside_battle)
5853 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5858 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5859 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5862 /* Modify the damage */
5864 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5866 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤";
5868 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5871 /* Check for death */
5872 if (dam > m_ptr->hp)
5874 /* Extract method of death */
5878 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5879 else if (do_poly && (randint1(90) > r_ptr->level))
5881 if (polymorph_monster(y, x))
5884 if (seen) obvious = TRUE;
5886 /* Monster polymorphs */
5888 note = "¤¬ÊѿȤ·¤¿¡ª";
5894 /* Turn off the damage */
5897 /* Hack -- Get new monster */
5898 m_ptr = &m_list[c_ptr->m_idx];
5900 /* Hack -- Get new race */
5901 r_ptr = &r_info[m_ptr->r_idx];
5907 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5909 note = " is unaffected!";
5915 /* Handle "teleport" */
5919 if (seen) obvious = TRUE;
5923 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5925 note = " disappears!";
5928 chg_virtue(V_VALOUR, -1);
5931 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who));
5933 /* Hack -- get new location */
5937 /* Hack -- get new grid */
5938 c_ptr = &cave[y][x];
5941 /* Sound and Impact breathers never stun */
5943 !(r_ptr->flags4 & (RF4_BR_SOUN)) &&
5944 !(r_ptr->flags4 & (RF4_BR_WALL)) &&
5945 !(r_ptr->flags3 & (RF3_NO_STUN)))
5948 if (seen) obvious = TRUE;
5954 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5956 note = " is more dazed.";
5959 tmp = m_ptr->stunned + (do_stun / 2);
5964 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5966 note = " is dazed.";
5973 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5979 /* Confusion and Chaos breathers (and sleepers) never confuse */
5981 !(r_ptr->flags3 & (RF3_NO_CONF)) &&
5982 !(r_ptr->flags4 & (RF4_BR_CONF)) &&
5983 !(r_ptr->flags4 & (RF4_BR_CHAO)))
5986 if (seen) obvious = TRUE;
5988 /* Already partially confused */
5989 if (m_ptr->confused)
5992 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5994 note = " looks more confused.";
5997 tmp = m_ptr->confused + (do_conf / 2);
6000 /* Was not confused */
6004 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
6006 note = " looks confused.";
6012 /* Apply confusion */
6013 m_ptr->confused = (tmp < 200) ? tmp : 200;
6021 if (seen) obvious = TRUE;
6023 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp-1;
6028 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
6030 note = " seems weakened.";
6032 m_ptr->maxhp -= do_time;
6033 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp-m_ptr->maxhp;
6043 tmp = m_ptr->monfear + do_fear;
6046 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6053 /* If another monster did the damage, hurt the monster by hand */
6056 /* Redraw (later) if needed */
6057 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6058 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6060 /* Wake the monster up */
6063 /* Hurt the monster */
6071 if (is_pet(m_ptr) && !(m_ptr->ml))
6074 /* Give detailed messages if destroyed */
6077 monster_desc(m_name, m_ptr, 0x100);
6080 msg_format("%^s%s", m_name, note);
6088 monster_gain_exp(who, m_ptr->r_idx);
6090 /* Generate treasure, etc */
6091 monster_death(c_ptr->m_idx, FALSE);
6093 /* Delete the monster */
6094 delete_monster_idx(c_ptr->m_idx);
6099 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6101 msg_print("You feel sad for a moment.");
6107 /* Damaged monster */
6110 /* Give detailed messages if visible or destroyed */
6111 if (note && seen) msg_format("%^s%s", m_name, note);
6113 /* Hack -- Pain message */
6116 message_pain(c_ptr->m_idx, dam);
6123 /* Hack -- handle sleep */
6124 if (do_sleep) m_ptr->csleep = do_sleep;
6128 else if (heal_leper)
6131 msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6133 msg_print("The Mangy looking leper is healed!");
6136 delete_monster_idx(c_ptr->m_idx);
6138 /* If the player did it, give him experience, check fear */
6139 else if (typ != GF_DRAIN_MANA)
6143 /* Hurt the monster, check for fear and death */
6144 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6149 /* Damaged monster */
6152 /* HACK - anger the monster before showing the sleep message */
6153 if (do_sleep) anger_monster(m_ptr);
6155 /* Give detailed messages if visible or destroyed */
6158 msg_format("%s%s", m_name, note);
6160 msg_format("%^s%s", m_name, note);
6164 /* Hack -- Pain message */
6165 else if (known && (dam || !do_fear))
6167 message_pain(c_ptr->m_idx, dam);
6170 /* Anger monsters */
6171 if (((dam > 0) || get_angry) && !do_sleep)
6172 anger_monster(m_ptr);
6175 if ((fear || do_fear) && (m_ptr->ml))
6182 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6184 msg_format("%^s flees in terror!", m_name);
6189 /* Hack -- handle sleep */
6190 if (do_sleep) m_ptr->csleep = do_sleep;
6194 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6196 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6200 switch (randint1(28))
6206 msg_print("ÃÏÌ̤¬Íɤ줿...");
6208 msg_print("The ground trembles...");
6211 earthquake(ty, tx, 4 + randint0(4));
6212 if (!one_in_(6)) break;
6214 case 3: case 4: case 5: case 6:
6217 int dam = damroll(10, 10);
6219 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6221 msg_print("A portal opens to a plane of raw mana!");
6224 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6225 if (!one_in_(6)) break;
6231 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6233 msg_print("Space warps about you!");
6236 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE);
6237 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6238 if (!one_in_(6)) break;
6240 case 9: case 10: case 11:
6242 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6244 msg_print("You feel a surge of energy!");
6247 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6248 if (!one_in_(6)) break;
6249 case 12: case 13: case 14: case 15: case 16:
6250 aggravate_monsters(0);
6251 if (!one_in_(6)) break;
6253 count += activate_hi_summon(ty, tx, TRUE);
6254 if (!one_in_(6)) break;
6255 case 19: case 20: case 21: case 22:
6257 bool pet = !one_in_(3);
6258 u32b mode = PM_ALLOW_GROUP;
6260 if (pet) mode |= PM_FORCE_PET;
6261 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6263 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6264 if (!one_in_(6)) break;
6266 case 23: case 24: case 25:
6267 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6269 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6271 msg_print("You feel your life draining away...");
6274 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6275 else lose_exp(p_ptr->exp / 16);
6276 if (!one_in_(6)) break;
6277 case 26: case 27: case 28:
6286 (void)do_dec_stat(i);
6295 (void)do_dec_stat(randint0(6));
6304 if (p_ptr->inside_battle)
6306 p_ptr->health_who = c_ptr->m_idx;
6307 p_ptr->redraw |= (PR_HEALTH);
6311 /* XXX XXX XXX Verify this code */
6313 /* Update the monster */
6314 update_mon(c_ptr->m_idx, FALSE);
6316 /* Redraw the monster grid */
6320 /* Update monster recall window */
6321 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6324 p_ptr->window |= (PW_MONSTER);
6327 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6331 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6333 set_target(m_ptr, monster_target_y, monster_target_x);
6336 else if (is_pet(&m_list[who]) && (m_ptr->target_y != py) && (m_ptr->target_x != px))
6338 set_target(m_ptr, m_list[who].fy, m_list[who].fx);
6342 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6344 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6345 rakubadam_m = (dam > 200) ? 200 : dam;
6354 /* Get local object */
6357 /* Prepare to make a Blade of Chaos */
6358 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6360 q_ptr->pval = photo;
6362 /* Mark the item as fully known */
6363 q_ptr->ident |= (IDENT_MENTAL);
6365 /* Drop it in the dungeon */
6366 (void)drop_near(q_ptr, -1, py, px);
6374 /* Return "Anything seen?" */
6380 * Helper function for "project()" below.
6382 * Handle a beam/bolt/ball causing damage to the player.
6384 * This routine takes a "source monster" (by index), a "distance", a default
6385 * "damage", and a "damage type". See "project_m()" above.
6387 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6388 * is reduced (see "project_m()" above). This can happen if a monster breathes
6389 * at the player and hits a wall instead.
6391 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6392 * to know if this is actually a ball or a bolt spell
6395 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6396 * we just assume that the effects were obvious, for historical reasons.
6398 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6403 /* Hack -- assume obvious */
6404 bool obvious = TRUE;
6406 /* Player blind-ness */
6407 bool blind = (p_ptr->blind ? TRUE : FALSE);
6409 /* Player needs a "description" (he is blind) */
6412 /* Source monster */
6413 monster_type *m_ptr = NULL;
6415 /* Monster name (for attacks) */
6418 /* Monster name (for damage) */
6421 /* Hack -- messages */
6427 /* Player is not here */
6428 if ((x != px) || (y != py)) return (FALSE);
6430 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6436 /* Player cannot hurt himself */
6437 if (!who) return (FALSE);
6438 if (who == p_ptr->riding) return (FALSE);
6440 if ((p_ptr->reflect || p_ptr->tim_reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6443 int max_attempts = 10;
6446 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6447 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6448 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6450 if (blind) msg_print("Something bounces!");
6451 else msg_print("The attack bounces!");
6455 /* Choose 'new' target */
6458 t_y = m_list[who].fy - 1 + randint1(3);
6459 t_x = m_list[who].fx - 1 + randint1(3);
6462 while (max_attempts && in_bounds2u(t_y, t_x) &&
6463 !(player_has_los_bold(t_y, t_x)));
6465 if (max_attempts < 1)
6467 t_y = m_list[who].fy;
6468 t_x = m_list[who].fx;
6471 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6478 /* Limit maximum damage */
6479 if (dam > 1600) dam = 1600;
6481 /* Reduce damage by distance */
6482 dam = (dam + r) / (r + 1);
6485 /* If the player is blind, be more descriptive */
6486 if (blind) fuzzy = TRUE;
6491 /* Get the source monster */
6492 m_ptr = &m_list[who];
6493 /* Extract the monster level */
6494 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6496 /* Get the monster name */
6497 monster_desc(m_name, m_ptr, 0);
6499 /* Get the monster's real name (gotten before polymorph!) */
6500 strcpy(killer, who_name);
6505 strcpy(killer, "æ«");
6507 strcpy(killer, "a trap");
6511 /* Analyze the damage */
6514 /* Standard damage -- hurts inventory too */
6518 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6520 if (fuzzy) msg_print("You are hit by acid!");
6523 get_damage = acid_dam(dam, killer, monspell);
6527 /* Standard damage -- hurts inventory too */
6531 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6533 if (fuzzy) msg_print("You are hit by fire!");
6536 get_damage = fire_dam(dam, killer, monspell);
6540 /* Standard damage -- hurts inventory too */
6544 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6546 if (fuzzy) msg_print("You are hit by cold!");
6549 get_damage = cold_dam(dam, killer, monspell);
6553 /* Standard damage -- hurts inventory too */
6557 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6559 if (fuzzy) msg_print("You are hit by lightning!");
6562 get_damage = elec_dam(dam, killer, monspell);
6566 /* Standard damage -- also poisons player */
6569 bool double_resist = (p_ptr->oppose_pois || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU));
6571 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6573 if (fuzzy) msg_print("You are hit by poison!");
6576 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6577 if (double_resist) dam = (dam + 2) / 3;
6579 if ((!(double_resist || p_ptr->resist_pois)) &&
6580 one_in_(HURT_CHANCE))
6585 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6587 if (!(double_resist || p_ptr->resist_pois))
6589 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6594 /* Standard damage -- also poisons / mutates player */
6597 bool double_resist = (p_ptr->oppose_pois || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU));
6599 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6601 if (fuzzy) msg_print("You are hit by radiation!");
6604 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6605 if (double_resist) dam = (2 * dam + 2) / 5;
6606 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6607 if (!(double_resist || p_ptr->resist_pois))
6609 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6611 if (one_in_(5)) /* 6 */
6614 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6616 msg_print("You undergo a freakish metamorphosis!");
6619 if (one_in_(4)) /* 4 */
6627 inven_damage(set_acid_destroy, 2);
6633 /* Standard damage */
6637 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6639 if (fuzzy) msg_print("You are hit by something!");
6642 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6646 /* Holy Orb -- Player only takes partial damage */
6650 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6652 if (fuzzy) msg_print("You are hit by something!");
6655 if (p_ptr->align > 10)
6657 else if (p_ptr->align < -10)
6659 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6666 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6668 if (fuzzy) msg_print("You are hit by something!");
6671 if (p_ptr->align > 10)
6673 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6677 /* Arrow -- XXX no dodging */
6681 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6683 if (fuzzy) msg_print("You are hit by something sharp!");
6686 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6689 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6691 msg_print("You cut down the arrow!");
6695 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6699 /* Plasma -- XXX No resist */
6703 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6705 if (fuzzy) msg_print("You are hit by something *HOT*!");
6708 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6710 if (!p_ptr->resist_sound)
6712 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6713 (void)set_stun(p_ptr->stun + k);
6716 if (!(p_ptr->resist_fire ||
6717 p_ptr->oppose_fire ||
6718 music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU) ||
6719 p_ptr->immune_fire))
6721 inven_damage(set_acid_destroy, 3);
6727 /* Nether -- drain experience */
6731 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6733 if (fuzzy) msg_print("You are hit by nether forces!");
6737 if (p_ptr->resist_neth)
6739 if (!prace_is_(RACE_SPECTRE))
6740 dam *= 6; dam /= (randint1(4) + 7);
6742 else drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
6744 if (prace_is_(RACE_SPECTRE))
6747 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6749 msg_print("You feel invigorated!");
6753 learn_spell(monspell);
6757 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6763 /* Water -- stun/confuse */
6767 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6769 if (fuzzy) msg_print("You are hit by something wet!");
6772 if (!p_ptr->resist_sound)
6774 set_stun(p_ptr->stun + randint1(40));
6776 if (!p_ptr->resist_conf)
6778 set_confused(p_ptr->confused + randint1(5) + 5);
6783 inven_damage(set_cold_destroy, 3);
6786 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6790 /* Chaos -- many effects */
6794 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6796 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6799 if (p_ptr->resist_chaos)
6801 dam *= 6; dam /= (randint1(4) + 7);
6803 if (!p_ptr->resist_conf)
6805 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6807 if (!p_ptr->resist_chaos)
6809 (void)set_image(p_ptr->image + randint1(10));
6813 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6815 msg_print("Your body is twisted by chaos!");
6818 (void)gain_random_mutation(0);
6821 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6823 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
6825 if (!p_ptr->resist_chaos || one_in_(9))
6827 inven_damage(set_elec_destroy, 2);
6828 inven_damage(set_fire_destroy, 2);
6830 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6834 /* Shards -- mostly cutting */
6838 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6840 if (fuzzy) msg_print("You are hit by something sharp!");
6843 if (p_ptr->resist_shard)
6845 dam *= 6; dam /= (randint1(4) + 7);
6849 (void)set_cut(p_ptr->cut + dam);
6852 if (!p_ptr->resist_shard || one_in_(13))
6854 inven_damage(set_cold_destroy, 2);
6857 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6861 /* Sound -- mostly stunning */
6865 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6867 if (fuzzy) msg_print("You are hit by a loud noise!");
6870 if (p_ptr->resist_sound)
6872 dam *= 5; dam /= (randint1(4) + 7);
6876 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6877 (void)set_stun(p_ptr->stun + k);
6880 if (!p_ptr->resist_sound || one_in_(13))
6882 inven_damage(set_cold_destroy, 2);
6885 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6889 /* Pure confusion */
6893 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6895 if (fuzzy) msg_print("You are hit by something puzzling!");
6898 if (p_ptr->resist_conf)
6900 dam *= 5; dam /= (randint1(4) + 7);
6902 if (!p_ptr->resist_conf)
6904 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6906 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6910 /* Disenchantment -- see above */
6914 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6916 if (fuzzy) msg_print("You are hit by something static!");
6919 if (p_ptr->resist_disen)
6921 dam *= 6; dam /= (randint1(4) + 7);
6925 (void)apply_disenchant(0);
6927 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6931 /* Nexus -- see above */
6935 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6937 if (fuzzy) msg_print("You are hit by something strange!");
6940 if (p_ptr->resist_nexus)
6942 dam *= 6; dam /= (randint1(4) + 7);
6948 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6952 /* Force -- mostly stun */
6956 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6958 if (fuzzy) msg_print("You are hit by kinetic force!");
6961 if (!p_ptr->resist_sound)
6963 (void)set_stun(p_ptr->stun + randint1(20));
6965 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6970 /* Rocket -- stun, cut */
6974 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
6976 if (fuzzy) msg_print("There is an explosion!");
6979 if (!p_ptr->resist_sound)
6981 (void)set_stun(p_ptr->stun + randint1(20));
6983 if (p_ptr->resist_shard)
6989 (void)set_cut(p_ptr-> cut + ( dam / 2));
6992 if ((!p_ptr->resist_shard) || one_in_(12))
6994 inven_damage(set_cold_destroy, 3);
6997 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7001 /* Inertia -- slowness */
7005 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7007 if (fuzzy) msg_print("You are hit by something slow!");
7010 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7011 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7015 /* Lite -- blinding */
7019 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7021 if (fuzzy) msg_print("You are hit by something!");
7024 if (p_ptr->resist_lite)
7026 dam *= 4; dam /= (randint1(4) + 7);
7028 else if (!blind && !p_ptr->resist_blind)
7030 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7032 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
7035 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
7037 msg_print("The light scorches your flesh!");
7042 else if (prace_is_(RACE_S_FAIRY))
7046 if (p_ptr->wraith_form) dam *= 2;
7047 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7049 if (p_ptr->wraith_form)
7051 p_ptr->wraith_form = 0;
7053 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7055 msg_print("The light forces you out of your incorporeal shadow form.");
7058 p_ptr->redraw |= PR_MAP;
7059 /* Update monsters */
7060 p_ptr->update |= (PU_MONSTERS);
7062 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7064 /* Redraw status bar */
7065 p_ptr->redraw |= (PR_STATUS);
7072 /* Dark -- blinding */
7076 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7078 if (fuzzy) msg_print("You are hit by something!");
7081 if (p_ptr->resist_dark)
7083 dam *= 4; dam /= (randint1(4) + 7);
7085 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7087 else if (!blind && !p_ptr->resist_blind)
7089 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7091 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7095 /* Time -- bolt fewer effects XXX */
7099 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7101 if (fuzzy) msg_print("You are hit by a blast from the past!");
7104 if (p_ptr->resist_time)
7107 dam /= (randint1(4) + 7);
7109 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7111 msg_print("You feel as if time is passing you by.");
7117 switch (randint1(10))
7119 case 1: case 2: case 3: case 4: case 5:
7121 if (p_ptr->prace == RACE_ANDROID) break;
7123 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7125 msg_print("You feel life has clocked back.");
7128 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7132 case 6: case 7: case 8: case 9:
7134 switch (randint1(6))
7137 case 1: k = A_STR; act = "¶¯¤¯"; break;
7138 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7139 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7140 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7141 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7142 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7144 case 1: k = A_STR; act = "strong"; break;
7145 case 2: k = A_INT; act = "bright"; break;
7146 case 3: k = A_WIS; act = "wise"; break;
7147 case 4: k = A_DEX; act = "agile"; break;
7148 case 5: k = A_CON; act = "hale"; break;
7149 case 6: k = A_CHR; act = "beautiful"; break;
7155 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7157 msg_format("You're not as %s as you used to be...", act);
7161 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7162 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7163 p_ptr->update |= (PU_BONUS);
7170 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7172 msg_print("You're not as powerful as you used to be...");
7176 for (k = 0; k < 6; k++)
7178 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7179 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7181 p_ptr->update |= (PU_BONUS);
7187 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7191 /* Gravity -- stun plus slowness plus teleport */
7195 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7196 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7198 if (fuzzy) msg_print("You are hit by something heavy!");
7199 msg_print("Gravity warps around you.");
7204 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7205 if (!(p_ptr->resist_sound || p_ptr->ffall))
7207 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7208 (void)set_stun(p_ptr->stun + k);
7212 dam = (dam * 2) / 3;
7215 if (!p_ptr->ffall || one_in_(13))
7217 inven_damage(set_cold_destroy, 2);
7220 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7224 /* Standard damage */
7225 case GF_DISINTEGRATE:
7228 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7230 if (fuzzy) msg_print("You are hit by pure energy!");
7233 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7240 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7242 if (fuzzy) msg_print("You are hit by something invigorating!");
7245 (void)hp_player(dam);
7253 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7255 if (fuzzy) msg_print("You are hit by something!");
7258 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7266 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7268 if (fuzzy) msg_print("You are hit by something slow!");
7271 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7277 if (p_ptr->free_act) break;
7279 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7281 if (fuzzy) msg_print("You fall asleep!");
7285 if (ironman_nightmare)
7288 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7290 msg_print("A horrible vision enters your mind.");
7294 /* Pick a nightmare */
7295 get_mon_num_prep(get_nightmare, NULL);
7297 /* Have some nightmares */
7298 have_nightmare(get_mon_num(MAX_DEPTH));
7300 /* Remove the monster restriction */
7301 get_mon_num_prep(NULL, NULL);
7304 set_paralyzed(p_ptr->paralyzed + dam);
7315 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7317 if (fuzzy) msg_print("You are hit by an aura of magic!");
7320 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7328 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7330 if (fuzzy) msg_print("You are hit by an energy!");
7333 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7341 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7343 if (fuzzy) msg_print("Something falls from the sky on you!");
7346 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7347 if (!p_ptr->resist_shard || one_in_(13))
7349 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7350 inven_damage(set_cold_destroy, 2);
7356 /* Ice -- cold plus stun plus cuts */
7360 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7362 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7365 cold_dam(dam, killer, monspell);
7366 if (!p_ptr->resist_shard)
7368 (void)set_cut(p_ptr->cut + damroll(5, 8));
7370 if (!p_ptr->resist_sound)
7372 (void)set_stun(p_ptr->stun + randint1(15));
7375 if ((!(p_ptr->resist_cold || p_ptr->oppose_cold || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))) || one_in_(12))
7377 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7387 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7389 if (fuzzy) msg_print("You are hit by something extremely cold!");
7393 if (p_ptr->mimic_form)
7395 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7396 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7401 switch (p_ptr->prace)
7403 /* Some races are immune */
7417 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7429 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7432 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7434 msg_print("You resist the effects!");
7436 learn_spell(MS_MIND_BLAST);
7441 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7443 msg_print("Your mind is blasted by psyonic energy.");
7446 if (!p_ptr->resist_conf)
7448 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7451 if (!p_ptr->resist_chaos && one_in_(3))
7453 (void)set_image(p_ptr->image + randint0(250) + 150);
7460 p_ptr->csp_frac = 0;
7462 p_ptr->redraw |= PR_MANA;
7464 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_MIND_BLAST);
7469 case GF_BRAIN_SMASH:
7471 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7474 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7476 msg_print("You resist the effects!");
7478 learn_spell(MS_BRAIN_SMASH);
7483 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7485 msg_print("Your mind is blasted by psionic energy.");
7492 p_ptr->csp_frac = 0;
7494 p_ptr->redraw |= PR_MANA;
7496 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_BRAIN_SMASH);
7497 if (!p_ptr->resist_blind)
7499 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7501 if (!p_ptr->resist_conf)
7503 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7505 if (!p_ptr->free_act)
7507 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7509 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7511 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7512 (void)do_dec_stat(A_INT);
7513 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7514 (void)do_dec_stat(A_WIS);
7516 if (!p_ptr->resist_chaos)
7518 (void)set_image(p_ptr->image + randint0(250) + 150);
7526 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7529 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7531 msg_print("You resist the effects!");
7533 learn_spell(MS_CAUSE_1);
7537 curse_equipment(15, 0);
7538 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_1);
7545 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7548 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7550 msg_print("You resist the effects!");
7552 learn_spell(MS_CAUSE_2);
7556 curse_equipment(25, MIN(rlev/2-15, 5));
7557 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_2);
7564 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7567 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7569 msg_print("You resist the effects!");
7571 learn_spell(MS_CAUSE_3);
7575 curse_equipment(33, MIN(rlev/2-15, 15));
7576 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_3);
7583 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7586 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7588 msg_print("You resist the effects!");
7590 learn_spell(MS_CAUSE_4);
7594 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_4);
7595 (void)set_cut(p_ptr->cut + damroll(10, 10));
7602 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7605 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7607 msg_format("You resist the effects!");
7609 learn_spell(MS_HAND_DOOM);
7615 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7617 msg_print("Your feel your life fade away!");
7620 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, MS_HAND_DOOM);
7621 curse_equipment(40, 20);
7623 if (p_ptr->chp < 1) p_ptr->chp = 1;
7638 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7641 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7643 char m_name_self[80];
7646 monster_desc(m_name_self, m_ptr, 0x23);
7648 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7650 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7651 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7654 if (p_ptr->riding && dam > 0)
7656 rakubadam_p = (dam > 200) ? 200 : dam;
7664 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7670 /* Return "Anything seen?" */
7676 * Find the distance from (x, y) to a line.
7678 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7680 /* Vector from (x, y) to (x1, y1) */
7689 int pd = distance(y1, x1, y, x);
7690 int nd = distance(y1, x1, y2, x2);
7692 if (pd > nd) return distance(y, x, y2, x2);
7694 /* Component of P on N */
7695 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7697 /* Absolute value */
7698 return((nd >= 0) ? nd : 0 - nd);
7705 * Modified version of los() for calculation of disintegration balls.
7706 * Disintegration effects are stopped by permanent walls.
7708 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7728 /* Slope, or 1/Slope, of LOS */
7732 /* Extract the offset */
7736 /* Extract the absolute offset */
7741 /* Handle adjacent (or identical) grids */
7742 if ((ax < 2) && (ay < 2)) return (TRUE);
7745 /* Paranoia -- require "safe" origin */
7746 /* if (!in_bounds(y1, x1)) return (FALSE); */
7749 /* Directly South/North */
7752 /* South -- check for walls */
7755 for (ty = y1 + 1; ty < y2; ty++)
7757 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7761 /* North -- check for walls */
7764 for (ty = y1 - 1; ty > y2; ty--)
7766 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7774 /* Directly East/West */
7777 /* East -- check for walls */
7780 for (tx = x1 + 1; tx < x2; tx++)
7782 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7786 /* West -- check for walls */
7789 for (tx = x1 - 1; tx > x2; tx--)
7791 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7800 /* Extract some signs */
7801 sx = (dx < 0) ? -1 : 1;
7802 sy = (dy < 0) ? -1 : 1;
7805 /* Vertical "knights" */
7810 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7814 /* Horizontal "knights" */
7819 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7824 /* Calculate scale factor div 2 */
7827 /* Calculate scale factor */
7831 /* Travel horizontally */
7834 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7840 /* Consider the special case where slope == 1. */
7851 /* Note (below) the case (qy == f2), where */
7852 /* the LOS exactly meets the corner of a tile. */
7855 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7866 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7879 /* Travel vertically */
7882 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7898 /* Note (below) the case (qx == f2), where */
7899 /* the LOS exactly meets the corner of a tile. */
7902 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7913 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7932 * Do disintegration effect on the terrain
7933 * before we decide the region of the effect.
7935 static bool do_disintegration(int by, int bx, int y, int x)
7939 /* Disintegration balls explosions are stopped by perma-walls */
7940 if (!in_disintegration_range(by, bx, y, x)) return FALSE;
7942 /* Permanent walls and artifacts don't get effect */
7943 /* But not protect monsters and other objects */
7944 if (!cave_valid_bold(y, x)) return TRUE;
7946 /* Destroy mirror/glyph */
7949 feat = cave[y][x].feat;
7951 if ((feat < FEAT_PATTERN_START || feat > FEAT_PATTERN_XTRA2) &&
7952 (feat < FEAT_DEEP_WATER || feat > FEAT_GRASS))
7954 if (feat == FEAT_TREES || feat == FEAT_FLOWER || feat == FEAT_DEEP_GRASS)
7955 cave_set_feat(y, x, FEAT_GRASS);
7957 cave_set_feat(y, x, floor_type[randint0(100)]);
7960 /* Update some things -- similar to GF_KILL_WALL */
7961 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
7970 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)
7975 int brev = rad * rad / dist;
7979 int tdis = distance(y1, x1, y2, x2);
7980 int mdis = tdis + rad;
7982 while (bdis <= mdis)
7986 if ((0 < dist) && (path_n < dist))
7988 int ny = GRID_Y(path_g[path_n]);
7989 int nx = GRID_X(path_g[path_n]);
7990 int nd = distance(ny, nx, y1, x1);
7992 /* Get next base point */
8001 /* Travel from center outward */
8002 for (cdis = 0; cdis <= brad; cdis++)
8004 /* Scan the maximal blast area of radius "cdis" */
8005 for (y = by - cdis; y <= by + cdis; y++)
8007 for (x = bx - cdis; x <= bx + cdis; x++)
8009 /* Ignore "illegal" locations */
8010 if (!in_bounds(y, x)) continue;
8012 /* Enforce a circular "ripple" */
8013 if (distance(y1, x1, y, x) != bdis) continue;
8015 /* Enforce an arc */
8016 if (distance(by, bx, y, x) != cdis) continue;
8021 /* Disintegration are stopped only by perma-walls */
8024 /* Destroy terrains */
8025 if (!do_disintegration(by, bx, y, x)) continue;
8029 /* No actual disintegration */
8030 if (!in_disintegration_range(by, bx, y, x)) continue;
8035 /* The blast is stopped by walls */
8036 if (!los(by, bx, y, x)) continue;
8039 /* Save this grid */
8047 /* Encode some more "radius" info */
8048 gm[bdis + 1] = *pgrids;
8050 /* Increase the size */
8051 brad = rad * (path_n + brev) / (dist + brev);
8053 /* Find the next ripple */
8057 /* Store the effect size */
8063 * Generic "beam"/"bolt"/"ball" projection routine.
8066 * who: Index of "source" monster (zero for "player")
8067 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8068 * y,x: Target location (or location to travel "towards")
8069 * dam: Base damage roll to apply to affected monsters (or player)
8070 * typ: Type of damage to apply to monsters (and objects)
8071 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8074 * TRUE if any "effects" of the projection were observed, else FALSE
8076 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8077 * towards a given location (optionally passing over the heads of interposing
8078 * monsters), and have it do a given amount of damage to the monsters (and
8079 * optionally objects) within the given radius of the final location.
8081 * A "bolt" travels from source to target and affects only the target grid.
8082 * A "beam" travels from source to target, affecting all grids passed through.
8083 * A "ball" travels from source to the target, exploding at the target, and
8084 * affecting everything within the given radius of the target location.
8086 * Traditionally, a "bolt" does not affect anything on the ground, and does
8087 * not pass over the heads of interposing monsters, much like a traditional
8088 * missile, and will "stop" abruptly at the "target" even if no monster is
8089 * positioned there, while a "ball", on the other hand, passes over the heads
8090 * of monsters between the source and target, and affects everything except
8091 * the source monster which lies within the final radius, while a "beam"
8092 * affects every monster between the source and target, except for the casting
8093 * monster (or player), and rarely affects things on the ground.
8095 * Two special flags allow us to use this function in special ways, the
8096 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8097 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8098 * actually projecting from the source monster (or player).
8100 * The player will only get "experience" for monsters killed by himself
8101 * Unique monsters can only be destroyed by attacks from the player
8103 * Only 256 grids can be affected per projection, limiting the effective
8104 * "radius" of standard ball attacks to nine units (diameter nineteen).
8106 * One can project in a given "direction" by combining PROJECT_THRU with small
8107 * offsets to the initial location (see "line_spell()"), or by calculating
8108 * "virtual targets" far away from the player.
8110 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8111 * continuing until it actually hits somethings (useful for "stone to mud").
8113 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8115 * Balls must explode BEFORE hitting walls, or they would affect monsters
8116 * on both sides of a wall. Some bug reports indicate that this is still
8117 * happening in 2.7.8 for Windows, though it appears to be impossible.
8119 * We "pre-calculate" the blast area only in part for efficiency.
8120 * More importantly, this lets us do "explosions" from the "inside" out.
8121 * This results in a more logical distribution of "blast" treasure.
8122 * It also produces a better (in my opinion) animation of the explosion.
8123 * It could be (but is not) used to have the treasure dropped by monsters
8124 * in the middle of the explosion fall "outwards", and then be damaged by
8125 * the blast as it spreads outwards towards the treasure drop location.
8127 * Walls and doors are included in the blast area, so that they can be
8128 * "burned" or "melted" in later versions.
8130 * This algorithm is intended to maximize simplicity, not necessarily
8131 * efficiency, since this function is not a bottleneck in the code.
8133 * We apply the blast effect from ground zero outwards, in several passes,
8134 * first affecting features, then objects, then monsters, then the player.
8135 * This allows walls to be removed before checking the object or monster
8136 * in the wall, and protects objects which are dropped by monsters killed
8137 * in the blast, and allows the player to see all affects before he is
8138 * killed or teleported away. The semantics of this method are open to
8139 * various interpretations, but they seem to work well in practice.
8141 * We process the blast area from ground-zero outwards to allow for better
8142 * distribution of treasure dropped by monsters, and because it provides a
8143 * pleasing visual effect at low cost.
8145 * Note that the damage done by "ball" explosions decreases with distance.
8146 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8148 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8149 * the target, and then the damage "flows" along this beam of destruction.
8150 * The damage at every grid is the same as at the "center" of a "ball"
8151 * explosion, since the "beam" grids are treated as if they ARE at the
8152 * center of a "ball" explosion.
8154 * Currently, specifying "beam" plus "ball" means that locations which are
8155 * covered by the initial "beam", and also covered by the final "ball", except
8156 * for the final grid (the epicenter of the ball), will be "hit twice", once
8157 * by the initial beam, and once by the exploding ball. For the grid right
8158 * next to the epicenter, this results in 150% damage being done. The center
8159 * does not have this problem, for the same reason the final grid in a "beam"
8160 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8161 * grids which are covered by the "ball" will NOT work, as then they will
8162 * receive LESS damage than they should. Do not combine "beam" with "ball".
8164 * The array "gy[],gx[]" with current size "grids" is used to hold the
8165 * collected locations of all grids in the "blast area" plus "beam path".
8167 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8168 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8169 * first blast grid (see above) with radius "N" from the blast center. Note
8170 * that only the first gm[1] grids in the blast area thus take full damage.
8171 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8172 * number of blast grids.
8174 * Note that once the projection is complete, (y2,x2) holds the final location
8175 * of bolts/beams, and the "epicenter" of balls.
8177 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8178 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8179 * implementation of the "distance" function. Also, a bolt can be properly
8180 * viewed as a "ball" with a "rad" of "zero".
8182 * Note that if no "target" is reached before the beam/bolt/ball travels the
8183 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8184 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8186 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8187 * to move from point A to point B, even if the player cannot see part of the
8188 * projection path. Note that in general, the player will *always* see part
8189 * of the path, since it either starts at the player or ends on the player.
8191 * Hack -- we assume that every "projection" is "self-illuminating".
8193 * Hack -- when only a single monster is affected, we automatically track
8194 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8196 * Note that all projections now "explode" at their final destination, even
8197 * if they were being projected at a more distant destination. This means
8198 * that "ball" spells will *always* explode.
8200 * Note that we must call "handle_stuff()" after affecting terrain features
8201 * in the blast radius, in case the "illumination" of the grid was changed,
8202 * and "update_view()" and "update_monsters()" need to be called.
8204 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8213 int y_saver, x_saver; /* For reflecting monsters */
8215 int msec = delay_factor * delay_factor * delay_factor;
8217 /* Assume the player sees nothing */
8218 bool notice = FALSE;
8220 /* Assume the player has seen nothing */
8221 bool visual = FALSE;
8223 /* Assume the player has seen no blast grids */
8226 /* Assume to be a normal ball spell */
8227 bool breath = FALSE;
8229 /* Is the player blind? */
8230 bool blind = (p_ptr->blind ? TRUE : FALSE);
8232 bool old_hide = FALSE;
8234 /* Number of grids in the "path" */
8237 /* Actual grids in the "path" */
8240 /* Number of grids in the "blast area" (including the "beam" path) */
8243 /* Coordinates of the affected grids */
8244 byte gx[1024], gy[1024];
8246 /* Encoded "radius" info (see above) */
8249 /* Actual radius encoded in gm[] */
8254 /* Attacker's name (prepared before polymorph)*/
8257 /* Initialize by null string */
8263 /* Default target of monsterspell is player */
8264 monster_target_y=py;
8265 monster_target_x=px;
8267 /* Initialize with nul string */
8270 /* Hack -- Jump to target */
8271 if (flg & (PROJECT_JUMP))
8276 /* Clear the flag */
8277 flg &= ~(PROJECT_JUMP);
8282 /* Start at player */
8289 /* Start at monster */
8292 x1 = m_list[who].fx;
8293 y1 = m_list[who].fy;
8294 monster_desc(who_name, &m_list[who], 0x288);
8307 /* Default "destination" */
8312 /* Hack -- verify stuff */
8313 if (flg & (PROJECT_THRU))
8315 if ((x1 == x2) && (y1 == y2))
8317 flg &= ~(PROJECT_THRU);
8321 /* Handle a breath attack */
8326 if (flg & PROJECT_HIDE) old_hide = TRUE;
8327 flg |= PROJECT_HIDE;
8331 /* Hack -- Assume there will be no blast (max radius 32) */
8332 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8340 /* Collect beam grids */
8341 if (flg & (PROJECT_BEAM))
8348 if (breath && typ == GF_DISINTEGRATE)
8350 flg |= (PROJECT_DISI);
8353 /* Calculate the projection path */
8355 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8357 /* Hack -- Handle stuff */
8360 /* Giga-Hack SEEKER & SUPER_RAY */
8362 if( typ == GF_SEEKER )
8372 for (i = 0; i < path_n; ++i)
8377 int ny = GRID_Y(path_g[i]);
8378 int nx = GRID_X(path_g[i]);
8389 /* Only do visuals if requested */
8390 if (!blind && !(flg & (PROJECT_HIDE)))
8392 /* Only do visuals if the player can "see" the bolt */
8393 if (panel_contains(y, x) && player_has_los_bold(y, x))
8400 /* Obtain the bolt pict */
8401 p = bolt_pict(oy, ox, y, x, typ);
8403 /* Extract attr/char */
8407 /* Visual effects */
8408 print_rel(c, a, y, x);
8409 move_cursor_relative(y, x);
8410 /*if (fresh_before)*/ Term_fresh();
8411 Term_xtra(TERM_XTRA_DELAY, msec);
8413 /*if (fresh_before)*/ Term_fresh();
8415 /* Display "beam" grids */
8416 if (flg & (PROJECT_BEAM))
8418 /* Obtain the explosion pict */
8419 p = bolt_pict(y, x, y, x, typ);
8421 /* Extract attr/char */
8425 /* Visual effects */
8426 print_rel(c, a, y, x);
8429 /* Hack -- Activate delay */
8433 /* Hack -- delay anyway for consistency */
8436 /* Delay for consistency */
8437 Term_xtra(TERM_XTRA_DELAY, msec);
8440 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8441 if( is_mirror_grid(&cave[y][x]))
8443 /* The target of monsterspell becomes tha mirror(broken) */
8444 monster_target_y=(s16b)y;
8445 monster_target_x=(s16b)x;
8448 next_mirror( &oy,&ox,y,x );
8450 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8451 for( j = last_i; j <=i ; j++ )
8453 y = GRID_Y(path_g[j]);
8454 x = GRID_X(path_g[j]);
8455 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8456 if(!who && (project_m_n==1) && !jump ){
8457 if(cave[project_m_y][project_m_x].m_idx >0 ){
8458 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8460 /* Hack -- auto-recall */
8461 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8463 /* Hack - auto-track */
8464 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8467 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8472 for( i = last_i ; i < path_n ; i++ )
8475 y = GRID_Y(path_g[i]);
8476 x = GRID_X(path_g[i]);
8477 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8479 if(!who && (project_m_n==1) && !jump ){
8480 if(cave[project_m_y][project_m_x].m_idx >0 ){
8481 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8483 /* Hack -- auto-recall */
8484 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8486 /* Hack - auto-track */
8487 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8490 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8494 else if(typ == GF_SUPER_RAY){
8496 int second_step = 0;
8503 for (i = 0; i < path_n; ++i)
8508 int ny = GRID_Y(path_g[i]);
8509 int nx = GRID_X(path_g[i]);
8520 /* Only do visuals if requested */
8521 if (!blind && !(flg & (PROJECT_HIDE)))
8523 /* Only do visuals if the player can "see" the bolt */
8524 if (panel_contains(y, x) && player_has_los_bold(y, x))
8531 /* Obtain the bolt pict */
8532 p = bolt_pict(oy, ox, y, x, typ);
8534 /* Extract attr/char */
8538 /* Visual effects */
8539 print_rel(c, a, y, x);
8540 move_cursor_relative(y, x);
8541 /*if (fresh_before)*/ Term_fresh();
8542 Term_xtra(TERM_XTRA_DELAY, msec);
8544 /*if (fresh_before)*/ Term_fresh();
8546 /* Display "beam" grids */
8547 if (flg & (PROJECT_BEAM))
8549 /* Obtain the explosion pict */
8550 p = bolt_pict(y, x, y, x, typ);
8552 /* Extract attr/char */
8556 /* Visual effects */
8557 print_rel(c, a, y, x);
8560 /* Hack -- Activate delay */
8564 /* Hack -- delay anyway for consistency */
8567 /* Delay for consistency */
8568 Term_xtra(TERM_XTRA_DELAY, msec);
8571 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8572 if( cave[y][x].feat == FEAT_RUBBLE ||
8573 cave[y][x].feat == FEAT_DOOR_HEAD ||
8574 cave[y][x].feat == FEAT_DOOR_TAIL ||
8575 (cave[y][x].feat >= FEAT_WALL_EXTRA &&
8576 cave[y][x].feat <= FEAT_PERM_SOLID ))
8578 if( second_step )continue;
8581 if( is_mirror_grid(&cave[y][x]) && !second_step )
8583 /* The target of monsterspell becomes tha mirror(broken) */
8584 monster_target_y=(s16b)y;
8585 monster_target_x=(s16b)x;
8588 for( j = 0; j <=i ; j++ )
8590 y = GRID_Y(path_g[j]);
8591 x = GRID_X(path_g[j]);
8592 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8596 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8597 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8598 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8599 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8600 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8601 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8602 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8603 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8606 for( i = 0; i < path_n ; i++ )
8609 y = GRID_Y(path_g[i]);
8610 x = GRID_X(path_g[i]);
8611 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8612 if(!who && (project_m_n==1) && !jump ){
8613 if(cave[project_m_y][project_m_x].m_idx >0 ){
8614 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8616 /* Hack -- auto-recall */
8617 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8619 /* Hack - auto-track */
8620 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8623 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8628 /* Project along the path */
8629 for (i = 0; i < path_n; ++i)
8634 int ny = GRID_Y(path_g[i]);
8635 int nx = GRID_X(path_g[i]);
8637 if (flg & PROJECT_DISI)
8639 /* Hack -- Balls explode before reaching walls */
8640 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8644 /* Hack -- Balls explode before reaching walls */
8645 if (!cave_floor_bold(ny, nx) && (rad > 0)) break;
8652 /* Collect beam grids */
8653 if (flg & (PROJECT_BEAM))
8660 /* Only do visuals if requested */
8661 if (!blind && !(flg & (PROJECT_HIDE)) && !(flg & PROJECT_FAST))
8663 /* Only do visuals if the player can "see" the bolt */
8664 if (panel_contains(y, x) && player_has_los_bold(y, x))
8671 /* Obtain the bolt pict */
8672 p = bolt_pict(oy, ox, y, x, typ);
8674 /* Extract attr/char */
8678 /* Visual effects */
8679 print_rel(c, a, y, x);
8680 move_cursor_relative(y, x);
8681 /*if (fresh_before)*/ Term_fresh();
8682 Term_xtra(TERM_XTRA_DELAY, msec);
8684 /*if (fresh_before)*/ Term_fresh();
8686 /* Display "beam" grids */
8687 if (flg & (PROJECT_BEAM))
8689 /* Obtain the explosion pict */
8690 p = bolt_pict(y, x, y, x, typ);
8692 /* Extract attr/char */
8696 /* Visual effects */
8697 print_rel(c, a, y, x);
8700 /* Hack -- Activate delay */
8704 /* Hack -- delay anyway for consistency */
8707 /* Delay for consistency */
8708 Term_xtra(TERM_XTRA_DELAY, msec);
8711 if ((typ == GF_ATTACK) && (dam == HISSATSU_NYUSIN) && ((i+1) == path_n))
8713 if (cave_empty_bold(y, x)) teleport_player_to(ny, nx, FALSE);
8718 /* Save the "blast epicenter" */
8722 if (breath && (y1 == y2) && (x1 == x2))
8728 flg &= ~(PROJECT_HIDE);
8732 /* Start the "explosion" */
8735 /* Hack -- make sure beams get to "explode" */
8743 /* If we found a "target", explode there */
8744 if (dist <= MAX_RANGE)
8746 /* Mega-Hack -- remove the final "beam" grid */
8747 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8750 * Create a conical breath attack
8761 flg &= ~(PROJECT_HIDE);
8763 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, y2, x2, (bool)(typ == GF_DISINTEGRATE), TRUE);
8767 /* Determine the blast area, work from the inside out */
8768 for (dist = 0; dist <= rad; dist++)
8770 /* Scan the maximal blast area of radius "dist" */
8771 for (y = y2 - dist; y <= y2 + dist; y++)
8773 for (x = x2 - dist; x <= x2 + dist; x++)
8775 /* Ignore "illegal" locations */
8776 if (!in_bounds2(y, x)) continue;
8778 /* Enforce a "circular" explosion */
8779 if (distance(y2, x2, y, x) != dist) continue;
8781 if (typ == GF_DISINTEGRATE)
8783 /* Disintegration are stopped only by perma-walls */
8784 if (!do_disintegration(y2, x2, y, x)) continue;
8788 /* Ball explosions are stopped by walls */
8789 if (!los(y2, x2, y, x)) continue;
8792 /* Save this grid */
8799 /* Encode some more "radius" info */
8805 /* Speed -- ignore "non-explosions" */
8806 if (!grids) return (FALSE);
8809 /* Display the "blast area" if requested */
8810 if (!blind && !(flg & (PROJECT_HIDE)))
8812 /* Then do the "blast", from inside out */
8813 for (t = 0; t <= gm_rad; t++)
8815 /* Dump everything with this radius */
8816 for (i = gm[t]; i < gm[t+1]; i++)
8818 /* Extract the location */
8822 /* Only do visuals if the player can "see" the blast */
8823 if (panel_contains(y, x) && player_has_los_bold(y, x))
8832 /* Obtain the explosion pict */
8833 p = bolt_pict(y, x, y, x, typ);
8835 /* Extract attr/char */
8839 /* Visual effects -- Display */
8840 print_rel(c, a, y, x);
8844 /* Hack -- center the cursor */
8845 move_cursor_relative(y2, x2);
8847 /* Flush each "radius" seperately */
8848 /*if (fresh_before)*/ Term_fresh();
8850 /* Delay (efficiently) */
8851 if (visual || drawn)
8853 Term_xtra(TERM_XTRA_DELAY, msec);
8857 /* Flush the erasing */
8860 /* Erase the explosion drawn above */
8861 for (i = 0; i < grids; i++)
8863 /* Extract the location */
8867 /* Hack -- Erase if needed */
8868 if (panel_contains(y, x) && player_has_los_bold(y, x))
8874 /* Hack -- center the cursor */
8875 move_cursor_relative(y2, x2);
8877 /* Flush the explosion */
8878 /*if (fresh_before)*/ Term_fresh();
8883 /* Update stuff if needed */
8884 if (p_ptr->update) update_stuff();
8887 /* Check features */
8888 if (flg & (PROJECT_GRID))
8890 /* Start with "dist" of zero */
8893 /* Scan for features */
8894 for (i = 0; i < grids; i++)
8896 /* Hack -- Notice new "dist" values */
8897 if (gm[dist+1] == i) dist++;
8899 /* Get the grid location */
8903 /* Find the closest point in the blast */
8906 int d = dist_to_line(y, x, y1, x1, y2, x2);
8908 /* Affect the grid */
8909 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8913 /* Affect the grid */
8914 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8921 if (flg & (PROJECT_ITEM))
8923 /* Start with "dist" of zero */
8926 /* Scan for objects */
8927 for (i = 0; i < grids; i++)
8929 /* Hack -- Notice new "dist" values */
8930 if (gm[dist+1] == i) dist++;
8932 /* Get the grid location */
8936 /* Find the closest point in the blast */
8939 int d = dist_to_line(y, x, y1, x1, y2, x2);
8941 /* Affect the object in the grid */
8942 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8946 /* Affect the object in the grid */
8947 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8953 /* Check monsters */
8954 if (flg & (PROJECT_KILL))
8961 /* Start with "dist" of zero */
8964 /* Scan for monsters */
8965 for (i = 0; i < grids; i++)
8967 /* Hack -- Notice new "dist" values */
8968 if (gm[dist + 1] == i) dist++;
8970 /* Get the grid location */
8976 /* Find the closest point in the blast */
8979 int d = dist_to_line(y, x, y1, x1, y2, x2);
8981 /* Affect the monster in the grid */
8982 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
8984 if (project_m(who, d+1, y, x, dam, typ,flg)) notice = TRUE;
8986 else if (project_m(who, d, y, x, dam, typ,flg)) notice = TRUE;
8990 /* Affect the monster in the grid */
8991 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
8993 if (!(flg & PROJECT_BEAM))
8995 if (project_m(who, dist+1, y, x, dam, typ,flg)) notice = TRUE;
8998 else if (project_m(who, dist, y, x, dam, typ,flg)) notice = TRUE;
9003 monster_race *ref_ptr = &r_info[m_list[cave[y][x].m_idx].r_idx];
9005 if ((ref_ptr->flags2 & RF2_REFLECTING) && (!one_in_(10) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1)))
9008 int max_attempts = 10;
9010 /* Choose 'new' target */
9013 t_y = y_saver - 1 + randint1(3);
9014 t_x = x_saver - 1 + randint1(3);
9018 while (max_attempts && in_bounds2u(t_y, t_x) &&
9019 !(los(y, x, t_y, t_x)));
9021 if (max_attempts < 1)
9027 if (m_list[cave[y][x].m_idx].ml)
9030 if ((m_list[cave[y][x].m_idx].r_idx == MON_KENSHIROU)
9031 || (m_list[cave[y][x].m_idx].r_idx == MON_RAOU))
9032 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9033 if (m_list[cave[y][x].m_idx].r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9034 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9036 msg_print("The attack bounces!");
9039 ref_ptr->r_flags2 |= RF2_REFLECTING;
9041 flg &= ~(PROJECT_MONSTER | PROJECT_PLAYER);
9042 if (one_in_(2)) flg |= PROJECT_MONSTER;
9043 else flg |= PROJECT_PLAYER;
9045 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9049 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_PLAYER))
9052 else if (project_m(who, dist, y, x, dam, typ,flg)) notice = TRUE;
9057 /* Player affected one monster (without "jumping") */
9058 if (!who && (project_m_n == 1) && !jump)
9064 /* Track if possible */
9065 if (cave[y][x].m_idx > 0)
9067 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9069 /* Hack -- auto-recall */
9070 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9072 /* Hack - auto-track */
9073 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9080 if (flg & (PROJECT_KILL))
9082 /* Start with "dist" of zero */
9085 /* Scan for player */
9086 for (i = 0; i < grids; i++)
9088 /* Hack -- Notice new "dist" values */
9089 if (gm[dist+1] == i) dist++;
9091 /* Get the grid location */
9095 /* Find the closest point in the blast */
9098 int d = dist_to_line(y, x, y1, x1, y2, x2);
9100 /* Affect the player */
9101 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_MONSTER))
9103 if (project_p(who, who_name, d+1, y, x, dam, typ, flg, monspell)) notice = TRUE;
9105 else if (project_p(who, who_name, d, y, x, dam, typ, flg, monspell)) notice = TRUE;
9109 /* Affect the player */
9110 if ((y == y2) && (x == x2) && (y == py) && (x == px) && (flg & PROJECT_MONSTER))
9112 if (!((flg & PROJECT_BEAM) || (flg & PROJECT_STOP)))
9114 if (project_p(who, who_name, dist+1, y, x, dam, typ, flg, monspell)) notice = TRUE;
9117 else if (project_p(who, who_name, dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9126 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9128 if (rakubadam_m > 0)
9130 if (rakuba(rakubadam_m, FALSE))
9133 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9135 msg_format("%^s has thrown you off!", m_name);
9139 if (p_ptr->riding && rakubadam_p > 0)
9141 if(rakuba(rakubadam_p, FALSE))
9144 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9146 msg_format("You have fallen from %s.", m_name);
9152 /* Return "something was noticed" */
9156 bool binding_field( int dam )
9158 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9159 int mirror_num=0; /* ¶À¤Î¿ô */
9164 int msec= delay_factor*delay_factor*delay_factor;
9170 /* Default target of monsterspell is player */
9171 monster_target_y=py;
9172 monster_target_x=px;
9174 for( x=0 ; x < cur_wid ; x++ )
9176 for( y=0 ; y < cur_hgt ; y++ )
9178 if( is_mirror_grid(&cave[y][x]) &&
9179 distance(py,px,y,x) <= MAX_RANGE &&
9180 distance(py,px,y,x) != 0 &&
9181 player_has_los_bold(y,x)
9183 mirror_y[mirror_num]=y;
9184 mirror_x[mirror_num]=x;
9190 if( mirror_num < 2 )return FALSE;
9192 point_x[0] = randint0( mirror_num );
9194 point_x[1] = randint0( mirror_num );
9196 while( point_x[0] == point_x[1] );
9198 point_y[0]=mirror_y[point_x[0]];
9199 point_x[0]=mirror_x[point_x[0]];
9200 point_y[1]=mirror_y[point_x[1]];
9201 point_x[1]=mirror_x[point_x[1]];
9205 x=point_x[0]+point_x[1]+point_x[2];
9206 y=point_y[0]+point_y[1]+point_y[2];
9208 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9209 - (point_y[0]*3-y)*(point_x[1]*3-x);
9210 if( centersign == 0 )return FALSE;
9212 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9213 x1 = x1 < point_x[2] ? x1 : point_x[2];
9214 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9215 y1 = y1 < point_y[2] ? y1 : point_y[2];
9217 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9218 x2 = x2 > point_x[2] ? x2 : point_x[2];
9219 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9220 y2 = y2 > point_y[2] ? y2 : point_y[2];
9222 for( y=y1 ; y <=y2 ; y++ ){
9223 for( x=x1 ; x <=x2 ; x++ ){
9224 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9225 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9226 centersign*( (point_x[1]-x)*(point_y[2]-y)
9227 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9228 centersign*( (point_x[2]-x)*(point_y[0]-y)
9229 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9231 if( player_has_los_bold(y,x)){
9232 /* Visual effects */
9234 && panel_contains(y,x)){
9235 p = bolt_pict(y,x,y,x, GF_MANA );
9236 print_rel(PICT_C(p), PICT_A(p),y,x);
9237 move_cursor_relative(y, x);
9238 /*if (fresh_before)*/ Term_fresh();
9239 Term_xtra(TERM_XTRA_DELAY, msec);
9245 for( y=y1 ; y <=y2 ; y++ ){
9246 for( x=x1 ; x <=x2 ; x++ ){
9247 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9248 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9249 centersign*( (point_x[1]-x)*(point_y[2]-y)
9250 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9251 centersign*( (point_x[2]-x)*(point_y[0]-y)
9252 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9254 if( player_has_los_bold(y,x)){
9255 (void)project_f(0,0,y,x,dam,GF_MANA);
9260 for( y=y1 ; y <=y2 ; y++ ){
9261 for( x=x1 ; x <=x2 ; x++ ){
9262 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9263 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9264 centersign*( (point_x[1]-x)*(point_y[2]-y)
9265 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9266 centersign*( (point_x[2]-x)*(point_y[0]-y)
9267 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9269 if( player_has_los_bold(y,x)){
9270 (void)project_o(0,0,y,x,dam,GF_MANA);
9275 for( y=y1 ; y <=y2 ; y++ ){
9276 for( x=x1 ; x <=x2 ; x++ ){
9277 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9278 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9279 centersign*( (point_x[1]-x)*(point_y[2]-y)
9280 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9281 centersign*( (point_x[2]-x)*(point_y[0]-y)
9282 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9284 if( player_has_los_bold(y,x) ){
9285 (void)project_m(0,0,y,x,dam,GF_MANA,
9286 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9293 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9295 msg_print("The field broke a mirror");
9297 remove_mirror(point_y[0],point_x[0]);
9303 void seal_of_mirror( int dam )
9307 for( x = 0 ; x < cur_wid ; x++ )
9309 for( y = 0 ; y < cur_hgt ; y++ )
9311 if( is_mirror_grid(&cave[y][x]))
9313 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9314 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9316 if( !cave[y][x].m_idx )