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 (player_bold(y, x) || 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 (player_bold(y, x) || 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 (player_bold(y, x) || 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, 0L);
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 (player_bold(y, x)) 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 (player_bold(y, x)) 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 (player_bold(y, x)) 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)
1290 /* Acquire object */
1291 object_type *o_ptr = &o_list[this_o_idx];
1293 bool is_art = FALSE;
1294 bool ignore = FALSE;
1295 bool do_kill = FALSE;
1297 cptr note_kill = NULL;
1300 /* Get the "plural"-ness */
1301 bool plural = (o_ptr->number > 1);
1304 /* Acquire next object */
1305 next_o_idx = o_ptr->next_o_idx;
1307 /* Extract the flags */
1308 object_flags(o_ptr, flgs);
1310 /* Check for artifact */
1311 if ((artifact_p(o_ptr) || o_ptr->art_name)) is_art = TRUE;
1313 /* Analyze the type */
1316 /* Acid -- Lots of things */
1319 if (hates_acid(o_ptr))
1323 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1325 note_kill = (plural ? " melt!" : " melts!");
1328 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1333 /* Elec -- Rings and Wands */
1336 if (hates_elec(o_ptr))
1340 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1342 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1345 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1350 /* Fire -- Flammable objects */
1353 if (hates_fire(o_ptr))
1357 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1359 note_kill = (plural ? " burn up!" : " burns up!");
1362 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1367 /* Cold -- potions and flasks */
1370 if (hates_cold(o_ptr))
1373 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1375 note_kill = (plural ? " shatter!" : " shatters!");
1379 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1387 if (hates_fire(o_ptr))
1391 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1393 note_kill = (plural ? " burn up!" : " burns up!");
1396 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1398 if (hates_elec(o_ptr))
1403 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1405 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1408 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1416 if (hates_fire(o_ptr))
1420 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1422 note_kill = (plural ? " burn up!" : " burns up!");
1425 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1427 if (hates_cold(o_ptr))
1432 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1434 note_kill = (plural ? " shatter!" : " shatters!");
1437 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1442 /* Hack -- break potions and such */
1448 if (hates_cold(o_ptr))
1451 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1453 note_kill = (plural ? " shatter!" : " shatters!");
1461 /* Mana and Chaos -- destroy everything */
1468 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1470 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1476 case GF_DISINTEGRATE:
1480 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1482 note_kill = (plural ? " evaporate!" : " evaporates!");
1492 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1494 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1497 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1498 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1502 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1506 if (cursed_p(o_ptr))
1510 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1512 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1521 identify_item(o_ptr);
1529 /* Chests are noticed only if trapped or locked */
1530 if (o_ptr->tval == TV_CHEST)
1532 /* Disarm/Unlock traps */
1533 if (o_ptr->pval > 0)
1535 /* Disarm or Unlock */
1536 o_ptr->pval = (0 - o_ptr->pval);
1539 object_known(o_ptr);
1542 if (known && o_ptr->marked)
1545 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1547 msg_print("Click!");
1559 if (o_ptr->tval == TV_CORPSE)
1564 if (!who || is_pet(&m_list[who]))
1565 mode |= PM_FORCE_PET;
1567 for (i = 0; i < o_ptr->number ; i++)
1569 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1570 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1575 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1577 note_kill = (plural ? " become dust." : " becomes dust.");
1582 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1585 note_kill = "À¸¤Ê֤ä¿¡£";
1587 note_kill = "rivived.";
1590 else if (!note_kill)
1593 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1595 note_kill = (plural ? " become dust." : " becomes dust.");
1607 /* Attempt to destroy the object */
1610 /* Effect "observed" */
1611 if (known && o_ptr->marked)
1614 object_desc(o_name, o_ptr, FALSE, 0);
1617 /* Artifacts, and other objects, get to resist */
1618 if (is_art || ignore)
1620 /* Observe the resist */
1621 if (known && o_ptr->marked)
1624 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1627 msg_format("The %s %s unaffected!",
1628 o_name, (plural ? "are" : "is"));
1637 /* Describe if needed */
1638 if (known && o_ptr->marked && note_kill)
1641 msg_format("%s¤Ï%s", o_name, note_kill);
1643 msg_format("The %s%s", o_name, note_kill);
1648 k_idx = o_ptr->k_idx;
1649 is_potion = object_is_potion(o_ptr);
1652 /* Delete the object */
1653 delete_object_idx(this_o_idx);
1655 /* Potions produce effects when 'shattered' */
1658 (void)potion_smash_effect(who, y, x, k_idx);
1667 /* Return "Anything seen?" */
1673 * Helper function for "project()" below.
1675 * Handle a beam/bolt/ball causing damage to a monster.
1677 * This routine takes a "source monster" (by index) which is mostly used to
1678 * determine if the player is causing the damage, and a "radius" (see below),
1679 * which is used to decrease the power of explosions with distance, and a
1680 * location, via integers which are modified by certain types of attacks
1681 * (polymorph and teleport being the obvious ones), a default damage, which
1682 * is modified as needed based on various properties, and finally a "damage
1683 * type" (see below).
1685 * Note that this routine can handle "no damage" attacks (like teleport) by
1686 * taking a "zero" damage, and can even take "parameters" to attacks (like
1687 * confuse) by accepting a "damage", using it to calculate the effect, and
1688 * then setting the damage to zero. Note that the "damage" parameter is
1689 * divided by the radius, so monsters not at the "epicenter" will not take
1690 * as much damage (or whatever)...
1692 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1693 * may result in a dereference of an invalid pointer. XXX XXX XXX
1695 * Various messages are produced, and damage is applied.
1697 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1698 * actually be "made" of that substance, or "breathe" big balls of it.
1700 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1703 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1704 * and hurts evil less. If can breath nether, then it resists it as well.
1706 * Damage reductions use the following formulas:
1707 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1708 * gives avg damage of .655, ranging from .858 to .500
1709 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1710 * gives avg damage of .544, ranging from .714 to .417
1711 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1712 * gives avg damage of .444, ranging from .556 to .333
1713 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1714 * gives avg damage of .327, ranging from .427 to .250
1715 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1716 * gives something simple.
1718 * In this function, "result" messages are postponed until the end, where
1719 * the "note" string is appended to the monster name, if not NULL. So,
1720 * to make a spell have "no effect" just set "note" to NULL. You should
1721 * also set "notice" to FALSE, or the player will learn what the spell does.
1723 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1725 /* "flg" was added. */
1726 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1730 cave_type *c_ptr = &cave[y][x];
1732 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1734 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1738 /* Is the monster "seen"? */
1739 bool seen = m_ptr->ml;
1741 bool slept = (bool)(m_ptr->csleep > 0);
1743 /* Were the effects "obvious" (if seen)? */
1744 bool obvious = FALSE;
1746 /* Can the player know about this effect? */
1747 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1749 /* Can the player see the source of this effect? */
1750 bool see_s = ((who <= 0) || m_list[who].ml);
1752 /* Were the effects "irrelevant"? */
1753 bool skipped = FALSE;
1755 /* Gets the monster angry at the source of the effect? */
1756 bool get_angry = FALSE;
1758 /* Polymorph setting (true or false) */
1759 bool do_poly = FALSE;
1761 /* Teleport setting (max distance) */
1764 /* Confusion setting (amount to confuse) */
1767 /* Stunning setting (amount to stun) */
1770 /* Sleep amount (amount to sleep) */
1773 /* Fear amount (amount to fear) */
1776 /* Time amount (amount to time) */
1779 bool heal_leper = FALSE;
1781 /* Hold the monster name */
1790 /* Assume no note */
1793 /* Assume a default death */
1794 cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
1799 int caster_lev = (who > 0) ? (r_info[m_list[who].r_idx].level / 2) : p_ptr->lev;
1802 if (!c_ptr->m_idx) return (FALSE);
1804 /* Never affect projector */
1805 if (who && (c_ptr->m_idx == who)) return (FALSE);
1806 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1807 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1809 /* Don't affect already death monsters */
1810 /* Prevents problems with chain reactions of exploding monsters */
1811 if (m_ptr->hp < 0) return (FALSE);
1813 /* Reduce damage by distance */
1814 dam = (dam + r) / (r + 1);
1817 /* Get the monster name (BEFORE polymorphing) */
1818 monster_desc(m_name, m_ptr, 0);
1821 /* Get the monster possessive ("his"/"her"/"its") */
1822 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1826 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1828 /* Analyze the damage type */
1831 /* Magic Missile -- pure damage */
1834 if (seen) obvious = TRUE;
1836 if (r_ptr->flagsr & RFR_RES_ALL)
1839 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1841 note = " is immune.";
1844 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1853 if (seen) obvious = TRUE;
1855 if (r_ptr->flagsr & RFR_RES_ALL)
1858 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1860 note = " is immune.";
1863 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1866 if (r_ptr->flagsr & RFR_IM_ACID)
1869 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1871 note = " resists a lot.";
1875 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1883 if (seen) obvious = TRUE;
1885 if (r_ptr->flagsr & RFR_RES_ALL)
1888 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1890 note = " is immune.";
1893 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1896 if (r_ptr->flagsr & RFR_IM_ELEC)
1899 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1901 note = " resists a lot.";
1905 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1913 if (seen) obvious = TRUE;
1915 if (r_ptr->flagsr & RFR_RES_ALL)
1918 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1920 note = " is immune.";
1923 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1926 if (r_ptr->flagsr & RFR_IM_FIRE)
1929 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1931 note = " resists a lot.";
1935 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1937 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1940 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1942 note = " is hit hard.";
1946 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1954 if (seen) obvious = TRUE;
1956 if (r_ptr->flagsr & RFR_RES_ALL)
1959 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1961 note = " is immune.";
1964 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1967 if (r_ptr->flagsr & RFR_IM_COLD)
1970 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1972 note = " resists a lot.";
1976 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1978 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1981 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1983 note = " is hit hard.";
1987 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1995 if (seen) obvious = TRUE;
1997 if (r_ptr->flagsr & RFR_RES_ALL)
2000 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2002 note = " is immune.";
2005 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2008 if (r_ptr->flagsr & RFR_IM_POIS)
2011 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
2013 note = " resists a lot.";
2017 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
2025 if (seen) obvious = TRUE;
2027 if (r_ptr->flagsr & RFR_RES_ALL)
2030 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2032 note = " is immune.";
2035 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2038 if (r_ptr->flagsr & RFR_IM_POIS)
2041 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2046 dam *= 3; dam /= randint1(6) + 6;
2047 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
2049 else if (one_in_(3)) do_poly = TRUE;
2053 /* Hellfire -- hurts Evil */
2056 if (seen) obvious = TRUE;
2058 if (r_ptr->flagsr & RFR_RES_ALL)
2061 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2063 note = " is immune.";
2066 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2069 if (r_ptr->flags3 & RF3_GOOD)
2073 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2075 note = " is hit hard.";
2078 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
2083 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2086 if (seen) obvious = TRUE;
2088 if (r_ptr->flagsr & RFR_RES_ALL)
2091 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2093 note = " is immune.";
2096 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2099 if (r_ptr->flags3 & RF3_GOOD)
2103 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2105 note = " is immune.";
2108 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
2110 else if (r_ptr->flags3 & RF3_EVIL)
2114 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2116 note = " is hit hard.";
2119 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
2124 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2129 dam *= 3; dam /= randint1(6) + 6;
2134 /* Arrow -- XXX no defense */
2137 if (seen) obvious = TRUE;
2139 if (r_ptr->flagsr & RFR_RES_ALL)
2142 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2144 note = " is immune.";
2147 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2153 /* Plasma -- XXX perhaps check ELEC or FIRE */
2156 if (seen) obvious = TRUE;
2158 if (r_ptr->flagsr & RFR_RES_ALL)
2161 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2163 note = " is immune.";
2166 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2169 if (r_ptr->flagsr & RFR_RES_PLAS)
2172 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2177 dam *= 3; dam /= randint1(6) + 6;
2178 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
2183 /* Nether -- see above */
2186 if (seen) obvious = TRUE;
2188 if (r_ptr->flagsr & RFR_RES_ALL)
2191 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2193 note = " is immune.";
2196 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2199 if (r_ptr->flagsr & RFR_RES_NETH)
2201 if (r_ptr->flags3 & RF3_UNDEAD)
2204 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2206 note = " is immune.";
2210 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2215 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2220 dam *= 3; dam /= randint1(6) + 6;
2222 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
2224 else if (r_ptr->flags3 & RF3_EVIL)
2228 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2230 note = " resists somewhat.";
2233 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2238 /* Water (acid) damage -- Water spirits/elementals are immune */
2241 if (seen) obvious = TRUE;
2243 if (r_ptr->flagsr & RFR_RES_ALL)
2246 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2248 note = " is immune.";
2251 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2254 if (r_ptr->flagsr & RFR_RES_WATE)
2256 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
2259 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2261 note = " is immune.";
2269 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2274 dam *= 3; dam /= randint1(6) + 6;
2276 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
2281 /* Chaos -- Chaos breathers resist */
2284 if (seen) obvious = TRUE;
2286 if (r_ptr->flagsr & RFR_RES_ALL)
2289 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2291 note = " is immune.";
2294 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2297 if (r_ptr->flagsr & RFR_RES_CHAO)
2300 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2305 dam *= 3; dam /= randint1(6) + 6;
2306 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
2308 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
2311 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2313 note = " resists somewhat.";
2316 dam *= 3; dam /= randint1(6) + 6;
2317 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2322 do_conf = (5 + randint1(11) + r) / (r + 1);
2327 /* Shards -- Shard breathers resist */
2330 if (seen) obvious = TRUE;
2332 if (r_ptr->flagsr & RFR_RES_ALL)
2335 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2337 note = " is immune.";
2340 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2343 if (r_ptr->flagsr & RFR_RES_SHAR)
2346 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2351 dam *= 3; dam /= randint1(6) + 6;
2352 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2357 /* Rocket: Shard resistance helps */
2360 if (seen) obvious = TRUE;
2362 if (r_ptr->flagsr & RFR_RES_ALL)
2365 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2367 note = " is immune.";
2370 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2373 if (r_ptr->flagsr & RFR_RES_SHAR)
2376 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2378 note = " resists somewhat.";
2382 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2388 /* Sound -- Sound breathers resist */
2391 if (seen) obvious = TRUE;
2393 if (r_ptr->flagsr & RFR_RES_ALL)
2396 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2398 note = " is immune.";
2401 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2404 if (r_ptr->flagsr & RFR_RES_SOUN)
2407 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2412 dam *= 2; dam /= randint1(6) + 6;
2413 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
2415 else do_stun = (10 + randint1(15) + r) / (r + 1);
2422 if (seen) obvious = TRUE;
2424 if (r_ptr->flagsr & RFR_RES_ALL)
2427 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2429 note = " is immune.";
2432 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2435 if (r_ptr->flags3 & RF3_NO_CONF)
2438 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2443 dam *= 3; dam /= randint1(6) + 6;
2444 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2446 else do_conf = (10 + randint1(15) + r) / (r + 1);
2450 /* Disenchantment -- Breathers and Disenchanters resist */
2453 if (seen) obvious = TRUE;
2455 if (r_ptr->flagsr & RFR_RES_ALL)
2458 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2460 note = " is immune.";
2463 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2466 if (r_ptr->flagsr & RFR_RES_DISE)
2469 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2474 dam *= 3; dam /= randint1(6) + 6;
2475 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
2480 /* Nexus -- Breathers and Existers resist */
2483 if (seen) obvious = TRUE;
2485 if (r_ptr->flagsr & RFR_RES_ALL)
2488 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2490 note = " is immune.";
2493 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2496 if (r_ptr->flagsr & RFR_RES_NEXU)
2499 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2504 dam *= 3; dam /= randint1(6) + 6;
2505 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
2513 if (seen) obvious = TRUE;
2515 if (r_ptr->flagsr & RFR_RES_ALL)
2518 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2520 note = " is immune.";
2523 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2526 if (r_ptr->flagsr & RFR_RES_WALL)
2529 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2534 dam *= 3; dam /= randint1(6) + 6;
2535 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
2537 else do_stun = (randint1(15) + r) / (r + 1);
2541 /* Inertia -- breathers resist */
2544 if (seen) obvious = TRUE;
2546 if (r_ptr->flagsr & RFR_RES_ALL)
2549 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2551 note = " is immune.";
2554 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2557 if (r_ptr->flagsr & RFR_RES_INER)
2560 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2565 dam *= 3; dam /= randint1(6) + 6;
2566 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
2570 /* Powerful monsters can resist */
2571 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2572 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2576 /* Normal monsters slow down */
2582 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2584 note = " starts moving slower.";
2587 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2588 if (c_ptr->m_idx == p_ptr->riding)
2589 p_ptr->update |= (PU_BONUS);
2595 /* Time -- breathers resist */
2598 if (seen) obvious = TRUE;
2600 if (r_ptr->flagsr & RFR_RES_ALL)
2603 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2605 note = " is immune.";
2608 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2611 if (r_ptr->flagsr & RFR_RES_TIME)
2614 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2619 dam *= 3; dam /= randint1(6) + 6;
2620 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
2622 else do_time = (dam + 1) / 2;
2626 /* Gravity -- breathers resist */
2629 bool resist_tele = FALSE;
2631 if (seen) obvious = TRUE;
2633 if (r_ptr->flagsr & RFR_RES_ALL)
2636 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2638 note = " is immune.";
2641 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2644 if (r_ptr->flagsr & RFR_RES_TELE)
2646 if (r_ptr->flags1 & (RF1_UNIQUE))
2648 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2650 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2652 note = " is unaffected!";
2657 else if (r_ptr->level > randint1(100))
2659 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2661 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2670 if (!resist_tele) do_dist = 10;
2672 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2674 if (r_ptr->flagsr & RFR_RES_GRAV)
2677 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2682 dam *= 3; dam /= randint1(6) + 6;
2684 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
2689 /* Powerful monsters can resist */
2690 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2691 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2695 /* Normal monsters slow down */
2701 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2703 note = " starts moving slower.";
2706 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2707 if (c_ptr->m_idx == p_ptr->riding)
2708 p_ptr->update |= (PU_BONUS);
2712 do_stun = damroll((caster_lev / 10) + 3 , (dam)) + 1;
2714 /* Attempt a saving throw */
2715 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2716 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2720 /* No obvious effect */
2722 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2724 note = " is unaffected!";
2738 if (seen) obvious = TRUE;
2740 if (r_ptr->flagsr & RFR_RES_ALL)
2743 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2745 note = " is immune.";
2748 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2756 case GF_DISINTEGRATE:
2758 if (seen) obvious = TRUE;
2760 if (r_ptr->flagsr & RFR_RES_ALL)
2763 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2765 note = " is immune.";
2768 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2771 if (r_ptr->flags3 & RF3_HURT_ROCK)
2773 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2775 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2776 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2778 note = " loses some skin!";
2779 note_dies = " evaporates!";
2789 if (seen) obvious = TRUE;
2791 /* PSI only works if the monster can see you! -- RG */
2792 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2795 if (seen) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name);
2797 if (seen) msg_format("%^s can't see you, and isn't affected!", m_name);
2803 if (r_ptr->flagsr & RFR_RES_ALL)
2806 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2808 note = " is immune.";
2811 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2814 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2818 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2820 note = " is immune!";
2822 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2825 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2826 (r_ptr->flags3 & RF3_ANIMAL) ||
2827 (r_ptr->level > randint1(3 * dam)))
2831 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2838 * Powerful demons & undead can turn a mindcrafter's
2839 * attacks back on them
2841 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2842 (r_ptr->level > p_ptr->lev / 2) &&
2847 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2849 msg_format("%^s%s corrupted mind backlashes your attack!",
2850 m_name, (seen ? "'s" : "s"));
2854 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2857 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2859 msg_print("You resist the effects!");
2865 /* Injure +/- confusion */
2866 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2867 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2870 switch (randint1(4))
2873 set_confused(p_ptr->confused + 3 + randint1(dam));
2876 set_stun(p_ptr->stun + randint1(dam));
2880 if (r_ptr->flags3 & RF3_NO_FEAR)
2882 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2884 note = " is unaffected.";
2888 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2892 if (!p_ptr->free_act)
2893 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2902 if ((dam > 0) && one_in_(4))
2904 switch (randint1(4))
2907 do_conf = 3 + randint1(dam);
2910 do_stun = 3 + randint1(dam);
2913 do_fear = 3 + randint1(dam);
2917 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2919 note = " falls asleep!";
2922 do_sleep = 3 + randint1(dam);
2928 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2930 note_dies = " collapses, a mindless husk.";
2938 if (seen) obvious = TRUE;
2940 if (r_ptr->flagsr & RFR_RES_ALL)
2943 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2945 note = " is immune.";
2948 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2951 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2955 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2957 note = " is immune!";
2961 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2962 (r_ptr->flags3 & RF3_ANIMAL) ||
2963 (r_ptr->level > randint1(3 * dam)))
2967 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2974 * Powerful demons & undead can turn a mindcrafter's
2975 * attacks back on them
2977 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2978 (r_ptr->level > p_ptr->lev / 2) &&
2983 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2985 msg_format("%^s%s corrupted mind backlashes your attack!",
2986 m_name, (seen ? "'s" : "s"));
2990 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2993 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2995 msg_print("You resist the effects!");
3001 /* Injure + mana drain */
3002 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
3004 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
3006 msg_print("Your psychic energy is drained!");
3009 p_ptr->csp -= damroll(5, dam) / 2;
3010 if (p_ptr->csp < 0) p_ptr->csp = 0;
3011 p_ptr->redraw |= PR_MANA;
3012 p_ptr->window |= (PW_SPELL);
3013 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
3020 int b = damroll(5, dam) / 4;
3022 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª", m_name);
3024 msg_format("You convert %s%s pain into psychic energy!",
3025 m_name, (seen ? "'s" : "s"));
3028 b = MIN(p_ptr->msp, p_ptr->csp + b);
3030 p_ptr->redraw |= PR_MANA;
3031 p_ptr->window |= (PW_SPELL);
3035 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
3037 note_dies = " collapses, a mindless husk.";
3043 case GF_TELEKINESIS:
3045 if (seen) obvious = TRUE;
3047 if (r_ptr->flagsr & RFR_RES_ALL)
3050 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3052 note = " is immune.";
3055 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3060 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
3065 do_stun = damroll((caster_lev / 10) + 3 , dam) + 1;
3067 /* Attempt a saving throw */
3068 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3069 (r_ptr->level > 5 + randint1(dam)))
3073 /* No obvious effect */
3079 /* Psycho-spear -- powerful magic missile */
3082 if (seen) obvious = TRUE;
3084 if (r_ptr->flagsr & RFR_RES_ALL)
3087 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3089 note = " is immune.";
3092 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3098 /* Meteor -- powerful magic missile */
3101 if (seen) obvious = TRUE;
3103 if (r_ptr->flagsr & RFR_RES_ALL)
3106 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3108 note = " is immune.";
3111 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3119 if (!is_hostile(m_ptr)) break;
3121 if (seen) obvious = TRUE;
3123 if (r_ptr->flagsr & RFR_RES_ALL)
3126 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3128 note = " is immune.";
3131 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3134 /* Attempt a saving throw */
3135 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
3136 (r_ptr->flags3 & RF3_NO_CONF) ||
3137 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3139 /* Memorize a flag */
3140 if (r_ptr->flags3 & RF3_NO_CONF)
3142 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3149 * Powerful demons & undead can turn a mindcrafter's
3150 * attacks back on them
3152 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
3153 (r_ptr->level > p_ptr->lev / 2) &&
3158 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
3160 msg_format("%^s%s corrupted mind backlashes your attack!",
3161 m_name, (seen ? "'s" : "s"));
3165 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3168 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3170 msg_print("You resist the effects!");
3176 /* Confuse, stun, terrify */
3177 switch (randint1(4))
3180 set_stun(p_ptr->stun + dam / 2);
3183 set_confused(p_ptr->confused + dam / 2);
3187 if (r_ptr->flags3 & RF3_NO_FEAR)
3189 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3191 note = " is unaffected.";
3195 set_afraid(p_ptr->afraid + dam);
3202 /* No obvious effect */
3204 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3206 note = " is unaffected!";
3214 if ((dam > 29) && (randint1(100) < dam))
3217 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3219 note = " is in your thrall!";
3226 switch (randint1(4))
3240 /* No "real" damage */
3247 /* Ice -- Cold + Cuts + Stun */
3250 if (seen) obvious = TRUE;
3252 if (r_ptr->flagsr & RFR_RES_ALL)
3255 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3257 note = " is immune.";
3260 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3263 do_stun = (randint1(15) + 1) / (r + 1);
3264 if (r_ptr->flagsr & RFR_IM_COLD)
3267 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3269 note = " resists a lot.";
3273 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
3275 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3278 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3280 note = " is hit hard.";
3284 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3293 if (seen) obvious = TRUE;
3295 if (r_ptr->flagsr & RFR_RES_ALL)
3298 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3300 note = " is immune.";
3303 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3306 if (!monster_living(r_ptr))
3310 if (is_original_ap(m_ptr))
3312 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3313 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3314 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3319 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3321 note = " is unaffected!";
3327 else do_time = (dam+7)/8;
3335 if (seen) obvious = TRUE;
3337 if (r_ptr->flagsr & RFR_RES_ALL)
3340 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3342 note = " is immune.";
3345 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3348 if (!monster_living(r_ptr))
3352 if (is_original_ap(m_ptr))
3354 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3355 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3356 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3361 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3363 note = " is immune.";
3369 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3370 (randint1(888) != 666)) ||
3371 (((r_ptr->level + randint1(20)) > randint1(caster_lev + randint1(10))) &&
3372 randint1(100) != 66))
3375 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3387 /* Polymorph monster (Use "dam" as "power") */
3390 if (seen) obvious = TRUE;
3392 if (r_ptr->flagsr & RFR_RES_ALL)
3395 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3397 note = " is immune.";
3400 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3403 /* Attempt to polymorph (see below) */
3406 /* Powerful monsters can resist */
3407 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3408 (r_ptr->flags1 & RF1_QUESTOR) ||
3409 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3412 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3414 note = " is unaffected!";
3421 /* No "real" damage */
3428 /* Clone monsters (Ignore "dam") */
3431 if (seen) obvious = TRUE;
3433 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)))
3436 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3438 note = " is unaffected!";
3444 m_ptr->hp = m_ptr->maxhp;
3446 /* Attempt to clone. */
3447 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3450 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3458 /* No "real" damage */
3465 /* Heal Monster (use "dam" as amount of healing) */
3468 if (seen) obvious = TRUE;
3473 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3475 if (m_ptr->maxhp < m_ptr->max_maxhp)
3478 msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3480 msg_format("%^s recovers %s vitality.", m_name, m_poss);
3482 m_ptr->maxhp = m_ptr->max_maxhp;
3488 if (seen) obvious = TRUE;
3493 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3498 msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3500 msg_format("%^s is no longer stunned.", m_name);
3504 if (m_ptr->confused)
3507 msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3509 msg_format("%^s is no longer confused.", m_name);
3511 m_ptr->confused = 0;
3516 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3518 msg_format("%^s recovers %s courage.", m_name, m_poss);
3524 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3527 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3529 chg_virtue(V_VITALITY, 1);
3531 if (r_ptr->flags1 & RF1_UNIQUE)
3532 chg_virtue(V_INDIVIDUALISM, 1);
3534 if (is_friendly(m_ptr))
3535 chg_virtue(V_HONOUR, 1);
3536 else if (!(r_ptr->flags3 & RF3_EVIL))
3538 if (r_ptr->flags3 & RF3_GOOD)
3539 chg_virtue(V_COMPASSION, 2);
3541 chg_virtue(V_COMPASSION, 1);
3544 if (m_ptr->r_idx == MON_LEPER)
3547 chg_virtue(V_COMPASSION, 5);
3550 if (r_ptr->flags3 & RF3_ANIMAL)
3551 chg_virtue(V_NATURE, 1);
3553 /* Redraw (later) if needed */
3554 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3555 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3559 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3561 note = " looks healthier.";
3565 /* No "real" damage */
3571 /* Speed Monster (Ignore "dam") */
3574 if (seen) obvious = TRUE;
3580 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3582 note = " starts moving faster.";
3585 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3587 if (c_ptr->m_idx == p_ptr->riding)
3588 p_ptr->update |= (PU_BONUS);
3590 if (r_ptr->flags1 & RF1_UNIQUE)
3591 chg_virtue(V_INDIVIDUALISM, 1);
3592 if (is_friendly(m_ptr))
3593 chg_virtue(V_HONOUR, 1);
3595 /* No "real" damage */
3601 /* Slow Monster (Use "dam" as "power") */
3604 if (seen) obvious = TRUE;
3606 if (r_ptr->flagsr & RFR_RES_ALL)
3609 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3611 note = " is immune.";
3614 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3617 /* Powerful monsters can resist */
3618 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3619 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3622 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3624 note = " is unaffected!";
3630 /* Normal monsters slow down */
3636 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3638 note = " starts moving slower.";
3641 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3643 if (c_ptr->m_idx == p_ptr->riding)
3644 p_ptr->update |= (PU_BONUS);
3647 /* No "real" damage */
3653 /* Sleep (Use "dam" as "power") */
3656 if (seen) obvious = TRUE;
3658 if (r_ptr->flagsr & RFR_RES_ALL)
3661 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3663 note = " is immune.";
3666 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3669 /* Attempt a saving throw */
3670 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3671 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3672 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3674 /* Memorize a flag */
3675 if (r_ptr->flags3 & RF3_NO_SLEEP)
3677 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3680 /* No obvious effect */
3682 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3684 note = " is unaffected!";
3691 /* Go to sleep (much) later */
3693 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3695 note = " falls asleep!";
3701 /* No "real" damage */
3707 /* Sleep (Use "dam" as "power") */
3708 case GF_STASIS_EVIL:
3710 if (seen) obvious = TRUE;
3712 if (r_ptr->flagsr & RFR_RES_ALL)
3715 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3717 note = " is immune.";
3720 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3723 /* Attempt a saving throw */
3724 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3725 !(r_ptr->flags3 & RF3_EVIL) ||
3726 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3729 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3731 note = " is unaffected!";
3738 /* Go to sleep (much) later */
3740 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3742 note = " is suspended!";
3748 /* No "real" damage */
3753 /* Sleep (Use "dam" as "power") */
3756 if (seen) obvious = TRUE;
3758 if (r_ptr->flagsr & RFR_RES_ALL)
3761 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3763 note = " is immune.";
3766 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3769 /* Attempt a saving throw */
3770 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3771 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3774 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3776 note = " is unaffected!";
3783 /* Go to sleep (much) later */
3785 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3787 note = " is suspended!";
3793 /* No "real" damage */
3802 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3803 vir = virtue_number(V_HARMONY);
3806 dam += p_ptr->virtues[vir-1]/10;
3809 vir = virtue_number(V_INDIVIDUALISM);
3812 dam -= p_ptr->virtues[vir-1]/20;
3815 if (seen) obvious = TRUE;
3817 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3820 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3822 note = " is immune.";
3825 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3829 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3832 /* Attempt a saving throw */
3833 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3834 (r_ptr->flags3 & RF3_NO_CONF) ||
3835 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3836 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3838 /* Memorize a flag */
3839 if (r_ptr->flags3 & RF3_NO_CONF)
3841 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3845 /* No obvious effect */
3847 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3849 note = " is unaffected!";
3854 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3856 else if (p_ptr->cursed & TRC_AGGRAVATE)
3859 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3861 note = " hates you too much!";
3864 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3869 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3871 note = " suddenly seems friendly!";
3876 chg_virtue(V_INDIVIDUALISM, -1);
3877 if (r_ptr->flags3 & RF3_ANIMAL)
3878 chg_virtue(V_NATURE, 1);
3881 /* No "real" damage */
3886 /* Control undead */
3887 case GF_CONTROL_UNDEAD:
3890 if (seen) obvious = TRUE;
3892 vir = virtue_number(V_UNLIFE);
3895 dam += p_ptr->virtues[vir-1]/10;
3898 vir = virtue_number(V_INDIVIDUALISM);
3901 dam -= p_ptr->virtues[vir-1]/20;
3904 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3907 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3909 note = " is immune.";
3912 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3916 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3919 /* Attempt a saving throw */
3920 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3921 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3922 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3923 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3925 /* No obvious effect */
3927 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3929 note = " is unaffected!";
3933 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3935 else if (p_ptr->cursed & TRC_AGGRAVATE)
3938 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3940 note = " hates you too much!";
3943 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3948 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3950 note = " is in your thrall!";
3956 /* No "real" damage */
3962 case GF_CONTROL_DEMON:
3965 if (seen) obvious = TRUE;
3967 vir = virtue_number(V_UNLIFE);
3970 dam += p_ptr->virtues[vir-1]/10;
3973 vir = virtue_number(V_INDIVIDUALISM);
3976 dam -= p_ptr->virtues[vir-1]/20;
3979 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3982 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3984 note = " is immune.";
3987 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3991 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3994 /* Attempt a saving throw */
3995 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3996 (!(r_ptr->flags3 & RF3_DEMON)) ||
3997 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3998 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4000 /* No obvious effect */
4002 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4004 note = " is unaffected!";
4008 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4010 else if (p_ptr->cursed & TRC_AGGRAVATE)
4013 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4015 note = " hates you too much!";
4018 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4023 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
4025 note = " is in your thrall!";
4031 /* No "real" damage */
4037 case GF_CONTROL_ANIMAL:
4041 if (seen) obvious = TRUE;
4043 vir = virtue_number(V_NATURE);
4046 dam += p_ptr->virtues[vir-1]/10;
4049 vir = virtue_number(V_INDIVIDUALISM);
4052 dam -= p_ptr->virtues[vir-1]/20;
4055 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4058 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4060 note = " is immune.";
4063 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4067 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4070 /* Attempt a saving throw */
4071 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4072 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
4073 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4074 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4075 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4077 /* Memorize a flag */
4078 if (r_ptr->flags3 & (RF3_NO_CONF))
4080 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4084 /* No obvious effect */
4086 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4088 note = " is unaffected!";
4092 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4094 else if (p_ptr->cursed & TRC_AGGRAVATE)
4097 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4099 note = " hates you too much!";
4102 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4107 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4109 note = " is tamed!";
4114 if (r_ptr->flags3 & RF3_ANIMAL)
4115 chg_virtue(V_NATURE, 1);
4118 /* No "real" damage */
4124 case GF_CONTROL_LIVING:
4128 vir = virtue_number(V_UNLIFE);
4129 if (seen) obvious = TRUE;
4131 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4132 vir = virtue_number(V_UNLIFE);
4135 dam -= p_ptr->virtues[vir-1]/10;
4138 vir = virtue_number(V_INDIVIDUALISM);
4141 dam -= p_ptr->virtues[vir-1]/20;
4144 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4145 if (dam < 1) dam = 1;
4147 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4149 msg_format("You stare into %s.", m_name);
4151 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4154 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4156 note = " is immune.";
4159 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4163 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4166 /* Attempt a saving throw */
4167 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4168 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4169 !monster_living(r_ptr) ||
4170 ((r_ptr->level+10) > randint1(dam)))
4173 /* No obvious effect */
4175 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4177 note = " is unaffected!";
4181 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4183 else if (p_ptr->cursed & TRC_AGGRAVATE)
4186 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4188 note = " hates you too much!";
4191 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4196 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4198 note = " is tamed!";
4203 if (r_ptr->flags3 & RF3_ANIMAL)
4204 chg_virtue(V_NATURE, 1);
4207 /* No "real" damage */
4212 /* Confusion (Use "dam" as "power") */
4215 if (seen) obvious = TRUE;
4217 if (r_ptr->flagsr & RFR_RES_ALL)
4220 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4222 note = " is immune.";
4225 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4228 /* Get confused later */
4229 do_conf = damroll(3, (dam / 2)) + 1;
4231 /* Attempt a saving throw */
4232 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4233 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4234 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4236 /* Memorize a flag */
4237 if (r_ptr->flags3 & (RF3_NO_CONF))
4239 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4245 /* No obvious effect */
4247 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4249 note = " is unaffected!";
4255 /* No "real" damage */
4262 if (seen) obvious = TRUE;
4264 if (r_ptr->flagsr & RFR_RES_ALL)
4267 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4269 note = " is immune.";
4272 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4275 do_stun = damroll((caster_lev / 10) + 3 , (dam)) + 1;
4277 /* Attempt a saving throw */
4278 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4279 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4284 /* No obvious effect */
4286 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4288 note = " is unaffected!";
4294 /* No "real" damage */
4302 /* Lite, but only hurts susceptible creatures */
4310 if (r_ptr->flagsr & RFR_RES_ALL)
4316 if (r_ptr->flags3 & (RF3_HURT_LITE))
4320 /* Obvious effect */
4323 /* Memorize the effects */
4324 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4327 /* Special effect */
4329 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4330 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4332 note = " cringes from the light!";
4333 note_dies = " shrivels away in the light!";
4338 /* Normally no damage */
4350 /* Lite -- opposite of Dark */
4353 if (seen) obvious = TRUE;
4355 if (r_ptr->flagsr & RFR_RES_ALL)
4358 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4360 note = " is immune.";
4363 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4366 if (r_ptr->flagsr & RFR_RES_LITE)
4369 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4374 dam *= 2; dam /= (randint1(6)+6);
4375 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4377 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4379 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4381 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4382 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4384 note = " cringes from the light!";
4385 note_dies = " shrivels away in the light!";
4394 /* Dark -- opposite of Lite */
4397 if (seen) obvious = TRUE;
4399 if (r_ptr->flagsr & RFR_RES_ALL)
4402 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4404 note = " is immune.";
4407 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4410 if (r_ptr->flagsr & RFR_RES_DARK)
4413 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4418 dam *= 2; dam /= (randint1(6)+6);
4419 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4428 if (r_ptr->flagsr & RFR_RES_ALL)
4433 /* Hurt by rock remover */
4434 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4441 /* Memorize the effects */
4442 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4445 /* Cute little message */
4447 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4448 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4450 note = " loses some skin!";
4451 note_dies = " dissolves!";
4456 /* Usually, ignore the effects */
4467 /* Teleport undead (Use "dam" as "power") */
4468 case GF_AWAY_UNDEAD:
4470 /* Only affect undead */
4471 if (r_ptr->flags3 & (RF3_UNDEAD))
4473 bool resists_tele = FALSE;
4475 if (r_ptr->flagsr & RFR_RES_TELE)
4477 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4479 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4481 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4483 note = " is unaffected!";
4486 resists_tele = TRUE;
4488 else if (r_ptr->level > randint1(100))
4490 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4492 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4497 resists_tele = TRUE;
4506 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4519 /* No "real" damage */
4525 /* Teleport evil (Use "dam" as "power") */
4528 /* Only affect evil */
4529 if (r_ptr->flags3 & (RF3_EVIL))
4531 bool resists_tele = FALSE;
4533 if (r_ptr->flagsr & RFR_RES_TELE)
4535 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4537 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4539 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4541 note = " is unaffected!";
4544 resists_tele = TRUE;
4546 else if (r_ptr->level > randint1(100))
4548 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4550 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4555 resists_tele = TRUE;
4564 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4577 /* No "real" damage */
4583 /* Teleport monster (Use "dam" as "power") */
4586 bool resists_tele = FALSE;
4587 if (r_ptr->flagsr & RFR_RES_TELE)
4589 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4591 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4593 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4595 note = " is unaffected!";
4598 resists_tele = TRUE;
4600 else if (r_ptr->level > randint1(100))
4602 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4604 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4609 resists_tele = TRUE;
4616 if (seen) obvious = TRUE;
4618 /* Prepare to teleport */
4622 /* No "real" damage */
4628 /* Turn undead (Use "dam" as "power") */
4629 case GF_TURN_UNDEAD:
4631 if (r_ptr->flagsr & RFR_RES_ALL)
4636 /* Only affect undead */
4637 if (r_ptr->flags3 & (RF3_UNDEAD))
4641 /* Learn about type */
4642 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4648 /* Apply some fear */
4649 do_fear = damroll(3, (dam / 2)) + 1;
4651 /* Attempt a saving throw */
4652 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4654 /* No obvious effect */
4656 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4658 note = " is unaffected!";
4673 /* No "real" damage */
4679 /* Turn evil (Use "dam" as "power") */
4682 if (r_ptr->flagsr & RFR_RES_ALL)
4687 /* Only affect evil */
4688 if (r_ptr->flags3 & (RF3_EVIL))
4692 /* Learn about type */
4693 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4699 /* Apply some fear */
4700 do_fear = damroll(3, (dam / 2)) + 1;
4702 /* Attempt a saving throw */
4703 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4705 /* No obvious effect */
4707 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4709 note = " is unaffected!";
4724 /* No "real" damage */
4730 /* Turn monster (Use "dam" as "power") */
4733 if (r_ptr->flagsr & RFR_RES_ALL)
4739 if (seen) obvious = TRUE;
4741 /* Apply some fear */
4742 do_fear = damroll(3, (dam / 2)) + 1;
4744 /* Attempt a saving throw */
4745 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4746 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4747 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4749 /* No obvious effect */
4751 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4753 note = " is unaffected!";
4760 /* No "real" damage */
4767 case GF_DISP_UNDEAD:
4769 if (r_ptr->flagsr & RFR_RES_ALL)
4775 /* Only affect undead */
4776 if (r_ptr->flags3 & (RF3_UNDEAD))
4780 /* Learn about type */
4781 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4789 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4790 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4792 note = " shudders.";
4793 note_dies = " dissolves!";
4815 if (r_ptr->flagsr & RFR_RES_ALL)
4821 /* Only affect evil */
4822 if (r_ptr->flags3 & (RF3_EVIL))
4826 /* Learn about type */
4827 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4835 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4836 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4838 note = " shudders.";
4839 note_dies = " dissolves!";
4860 if (r_ptr->flagsr & RFR_RES_ALL)
4866 /* Only affect good */
4867 if (r_ptr->flags3 & (RF3_GOOD))
4871 /* Learn about type */
4872 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4880 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4881 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4883 note = " shudders.";
4884 note_dies = " dissolves!";
4903 case GF_DISP_LIVING:
4905 if (r_ptr->flagsr & RFR_RES_ALL)
4911 /* Only affect non-undead */
4912 if (monster_living(r_ptr))
4915 if (seen) obvious = TRUE;
4919 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4920 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4922 note = " shudders.";
4923 note_dies = " dissolves!";
4944 if (r_ptr->flagsr & RFR_RES_ALL)
4950 /* Only affect demons */
4951 if (r_ptr->flags3 & (RF3_DEMON))
4955 /* Learn about type */
4956 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4964 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4965 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4967 note = " shudders.";
4968 note_dies = " dissolves!";
4986 /* Dispel monster */
4989 if (r_ptr->flagsr & RFR_RES_ALL)
4996 if (seen) obvious = TRUE;
5000 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
5001 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
5003 note = " shudders.";
5004 note_dies = " dissolves!";
5014 if (seen) obvious = TRUE;
5016 if (r_ptr->flagsr & RFR_RES_ALL)
5019 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5021 note = " is immune.";
5024 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5028 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
5032 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£",m_name);
5034 msg_format("You draw psychic energy from %s.", m_name);
5037 (void)hp_player(dam);
5042 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5044 msg_format("%s is unaffected.", m_name);
5054 if (seen) obvious = TRUE;
5057 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5059 msg_format("You gaze intently at %s.", m_name);
5062 if (r_ptr->flagsr & RFR_RES_ALL)
5065 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5067 note = " is immune.";
5070 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5074 /* Attempt a saving throw */
5075 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5076 (r_ptr->flags3 & RF3_NO_CONF) ||
5077 (r_ptr->level > randint1((caster_lev*2 - 10) < 1 ? 1 : (caster_lev*2 - 10)) + 10))
5079 /* Memorize a flag */
5080 if (r_ptr->flags3 & (RF3_NO_CONF))
5082 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5085 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5087 note = "is unaffected!";
5094 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5095 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5097 msg_format("%^s is blasted by psionic energy.", m_name);
5098 note_dies = " collapses, a mindless husk.";
5101 do_conf = randint0(8) + 8;
5107 case GF_BRAIN_SMASH:
5109 if (seen) obvious = TRUE;
5112 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5114 msg_format("You gaze intently at %s.", m_name);
5117 if (r_ptr->flagsr & RFR_RES_ALL)
5120 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5122 note = " is immune.";
5125 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5129 /* Attempt a saving throw */
5130 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5131 (r_ptr->flags3 & RF3_NO_CONF) ||
5132 (r_ptr->level > randint1((caster_lev*2 - 10) < 1 ? 1 : (caster_lev*2 - 10)) + 10))
5134 /* Memorize a flag */
5135 if (r_ptr->flags3 & (RF3_NO_CONF))
5137 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5140 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5142 note = "is unaffected!";
5149 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5150 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5152 msg_format("%^s is blasted by psionic energy.", m_name);
5153 note_dies = " collapses, a mindless husk.";
5156 do_conf = randint0(8) + 8;
5157 do_stun = randint0(8) + 8;
5158 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5159 if (c_ptr->m_idx == p_ptr->riding)
5160 p_ptr->update |= (PU_BONUS);
5168 if (seen) obvious = TRUE;
5171 msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5173 msg_format("You point at %s and curses.", m_name);
5176 if (r_ptr->flagsr & RFR_RES_ALL)
5179 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5181 note = " is immune.";
5184 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5188 /* Attempt a saving throw */
5189 if (randint0(100 + caster_lev) < (r_ptr->level + 35))
5193 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5195 note = "is unaffected!";
5205 if (seen) obvious = TRUE;
5208 msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5210 msg_format("You point at %s and curses horribly.", m_name);
5213 if (r_ptr->flagsr & RFR_RES_ALL)
5216 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5218 note = " is immune.";
5221 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5225 /* Attempt a saving throw */
5226 if (randint0(100 + caster_lev) < (r_ptr->level + 35))
5230 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5232 note = "is unaffected!";
5242 if (seen) obvious = TRUE;
5245 msg_format("%s¤ò»Øº¹¤·¡¢¶²¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª",m_name);
5247 msg_format("You point at %s, incanting terribly!", m_name);
5250 if (r_ptr->flagsr & RFR_RES_ALL)
5253 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5255 note = " is immune.";
5258 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5262 /* Attempt a saving throw */
5263 if (randint0(100 + caster_lev) < (r_ptr->level + 35))
5267 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5269 note = "is unaffected!";
5279 if (seen) obvious = TRUE;
5282 msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£",m_name);
5284 msg_format("You point at %s, screaming th word, 'DIE!'.", m_name);
5287 if (r_ptr->flagsr & RFR_RES_ALL)
5290 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5292 note = " is immune.";
5295 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5299 /* Attempt a saving throw */
5300 if (randint0(100 + caster_lev) < (r_ptr->level + 35))
5304 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5306 note = "is unaffected!";
5316 if (seen) obvious = TRUE;
5318 if (r_ptr->flagsr & RFR_RES_ALL)
5321 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5323 note = " is immune.";
5326 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5330 if (r_ptr->flags1 & RF1_UNIQUE)
5333 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5335 note = "is unaffected!";
5341 if ((caster_lev + randint1(dam)) >
5342 (r_ptr->level + randint1(200)))
5344 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5346 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5351 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5361 /* Capture monster */
5365 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5366 (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_UNIQUE_7)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR))
5369 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5371 msg_format("%^s is unaffected.", m_name);
5377 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5378 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5379 nokori_hp = m_ptr->maxhp * 3 / 10;
5381 nokori_hp = m_ptr->maxhp * 3 / 20;
5383 if (m_ptr->hp >= nokori_hp)
5386 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5388 msg_format("You need to weaken %s more.", m_name);
5392 else if (m_ptr->hp < randint0(nokori_hp))
5394 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5396 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5398 msg_format("You capture %^s!", m_name);
5400 cap_mon = m_list[c_ptr->m_idx].r_idx;
5401 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5402 cap_hp = m_list[c_ptr->m_idx].hp;
5403 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5404 if (m_list[c_ptr->m_idx].nickname)
5405 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5408 if (c_ptr->m_idx == p_ptr->riding)
5410 if (rakuba(-1, FALSE))
5413 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5415 msg_format("You have fallen from %s.", m_name);
5420 delete_monster_idx(c_ptr->m_idx);
5427 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5429 msg_format("You failed to capture %s.", m_name);
5436 /* Attack (Use "dam" as attack type) */
5439 /* Return this monster's death */
5440 return py_attack(y, x, dam);
5443 /* Sleep (Use "dam" as "power") */
5449 if (seen) obvious = TRUE;
5451 if (r_ptr->flagsr & RFR_RES_ALL)
5454 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5456 note = " is immune.";
5459 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5462 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5465 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5467 note = " is immune!";
5471 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5477 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5479 note = " is immune!";
5486 if (one_in_(5)) effect = 1;
5487 else if (one_in_(4)) effect = 2;
5488 else if (one_in_(3)) effect = 3;
5493 /* Powerful monsters can resist */
5494 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5495 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5498 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5500 note = " is unaffected!";
5506 /* Normal monsters slow down */
5512 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5514 note = " starts moving slower.";
5517 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5519 if (c_ptr->m_idx == p_ptr->riding)
5520 p_ptr->update |= (PU_BONUS);
5524 else if (effect == 2)
5526 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5528 /* Attempt a saving throw */
5529 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5530 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5535 /* No obvious effect */
5537 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5539 note = " is unaffected!";
5546 else if (effect == 3)
5548 /* Attempt a saving throw */
5549 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5550 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5551 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5553 /* Memorize a flag */
5554 if (r_ptr->flags3 & RF3_NO_SLEEP)
5556 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5559 /* No obvious effect */
5561 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5563 note = " is unaffected!";
5570 /* Go to sleep (much) later */
5572 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5574 note = " falls asleep!";
5584 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5586 note = " is immune!";
5590 /* No "real" damage */
5599 if (seen) obvious = TRUE;
5601 if (r_ptr->flagsr & RFR_RES_ALL)
5604 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5606 note = " is immune.";
5609 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5613 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (c_ptr->m_idx == p_ptr->riding)) || p_ptr->inside_arena || p_ptr->inside_quest)
5620 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG2_NOGENO))
5627 delete_monster_idx(c_ptr->m_idx);
5629 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5631 msg_format("%^s disappered!",m_name);
5635 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5637 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5641 chg_virtue(V_VITALITY, -1);
5646 p_ptr->redraw |= (PR_HP);
5649 p_ptr->window |= (PW_PLAYER);
5656 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5658 note = "is unaffected!";
5661 if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
5669 msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£",m_name);
5671 msg_format("You take a photograph of %s.",m_name);
5674 if (r_ptr->flags3 & (RF3_HURT_LITE))
5678 /* Obvious effect */
5681 /* Memorize the effects */
5682 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5685 /* Special effect */
5687 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5688 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5690 note = " cringes from the light!";
5691 note_dies = " shrivels away in the light!";
5696 /* Normally no damage */
5703 photo = m_ptr->r_idx;
5710 case GF_BLOOD_CURSE:
5712 if (seen) obvious = TRUE;
5714 if (r_ptr->flagsr & RFR_RES_ALL)
5717 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5719 note = " is immune.";
5722 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_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 & MFLAG2_NOPET) ||
5755 (p_ptr->cursed & TRC_AGGRAVATE) ||
5756 ((r_ptr->level+10) > randint1(dam)))
5759 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5764 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5766 note = " is tamed!";
5770 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5772 /* Learn about type */
5773 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5780 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5782 do_fear = randint1(90)+10;
5786 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5790 /* No "real" damage */
5797 if (seen) obvious = TRUE;
5799 if (r_ptr->flagsr & RFR_RES_ALL)
5802 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5804 note = " is immune.";
5807 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_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 resisters never stun */
5943 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5944 !(r_ptr->flags3 & RF3_NO_STUN))
5947 if (seen) obvious = TRUE;
5953 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5955 note = " is more dazed.";
5958 tmp = m_ptr->stunned + (do_stun / 2);
5963 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5965 note = " is dazed.";
5972 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5978 /* Confusion and Chaos resisters (and sleepers) never confuse */
5980 !(r_ptr->flags3 & RF3_NO_CONF) &&
5981 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
5984 if (seen) obvious = TRUE;
5986 /* Already partially confused */
5987 if (m_ptr->confused)
5990 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5992 note = " looks more confused.";
5995 tmp = m_ptr->confused + (do_conf / 2);
5998 /* Was not confused */
6002 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
6004 note = " looks confused.";
6010 /* Apply confusion */
6011 m_ptr->confused = (tmp < 200) ? tmp : 200;
6020 if (seen) obvious = TRUE;
6022 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
6027 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
6029 note = " seems weakened.";
6031 m_ptr->maxhp -= do_time;
6032 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
6042 tmp = m_ptr->monfear + do_fear;
6045 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6052 /* If another monster did the damage, hurt the monster by hand */
6055 /* Redraw (later) if needed */
6056 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6057 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6059 /* Wake the monster up */
6062 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
6064 /* Hurt the monster */
6072 if (is_pet(m_ptr) && !(m_ptr->ml))
6075 /* Give detailed messages if destroyed */
6078 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
6081 msg_format("%^s%s", m_name, note);
6089 monster_gain_exp(who, m_ptr->r_idx);
6091 /* Generate treasure, etc */
6092 monster_death(c_ptr->m_idx, FALSE);
6094 /* Delete the monster */
6095 delete_monster_idx(c_ptr->m_idx);
6100 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6102 msg_print("You feel sad for a moment.");
6108 /* Damaged monster */
6111 /* Give detailed messages if visible or destroyed */
6112 if (note && seen) msg_format("%^s%s", m_name, note);
6114 /* Hack -- Pain message */
6117 message_pain(c_ptr->m_idx, dam);
6124 /* Hack -- handle sleep */
6125 if (do_sleep) m_ptr->csleep = do_sleep;
6129 else if (heal_leper)
6132 msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6134 msg_print("The Mangy looking leper is healed!");
6137 delete_monster_idx(c_ptr->m_idx);
6139 /* If the player did it, give him experience, check fear */
6140 else if (typ != GF_DRAIN_MANA)
6144 /* Hurt the monster, check for fear and death */
6145 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6150 /* Damaged monster */
6153 /* HACK - anger the monster before showing the sleep message */
6154 if (do_sleep) anger_monster(m_ptr);
6156 /* Give detailed messages if visible or destroyed */
6159 msg_format("%s%s", m_name, note);
6161 msg_format("%^s%s", m_name, note);
6165 /* Hack -- Pain message */
6166 else if (known && (dam || !do_fear))
6168 message_pain(c_ptr->m_idx, dam);
6171 /* Anger monsters */
6172 if (((dam > 0) || get_angry) && !do_sleep)
6173 anger_monster(m_ptr);
6176 if ((fear || do_fear) && (m_ptr->ml))
6183 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6185 msg_format("%^s flees in terror!", m_name);
6190 /* Hack -- handle sleep */
6191 if (do_sleep) m_ptr->csleep = do_sleep;
6195 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6197 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6201 switch (randint1(28))
6207 msg_print("ÃÏÌ̤¬Íɤ줿...");
6209 msg_print("The ground trembles...");
6212 earthquake(ty, tx, 4 + randint0(4));
6213 if (!one_in_(6)) break;
6215 case 3: case 4: case 5: case 6:
6218 int dam = damroll(10, 10);
6220 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6222 msg_print("A portal opens to a plane of raw mana!");
6225 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6226 if (!one_in_(6)) break;
6232 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6234 msg_print("Space warps about you!");
6237 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE);
6238 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6239 if (!one_in_(6)) break;
6241 case 9: case 10: case 11:
6243 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6245 msg_print("You feel a surge of energy!");
6248 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6249 if (!one_in_(6)) break;
6250 case 12: case 13: case 14: case 15: case 16:
6251 aggravate_monsters(0);
6252 if (!one_in_(6)) break;
6254 count += activate_hi_summon(ty, tx, TRUE);
6255 if (!one_in_(6)) break;
6256 case 19: case 20: case 21: case 22:
6258 bool pet = !one_in_(3);
6259 u32b mode = PM_ALLOW_GROUP;
6261 if (pet) mode |= PM_FORCE_PET;
6262 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6264 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6265 if (!one_in_(6)) break;
6267 case 23: case 24: case 25:
6268 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6270 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6272 msg_print("You feel your life draining away...");
6275 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6276 else lose_exp(p_ptr->exp / 16);
6277 if (!one_in_(6)) break;
6278 case 26: case 27: case 28:
6287 (void)do_dec_stat(i);
6296 (void)do_dec_stat(randint0(6));
6305 if (p_ptr->inside_battle)
6307 p_ptr->health_who = c_ptr->m_idx;
6308 p_ptr->redraw |= (PR_HEALTH);
6312 /* XXX XXX XXX Verify this code */
6314 /* Update the monster */
6315 update_mon(c_ptr->m_idx, FALSE);
6317 /* Redraw the monster grid */
6321 /* Update monster recall window */
6322 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6325 p_ptr->window |= (PW_MONSTER);
6328 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6332 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6334 set_target(m_ptr, monster_target_y, monster_target_x);
6337 else if (is_pet(&m_list[who]) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6339 set_target(m_ptr, m_list[who].fy, m_list[who].fx);
6343 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6345 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6346 rakubadam_m = (dam > 200) ? 200 : dam;
6355 /* Get local object */
6358 /* Prepare to make a Blade of Chaos */
6359 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6361 q_ptr->pval = photo;
6363 /* Mark the item as fully known */
6364 q_ptr->ident |= (IDENT_MENTAL);
6366 /* Drop it in the dungeon */
6367 (void)drop_near(q_ptr, -1, py, px);
6375 /* Return "Anything seen?" */
6381 * Helper function for "project()" below.
6383 * Handle a beam/bolt/ball causing damage to the player.
6385 * This routine takes a "source monster" (by index), a "distance", a default
6386 * "damage", and a "damage type". See "project_m()" above.
6388 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6389 * is reduced (see "project_m()" above). This can happen if a monster breathes
6390 * at the player and hits a wall instead.
6392 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6393 * to know if this is actually a ball or a bolt spell
6396 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6397 * we just assume that the effects were obvious, for historical reasons.
6399 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6404 /* Hack -- assume obvious */
6405 bool obvious = TRUE;
6407 /* Player blind-ness */
6408 bool blind = (p_ptr->blind ? TRUE : FALSE);
6410 /* Player needs a "description" (he is blind) */
6413 /* Source monster */
6414 monster_type *m_ptr = NULL;
6416 /* Monster name (for attacks) */
6419 /* Monster name (for damage) */
6422 /* Hack -- messages */
6428 /* Player is not here */
6429 if (!player_bold(y, x)) return (FALSE);
6431 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6437 /* Player cannot hurt himself */
6438 if (!who) return (FALSE);
6439 if (who == p_ptr->riding) return (FALSE);
6441 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6444 int max_attempts = 10;
6447 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6448 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6449 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6451 if (blind) msg_print("Something bounces!");
6452 else msg_print("The attack bounces!");
6456 /* Choose 'new' target */
6459 t_y = m_list[who].fy - 1 + randint1(3);
6460 t_x = m_list[who].fx - 1 + randint1(3);
6463 while (max_attempts && in_bounds2u(t_y, t_x) &&
6464 !(player_has_los_bold(t_y, t_x)));
6466 if (max_attempts < 1)
6468 t_y = m_list[who].fy;
6469 t_x = m_list[who].fx;
6472 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6479 /* Limit maximum damage */
6480 if (dam > 1600) dam = 1600;
6482 /* Reduce damage by distance */
6483 dam = (dam + r) / (r + 1);
6486 /* If the player is blind, be more descriptive */
6487 if (blind) fuzzy = TRUE;
6492 /* Get the source monster */
6493 m_ptr = &m_list[who];
6494 /* Extract the monster level */
6495 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6497 /* Get the monster name */
6498 monster_desc(m_name, m_ptr, 0);
6500 /* Get the monster's real name (gotten before polymorph!) */
6501 strcpy(killer, who_name);
6506 strcpy(killer, "æ«");
6508 strcpy(killer, "a trap");
6512 /* Analyze the damage */
6515 /* Standard damage -- hurts inventory too */
6519 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6521 if (fuzzy) msg_print("You are hit by acid!");
6524 get_damage = acid_dam(dam, killer, monspell);
6528 /* Standard damage -- hurts inventory too */
6532 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6534 if (fuzzy) msg_print("You are hit by fire!");
6537 get_damage = fire_dam(dam, killer, monspell);
6541 /* Standard damage -- hurts inventory too */
6545 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6547 if (fuzzy) msg_print("You are hit by cold!");
6550 get_damage = cold_dam(dam, killer, monspell);
6554 /* Standard damage -- hurts inventory too */
6558 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6560 if (fuzzy) msg_print("You are hit by lightning!");
6563 get_damage = elec_dam(dam, killer, monspell);
6567 /* Standard damage -- also poisons player */
6570 bool double_resist = IS_OPPOSE_POIS();
6572 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6574 if (fuzzy) msg_print("You are hit by poison!");
6577 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6578 if (double_resist) dam = (dam + 2) / 3;
6580 if ((!(double_resist || p_ptr->resist_pois)) &&
6581 one_in_(HURT_CHANCE))
6586 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6588 if (!(double_resist || p_ptr->resist_pois))
6590 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6595 /* Standard damage -- also poisons / mutates player */
6598 bool double_resist = IS_OPPOSE_POIS();
6600 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6602 if (fuzzy) msg_print("You are hit by radiation!");
6605 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6606 if (double_resist) dam = (2 * dam + 2) / 5;
6607 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6608 if (!(double_resist || p_ptr->resist_pois))
6610 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6612 if (one_in_(5)) /* 6 */
6615 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6617 msg_print("You undergo a freakish metamorphosis!");
6620 if (one_in_(4)) /* 4 */
6628 inven_damage(set_acid_destroy, 2);
6634 /* Standard damage */
6638 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6640 if (fuzzy) msg_print("You are hit by something!");
6643 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6647 /* Holy Orb -- Player only takes partial damage */
6651 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6653 if (fuzzy) msg_print("You are hit by something!");
6656 if (p_ptr->align > 10)
6658 else if (p_ptr->align < -10)
6660 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6667 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6669 if (fuzzy) msg_print("You are hit by something!");
6672 if (p_ptr->align > 10)
6674 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6678 /* Arrow -- XXX no dodging */
6682 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6684 if (fuzzy) msg_print("You are hit by something sharp!");
6687 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6690 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6692 msg_print("You cut down the arrow!");
6696 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6700 /* Plasma -- XXX No resist */
6704 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6706 if (fuzzy) msg_print("You are hit by something *HOT*!");
6709 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6711 if (!p_ptr->resist_sound)
6713 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6714 (void)set_stun(p_ptr->stun + k);
6717 if (!(p_ptr->resist_fire ||
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 || IS_OPPOSE_COLD())) || 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, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
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)
8214 int y_saver, x_saver; /* For reflecting monsters */
8216 int msec = delay_factor * delay_factor * delay_factor;
8218 /* Assume the player sees nothing */
8219 bool notice = FALSE;
8221 /* Assume the player has seen nothing */
8222 bool visual = FALSE;
8224 /* Assume the player has seen no blast grids */
8227 /* Assume to be a normal ball spell */
8228 bool breath = FALSE;
8230 /* Is the player blind? */
8231 bool blind = (p_ptr->blind ? TRUE : FALSE);
8233 bool old_hide = FALSE;
8235 /* Number of grids in the "path" */
8238 /* Actual grids in the "path" */
8241 /* Number of grids in the "blast area" (including the "beam" path) */
8244 /* Coordinates of the affected grids */
8245 byte gx[1024], gy[1024];
8247 /* Encoded "radius" info (see above) */
8250 /* Actual radius encoded in gm[] */
8255 /* Attacker's name (prepared before polymorph)*/
8258 /* Initialize by null string */
8264 /* Default target of monsterspell is player */
8265 monster_target_y=py;
8266 monster_target_x=px;
8268 /* Initialize with nul string */
8271 /* Hack -- Jump to target */
8272 if (flg & (PROJECT_JUMP))
8277 /* Clear the flag */
8278 flg &= ~(PROJECT_JUMP);
8283 /* Start at player */
8290 /* Start at monster */
8293 x1 = m_list[who].fx;
8294 y1 = m_list[who].fy;
8295 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8308 /* Default "destination" */
8313 /* Hack -- verify stuff */
8314 if (flg & (PROJECT_THRU))
8316 if ((x1 == x2) && (y1 == y2))
8318 flg &= ~(PROJECT_THRU);
8322 /* Handle a breath attack */
8327 if (flg & PROJECT_HIDE) old_hide = TRUE;
8328 flg |= PROJECT_HIDE;
8332 /* Hack -- Assume there will be no blast (max radius 32) */
8333 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8341 /* Collect beam grids */
8342 if (flg & (PROJECT_BEAM))
8349 if (breath && typ == GF_DISINTEGRATE)
8351 flg |= (PROJECT_DISI);
8354 /* Calculate the projection path */
8356 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8358 /* Hack -- Handle stuff */
8361 /* Giga-Hack SEEKER & SUPER_RAY */
8363 if( typ == GF_SEEKER )
8373 for (i = 0; i < path_n; ++i)
8378 int ny = GRID_Y(path_g[i]);
8379 int nx = GRID_X(path_g[i]);
8390 /* Only do visuals if requested */
8391 if (!blind && !(flg & (PROJECT_HIDE)))
8393 /* Only do visuals if the player can "see" the bolt */
8394 if (panel_contains(y, x) && player_has_los_bold(y, x))
8401 /* Obtain the bolt pict */
8402 p = bolt_pict(oy, ox, y, x, typ);
8404 /* Extract attr/char */
8408 /* Visual effects */
8409 print_rel(c, a, y, x);
8410 move_cursor_relative(y, x);
8411 /*if (fresh_before)*/ Term_fresh();
8412 Term_xtra(TERM_XTRA_DELAY, msec);
8414 /*if (fresh_before)*/ Term_fresh();
8416 /* Display "beam" grids */
8417 if (flg & (PROJECT_BEAM))
8419 /* Obtain the explosion pict */
8420 p = bolt_pict(y, x, y, x, typ);
8422 /* Extract attr/char */
8426 /* Visual effects */
8427 print_rel(c, a, y, x);
8430 /* Hack -- Activate delay */
8434 /* Hack -- delay anyway for consistency */
8437 /* Delay for consistency */
8438 Term_xtra(TERM_XTRA_DELAY, msec);
8441 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8442 if( is_mirror_grid(&cave[y][x]))
8444 /* The target of monsterspell becomes tha mirror(broken) */
8445 monster_target_y=(s16b)y;
8446 monster_target_x=(s16b)x;
8449 next_mirror( &oy,&ox,y,x );
8451 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8452 for( j = last_i; j <=i ; j++ )
8454 y = GRID_Y(path_g[j]);
8455 x = GRID_X(path_g[j]);
8456 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8457 if(!who && (project_m_n==1) && !jump ){
8458 if(cave[project_m_y][project_m_x].m_idx >0 ){
8459 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8461 /* Hack -- auto-recall */
8462 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8464 /* Hack - auto-track */
8465 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8468 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8473 for( i = last_i ; i < path_n ; i++ )
8476 y = GRID_Y(path_g[i]);
8477 x = GRID_X(path_g[i]);
8478 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8480 if(!who && (project_m_n==1) && !jump ){
8481 if(cave[project_m_y][project_m_x].m_idx >0 ){
8482 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8484 /* Hack -- auto-recall */
8485 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8487 /* Hack - auto-track */
8488 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8491 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8495 else if(typ == GF_SUPER_RAY){
8497 int second_step = 0;
8504 for (i = 0; i < path_n; ++i)
8509 int ny = GRID_Y(path_g[i]);
8510 int nx = GRID_X(path_g[i]);
8521 /* Only do visuals if requested */
8522 if (!blind && !(flg & (PROJECT_HIDE)))
8524 /* Only do visuals if the player can "see" the bolt */
8525 if (panel_contains(y, x) && player_has_los_bold(y, x))
8532 /* Obtain the bolt pict */
8533 p = bolt_pict(oy, ox, y, x, typ);
8535 /* Extract attr/char */
8539 /* Visual effects */
8540 print_rel(c, a, y, x);
8541 move_cursor_relative(y, x);
8542 /*if (fresh_before)*/ Term_fresh();
8543 Term_xtra(TERM_XTRA_DELAY, msec);
8545 /*if (fresh_before)*/ Term_fresh();
8547 /* Display "beam" grids */
8548 if (flg & (PROJECT_BEAM))
8550 /* Obtain the explosion pict */
8551 p = bolt_pict(y, x, y, x, typ);
8553 /* Extract attr/char */
8557 /* Visual effects */
8558 print_rel(c, a, y, x);
8561 /* Hack -- Activate delay */
8565 /* Hack -- delay anyway for consistency */
8568 /* Delay for consistency */
8569 Term_xtra(TERM_XTRA_DELAY, msec);
8572 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8573 if( cave[y][x].feat == FEAT_RUBBLE ||
8574 cave[y][x].feat == FEAT_DOOR_HEAD ||
8575 cave[y][x].feat == FEAT_DOOR_TAIL ||
8576 (cave[y][x].feat >= FEAT_WALL_EXTRA &&
8577 cave[y][x].feat <= FEAT_PERM_SOLID ))
8579 if( second_step )continue;
8582 if( is_mirror_grid(&cave[y][x]) && !second_step )
8584 /* The target of monsterspell becomes tha mirror(broken) */
8585 monster_target_y=(s16b)y;
8586 monster_target_x=(s16b)x;
8589 for( j = 0; j <=i ; j++ )
8591 y = GRID_Y(path_g[j]);
8592 x = GRID_X(path_g[j]);
8593 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8597 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8598 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8599 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, 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 , x+1, flg);
8602 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8603 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8604 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8607 for( i = 0; i < path_n ; i++ )
8610 y = GRID_Y(path_g[i]);
8611 x = GRID_X(path_g[i]);
8612 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8613 if(!who && (project_m_n==1) && !jump ){
8614 if(cave[project_m_y][project_m_x].m_idx >0 ){
8615 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8617 /* Hack -- auto-recall */
8618 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8620 /* Hack - auto-track */
8621 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8624 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8629 /* Project along the path */
8630 for (i = 0; i < path_n; ++i)
8635 int ny = GRID_Y(path_g[i]);
8636 int nx = GRID_X(path_g[i]);
8638 if (flg & PROJECT_DISI)
8640 /* Hack -- Balls explode before reaching walls */
8641 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8645 /* Hack -- Balls explode before reaching walls */
8646 if (!cave_floor_bold(ny, nx) && (rad > 0)) break;
8653 /* Collect beam grids */
8654 if (flg & (PROJECT_BEAM))
8661 /* Only do visuals if requested */
8662 if (!blind && !(flg & (PROJECT_HIDE)) && !(flg & PROJECT_FAST))
8664 /* Only do visuals if the player can "see" the bolt */
8665 if (panel_contains(y, x) && player_has_los_bold(y, x))
8672 /* Obtain the bolt pict */
8673 p = bolt_pict(oy, ox, y, x, typ);
8675 /* Extract attr/char */
8679 /* Visual effects */
8680 print_rel(c, a, y, x);
8681 move_cursor_relative(y, x);
8682 /*if (fresh_before)*/ Term_fresh();
8683 Term_xtra(TERM_XTRA_DELAY, msec);
8685 /*if (fresh_before)*/ Term_fresh();
8687 /* Display "beam" grids */
8688 if (flg & (PROJECT_BEAM))
8690 /* Obtain the explosion pict */
8691 p = bolt_pict(y, x, y, x, typ);
8693 /* Extract attr/char */
8697 /* Visual effects */
8698 print_rel(c, a, y, x);
8701 /* Hack -- Activate delay */
8705 /* Hack -- delay anyway for consistency */
8708 /* Delay for consistency */
8709 Term_xtra(TERM_XTRA_DELAY, msec);
8714 /* Save the "blast epicenter" */
8718 if (breath && (y1 == by) && (x1 == bx))
8724 flg &= ~(PROJECT_HIDE);
8728 /* Start the "explosion" */
8731 /* Hack -- make sure beams get to "explode" */
8739 /* If we found a "target", explode there */
8740 if (dist <= MAX_RANGE)
8742 /* Mega-Hack -- remove the final "beam" grid */
8743 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8746 * Create a conical breath attack
8757 flg &= ~(PROJECT_HIDE);
8759 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, (bool)(typ == GF_DISINTEGRATE), TRUE);
8763 /* Determine the blast area, work from the inside out */
8764 for (dist = 0; dist <= rad; dist++)
8766 /* Scan the maximal blast area of radius "dist" */
8767 for (y = by - dist; y <= by + dist; y++)
8769 for (x = bx - dist; x <= bx + dist; x++)
8771 /* Ignore "illegal" locations */
8772 if (!in_bounds2(y, x)) continue;
8774 /* Enforce a "circular" explosion */
8775 if (distance(by, bx, y, x) != dist) continue;
8777 if (typ == GF_DISINTEGRATE)
8779 /* Disintegration are stopped only by perma-walls */
8780 if (!do_disintegration(by, bx, y, x)) continue;
8784 /* Ball explosions are stopped by walls */
8785 if (!los(by, bx, y, x)) continue;
8788 /* Save this grid */
8795 /* Encode some more "radius" info */
8801 /* Speed -- ignore "non-explosions" */
8802 if (!grids) return (FALSE);
8805 /* Display the "blast area" if requested */
8806 if (!blind && !(flg & (PROJECT_HIDE)))
8808 /* Then do the "blast", from inside out */
8809 for (t = 0; t <= gm_rad; t++)
8811 /* Dump everything with this radius */
8812 for (i = gm[t]; i < gm[t+1]; i++)
8814 /* Extract the location */
8818 /* Only do visuals if the player can "see" the blast */
8819 if (panel_contains(y, x) && player_has_los_bold(y, x))
8828 /* Obtain the explosion pict */
8829 p = bolt_pict(y, x, y, x, typ);
8831 /* Extract attr/char */
8835 /* Visual effects -- Display */
8836 print_rel(c, a, y, x);
8840 /* Hack -- center the cursor */
8841 move_cursor_relative(by, bx);
8843 /* Flush each "radius" seperately */
8844 /*if (fresh_before)*/ Term_fresh();
8846 /* Delay (efficiently) */
8847 if (visual || drawn)
8849 Term_xtra(TERM_XTRA_DELAY, msec);
8853 /* Flush the erasing */
8856 /* Erase the explosion drawn above */
8857 for (i = 0; i < grids; i++)
8859 /* Extract the location */
8863 /* Hack -- Erase if needed */
8864 if (panel_contains(y, x) && player_has_los_bold(y, x))
8870 /* Hack -- center the cursor */
8871 move_cursor_relative(by, bx);
8873 /* Flush the explosion */
8874 /*if (fresh_before)*/ Term_fresh();
8879 /* Update stuff if needed */
8880 if (p_ptr->update) update_stuff();
8883 /* Check features */
8884 if (flg & (PROJECT_GRID))
8886 /* Start with "dist" of zero */
8889 /* Scan for features */
8890 for (i = 0; i < grids; i++)
8892 /* Hack -- Notice new "dist" values */
8893 if (gm[dist+1] == i) dist++;
8895 /* Get the grid location */
8899 /* Find the closest point in the blast */
8902 int d = dist_to_line(y, x, y1, x1, by, bx);
8904 /* Affect the grid */
8905 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8909 /* Affect the grid */
8910 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8917 if (flg & (PROJECT_ITEM))
8919 /* Start with "dist" of zero */
8922 /* Scan for objects */
8923 for (i = 0; i < grids; i++)
8925 /* Hack -- Notice new "dist" values */
8926 if (gm[dist+1] == i) dist++;
8928 /* Get the grid location */
8932 /* Find the closest point in the blast */
8935 int d = dist_to_line(y, x, y1, x1, by, bx);
8937 /* Affect the object in the grid */
8938 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8942 /* Affect the object in the grid */
8943 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8949 /* Check monsters */
8950 if (flg & (PROJECT_KILL))
8957 /* Start with "dist" of zero */
8960 /* Scan for monsters */
8961 for (i = 0; i < grids; i++)
8965 /* Hack -- Notice new "dist" values */
8966 if (gm[dist + 1] == i) dist++;
8968 /* Get the grid location */
8972 /* A single bolt may be reflected */
8975 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
8976 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
8978 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
8981 int max_attempts = 10;
8983 /* Choose 'new' target */
8986 t_y = y_saver - 1 + randint1(3);
8987 t_x = x_saver - 1 + randint1(3);
8990 while (max_attempts && in_bounds2u(t_y, t_x) &&
8991 !(los(y, x, t_y, t_x)));
8993 if (max_attempts < 1)
9002 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
9003 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9004 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9005 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9007 msg_print("The attack bounces!");
9010 if (is_original_ap(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
9013 /* Reflected bolts randomly target either one */
9014 flg &= ~(PROJECT_MONSTER | PROJECT_PLAYER);
9015 if (one_in_(2)) flg |= PROJECT_MONSTER;
9016 else flg |= PROJECT_PLAYER;
9018 /* The bolt is reflected */
9019 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9021 /* Don't affect the monster any longer */
9027 /* Find the closest point in the blast */
9030 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9034 effective_dist = dist;
9038 /* There is the riding player on this monster */
9039 if (p_ptr->riding && player_bold(y, x))
9041 /* Aimed on the player */
9042 if (flg & PROJECT_PLAYER)
9044 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9047 * A beam or bolt is well aimed
9049 * So don't affects the mount.
9056 * The spell is not well aimed,
9057 * So partly affect the mount too.
9064 * This grid is the original target.
9066 else if ((y == y2) || (x == x2))
9068 /* Hit the mount with full damage */
9072 * Otherwise this grid is not the
9073 * original target, it means that line
9074 * of fire is obstructed by this
9078 * A beam or bolt will hit either
9079 * player or mount. Choose randomly.
9081 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9085 /* Hit the mount with full damage */
9089 /* Hit the player later */
9090 flg &= ~(PROJECT_MONSTER);
9091 flg |= PROJECT_PLAYER;
9093 /* Don't affect the mount */
9099 * The spell is not well aimed, so
9100 * partly affect both player and
9109 /* Affect the monster in the grid */
9110 if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
9114 /* Player affected one monster (without "jumping") */
9115 if (!who && (project_m_n == 1) && !jump)
9121 /* Track if possible */
9122 if (cave[y][x].m_idx > 0)
9124 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9126 /* Hack -- auto-recall */
9127 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9129 /* Hack - auto-track */
9130 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9137 if (flg & (PROJECT_KILL))
9139 /* Start with "dist" of zero */
9142 /* Scan for player */
9143 for (i = 0; i < grids; i++)
9147 /* Hack -- Notice new "dist" values */
9148 if (gm[dist+1] == i) dist++;
9150 /* Get the grid location */
9154 /* Affect the player? */
9155 if (!player_bold(y, x)) continue;
9157 /* Find the closest point in the blast */
9160 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9164 effective_dist = dist;
9167 /* Target may be your horse */
9170 /* Aimed on the player */
9171 if (flg & PROJECT_PLAYER)
9173 /* Hit the player with full damage */
9177 * Hack -- When this grid was not the
9178 * original target, a beam or bolt
9179 * would hit either player or mount,
9180 * and should be choosen randomly.
9182 * But already choosen to hit the
9183 * mount at this point.
9185 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9188 * A beam or bolt is well aimed
9190 * So don't affects the player.
9197 * The spell is not well aimed,
9198 * So partly affect the player too.
9204 /* Affect the player */
9205 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9213 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9215 if (rakubadam_m > 0)
9217 if (rakuba(rakubadam_m, FALSE))
9220 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9222 msg_format("%^s has thrown you off!", m_name);
9226 if (p_ptr->riding && rakubadam_p > 0)
9228 if(rakuba(rakubadam_p, FALSE))
9231 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9233 msg_format("You have fallen from %s.", m_name);
9239 /* Return "something was noticed" */
9243 bool binding_field( int dam )
9245 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9246 int mirror_num=0; /* ¶À¤Î¿ô */
9251 int msec= delay_factor*delay_factor*delay_factor;
9257 /* Default target of monsterspell is player */
9258 monster_target_y=py;
9259 monster_target_x=px;
9261 for( x=0 ; x < cur_wid ; x++ )
9263 for( y=0 ; y < cur_hgt ; y++ )
9265 if( is_mirror_grid(&cave[y][x]) &&
9266 distance(py,px,y,x) <= MAX_RANGE &&
9267 distance(py,px,y,x) != 0 &&
9268 player_has_los_bold(y,x)
9270 mirror_y[mirror_num]=y;
9271 mirror_x[mirror_num]=x;
9277 if( mirror_num < 2 )return FALSE;
9279 point_x[0] = randint0( mirror_num );
9281 point_x[1] = randint0( mirror_num );
9283 while( point_x[0] == point_x[1] );
9285 point_y[0]=mirror_y[point_x[0]];
9286 point_x[0]=mirror_x[point_x[0]];
9287 point_y[1]=mirror_y[point_x[1]];
9288 point_x[1]=mirror_x[point_x[1]];
9292 x=point_x[0]+point_x[1]+point_x[2];
9293 y=point_y[0]+point_y[1]+point_y[2];
9295 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9296 - (point_y[0]*3-y)*(point_x[1]*3-x);
9297 if( centersign == 0 )return FALSE;
9299 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9300 x1 = x1 < point_x[2] ? x1 : point_x[2];
9301 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9302 y1 = y1 < point_y[2] ? y1 : point_y[2];
9304 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9305 x2 = x2 > point_x[2] ? x2 : point_x[2];
9306 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9307 y2 = y2 > point_y[2] ? y2 : point_y[2];
9309 for( y=y1 ; y <=y2 ; y++ ){
9310 for( x=x1 ; x <=x2 ; x++ ){
9311 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9312 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9313 centersign*( (point_x[1]-x)*(point_y[2]-y)
9314 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9315 centersign*( (point_x[2]-x)*(point_y[0]-y)
9316 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9318 if( player_has_los_bold(y,x)){
9319 /* Visual effects */
9321 && panel_contains(y,x)){
9322 p = bolt_pict(y,x,y,x, GF_MANA );
9323 print_rel(PICT_C(p), PICT_A(p),y,x);
9324 move_cursor_relative(y, x);
9325 /*if (fresh_before)*/ Term_fresh();
9326 Term_xtra(TERM_XTRA_DELAY, msec);
9332 for( y=y1 ; y <=y2 ; y++ ){
9333 for( x=x1 ; x <=x2 ; x++ ){
9334 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9335 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9336 centersign*( (point_x[1]-x)*(point_y[2]-y)
9337 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9338 centersign*( (point_x[2]-x)*(point_y[0]-y)
9339 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9341 if( player_has_los_bold(y,x)){
9342 (void)project_f(0,0,y,x,dam,GF_MANA);
9347 for( y=y1 ; y <=y2 ; y++ ){
9348 for( x=x1 ; x <=x2 ; x++ ){
9349 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9350 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9351 centersign*( (point_x[1]-x)*(point_y[2]-y)
9352 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9353 centersign*( (point_x[2]-x)*(point_y[0]-y)
9354 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9356 if( player_has_los_bold(y,x)){
9357 (void)project_o(0,0,y,x,dam,GF_MANA);
9362 for( y=y1 ; y <=y2 ; y++ ){
9363 for( x=x1 ; x <=x2 ; x++ ){
9364 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9365 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9366 centersign*( (point_x[1]-x)*(point_y[2]-y)
9367 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9368 centersign*( (point_x[2]-x)*(point_y[0]-y)
9369 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9371 if( player_has_los_bold(y,x) ){
9372 (void)project_m(0,0,y,x,dam,GF_MANA,
9373 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9380 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9382 msg_print("The field broke a mirror");
9384 remove_mirror(point_y[0],point_x[0]);
9390 void seal_of_mirror( int dam )
9394 for( x = 0 ; x < cur_wid ; x++ )
9396 for( y = 0 ; y < cur_hgt ; y++ )
9398 if( is_mirror_grid(&cave[y][x]))
9400 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9401 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9403 if( !cave[y][x].m_idx )