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
20 static int rakubadam_m;
21 static int rakubadam_p;
23 int project_length = 0;
26 * Get another mirror. for SEEKER
28 static void next_mirror( int* next_y , int* next_x , int cury, int curx)
30 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
31 int mirror_num=0; /* ¶À¤Î¿ô */
35 for( x=0 ; x < cur_wid ; x++ )
37 for( y=0 ; y < cur_hgt ; y++ )
39 if( is_mirror_grid(&cave[y][x])){
40 mirror_y[mirror_num]=y;
41 mirror_x[mirror_num]=x;
48 num=randint0(mirror_num);
49 *next_y=mirror_y[num];
50 *next_x=mirror_x[num];
53 *next_y=cury+randint0(5)-2;
54 *next_x=curx+randint0(5)-2;
59 * Get a legal "multi-hued" color for drawing "spells"
61 static byte mh_attr(int max)
63 switch (randint1(max))
65 case 1: return (TERM_RED);
66 case 2: return (TERM_GREEN);
67 case 3: return (TERM_BLUE);
68 case 4: return (TERM_YELLOW);
69 case 5: return (TERM_ORANGE);
70 case 6: return (TERM_VIOLET);
71 case 7: return (TERM_L_RED);
72 case 8: return (TERM_L_GREEN);
73 case 9: return (TERM_L_BLUE);
74 case 10: return (TERM_UMBER);
75 case 11: return (TERM_L_UMBER);
76 case 12: return (TERM_SLATE);
77 case 13: return (TERM_WHITE);
78 case 14: return (TERM_L_WHITE);
79 case 15: return (TERM_L_DARK);
87 * Return a color to use for the bolt/ball spells
89 static byte spell_color(int type)
91 /* Check if A.B.'s new graphics should be used (rr9) */
92 if (streq(ANGBAND_GRAF, "new"))
97 case GF_PSY_SPEAR: return (0x06);
98 case GF_MISSILE: return (0x0F);
99 case GF_ACID: return (0x04);
100 case GF_ELEC: return (0x02);
101 case GF_FIRE: return (0x00);
102 case GF_COLD: return (0x01);
103 case GF_POIS: return (0x03);
104 case GF_HOLY_FIRE: return (0x00);
105 case GF_HELL_FIRE: return (0x00);
106 case GF_MANA: return (0x0E);
108 case GF_SEEKER: return (0x0E);
109 case GF_SUPER_RAY: return (0x0E);
111 case GF_ARROW: return (0x0F);
112 case GF_WATER: return (0x04);
113 case GF_NETHER: return (0x07);
114 case GF_CHAOS: return (mh_attr(15));
115 case GF_DISENCHANT: return (0x05);
116 case GF_NEXUS: return (0x0C);
117 case GF_CONFUSION: return (mh_attr(4));
118 case GF_SOUND: return (0x09);
119 case GF_SHARDS: return (0x08);
120 case GF_FORCE: return (0x09);
121 case GF_INERTIA: return (0x09);
122 case GF_GRAVITY: return (0x09);
123 case GF_TIME: return (0x09);
124 case GF_LITE_WEAK: return (0x06);
125 case GF_LITE: return (0x06);
126 case GF_DARK_WEAK: return (0x07);
127 case GF_DARK: return (0x07);
128 case GF_PLASMA: return (0x0B);
129 case GF_METEOR: return (0x00);
130 case GF_ICE: return (0x01);
131 case GF_ROCKET: return (0x0F);
132 case GF_DEATH_RAY: return (0x07);
133 case GF_NUKE: return (mh_attr(2));
134 case GF_DISINTEGRATE: return (0x05);
146 case GF_CAUSE_4: return (0x0E);
147 case GF_HAND_DOOM: return (0x07);
148 case GF_CAPTURE : return (0x0E);
149 case GF_IDENTIFY: return (0x01);
150 case GF_ATTACK: return (0x0F);
151 case GF_PHOTO : return (0x06);
154 /* Normal tiles or ASCII */
160 /* Lookup the default colors for this type */
161 cptr s = quark_str(gf_color[type]);
164 if (!s) return (TERM_WHITE);
166 /* Pick a random color */
167 c = s[randint0(strlen(s))];
169 /* Lookup this color */
170 a = my_strchr(color_char, c) - color_char;
172 /* Invalid color (note check for < 0 removed, gave a silly
173 * warning because bytes are always >= 0 -- RG) */
174 if (a > 15) return (TERM_WHITE);
180 /* Standard "color" */
186 * Find the attr/char pair to use for a spell effect
188 * It is moving (or has moved) from (x,y) to (nx,ny).
190 * If the distance is not "one", we (may) return "*".
192 u16b bolt_pict(int y, int x, int ny, int nx, int typ)
202 if ((ny == y) && (nx == x)) base = 0x30;
205 else if (nx == x) base = 0x40;
208 else if (ny == y) base = 0x50;
211 else if ((ny - y) == (x - nx)) base = 0x60;
214 else if ((ny - y) == (nx - x)) base = 0x70;
219 /* Basic spell color */
220 k = spell_color(typ);
222 /* Obtain attr/char */
223 a = misc_to_attr[base + k];
224 c = misc_to_char[base + k];
232 * Determine the path taken by a projection.
234 * The projection will always start from the grid (y1,x1), and will travel
235 * towards the grid (y2,x2), touching one grid per unit of distance along
236 * the major axis, and stopping when it enters the destination grid or a
237 * wall grid, or has travelled the maximum legal distance of "range".
239 * Note that "distance" in this function (as in the "update_view()" code)
240 * is defined as "MAX(dy,dx) + MIN(dy,dx)/2", which means that the player
241 * actually has an "octagon of projection" not a "circle of projection".
243 * The path grids are saved into the grid array pointed to by "gp", and
244 * there should be room for at least "range" grids in "gp". Note that
245 * due to the way in which distance is calculated, this function normally
246 * uses fewer than "range" grids for the projection path, so the result
247 * of this function should never be compared directly to "range". Note
248 * that the initial grid (y1,x1) is never saved into the grid array, not
249 * even if the initial grid is also the final grid. XXX XXX XXX
251 * The "flg" flags can be used to modify the behavior of this function.
253 * In particular, the "PROJECT_STOP" and "PROJECT_THRU" flags have the same
254 * semantics as they do for the "project" function, namely, that the path
255 * will stop as soon as it hits a monster, or that the path will continue
256 * through the destination grid, respectively.
258 * The "PROJECT_JUMP" flag, which for the "project()" function means to
259 * start at a special grid (which makes no sense in this function), means
260 * that the path should be "angled" slightly if needed to avoid any wall
261 * grids, allowing the player to "target" any grid which is in "view".
262 * This flag is non-trivial and has not yet been implemented, but could
263 * perhaps make use of the "vinfo" array (above). XXX XXX XXX
265 * This function returns the number of grids (if any) in the path. This
266 * function will return zero if and only if (y1,x1) and (y2,x2) are equal.
268 * This algorithm is similar to, but slightly different from, the one used
269 * by "update_view_los()", and very different from the one used by "los()".
271 sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg)
293 /* No path necessary (or allowed) */
294 if ((x1 == x2) && (y1 == y2)) return (0);
322 /* Number of "units" in one "half" grid */
325 /* Number of "units" in one "full" grid */
331 /* Let m = ((dx/dy) * full) = (dx * dx * 2) */
342 /* Advance (X) part 2 */
345 /* Advance (X) part 3 */
352 /* Create the projection path */
356 gp[n++] = GRID(y, x);
358 /* Hack -- Check maximum range */
359 if ((n + (k >> 1)) >= range) break;
361 /* Sometimes stop at destination grid */
362 if (!(flg & (PROJECT_THRU)))
364 if ((x == x2) && (y == y2)) break;
367 if (flg & (PROJECT_DISI))
369 if ((n > 0) && cave_stop_disintegration(y, x)) break;
371 else if (flg & (PROJECT_LOS))
373 if ((n > 0) && !cave_los_bold(y, x)) break;
375 else if (!(flg & (PROJECT_PATH)))
377 /* Always stop at non-initial wall grids */
378 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
381 /* Sometimes stop at non-initial monsters/players */
382 if (flg & (PROJECT_STOP))
385 (player_bold(y, x) || cave[y][x].m_idx != 0))
389 if (!in_bounds(y, x)) break;
394 /* Advance (X) part 1 */
397 /* Horizontal change */
400 /* Advance (X) part 2 */
403 /* Advance (X) part 3 */
419 /* Let m = ((dy/dx) * full) = (dy * dy * 2) */
428 /* Vertical change */
431 /* Advance (Y) part 2 */
434 /* Advance (Y) part 3 */
441 /* Create the projection path */
445 gp[n++] = GRID(y, x);
447 /* Hack -- Check maximum range */
448 if ((n + (k >> 1)) >= range) break;
450 /* Sometimes stop at destination grid */
451 if (!(flg & (PROJECT_THRU)))
453 if ((x == x2) && (y == y2)) break;
456 if (flg & (PROJECT_DISI))
458 if ((n > 0) && cave_stop_disintegration(y, x)) break;
460 else if (flg & (PROJECT_LOS))
462 if ((n > 0) && !cave_los_bold(y, x)) break;
464 else if (!(flg & (PROJECT_PATH)))
466 /* Always stop at non-initial wall grids */
467 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
470 /* Sometimes stop at non-initial monsters/players */
471 if (flg & (PROJECT_STOP))
474 (player_bold(y, x) || cave[y][x].m_idx != 0))
478 if (!in_bounds(y, x)) break;
483 /* Advance (Y) part 1 */
486 /* Vertical change */
489 /* Advance (Y) part 2 */
492 /* Advance (Y) part 3 */
512 /* Create the projection path */
516 gp[n++] = GRID(y, x);
518 /* Hack -- Check maximum range */
519 if ((n + (n >> 1)) >= range) break;
521 /* Sometimes stop at destination grid */
522 if (!(flg & (PROJECT_THRU)))
524 if ((x == x2) && (y == y2)) break;
527 if (flg & (PROJECT_DISI))
529 if ((n > 0) && cave_stop_disintegration(y, x)) break;
531 else if (flg & (PROJECT_LOS))
533 if ((n > 0) && !cave_los_bold(y, x)) break;
535 else if (!(flg & (PROJECT_PATH)))
537 /* Always stop at non-initial wall grids */
538 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
541 /* Sometimes stop at non-initial monsters/players */
542 if (flg & (PROJECT_STOP))
545 (player_bold(y, x) || cave[y][x].m_idx != 0))
549 if (!in_bounds(y, x)) break;
566 * Mega-Hack -- track "affected" monsters (see "project()" comments)
568 static int project_m_n;
569 static int project_m_x;
570 static int project_m_y;
571 /* Mega-Hack -- monsters target */
572 static s16b monster_target_x;
573 static s16b monster_target_y;
577 * We are called from "project()" to "damage" terrain features
579 * We are called both for "beam" effects and "ball" effects.
581 * The "r" parameter is the "distance from ground zero".
583 * Note that we determine if the player can "see" anything that happens
584 * by taking into account: blindness, line-of-sight, and illumination.
586 * We return "TRUE" if the effect of the projection is "obvious".
588 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
590 * XXX XXX XXX Perhaps we should affect doors?
592 static bool project_f(int who, int r, int y, int x, int dam, int typ)
594 cave_type *c_ptr = &cave[y][x];
595 feature_type *f_ptr = &f_info[c_ptr->feat];
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 (have_flag(f_ptr->flags, FF_TREE))
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;
681 /* Analyze the type */
684 /* Ignore most effects */
719 /* Destroy Traps (and Locks) */
722 /* Reveal secret doors */
723 if (is_hidden_door(c_ptr))
728 /* Check line of sight */
736 if (is_trap(c_ptr->feat))
738 /* Check line of sight */
742 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
744 msg_print("There is a bright flash of light!");
750 /* Destroy the trap */
751 cave_alter_feat(y, x, FF_DISARM);
754 /* Locked doors are unlocked */
755 if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
757 s16b old_feat = c_ptr->feat;
759 /* Unlock the door */
760 cave_alter_feat(y, x, FF_DISARM);
762 /* Check line of sound */
763 if (known && (old_feat != c_ptr->feat))
766 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
775 /* Remove "unsafe" flag if player is not blind */
776 if (!p_ptr->blind && player_has_los_bold(y, x))
778 c_ptr->info &= ~(CAVE_UNSAFE);
789 /* Destroy Doors (and traps) */
792 /* Destroy all doors and traps */
793 if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
795 /* Check line of sight */
800 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
802 msg_print("There is a bright flash of light!");
808 /* Destroy the feature */
809 cave_alter_feat(y, x, FF_TUNNEL);
812 /* Remove "unsafe" flag if player is not blind */
813 if (!p_ptr->blind && player_has_los_bold(y, x))
815 c_ptr->info &= ~(CAVE_UNSAFE);
826 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
828 if (have_flag(f_ptr->flags, FF_SPIKE))
830 s16b old_mimic = c_ptr->mimic;
831 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
833 cave_alter_feat(y, x, FF_SPIKE);
835 c_ptr->mimic = old_mimic;
843 /* Check line of sight */
844 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
848 msg_format("%s¤Ë²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ³«¤«¤Ê¤¯¤Ê¤Ã¤¿¡£", f_name + mimic_f_ptr->name);
850 msg_format("The %s seems stuck.", f_name + mimic_f_ptr->name);
859 /* Destroy walls (and doors) */
862 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
865 if (known && (c_ptr->info & (CAVE_MARK)))
868 msg_format("%s¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª", f_name + f_info[get_feat_mimic(c_ptr)].name);
870 msg_format("The %s turns into mud!", f_name + f_info[get_feat_mimic(c_ptr)].name);
876 /* Destroy the wall */
877 cave_alter_feat(y, x, FF_HURT_ROCK);
879 /* Update some things */
880 p_ptr->update |= (PU_FLOW);
889 /* Require a "naked" floor grid */
890 if (!cave_naked_bold(y, x)) break;
892 /* Not on the player */
893 if (player_bold(y, x)) break;
895 /* Create a closed door */
896 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
899 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
916 /* Require a "naked" floor grid */
917 if (!cave_naked_bold(y, x)) break;
919 /* Not on the player */
920 if (player_bold(y, x)) break;
922 /* Create a closed door */
923 cave_set_feat(y, x, FEAT_TREES);
926 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
934 /* Require a "naked" floor grid */
935 if (!cave_naked_bold(y, x)) break;
938 c_ptr->info |= CAVE_OBJECT;
939 c_ptr->mimic = FEAT_GLYPH;
952 /* Require a "naked" floor grid */
953 if (!cave_naked_bold(y, x)) break;
955 /* Not on the player */
956 if (player_bold(y, x)) break;
959 cave_set_feat(y, x, FEAT_WALL);
967 /* Ignore permanent grid */
968 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
973 /* Ignore grid without enough space */
974 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
976 /* Place a shallow lava */
977 cave_set_feat(y, x, FEAT_SHAL_LAVA);
982 /* Place a deep lava */
983 cave_set_feat(y, x, FEAT_DEEP_LAVA);
990 /* Ignore permanent grid */
991 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
996 /* Ignore grid without enough space */
997 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
999 /* Place a shallow water */
1000 cave_set_feat(y, x, FEAT_SHAL_WATER);
1005 /* Place a deep water */
1006 cave_set_feat(y, x, FEAT_DEEP_WATER);
1011 /* Lite up the grid */
1015 /* Turn on the light */
1016 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
1018 c_ptr->info |= (CAVE_GLOW);
1026 update_local_illumination(y, x);
1029 if (player_can_see_bold(y, x)) obvious = TRUE;
1031 /* Mega-Hack -- Update the monster in the affected grid */
1032 /* This allows "spear of light" (etc) to work "correctly" */
1033 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1035 if (p_ptr->special_defense & NINJA_S_STEALTH)
1037 if (player_bold(y, x)) set_superstealth(FALSE);
1044 /* Darken the grid */
1048 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(c_ptr);
1051 /* Turn off the light. */
1054 if (dun_level || !is_daytime())
1056 for (j = 0; j < 9; j++)
1058 int by = y + ddy_ddd[j];
1059 int bx = x + ddx_ddd[j];
1061 if (in_bounds2(by, bx))
1063 cave_type *cc_ptr = &cave[by][bx];
1065 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
1073 if (!do_dark) break;
1076 c_ptr->info &= ~(CAVE_GLOW);
1078 /* Hack -- Forget "boring" grids */
1079 if (!have_flag(f_ptr->flags, FF_REMEMBER))
1082 c_ptr->info &= ~(CAVE_MARK);
1091 update_local_illumination(y, x);
1094 if (player_can_see_bold(y, x)) obvious = TRUE;
1096 /* Mega-Hack -- Update the monster in the affected grid */
1097 /* This allows "spear of light" (etc) to work "correctly" */
1098 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1108 if (is_mirror_grid(c_ptr))
1111 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1113 msg_print("The mirror was crashed!");
1115 remove_mirror(y, x);
1116 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1122 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
1125 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1127 msg_print("The mirror was crashed!");
1129 remove_mirror(y, x);
1130 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1135 case GF_DISINTEGRATE:
1137 /* Destroy mirror */
1138 if (is_mirror_grid(c_ptr)) remove_mirror(y, x);
1140 /* Permanent features don't get effect */
1141 /* But not protect monsters and other objects */
1142 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
1144 cave_alter_feat(y, x, FF_HURT_DISI);
1146 /* Update some things -- similar to GF_KILL_WALL */
1147 p_ptr->update |= (PU_FLOW);
1154 /* Return "Anything seen?" */
1161 * We are called from "project()" to "damage" objects
1163 * We are called both for "beam" effects and "ball" effects.
1165 * Perhaps we should only SOMETIMES damage things on the ground.
1167 * The "r" parameter is the "distance from ground zero".
1169 * Note that we determine if the player can "see" anything that happens
1170 * by taking into account: blindness, line-of-sight, and illumination.
1172 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1174 * We return "TRUE" if the effect of the projection is "obvious".
1176 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1178 cave_type *c_ptr = &cave[y][x];
1180 s16b this_o_idx, next_o_idx = 0;
1182 bool obvious = FALSE;
1183 bool known = player_has_los_bold(y, x);
1185 u32b flgs[TR_FLAG_SIZE];
1187 char o_name[MAX_NLEN];
1190 bool is_potion = FALSE;
1194 who = who ? who : 0;
1196 /* Reduce damage by distance */
1197 dam = (dam + r) / (r + 1);
1200 /* Scan all objects in the grid */
1201 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1203 /* Acquire object */
1204 object_type *o_ptr = &o_list[this_o_idx];
1206 bool is_art = FALSE;
1207 bool ignore = FALSE;
1208 bool do_kill = FALSE;
1210 cptr note_kill = NULL;
1213 /* Get the "plural"-ness */
1214 bool plural = (o_ptr->number > 1);
1217 /* Acquire next object */
1218 next_o_idx = o_ptr->next_o_idx;
1220 /* Extract the flags */
1221 object_flags(o_ptr, flgs);
1223 /* Check for artifact */
1224 if (object_is_artifact(o_ptr)) is_art = TRUE;
1226 /* Analyze the type */
1229 /* Acid -- Lots of things */
1232 if (hates_acid(o_ptr))
1236 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1238 note_kill = (plural ? " melt!" : " melts!");
1241 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1246 /* Elec -- Rings and Wands */
1249 if (hates_elec(o_ptr))
1253 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1255 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1258 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1263 /* Fire -- Flammable objects */
1266 if (hates_fire(o_ptr))
1270 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1272 note_kill = (plural ? " burn up!" : " burns up!");
1275 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1280 /* Cold -- potions and flasks */
1283 if (hates_cold(o_ptr))
1286 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1288 note_kill = (plural ? " shatter!" : " shatters!");
1292 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1300 if (hates_fire(o_ptr))
1304 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1306 note_kill = (plural ? " burn up!" : " burns up!");
1309 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1311 if (hates_elec(o_ptr))
1316 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1318 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1321 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1329 if (hates_fire(o_ptr))
1333 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1335 note_kill = (plural ? " burn up!" : " burns up!");
1338 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1340 if (hates_cold(o_ptr))
1345 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1347 note_kill = (plural ? " shatter!" : " shatters!");
1350 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1355 /* Hack -- break potions and such */
1361 if (hates_cold(o_ptr))
1364 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1366 note_kill = (plural ? " shatter!" : " shatters!");
1374 /* Mana and Chaos -- destroy everything */
1381 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1383 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1389 case GF_DISINTEGRATE:
1393 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1395 note_kill = (plural ? " evaporate!" : " evaporates!");
1405 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1407 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1410 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1411 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1415 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1419 if (object_is_cursed(o_ptr))
1423 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1425 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1434 identify_item(o_ptr);
1436 /* Auto-inscription */
1437 autopick_alter_item((-this_o_idx), FALSE);
1445 /* Chests are noticed only if trapped or locked */
1446 if (o_ptr->tval == TV_CHEST)
1448 /* Disarm/Unlock traps */
1449 if (o_ptr->pval > 0)
1451 /* Disarm or Unlock */
1452 o_ptr->pval = (0 - o_ptr->pval);
1455 object_known(o_ptr);
1458 if (known && (o_ptr->marked & OM_FOUND))
1461 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1463 msg_print("Click!");
1475 if (o_ptr->tval == TV_CORPSE)
1480 if (!who || is_pet(&m_list[who]))
1481 mode |= PM_FORCE_PET;
1483 for (i = 0; i < o_ptr->number ; i++)
1485 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1486 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1491 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1493 note_kill = (plural ? " become dust." : " becomes dust.");
1498 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1501 note_kill = "À¸¤Ê֤ä¿¡£";
1503 note_kill = "rivived.";
1506 else if (!note_kill)
1509 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1511 note_kill = (plural ? " become dust." : " becomes dust.");
1523 /* Attempt to destroy the object */
1526 /* Effect "observed" */
1527 if (known && (o_ptr->marked & OM_FOUND))
1530 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1533 /* Artifacts, and other objects, get to resist */
1534 if (is_art || ignore)
1536 /* Observe the resist */
1537 if (known && (o_ptr->marked & OM_FOUND))
1540 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1543 msg_format("The %s %s unaffected!",
1544 o_name, (plural ? "are" : "is"));
1553 /* Describe if needed */
1554 if (known && (o_ptr->marked & OM_FOUND) && note_kill)
1557 msg_format("%s¤Ï%s", o_name, note_kill);
1559 msg_format("The %s%s", o_name, note_kill);
1564 k_idx = o_ptr->k_idx;
1565 is_potion = object_is_potion(o_ptr);
1568 /* Delete the object */
1569 delete_object_idx(this_o_idx);
1571 /* Potions produce effects when 'shattered' */
1574 (void)potion_smash_effect(who, y, x, k_idx);
1583 /* Return "Anything seen?" */
1589 * Helper function for "project()" below.
1591 * Handle a beam/bolt/ball causing damage to a monster.
1593 * This routine takes a "source monster" (by index) which is mostly used to
1594 * determine if the player is causing the damage, and a "radius" (see below),
1595 * which is used to decrease the power of explosions with distance, and a
1596 * location, via integers which are modified by certain types of attacks
1597 * (polymorph and teleport being the obvious ones), a default damage, which
1598 * is modified as needed based on various properties, and finally a "damage
1599 * type" (see below).
1601 * Note that this routine can handle "no damage" attacks (like teleport) by
1602 * taking a "zero" damage, and can even take "parameters" to attacks (like
1603 * confuse) by accepting a "damage", using it to calculate the effect, and
1604 * then setting the damage to zero. Note that the "damage" parameter is
1605 * divided by the radius, so monsters not at the "epicenter" will not take
1606 * as much damage (or whatever)...
1608 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1609 * may result in a dereference of an invalid pointer. XXX XXX XXX
1611 * Various messages are produced, and damage is applied.
1613 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1614 * actually be "made" of that substance, or "breathe" big balls of it.
1616 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1619 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1620 * and hurts evil less. If can breath nether, then it resists it as well.
1622 * Damage reductions use the following formulas:
1623 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1624 * gives avg damage of .655, ranging from .858 to .500
1625 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1626 * gives avg damage of .544, ranging from .714 to .417
1627 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1628 * gives avg damage of .444, ranging from .556 to .333
1629 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1630 * gives avg damage of .327, ranging from .427 to .250
1631 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1632 * gives something simple.
1634 * In this function, "result" messages are postponed until the end, where
1635 * the "note" string is appended to the monster name, if not NULL. So,
1636 * to make a spell have "no effect" just set "note" to NULL. You should
1637 * also set "notice" to FALSE, or the player will learn what the spell does.
1639 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1641 /* "flg" was added. */
1642 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1646 cave_type *c_ptr = &cave[y][x];
1648 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1649 monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
1651 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1655 /* Is the monster "seen"? */
1656 bool seen = m_ptr->ml;
1657 bool seen_msg = is_seen(m_ptr);
1659 bool slept = (bool)MON_CSLEEP(m_ptr);
1661 /* Were the effects "obvious" (if seen)? */
1662 bool obvious = FALSE;
1664 /* Can the player know about this effect? */
1665 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1667 /* Can the player see the source of this effect? */
1668 bool see_s_msg = ((who <= 0) || is_seen(caster_ptr));
1670 /* Were the effects "irrelevant"? */
1671 bool skipped = FALSE;
1673 /* Gets the monster angry at the source of the effect? */
1674 bool get_angry = FALSE;
1676 /* Polymorph setting (true or false) */
1677 bool do_poly = FALSE;
1679 /* Teleport setting (max distance) */
1682 /* Confusion setting (amount to confuse) */
1685 /* Stunning setting (amount to stun) */
1688 /* Sleep amount (amount to sleep) */
1691 /* Fear amount (amount to fear) */
1694 /* Time amount (amount to time) */
1697 bool heal_leper = FALSE;
1699 /* Hold the monster name */
1708 /* Assume no note */
1711 /* Assume a default death */
1712 cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
1717 int caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1720 if (!c_ptr->m_idx) return (FALSE);
1722 /* Never affect projector */
1723 if (who && (c_ptr->m_idx == who)) return (FALSE);
1724 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1725 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1727 /* Don't affect already death monsters */
1728 /* Prevents problems with chain reactions of exploding monsters */
1729 if (m_ptr->hp < 0) return (FALSE);
1731 /* Reduce damage by distance */
1732 dam = (dam + r) / (r + 1);
1735 /* Get the monster name (BEFORE polymorphing) */
1736 monster_desc(m_name, m_ptr, 0);
1739 /* Get the monster possessive ("his"/"her"/"its") */
1740 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1744 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1746 /* Analyze the damage type */
1749 /* Magic Missile -- pure damage */
1752 if (seen) obvious = TRUE;
1754 if (r_ptr->flagsr & RFR_RES_ALL)
1757 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1759 note = " is immune.";
1762 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1771 if (seen) obvious = TRUE;
1773 if (r_ptr->flagsr & RFR_RES_ALL)
1776 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1778 note = " is immune.";
1781 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1784 if (r_ptr->flagsr & RFR_IM_ACID)
1787 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1789 note = " resists a lot.";
1793 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1801 if (seen) obvious = TRUE;
1803 if (r_ptr->flagsr & RFR_RES_ALL)
1806 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1808 note = " is immune.";
1811 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1814 if (r_ptr->flagsr & RFR_IM_ELEC)
1817 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1819 note = " resists a lot.";
1823 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1831 if (seen) obvious = TRUE;
1833 if (r_ptr->flagsr & RFR_RES_ALL)
1836 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1838 note = " is immune.";
1841 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1844 if (r_ptr->flagsr & RFR_IM_FIRE)
1847 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1849 note = " resists a lot.";
1853 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1855 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1858 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1860 note = " is hit hard.";
1864 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1872 if (seen) obvious = TRUE;
1874 if (r_ptr->flagsr & RFR_RES_ALL)
1877 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1879 note = " is immune.";
1882 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1885 if (r_ptr->flagsr & RFR_IM_COLD)
1888 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1890 note = " resists a lot.";
1894 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1896 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1899 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1901 note = " is hit hard.";
1905 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1913 if (seen) obvious = TRUE;
1915 if (r_ptr->flagsr & RFR_RES_ALL)
1918 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1920 note = " is immune.";
1923 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1926 if (r_ptr->flagsr & RFR_IM_POIS)
1929 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1931 note = " resists a lot.";
1935 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1943 if (seen) obvious = TRUE;
1945 if (r_ptr->flagsr & RFR_RES_ALL)
1948 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1950 note = " is immune.";
1953 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1956 if (r_ptr->flagsr & RFR_IM_POIS)
1959 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
1964 dam *= 3; dam /= randint1(6) + 6;
1965 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1967 else if (one_in_(3)) do_poly = TRUE;
1971 /* Hellfire -- hurts Evil */
1974 if (seen) obvious = TRUE;
1976 if (r_ptr->flagsr & RFR_RES_ALL)
1979 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1981 note = " is immune.";
1984 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1987 if (r_ptr->flags3 & RF3_GOOD)
1991 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
1993 note = " is hit hard.";
1996 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
2001 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2004 if (seen) obvious = TRUE;
2006 if (r_ptr->flagsr & RFR_RES_ALL)
2009 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2011 note = " is immune.";
2014 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2017 if (r_ptr->flags3 & RF3_GOOD)
2021 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2023 note = " is immune.";
2026 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
2028 else if (r_ptr->flags3 & RF3_EVIL)
2032 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2034 note = " is hit hard.";
2037 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
2042 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2047 dam *= 3; dam /= randint1(6) + 6;
2052 /* Arrow -- XXX no defense */
2055 if (seen) obvious = TRUE;
2057 if (r_ptr->flagsr & RFR_RES_ALL)
2060 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2062 note = " is immune.";
2065 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2071 /* Plasma -- XXX perhaps check ELEC or FIRE */
2074 if (seen) obvious = TRUE;
2076 if (r_ptr->flagsr & RFR_RES_ALL)
2079 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2081 note = " is immune.";
2084 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2087 if (r_ptr->flagsr & RFR_RES_PLAS)
2090 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2095 dam *= 3; dam /= randint1(6) + 6;
2096 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
2101 /* Nether -- see above */
2104 if (seen) obvious = TRUE;
2106 if (r_ptr->flagsr & RFR_RES_ALL)
2109 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2111 note = " is immune.";
2114 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2117 if (r_ptr->flagsr & RFR_RES_NETH)
2119 if (r_ptr->flags3 & RF3_UNDEAD)
2122 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2124 note = " is immune.";
2128 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2133 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2138 dam *= 3; dam /= randint1(6) + 6;
2140 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
2142 else if (r_ptr->flags3 & RF3_EVIL)
2146 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2148 note = " resists somewhat.";
2151 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2156 /* Water (acid) damage -- Water spirits/elementals are immune */
2159 if (seen) obvious = TRUE;
2161 if (r_ptr->flagsr & RFR_RES_ALL)
2164 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2166 note = " is immune.";
2169 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2172 if (r_ptr->flagsr & RFR_RES_WATE)
2174 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
2177 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2179 note = " is immune.";
2187 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2192 dam *= 3; dam /= randint1(6) + 6;
2194 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
2199 /* Chaos -- Chaos breathers resist */
2202 if (seen) obvious = TRUE;
2204 if (r_ptr->flagsr & RFR_RES_ALL)
2207 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2209 note = " is immune.";
2212 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2215 if (r_ptr->flagsr & RFR_RES_CHAO)
2218 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2223 dam *= 3; dam /= randint1(6) + 6;
2224 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
2226 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
2229 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2231 note = " resists somewhat.";
2234 dam *= 3; dam /= randint1(6) + 6;
2235 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2240 do_conf = (5 + randint1(11) + r) / (r + 1);
2245 /* Shards -- Shard breathers resist */
2248 if (seen) obvious = TRUE;
2250 if (r_ptr->flagsr & RFR_RES_ALL)
2253 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2255 note = " is immune.";
2258 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2261 if (r_ptr->flagsr & RFR_RES_SHAR)
2264 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2269 dam *= 3; dam /= randint1(6) + 6;
2270 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2275 /* Rocket: Shard resistance helps */
2278 if (seen) obvious = TRUE;
2280 if (r_ptr->flagsr & RFR_RES_ALL)
2283 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2285 note = " is immune.";
2288 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2291 if (r_ptr->flagsr & RFR_RES_SHAR)
2294 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2296 note = " resists somewhat.";
2300 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2306 /* Sound -- Sound breathers resist */
2309 if (seen) obvious = TRUE;
2311 if (r_ptr->flagsr & RFR_RES_ALL)
2314 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2316 note = " is immune.";
2319 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2322 if (r_ptr->flagsr & RFR_RES_SOUN)
2325 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2330 dam *= 2; dam /= randint1(6) + 6;
2331 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
2333 else do_stun = (10 + randint1(15) + r) / (r + 1);
2340 if (seen) obvious = TRUE;
2342 if (r_ptr->flagsr & RFR_RES_ALL)
2345 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2347 note = " is immune.";
2350 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2353 if (r_ptr->flags3 & RF3_NO_CONF)
2356 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2361 dam *= 3; dam /= randint1(6) + 6;
2362 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2364 else do_conf = (10 + randint1(15) + r) / (r + 1);
2368 /* Disenchantment -- Breathers and Disenchanters resist */
2371 if (seen) obvious = TRUE;
2373 if (r_ptr->flagsr & RFR_RES_ALL)
2376 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2378 note = " is immune.";
2381 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2384 if (r_ptr->flagsr & RFR_RES_DISE)
2387 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2392 dam *= 3; dam /= randint1(6) + 6;
2393 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
2398 /* Nexus -- Breathers and Existers resist */
2401 if (seen) obvious = TRUE;
2403 if (r_ptr->flagsr & RFR_RES_ALL)
2406 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2408 note = " is immune.";
2411 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2414 if (r_ptr->flagsr & RFR_RES_NEXU)
2417 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2422 dam *= 3; dam /= randint1(6) + 6;
2423 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
2431 if (seen) obvious = TRUE;
2433 if (r_ptr->flagsr & RFR_RES_ALL)
2436 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2438 note = " is immune.";
2441 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2444 if (r_ptr->flagsr & RFR_RES_WALL)
2447 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2452 dam *= 3; dam /= randint1(6) + 6;
2453 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
2455 else do_stun = (randint1(15) + r) / (r + 1);
2459 /* Inertia -- breathers resist */
2462 if (seen) obvious = TRUE;
2464 if (r_ptr->flagsr & RFR_RES_ALL)
2467 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2469 note = " is immune.";
2472 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2475 if (r_ptr->flagsr & RFR_RES_INER)
2478 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2483 dam *= 3; dam /= randint1(6) + 6;
2484 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
2488 /* Powerful monsters can resist */
2489 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2490 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2494 /* Normal monsters slow down */
2497 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2500 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2502 note = " starts moving slower.";
2510 /* Time -- breathers resist */
2513 if (seen) obvious = TRUE;
2515 if (r_ptr->flagsr & RFR_RES_ALL)
2518 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2520 note = " is immune.";
2523 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2526 if (r_ptr->flagsr & RFR_RES_TIME)
2529 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2534 dam *= 3; dam /= randint1(6) + 6;
2535 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
2537 else do_time = (dam + 1) / 2;
2541 /* Gravity -- breathers resist */
2544 bool resist_tele = FALSE;
2546 if (seen) obvious = TRUE;
2548 if (r_ptr->flagsr & RFR_RES_ALL)
2551 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2553 note = " is immune.";
2556 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2559 if (r_ptr->flagsr & RFR_RES_TELE)
2561 if (r_ptr->flags1 & (RF1_UNIQUE))
2563 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2565 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2567 note = " is unaffected!";
2572 else if (r_ptr->level > randint1(100))
2574 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2576 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2585 if (!resist_tele) do_dist = 10;
2587 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2589 if (r_ptr->flagsr & RFR_RES_GRAV)
2592 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2597 dam *= 3; dam /= randint1(6) + 6;
2599 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
2604 /* Powerful monsters can resist */
2605 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2606 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2610 /* Normal monsters slow down */
2613 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2616 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2618 note = " starts moving slower.";
2624 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2626 /* Attempt a saving throw */
2627 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2628 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2632 /* No obvious effect */
2634 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2636 note = " is unaffected!";
2650 if (seen) obvious = TRUE;
2652 if (r_ptr->flagsr & RFR_RES_ALL)
2655 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2657 note = " is immune.";
2660 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2668 case GF_DISINTEGRATE:
2670 if (seen) obvious = TRUE;
2672 if (r_ptr->flagsr & RFR_RES_ALL)
2675 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2677 note = " is immune.";
2680 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2683 if (r_ptr->flags3 & RF3_HURT_ROCK)
2685 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2687 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2688 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2690 note = " loses some skin!";
2691 note_dies = " evaporates!";
2701 if (seen) obvious = TRUE;
2703 /* PSI only works if the monster can see you! -- RG */
2704 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2707 if (seen_msg) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name);
2709 if (seen_msg) msg_format("%^s can't see you, and isn't affected!", m_name);
2715 if (r_ptr->flagsr & RFR_RES_ALL)
2718 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2720 note = " is immune.";
2723 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2726 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2730 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2732 note = " is immune!";
2734 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2737 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2738 (r_ptr->flags3 & RF3_ANIMAL) ||
2739 (r_ptr->level > randint1(3 * dam)))
2743 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2750 * Powerful demons & undead can turn a mindcrafter's
2751 * attacks back on them
2753 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2754 (r_ptr->level > p_ptr->lev / 2) &&
2759 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2761 msg_format("%^s%s corrupted mind backlashes your attack!",
2762 m_name, (seen ? "'s" : "s"));
2766 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2769 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2771 msg_print("You resist the effects!");
2777 /* Injure +/- confusion */
2778 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2779 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2782 switch (randint1(4))
2785 set_confused(p_ptr->confused + 3 + randint1(dam));
2788 set_stun(p_ptr->stun + randint1(dam));
2792 if (r_ptr->flags3 & RF3_NO_FEAR)
2794 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2796 note = " is unaffected.";
2800 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2804 if (!p_ptr->free_act)
2805 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2814 if ((dam > 0) && one_in_(4))
2816 switch (randint1(4))
2819 do_conf = 3 + randint1(dam);
2822 do_stun = 3 + randint1(dam);
2825 do_fear = 3 + randint1(dam);
2829 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2831 note = " falls asleep!";
2834 do_sleep = 3 + randint1(dam);
2840 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2842 note_dies = " collapses, a mindless husk.";
2850 if (seen) obvious = TRUE;
2852 if (r_ptr->flagsr & RFR_RES_ALL)
2855 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2857 note = " is immune.";
2860 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2863 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2867 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2869 note = " is immune!";
2873 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2874 (r_ptr->flags3 & RF3_ANIMAL) ||
2875 (r_ptr->level > randint1(3 * dam)))
2879 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2886 * Powerful demons & undead can turn a mindcrafter's
2887 * attacks back on them
2889 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2890 (r_ptr->level > p_ptr->lev / 2) &&
2895 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2897 msg_format("%^s%s corrupted mind backlashes your attack!",
2898 m_name, (seen ? "'s" : "s"));
2902 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2905 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2907 msg_print("You resist the effects!");
2913 /* Injure + mana drain */
2914 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2916 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
2918 msg_print("Your psychic energy is drained!");
2921 p_ptr->csp -= damroll(5, dam) / 2;
2922 if (p_ptr->csp < 0) p_ptr->csp = 0;
2923 p_ptr->redraw |= PR_MANA;
2924 p_ptr->window |= (PW_SPELL);
2925 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2932 int b = damroll(5, dam) / 4;
2934 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª", m_name);
2936 msg_format("You convert %s%s pain into psychic energy!",
2937 m_name, (seen ? "'s" : "s"));
2940 b = MIN(p_ptr->msp, p_ptr->csp + b);
2942 p_ptr->redraw |= PR_MANA;
2943 p_ptr->window |= (PW_SPELL);
2947 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2949 note_dies = " collapses, a mindless husk.";
2955 case GF_TELEKINESIS:
2957 if (seen) obvious = TRUE;
2959 if (r_ptr->flagsr & RFR_RES_ALL)
2962 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2964 note = " is immune.";
2967 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2972 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2977 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2979 /* Attempt a saving throw */
2980 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2981 (r_ptr->level > 5 + randint1(dam)))
2985 /* No obvious effect */
2991 /* Psycho-spear -- powerful magic missile */
2994 if (seen) obvious = TRUE;
2996 if (r_ptr->flagsr & RFR_RES_ALL)
2999 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3001 note = " is immune.";
3004 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3010 /* Meteor -- powerful magic missile */
3013 if (seen) obvious = TRUE;
3015 if (r_ptr->flagsr & RFR_RES_ALL)
3018 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3020 note = " is immune.";
3023 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3031 if (!is_hostile(m_ptr)) break;
3033 if (seen) obvious = TRUE;
3035 if (r_ptr->flagsr & RFR_RES_ALL)
3038 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3040 note = " is immune.";
3043 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3046 /* Attempt a saving throw */
3047 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
3048 (r_ptr->flags3 & RF3_NO_CONF) ||
3049 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3051 /* Memorize a flag */
3052 if (r_ptr->flags3 & RF3_NO_CONF)
3054 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3061 * Powerful demons & undead can turn a mindcrafter's
3062 * attacks back on them
3064 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
3065 (r_ptr->level > p_ptr->lev / 2) &&
3070 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
3072 msg_format("%^s%s corrupted mind backlashes your attack!",
3073 m_name, (seen ? "'s" : "s"));
3077 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3080 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3082 msg_print("You resist the effects!");
3088 /* Confuse, stun, terrify */
3089 switch (randint1(4))
3092 set_stun(p_ptr->stun + dam / 2);
3095 set_confused(p_ptr->confused + dam / 2);
3099 if (r_ptr->flags3 & RF3_NO_FEAR)
3101 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3103 note = " is unaffected.";
3107 set_afraid(p_ptr->afraid + dam);
3114 /* No obvious effect */
3116 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3118 note = " is unaffected!";
3126 if ((dam > 29) && (randint1(100) < dam))
3129 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3131 note = " is in your thrall!";
3138 switch (randint1(4))
3152 /* No "real" damage */
3159 /* Ice -- Cold + Cuts + Stun */
3162 if (seen) obvious = TRUE;
3164 if (r_ptr->flagsr & RFR_RES_ALL)
3167 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3169 note = " is immune.";
3172 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3175 do_stun = (randint1(15) + 1) / (r + 1);
3176 if (r_ptr->flagsr & RFR_IM_COLD)
3179 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3181 note = " resists a lot.";
3185 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
3187 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3190 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3192 note = " is hit hard.";
3196 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3205 if (seen) obvious = TRUE;
3207 if (r_ptr->flagsr & RFR_RES_ALL)
3210 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3212 note = " is immune.";
3215 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3218 if (!monster_living(r_ptr))
3220 if (is_original_ap_and_seen(m_ptr))
3222 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3223 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3224 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3228 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3230 note = " is unaffected!";
3236 else do_time = (dam+7)/8;
3244 if (seen) obvious = TRUE;
3246 if (r_ptr->flagsr & RFR_RES_ALL)
3249 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3251 note = " is immune.";
3254 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3257 if (!monster_living(r_ptr))
3259 if (is_original_ap_and_seen(m_ptr))
3261 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3262 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3263 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3267 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3269 note = " is immune.";
3275 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3276 (randint1(888) != 666)) ||
3277 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
3278 randint1(100) != 66))
3281 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3293 /* Polymorph monster (Use "dam" as "power") */
3296 if (seen) obvious = TRUE;
3298 if (r_ptr->flagsr & RFR_RES_ALL)
3301 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3303 note = " is immune.";
3306 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3309 /* Attempt to polymorph (see below) */
3312 /* Powerful monsters can resist */
3313 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3314 (r_ptr->flags1 & RF1_QUESTOR) ||
3315 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3318 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3320 note = " is unaffected!";
3327 /* No "real" damage */
3334 /* Clone monsters (Ignore "dam") */
3337 if (seen) obvious = TRUE;
3339 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
3342 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3344 note = " is unaffected!";
3350 m_ptr->hp = m_ptr->maxhp;
3352 /* Attempt to clone. */
3353 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3356 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3364 /* No "real" damage */
3371 /* Heal Monster (use "dam" as amount of healing) */
3374 if (seen) obvious = TRUE;
3377 (void)set_monster_csleep(c_ptr->m_idx, 0);
3379 if (m_ptr->maxhp < m_ptr->max_maxhp)
3382 if (seen_msg) msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3384 if (seen_msg) msg_format("%^s recovers %s vitality.", m_name, m_poss);
3386 m_ptr->maxhp = m_ptr->max_maxhp;
3391 /* Redraw (later) if needed */
3392 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3393 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3401 if (seen) obvious = TRUE;
3404 (void)set_monster_csleep(c_ptr->m_idx, 0);
3405 if (MON_STUNNED(m_ptr))
3408 if (seen_msg) msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3410 if (seen_msg) msg_format("%^s is no longer stunned.", m_name);
3412 (void)set_monster_stunned(c_ptr->m_idx, 0);
3414 if (MON_CONFUSED(m_ptr))
3417 if (seen_msg) msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3419 if (seen_msg) msg_format("%^s is no longer confused.", m_name);
3421 (void)set_monster_confused(c_ptr->m_idx, 0);
3423 if (MON_MONFEAR(m_ptr))
3426 if (seen_msg) msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3428 if (seen_msg) msg_format("%^s recovers %s courage.", m_name, m_poss);
3430 (void)set_monster_monfear(c_ptr->m_idx, 0);
3434 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3437 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3441 chg_virtue(V_VITALITY, 1);
3443 if (r_ptr->flags1 & RF1_UNIQUE)
3444 chg_virtue(V_INDIVIDUALISM, 1);
3446 if (is_friendly(m_ptr))
3447 chg_virtue(V_HONOUR, 1);
3448 else if (!(r_ptr->flags3 & RF3_EVIL))
3450 if (r_ptr->flags3 & RF3_GOOD)
3451 chg_virtue(V_COMPASSION, 2);
3453 chg_virtue(V_COMPASSION, 1);
3456 if (r_ptr->flags3 & RF3_ANIMAL)
3457 chg_virtue(V_NATURE, 1);
3460 if (m_ptr->r_idx == MON_LEPER)
3463 if (!who) chg_virtue(V_COMPASSION, 5);
3466 /* Redraw (later) if needed */
3467 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3468 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3472 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3474 note = " looks healthier.";
3477 /* No "real" damage */
3483 /* Speed Monster (Ignore "dam") */
3486 if (seen) obvious = TRUE;
3489 if (set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100))
3492 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3494 note = " starts moving faster.";
3500 if (r_ptr->flags1 & RF1_UNIQUE)
3501 chg_virtue(V_INDIVIDUALISM, 1);
3502 if (is_friendly(m_ptr))
3503 chg_virtue(V_HONOUR, 1);
3506 /* No "real" damage */
3512 /* Slow Monster (Use "dam" as "power") */
3515 if (seen) obvious = TRUE;
3517 if (r_ptr->flagsr & RFR_RES_ALL)
3520 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3522 note = " is immune.";
3525 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3528 /* Powerful monsters can resist */
3529 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3530 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3533 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3535 note = " is unaffected!";
3541 /* Normal monsters slow down */
3544 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
3547 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3549 note = " starts moving slower.";
3554 /* No "real" damage */
3560 /* Sleep (Use "dam" as "power") */
3563 if (seen) obvious = TRUE;
3565 if (r_ptr->flagsr & RFR_RES_ALL)
3568 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3570 note = " is immune.";
3573 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3576 /* Attempt a saving throw */
3577 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3578 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3579 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3581 /* Memorize a flag */
3582 if (r_ptr->flags3 & RF3_NO_SLEEP)
3584 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3587 /* No obvious effect */
3589 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3591 note = " is unaffected!";
3598 /* Go to sleep (much) later */
3600 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3602 note = " falls asleep!";
3608 /* No "real" damage */
3614 /* Sleep (Use "dam" as "power") */
3615 case GF_STASIS_EVIL:
3617 if (seen) obvious = TRUE;
3619 if (r_ptr->flagsr & RFR_RES_ALL)
3622 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3624 note = " is immune.";
3627 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3630 /* Attempt a saving throw */
3631 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3632 !(r_ptr->flags3 & RF3_EVIL) ||
3633 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3636 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3638 note = " is unaffected!";
3645 /* Go to sleep (much) later */
3647 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3649 note = " is suspended!";
3655 /* No "real" damage */
3660 /* Sleep (Use "dam" as "power") */
3663 if (seen) obvious = TRUE;
3665 if (r_ptr->flagsr & RFR_RES_ALL)
3668 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3670 note = " is immune.";
3673 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3676 /* Attempt a saving throw */
3677 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3678 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3681 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3683 note = " is unaffected!";
3690 /* Go to sleep (much) later */
3692 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3694 note = " is suspended!";
3700 /* No "real" damage */
3709 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3710 vir = virtue_number(V_HARMONY);
3713 dam += p_ptr->virtues[vir-1]/10;
3716 vir = virtue_number(V_INDIVIDUALISM);
3719 dam -= p_ptr->virtues[vir-1]/20;
3722 if (seen) obvious = TRUE;
3724 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3727 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3729 note = " is immune.";
3732 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3736 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3739 /* Attempt a saving throw */
3740 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3741 (r_ptr->flags3 & RF3_NO_CONF) ||
3742 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3743 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3745 /* Memorize a flag */
3746 if (r_ptr->flags3 & RF3_NO_CONF)
3748 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3752 /* No obvious effect */
3754 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3756 note = " is unaffected!";
3761 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3763 else if (p_ptr->cursed & TRC_AGGRAVATE)
3766 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3768 note = " hates you too much!";
3771 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3776 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3778 note = " suddenly seems friendly!";
3783 chg_virtue(V_INDIVIDUALISM, -1);
3784 if (r_ptr->flags3 & RF3_ANIMAL)
3785 chg_virtue(V_NATURE, 1);
3788 /* No "real" damage */
3793 /* Control undead */
3794 case GF_CONTROL_UNDEAD:
3797 if (seen) obvious = TRUE;
3799 vir = virtue_number(V_UNLIFE);
3802 dam += p_ptr->virtues[vir-1]/10;
3805 vir = virtue_number(V_INDIVIDUALISM);
3808 dam -= p_ptr->virtues[vir-1]/20;
3811 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3814 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3816 note = " is immune.";
3819 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3823 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3826 /* Attempt a saving throw */
3827 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3828 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3829 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3830 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3832 /* No obvious effect */
3834 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3836 note = " is unaffected!";
3840 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3842 else if (p_ptr->cursed & TRC_AGGRAVATE)
3845 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3847 note = " hates you too much!";
3850 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3855 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3857 note = " is in your thrall!";
3863 /* No "real" damage */
3869 case GF_CONTROL_DEMON:
3872 if (seen) obvious = TRUE;
3874 vir = virtue_number(V_UNLIFE);
3877 dam += p_ptr->virtues[vir-1]/10;
3880 vir = virtue_number(V_INDIVIDUALISM);
3883 dam -= p_ptr->virtues[vir-1]/20;
3886 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3889 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3891 note = " is immune.";
3894 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3898 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3901 /* Attempt a saving throw */
3902 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3903 (!(r_ptr->flags3 & RF3_DEMON)) ||
3904 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3905 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3907 /* No obvious effect */
3909 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3911 note = " is unaffected!";
3915 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3917 else if (p_ptr->cursed & TRC_AGGRAVATE)
3920 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3922 note = " hates you too much!";
3925 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3930 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3932 note = " is in your thrall!";
3938 /* No "real" damage */
3944 case GF_CONTROL_ANIMAL:
3948 if (seen) obvious = TRUE;
3950 vir = virtue_number(V_NATURE);
3953 dam += p_ptr->virtues[vir-1]/10;
3956 vir = virtue_number(V_INDIVIDUALISM);
3959 dam -= p_ptr->virtues[vir-1]/20;
3962 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3965 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3967 note = " is immune.";
3970 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3974 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3977 /* Attempt a saving throw */
3978 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3979 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
3980 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3981 (r_ptr->flags3 & (RF3_NO_CONF)) ||
3982 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3984 /* Memorize a flag */
3985 if (r_ptr->flags3 & (RF3_NO_CONF))
3987 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3991 /* No obvious effect */
3993 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3995 note = " is unaffected!";
3999 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4001 else if (p_ptr->cursed & TRC_AGGRAVATE)
4004 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4006 note = " hates you too much!";
4009 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4014 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4016 note = " is tamed!";
4021 if (r_ptr->flags3 & RF3_ANIMAL)
4022 chg_virtue(V_NATURE, 1);
4025 /* No "real" damage */
4031 case GF_CONTROL_LIVING:
4035 vir = virtue_number(V_UNLIFE);
4036 if (seen) obvious = TRUE;
4038 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4039 vir = virtue_number(V_UNLIFE);
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->flags3 & (RF3_NO_CONF)) dam -= 30;
4052 if (dam < 1) dam = 1;
4054 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4056 msg_format("You stare into %s.", m_name);
4058 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4061 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4063 note = " is immune.";
4066 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4070 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4073 /* Attempt a saving throw */
4074 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4075 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4076 !monster_living(r_ptr) ||
4077 ((r_ptr->level+10) > randint1(dam)))
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 */
4119 /* Confusion (Use "dam" as "power") */
4122 if (seen) obvious = TRUE;
4124 if (r_ptr->flagsr & RFR_RES_ALL)
4127 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4129 note = " is immune.";
4132 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4135 /* Get confused later */
4136 do_conf = damroll(3, (dam / 2)) + 1;
4138 /* Attempt a saving throw */
4139 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4140 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4141 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4143 /* Memorize a flag */
4144 if (r_ptr->flags3 & (RF3_NO_CONF))
4146 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4152 /* No obvious effect */
4154 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4156 note = " is unaffected!";
4162 /* No "real" damage */
4169 if (seen) obvious = TRUE;
4171 if (r_ptr->flagsr & RFR_RES_ALL)
4174 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4176 note = " is immune.";
4179 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4182 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
4184 /* Attempt a saving throw */
4185 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4186 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4191 /* No obvious effect */
4193 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4195 note = " is unaffected!";
4201 /* No "real" damage */
4209 /* Lite, but only hurts susceptible creatures */
4217 if (r_ptr->flagsr & RFR_RES_ALL)
4223 if (r_ptr->flags3 & (RF3_HURT_LITE))
4225 /* Obvious effect */
4226 if (seen) obvious = TRUE;
4228 /* Memorize the effects */
4229 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4231 /* Special effect */
4233 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4234 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4236 note = " cringes from the light!";
4237 note_dies = " shrivels away in the light!";
4242 /* Normally no damage */
4254 /* Lite -- opposite of Dark */
4257 if (seen) obvious = TRUE;
4259 if (r_ptr->flagsr & RFR_RES_ALL)
4262 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4264 note = " is immune.";
4267 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4270 if (r_ptr->flagsr & RFR_RES_LITE)
4273 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4278 dam *= 2; dam /= (randint1(6)+6);
4279 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4281 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4283 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4285 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4286 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4288 note = " cringes from the light!";
4289 note_dies = " shrivels away in the light!";
4298 /* Dark -- opposite of Lite */
4301 if (seen) obvious = TRUE;
4303 if (r_ptr->flagsr & RFR_RES_ALL)
4306 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4308 note = " is immune.";
4311 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4314 if (r_ptr->flagsr & RFR_RES_DARK)
4317 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4322 dam *= 2; dam /= (randint1(6)+6);
4323 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4332 if (r_ptr->flagsr & RFR_RES_ALL)
4337 /* Hurt by rock remover */
4338 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4341 if (seen) obvious = TRUE;
4343 /* Memorize the effects */
4344 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4346 /* Cute little message */
4348 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4349 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4351 note = " loses some skin!";
4352 note_dies = " dissolves!";
4357 /* Usually, ignore the effects */
4368 /* Teleport undead (Use "dam" as "power") */
4369 case GF_AWAY_UNDEAD:
4371 /* Only affect undead */
4372 if (r_ptr->flags3 & (RF3_UNDEAD))
4374 bool resists_tele = FALSE;
4376 if (r_ptr->flagsr & RFR_RES_TELE)
4378 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4380 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4382 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4384 note = " is unaffected!";
4387 resists_tele = TRUE;
4389 else if (r_ptr->level > randint1(100))
4391 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4393 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4398 resists_tele = TRUE;
4404 if (seen) obvious = TRUE;
4405 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4417 /* No "real" damage */
4423 /* Teleport evil (Use "dam" as "power") */
4426 /* Only affect evil */
4427 if (r_ptr->flags3 & (RF3_EVIL))
4429 bool resists_tele = FALSE;
4431 if (r_ptr->flagsr & RFR_RES_TELE)
4433 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4435 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4437 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4439 note = " is unaffected!";
4442 resists_tele = TRUE;
4444 else if (r_ptr->level > randint1(100))
4446 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4448 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4453 resists_tele = TRUE;
4459 if (seen) obvious = TRUE;
4460 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4472 /* No "real" damage */
4478 /* Teleport monster (Use "dam" as "power") */
4481 bool resists_tele = FALSE;
4482 if (r_ptr->flagsr & RFR_RES_TELE)
4484 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4486 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4488 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4490 note = " is unaffected!";
4493 resists_tele = TRUE;
4495 else if (r_ptr->level > randint1(100))
4497 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4499 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4504 resists_tele = TRUE;
4511 if (seen) obvious = TRUE;
4513 /* Prepare to teleport */
4517 /* No "real" damage */
4523 /* Turn undead (Use "dam" as "power") */
4524 case GF_TURN_UNDEAD:
4526 if (r_ptr->flagsr & RFR_RES_ALL)
4531 /* Only affect undead */
4532 if (r_ptr->flags3 & (RF3_UNDEAD))
4535 if (seen) obvious = TRUE;
4537 /* Learn about type */
4538 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4540 /* Apply some fear */
4541 do_fear = damroll(3, (dam / 2)) + 1;
4543 /* Attempt a saving throw */
4544 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4546 /* No obvious effect */
4548 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4550 note = " is unaffected!";
4565 /* No "real" damage */
4571 /* Turn evil (Use "dam" as "power") */
4574 if (r_ptr->flagsr & RFR_RES_ALL)
4579 /* Only affect evil */
4580 if (r_ptr->flags3 & (RF3_EVIL))
4583 if (seen) obvious = TRUE;
4585 /* Learn about type */
4586 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4588 /* Apply some fear */
4589 do_fear = damroll(3, (dam / 2)) + 1;
4591 /* Attempt a saving throw */
4592 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4594 /* No obvious effect */
4596 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4598 note = " is unaffected!";
4613 /* No "real" damage */
4619 /* Turn monster (Use "dam" as "power") */
4622 if (r_ptr->flagsr & RFR_RES_ALL)
4628 if (seen) obvious = TRUE;
4630 /* Apply some fear */
4631 do_fear = damroll(3, (dam / 2)) + 1;
4633 /* Attempt a saving throw */
4634 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4635 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4636 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4638 /* No obvious effect */
4640 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4642 note = " is unaffected!";
4649 /* No "real" damage */
4656 case GF_DISP_UNDEAD:
4658 if (r_ptr->flagsr & RFR_RES_ALL)
4664 /* Only affect undead */
4665 if (r_ptr->flags3 & (RF3_UNDEAD))
4668 if (seen) obvious = TRUE;
4670 /* Learn about type */
4671 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4675 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4676 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4678 note = " shudders.";
4679 note_dies = " dissolves!";
4700 if (r_ptr->flagsr & RFR_RES_ALL)
4706 /* Only affect evil */
4707 if (r_ptr->flags3 & (RF3_EVIL))
4710 if (seen) obvious = TRUE;
4712 /* Learn about type */
4713 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4717 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4718 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4720 note = " shudders.";
4721 note_dies = " dissolves!";
4741 if (r_ptr->flagsr & RFR_RES_ALL)
4747 /* Only affect good */
4748 if (r_ptr->flags3 & (RF3_GOOD))
4751 if (seen) obvious = TRUE;
4753 /* Learn about type */
4754 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4758 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4759 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4761 note = " shudders.";
4762 note_dies = " dissolves!";
4780 case GF_DISP_LIVING:
4782 if (r_ptr->flagsr & RFR_RES_ALL)
4788 /* Only affect non-undead */
4789 if (monster_living(r_ptr))
4792 if (seen) obvious = TRUE;
4796 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4797 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4799 note = " shudders.";
4800 note_dies = " dissolves!";
4821 if (r_ptr->flagsr & RFR_RES_ALL)
4827 /* Only affect demons */
4828 if (r_ptr->flags3 & (RF3_DEMON))
4831 if (seen) obvious = TRUE;
4833 /* Learn about type */
4834 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4838 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4839 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4841 note = " shudders.";
4842 note_dies = " dissolves!";
4859 /* Dispel monster */
4862 if (r_ptr->flagsr & RFR_RES_ALL)
4869 if (seen) obvious = TRUE;
4873 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4874 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4876 note = " shudders.";
4877 note_dies = " dissolves!";
4887 if (seen) obvious = TRUE;
4889 if (r_ptr->flagsr & RFR_RES_ALL)
4892 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4894 note = " is immune.";
4897 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4901 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4905 /* Heal the monster */
4906 if (caster_ptr->hp < caster_ptr->maxhp)
4909 caster_ptr->hp += 6 * dam;
4910 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
4912 /* Redraw (later) if needed */
4913 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4914 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4916 /* Special message */
4919 /* Get the monster name */
4920 monster_desc(killer, caster_ptr, 0);
4922 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", killer);
4924 msg_format("%^s appears healthier.", killer);
4933 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£", m_name);
4935 msg_format("You draw psychic energy from %s.", m_name);
4938 (void)hp_player(dam);
4944 if (see_s_msg) msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
4946 if (see_s_msg) msg_format("%s is unaffected.", m_name);
4956 if (seen) obvious = TRUE;
4959 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
4961 if (!who) msg_format("You gaze intently at %s.", m_name);
4964 if (r_ptr->flagsr & RFR_RES_ALL)
4967 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4969 note = " is immune.";
4972 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4976 /* Attempt a saving throw */
4977 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4978 (r_ptr->flags3 & RF3_NO_CONF) ||
4979 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
4981 /* Memorize a flag */
4982 if (r_ptr->flags3 & (RF3_NO_CONF))
4984 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4987 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
4989 note = "is unaffected!";
4993 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
4995 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
4997 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4999 note = " is immune!";
5003 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5005 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5007 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5016 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5017 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5019 note = " is blasted by psionic energy.";
5020 note_dies = " collapses, a mindless husk.";
5023 if (who > 0) do_conf = randint0(4) + 4;
5024 else do_conf = randint0(8) + 8;
5030 case GF_BRAIN_SMASH:
5032 if (seen) obvious = TRUE;
5035 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5037 if (!who) msg_format("You gaze intently at %s.", m_name);
5040 if (r_ptr->flagsr & RFR_RES_ALL)
5043 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5045 note = " is immune.";
5048 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5052 /* Attempt a saving throw */
5053 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5054 (r_ptr->flags3 & RF3_NO_CONF) ||
5055 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5057 /* Memorize a flag */
5058 if (r_ptr->flags3 & (RF3_NO_CONF))
5060 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5063 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5065 note = "is unaffected!";
5069 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5071 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5073 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5075 note = " is immune!";
5079 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5081 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5083 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5092 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5093 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5095 note = " is blasted by psionic energy.";
5096 note_dies = " collapses, a mindless husk.";
5101 do_conf = randint0(4) + 4;
5102 do_stun = randint0(4) + 4;
5106 do_conf = randint0(8) + 8;
5107 do_stun = randint0(8) + 8;
5109 (void)set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 10);
5117 if (seen) obvious = TRUE;
5120 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5122 if (!who) msg_format("You point at %s and curses.", m_name);
5125 if (r_ptr->flagsr & RFR_RES_ALL)
5128 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5130 note = " is immune.";
5133 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5137 /* Attempt a saving throw */
5138 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5141 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5143 note = "is unaffected!";
5153 if (seen) obvious = TRUE;
5156 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5158 if (!who) msg_format("You point at %s and curses horribly.", m_name);
5161 if (r_ptr->flagsr & RFR_RES_ALL)
5164 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5166 note = " is immune.";
5169 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5173 /* Attempt a saving throw */
5174 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5177 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5179 note = "is unaffected!";
5189 if (seen) obvious = TRUE;
5192 if (!who) msg_format("%s¤ò»Øº¹¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
5194 if (!who) msg_format("You point at %s, incanting terribly!", m_name);
5197 if (r_ptr->flagsr & RFR_RES_ALL)
5200 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5202 note = " is immune.";
5205 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5209 /* Attempt a saving throw */
5210 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5213 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5215 note = "is unaffected!";
5225 if (seen) obvious = TRUE;
5228 if (!who) msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
5230 if (!who) msg_format("You point at %s, screaming the word, 'DIE!'.", m_name);
5233 if (r_ptr->flagsr & RFR_RES_ALL)
5236 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5238 note = " is immune.";
5241 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5245 /* Attempt a saving throw */
5246 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
5249 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5251 note = "is unaffected!";
5261 if (seen) obvious = TRUE;
5263 if (r_ptr->flagsr & RFR_RES_ALL)
5266 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5268 note = " is immune.";
5271 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5275 if (r_ptr->flags1 & RF1_UNIQUE)
5278 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5280 note = "is unaffected!";
5286 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
5287 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
5289 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5291 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5296 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5306 /* Capture monster */
5310 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5311 (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_NAZGUL)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR) || m_ptr->parent_m_idx)
5314 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5316 msg_format("%^s is unaffected.", m_name);
5322 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
5323 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5324 nokori_hp = m_ptr->maxhp * 3 / 10;
5326 nokori_hp = m_ptr->maxhp * 3 / 20;
5328 if (m_ptr->hp >= nokori_hp)
5331 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5333 msg_format("You need to weaken %s more.", m_name);
5337 else if (m_ptr->hp < randint0(nokori_hp))
5339 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5341 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5343 msg_format("You capture %^s!", m_name);
5345 cap_mon = m_ptr->r_idx;
5346 cap_mspeed = m_ptr->mspeed;
5348 cap_maxhp = m_ptr->max_maxhp;
5349 cap_nickname = m_ptr->nickname; /* Quark transfer */
5350 if (c_ptr->m_idx == p_ptr->riding)
5352 if (rakuba(-1, FALSE))
5355 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5357 msg_format("You have fallen from %s.", m_name);
5362 delete_monster_idx(c_ptr->m_idx);
5369 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5371 msg_format("You failed to capture %s.", m_name);
5378 /* Attack (Use "dam" as attack type) */
5381 /* Return this monster's death */
5382 return py_attack(y, x, dam);
5385 /* Sleep (Use "dam" as "power") */
5391 if (seen) obvious = TRUE;
5393 if (r_ptr->flagsr & RFR_RES_ALL)
5396 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5398 note = " is immune.";
5401 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5404 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5407 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5409 note = " is immune!";
5413 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5416 if (MON_CSLEEP(m_ptr))
5419 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5421 note = " is immune!";
5428 if (one_in_(5)) effect = 1;
5429 else if (one_in_(4)) effect = 2;
5430 else if (one_in_(3)) effect = 3;
5435 /* Powerful monsters can resist */
5436 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5437 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5440 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5442 note = " is unaffected!";
5448 /* Normal monsters slow down */
5451 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
5454 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5456 note = " starts moving slower.";
5462 else if (effect == 2)
5464 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5466 /* Attempt a saving throw */
5467 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5468 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5473 /* No obvious effect */
5475 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5477 note = " is unaffected!";
5484 else if (effect == 3)
5486 /* Attempt a saving throw */
5487 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5488 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5489 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5491 /* Memorize a flag */
5492 if (r_ptr->flags3 & RF3_NO_SLEEP)
5494 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5497 /* No obvious effect */
5499 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5501 note = " is unaffected!";
5508 /* Go to sleep (much) later */
5510 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5512 note = " falls asleep!";
5522 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5524 note = " is immune!";
5528 /* No "real" damage */
5536 if (seen) obvious = TRUE;
5538 if (r_ptr->flagsr & RFR_RES_ALL)
5541 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5543 note = " is immune.";
5546 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5551 if (genocide_aux(c_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, "¥â¥ó¥¹¥¿¡¼¾ÃÌÇ"))
5553 if (genocide_aux(c_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, "Genocide One"))
5557 if (seen_msg) msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª", m_name);
5559 if (seen_msg) msg_format("%^s disappered!", m_name);
5561 chg_virtue(V_VITALITY, -1);
5572 if (!who) msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£", m_name);
5574 if (!who) msg_format("You take a photograph of %s.", m_name);
5577 if (r_ptr->flags3 & (RF3_HURT_LITE))
5579 /* Obvious effect */
5580 if (seen) obvious = TRUE;
5582 /* Memorize the effects */
5583 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5585 /* Special effect */
5587 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5588 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5590 note = " cringes from the light!";
5591 note_dies = " shrivels away in the light!";
5595 /* Normally no damage */
5602 photo = m_ptr->r_idx;
5609 case GF_BLOOD_CURSE:
5611 if (seen) obvious = TRUE;
5613 if (r_ptr->flagsr & RFR_RES_ALL)
5616 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5618 note = " is immune.";
5621 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5629 bool success = FALSE;
5630 if (seen) obvious = TRUE;
5632 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5634 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5635 if (dam < 1) dam = 1;
5637 /* No need to tame your pet */
5641 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5643 note = " starts moving faster.";
5646 (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100);
5650 /* Attempt a saving throw */
5651 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5652 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5653 (m_ptr->mflag2 & MFLAG2_NOPET) ||
5654 (p_ptr->cursed & TRC_AGGRAVATE) ||
5655 ((r_ptr->level+10) > randint1(dam)))
5658 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5663 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5665 note = " is tamed!";
5669 (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100);
5671 /* Learn about type */
5672 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5679 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5681 do_fear = randint1(90)+10;
5683 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5686 /* No "real" damage */
5693 if (seen) obvious = TRUE;
5695 if (r_ptr->flagsr & RFR_RES_ALL)
5698 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5700 note = " is immune.";
5703 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5707 /* Attempt a saving throw */
5708 if (randint0(100 + dam) < (r_ptr->level + 50))
5712 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5714 note = "is unaffected!";
5735 /* Absolutely no effect */
5736 if (skipped) return (FALSE);
5738 /* "Unique" monsters cannot be polymorphed */
5739 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5741 /* Quest monsters cannot be polymorphed */
5742 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5744 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5746 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5747 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
5749 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5754 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5755 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5758 /* Modify the damage */
5760 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5762 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤¡£";
5764 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5767 /* Check for death */
5768 if (dam > m_ptr->hp)
5770 /* Extract method of death */
5775 /* Sound and Impact resisters never stun */
5777 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5778 !(r_ptr->flags3 & RF3_NO_STUN))
5781 if (seen) obvious = TRUE;
5784 if (MON_STUNNED(m_ptr))
5787 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5789 note = " is more dazed.";
5792 tmp = MON_STUNNED(m_ptr) + (do_stun / 2);
5797 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5799 note = " is dazed.";
5806 (void)set_monster_stunned(c_ptr->m_idx, tmp);
5812 /* Confusion and Chaos resisters (and sleepers) never confuse */
5814 !(r_ptr->flags3 & RF3_NO_CONF) &&
5815 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
5818 if (seen) obvious = TRUE;
5820 /* Already partially confused */
5821 if (MON_CONFUSED(m_ptr))
5824 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5826 note = " looks more confused.";
5829 tmp = MON_CONFUSED(m_ptr) + (do_conf / 2);
5832 /* Was not confused */
5836 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
5838 note = " looks confused.";
5844 /* Apply confusion */
5845 (void)set_monster_confused(c_ptr->m_idx, tmp);
5854 if (seen) obvious = TRUE;
5856 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
5861 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
5863 note = " seems weakened.";
5865 m_ptr->maxhp -= do_time;
5866 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
5871 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5872 if (do_poly && (randint1(90) > r_ptr->level))
5874 if (polymorph_monster(y, x))
5877 if (seen) obvious = TRUE;
5879 /* Monster polymorphs */
5881 note = "¤¬ÊѿȤ·¤¿¡ª";
5886 /* Turn off the damage */
5893 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5895 note = " is unaffected!";
5899 /* Hack -- Get new monster */
5900 m_ptr = &m_list[c_ptr->m_idx];
5902 /* Hack -- Get new race */
5903 r_ptr = &r_info[m_ptr->r_idx];
5906 /* Handle "teleport" */
5910 if (seen) obvious = TRUE;
5914 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5916 note = " disappears!";
5919 if (!who) chg_virtue(V_VALOUR, -1);
5922 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who), TRUE);
5924 /* Hack -- get new location */
5928 /* Hack -- get new grid */
5929 c_ptr = &cave[y][x];
5936 (void)set_monster_monfear(c_ptr->m_idx, MON_MONFEAR(m_ptr) + do_fear);
5943 if (typ == GF_DRAIN_MANA)
5945 /* Drain mana does nothing */
5948 /* If another monster did the damage, hurt the monster by hand */
5951 /* Redraw (later) if needed */
5952 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
5953 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
5955 /* Wake the monster up */
5956 (void)set_monster_csleep(c_ptr->m_idx, 0);
5958 /* Hurt the monster */
5966 if (is_pet(m_ptr) && !(m_ptr->ml))
5969 /* Give detailed messages if destroyed */
5972 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
5975 msg_format("%^s%s", m_name, note);
5983 monster_gain_exp(who, m_ptr->r_idx);
5985 /* Generate treasure, etc */
5986 monster_death(c_ptr->m_idx, FALSE);
5988 /* Delete the monster */
5989 delete_monster_idx(c_ptr->m_idx);
5994 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
5996 msg_print("You feel sad for a moment.");
6001 /* Damaged monster */
6004 /* Give detailed messages if visible or destroyed */
6005 if (note && seen_msg) msg_format("%^s%s", m_name, note);
6007 /* Hack -- Pain message */
6010 message_pain(c_ptr->m_idx, dam);
6017 /* Hack -- handle sleep */
6018 if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep);
6022 else if (heal_leper)
6025 if (seen_msg) msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6027 if (seen_msg) msg_print("The Mangy looking leper is healed!");
6030 delete_monster_idx(c_ptr->m_idx);
6033 /* If the player did it, give him experience, check fear */
6038 /* Hurt the monster, check for fear and death */
6039 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6044 /* Damaged monster */
6047 /* HACK - anger the monster before showing the sleep message */
6048 if (do_sleep) anger_monster(m_ptr);
6050 /* Give detailed messages if visible or destroyed */
6051 if (note && seen_msg)
6053 msg_format("%s%s", m_name, note);
6055 msg_format("%^s%s", m_name, note);
6059 /* Hack -- Pain message */
6060 else if (known && (dam || !do_fear))
6062 message_pain(c_ptr->m_idx, dam);
6065 /* Anger monsters */
6066 if (((dam > 0) || get_angry) && !do_sleep)
6067 anger_monster(m_ptr);
6070 if ((fear || do_fear) && seen)
6077 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6079 msg_format("%^s flees in terror!", m_name);
6083 /* Hack -- handle sleep */
6084 if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep);
6088 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6090 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6094 switch (randint1(28))
6100 msg_print("ÃÏÌ̤¬Íɤ줿...");
6102 msg_print("The ground trembles...");
6105 earthquake(ty, tx, 4 + randint0(4));
6106 if (!one_in_(6)) break;
6108 case 3: case 4: case 5: case 6:
6111 int dam = damroll(10, 10);
6113 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6115 msg_print("A portal opens to a plane of raw mana!");
6118 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6119 if (!one_in_(6)) break;
6125 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6127 msg_print("Space warps about you!");
6130 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE, TRUE);
6131 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6132 if (!one_in_(6)) break;
6134 case 9: case 10: case 11:
6136 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6138 msg_print("You feel a surge of energy!");
6141 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6142 if (!one_in_(6)) break;
6143 case 12: case 13: case 14: case 15: case 16:
6144 aggravate_monsters(0);
6145 if (!one_in_(6)) break;
6147 count += activate_hi_summon(ty, tx, TRUE);
6148 if (!one_in_(6)) break;
6149 case 19: case 20: case 21: case 22:
6151 bool pet = !one_in_(3);
6152 u32b mode = PM_ALLOW_GROUP;
6154 if (pet) mode |= PM_FORCE_PET;
6155 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6157 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6158 if (!one_in_(6)) break;
6160 case 23: case 24: case 25:
6161 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6163 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6165 msg_print("You feel your life draining away...");
6168 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6169 else lose_exp(p_ptr->exp / 16);
6170 if (!one_in_(6)) break;
6171 case 26: case 27: case 28:
6180 (void)do_dec_stat(i);
6189 (void)do_dec_stat(randint0(6));
6198 if (p_ptr->inside_battle)
6200 p_ptr->health_who = c_ptr->m_idx;
6201 p_ptr->redraw |= (PR_HEALTH);
6205 /* XXX XXX XXX Verify this code */
6207 /* Update the monster */
6208 update_mon(c_ptr->m_idx, FALSE);
6210 /* Redraw the monster grid */
6214 /* Update monster recall window */
6215 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6218 p_ptr->window |= (PW_MONSTER);
6221 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6225 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6227 set_target(m_ptr, monster_target_y, monster_target_x);
6230 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6232 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
6236 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6238 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6239 rakubadam_m = (dam > 200) ? 200 : dam;
6248 /* Get local object */
6251 /* Prepare to make a Blade of Chaos */
6252 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6254 q_ptr->pval = photo;
6256 /* Mark the item as fully known */
6257 q_ptr->ident |= (IDENT_MENTAL);
6259 /* Drop it in the dungeon */
6260 (void)drop_near(q_ptr, -1, py, px);
6268 /* Return "Anything seen?" */
6274 * Helper function for "project()" below.
6276 * Handle a beam/bolt/ball causing damage to the player.
6278 * This routine takes a "source monster" (by index), a "distance", a default
6279 * "damage", and a "damage type". See "project_m()" above.
6281 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6282 * is reduced (see "project_m()" above). This can happen if a monster breathes
6283 * at the player and hits a wall instead.
6285 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6286 * to know if this is actually a ball or a bolt spell
6289 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6290 * we just assume that the effects were obvious, for historical reasons.
6292 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6297 /* Hack -- assume obvious */
6298 bool obvious = TRUE;
6300 /* Player blind-ness */
6301 bool blind = (p_ptr->blind ? TRUE : FALSE);
6303 /* Player needs a "description" (he is blind) */
6306 /* Source monster */
6307 monster_type *m_ptr = NULL;
6309 /* Monster name (for attacks) */
6312 /* Monster name (for damage) */
6315 /* Hack -- messages */
6321 /* Player is not here */
6322 if (!player_bold(y, x)) return (FALSE);
6324 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6330 /* Player cannot hurt himself */
6331 if (!who) return (FALSE);
6332 if (who == p_ptr->riding) return (FALSE);
6334 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6337 int max_attempts = 10;
6340 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6341 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6342 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6344 if (blind) msg_print("Something bounces!");
6345 else msg_print("The attack bounces!");
6349 /* Choose 'new' target */
6352 t_y = m_list[who].fy - 1 + randint1(3);
6353 t_x = m_list[who].fx - 1 + randint1(3);
6356 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
6358 if (max_attempts < 1)
6360 t_y = m_list[who].fy;
6361 t_x = m_list[who].fx;
6364 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6371 /* Limit maximum damage */
6372 if (dam > 1600) dam = 1600;
6374 /* Reduce damage by distance */
6375 dam = (dam + r) / (r + 1);
6378 /* If the player is blind, be more descriptive */
6379 if (blind) fuzzy = TRUE;
6384 /* Get the source monster */
6385 m_ptr = &m_list[who];
6386 /* Extract the monster level */
6387 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6389 /* Get the monster name */
6390 monster_desc(m_name, m_ptr, 0);
6392 /* Get the monster's real name (gotten before polymorph!) */
6393 strcpy(killer, who_name);
6398 strcpy(killer, "æ«");
6400 strcpy(killer, "a trap");
6404 /* Analyze the damage */
6407 /* Standard damage -- hurts inventory too */
6411 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6413 if (fuzzy) msg_print("You are hit by acid!");
6416 get_damage = acid_dam(dam, killer, monspell);
6420 /* Standard damage -- hurts inventory too */
6424 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6426 if (fuzzy) msg_print("You are hit by fire!");
6429 get_damage = fire_dam(dam, killer, monspell);
6433 /* Standard damage -- hurts inventory too */
6437 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6439 if (fuzzy) msg_print("You are hit by cold!");
6442 get_damage = cold_dam(dam, killer, monspell);
6446 /* Standard damage -- hurts inventory too */
6450 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6452 if (fuzzy) msg_print("You are hit by lightning!");
6455 get_damage = elec_dam(dam, killer, monspell);
6459 /* Standard damage -- also poisons player */
6462 bool double_resist = IS_OPPOSE_POIS();
6464 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6466 if (fuzzy) msg_print("You are hit by poison!");
6469 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6470 if (double_resist) dam = (dam + 2) / 3;
6472 if ((!(double_resist || p_ptr->resist_pois)) &&
6473 one_in_(HURT_CHANCE))
6478 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6480 if (!(double_resist || p_ptr->resist_pois))
6482 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6487 /* Standard damage -- also poisons / mutates player */
6490 bool double_resist = IS_OPPOSE_POIS();
6492 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6494 if (fuzzy) msg_print("You are hit by radiation!");
6497 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6498 if (double_resist) dam = (2 * dam + 2) / 5;
6499 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6500 if (!(double_resist || p_ptr->resist_pois))
6502 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6504 if (one_in_(5)) /* 6 */
6507 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6509 msg_print("You undergo a freakish metamorphosis!");
6512 if (one_in_(4)) /* 4 */
6520 inven_damage(set_acid_destroy, 2);
6526 /* Standard damage */
6530 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6532 if (fuzzy) msg_print("You are hit by something!");
6535 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6539 /* Holy Orb -- Player only takes partial damage */
6543 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6545 if (fuzzy) msg_print("You are hit by something!");
6548 if (p_ptr->align > 10)
6550 else if (p_ptr->align < -10)
6552 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6559 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6561 if (fuzzy) msg_print("You are hit by something!");
6564 if (p_ptr->align > 10)
6566 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6570 /* Arrow -- XXX no dodging */
6574 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6576 if (fuzzy) msg_print("You are hit by something sharp!");
6579 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6582 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6584 msg_print("You cut down the arrow!");
6588 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6592 /* Plasma -- XXX No resist */
6596 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6598 if (fuzzy) msg_print("You are hit by something *HOT*!");
6601 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6603 if (!p_ptr->resist_sound)
6605 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6606 (void)set_stun(p_ptr->stun + k);
6609 if (!(p_ptr->resist_fire ||
6611 p_ptr->immune_fire))
6613 inven_damage(set_acid_destroy, 3);
6619 /* Nether -- drain experience */
6623 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6625 if (fuzzy) msg_print("You are hit by nether forces!");
6629 if (p_ptr->resist_neth)
6631 if (!prace_is_(RACE_SPECTRE))
6632 dam *= 6; dam /= (randint1(4) + 7);
6634 else drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
6636 if (prace_is_(RACE_SPECTRE))
6639 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6641 msg_print("You feel invigorated!");
6645 learn_spell(monspell);
6649 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6655 /* Water -- stun/confuse */
6659 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6661 if (fuzzy) msg_print("You are hit by something wet!");
6664 if (!p_ptr->resist_sound)
6666 set_stun(p_ptr->stun + randint1(40));
6668 if (!p_ptr->resist_conf)
6670 set_confused(p_ptr->confused + randint1(5) + 5);
6675 inven_damage(set_cold_destroy, 3);
6678 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6682 /* Chaos -- many effects */
6686 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6688 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6691 if (p_ptr->resist_chaos)
6693 dam *= 6; dam /= (randint1(4) + 7);
6695 if (!p_ptr->resist_conf)
6697 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6699 if (!p_ptr->resist_chaos)
6701 (void)set_image(p_ptr->image + randint1(10));
6705 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6707 msg_print("Your body is twisted by chaos!");
6710 (void)gain_random_mutation(0);
6713 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6715 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
6717 if (!p_ptr->resist_chaos || one_in_(9))
6719 inven_damage(set_elec_destroy, 2);
6720 inven_damage(set_fire_destroy, 2);
6722 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6726 /* Shards -- mostly cutting */
6730 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6732 if (fuzzy) msg_print("You are hit by something sharp!");
6735 if (p_ptr->resist_shard)
6737 dam *= 6; dam /= (randint1(4) + 7);
6741 (void)set_cut(p_ptr->cut + dam);
6744 if (!p_ptr->resist_shard || one_in_(13))
6746 inven_damage(set_cold_destroy, 2);
6749 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6753 /* Sound -- mostly stunning */
6757 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6759 if (fuzzy) msg_print("You are hit by a loud noise!");
6762 if (p_ptr->resist_sound)
6764 dam *= 5; dam /= (randint1(4) + 7);
6768 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6769 (void)set_stun(p_ptr->stun + k);
6772 if (!p_ptr->resist_sound || one_in_(13))
6774 inven_damage(set_cold_destroy, 2);
6777 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6781 /* Pure confusion */
6785 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6787 if (fuzzy) msg_print("You are hit by something puzzling!");
6790 if (p_ptr->resist_conf)
6792 dam *= 5; dam /= (randint1(4) + 7);
6794 if (!p_ptr->resist_conf)
6796 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6798 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6802 /* Disenchantment -- see above */
6806 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6808 if (fuzzy) msg_print("You are hit by something static!");
6811 if (p_ptr->resist_disen)
6813 dam *= 6; dam /= (randint1(4) + 7);
6817 (void)apply_disenchant(0);
6819 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6823 /* Nexus -- see above */
6827 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6829 if (fuzzy) msg_print("You are hit by something strange!");
6832 if (p_ptr->resist_nexus)
6834 dam *= 6; dam /= (randint1(4) + 7);
6840 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6844 /* Force -- mostly stun */
6848 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6850 if (fuzzy) msg_print("You are hit by kinetic force!");
6853 if (!p_ptr->resist_sound)
6855 (void)set_stun(p_ptr->stun + randint1(20));
6857 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6862 /* Rocket -- stun, cut */
6866 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
6868 if (fuzzy) msg_print("There is an explosion!");
6871 if (!p_ptr->resist_sound)
6873 (void)set_stun(p_ptr->stun + randint1(20));
6875 if (p_ptr->resist_shard)
6881 (void)set_cut(p_ptr-> cut + ( dam / 2));
6884 if ((!p_ptr->resist_shard) || one_in_(12))
6886 inven_damage(set_cold_destroy, 3);
6889 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6893 /* Inertia -- slowness */
6897 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6899 if (fuzzy) msg_print("You are hit by something slow!");
6902 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
6903 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6907 /* Lite -- blinding */
6911 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6913 if (fuzzy) msg_print("You are hit by something!");
6916 if (p_ptr->resist_lite)
6918 dam *= 4; dam /= (randint1(4) + 7);
6920 else if (!blind && !p_ptr->resist_blind)
6922 (void)set_blind(p_ptr->blind + randint1(5) + 2);
6924 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
6927 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
6929 msg_print("The light scorches your flesh!");
6934 else if (prace_is_(RACE_S_FAIRY))
6938 if (p_ptr->wraith_form) dam *= 2;
6939 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6941 if (p_ptr->wraith_form)
6943 p_ptr->wraith_form = 0;
6945 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
6947 msg_print("The light forces you out of your incorporeal shadow form.");
6950 p_ptr->redraw |= PR_MAP;
6951 /* Update monsters */
6952 p_ptr->update |= (PU_MONSTERS);
6954 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
6956 /* Redraw status bar */
6957 p_ptr->redraw |= (PR_STATUS);
6964 /* Dark -- blinding */
6968 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6970 if (fuzzy) msg_print("You are hit by something!");
6973 if (p_ptr->resist_dark)
6975 dam *= 4; dam /= (randint1(4) + 7);
6977 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
6979 else if (!blind && !p_ptr->resist_blind)
6981 (void)set_blind(p_ptr->blind + randint1(5) + 2);
6983 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6987 /* Time -- bolt fewer effects XXX */
6991 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
6993 if (fuzzy) msg_print("You are hit by a blast from the past!");
6996 if (p_ptr->resist_time)
6999 dam /= (randint1(4) + 7);
7001 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7003 msg_print("You feel as if time is passing you by.");
7009 switch (randint1(10))
7011 case 1: case 2: case 3: case 4: case 5:
7013 if (p_ptr->prace == RACE_ANDROID) break;
7015 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7017 msg_print("You feel life has clocked back.");
7020 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7024 case 6: case 7: case 8: case 9:
7026 switch (randint1(6))
7029 case 1: k = A_STR; act = "¶¯¤¯"; break;
7030 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7031 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7032 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7033 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7034 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7036 case 1: k = A_STR; act = "strong"; break;
7037 case 2: k = A_INT; act = "bright"; break;
7038 case 3: k = A_WIS; act = "wise"; break;
7039 case 4: k = A_DEX; act = "agile"; break;
7040 case 5: k = A_CON; act = "hale"; break;
7041 case 6: k = A_CHR; act = "beautiful"; break;
7047 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7049 msg_format("You're not as %s as you used to be...", act);
7053 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7054 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7055 p_ptr->update |= (PU_BONUS);
7062 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7064 msg_print("You're not as powerful as you used to be...");
7068 for (k = 0; k < 6; k++)
7070 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7071 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7073 p_ptr->update |= (PU_BONUS);
7079 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7083 /* Gravity -- stun plus slowness plus teleport */
7087 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7088 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7090 if (fuzzy) msg_print("You are hit by something heavy!");
7091 msg_print("Gravity warps around you.");
7094 teleport_player(5, TRUE);
7095 if (!p_ptr->levitation)
7096 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7097 if (!(p_ptr->resist_sound || p_ptr->levitation))
7099 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7100 (void)set_stun(p_ptr->stun + k);
7102 if (p_ptr->levitation)
7104 dam = (dam * 2) / 3;
7107 if (!p_ptr->levitation || one_in_(13))
7109 inven_damage(set_cold_destroy, 2);
7112 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7116 /* Standard damage */
7117 case GF_DISINTEGRATE:
7120 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7122 if (fuzzy) msg_print("You are hit by pure energy!");
7125 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7132 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7134 if (fuzzy) msg_print("You are hit by something invigorating!");
7137 (void)hp_player(dam);
7145 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7147 if (fuzzy) msg_print("You are hit by something!");
7150 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7158 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7160 if (fuzzy) msg_print("You are hit by something slow!");
7163 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7169 if (p_ptr->free_act) break;
7171 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7173 if (fuzzy) msg_print("You fall asleep!");
7177 if (ironman_nightmare)
7180 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7182 msg_print("A horrible vision enters your mind.");
7186 /* Pick a nightmare */
7187 get_mon_num_prep(get_nightmare, NULL);
7189 /* Have some nightmares */
7190 have_nightmare(get_mon_num(MAX_DEPTH));
7192 /* Remove the monster restriction */
7193 get_mon_num_prep(NULL, NULL);
7196 set_paralyzed(p_ptr->paralyzed + dam);
7207 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7209 if (fuzzy) msg_print("You are hit by an aura of magic!");
7212 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7220 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7222 if (fuzzy) msg_print("You are hit by an energy!");
7225 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7233 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7235 if (fuzzy) msg_print("Something falls from the sky on you!");
7238 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7239 if (!p_ptr->resist_shard || one_in_(13))
7241 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7242 inven_damage(set_cold_destroy, 2);
7248 /* Ice -- cold plus stun plus cuts */
7252 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7254 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7257 cold_dam(dam, killer, monspell);
7258 if (!p_ptr->resist_shard)
7260 (void)set_cut(p_ptr->cut + damroll(5, 8));
7262 if (!p_ptr->resist_sound)
7264 (void)set_stun(p_ptr->stun + randint1(15));
7267 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
7269 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7279 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7281 if (fuzzy) msg_print("You are hit by something extremely cold!");
7285 if (p_ptr->mimic_form)
7287 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7288 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7293 switch (p_ptr->prace)
7295 /* Some races are immune */
7309 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7325 if (who > 0) msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
7326 else msg_print("Àº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
7328 if (who > 0) msg_format("%^s draws psychic energy from you!", m_name);
7329 else msg_print("Your psychic energy is drawn!");
7333 if (dam >= p_ptr->csp)
7337 p_ptr->csp_frac = 0;
7346 learn_spell(monspell);
7349 p_ptr->redraw |= (PR_MANA);
7352 p_ptr->window |= (PW_PLAYER);
7353 p_ptr->window |= (PW_SPELL);
7357 /* Heal the monster */
7358 if (m_ptr->hp < m_ptr->maxhp)
7361 m_ptr->hp += (6 * dam);
7362 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
7364 /* Redraw (later) if needed */
7365 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
7366 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
7368 /* Special message */
7372 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
7374 msg_format("%^s appears healthier.", m_name);
7388 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7391 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7393 msg_print("You resist the effects!");
7395 learn_spell(monspell);
7400 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7402 msg_print("Your mind is blasted by psyonic energy.");
7405 if (!p_ptr->resist_conf)
7407 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7410 if (!p_ptr->resist_chaos && one_in_(3))
7412 (void)set_image(p_ptr->image + randint0(250) + 150);
7419 p_ptr->csp_frac = 0;
7421 p_ptr->redraw |= PR_MANA;
7423 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7429 case GF_BRAIN_SMASH:
7431 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7434 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7436 msg_print("You resist the effects!");
7438 learn_spell(monspell);
7443 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7445 msg_print("Your mind is blasted by psionic energy.");
7452 p_ptr->csp_frac = 0;
7454 p_ptr->redraw |= PR_MANA;
7456 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7457 if (!p_ptr->resist_blind)
7459 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7461 if (!p_ptr->resist_conf)
7463 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7465 if (!p_ptr->free_act)
7467 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7469 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7471 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7472 (void)do_dec_stat(A_INT);
7473 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7474 (void)do_dec_stat(A_WIS);
7476 if (!p_ptr->resist_chaos)
7478 (void)set_image(p_ptr->image + randint0(250) + 150);
7487 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7490 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7492 msg_print("You resist the effects!");
7494 learn_spell(monspell);
7498 curse_equipment(15, 0);
7499 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7507 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7510 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7512 msg_print("You resist the effects!");
7514 learn_spell(monspell);
7518 curse_equipment(25, MIN(rlev/2-15, 5));
7519 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7527 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7530 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7532 msg_print("You resist the effects!");
7534 learn_spell(monspell);
7538 curse_equipment(33, MIN(rlev/2-15, 15));
7539 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7547 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7550 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7552 msg_print("You resist the effects!");
7554 learn_spell(monspell);
7558 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7559 (void)set_cut(p_ptr->cut + damroll(10, 10));
7567 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7570 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7572 msg_format("You resist the effects!");
7574 learn_spell(monspell);
7579 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7581 msg_print("You feel your life fade away!");
7584 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
7585 curse_equipment(40, 20);
7587 if (p_ptr->chp < 1) p_ptr->chp = 1;
7602 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7605 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7607 char m_name_self[80];
7610 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
7612 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7614 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7615 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7618 if (p_ptr->riding && dam > 0)
7620 rakubadam_p = (dam > 200) ? 200 : dam;
7628 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7634 /* Return "Anything seen?" */
7640 * Find the distance from (x, y) to a line.
7642 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7644 /* Vector from (x, y) to (x1, y1) */
7653 int pd = distance(y1, x1, y, x);
7654 int nd = distance(y1, x1, y2, x2);
7656 if (pd > nd) return distance(y, x, y2, x2);
7658 /* Component of P on N */
7659 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7661 /* Absolute value */
7662 return((nd >= 0) ? nd : 0 - nd);
7669 * Modified version of los() for calculation of disintegration balls.
7670 * Disintegration effects are stopped by permanent walls.
7672 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7692 /* Slope, or 1/Slope, of LOS */
7696 /* Extract the offset */
7700 /* Extract the absolute offset */
7705 /* Handle adjacent (or identical) grids */
7706 if ((ax < 2) && (ay < 2)) return (TRUE);
7709 /* Paranoia -- require "safe" origin */
7710 /* if (!in_bounds(y1, x1)) return (FALSE); */
7713 /* Directly South/North */
7716 /* South -- check for walls */
7719 for (ty = y1 + 1; ty < y2; ty++)
7721 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7725 /* North -- check for walls */
7728 for (ty = y1 - 1; ty > y2; ty--)
7730 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7738 /* Directly East/West */
7741 /* East -- check for walls */
7744 for (tx = x1 + 1; tx < x2; tx++)
7746 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7750 /* West -- check for walls */
7753 for (tx = x1 - 1; tx > x2; tx--)
7755 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7764 /* Extract some signs */
7765 sx = (dx < 0) ? -1 : 1;
7766 sy = (dy < 0) ? -1 : 1;
7769 /* Vertical "knights" */
7774 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7778 /* Horizontal "knights" */
7783 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7788 /* Calculate scale factor div 2 */
7791 /* Calculate scale factor */
7795 /* Travel horizontally */
7798 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7804 /* Consider the special case where slope == 1. */
7815 /* Note (below) the case (qy == f2), where */
7816 /* the LOS exactly meets the corner of a tile. */
7819 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7830 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7843 /* Travel vertically */
7846 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7862 /* Note (below) the case (qx == f2), where */
7863 /* the LOS exactly meets the corner of a tile. */
7866 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7877 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7898 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, int typ)
7903 int brev = rad * rad / dist;
7907 int mdis = distance(y1, x1, y2, x2) + rad;
7909 while (bdis <= mdis)
7913 if ((0 < dist) && (path_n < dist))
7915 int ny = GRID_Y(path_g[path_n]);
7916 int nx = GRID_X(path_g[path_n]);
7917 int nd = distance(ny, nx, y1, x1);
7919 /* Get next base point */
7928 /* Travel from center outward */
7929 for (cdis = 0; cdis <= brad; cdis++)
7931 /* Scan the maximal blast area of radius "cdis" */
7932 for (y = by - cdis; y <= by + cdis; y++)
7934 for (x = bx - cdis; x <= bx + cdis; x++)
7936 /* Ignore "illegal" locations */
7937 if (!in_bounds(y, x)) continue;
7939 /* Enforce a circular "ripple" */
7940 if (distance(y1, x1, y, x) != bdis) continue;
7942 /* Enforce an arc */
7943 if (distance(by, bx, y, x) != cdis) continue;
7949 /* Lights are stopped by opaque terrains */
7950 if (!los(by, bx, y, x)) continue;
7952 case GF_DISINTEGRATE:
7953 /* Disintegration are stopped only by perma-walls */
7954 if (!in_disintegration_range(by, bx, y, x)) continue;
7957 /* Ball explosions are stopped by walls */
7958 if (!projectable(by, bx, y, x)) continue;
7962 /* Save this grid */
7970 /* Encode some more "radius" info */
7971 gm[bdis + 1] = *pgrids;
7973 /* Increase the size */
7974 brad = rad * (path_n + brev) / (dist + brev);
7976 /* Find the next ripple */
7980 /* Store the effect size */
7986 * Generic "beam"/"bolt"/"ball" projection routine.
7989 * who: Index of "source" monster (zero for "player")
7990 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
7991 * y,x: Target location (or location to travel "towards")
7992 * dam: Base damage roll to apply to affected monsters (or player)
7993 * typ: Type of damage to apply to monsters (and objects)
7994 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
7997 * TRUE if any "effects" of the projection were observed, else FALSE
7999 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8000 * towards a given location (optionally passing over the heads of interposing
8001 * monsters), and have it do a given amount of damage to the monsters (and
8002 * optionally objects) within the given radius of the final location.
8004 * A "bolt" travels from source to target and affects only the target grid.
8005 * A "beam" travels from source to target, affecting all grids passed through.
8006 * A "ball" travels from source to the target, exploding at the target, and
8007 * affecting everything within the given radius of the target location.
8009 * Traditionally, a "bolt" does not affect anything on the ground, and does
8010 * not pass over the heads of interposing monsters, much like a traditional
8011 * missile, and will "stop" abruptly at the "target" even if no monster is
8012 * positioned there, while a "ball", on the other hand, passes over the heads
8013 * of monsters between the source and target, and affects everything except
8014 * the source monster which lies within the final radius, while a "beam"
8015 * affects every monster between the source and target, except for the casting
8016 * monster (or player), and rarely affects things on the ground.
8018 * Two special flags allow us to use this function in special ways, the
8019 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8020 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8021 * actually projecting from the source monster (or player).
8023 * The player will only get "experience" for monsters killed by himself
8024 * Unique monsters can only be destroyed by attacks from the player
8026 * Only 256 grids can be affected per projection, limiting the effective
8027 * "radius" of standard ball attacks to nine units (diameter nineteen).
8029 * One can project in a given "direction" by combining PROJECT_THRU with small
8030 * offsets to the initial location (see "line_spell()"), or by calculating
8031 * "virtual targets" far away from the player.
8033 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8034 * continuing until it actually hits somethings (useful for "stone to mud").
8036 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8038 * Balls must explode BEFORE hitting walls, or they would affect monsters
8039 * on both sides of a wall. Some bug reports indicate that this is still
8040 * happening in 2.7.8 for Windows, though it appears to be impossible.
8042 * We "pre-calculate" the blast area only in part for efficiency.
8043 * More importantly, this lets us do "explosions" from the "inside" out.
8044 * This results in a more logical distribution of "blast" treasure.
8045 * It also produces a better (in my opinion) animation of the explosion.
8046 * It could be (but is not) used to have the treasure dropped by monsters
8047 * in the middle of the explosion fall "outwards", and then be damaged by
8048 * the blast as it spreads outwards towards the treasure drop location.
8050 * Walls and doors are included in the blast area, so that they can be
8051 * "burned" or "melted" in later versions.
8053 * This algorithm is intended to maximize simplicity, not necessarily
8054 * efficiency, since this function is not a bottleneck in the code.
8056 * We apply the blast effect from ground zero outwards, in several passes,
8057 * first affecting features, then objects, then monsters, then the player.
8058 * This allows walls to be removed before checking the object or monster
8059 * in the wall, and protects objects which are dropped by monsters killed
8060 * in the blast, and allows the player to see all affects before he is
8061 * killed or teleported away. The semantics of this method are open to
8062 * various interpretations, but they seem to work well in practice.
8064 * We process the blast area from ground-zero outwards to allow for better
8065 * distribution of treasure dropped by monsters, and because it provides a
8066 * pleasing visual effect at low cost.
8068 * Note that the damage done by "ball" explosions decreases with distance.
8069 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8071 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8072 * the target, and then the damage "flows" along this beam of destruction.
8073 * The damage at every grid is the same as at the "center" of a "ball"
8074 * explosion, since the "beam" grids are treated as if they ARE at the
8075 * center of a "ball" explosion.
8077 * Currently, specifying "beam" plus "ball" means that locations which are
8078 * covered by the initial "beam", and also covered by the final "ball", except
8079 * for the final grid (the epicenter of the ball), will be "hit twice", once
8080 * by the initial beam, and once by the exploding ball. For the grid right
8081 * next to the epicenter, this results in 150% damage being done. The center
8082 * does not have this problem, for the same reason the final grid in a "beam"
8083 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8084 * grids which are covered by the "ball" will NOT work, as then they will
8085 * receive LESS damage than they should. Do not combine "beam" with "ball".
8087 * The array "gy[],gx[]" with current size "grids" is used to hold the
8088 * collected locations of all grids in the "blast area" plus "beam path".
8090 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8091 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8092 * first blast grid (see above) with radius "N" from the blast center. Note
8093 * that only the first gm[1] grids in the blast area thus take full damage.
8094 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8095 * number of blast grids.
8097 * Note that once the projection is complete, (y2,x2) holds the final location
8098 * of bolts/beams, and the "epicenter" of balls.
8100 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8101 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8102 * implementation of the "distance" function. Also, a bolt can be properly
8103 * viewed as a "ball" with a "rad" of "zero".
8105 * Note that if no "target" is reached before the beam/bolt/ball travels the
8106 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8107 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8109 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8110 * to move from point A to point B, even if the player cannot see part of the
8111 * projection path. Note that in general, the player will *always* see part
8112 * of the path, since it either starts at the player or ends on the player.
8114 * Hack -- we assume that every "projection" is "self-illuminating".
8116 * Hack -- when only a single monster is affected, we automatically track
8117 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8119 * Note that all projections now "explode" at their final destination, even
8120 * if they were being projected at a more distant destination. This means
8121 * that "ball" spells will *always* explode.
8123 * Note that we must call "handle_stuff()" after affecting terrain features
8124 * in the blast radius, in case the "illumination" of the grid was changed,
8125 * and "update_view()" and "update_monsters()" need to be called.
8127 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8137 int y_saver, x_saver; /* For reflecting monsters */
8139 int msec = delay_factor * delay_factor * delay_factor;
8141 /* Assume the player sees nothing */
8142 bool notice = FALSE;
8144 /* Assume the player has seen nothing */
8145 bool visual = FALSE;
8147 /* Assume the player has seen no blast grids */
8150 /* Assume to be a normal ball spell */
8151 bool breath = FALSE;
8153 /* Is the player blind? */
8154 bool blind = (p_ptr->blind ? TRUE : FALSE);
8156 bool old_hide = FALSE;
8158 /* Number of grids in the "path" */
8161 /* Actual grids in the "path" */
8164 /* Number of grids in the "blast area" (including the "beam" path) */
8167 /* Coordinates of the affected grids */
8168 byte gx[1024], gy[1024];
8170 /* Encoded "radius" info (see above) */
8173 /* Actual radius encoded in gm[] */
8178 /* Attacker's name (prepared before polymorph)*/
8181 /* Initialize by null string */
8187 /* Default target of monsterspell is player */
8188 monster_target_y=py;
8189 monster_target_x=px;
8191 /* Hack -- Jump to target */
8192 if (flg & (PROJECT_JUMP))
8197 /* Clear the flag */
8198 flg &= ~(PROJECT_JUMP);
8203 /* Start at player */
8210 /* Start at monster */
8213 x1 = m_list[who].fx;
8214 y1 = m_list[who].fy;
8215 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8228 /* Default "destination" */
8233 /* Hack -- verify stuff */
8234 if (flg & (PROJECT_THRU))
8236 if ((x1 == x2) && (y1 == y2))
8238 flg &= ~(PROJECT_THRU);
8242 /* Handle a breath attack */
8247 if (flg & PROJECT_HIDE) old_hide = TRUE;
8248 flg |= PROJECT_HIDE;
8252 /* Hack -- Assume there will be no blast (max radius 32) */
8253 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8261 /* Collect beam grids */
8262 if (flg & (PROJECT_BEAM))
8273 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
8275 case GF_DISINTEGRATE:
8276 flg |= (PROJECT_GRID);
8277 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
8281 /* Calculate the projection path */
8283 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8285 /* Hack -- Handle stuff */
8288 /* Giga-Hack SEEKER & SUPER_RAY */
8290 if( typ == GF_SEEKER )
8300 for (i = 0; i < path_n; ++i)
8305 int ny = GRID_Y(path_g[i]);
8306 int nx = GRID_X(path_g[i]);
8317 /* Only do visuals if requested */
8318 if (!blind && !(flg & (PROJECT_HIDE)))
8320 /* Only do visuals if the player can "see" the bolt */
8321 if (panel_contains(y, x) && player_has_los_bold(y, x))
8328 /* Obtain the bolt pict */
8329 p = bolt_pict(oy, ox, y, x, typ);
8331 /* Extract attr/char */
8335 /* Visual effects */
8336 print_rel(c, a, y, x);
8337 move_cursor_relative(y, x);
8338 /*if (fresh_before)*/ Term_fresh();
8339 Term_xtra(TERM_XTRA_DELAY, msec);
8341 /*if (fresh_before)*/ Term_fresh();
8343 /* Display "beam" grids */
8344 if (flg & (PROJECT_BEAM))
8346 /* Obtain the explosion pict */
8347 p = bolt_pict(y, x, y, x, typ);
8349 /* Extract attr/char */
8353 /* Visual effects */
8354 print_rel(c, a, y, x);
8357 /* Hack -- Activate delay */
8361 /* Hack -- delay anyway for consistency */
8364 /* Delay for consistency */
8365 Term_xtra(TERM_XTRA_DELAY, msec);
8368 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8369 if( is_mirror_grid(&cave[y][x]))
8371 /* The target of monsterspell becomes tha mirror(broken) */
8372 monster_target_y=(s16b)y;
8373 monster_target_x=(s16b)x;
8376 next_mirror( &oy,&ox,y,x );
8378 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8379 for( j = last_i; j <=i ; j++ )
8381 y = GRID_Y(path_g[j]);
8382 x = GRID_X(path_g[j]);
8383 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8384 if(!who && (project_m_n==1) && !jump ){
8385 if(cave[project_m_y][project_m_x].m_idx >0 ){
8386 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8388 /* Hack -- auto-recall */
8389 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8391 /* Hack - auto-track */
8392 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8395 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8400 for( i = last_i ; i < path_n ; i++ )
8403 y = GRID_Y(path_g[i]);
8404 x = GRID_X(path_g[i]);
8405 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8407 if(!who && (project_m_n==1) && !jump ){
8408 if(cave[project_m_y][project_m_x].m_idx >0 ){
8409 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8411 /* Hack -- auto-recall */
8412 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8414 /* Hack - auto-track */
8415 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8418 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8422 else if(typ == GF_SUPER_RAY){
8424 int second_step = 0;
8431 for (i = 0; i < path_n; ++i)
8436 int ny = GRID_Y(path_g[i]);
8437 int nx = GRID_X(path_g[i]);
8448 /* Only do visuals if requested */
8449 if (!blind && !(flg & (PROJECT_HIDE)))
8451 /* Only do visuals if the player can "see" the bolt */
8452 if (panel_contains(y, x) && player_has_los_bold(y, x))
8459 /* Obtain the bolt pict */
8460 p = bolt_pict(oy, ox, y, x, typ);
8462 /* Extract attr/char */
8466 /* Visual effects */
8467 print_rel(c, a, y, x);
8468 move_cursor_relative(y, x);
8469 /*if (fresh_before)*/ Term_fresh();
8470 Term_xtra(TERM_XTRA_DELAY, msec);
8472 /*if (fresh_before)*/ Term_fresh();
8474 /* Display "beam" grids */
8475 if (flg & (PROJECT_BEAM))
8477 /* Obtain the explosion pict */
8478 p = bolt_pict(y, x, y, x, typ);
8480 /* Extract attr/char */
8484 /* Visual effects */
8485 print_rel(c, a, y, x);
8488 /* Hack -- Activate delay */
8492 /* Hack -- delay anyway for consistency */
8495 /* Delay for consistency */
8496 Term_xtra(TERM_XTRA_DELAY, msec);
8499 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8500 if (!cave_have_flag_bold(y, x, FF_PROJECT))
8502 if( second_step )continue;
8505 if( is_mirror_grid(&cave[y][x]) && !second_step )
8507 /* The target of monsterspell becomes tha mirror(broken) */
8508 monster_target_y=(s16b)y;
8509 monster_target_x=(s16b)x;
8512 for( j = 0; j <=i ; j++ )
8514 y = GRID_Y(path_g[j]);
8515 x = GRID_X(path_g[j]);
8516 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8520 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8521 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8522 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8523 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8524 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8525 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8526 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8527 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8530 for( i = 0; i < path_n ; i++ )
8533 y = GRID_Y(path_g[i]);
8534 x = GRID_X(path_g[i]);
8535 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8536 if(!who && (project_m_n==1) && !jump ){
8537 if(cave[project_m_y][project_m_x].m_idx >0 ){
8538 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8540 /* Hack -- auto-recall */
8541 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8543 /* Hack - auto-track */
8544 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8547 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8552 /* Project along the path */
8553 for (i = 0; i < path_n; ++i)
8558 int ny = GRID_Y(path_g[i]);
8559 int nx = GRID_X(path_g[i]);
8561 if (flg & PROJECT_DISI)
8563 /* Hack -- Balls explode before reaching walls */
8564 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8566 else if (flg & PROJECT_LOS)
8568 /* Hack -- Balls explode before reaching walls */
8569 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
8573 /* Hack -- Balls explode before reaching walls */
8574 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
8581 /* Collect beam grids */
8582 if (flg & (PROJECT_BEAM))
8589 /* Only do visuals if requested */
8590 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
8592 /* Only do visuals if the player can "see" the bolt */
8593 if (panel_contains(y, x) && player_has_los_bold(y, x))
8600 /* Obtain the bolt pict */
8601 p = bolt_pict(oy, ox, y, x, typ);
8603 /* Extract attr/char */
8607 /* Visual effects */
8608 print_rel(c, a, y, x);
8609 move_cursor_relative(y, x);
8610 /*if (fresh_before)*/ Term_fresh();
8611 Term_xtra(TERM_XTRA_DELAY, msec);
8613 /*if (fresh_before)*/ Term_fresh();
8615 /* Display "beam" grids */
8616 if (flg & (PROJECT_BEAM))
8618 /* Obtain the explosion pict */
8619 p = bolt_pict(y, x, y, x, typ);
8621 /* Extract attr/char */
8625 /* Visual effects */
8626 print_rel(c, a, y, x);
8629 /* Hack -- Activate delay */
8633 /* Hack -- delay anyway for consistency */
8636 /* Delay for consistency */
8637 Term_xtra(TERM_XTRA_DELAY, msec);
8644 /* Save the "blast epicenter" */
8648 if (breath && !path_n)
8654 flg &= ~(PROJECT_HIDE);
8658 /* Start the "explosion" */
8661 /* Hack -- make sure beams get to "explode" */
8669 /* If we found a "target", explode there */
8670 if (dist <= MAX_RANGE)
8672 /* Mega-Hack -- remove the final "beam" grid */
8673 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8676 * Create a conical breath attack
8687 flg &= ~(PROJECT_HIDE);
8689 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
8693 /* Determine the blast area, work from the inside out */
8694 for (dist = 0; dist <= rad; dist++)
8696 /* Scan the maximal blast area of radius "dist" */
8697 for (y = by - dist; y <= by + dist; y++)
8699 for (x = bx - dist; x <= bx + dist; x++)
8701 /* Ignore "illegal" locations */
8702 if (!in_bounds2(y, x)) continue;
8704 /* Enforce a "circular" explosion */
8705 if (distance(by, bx, y, x) != dist) continue;
8711 /* Lights are stopped by opaque terrains */
8712 if (!los(by, bx, y, x)) continue;
8714 case GF_DISINTEGRATE:
8715 /* Disintegration are stopped only by perma-walls */
8716 if (!in_disintegration_range(by, bx, y, x)) continue;
8719 /* Ball explosions are stopped by walls */
8720 if (!projectable(by, bx, y, x)) continue;
8724 /* Save this grid */
8731 /* Encode some more "radius" info */
8737 /* Speed -- ignore "non-explosions" */
8738 if (!grids) return (FALSE);
8741 /* Display the "blast area" if requested */
8742 if (!blind && !(flg & (PROJECT_HIDE)))
8744 /* Then do the "blast", from inside out */
8745 for (t = 0; t <= gm_rad; t++)
8747 /* Dump everything with this radius */
8748 for (i = gm[t]; i < gm[t+1]; i++)
8750 /* Extract the location */
8754 /* Only do visuals if the player can "see" the blast */
8755 if (panel_contains(y, x) && player_has_los_bold(y, x))
8764 /* Obtain the explosion pict */
8765 p = bolt_pict(y, x, y, x, typ);
8767 /* Extract attr/char */
8771 /* Visual effects -- Display */
8772 print_rel(c, a, y, x);
8776 /* Hack -- center the cursor */
8777 move_cursor_relative(by, bx);
8779 /* Flush each "radius" seperately */
8780 /*if (fresh_before)*/ Term_fresh();
8782 /* Delay (efficiently) */
8783 if (visual || drawn)
8785 Term_xtra(TERM_XTRA_DELAY, msec);
8789 /* Flush the erasing */
8792 /* Erase the explosion drawn above */
8793 for (i = 0; i < grids; i++)
8795 /* Extract the location */
8799 /* Hack -- Erase if needed */
8800 if (panel_contains(y, x) && player_has_los_bold(y, x))
8806 /* Hack -- center the cursor */
8807 move_cursor_relative(by, bx);
8809 /* Flush the explosion */
8810 /*if (fresh_before)*/ Term_fresh();
8815 /* Update stuff if needed */
8816 if (p_ptr->update) update_stuff();
8819 /* Check features */
8820 if (flg & (PROJECT_GRID))
8822 /* Start with "dist" of zero */
8825 /* Scan for features */
8826 for (i = 0; i < grids; i++)
8828 /* Hack -- Notice new "dist" values */
8829 if (gm[dist+1] == i) dist++;
8831 /* Get the grid location */
8835 /* Find the closest point in the blast */
8838 int d = dist_to_line(y, x, y1, x1, by, bx);
8840 /* Affect the grid */
8841 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8845 /* Affect the grid */
8846 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8851 /* Update stuff if needed */
8852 if (p_ptr->update) update_stuff();
8855 if (flg & (PROJECT_ITEM))
8857 /* Start with "dist" of zero */
8860 /* Scan for objects */
8861 for (i = 0; i < grids; i++)
8863 /* Hack -- Notice new "dist" values */
8864 if (gm[dist+1] == i) dist++;
8866 /* Get the grid location */
8870 /* Find the closest point in the blast */
8873 int d = dist_to_line(y, x, y1, x1, by, bx);
8875 /* Affect the object in the grid */
8876 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8880 /* Affect the object in the grid */
8881 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8887 /* Check monsters */
8888 if (flg & (PROJECT_KILL))
8895 /* Start with "dist" of zero */
8898 /* Scan for monsters */
8899 for (i = 0; i < grids; i++)
8903 /* Hack -- Notice new "dist" values */
8904 if (gm[dist + 1] == i) dist++;
8906 /* Get the grid location */
8910 /* A single bolt may be reflected */
8913 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
8914 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
8916 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
8919 int max_attempts = 10;
8921 /* Choose 'new' target */
8924 t_y = y_saver - 1 + randint1(3);
8925 t_x = x_saver - 1 + randint1(3);
8928 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
8930 if (max_attempts < 1)
8939 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
8940 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
8941 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
8942 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
8944 msg_print("The attack bounces!");
8947 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
8949 /* Reflected bolts randomly target either one */
8950 if (one_in_(2)) flg |= PROJECT_PLAYER;
8951 else flg &= ~(PROJECT_PLAYER);
8953 /* The bolt is reflected */
8954 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
8956 /* Don't affect the monster any longer */
8962 /* Find the closest point in the blast */
8965 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
8969 effective_dist = dist;
8973 /* There is the riding player on this monster */
8974 if (p_ptr->riding && player_bold(y, x))
8976 /* Aimed on the player */
8977 if (flg & PROJECT_PLAYER)
8979 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
8982 * A beam or bolt is well aimed
8984 * So don't affects the mount.
8991 * The spell is not well aimed,
8992 * So partly affect the mount too.
8999 * This grid is the original target.
9000 * Or aimed on your horse.
9002 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
9004 /* Hit the mount with full damage */
9008 * Otherwise this grid is not the
9009 * original target, it means that line
9010 * of fire is obstructed by this
9014 * A beam or bolt will hit either
9015 * player or mount. Choose randomly.
9017 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9021 /* Hit the mount with full damage */
9025 /* Hit the player later */
9026 flg |= PROJECT_PLAYER;
9028 /* Don't affect the mount */
9034 * The spell is not well aimed, so
9035 * partly affect both player and
9044 /* Affect the monster in the grid */
9045 if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
9049 /* Player affected one monster (without "jumping") */
9050 if (!who && (project_m_n == 1) && !jump)
9056 /* Track if possible */
9057 if (cave[y][x].m_idx > 0)
9059 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9061 /* Hack -- auto-recall */
9062 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9064 /* Hack - auto-track */
9065 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9072 if (flg & (PROJECT_KILL))
9074 /* Start with "dist" of zero */
9077 /* Scan for player */
9078 for (i = 0; i < grids; i++)
9082 /* Hack -- Notice new "dist" values */
9083 if (gm[dist+1] == i) dist++;
9085 /* Get the grid location */
9089 /* Affect the player? */
9090 if (!player_bold(y, x)) continue;
9092 /* Find the closest point in the blast */
9095 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9099 effective_dist = dist;
9102 /* Target may be your horse */
9105 /* Aimed on the player */
9106 if (flg & PROJECT_PLAYER)
9108 /* Hit the player with full damage */
9112 * Hack -- When this grid was not the
9113 * original target, a beam or bolt
9114 * would hit either player or mount,
9115 * and should be choosen randomly.
9117 * But already choosen to hit the
9118 * mount at this point.
9120 * Or aimed on your horse.
9122 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9125 * A beam or bolt is well aimed
9127 * So don't affects the player.
9134 * The spell is not well aimed,
9135 * So partly affect the player too.
9141 /* Affect the player */
9142 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9150 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9152 if (rakubadam_m > 0)
9154 if (rakuba(rakubadam_m, FALSE))
9157 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9159 msg_format("%^s has thrown you off!", m_name);
9163 if (p_ptr->riding && rakubadam_p > 0)
9165 if(rakuba(rakubadam_p, FALSE))
9168 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9170 msg_format("You have fallen from %s.", m_name);
9176 /* Return "something was noticed" */
9180 bool binding_field( int dam )
9182 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9183 int mirror_num=0; /* ¶À¤Î¿ô */
9188 int msec= delay_factor*delay_factor*delay_factor;
9194 /* Default target of monsterspell is player */
9195 monster_target_y=py;
9196 monster_target_x=px;
9198 for( x=0 ; x < cur_wid ; x++ )
9200 for( y=0 ; y < cur_hgt ; y++ )
9202 if( is_mirror_grid(&cave[y][x]) &&
9203 distance(py,px,y,x) <= MAX_RANGE &&
9204 distance(py,px,y,x) != 0 &&
9205 player_has_los_bold(y,x) &&
9206 projectable(py, px, y, x)
9208 mirror_y[mirror_num]=y;
9209 mirror_x[mirror_num]=x;
9215 if( mirror_num < 2 )return FALSE;
9217 point_x[0] = randint0( mirror_num );
9219 point_x[1] = randint0( mirror_num );
9221 while( point_x[0] == point_x[1] );
9223 point_y[0]=mirror_y[point_x[0]];
9224 point_x[0]=mirror_x[point_x[0]];
9225 point_y[1]=mirror_y[point_x[1]];
9226 point_x[1]=mirror_x[point_x[1]];
9230 x=point_x[0]+point_x[1]+point_x[2];
9231 y=point_y[0]+point_y[1]+point_y[2];
9233 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9234 - (point_y[0]*3-y)*(point_x[1]*3-x);
9235 if( centersign == 0 )return FALSE;
9237 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9238 x1 = x1 < point_x[2] ? x1 : point_x[2];
9239 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9240 y1 = y1 < point_y[2] ? y1 : point_y[2];
9242 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9243 x2 = x2 > point_x[2] ? x2 : point_x[2];
9244 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9245 y2 = y2 > point_y[2] ? y2 : point_y[2];
9247 for( y=y1 ; y <=y2 ; y++ ){
9248 for( x=x1 ; x <=x2 ; x++ ){
9249 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9250 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9251 centersign*( (point_x[1]-x)*(point_y[2]-y)
9252 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9253 centersign*( (point_x[2]-x)*(point_y[0]-y)
9254 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9256 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9257 /* Visual effects */
9259 && panel_contains(y,x)){
9260 p = bolt_pict(y,x,y,x, GF_MANA );
9261 print_rel(PICT_C(p), PICT_A(p),y,x);
9262 move_cursor_relative(y, x);
9263 /*if (fresh_before)*/ Term_fresh();
9264 Term_xtra(TERM_XTRA_DELAY, msec);
9270 for( y=y1 ; y <=y2 ; y++ ){
9271 for( x=x1 ; x <=x2 ; x++ ){
9272 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9273 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9274 centersign*( (point_x[1]-x)*(point_y[2]-y)
9275 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9276 centersign*( (point_x[2]-x)*(point_y[0]-y)
9277 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9279 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9280 (void)project_f(0,0,y,x,dam,GF_MANA);
9285 for( y=y1 ; y <=y2 ; y++ ){
9286 for( x=x1 ; x <=x2 ; x++ ){
9287 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9288 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9289 centersign*( (point_x[1]-x)*(point_y[2]-y)
9290 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9291 centersign*( (point_x[2]-x)*(point_y[0]-y)
9292 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9294 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9295 (void)project_o(0,0,y,x,dam,GF_MANA);
9300 for( y=y1 ; y <=y2 ; y++ ){
9301 for( x=x1 ; x <=x2 ; x++ ){
9302 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9303 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9304 centersign*( (point_x[1]-x)*(point_y[2]-y)
9305 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9306 centersign*( (point_x[2]-x)*(point_y[0]-y)
9307 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9309 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9310 (void)project_m(0,0,y,x,dam,GF_MANA,
9311 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9318 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9320 msg_print("The field broke a mirror");
9322 remove_mirror(point_y[0],point_x[0]);
9328 void seal_of_mirror( int dam )
9332 for( x = 0 ; x < cur_wid ; x++ )
9334 for( y = 0 ; y < cur_hgt ; y++ )
9336 if( is_mirror_grid(&cave[y][x]))
9338 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9339 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9341 if( !cave[y][x].m_idx )