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 (m_ptr->maxhp < m_ptr->max_maxhp)
3476 msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3478 msg_format("%^s recovers %s vitality.", m_name, m_poss);
3480 m_ptr->maxhp = m_ptr->max_maxhp;
3486 if (seen) obvious = TRUE;
3494 msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3496 msg_format("%^s is no longer stunned.", m_name);
3500 if (m_ptr->confused)
3503 msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3505 msg_format("%^s is no longer confused.", m_name);
3507 m_ptr->confused = 0;
3512 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3514 msg_format("%^s recovers %s courage.", m_name, m_poss);
3520 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3523 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3525 chg_virtue(V_VITALITY, 1);
3527 if (r_ptr->flags1 & RF1_UNIQUE)
3528 chg_virtue(V_INDIVIDUALISM, 1);
3530 if (is_friendly(m_ptr))
3531 chg_virtue(V_HONOUR, 1);
3532 else if (!(r_ptr->flags3 & RF3_EVIL))
3534 if (r_ptr->flags3 & RF3_GOOD)
3535 chg_virtue(V_COMPASSION, 2);
3537 chg_virtue(V_COMPASSION, 1);
3540 if (m_ptr->r_idx == MON_LEPER)
3543 chg_virtue(V_COMPASSION, 5);
3546 if (r_ptr->flags3 & RF3_ANIMAL)
3547 chg_virtue(V_NATURE, 1);
3549 /* Redraw (later) if needed */
3550 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3551 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3555 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3557 note = " looks healthier.";
3561 /* No "real" damage */
3567 /* Speed Monster (Ignore "dam") */
3570 if (seen) obvious = TRUE;
3576 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3578 note = " starts moving faster.";
3581 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3583 if (c_ptr->m_idx == p_ptr->riding)
3584 p_ptr->update |= (PU_BONUS);
3586 if (r_ptr->flags1 & RF1_UNIQUE)
3587 chg_virtue(V_INDIVIDUALISM, 1);
3588 if (is_friendly(m_ptr))
3589 chg_virtue(V_HONOUR, 1);
3591 /* No "real" damage */
3597 /* Slow Monster (Use "dam" as "power") */
3600 if (seen) obvious = TRUE;
3602 if (r_ptr->flagsr & RFR_RES_ALL)
3605 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3607 note = " is immune.";
3610 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3613 /* Powerful monsters can resist */
3614 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3615 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3618 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3620 note = " is unaffected!";
3626 /* Normal monsters slow down */
3632 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3634 note = " starts moving slower.";
3637 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3639 if (c_ptr->m_idx == p_ptr->riding)
3640 p_ptr->update |= (PU_BONUS);
3643 /* No "real" damage */
3649 /* Sleep (Use "dam" as "power") */
3652 if (seen) obvious = TRUE;
3654 if (r_ptr->flagsr & RFR_RES_ALL)
3657 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3659 note = " is immune.";
3662 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3665 /* Attempt a saving throw */
3666 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3667 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3668 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3670 /* Memorize a flag */
3671 if (r_ptr->flags3 & RF3_NO_SLEEP)
3673 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3676 /* No obvious effect */
3678 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3680 note = " is unaffected!";
3687 /* Go to sleep (much) later */
3689 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3691 note = " falls asleep!";
3697 /* No "real" damage */
3703 /* Sleep (Use "dam" as "power") */
3704 case GF_STASIS_EVIL:
3706 if (seen) obvious = TRUE;
3708 if (r_ptr->flagsr & RFR_RES_ALL)
3711 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3713 note = " is immune.";
3716 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3719 /* Attempt a saving throw */
3720 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3721 !(r_ptr->flags3 & RF3_EVIL) ||
3722 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3725 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3727 note = " is unaffected!";
3734 /* Go to sleep (much) later */
3736 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3738 note = " is suspended!";
3744 /* No "real" damage */
3749 /* Sleep (Use "dam" as "power") */
3752 if (seen) obvious = TRUE;
3754 if (r_ptr->flagsr & RFR_RES_ALL)
3757 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3759 note = " is immune.";
3762 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3765 /* Attempt a saving throw */
3766 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3767 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3770 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3772 note = " is unaffected!";
3779 /* Go to sleep (much) later */
3781 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3783 note = " is suspended!";
3789 /* No "real" damage */
3798 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3799 vir = virtue_number(V_HARMONY);
3802 dam += p_ptr->virtues[vir-1]/10;
3805 vir = virtue_number(V_INDIVIDUALISM);
3808 dam -= p_ptr->virtues[vir-1]/20;
3811 if (seen) obvious = TRUE;
3813 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3816 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3818 note = " is immune.";
3821 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3825 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3828 /* Attempt a saving throw */
3829 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3830 (r_ptr->flags3 & RF3_NO_CONF) ||
3831 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3832 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3834 /* Memorize a flag */
3835 if (r_ptr->flags3 & RF3_NO_CONF)
3837 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3841 /* No obvious effect */
3843 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3845 note = " is unaffected!";
3850 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3852 else if (p_ptr->cursed & TRC_AGGRAVATE)
3855 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3857 note = " hates you too much!";
3860 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3865 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3867 note = " suddenly seems friendly!";
3872 chg_virtue(V_INDIVIDUALISM, -1);
3873 if (r_ptr->flags3 & RF3_ANIMAL)
3874 chg_virtue(V_NATURE, 1);
3877 /* No "real" damage */
3882 /* Control undead */
3883 case GF_CONTROL_UNDEAD:
3886 if (seen) obvious = TRUE;
3888 vir = virtue_number(V_UNLIFE);
3891 dam += p_ptr->virtues[vir-1]/10;
3894 vir = virtue_number(V_INDIVIDUALISM);
3897 dam -= p_ptr->virtues[vir-1]/20;
3900 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3903 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3905 note = " is immune.";
3908 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3912 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3915 /* Attempt a saving throw */
3916 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3917 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3918 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3919 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3921 /* No obvious effect */
3923 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3925 note = " is unaffected!";
3929 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3931 else if (p_ptr->cursed & TRC_AGGRAVATE)
3934 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3936 note = " hates you too much!";
3939 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3944 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3946 note = " is in your thrall!";
3952 /* No "real" damage */
3958 case GF_CONTROL_DEMON:
3961 if (seen) obvious = TRUE;
3963 vir = virtue_number(V_UNLIFE);
3966 dam += p_ptr->virtues[vir-1]/10;
3969 vir = virtue_number(V_INDIVIDUALISM);
3972 dam -= p_ptr->virtues[vir-1]/20;
3975 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3978 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3980 note = " is immune.";
3983 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3987 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
3990 /* Attempt a saving throw */
3991 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3992 (!(r_ptr->flags3 & RF3_DEMON)) ||
3993 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3994 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3996 /* No obvious effect */
3998 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4000 note = " is unaffected!";
4004 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4006 else if (p_ptr->cursed & TRC_AGGRAVATE)
4009 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4011 note = " hates you too much!";
4014 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4019 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
4021 note = " is in your thrall!";
4027 /* No "real" damage */
4033 case GF_CONTROL_ANIMAL:
4037 if (seen) obvious = TRUE;
4039 vir = virtue_number(V_NATURE);
4042 dam += p_ptr->virtues[vir-1]/10;
4045 vir = virtue_number(V_INDIVIDUALISM);
4048 dam -= p_ptr->virtues[vir-1]/20;
4051 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4054 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4056 note = " is immune.";
4059 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4063 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4066 /* Attempt a saving throw */
4067 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4068 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
4069 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4070 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4071 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4073 /* Memorize a flag */
4074 if (r_ptr->flags3 & (RF3_NO_CONF))
4076 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4080 /* No obvious effect */
4082 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4084 note = " is unaffected!";
4088 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4090 else if (p_ptr->cursed & TRC_AGGRAVATE)
4093 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4095 note = " hates you too much!";
4098 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4103 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4105 note = " is tamed!";
4110 if (r_ptr->flags3 & RF3_ANIMAL)
4111 chg_virtue(V_NATURE, 1);
4114 /* No "real" damage */
4120 case GF_CONTROL_LIVING:
4124 vir = virtue_number(V_UNLIFE);
4125 if (seen) obvious = TRUE;
4127 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4128 vir = virtue_number(V_UNLIFE);
4131 dam -= p_ptr->virtues[vir-1]/10;
4134 vir = virtue_number(V_INDIVIDUALISM);
4137 dam -= p_ptr->virtues[vir-1]/20;
4140 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4141 if (dam < 1) dam = 1;
4143 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4145 msg_format("You stare into %s.", m_name);
4147 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4150 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4152 note = " is immune.";
4155 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4159 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
4162 /* Attempt a saving throw */
4163 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4164 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4165 !monster_living(r_ptr) ||
4166 ((r_ptr->level+10) > randint1(dam)))
4169 /* No obvious effect */
4171 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4173 note = " is unaffected!";
4177 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4179 else if (p_ptr->cursed & TRC_AGGRAVATE)
4182 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4184 note = " hates you too much!";
4187 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4192 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4194 note = " is tamed!";
4199 if (r_ptr->flags3 & RF3_ANIMAL)
4200 chg_virtue(V_NATURE, 1);
4203 /* No "real" damage */
4208 /* Confusion (Use "dam" as "power") */
4211 if (seen) obvious = TRUE;
4213 if (r_ptr->flagsr & RFR_RES_ALL)
4216 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4218 note = " is immune.";
4221 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4224 /* Get confused later */
4225 do_conf = damroll(3, (dam / 2)) + 1;
4227 /* Attempt a saving throw */
4228 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4229 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4230 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4232 /* Memorize a flag */
4233 if (r_ptr->flags3 & (RF3_NO_CONF))
4235 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4241 /* No obvious effect */
4243 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4245 note = " is unaffected!";
4251 /* No "real" damage */
4258 if (seen) obvious = TRUE;
4260 if (r_ptr->flagsr & RFR_RES_ALL)
4263 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4265 note = " is immune.";
4268 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4271 do_stun = damroll((caster_lev / 10) + 3 , (dam)) + 1;
4273 /* Attempt a saving throw */
4274 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4275 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4280 /* No obvious effect */
4282 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4284 note = " is unaffected!";
4290 /* No "real" damage */
4298 /* Lite, but only hurts susceptible creatures */
4306 if (r_ptr->flagsr & RFR_RES_ALL)
4312 if (r_ptr->flags3 & (RF3_HURT_LITE))
4316 /* Obvious effect */
4319 /* Memorize the effects */
4320 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4323 /* Special effect */
4325 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4326 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4328 note = " cringes from the light!";
4329 note_dies = " shrivels away in the light!";
4334 /* Normally no damage */
4346 /* Lite -- opposite of Dark */
4349 if (seen) obvious = TRUE;
4351 if (r_ptr->flagsr & RFR_RES_ALL)
4354 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4356 note = " is immune.";
4359 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4362 if (r_ptr->flagsr & RFR_RES_LITE)
4365 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4370 dam *= 2; dam /= (randint1(6)+6);
4371 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4373 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4375 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4377 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4378 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4380 note = " cringes from the light!";
4381 note_dies = " shrivels away in the light!";
4390 /* Dark -- opposite of Lite */
4393 if (seen) obvious = TRUE;
4395 if (r_ptr->flagsr & RFR_RES_ALL)
4398 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4400 note = " is immune.";
4403 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4406 if (r_ptr->flagsr & RFR_RES_DARK)
4409 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4414 dam *= 2; dam /= (randint1(6)+6);
4415 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4424 if (r_ptr->flagsr & RFR_RES_ALL)
4429 /* Hurt by rock remover */
4430 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4437 /* Memorize the effects */
4438 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4441 /* Cute little message */
4443 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4444 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4446 note = " loses some skin!";
4447 note_dies = " dissolves!";
4452 /* Usually, ignore the effects */
4463 /* Teleport undead (Use "dam" as "power") */
4464 case GF_AWAY_UNDEAD:
4466 /* Only affect undead */
4467 if (r_ptr->flags3 & (RF3_UNDEAD))
4469 bool resists_tele = FALSE;
4471 if (r_ptr->flagsr & RFR_RES_TELE)
4473 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4475 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4477 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4479 note = " is unaffected!";
4482 resists_tele = TRUE;
4484 else if (r_ptr->level > randint1(100))
4486 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4488 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4493 resists_tele = TRUE;
4502 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4515 /* No "real" damage */
4521 /* Teleport evil (Use "dam" as "power") */
4524 /* Only affect evil */
4525 if (r_ptr->flags3 & (RF3_EVIL))
4527 bool resists_tele = FALSE;
4529 if (r_ptr->flagsr & RFR_RES_TELE)
4531 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4533 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4535 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4537 note = " is unaffected!";
4540 resists_tele = TRUE;
4542 else if (r_ptr->level > randint1(100))
4544 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4546 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4551 resists_tele = TRUE;
4560 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4573 /* No "real" damage */
4579 /* Teleport monster (Use "dam" as "power") */
4582 bool resists_tele = FALSE;
4583 if (r_ptr->flagsr & RFR_RES_TELE)
4585 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4587 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4589 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4591 note = " is unaffected!";
4594 resists_tele = TRUE;
4596 else if (r_ptr->level > randint1(100))
4598 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4600 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4605 resists_tele = TRUE;
4612 if (seen) obvious = TRUE;
4614 /* Prepare to teleport */
4618 /* No "real" damage */
4624 /* Turn undead (Use "dam" as "power") */
4625 case GF_TURN_UNDEAD:
4627 if (r_ptr->flagsr & RFR_RES_ALL)
4632 /* Only affect undead */
4633 if (r_ptr->flags3 & (RF3_UNDEAD))
4637 /* Learn about type */
4638 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4644 /* Apply some fear */
4645 do_fear = damroll(3, (dam / 2)) + 1;
4647 /* Attempt a saving throw */
4648 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4650 /* No obvious effect */
4652 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4654 note = " is unaffected!";
4669 /* No "real" damage */
4675 /* Turn evil (Use "dam" as "power") */
4678 if (r_ptr->flagsr & RFR_RES_ALL)
4683 /* Only affect evil */
4684 if (r_ptr->flags3 & (RF3_EVIL))
4688 /* Learn about type */
4689 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4695 /* Apply some fear */
4696 do_fear = damroll(3, (dam / 2)) + 1;
4698 /* Attempt a saving throw */
4699 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4701 /* No obvious effect */
4703 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4705 note = " is unaffected!";
4720 /* No "real" damage */
4726 /* Turn monster (Use "dam" as "power") */
4729 if (r_ptr->flagsr & RFR_RES_ALL)
4735 if (seen) obvious = TRUE;
4737 /* Apply some fear */
4738 do_fear = damroll(3, (dam / 2)) + 1;
4740 /* Attempt a saving throw */
4741 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4742 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4743 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4745 /* No obvious effect */
4747 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4749 note = " is unaffected!";
4756 /* No "real" damage */
4763 case GF_DISP_UNDEAD:
4765 if (r_ptr->flagsr & RFR_RES_ALL)
4771 /* Only affect undead */
4772 if (r_ptr->flags3 & (RF3_UNDEAD))
4776 /* Learn about type */
4777 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4785 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4786 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4788 note = " shudders.";
4789 note_dies = " dissolves!";
4811 if (r_ptr->flagsr & RFR_RES_ALL)
4817 /* Only affect evil */
4818 if (r_ptr->flags3 & (RF3_EVIL))
4822 /* Learn about type */
4823 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4831 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4832 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4834 note = " shudders.";
4835 note_dies = " dissolves!";
4856 if (r_ptr->flagsr & RFR_RES_ALL)
4862 /* Only affect good */
4863 if (r_ptr->flags3 & (RF3_GOOD))
4867 /* Learn about type */
4868 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4876 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4877 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4879 note = " shudders.";
4880 note_dies = " dissolves!";
4899 case GF_DISP_LIVING:
4901 if (r_ptr->flagsr & RFR_RES_ALL)
4907 /* Only affect non-undead */
4908 if (monster_living(r_ptr))
4911 if (seen) obvious = TRUE;
4915 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4916 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4918 note = " shudders.";
4919 note_dies = " dissolves!";
4940 if (r_ptr->flagsr & RFR_RES_ALL)
4946 /* Only affect demons */
4947 if (r_ptr->flags3 & (RF3_DEMON))
4951 /* Learn about type */
4952 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4960 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4961 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4963 note = " shudders.";
4964 note_dies = " dissolves!";
4982 /* Dispel monster */
4985 if (r_ptr->flagsr & RFR_RES_ALL)
4992 if (seen) obvious = TRUE;
4996 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4997 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4999 note = " shudders.";
5000 note_dies = " dissolves!";
5010 if (seen) obvious = TRUE;
5012 if (r_ptr->flagsr & RFR_RES_ALL)
5015 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5017 note = " is immune.";
5020 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5024 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
5028 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£",m_name);
5030 msg_format("You draw psychic energy from %s.", m_name);
5033 (void)hp_player(dam);
5038 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5040 msg_format("%s is unaffected.", m_name);
5050 if (seen) obvious = TRUE;
5053 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5055 msg_format("You gaze intently at %s.", m_name);
5058 if (r_ptr->flagsr & RFR_RES_ALL)
5061 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5063 note = " is immune.";
5066 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5070 /* Attempt a saving throw */
5071 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5072 (r_ptr->flags3 & RF3_NO_CONF) ||
5073 (r_ptr->level > randint1((caster_lev*2 - 10) < 1 ? 1 : (caster_lev*2 - 10)) + 10))
5075 /* Memorize a flag */
5076 if (r_ptr->flags3 & (RF3_NO_CONF))
5078 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5081 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5083 note = "is unaffected!";
5090 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5091 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5093 msg_format("%^s is blasted by psionic energy.", m_name);
5094 note_dies = " collapses, a mindless husk.";
5097 do_conf = randint0(8) + 8;
5103 case GF_BRAIN_SMASH:
5105 if (seen) obvious = TRUE;
5108 msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
5110 msg_format("You gaze intently at %s.", m_name);
5113 if (r_ptr->flagsr & RFR_RES_ALL)
5116 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5118 note = " is immune.";
5121 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5125 /* Attempt a saving throw */
5126 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5127 (r_ptr->flags3 & RF3_NO_CONF) ||
5128 (r_ptr->level > randint1((caster_lev*2 - 10) < 1 ? 1 : (caster_lev*2 - 10)) + 10))
5130 /* Memorize a flag */
5131 if (r_ptr->flags3 & (RF3_NO_CONF))
5133 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5136 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5138 note = "is unaffected!";
5145 msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
5146 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5148 msg_format("%^s is blasted by psionic energy.", m_name);
5149 note_dies = " collapses, a mindless husk.";
5152 do_conf = randint0(8) + 8;
5153 do_stun = randint0(8) + 8;
5154 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5155 if (c_ptr->m_idx == p_ptr->riding)
5156 p_ptr->update |= (PU_BONUS);
5164 if (seen) obvious = TRUE;
5167 msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5169 msg_format("You point at %s and curses.", m_name);
5172 if (r_ptr->flagsr & RFR_RES_ALL)
5175 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5177 note = " is immune.";
5180 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5184 /* Attempt a saving throw */
5185 if (randint0(100 + caster_lev) < (r_ptr->level + 35))
5189 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5191 note = "is unaffected!";
5201 if (seen) obvious = TRUE;
5204 msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
5206 msg_format("You point at %s and curses horribly.", m_name);
5209 if (r_ptr->flagsr & RFR_RES_ALL)
5212 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5214 note = " is immune.";
5217 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5221 /* Attempt a saving throw */
5222 if (randint0(100 + caster_lev) < (r_ptr->level + 35))
5226 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5228 note = "is unaffected!";
5238 if (seen) obvious = TRUE;
5241 msg_format("%s¤ò»Øº¹¤·¡¢¶²¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª",m_name);
5243 msg_format("You point at %s, incanting terribly!", m_name);
5246 if (r_ptr->flagsr & RFR_RES_ALL)
5249 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5251 note = " is immune.";
5254 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5258 /* Attempt a saving throw */
5259 if (randint0(100 + caster_lev) < (r_ptr->level + 35))
5263 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5265 note = "is unaffected!";
5275 if (seen) obvious = TRUE;
5278 msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£",m_name);
5280 msg_format("You point at %s, screaming th word, 'DIE!'.", m_name);
5283 if (r_ptr->flagsr & RFR_RES_ALL)
5286 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5288 note = " is immune.";
5291 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5295 /* Attempt a saving throw */
5296 if (randint0(100 + caster_lev) < (r_ptr->level + 35))
5300 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5302 note = "is unaffected!";
5312 if (seen) obvious = TRUE;
5314 if (r_ptr->flagsr & RFR_RES_ALL)
5317 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5319 note = " is immune.";
5322 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5326 if (r_ptr->flags1 & RF1_UNIQUE)
5329 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5331 note = "is unaffected!";
5337 if ((caster_lev + randint1(dam)) >
5338 (r_ptr->level + randint1(200)))
5340 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5342 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5347 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5357 /* Capture monster */
5361 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5362 (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_UNIQUE_7)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR))
5365 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5367 msg_format("%^s is unaffected.", m_name);
5373 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5374 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5375 nokori_hp = m_ptr->maxhp * 3 / 10;
5377 nokori_hp = m_ptr->maxhp * 3 / 20;
5379 if (m_ptr->hp >= nokori_hp)
5382 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5384 msg_format("You need to weaken %s more.", m_name);
5388 else if (m_ptr->hp < randint0(nokori_hp))
5390 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5392 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5394 msg_format("You capture %^s!", m_name);
5396 cap_mon = m_list[c_ptr->m_idx].r_idx;
5397 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5398 cap_hp = m_list[c_ptr->m_idx].hp;
5399 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5400 if (m_list[c_ptr->m_idx].nickname)
5401 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5404 if (c_ptr->m_idx == p_ptr->riding)
5406 if (rakuba(-1, FALSE))
5409 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5411 msg_format("You have fallen from %s.", m_name);
5416 delete_monster_idx(c_ptr->m_idx);
5423 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5425 msg_format("You failed to capture %s.", m_name);
5432 /* Attack (Use "dam" as attack type) */
5435 /* Return this monster's death */
5436 return py_attack(y, x, dam);
5439 /* Sleep (Use "dam" as "power") */
5445 if (seen) obvious = TRUE;
5447 if (r_ptr->flagsr & RFR_RES_ALL)
5450 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5452 note = " is immune.";
5455 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5458 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5461 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5463 note = " is immune!";
5467 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5473 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5475 note = " is immune!";
5482 if (one_in_(5)) effect = 1;
5483 else if (one_in_(4)) effect = 2;
5484 else if (one_in_(3)) effect = 3;
5489 /* Powerful monsters can resist */
5490 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5491 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5494 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5496 note = " is unaffected!";
5502 /* Normal monsters slow down */
5508 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5510 note = " starts moving slower.";
5513 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5515 if (c_ptr->m_idx == p_ptr->riding)
5516 p_ptr->update |= (PU_BONUS);
5520 else if (effect == 2)
5522 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5524 /* Attempt a saving throw */
5525 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5526 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5531 /* No obvious effect */
5533 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5535 note = " is unaffected!";
5542 else if (effect == 3)
5544 /* Attempt a saving throw */
5545 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5546 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5547 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5549 /* Memorize a flag */
5550 if (r_ptr->flags3 & RF3_NO_SLEEP)
5552 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5555 /* No obvious effect */
5557 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5559 note = " is unaffected!";
5566 /* Go to sleep (much) later */
5568 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5570 note = " falls asleep!";
5580 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5582 note = " is immune!";
5586 /* No "real" damage */
5595 if (seen) obvious = TRUE;
5597 if (r_ptr->flagsr & RFR_RES_ALL)
5600 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5602 note = " is immune.";
5605 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5609 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (c_ptr->m_idx == p_ptr->riding)) || p_ptr->inside_arena || p_ptr->inside_quest)
5616 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG2_NOGENO))
5623 delete_monster_idx(c_ptr->m_idx);
5625 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5627 msg_format("%^s disappered!",m_name);
5631 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5633 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5637 chg_virtue(V_VITALITY, -1);
5642 p_ptr->redraw |= (PR_HP);
5645 p_ptr->window |= (PW_PLAYER);
5652 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5654 note = "is unaffected!";
5657 if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
5665 msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£",m_name);
5667 msg_format("You take a photograph of %s.",m_name);
5670 if (r_ptr->flags3 & (RF3_HURT_LITE))
5674 /* Obvious effect */
5677 /* Memorize the effects */
5678 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5681 /* Special effect */
5683 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5684 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5686 note = " cringes from the light!";
5687 note_dies = " shrivels away in the light!";
5692 /* Normally no damage */
5699 photo = m_ptr->r_idx;
5706 case GF_BLOOD_CURSE:
5708 if (seen) obvious = TRUE;
5710 if (r_ptr->flagsr & RFR_RES_ALL)
5713 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5715 note = " is immune.";
5718 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5726 bool success = FALSE;
5727 if (seen) obvious = TRUE;
5729 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5731 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5732 if (dam < 1) dam = 1;
5734 /* No need to tame your pet */
5738 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5740 note = " starts moving faster.";
5743 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5747 /* Attempt a saving throw */
5748 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5749 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5750 (m_ptr->mflag2 & MFLAG2_NOPET) ||
5751 (p_ptr->cursed & TRC_AGGRAVATE) ||
5752 ((r_ptr->level+10) > randint1(dam)))
5755 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5760 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5762 note = " is tamed!";
5766 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5768 /* Learn about type */
5769 if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5776 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5778 do_fear = randint1(90)+10;
5782 if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5786 /* No "real" damage */
5793 if (seen) obvious = TRUE;
5795 if (r_ptr->flagsr & RFR_RES_ALL)
5798 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5800 note = " is immune.";
5803 if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5807 /* Attempt a saving throw */
5808 if (randint0(100 + dam) < (r_ptr->level + 50))
5812 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5814 note = "is unaffected!";
5835 /* Absolutely no effect */
5836 if (skipped) return (FALSE);
5838 /* "Unique" monsters cannot be polymorphed */
5839 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5841 /* Quest monsters cannot be polymorphed */
5842 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5844 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5846 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5847 if (((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7) || (r_ptr->flags1 & RF1_QUESTOR)) && !p_ptr->inside_battle)
5849 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5854 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5855 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5858 /* Modify the damage */
5860 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5862 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤¡£";
5864 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5867 /* Check for death */
5868 if (dam > m_ptr->hp)
5870 /* Extract method of death */
5874 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5875 else if (do_poly && (randint1(90) > r_ptr->level))
5877 if (polymorph_monster(y, x))
5880 if (seen) obvious = TRUE;
5882 /* Monster polymorphs */
5884 note = "¤¬ÊѿȤ·¤¿¡ª";
5890 /* Turn off the damage */
5893 /* Hack -- Get new monster */
5894 m_ptr = &m_list[c_ptr->m_idx];
5896 /* Hack -- Get new race */
5897 r_ptr = &r_info[m_ptr->r_idx];
5903 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5905 note = " is unaffected!";
5911 /* Handle "teleport" */
5915 if (seen) obvious = TRUE;
5919 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5921 note = " disappears!";
5924 chg_virtue(V_VALOUR, -1);
5927 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who));
5929 /* Hack -- get new location */
5933 /* Hack -- get new grid */
5934 c_ptr = &cave[y][x];
5937 /* Sound and Impact resisters never stun */
5939 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5940 !(r_ptr->flags3 & RF3_NO_STUN))
5943 if (seen) obvious = TRUE;
5949 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5951 note = " is more dazed.";
5954 tmp = m_ptr->stunned + (do_stun / 2);
5959 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5961 note = " is dazed.";
5968 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5974 /* Confusion and Chaos resisters (and sleepers) never confuse */
5976 !(r_ptr->flags3 & RF3_NO_CONF) &&
5977 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
5980 if (seen) obvious = TRUE;
5982 /* Already partially confused */
5983 if (m_ptr->confused)
5986 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5988 note = " looks more confused.";
5991 tmp = m_ptr->confused + (do_conf / 2);
5994 /* Was not confused */
5998 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
6000 note = " looks confused.";
6006 /* Apply confusion */
6007 m_ptr->confused = (tmp < 200) ? tmp : 200;
6016 if (seen) obvious = TRUE;
6018 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
6023 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
6025 note = " seems weakened.";
6027 m_ptr->maxhp -= do_time;
6028 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
6038 tmp = m_ptr->monfear + do_fear;
6041 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6048 /* If another monster did the damage, hurt the monster by hand */
6051 /* Redraw (later) if needed */
6052 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6053 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6055 /* Wake the monster up */
6058 /* Hurt the monster */
6066 if (is_pet(m_ptr) && !(m_ptr->ml))
6069 /* Give detailed messages if destroyed */
6072 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
6075 msg_format("%^s%s", m_name, note);
6083 monster_gain_exp(who, m_ptr->r_idx);
6085 /* Generate treasure, etc */
6086 monster_death(c_ptr->m_idx, FALSE);
6088 /* Delete the monster */
6089 delete_monster_idx(c_ptr->m_idx);
6094 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6096 msg_print("You feel sad for a moment.");
6102 /* Damaged monster */
6105 /* Give detailed messages if visible or destroyed */
6106 if (note && seen) msg_format("%^s%s", m_name, note);
6108 /* Hack -- Pain message */
6111 message_pain(c_ptr->m_idx, dam);
6118 /* Hack -- handle sleep */
6119 if (do_sleep) m_ptr->csleep = do_sleep;
6123 else if (heal_leper)
6126 msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6128 msg_print("The Mangy looking leper is healed!");
6131 delete_monster_idx(c_ptr->m_idx);
6133 /* If the player did it, give him experience, check fear */
6134 else if (typ != GF_DRAIN_MANA)
6138 /* Hurt the monster, check for fear and death */
6139 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6144 /* Damaged monster */
6147 /* HACK - anger the monster before showing the sleep message */
6148 if (do_sleep) anger_monster(m_ptr);
6150 /* Give detailed messages if visible or destroyed */
6153 msg_format("%s%s", m_name, note);
6155 msg_format("%^s%s", m_name, note);
6159 /* Hack -- Pain message */
6160 else if (known && (dam || !do_fear))
6162 message_pain(c_ptr->m_idx, dam);
6165 /* Anger monsters */
6166 if (((dam > 0) || get_angry) && !do_sleep)
6167 anger_monster(m_ptr);
6170 if ((fear || do_fear) && (m_ptr->ml))
6177 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6179 msg_format("%^s flees in terror!", m_name);
6184 /* Hack -- handle sleep */
6185 if (do_sleep) m_ptr->csleep = do_sleep;
6189 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6191 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6195 switch (randint1(28))
6201 msg_print("ÃÏÌ̤¬Íɤ줿...");
6203 msg_print("The ground trembles...");
6206 earthquake(ty, tx, 4 + randint0(4));
6207 if (!one_in_(6)) break;
6209 case 3: case 4: case 5: case 6:
6212 int dam = damroll(10, 10);
6214 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6216 msg_print("A portal opens to a plane of raw mana!");
6219 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6220 if (!one_in_(6)) break;
6226 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6228 msg_print("Space warps about you!");
6231 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE);
6232 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6233 if (!one_in_(6)) break;
6235 case 9: case 10: case 11:
6237 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6239 msg_print("You feel a surge of energy!");
6242 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6243 if (!one_in_(6)) break;
6244 case 12: case 13: case 14: case 15: case 16:
6245 aggravate_monsters(0);
6246 if (!one_in_(6)) break;
6248 count += activate_hi_summon(ty, tx, TRUE);
6249 if (!one_in_(6)) break;
6250 case 19: case 20: case 21: case 22:
6252 bool pet = !one_in_(3);
6253 u32b mode = PM_ALLOW_GROUP;
6255 if (pet) mode |= PM_FORCE_PET;
6256 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6258 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6259 if (!one_in_(6)) break;
6261 case 23: case 24: case 25:
6262 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6264 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6266 msg_print("You feel your life draining away...");
6269 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6270 else lose_exp(p_ptr->exp / 16);
6271 if (!one_in_(6)) break;
6272 case 26: case 27: case 28:
6281 (void)do_dec_stat(i);
6290 (void)do_dec_stat(randint0(6));
6299 if (p_ptr->inside_battle)
6301 p_ptr->health_who = c_ptr->m_idx;
6302 p_ptr->redraw |= (PR_HEALTH);
6306 /* XXX XXX XXX Verify this code */
6308 /* Update the monster */
6309 update_mon(c_ptr->m_idx, FALSE);
6311 /* Redraw the monster grid */
6315 /* Update monster recall window */
6316 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6319 p_ptr->window |= (PW_MONSTER);
6322 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6326 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6328 set_target(m_ptr, monster_target_y, monster_target_x);
6331 else if (is_pet(&m_list[who]) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6333 set_target(m_ptr, m_list[who].fy, m_list[who].fx);
6337 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6339 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6340 rakubadam_m = (dam > 200) ? 200 : dam;
6349 /* Get local object */
6352 /* Prepare to make a Blade of Chaos */
6353 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6355 q_ptr->pval = photo;
6357 /* Mark the item as fully known */
6358 q_ptr->ident |= (IDENT_MENTAL);
6360 /* Drop it in the dungeon */
6361 (void)drop_near(q_ptr, -1, py, px);
6369 /* Return "Anything seen?" */
6375 * Helper function for "project()" below.
6377 * Handle a beam/bolt/ball causing damage to the player.
6379 * This routine takes a "source monster" (by index), a "distance", a default
6380 * "damage", and a "damage type". See "project_m()" above.
6382 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6383 * is reduced (see "project_m()" above). This can happen if a monster breathes
6384 * at the player and hits a wall instead.
6386 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6387 * to know if this is actually a ball or a bolt spell
6390 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6391 * we just assume that the effects were obvious, for historical reasons.
6393 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6398 /* Hack -- assume obvious */
6399 bool obvious = TRUE;
6401 /* Player blind-ness */
6402 bool blind = (p_ptr->blind ? TRUE : FALSE);
6404 /* Player needs a "description" (he is blind) */
6407 /* Source monster */
6408 monster_type *m_ptr = NULL;
6410 /* Monster name (for attacks) */
6413 /* Monster name (for damage) */
6416 /* Hack -- messages */
6422 /* Player is not here */
6423 if (!player_bold(y, x)) return (FALSE);
6425 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6431 /* Player cannot hurt himself */
6432 if (!who) return (FALSE);
6433 if (who == p_ptr->riding) return (FALSE);
6435 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6438 int max_attempts = 10;
6441 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6442 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6443 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6445 if (blind) msg_print("Something bounces!");
6446 else msg_print("The attack bounces!");
6450 /* Choose 'new' target */
6453 t_y = m_list[who].fy - 1 + randint1(3);
6454 t_x = m_list[who].fx - 1 + randint1(3);
6457 while (max_attempts && in_bounds2u(t_y, t_x) &&
6458 !(player_has_los_bold(t_y, t_x)));
6460 if (max_attempts < 1)
6462 t_y = m_list[who].fy;
6463 t_x = m_list[who].fx;
6466 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6473 /* Limit maximum damage */
6474 if (dam > 1600) dam = 1600;
6476 /* Reduce damage by distance */
6477 dam = (dam + r) / (r + 1);
6480 /* If the player is blind, be more descriptive */
6481 if (blind) fuzzy = TRUE;
6486 /* Get the source monster */
6487 m_ptr = &m_list[who];
6488 /* Extract the monster level */
6489 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6491 /* Get the monster name */
6492 monster_desc(m_name, m_ptr, 0);
6494 /* Get the monster's real name (gotten before polymorph!) */
6495 strcpy(killer, who_name);
6500 strcpy(killer, "æ«");
6502 strcpy(killer, "a trap");
6506 /* Analyze the damage */
6509 /* Standard damage -- hurts inventory too */
6513 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6515 if (fuzzy) msg_print("You are hit by acid!");
6518 get_damage = acid_dam(dam, killer, monspell);
6522 /* Standard damage -- hurts inventory too */
6526 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6528 if (fuzzy) msg_print("You are hit by fire!");
6531 get_damage = fire_dam(dam, killer, monspell);
6535 /* Standard damage -- hurts inventory too */
6539 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6541 if (fuzzy) msg_print("You are hit by cold!");
6544 get_damage = cold_dam(dam, killer, monspell);
6548 /* Standard damage -- hurts inventory too */
6552 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6554 if (fuzzy) msg_print("You are hit by lightning!");
6557 get_damage = elec_dam(dam, killer, monspell);
6561 /* Standard damage -- also poisons player */
6564 bool double_resist = IS_OPPOSE_POIS();
6566 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6568 if (fuzzy) msg_print("You are hit by poison!");
6571 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6572 if (double_resist) dam = (dam + 2) / 3;
6574 if ((!(double_resist || p_ptr->resist_pois)) &&
6575 one_in_(HURT_CHANCE))
6580 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6582 if (!(double_resist || p_ptr->resist_pois))
6584 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6589 /* Standard damage -- also poisons / mutates player */
6592 bool double_resist = IS_OPPOSE_POIS();
6594 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6596 if (fuzzy) msg_print("You are hit by radiation!");
6599 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6600 if (double_resist) dam = (2 * dam + 2) / 5;
6601 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6602 if (!(double_resist || p_ptr->resist_pois))
6604 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6606 if (one_in_(5)) /* 6 */
6609 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6611 msg_print("You undergo a freakish metamorphosis!");
6614 if (one_in_(4)) /* 4 */
6622 inven_damage(set_acid_destroy, 2);
6628 /* Standard damage */
6632 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6634 if (fuzzy) msg_print("You are hit by something!");
6637 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6641 /* Holy Orb -- Player only takes partial damage */
6645 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6647 if (fuzzy) msg_print("You are hit by something!");
6650 if (p_ptr->align > 10)
6652 else if (p_ptr->align < -10)
6654 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6661 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6663 if (fuzzy) msg_print("You are hit by something!");
6666 if (p_ptr->align > 10)
6668 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6672 /* Arrow -- XXX no dodging */
6676 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6678 if (fuzzy) msg_print("You are hit by something sharp!");
6681 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6684 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6686 msg_print("You cut down the arrow!");
6690 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6694 /* Plasma -- XXX No resist */
6698 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6700 if (fuzzy) msg_print("You are hit by something *HOT*!");
6703 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6705 if (!p_ptr->resist_sound)
6707 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6708 (void)set_stun(p_ptr->stun + k);
6711 if (!(p_ptr->resist_fire ||
6713 p_ptr->immune_fire))
6715 inven_damage(set_acid_destroy, 3);
6721 /* Nether -- drain experience */
6725 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6727 if (fuzzy) msg_print("You are hit by nether forces!");
6731 if (p_ptr->resist_neth)
6733 if (!prace_is_(RACE_SPECTRE))
6734 dam *= 6; dam /= (randint1(4) + 7);
6736 else drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
6738 if (prace_is_(RACE_SPECTRE))
6741 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6743 msg_print("You feel invigorated!");
6747 learn_spell(monspell);
6751 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6757 /* Water -- stun/confuse */
6761 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6763 if (fuzzy) msg_print("You are hit by something wet!");
6766 if (!p_ptr->resist_sound)
6768 set_stun(p_ptr->stun + randint1(40));
6770 if (!p_ptr->resist_conf)
6772 set_confused(p_ptr->confused + randint1(5) + 5);
6777 inven_damage(set_cold_destroy, 3);
6780 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6784 /* Chaos -- many effects */
6788 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6790 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6793 if (p_ptr->resist_chaos)
6795 dam *= 6; dam /= (randint1(4) + 7);
6797 if (!p_ptr->resist_conf)
6799 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6801 if (!p_ptr->resist_chaos)
6803 (void)set_image(p_ptr->image + randint1(10));
6807 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6809 msg_print("Your body is twisted by chaos!");
6812 (void)gain_random_mutation(0);
6815 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6817 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
6819 if (!p_ptr->resist_chaos || one_in_(9))
6821 inven_damage(set_elec_destroy, 2);
6822 inven_damage(set_fire_destroy, 2);
6824 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6828 /* Shards -- mostly cutting */
6832 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6834 if (fuzzy) msg_print("You are hit by something sharp!");
6837 if (p_ptr->resist_shard)
6839 dam *= 6; dam /= (randint1(4) + 7);
6843 (void)set_cut(p_ptr->cut + dam);
6846 if (!p_ptr->resist_shard || one_in_(13))
6848 inven_damage(set_cold_destroy, 2);
6851 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6855 /* Sound -- mostly stunning */
6859 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6861 if (fuzzy) msg_print("You are hit by a loud noise!");
6864 if (p_ptr->resist_sound)
6866 dam *= 5; dam /= (randint1(4) + 7);
6870 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6871 (void)set_stun(p_ptr->stun + k);
6874 if (!p_ptr->resist_sound || one_in_(13))
6876 inven_damage(set_cold_destroy, 2);
6879 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6883 /* Pure confusion */
6887 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6889 if (fuzzy) msg_print("You are hit by something puzzling!");
6892 if (p_ptr->resist_conf)
6894 dam *= 5; dam /= (randint1(4) + 7);
6896 if (!p_ptr->resist_conf)
6898 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6900 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6904 /* Disenchantment -- see above */
6908 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6910 if (fuzzy) msg_print("You are hit by something static!");
6913 if (p_ptr->resist_disen)
6915 dam *= 6; dam /= (randint1(4) + 7);
6919 (void)apply_disenchant(0);
6921 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6925 /* Nexus -- see above */
6929 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6931 if (fuzzy) msg_print("You are hit by something strange!");
6934 if (p_ptr->resist_nexus)
6936 dam *= 6; dam /= (randint1(4) + 7);
6942 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6946 /* Force -- mostly stun */
6950 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6952 if (fuzzy) msg_print("You are hit by kinetic force!");
6955 if (!p_ptr->resist_sound)
6957 (void)set_stun(p_ptr->stun + randint1(20));
6959 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6964 /* Rocket -- stun, cut */
6968 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
6970 if (fuzzy) msg_print("There is an explosion!");
6973 if (!p_ptr->resist_sound)
6975 (void)set_stun(p_ptr->stun + randint1(20));
6977 if (p_ptr->resist_shard)
6983 (void)set_cut(p_ptr-> cut + ( dam / 2));
6986 if ((!p_ptr->resist_shard) || one_in_(12))
6988 inven_damage(set_cold_destroy, 3);
6991 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6995 /* Inertia -- slowness */
6999 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7001 if (fuzzy) msg_print("You are hit by something slow!");
7004 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7005 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7009 /* Lite -- blinding */
7013 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7015 if (fuzzy) msg_print("You are hit by something!");
7018 if (p_ptr->resist_lite)
7020 dam *= 4; dam /= (randint1(4) + 7);
7022 else if (!blind && !p_ptr->resist_blind)
7024 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7026 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
7029 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
7031 msg_print("The light scorches your flesh!");
7036 else if (prace_is_(RACE_S_FAIRY))
7040 if (p_ptr->wraith_form) dam *= 2;
7041 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7043 if (p_ptr->wraith_form)
7045 p_ptr->wraith_form = 0;
7047 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7049 msg_print("The light forces you out of your incorporeal shadow form.");
7052 p_ptr->redraw |= PR_MAP;
7053 /* Update monsters */
7054 p_ptr->update |= (PU_MONSTERS);
7056 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7058 /* Redraw status bar */
7059 p_ptr->redraw |= (PR_STATUS);
7066 /* Dark -- blinding */
7070 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7072 if (fuzzy) msg_print("You are hit by something!");
7075 if (p_ptr->resist_dark)
7077 dam *= 4; dam /= (randint1(4) + 7);
7079 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7081 else if (!blind && !p_ptr->resist_blind)
7083 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7085 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7089 /* Time -- bolt fewer effects XXX */
7093 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7095 if (fuzzy) msg_print("You are hit by a blast from the past!");
7098 if (p_ptr->resist_time)
7101 dam /= (randint1(4) + 7);
7103 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7105 msg_print("You feel as if time is passing you by.");
7111 switch (randint1(10))
7113 case 1: case 2: case 3: case 4: case 5:
7115 if (p_ptr->prace == RACE_ANDROID) break;
7117 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7119 msg_print("You feel life has clocked back.");
7122 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7126 case 6: case 7: case 8: case 9:
7128 switch (randint1(6))
7131 case 1: k = A_STR; act = "¶¯¤¯"; break;
7132 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7133 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7134 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7135 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7136 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7138 case 1: k = A_STR; act = "strong"; break;
7139 case 2: k = A_INT; act = "bright"; break;
7140 case 3: k = A_WIS; act = "wise"; break;
7141 case 4: k = A_DEX; act = "agile"; break;
7142 case 5: k = A_CON; act = "hale"; break;
7143 case 6: k = A_CHR; act = "beautiful"; break;
7149 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7151 msg_format("You're not as %s as you used to be...", act);
7155 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7156 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7157 p_ptr->update |= (PU_BONUS);
7164 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7166 msg_print("You're not as powerful as you used to be...");
7170 for (k = 0; k < 6; k++)
7172 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7173 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7175 p_ptr->update |= (PU_BONUS);
7181 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7185 /* Gravity -- stun plus slowness plus teleport */
7189 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7190 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7192 if (fuzzy) msg_print("You are hit by something heavy!");
7193 msg_print("Gravity warps around you.");
7198 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7199 if (!(p_ptr->resist_sound || p_ptr->ffall))
7201 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7202 (void)set_stun(p_ptr->stun + k);
7206 dam = (dam * 2) / 3;
7209 if (!p_ptr->ffall || one_in_(13))
7211 inven_damage(set_cold_destroy, 2);
7214 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7218 /* Standard damage */
7219 case GF_DISINTEGRATE:
7222 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7224 if (fuzzy) msg_print("You are hit by pure energy!");
7227 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7234 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7236 if (fuzzy) msg_print("You are hit by something invigorating!");
7239 (void)hp_player(dam);
7247 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7249 if (fuzzy) msg_print("You are hit by something!");
7252 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7260 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7262 if (fuzzy) msg_print("You are hit by something slow!");
7265 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7271 if (p_ptr->free_act) break;
7273 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7275 if (fuzzy) msg_print("You fall asleep!");
7279 if (ironman_nightmare)
7282 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7284 msg_print("A horrible vision enters your mind.");
7288 /* Pick a nightmare */
7289 get_mon_num_prep(get_nightmare, NULL);
7291 /* Have some nightmares */
7292 have_nightmare(get_mon_num(MAX_DEPTH));
7294 /* Remove the monster restriction */
7295 get_mon_num_prep(NULL, NULL);
7298 set_paralyzed(p_ptr->paralyzed + dam);
7309 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7311 if (fuzzy) msg_print("You are hit by an aura of magic!");
7314 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7322 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7324 if (fuzzy) msg_print("You are hit by an energy!");
7327 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7335 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7337 if (fuzzy) msg_print("Something falls from the sky on you!");
7340 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7341 if (!p_ptr->resist_shard || one_in_(13))
7343 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7344 inven_damage(set_cold_destroy, 2);
7350 /* Ice -- cold plus stun plus cuts */
7354 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7356 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7359 cold_dam(dam, killer, monspell);
7360 if (!p_ptr->resist_shard)
7362 (void)set_cut(p_ptr->cut + damroll(5, 8));
7364 if (!p_ptr->resist_sound)
7366 (void)set_stun(p_ptr->stun + randint1(15));
7369 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
7371 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7381 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7383 if (fuzzy) msg_print("You are hit by something extremely cold!");
7387 if (p_ptr->mimic_form)
7389 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7390 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7395 switch (p_ptr->prace)
7397 /* Some races are immune */
7411 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7423 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7426 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7428 msg_print("You resist the effects!");
7430 learn_spell(MS_MIND_BLAST);
7435 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7437 msg_print("Your mind is blasted by psyonic energy.");
7440 if (!p_ptr->resist_conf)
7442 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7445 if (!p_ptr->resist_chaos && one_in_(3))
7447 (void)set_image(p_ptr->image + randint0(250) + 150);
7454 p_ptr->csp_frac = 0;
7456 p_ptr->redraw |= PR_MANA;
7458 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_MIND_BLAST);
7463 case GF_BRAIN_SMASH:
7465 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7468 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7470 msg_print("You resist the effects!");
7472 learn_spell(MS_BRAIN_SMASH);
7477 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7479 msg_print("Your mind is blasted by psionic energy.");
7486 p_ptr->csp_frac = 0;
7488 p_ptr->redraw |= PR_MANA;
7490 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_BRAIN_SMASH);
7491 if (!p_ptr->resist_blind)
7493 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7495 if (!p_ptr->resist_conf)
7497 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7499 if (!p_ptr->free_act)
7501 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7503 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7505 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7506 (void)do_dec_stat(A_INT);
7507 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7508 (void)do_dec_stat(A_WIS);
7510 if (!p_ptr->resist_chaos)
7512 (void)set_image(p_ptr->image + randint0(250) + 150);
7520 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7523 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7525 msg_print("You resist the effects!");
7527 learn_spell(MS_CAUSE_1);
7531 curse_equipment(15, 0);
7532 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_1);
7539 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7542 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7544 msg_print("You resist the effects!");
7546 learn_spell(MS_CAUSE_2);
7550 curse_equipment(25, MIN(rlev/2-15, 5));
7551 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_2);
7558 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7561 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7563 msg_print("You resist the effects!");
7565 learn_spell(MS_CAUSE_3);
7569 curse_equipment(33, MIN(rlev/2-15, 15));
7570 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_3);
7577 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7580 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7582 msg_print("You resist the effects!");
7584 learn_spell(MS_CAUSE_4);
7588 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_4);
7589 (void)set_cut(p_ptr->cut + damroll(10, 10));
7596 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7599 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7601 msg_format("You resist the effects!");
7603 learn_spell(MS_HAND_DOOM);
7609 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7611 msg_print("Your feel your life fade away!");
7614 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, MS_HAND_DOOM);
7615 curse_equipment(40, 20);
7617 if (p_ptr->chp < 1) p_ptr->chp = 1;
7632 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7635 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7637 char m_name_self[80];
7640 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
7642 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7644 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7645 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7648 if (p_ptr->riding && dam > 0)
7650 rakubadam_p = (dam > 200) ? 200 : dam;
7658 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7664 /* Return "Anything seen?" */
7670 * Find the distance from (x, y) to a line.
7672 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7674 /* Vector from (x, y) to (x1, y1) */
7683 int pd = distance(y1, x1, y, x);
7684 int nd = distance(y1, x1, y2, x2);
7686 if (pd > nd) return distance(y, x, y2, x2);
7688 /* Component of P on N */
7689 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7691 /* Absolute value */
7692 return((nd >= 0) ? nd : 0 - nd);
7699 * Modified version of los() for calculation of disintegration balls.
7700 * Disintegration effects are stopped by permanent walls.
7702 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7722 /* Slope, or 1/Slope, of LOS */
7726 /* Extract the offset */
7730 /* Extract the absolute offset */
7735 /* Handle adjacent (or identical) grids */
7736 if ((ax < 2) && (ay < 2)) return (TRUE);
7739 /* Paranoia -- require "safe" origin */
7740 /* if (!in_bounds(y1, x1)) return (FALSE); */
7743 /* Directly South/North */
7746 /* South -- check for walls */
7749 for (ty = y1 + 1; ty < y2; ty++)
7751 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7755 /* North -- check for walls */
7758 for (ty = y1 - 1; ty > y2; ty--)
7760 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7768 /* Directly East/West */
7771 /* East -- check for walls */
7774 for (tx = x1 + 1; tx < x2; tx++)
7776 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7780 /* West -- check for walls */
7783 for (tx = x1 - 1; tx > x2; tx--)
7785 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7794 /* Extract some signs */
7795 sx = (dx < 0) ? -1 : 1;
7796 sy = (dy < 0) ? -1 : 1;
7799 /* Vertical "knights" */
7804 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7808 /* Horizontal "knights" */
7813 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7818 /* Calculate scale factor div 2 */
7821 /* Calculate scale factor */
7825 /* Travel horizontally */
7828 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7834 /* Consider the special case where slope == 1. */
7845 /* Note (below) the case (qy == f2), where */
7846 /* the LOS exactly meets the corner of a tile. */
7849 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7860 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7873 /* Travel vertically */
7876 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7892 /* Note (below) the case (qx == f2), where */
7893 /* the LOS exactly meets the corner of a tile. */
7896 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7907 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7926 * Do disintegration effect on the terrain
7927 * before we decide the region of the effect.
7929 static bool do_disintegration(int by, int bx, int y, int x)
7933 /* Disintegration balls explosions are stopped by perma-walls */
7934 if (!in_disintegration_range(by, bx, y, x)) return FALSE;
7936 /* Permanent walls and artifacts don't get effect */
7937 /* But not protect monsters and other objects */
7938 if (!cave_valid_bold(y, x)) return TRUE;
7940 /* Destroy mirror/glyph */
7943 feat = cave[y][x].feat;
7945 if ((feat < FEAT_PATTERN_START || feat > FEAT_PATTERN_XTRA2) &&
7946 (feat < FEAT_DEEP_WATER || feat > FEAT_GRASS))
7948 if (feat == FEAT_TREES || feat == FEAT_FLOWER || feat == FEAT_DEEP_GRASS)
7949 cave_set_feat(y, x, FEAT_GRASS);
7951 cave_set_feat(y, x, floor_type[randint0(100)]);
7954 /* Update some things -- similar to GF_KILL_WALL */
7955 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
7964 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)
7969 int brev = rad * rad / dist;
7973 int tdis = distance(y1, x1, y2, x2);
7974 int mdis = tdis + rad;
7976 while (bdis <= mdis)
7980 if ((0 < dist) && (path_n < dist))
7982 int ny = GRID_Y(path_g[path_n]);
7983 int nx = GRID_X(path_g[path_n]);
7984 int nd = distance(ny, nx, y1, x1);
7986 /* Get next base point */
7995 /* Travel from center outward */
7996 for (cdis = 0; cdis <= brad; cdis++)
7998 /* Scan the maximal blast area of radius "cdis" */
7999 for (y = by - cdis; y <= by + cdis; y++)
8001 for (x = bx - cdis; x <= bx + cdis; x++)
8003 /* Ignore "illegal" locations */
8004 if (!in_bounds(y, x)) continue;
8006 /* Enforce a circular "ripple" */
8007 if (distance(y1, x1, y, x) != bdis) continue;
8009 /* Enforce an arc */
8010 if (distance(by, bx, y, x) != cdis) continue;
8015 /* Disintegration are stopped only by perma-walls */
8018 /* Destroy terrains */
8019 if (!do_disintegration(by, bx, y, x)) continue;
8023 /* No actual disintegration */
8024 if (!in_disintegration_range(by, bx, y, x)) continue;
8029 /* The blast is stopped by walls */
8030 if (!los(by, bx, y, x)) continue;
8033 /* Save this grid */
8041 /* Encode some more "radius" info */
8042 gm[bdis + 1] = *pgrids;
8044 /* Increase the size */
8045 brad = rad * (path_n + brev) / (dist + brev);
8047 /* Find the next ripple */
8051 /* Store the effect size */
8057 * Generic "beam"/"bolt"/"ball" projection routine.
8060 * who: Index of "source" monster (zero for "player")
8061 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8062 * y,x: Target location (or location to travel "towards")
8063 * dam: Base damage roll to apply to affected monsters (or player)
8064 * typ: Type of damage to apply to monsters (and objects)
8065 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8068 * TRUE if any "effects" of the projection were observed, else FALSE
8070 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8071 * towards a given location (optionally passing over the heads of interposing
8072 * monsters), and have it do a given amount of damage to the monsters (and
8073 * optionally objects) within the given radius of the final location.
8075 * A "bolt" travels from source to target and affects only the target grid.
8076 * A "beam" travels from source to target, affecting all grids passed through.
8077 * A "ball" travels from source to the target, exploding at the target, and
8078 * affecting everything within the given radius of the target location.
8080 * Traditionally, a "bolt" does not affect anything on the ground, and does
8081 * not pass over the heads of interposing monsters, much like a traditional
8082 * missile, and will "stop" abruptly at the "target" even if no monster is
8083 * positioned there, while a "ball", on the other hand, passes over the heads
8084 * of monsters between the source and target, and affects everything except
8085 * the source monster which lies within the final radius, while a "beam"
8086 * affects every monster between the source and target, except for the casting
8087 * monster (or player), and rarely affects things on the ground.
8089 * Two special flags allow us to use this function in special ways, the
8090 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8091 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8092 * actually projecting from the source monster (or player).
8094 * The player will only get "experience" for monsters killed by himself
8095 * Unique monsters can only be destroyed by attacks from the player
8097 * Only 256 grids can be affected per projection, limiting the effective
8098 * "radius" of standard ball attacks to nine units (diameter nineteen).
8100 * One can project in a given "direction" by combining PROJECT_THRU with small
8101 * offsets to the initial location (see "line_spell()"), or by calculating
8102 * "virtual targets" far away from the player.
8104 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8105 * continuing until it actually hits somethings (useful for "stone to mud").
8107 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8109 * Balls must explode BEFORE hitting walls, or they would affect monsters
8110 * on both sides of a wall. Some bug reports indicate that this is still
8111 * happening in 2.7.8 for Windows, though it appears to be impossible.
8113 * We "pre-calculate" the blast area only in part for efficiency.
8114 * More importantly, this lets us do "explosions" from the "inside" out.
8115 * This results in a more logical distribution of "blast" treasure.
8116 * It also produces a better (in my opinion) animation of the explosion.
8117 * It could be (but is not) used to have the treasure dropped by monsters
8118 * in the middle of the explosion fall "outwards", and then be damaged by
8119 * the blast as it spreads outwards towards the treasure drop location.
8121 * Walls and doors are included in the blast area, so that they can be
8122 * "burned" or "melted" in later versions.
8124 * This algorithm is intended to maximize simplicity, not necessarily
8125 * efficiency, since this function is not a bottleneck in the code.
8127 * We apply the blast effect from ground zero outwards, in several passes,
8128 * first affecting features, then objects, then monsters, then the player.
8129 * This allows walls to be removed before checking the object or monster
8130 * in the wall, and protects objects which are dropped by monsters killed
8131 * in the blast, and allows the player to see all affects before he is
8132 * killed or teleported away. The semantics of this method are open to
8133 * various interpretations, but they seem to work well in practice.
8135 * We process the blast area from ground-zero outwards to allow for better
8136 * distribution of treasure dropped by monsters, and because it provides a
8137 * pleasing visual effect at low cost.
8139 * Note that the damage done by "ball" explosions decreases with distance.
8140 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8142 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8143 * the target, and then the damage "flows" along this beam of destruction.
8144 * The damage at every grid is the same as at the "center" of a "ball"
8145 * explosion, since the "beam" grids are treated as if they ARE at the
8146 * center of a "ball" explosion.
8148 * Currently, specifying "beam" plus "ball" means that locations which are
8149 * covered by the initial "beam", and also covered by the final "ball", except
8150 * for the final grid (the epicenter of the ball), will be "hit twice", once
8151 * by the initial beam, and once by the exploding ball. For the grid right
8152 * next to the epicenter, this results in 150% damage being done. The center
8153 * does not have this problem, for the same reason the final grid in a "beam"
8154 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8155 * grids which are covered by the "ball" will NOT work, as then they will
8156 * receive LESS damage than they should. Do not combine "beam" with "ball".
8158 * The array "gy[],gx[]" with current size "grids" is used to hold the
8159 * collected locations of all grids in the "blast area" plus "beam path".
8161 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8162 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8163 * first blast grid (see above) with radius "N" from the blast center. Note
8164 * that only the first gm[1] grids in the blast area thus take full damage.
8165 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8166 * number of blast grids.
8168 * Note that once the projection is complete, (y2,x2) holds the final location
8169 * of bolts/beams, and the "epicenter" of balls.
8171 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8172 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8173 * implementation of the "distance" function. Also, a bolt can be properly
8174 * viewed as a "ball" with a "rad" of "zero".
8176 * Note that if no "target" is reached before the beam/bolt/ball travels the
8177 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8178 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8180 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8181 * to move from point A to point B, even if the player cannot see part of the
8182 * projection path. Note that in general, the player will *always* see part
8183 * of the path, since it either starts at the player or ends on the player.
8185 * Hack -- we assume that every "projection" is "self-illuminating".
8187 * Hack -- when only a single monster is affected, we automatically track
8188 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8190 * Note that all projections now "explode" at their final destination, even
8191 * if they were being projected at a more distant destination. This means
8192 * that "ball" spells will *always* explode.
8194 * Note that we must call "handle_stuff()" after affecting terrain features
8195 * in the blast radius, in case the "illumination" of the grid was changed,
8196 * and "update_view()" and "update_monsters()" need to be called.
8198 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8208 int y_saver, x_saver; /* For reflecting monsters */
8210 int msec = delay_factor * delay_factor * delay_factor;
8212 /* Assume the player sees nothing */
8213 bool notice = FALSE;
8215 /* Assume the player has seen nothing */
8216 bool visual = FALSE;
8218 /* Assume the player has seen no blast grids */
8221 /* Assume to be a normal ball spell */
8222 bool breath = FALSE;
8224 /* Is the player blind? */
8225 bool blind = (p_ptr->blind ? TRUE : FALSE);
8227 bool old_hide = FALSE;
8229 /* Number of grids in the "path" */
8232 /* Actual grids in the "path" */
8235 /* Number of grids in the "blast area" (including the "beam" path) */
8238 /* Coordinates of the affected grids */
8239 byte gx[1024], gy[1024];
8241 /* Encoded "radius" info (see above) */
8244 /* Actual radius encoded in gm[] */
8249 /* Attacker's name (prepared before polymorph)*/
8252 /* Initialize by null string */
8258 /* Default target of monsterspell is player */
8259 monster_target_y=py;
8260 monster_target_x=px;
8262 /* Initialize with nul string */
8265 /* Hack -- Jump to target */
8266 if (flg & (PROJECT_JUMP))
8271 /* Clear the flag */
8272 flg &= ~(PROJECT_JUMP);
8277 /* Start at player */
8284 /* Start at monster */
8287 x1 = m_list[who].fx;
8288 y1 = m_list[who].fy;
8289 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8302 /* Default "destination" */
8307 /* Hack -- verify stuff */
8308 if (flg & (PROJECT_THRU))
8310 if ((x1 == x2) && (y1 == y2))
8312 flg &= ~(PROJECT_THRU);
8316 /* Handle a breath attack */
8321 if (flg & PROJECT_HIDE) old_hide = TRUE;
8322 flg |= PROJECT_HIDE;
8326 /* Hack -- Assume there will be no blast (max radius 32) */
8327 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8335 /* Collect beam grids */
8336 if (flg & (PROJECT_BEAM))
8343 if (breath && typ == GF_DISINTEGRATE)
8345 flg |= (PROJECT_DISI);
8348 /* Calculate the projection path */
8350 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8352 /* Hack -- Handle stuff */
8355 /* Giga-Hack SEEKER & SUPER_RAY */
8357 if( typ == GF_SEEKER )
8367 for (i = 0; i < path_n; ++i)
8372 int ny = GRID_Y(path_g[i]);
8373 int nx = GRID_X(path_g[i]);
8384 /* Only do visuals if requested */
8385 if (!blind && !(flg & (PROJECT_HIDE)))
8387 /* Only do visuals if the player can "see" the bolt */
8388 if (panel_contains(y, x) && player_has_los_bold(y, x))
8395 /* Obtain the bolt pict */
8396 p = bolt_pict(oy, ox, y, x, typ);
8398 /* Extract attr/char */
8402 /* Visual effects */
8403 print_rel(c, a, y, x);
8404 move_cursor_relative(y, x);
8405 /*if (fresh_before)*/ Term_fresh();
8406 Term_xtra(TERM_XTRA_DELAY, msec);
8408 /*if (fresh_before)*/ Term_fresh();
8410 /* Display "beam" grids */
8411 if (flg & (PROJECT_BEAM))
8413 /* Obtain the explosion pict */
8414 p = bolt_pict(y, x, y, x, typ);
8416 /* Extract attr/char */
8420 /* Visual effects */
8421 print_rel(c, a, y, x);
8424 /* Hack -- Activate delay */
8428 /* Hack -- delay anyway for consistency */
8431 /* Delay for consistency */
8432 Term_xtra(TERM_XTRA_DELAY, msec);
8435 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8436 if( is_mirror_grid(&cave[y][x]))
8438 /* The target of monsterspell becomes tha mirror(broken) */
8439 monster_target_y=(s16b)y;
8440 monster_target_x=(s16b)x;
8443 next_mirror( &oy,&ox,y,x );
8445 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8446 for( j = last_i; j <=i ; j++ )
8448 y = GRID_Y(path_g[j]);
8449 x = GRID_X(path_g[j]);
8450 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8451 if(!who && (project_m_n==1) && !jump ){
8452 if(cave[project_m_y][project_m_x].m_idx >0 ){
8453 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8455 /* Hack -- auto-recall */
8456 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8458 /* Hack - auto-track */
8459 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8462 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8467 for( i = last_i ; i < path_n ; i++ )
8470 y = GRID_Y(path_g[i]);
8471 x = GRID_X(path_g[i]);
8472 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8474 if(!who && (project_m_n==1) && !jump ){
8475 if(cave[project_m_y][project_m_x].m_idx >0 ){
8476 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8478 /* Hack -- auto-recall */
8479 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8481 /* Hack - auto-track */
8482 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8485 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8489 else if(typ == GF_SUPER_RAY){
8491 int second_step = 0;
8498 for (i = 0; i < path_n; ++i)
8503 int ny = GRID_Y(path_g[i]);
8504 int nx = GRID_X(path_g[i]);
8515 /* Only do visuals if requested */
8516 if (!blind && !(flg & (PROJECT_HIDE)))
8518 /* Only do visuals if the player can "see" the bolt */
8519 if (panel_contains(y, x) && player_has_los_bold(y, x))
8526 /* Obtain the bolt pict */
8527 p = bolt_pict(oy, ox, y, x, typ);
8529 /* Extract attr/char */
8533 /* Visual effects */
8534 print_rel(c, a, y, x);
8535 move_cursor_relative(y, x);
8536 /*if (fresh_before)*/ Term_fresh();
8537 Term_xtra(TERM_XTRA_DELAY, msec);
8539 /*if (fresh_before)*/ Term_fresh();
8541 /* Display "beam" grids */
8542 if (flg & (PROJECT_BEAM))
8544 /* Obtain the explosion pict */
8545 p = bolt_pict(y, x, y, x, typ);
8547 /* Extract attr/char */
8551 /* Visual effects */
8552 print_rel(c, a, y, x);
8555 /* Hack -- Activate delay */
8559 /* Hack -- delay anyway for consistency */
8562 /* Delay for consistency */
8563 Term_xtra(TERM_XTRA_DELAY, msec);
8566 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8567 if( cave[y][x].feat == FEAT_RUBBLE ||
8568 cave[y][x].feat == FEAT_DOOR_HEAD ||
8569 cave[y][x].feat == FEAT_DOOR_TAIL ||
8570 (cave[y][x].feat >= FEAT_WALL_EXTRA &&
8571 cave[y][x].feat <= FEAT_PERM_SOLID ))
8573 if( second_step )continue;
8576 if( is_mirror_grid(&cave[y][x]) && !second_step )
8578 /* The target of monsterspell becomes tha mirror(broken) */
8579 monster_target_y=(s16b)y;
8580 monster_target_x=(s16b)x;
8583 for( j = 0; j <=i ; j++ )
8585 y = GRID_Y(path_g[j]);
8586 x = GRID_X(path_g[j]);
8587 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8591 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8592 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8593 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8594 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8595 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8596 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8597 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8598 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8601 for( i = 0; i < path_n ; i++ )
8604 y = GRID_Y(path_g[i]);
8605 x = GRID_X(path_g[i]);
8606 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8607 if(!who && (project_m_n==1) && !jump ){
8608 if(cave[project_m_y][project_m_x].m_idx >0 ){
8609 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8611 /* Hack -- auto-recall */
8612 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8614 /* Hack - auto-track */
8615 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8618 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8623 /* Project along the path */
8624 for (i = 0; i < path_n; ++i)
8629 int ny = GRID_Y(path_g[i]);
8630 int nx = GRID_X(path_g[i]);
8632 if (flg & PROJECT_DISI)
8634 /* Hack -- Balls explode before reaching walls */
8635 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8639 /* Hack -- Balls explode before reaching walls */
8640 if (!cave_floor_bold(ny, nx) && (rad > 0)) break;
8647 /* Collect beam grids */
8648 if (flg & (PROJECT_BEAM))
8655 /* Only do visuals if requested */
8656 if (!blind && !(flg & (PROJECT_HIDE)) && !(flg & PROJECT_FAST))
8658 /* Only do visuals if the player can "see" the bolt */
8659 if (panel_contains(y, x) && player_has_los_bold(y, x))
8666 /* Obtain the bolt pict */
8667 p = bolt_pict(oy, ox, y, x, typ);
8669 /* Extract attr/char */
8673 /* Visual effects */
8674 print_rel(c, a, y, x);
8675 move_cursor_relative(y, x);
8676 /*if (fresh_before)*/ Term_fresh();
8677 Term_xtra(TERM_XTRA_DELAY, msec);
8679 /*if (fresh_before)*/ Term_fresh();
8681 /* Display "beam" grids */
8682 if (flg & (PROJECT_BEAM))
8684 /* Obtain the explosion pict */
8685 p = bolt_pict(y, x, y, x, typ);
8687 /* Extract attr/char */
8691 /* Visual effects */
8692 print_rel(c, a, y, x);
8695 /* Hack -- Activate delay */
8699 /* Hack -- delay anyway for consistency */
8702 /* Delay for consistency */
8703 Term_xtra(TERM_XTRA_DELAY, msec);
8708 /* Save the "blast epicenter" */
8712 if (breath && (y1 == by) && (x1 == bx))
8718 flg &= ~(PROJECT_HIDE);
8722 /* Start the "explosion" */
8725 /* Hack -- make sure beams get to "explode" */
8733 /* If we found a "target", explode there */
8734 if (dist <= MAX_RANGE)
8736 /* Mega-Hack -- remove the final "beam" grid */
8737 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8740 * Create a conical breath attack
8751 flg &= ~(PROJECT_HIDE);
8753 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, (bool)(typ == GF_DISINTEGRATE), TRUE);
8757 /* Determine the blast area, work from the inside out */
8758 for (dist = 0; dist <= rad; dist++)
8760 /* Scan the maximal blast area of radius "dist" */
8761 for (y = by - dist; y <= by + dist; y++)
8763 for (x = bx - dist; x <= bx + dist; x++)
8765 /* Ignore "illegal" locations */
8766 if (!in_bounds2(y, x)) continue;
8768 /* Enforce a "circular" explosion */
8769 if (distance(by, bx, y, x) != dist) continue;
8771 if (typ == GF_DISINTEGRATE)
8773 /* Disintegration are stopped only by perma-walls */
8774 if (!do_disintegration(by, bx, y, x)) continue;
8778 /* Ball explosions are stopped by walls */
8779 if (!los(by, bx, y, x)) continue;
8782 /* Save this grid */
8789 /* Encode some more "radius" info */
8795 /* Speed -- ignore "non-explosions" */
8796 if (!grids) return (FALSE);
8799 /* Display the "blast area" if requested */
8800 if (!blind && !(flg & (PROJECT_HIDE)))
8802 /* Then do the "blast", from inside out */
8803 for (t = 0; t <= gm_rad; t++)
8805 /* Dump everything with this radius */
8806 for (i = gm[t]; i < gm[t+1]; i++)
8808 /* Extract the location */
8812 /* Only do visuals if the player can "see" the blast */
8813 if (panel_contains(y, x) && player_has_los_bold(y, x))
8822 /* Obtain the explosion pict */
8823 p = bolt_pict(y, x, y, x, typ);
8825 /* Extract attr/char */
8829 /* Visual effects -- Display */
8830 print_rel(c, a, y, x);
8834 /* Hack -- center the cursor */
8835 move_cursor_relative(by, bx);
8837 /* Flush each "radius" seperately */
8838 /*if (fresh_before)*/ Term_fresh();
8840 /* Delay (efficiently) */
8841 if (visual || drawn)
8843 Term_xtra(TERM_XTRA_DELAY, msec);
8847 /* Flush the erasing */
8850 /* Erase the explosion drawn above */
8851 for (i = 0; i < grids; i++)
8853 /* Extract the location */
8857 /* Hack -- Erase if needed */
8858 if (panel_contains(y, x) && player_has_los_bold(y, x))
8864 /* Hack -- center the cursor */
8865 move_cursor_relative(by, bx);
8867 /* Flush the explosion */
8868 /*if (fresh_before)*/ Term_fresh();
8873 /* Update stuff if needed */
8874 if (p_ptr->update) update_stuff();
8877 /* Check features */
8878 if (flg & (PROJECT_GRID))
8880 /* Start with "dist" of zero */
8883 /* Scan for features */
8884 for (i = 0; i < grids; i++)
8886 /* Hack -- Notice new "dist" values */
8887 if (gm[dist+1] == i) dist++;
8889 /* Get the grid location */
8893 /* Find the closest point in the blast */
8896 int d = dist_to_line(y, x, y1, x1, by, bx);
8898 /* Affect the grid */
8899 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8903 /* Affect the grid */
8904 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8911 if (flg & (PROJECT_ITEM))
8913 /* Start with "dist" of zero */
8916 /* Scan for objects */
8917 for (i = 0; i < grids; i++)
8919 /* Hack -- Notice new "dist" values */
8920 if (gm[dist+1] == i) dist++;
8922 /* Get the grid location */
8926 /* Find the closest point in the blast */
8929 int d = dist_to_line(y, x, y1, x1, by, bx);
8931 /* Affect the object in the grid */
8932 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8936 /* Affect the object in the grid */
8937 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8943 /* Check monsters */
8944 if (flg & (PROJECT_KILL))
8951 /* Start with "dist" of zero */
8954 /* Scan for monsters */
8955 for (i = 0; i < grids; i++)
8959 /* Hack -- Notice new "dist" values */
8960 if (gm[dist + 1] == i) dist++;
8962 /* Get the grid location */
8966 /* A single bolt may be reflected */
8969 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
8970 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
8972 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
8975 int max_attempts = 10;
8977 /* Choose 'new' target */
8980 t_y = y_saver - 1 + randint1(3);
8981 t_x = x_saver - 1 + randint1(3);
8984 while (max_attempts && in_bounds2u(t_y, t_x) &&
8985 !(los(y, x, t_y, t_x)));
8987 if (max_attempts < 1)
8996 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
8997 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
8998 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
8999 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9001 msg_print("The attack bounces!");
9004 if (is_original_ap(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
9007 /* Reflected bolts randomly target either one */
9008 flg &= ~(PROJECT_MONSTER | PROJECT_PLAYER);
9009 if (one_in_(2)) flg |= PROJECT_MONSTER;
9010 else flg |= PROJECT_PLAYER;
9012 /* The bolt is reflected */
9013 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9015 /* Don't affect the monster any longer */
9021 /* Find the closest point in the blast */
9024 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9028 effective_dist = dist;
9032 /* There is the riding player on this monster */
9033 if (p_ptr->riding && player_bold(y, x))
9035 /* Aimed on the player */
9036 if (flg & PROJECT_PLAYER)
9038 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9041 * A beam or bolt is well aimed
9043 * So don't affects the mount.
9050 * The spell is not well aimed,
9051 * So partly affect the mount too.
9058 * This grid is the original target.
9060 else if ((y == y2) || (x == x2))
9062 /* Hit the mount with full damage */
9066 * Otherwise this grid is not the
9067 * original target, it means that line
9068 * of fire is obstructed by this
9072 * A beam or bolt will hit either
9073 * player or mount. Choose randomly.
9075 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9079 /* Hit the mount with full damage */
9083 /* Hit the player later */
9084 flg &= ~(PROJECT_MONSTER);
9085 flg |= PROJECT_PLAYER;
9087 /* Don't affect the mount */
9093 * The spell is not well aimed, so
9094 * partly affect both player and
9103 /* Affect the monster in the grid */
9104 if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
9108 /* Player affected one monster (without "jumping") */
9109 if (!who && (project_m_n == 1) && !jump)
9115 /* Track if possible */
9116 if (cave[y][x].m_idx > 0)
9118 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9120 /* Hack -- auto-recall */
9121 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9123 /* Hack - auto-track */
9124 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9131 if (flg & (PROJECT_KILL))
9133 /* Start with "dist" of zero */
9136 /* Scan for player */
9137 for (i = 0; i < grids; i++)
9141 /* Hack -- Notice new "dist" values */
9142 if (gm[dist+1] == i) dist++;
9144 /* Get the grid location */
9148 /* Affect the player? */
9149 if (!player_bold(y, x)) continue;
9151 /* Find the closest point in the blast */
9154 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9158 effective_dist = dist;
9161 /* Target may be your horse */
9164 /* Aimed on the player */
9165 if (flg & PROJECT_PLAYER)
9167 /* Hit the player with full damage */
9171 * Hack -- When this grid was not the
9172 * original target, a beam or bolt
9173 * would hit either player or mount,
9174 * and should be choosen randomly.
9176 * But already choosen to hit the
9177 * mount at this point.
9179 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9182 * A beam or bolt is well aimed
9184 * So don't affects the player.
9191 * The spell is not well aimed,
9192 * So partly affect the player too.
9198 /* Affect the player */
9199 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9207 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9209 if (rakubadam_m > 0)
9211 if (rakuba(rakubadam_m, FALSE))
9214 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9216 msg_format("%^s has thrown you off!", m_name);
9220 if (p_ptr->riding && rakubadam_p > 0)
9222 if(rakuba(rakubadam_p, FALSE))
9225 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9227 msg_format("You have fallen from %s.", m_name);
9233 /* Return "something was noticed" */
9237 bool binding_field( int dam )
9239 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9240 int mirror_num=0; /* ¶À¤Î¿ô */
9245 int msec= delay_factor*delay_factor*delay_factor;
9251 /* Default target of monsterspell is player */
9252 monster_target_y=py;
9253 monster_target_x=px;
9255 for( x=0 ; x < cur_wid ; x++ )
9257 for( y=0 ; y < cur_hgt ; y++ )
9259 if( is_mirror_grid(&cave[y][x]) &&
9260 distance(py,px,y,x) <= MAX_RANGE &&
9261 distance(py,px,y,x) != 0 &&
9262 player_has_los_bold(y,x)
9264 mirror_y[mirror_num]=y;
9265 mirror_x[mirror_num]=x;
9271 if( mirror_num < 2 )return FALSE;
9273 point_x[0] = randint0( mirror_num );
9275 point_x[1] = randint0( mirror_num );
9277 while( point_x[0] == point_x[1] );
9279 point_y[0]=mirror_y[point_x[0]];
9280 point_x[0]=mirror_x[point_x[0]];
9281 point_y[1]=mirror_y[point_x[1]];
9282 point_x[1]=mirror_x[point_x[1]];
9286 x=point_x[0]+point_x[1]+point_x[2];
9287 y=point_y[0]+point_y[1]+point_y[2];
9289 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9290 - (point_y[0]*3-y)*(point_x[1]*3-x);
9291 if( centersign == 0 )return FALSE;
9293 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9294 x1 = x1 < point_x[2] ? x1 : point_x[2];
9295 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9296 y1 = y1 < point_y[2] ? y1 : point_y[2];
9298 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9299 x2 = x2 > point_x[2] ? x2 : point_x[2];
9300 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9301 y2 = y2 > point_y[2] ? y2 : point_y[2];
9303 for( y=y1 ; y <=y2 ; y++ ){
9304 for( x=x1 ; x <=x2 ; x++ ){
9305 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9306 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9307 centersign*( (point_x[1]-x)*(point_y[2]-y)
9308 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9309 centersign*( (point_x[2]-x)*(point_y[0]-y)
9310 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9312 if( player_has_los_bold(y,x)){
9313 /* Visual effects */
9315 && panel_contains(y,x)){
9316 p = bolt_pict(y,x,y,x, GF_MANA );
9317 print_rel(PICT_C(p), PICT_A(p),y,x);
9318 move_cursor_relative(y, x);
9319 /*if (fresh_before)*/ Term_fresh();
9320 Term_xtra(TERM_XTRA_DELAY, msec);
9326 for( y=y1 ; y <=y2 ; y++ ){
9327 for( x=x1 ; x <=x2 ; x++ ){
9328 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9329 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9330 centersign*( (point_x[1]-x)*(point_y[2]-y)
9331 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9332 centersign*( (point_x[2]-x)*(point_y[0]-y)
9333 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9335 if( player_has_los_bold(y,x)){
9336 (void)project_f(0,0,y,x,dam,GF_MANA);
9341 for( y=y1 ; y <=y2 ; y++ ){
9342 for( x=x1 ; x <=x2 ; x++ ){
9343 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9344 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9345 centersign*( (point_x[1]-x)*(point_y[2]-y)
9346 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9347 centersign*( (point_x[2]-x)*(point_y[0]-y)
9348 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9350 if( player_has_los_bold(y,x)){
9351 (void)project_o(0,0,y,x,dam,GF_MANA);
9356 for( y=y1 ; y <=y2 ; y++ ){
9357 for( x=x1 ; x <=x2 ; x++ ){
9358 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9359 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9360 centersign*( (point_x[1]-x)*(point_y[2]-y)
9361 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9362 centersign*( (point_x[2]-x)*(point_y[0]-y)
9363 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9365 if( player_has_los_bold(y,x) ){
9366 (void)project_m(0,0,y,x,dam,GF_MANA,
9367 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9374 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9376 msg_print("The field broke a mirror");
9378 remove_mirror(point_y[0],point_x[0]);
9384 void seal_of_mirror( int dam )
9388 for( x = 0 ; x < cur_wid ; x++ )
9390 for( y = 0 ; y < cur_hgt ; y++ )
9392 if( is_mirror_grid(&cave[y][x]))
9394 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9395 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9397 if( !cave[y][x].m_idx )