3 * @brief 魔法による遠隔処理の実装 / Spell projection
7 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research,
9 * and not for profit purposes provided that this copyright and statement
10 * are included in all such copies. Other copyrights may also apply.
17 #include "object-curse.h"
18 #include "player-damage.h"
21 #include "monster-status.h"
22 #include "spells-summon.h"
23 #include "monsterrace-hook.h"
27 #include "projection.h"
33 static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
34 static int rakubadam_p; /*!< 落馬した際のダメージ量 */
36 int project_length = 0; /*!< 投射の射程距離 */
40 * @brief モンスター魅了用セービングスロー共通部(汎用系)
42 * @param m_ptr 対象モンスター
43 * @return 魅了に抵抗したらTRUE
45 static bool_hack common_saving_throw_charm(player_type *player_ptr, HIT_POINT pow, monster_type *m_ptr)
47 monster_race *r_ptr = &r_info[m_ptr->r_idx];
49 if(p_ptr->inside_arena) return TRUE;
52 if (r_ptr->flagsr & RFR_RES_ALL)
54 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
58 if (r_ptr->flags3 & RF3_NO_CONF)
60 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
64 if (r_ptr->flags1 & RF1_QUESTOR || m_ptr->mflag2 & MFLAG2_NOPET) return TRUE;
66 pow += (adj_chr_chm[player_ptr->stat_ind[A_CHR]] - 1);
67 if((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) pow = pow * 2 / 3;
68 return (r_ptr->level > randint1((pow - 10) < 1 ? 1 : (pow - 10)) + 5);
72 * @brief モンスター服従用セービングスロー共通部(部族依存系)
74 * @param m_ptr 対象モンスター
75 * @return 服従に抵抗したらTRUE
77 static bool_hack common_saving_throw_control(player_type *player_ptr, HIT_POINT pow, monster_type *m_ptr)
79 monster_race *r_ptr = &r_info[m_ptr->r_idx];
81 if (p_ptr->inside_arena) return TRUE;
84 if (r_ptr->flagsr & RFR_RES_ALL)
86 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
90 if (r_ptr->flags1 & RF1_QUESTOR || m_ptr->mflag2 & MFLAG2_NOPET) return TRUE;
92 pow += adj_chr_chm[player_ptr->stat_ind[A_CHR]] - 1;
93 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) pow = pow * 2 / 3;
94 return (r_ptr->level > randint1((pow - 10) < 1 ? 1 : (pow - 10)) + 5);
98 * @brief 一部ボルト魔法のビーム化確率を算出する / Prepare standard probability to become beam for fire_bolt_or_beam()
101 * ハードコーティングによる実装が行われている。
102 * メイジは(レベル)%、ハイメイジ、スペルマスターは(レベル)%、それ以外の職業は(レベル/2)%
104 PERCENTAGE beam_chance(void)
106 if (p_ptr->pclass == CLASS_MAGE)
107 return (PERCENTAGE)(p_ptr->lev);
108 if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
109 return (PERCENTAGE)(p_ptr->lev + 10);
111 return (PERCENTAGE)(p_ptr->lev / 2);
116 * @brief 配置した鏡リストの次を取得する /
117 * Get another mirror. for SEEKER
118 * @param next_y 次の鏡のy座標を返す参照ポインタ
119 * @param next_x 次の鏡のx座標を返す参照ポインタ
120 * @param cury 現在の鏡のy座標
121 * @param curx 現在の鏡のx座標
123 static void next_mirror(POSITION* next_y, POSITION* next_x, POSITION cury, POSITION curx)
125 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
126 int mirror_num = 0; /* 鏡の数 */
130 for (x = 0; x < cur_wid; x++)
132 for (y = 0; y < cur_hgt; y++)
134 if (is_mirror_grid(&cave[y][x])) {
135 mirror_y[mirror_num] = y;
136 mirror_x[mirror_num] = x;
143 num = randint0(mirror_num);
144 *next_y = mirror_y[num];
145 *next_x = mirror_x[num];
148 *next_y = cury + randint0(5) - 2;
149 *next_x = curx + randint0(5) - 2;
154 * @brief 万色表現用にランダムな色を選択する関数 /
155 * Get a legal "multi-hued" color for drawing "spells"
159 static TERM_COLOR mh_attr(int max)
161 switch (randint1(max))
163 case 1: return (TERM_RED);
164 case 2: return (TERM_GREEN);
165 case 3: return (TERM_BLUE);
166 case 4: return (TERM_YELLOW);
167 case 5: return (TERM_ORANGE);
168 case 6: return (TERM_VIOLET);
169 case 7: return (TERM_L_RED);
170 case 8: return (TERM_L_GREEN);
171 case 9: return (TERM_L_BLUE);
172 case 10: return (TERM_UMBER);
173 case 11: return (TERM_L_UMBER);
174 case 12: return (TERM_SLATE);
175 case 13: return (TERM_WHITE);
176 case 14: return (TERM_L_WHITE);
177 case 15: return (TERM_L_DARK);
185 * @brief 魔法属性に応じたエフェクトの色を返す /
186 * Return a color to use for the bolt/ball spells
190 static TERM_COLOR spell_color(int type)
192 /* Check if A.B.'s new graphics should be used (rr9) */
193 if (streq(ANGBAND_GRAF, "new") || streq(ANGBAND_GRAF, "ne2"))
198 case GF_PSY_SPEAR: return (0x06);
199 case GF_MISSILE: return (0x0F);
200 case GF_ACID: return (0x04);
201 case GF_ELEC: return (0x02);
202 case GF_FIRE: return (0x00);
203 case GF_COLD: return (0x01);
204 case GF_POIS: return (0x03);
205 case GF_HOLY_FIRE: return (0x00);
206 case GF_HELL_FIRE: return (0x00);
207 case GF_MANA: return (0x0E);
209 case GF_SEEKER: return (0x0E);
210 case GF_SUPER_RAY: return (0x0E);
212 case GF_ARROW: return (0x0F);
213 case GF_WATER: return (0x04);
214 case GF_NETHER: return (0x07);
215 case GF_CHAOS: return (mh_attr(15));
216 case GF_DISENCHANT: return (0x05);
217 case GF_NEXUS: return (0x0C);
218 case GF_CONFUSION: return (mh_attr(4));
219 case GF_SOUND: return (0x09);
220 case GF_SHARDS: return (0x08);
221 case GF_FORCE: return (0x09);
222 case GF_INERTIAL: return (0x09);
223 case GF_GRAVITY: return (0x09);
224 case GF_TIME: return (0x09);
225 case GF_LITE_WEAK: return (0x06);
226 case GF_LITE: return (0x06);
227 case GF_DARK_WEAK: return (0x07);
228 case GF_DARK: return (0x07);
229 case GF_PLASMA: return (0x0B);
230 case GF_METEOR: return (0x00);
231 case GF_ICE: return (0x01);
232 case GF_ROCKET: return (0x0F);
233 case GF_DEATH_RAY: return (0x07);
234 case GF_NUKE: return (mh_attr(2));
235 case GF_DISINTEGRATE: return (0x05);
247 case GF_CAUSE_4: return (0x0E);
248 case GF_HAND_DOOM: return (0x07);
249 case GF_CAPTURE : return (0x0E);
250 case GF_IDENTIFY: return (0x01);
251 case GF_ATTACK: return (0x0F);
252 case GF_PHOTO : return (0x06);
255 /* Normal tiles or ASCII */
261 /* Lookup the default colors for this type */
262 concptr s = quark_str(gf_color[type]);
264 if (!s) return (TERM_WHITE);
266 /* Pick a random color */
267 c = s[randint0(strlen(s))];
269 /* Lookup this color */
270 a = my_strchr(color_char, c) - color_char;
272 /* Invalid color (note check for < 0 removed, gave a silly
273 * warning because bytes are always >= 0 -- RG) */
274 if (a > 15) return (TERM_WHITE);
280 /* Standard "color" */
286 * @brief 始点から終点にかけた方向毎にボルトのキャラクタを返す /
287 * Find the attr/char pair to use for a spell effect
296 * It is moving (or has moved) from (x,y) to (nx,ny).
297 * If the distance is not "one", we (may) return "*".
300 u16b bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, EFFECT_ID typ)
310 if ((ny == y) && (nx == x)) base = 0x30;
313 else if (nx == x) base = 0x40;
316 else if (ny == y) base = 0x50;
319 else if ((ny - y) == (x - nx)) base = 0x60;
322 else if ((ny - y) == (nx - x)) base = 0x70;
327 /* Basic spell color */
328 k = spell_color(typ);
330 /* Obtain attr/char */
331 a = misc_to_attr[base + k];
332 c = misc_to_char[base + k];
341 * Mega-Hack -- track "affected" monsters (see "project()" comments)
343 static int project_m_n; /*!< 魔法効果範囲内にいるモンスターの数 */
344 static POSITION project_m_x; /*!< 処理中のモンスターX座標 */
345 static POSITION project_m_y; /*!< 処理中のモンスターY座標 */
346 /* Mega-Hack -- monsters target */
347 static POSITION monster_target_x; /*!< モンスターの攻撃目標X座標 */
348 static POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
352 * @brief 汎用的なビーム/ボルト/ボール系による地形効果処理 / We are called from "project()" to "damage" terrain features
353 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
354 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
355 * @param y 目標Y座標 / Target y location (or location to travel "towards")
356 * @param x 目標X座標 / Target x location (or location to travel "towards")
357 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
358 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
359 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
362 * We are called both for "beam" effects and "ball" effects.
364 * The "r" parameter is the "distance from ground zero".
366 * Note that we determine if the player can "see" anything that happens
367 * by taking into account: blindness, line-of-sight, and illumination.
369 * We return "TRUE" if the effect of the projection is "obvious".
371 * We also "see" grids which are "memorized", probably a hack
373 * Perhaps we should affect doors?
376 static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
378 cave_type *c_ptr = &cave[y][x];
379 feature_type *f_ptr = &f_info[c_ptr->feat];
381 bool obvious = FALSE;
382 bool known = player_has_los_bold(y, x);
387 /* Reduce damage by distance */
388 dam = (dam + r) / (r + 1);
391 if (have_flag(f_ptr->flags, FF_TREE))
399 message = _("枯れた", "was blasted."); break;
401 message = _("縮んだ", "shrank."); break;
403 message = _("溶けた", "melted."); break;
406 message = _("凍り、砕け散った", "was frozen and smashed."); break;
410 message = _("燃えた", "burns up!"); break;
422 message = _("粉砕された", "was crushed."); break;
424 message = NULL; break;
428 msg_format(_("木は%s。", "A tree %s"), message);
429 cave_set_feat(y, x, one_in_(3) ? feat_brake : feat_grass);
432 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
436 /* Analyze the type */
439 /* Ignore most effects */
474 /* Destroy Traps (and Locks) */
477 /* Reveal secret doors */
478 if (is_hidden_door(c_ptr))
483 /* Check line of sight */
491 if (is_trap(c_ptr->feat))
493 /* Check line of sight */
496 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
500 /* Destroy the trap */
501 cave_alter_feat(y, x, FF_DISARM);
504 /* Locked doors are unlocked */
505 if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
507 s16b old_feat = c_ptr->feat;
509 /* Unlock the door */
510 cave_alter_feat(y, x, FF_DISARM);
512 /* Check line of sound */
513 if (known && (old_feat != c_ptr->feat))
515 msg_print(_("カチッと音がした!", "Click!"));
520 /* Remove "unsafe" flag if player is not blind */
521 if (!p_ptr->blind && player_has_los_bold(y, x))
523 c_ptr->info &= ~(CAVE_UNSAFE);
531 /* Destroy Doors (and traps) */
534 /* Destroy all doors and traps */
535 if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
537 /* Check line of sight */
540 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
544 /* Destroy the feature */
545 cave_alter_feat(y, x, FF_TUNNEL);
548 /* Remove "unsafe" flag if player is not blind */
549 if (!p_ptr->blind && player_has_los_bold(y, x))
551 c_ptr->info &= ~(CAVE_UNSAFE);
559 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
561 if (have_flag(f_ptr->flags, FF_SPIKE))
563 s16b old_mimic = c_ptr->mimic;
564 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
566 cave_alter_feat(y, x, FF_SPIKE);
567 c_ptr->mimic = old_mimic;
572 /* Check line of sight */
573 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
575 msg_format(_("%sに何かがつっかえて開かなくなった。", "The %s seems stuck."), f_name + mimic_f_ptr->name);
582 /* Destroy walls (and doors) */
585 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
587 if (known && (c_ptr->info & (CAVE_MARK)))
589 msg_format(_("%sが溶けて泥になった!", "The %s turns into mud!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
593 /* Destroy the wall */
594 cave_alter_feat(y, x, FF_HURT_ROCK);
596 /* Update some things */
597 p_ptr->update |= (PU_FLOW);
606 /* Require a "naked" floor grid */
607 if (!cave_naked_bold(y, x)) break;
609 /* Not on the player */
610 if (player_bold(y, x)) break;
612 /* Create a closed door */
613 cave_set_feat(y, x, feat_door[DOOR_DOOR].closed);
616 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
633 /* Require a "naked" floor grid */
634 if (!cave_naked_bold(y, x)) break;
636 /* Not on the player */
637 if (player_bold(y, x)) break;
639 /* Create a closed door */
640 cave_set_feat(y, x, feat_tree);
643 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
651 /* Require a "naked" floor grid */
652 if (!cave_naked_bold(y, x)) break;
655 c_ptr->info |= CAVE_OBJECT;
656 c_ptr->mimic = feat_glyph;
667 /* Require a "naked" floor grid */
668 if (!cave_naked_bold(y, x)) break;
670 /* Not on the player */
671 if (player_bold(y, x)) break;
674 cave_set_feat(y, x, feat_granite);
682 /* Ignore permanent grid */
683 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
688 /* Ignore grid without enough space */
689 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
691 /* Place a shallow lava */
692 cave_set_feat(y, x, feat_shallow_lava);
697 /* Place a deep lava */
698 cave_set_feat(y, x, feat_deep_lava);
705 /* Ignore permanent grid */
706 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
711 /* Ignore grid without enough space */
712 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
714 /* Place a shallow water */
715 cave_set_feat(y, x, feat_shallow_water);
720 /* Place a deep water */
721 cave_set_feat(y, x, feat_deep_water);
726 /* Lite up the grid */
730 /* Turn on the light */
731 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
733 c_ptr->info |= (CAVE_GLOW);
736 update_local_illumination(y, x);
739 if (player_can_see_bold(y, x)) obvious = TRUE;
741 /* Mega-Hack -- Update the monster in the affected grid */
742 /* This allows "spear of light" (etc) to work "correctly" */
743 if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
745 if (p_ptr->special_defense & NINJA_S_STEALTH)
747 if (player_bold(y, x)) set_superstealth(FALSE);
754 /* Darken the grid */
758 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(c_ptr);
761 /* Turn off the light. */
764 if (dun_level || !is_daytime())
766 for (j = 0; j < 9; j++)
768 int by = y + ddy_ddd[j];
769 int bx = x + ddx_ddd[j];
771 if (in_bounds2(by, bx))
773 cave_type *cc_ptr = &cave[by][bx];
775 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
786 c_ptr->info &= ~(CAVE_GLOW);
788 /* Hack -- Forget "boring" grids */
789 if (!have_flag(f_ptr->flags, FF_REMEMBER))
792 c_ptr->info &= ~(CAVE_MARK);
799 update_local_illumination(y, x);
801 if (player_can_see_bold(y, x)) obvious = TRUE;
803 /* Mega-Hack -- Update the monster in the affected grid */
804 /* This allows "spear of light" (etc) to work "correctly" */
805 if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
815 if (is_mirror_grid(c_ptr))
817 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
820 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
823 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 50))
825 if (known && (c_ptr->info & CAVE_MARK))
827 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
831 /* Destroy the wall */
832 cave_alter_feat(y, x, FF_HURT_ROCK);
834 /* Update some things */
835 p_ptr->update |= (PU_FLOW);
842 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
844 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
847 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
850 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 200))
852 if (known && (c_ptr->info & CAVE_MARK))
854 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
858 /* Destroy the wall */
859 cave_alter_feat(y, x, FF_HURT_ROCK);
861 /* Update some things */
862 p_ptr->update |= (PU_FLOW);
867 case GF_DISINTEGRATE:
869 /* Destroy mirror/glyph */
870 if (is_mirror_grid(c_ptr) || is_glyph_grid(c_ptr) || is_explosive_rune_grid(c_ptr))
873 /* Permanent features don't get effect */
874 /* But not protect monsters and other objects */
875 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
877 cave_alter_feat(y, x, FF_HURT_DISI);
879 /* Update some things -- similar to GF_KILL_WALL */
880 p_ptr->update |= (PU_FLOW);
887 /* Return "Anything seen?" */
894 * @brief 汎用的なビーム/ボルト/ボール系によるアイテムオブジェクトへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
895 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
896 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
897 * @param y 目標Y座標 / Target y location (or location to travel "towards")
898 * @param x 目標X座標 / Target x location (or location to travel "towards")
899 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
900 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
901 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
904 * We are called from "project()" to "damage" objects
906 * We are called both for "beam" effects and "ball" effects.
908 * Perhaps we should only SOMETIMES damage things on the ground.
910 * The "r" parameter is the "distance from ground zero".
912 * Note that we determine if the player can "see" anything that happens
913 * by taking into account: blindness, line-of-sight, and illumination.
915 * We also "see" grids which are "memorized", probably a hack
917 * We return "TRUE" if the effect of the projection is "obvious".
920 static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
922 cave_type *c_ptr = &cave[y][x];
924 OBJECT_IDX this_o_idx, next_o_idx = 0;
926 bool obvious = FALSE;
927 bool known = player_has_los_bold(y, x);
929 BIT_FLAGS flgs[TR_FLAG_SIZE];
931 GAME_TEXT o_name[MAX_NLEN];
933 KIND_OBJECT_IDX k_idx = 0;
934 bool is_potion = FALSE;
939 /* Reduce damage by distance */
940 dam = (dam + r) / (r + 1);
943 /* Scan all objects in the grid */
944 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
946 object_type *o_ptr = &o_list[this_o_idx];
950 bool do_kill = FALSE;
952 concptr note_kill = NULL;
955 /* Get the "plural"-ness */
956 bool plural = (o_ptr->number > 1);
959 /* Acquire next object */
960 next_o_idx = o_ptr->next_o_idx;
961 object_flags(o_ptr, flgs);
963 /* Check for artifact */
964 if (object_is_artifact(o_ptr)) is_art = TRUE;
966 /* Analyze the type */
969 /* Acid -- Lots of things */
972 if (hates_acid(o_ptr))
975 note_kill = _("融けてしまった!", (plural ? " melt!" : " melts!"));
976 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
981 /* Elec -- Rings and Wands */
984 if (hates_elec(o_ptr))
987 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
988 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
993 /* Fire -- Flammable objects */
996 if (hates_fire(o_ptr))
999 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1000 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1005 /* Cold -- potions and flasks */
1008 if (hates_cold(o_ptr))
1010 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1012 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1020 if (hates_fire(o_ptr))
1023 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1024 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1026 if (hates_elec(o_ptr))
1030 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1031 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1039 if (hates_fire(o_ptr))
1042 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1043 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1045 if (hates_cold(o_ptr))
1049 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1050 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1055 /* Hack -- break potions and such */
1061 if (hates_cold(o_ptr))
1063 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1069 /* Mana and Chaos -- destroy everything */
1075 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1079 case GF_DISINTEGRATE:
1082 note_kill = _("蒸発してしまった!", (plural ? " evaporate!" : " evaporates!"));
1089 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1090 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1091 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1095 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1099 if (object_is_cursed(o_ptr))
1102 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1109 identify_item(o_ptr);
1111 /* Auto-inscription */
1112 autopick_alter_item((-this_o_idx), FALSE);
1120 /* Chests are noticed only if trapped or locked */
1121 if (o_ptr->tval == TV_CHEST)
1123 /* Disarm/Unlock traps */
1124 if (o_ptr->pval > 0)
1126 /* Disarm or Unlock */
1127 o_ptr->pval = (0 - o_ptr->pval);
1130 object_known(o_ptr);
1132 if (known && (o_ptr->marked & OM_FOUND))
1134 msg_print(_("カチッと音がした!", "Click!"));
1144 if (o_ptr->tval == TV_CORPSE)
1147 BIT_FLAGS mode = 0L;
1149 if (!who || is_pet(&m_list[who]))
1150 mode |= PM_FORCE_PET;
1152 for (i = 0; i < o_ptr->number ; i++)
1154 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1155 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1159 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
1163 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1165 note_kill = _("生き返った。", " revived.");
1167 else if (!note_kill)
1169 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
1180 /* Attempt to destroy the object */
1183 /* Effect "observed" */
1184 if (known && (o_ptr->marked & OM_FOUND))
1187 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1190 /* Artifacts, and other objects, get to resist */
1191 if (is_art || ignore)
1193 /* Observe the resist */
1194 if (known && (o_ptr->marked & OM_FOUND))
1196 msg_format(_("%sは影響を受けない!",
1197 (plural ? "The %s are unaffected!" : "The %s is unaffected!")), o_name);
1204 /* Describe if needed */
1205 if (known && (o_ptr->marked & OM_FOUND) && note_kill)
1207 msg_format(_("%sは%s", "The %s%s"), o_name, note_kill);
1210 k_idx = o_ptr->k_idx;
1211 is_potion = object_is_potion(o_ptr);
1212 delete_object_idx(this_o_idx);
1214 /* Potions produce effects when 'shattered' */
1217 (void)potion_smash_effect(who, y, x, k_idx);
1225 /* Return "Anything seen?" */
1231 * @brief 汎用的なビーム/ボルト/ボール系によるモンスターへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
1232 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
1233 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
1234 * @param y 目標Y座標 / Target y location (or location to travel "towards")
1235 * @param x 目標X座標 / Target x location (or location to travel "towards")
1236 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
1237 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
1239 * @param see_s_msg TRUEならばメッセージを表示する
1240 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
1243 * This routine takes a "source monster" (by index) which is mostly used to
1244 * determine if the player is causing the damage, and a "radius" (see below),
1245 * which is used to decrease the power of explosions with distance, and a
1246 * location, via integers which are modified by certain types of attacks
1247 * (polymorph and teleport being the obvious ones), a default damage, which
1248 * is modified as needed based on various properties, and finally a "damage
1249 * type" (see below).
1252 * Note that this routine can handle "no damage" attacks (like teleport) by
1253 * taking a "zero" damage, and can even take "parameters" to attacks (like
1254 * confuse) by accepting a "damage", using it to calculate the effect, and
1255 * then setting the damage to zero. Note that the "damage" parameter is
1256 * divided by the radius, so monsters not at the "epicenter" will not take
1257 * as much damage (or whatever)...
1260 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1261 * may result in a dereference of an invalid pointer.
1264 * Various messages are produced, and damage is applied.
1267 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1268 * actually be "made" of that substance, or "breathe" big balls of it.
1269 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1271 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1272 * and hurts evil less. If can breath nether, then it resists it as well.
1275 * Damage reductions use the following formulas:
1276 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1277 * gives avg damage of .655, ranging from .858 to .500
1278 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1279 * gives avg damage of .544, ranging from .714 to .417
1280 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1281 * gives avg damage of .444, ranging from .556 to .333
1282 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1283 * gives avg damage of .327, ranging from .427 to .250
1284 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1285 * gives something simple.
1288 * In this function, "result" messages are postponed until the end, where
1289 * the "note" string is appended to the monster name, if not NULL. So,
1290 * to make a spell have "no effect" just set "note" to NULL. You should
1291 * also set "notice" to FALSE, or the player will learn what the spell does.
1294 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1298 static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, bool see_s_msg)
1302 cave_type *c_ptr = &cave[y][x];
1304 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1305 monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
1307 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1311 /* Is the monster "seen"? */
1312 bool seen = m_ptr->ml;
1313 bool seen_msg = is_seen(m_ptr);
1315 bool slept = (bool)MON_CSLEEP(m_ptr);
1317 /* Were the effects "obvious" (if seen)? */
1318 bool obvious = FALSE;
1320 /* Can the player know about this effect? */
1321 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1323 /* Were the effects "irrelevant"? */
1324 bool skipped = FALSE;
1326 /* Gets the monster angry at the source of the effect? */
1327 bool get_angry = FALSE;
1329 /* Polymorph setting (true or false) */
1330 bool do_poly = FALSE;
1332 /* Teleport setting (max distance) */
1335 /* Confusion setting (amount to confuse) */
1338 /* Stunning setting (amount to stun) */
1341 /* Sleep amount (amount to sleep) */
1344 /* Fear amount (amount to fear) */
1347 /* Time amount (amount to time) */
1350 bool heal_leper = FALSE;
1352 /* Hold the monster name */
1353 GAME_TEXT m_name[MAX_NLEN];
1356 PARAMETER_VALUE photo = 0;
1358 /* Assume no note */
1359 concptr note = NULL;
1361 /* Assume a default death */
1362 concptr note_dies = extract_note_dies(real_r_idx(m_ptr));
1364 POSITION ty = m_ptr->fy;
1365 POSITION tx = m_ptr->fx;
1367 DEPTH caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1370 if (!c_ptr->m_idx) return (FALSE);
1372 /* Never affect projector */
1373 if (who && (c_ptr->m_idx == who)) return (FALSE);
1374 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1375 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1377 /* Don't affect already death monsters */
1378 /* Prevents problems with chain reactions of exploding monsters */
1379 if (m_ptr->hp < 0) return (FALSE);
1381 /* Reduce damage by distance */
1382 dam = (dam + r) / (r + 1);
1385 /* Get the monster name (BEFORE polymorphing) */
1386 monster_desc(m_name, m_ptr, 0);
1388 /* Get the monster possessive ("his"/"her"/"its") */
1389 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1391 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
1393 /* Analyze the damage type */
1396 /* Magic Missile -- pure damage */
1399 if (seen) obvious = TRUE;
1401 if (r_ptr->flagsr & RFR_RES_ALL)
1403 note = _("には完全な耐性がある!", " is immune.");
1405 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1414 if (seen) obvious = TRUE;
1416 if (r_ptr->flagsr & RFR_RES_ALL)
1418 note = _("には完全な耐性がある!", " is immune.");
1420 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1423 if (r_ptr->flagsr & RFR_IM_ACID)
1425 note = _("にはかなり耐性がある!", " resists a lot.");
1427 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1435 if (seen) obvious = TRUE;
1437 if (r_ptr->flagsr & RFR_RES_ALL)
1439 note = _("には完全な耐性がある!", " is immune.");
1441 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1444 if (r_ptr->flagsr & RFR_IM_ELEC)
1446 note = _("にはかなり耐性がある!", " resists a lot.");
1448 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1456 if (seen) obvious = TRUE;
1458 if (r_ptr->flagsr & RFR_RES_ALL)
1460 note = _("には完全な耐性がある!", " is immune.");
1462 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1465 if (r_ptr->flagsr & RFR_IM_FIRE)
1467 note = _("にはかなり耐性がある!", " resists a lot.");
1469 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1471 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1473 note = _("はひどい痛手をうけた。", " is hit hard.");
1475 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1483 if (seen) obvious = TRUE;
1485 if (r_ptr->flagsr & RFR_RES_ALL)
1487 note = _("には完全な耐性がある!", " is immune.");
1489 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1492 if (r_ptr->flagsr & RFR_IM_COLD)
1494 note = _("にはかなり耐性がある!", " resists a lot.");
1496 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1498 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1500 note = _("はひどい痛手をうけた。", " is hit hard.");
1502 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1510 if (seen) obvious = TRUE;
1512 if (r_ptr->flagsr & RFR_RES_ALL)
1514 note = _("には完全な耐性がある!", " is immune.");
1516 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1519 if (r_ptr->flagsr & RFR_IM_POIS)
1521 note = _("にはかなり耐性がある!", " resists a lot.");
1523 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1531 if (seen) obvious = TRUE;
1533 if (r_ptr->flagsr & RFR_RES_ALL)
1535 note = _("には完全な耐性がある!", " is immune.");
1537 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1540 if (r_ptr->flagsr & RFR_IM_POIS)
1542 note = _("には耐性がある。", " resists.");
1543 dam *= 3; dam /= randint1(6) + 6;
1544 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1546 else if (one_in_(3)) do_poly = TRUE;
1550 /* Hellfire -- hurts Evil */
1553 if (seen) obvious = TRUE;
1555 if (r_ptr->flagsr & RFR_RES_ALL)
1557 note = _("には完全な耐性がある!", " is immune.");
1559 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1562 if (r_ptr->flags3 & RF3_GOOD)
1564 note = _("はひどい痛手をうけた。", " is hit hard.");
1566 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1571 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1574 if (seen) obvious = TRUE;
1576 if (r_ptr->flagsr & RFR_RES_ALL)
1578 note = _("には完全な耐性がある!", " is immune.");
1580 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1583 if (r_ptr->flags3 & RF3_GOOD)
1585 note = _("には完全な耐性がある!", " is immune.");
1587 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
1589 else if (r_ptr->flags3 & RF3_EVIL)
1592 note = _("はひどい痛手をうけた。", " is hit hard.");
1593 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
1597 note = _("には耐性がある。", " resists.");
1598 dam *= 3; dam /= randint1(6) + 6;
1603 /* Arrow -- XXX no defense */
1606 if (seen) obvious = TRUE;
1608 if (r_ptr->flagsr & RFR_RES_ALL)
1610 note = _("には完全な耐性がある!", " is immune.");
1612 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1618 /* Plasma -- XXX perhaps check ELEC or FIRE */
1621 if (seen) obvious = TRUE;
1623 if (r_ptr->flagsr & RFR_RES_ALL)
1625 note = _("には完全な耐性がある!", " is immune.");
1627 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1630 if (r_ptr->flagsr & RFR_RES_PLAS)
1632 note = _("には耐性がある。", " resists.");
1633 dam *= 3; dam /= randint1(6) + 6;
1634 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
1639 /* Nether -- see above */
1642 if (seen) obvious = TRUE;
1644 if (r_ptr->flagsr & RFR_RES_ALL)
1646 note = _("には完全な耐性がある!", " is immune.");
1648 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1651 if (r_ptr->flagsr & RFR_RES_NETH)
1653 if (r_ptr->flags3 & RF3_UNDEAD)
1655 note = _("には完全な耐性がある!", " is immune.");
1657 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
1661 note = _("には耐性がある。", " resists.");
1662 dam *= 3; dam /= randint1(6) + 6;
1664 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
1666 else if (r_ptr->flags3 & RF3_EVIL)
1668 note = _("はいくらか耐性を示した。", " resists somewhat.");
1670 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
1675 /* Water (acid) damage -- Water spirits/elementals are immune */
1678 if (seen) obvious = TRUE;
1680 if (r_ptr->flagsr & RFR_RES_ALL)
1682 note = _("には完全な耐性がある!", " is immune.");
1684 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1687 if (r_ptr->flagsr & RFR_RES_WATE)
1689 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
1691 note = _("には完全な耐性がある!", " is immune.");
1696 note = _("には耐性がある。", " resists.");
1697 dam *= 3; dam /= randint1(6) + 6;
1699 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
1704 /* Chaos -- Chaos breathers resist */
1707 if (seen) obvious = TRUE;
1709 if (r_ptr->flagsr & RFR_RES_ALL)
1711 note = _("には完全な耐性がある!", " is immune.");
1713 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1716 if (r_ptr->flagsr & RFR_RES_CHAO)
1718 note = _("には耐性がある。", " resists.");
1719 dam *= 3; dam /= randint1(6) + 6;
1720 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
1722 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
1724 note = _("はいくらか耐性を示した。", " resists somewhat.");
1725 dam *= 3; dam /= randint1(6) + 6;
1726 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
1731 do_conf = (5 + randint1(11) + r) / (r + 1);
1736 /* Shards -- Shard breathers resist */
1739 if (seen) obvious = TRUE;
1741 if (r_ptr->flagsr & RFR_RES_ALL)
1743 note = _("には完全な耐性がある!", " is immune.");
1745 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1748 if (r_ptr->flagsr & RFR_RES_SHAR)
1750 note = _("には耐性がある。", " resists.");
1751 dam *= 3; dam /= randint1(6) + 6;
1752 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1757 /* Rocket: Shard resistance helps */
1760 if (seen) obvious = TRUE;
1762 if (r_ptr->flagsr & RFR_RES_ALL)
1764 note = _("には完全な耐性がある!", " is immune.");
1766 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1769 if (r_ptr->flagsr & RFR_RES_SHAR)
1771 note = _("はいくらか耐性を示した。", " resists somewhat.");
1773 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1779 /* Sound -- Sound breathers resist */
1782 if (seen) obvious = TRUE;
1784 if (r_ptr->flagsr & RFR_RES_ALL)
1786 note = _("には完全な耐性がある!", " is immune.");
1788 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1791 if (r_ptr->flagsr & RFR_RES_SOUN)
1793 note = _("には耐性がある。", " resists.");
1794 dam *= 2; dam /= randint1(6) + 6;
1795 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
1797 else do_stun = (10 + randint1(15) + r) / (r + 1);
1804 if (seen) obvious = TRUE;
1806 if (r_ptr->flagsr & RFR_RES_ALL)
1808 note = _("には完全な耐性がある!", " is immune.");
1810 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1813 if (r_ptr->flags3 & RF3_NO_CONF)
1815 note = _("には耐性がある。", " resists.");
1816 dam *= 3; dam /= randint1(6) + 6;
1817 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1819 else do_conf = (10 + randint1(15) + r) / (r + 1);
1823 /* Disenchantment -- Breathers and Disenchanters resist */
1826 if (seen) obvious = TRUE;
1828 if (r_ptr->flagsr & RFR_RES_ALL)
1830 note = _("には完全な耐性がある!", " is immune.");
1832 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1835 if (r_ptr->flagsr & RFR_RES_DISE)
1837 note = _("には耐性がある。", " resists.");
1838 dam *= 3; dam /= randint1(6) + 6;
1839 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
1844 /* Nexus -- Breathers and Existers resist */
1847 if (seen) obvious = TRUE;
1849 if (r_ptr->flagsr & RFR_RES_ALL)
1851 note = _("には完全な耐性がある!", " is immune.");
1853 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1856 if (r_ptr->flagsr & RFR_RES_NEXU)
1858 note = _("には耐性がある。", " resists.");
1859 dam *= 3; dam /= randint1(6) + 6;
1860 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
1868 if (seen) obvious = TRUE;
1870 if (r_ptr->flagsr & RFR_RES_ALL)
1872 note = _("には完全な耐性がある!", " is immune.");
1874 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1877 if (r_ptr->flagsr & RFR_RES_WALL)
1879 note = _("には耐性がある。", " resists.");
1880 dam *= 3; dam /= randint1(6) + 6;
1881 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
1883 else do_stun = (randint1(15) + r) / (r + 1);
1887 /* Inertia -- breathers resist */
1890 if (seen) obvious = TRUE;
1892 if (r_ptr->flagsr & RFR_RES_ALL)
1894 note = _("には完全な耐性がある!", " is immune.");
1896 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1899 if (r_ptr->flagsr & RFR_RES_INER)
1901 note = _("には耐性がある。", " resists.");
1902 dam *= 3; dam /= randint1(6) + 6;
1903 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
1907 /* Powerful monsters can resist */
1908 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1909 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1913 /* Normal monsters slow down */
1916 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1918 note = _("の動きが遅くなった。", " starts moving slower.");
1925 /* Time -- breathers resist */
1928 if (seen) obvious = TRUE;
1930 if (r_ptr->flagsr & RFR_RES_ALL)
1932 note = _("には完全な耐性がある!", " is immune.");
1934 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1937 if (r_ptr->flagsr & RFR_RES_TIME)
1939 note = _("には耐性がある。", " resists.");
1940 dam *= 3; dam /= randint1(6) + 6;
1941 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
1943 else do_time = (dam + 1) / 2;
1947 /* Gravity -- breathers resist */
1950 bool resist_tele = FALSE;
1952 if (seen) obvious = TRUE;
1954 if (r_ptr->flagsr & RFR_RES_ALL)
1956 note = _("には完全な耐性がある!", " is immune.");
1958 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1961 if (r_ptr->flagsr & RFR_RES_TELE)
1963 if (r_ptr->flags1 & (RF1_UNIQUE))
1965 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1966 note = _("には効果がなかった。", " is unaffected!");
1969 else if (r_ptr->level > randint1(100))
1971 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1972 note = _("には耐性がある!", " resists!");
1977 if (!resist_tele) do_dist = 10;
1979 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1981 if (r_ptr->flagsr & RFR_RES_GRAV)
1983 note = _("には耐性がある!", " resists!");
1984 dam *= 3; dam /= randint1(6) + 6;
1986 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
1991 /* Powerful monsters can resist */
1992 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1993 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1997 /* Normal monsters slow down */
2000 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2002 note = _("の動きが遅くなった。", " starts moving slower.");
2007 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2009 /* Attempt a saving throw */
2010 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2011 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2015 /* No obvious effect */
2016 note = _("には効果がなかった。", " is unaffected!");
2028 if (seen) obvious = TRUE;
2030 if (r_ptr->flagsr & RFR_RES_ALL)
2032 note = _("には完全な耐性がある!", " is immune.");
2034 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2042 case GF_DISINTEGRATE:
2044 if (seen) obvious = TRUE;
2046 if (r_ptr->flagsr & RFR_RES_ALL)
2048 note = _("には完全な耐性がある!", " is immune.");
2050 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2053 if (r_ptr->flags3 & RF3_HURT_ROCK)
2055 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2056 note = _("の皮膚がただれた!", " loses some skin!");
2057 note_dies = _("は蒸発した!", " evaporates!");
2065 if (seen) obvious = TRUE;
2067 /* PSI only works if the monster can see you! -- RG */
2068 if (!(los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)))
2071 msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), m_name);
2076 if (r_ptr->flagsr & RFR_RES_ALL)
2078 note = _("には完全な耐性がある!", " is immune.");
2080 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2083 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2086 note = _("には完全な耐性がある!", " is immune.");
2087 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2090 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2091 (r_ptr->flags3 & RF3_ANIMAL) ||
2092 (r_ptr->level > randint1(3 * dam)))
2094 note = _("には耐性がある!", " resists!");
2098 * Powerful demons & undead can turn a mindcrafter's
2099 * attacks back on them
2101 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2102 (r_ptr->level > p_ptr->lev / 2) &&
2106 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2107 (seen ? "%^s's corrupted mind backlashes your attack!" :
2108 "%^ss corrupted mind backlashes your attack!")), m_name);
2111 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
2113 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
2117 /* Injure +/- confusion */
2118 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2119 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2120 if (one_in_(4) && !CHECK_MULTISHADOW())
2122 switch (randint1(4))
2125 set_confused(p_ptr->confused + 3 + randint1(dam));
2128 set_stun(p_ptr->stun + randint1(dam));
2132 if (r_ptr->flags3 & RF3_NO_FEAR)
2133 note = _("には効果がなかった。", " is unaffected.");
2135 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2139 if (!p_ptr->free_act)
2140 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2149 if ((dam > 0) && one_in_(4))
2151 switch (randint1(4))
2154 do_conf = 3 + randint1(dam);
2157 do_stun = 3 + randint1(dam);
2160 do_fear = 3 + randint1(dam);
2163 note = _("は眠り込んでしまった!", " falls asleep!");
2164 do_sleep = 3 + randint1(dam);
2169 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
2175 if (seen) obvious = TRUE;
2177 if (r_ptr->flagsr & RFR_RES_ALL)
2179 note = _("には完全な耐性がある!", " is immune.");
2181 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2184 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2187 note = _("には完全な耐性がある!", " is immune.");
2189 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2190 (r_ptr->flags3 & RF3_ANIMAL) ||
2191 (r_ptr->level > randint1(3 * dam)))
2193 note = _("には耐性がある!", " resists!");
2197 * Powerful demons & undead can turn a mindcrafter's
2198 * attacks back on them
2200 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2201 (r_ptr->level > p_ptr->lev / 2) &&
2205 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2206 (seen ? "%^s's corrupted mind backlashes your attack!" :
2207 "%^ss corrupted mind backlashes your attack!")), m_name);
2209 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
2211 msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
2215 /* Injure + mana drain */
2216 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2217 if (!CHECK_MULTISHADOW())
2219 msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
2220 p_ptr->csp -= damroll(5, dam) / 2;
2221 if (p_ptr->csp < 0) p_ptr->csp = 0;
2222 p_ptr->redraw |= PR_MANA;
2223 p_ptr->window |= (PW_SPELL);
2225 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2232 int b = damroll(5, dam) / 4;
2233 concptr str = (p_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
2234 concptr msg = _("あなたは%sの苦痛を%sに変換した!",
2235 (seen ? "You convert %s's pain into %s!" :
2236 "You convert %ss pain into %s!"));
2237 msg_format(msg, m_name, str);
2239 b = MIN(p_ptr->msp, p_ptr->csp + b);
2241 p_ptr->redraw |= PR_MANA;
2242 p_ptr->window |= (PW_SPELL);
2244 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
2248 case GF_TELEKINESIS:
2250 if (seen) obvious = TRUE;
2252 if (r_ptr->flagsr & RFR_RES_ALL)
2254 note = _("には完全な耐性がある!", " is immune.");
2256 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2261 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2266 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2268 /* Attempt a saving throw */
2269 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2270 (r_ptr->level > 5 + randint1(dam)))
2274 /* No obvious effect */
2280 /* Psycho-spear -- powerful magic missile */
2283 if (seen) obvious = TRUE;
2285 if (r_ptr->flagsr & RFR_RES_ALL)
2287 note = _("には完全な耐性がある!", " is immune.");
2289 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2295 /* Meteor -- powerful magic missile */
2298 if (seen) obvious = TRUE;
2300 if (r_ptr->flagsr & RFR_RES_ALL)
2302 note = _("には完全な耐性がある!", " is immune.");
2304 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2312 if (!is_hostile(m_ptr)) break;
2314 if (seen) obvious = TRUE;
2316 if (r_ptr->flagsr & RFR_RES_ALL)
2318 note = _("には効果がなかった!", " is immune.");
2320 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2323 /* Attempt a saving throw */
2324 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
2325 (r_ptr->flags3 & RF3_NO_CONF) ||
2326 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2328 /* Memorize a flag */
2329 if (r_ptr->flags3 & RF3_NO_CONF)
2331 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2338 * Powerful demons & undead can turn a mindcrafter's
2339 * attacks back on them
2341 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2342 (r_ptr->level > p_ptr->lev / 2) &&
2346 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2347 (seen ? "%^s's corrupted mind backlashes your attack!" :
2348 "%^ss corrupted mind backlashes your attack!")), m_name);
2351 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2353 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
2357 /* Confuse, stun, terrify */
2358 switch (randint1(4))
2361 set_stun(p_ptr->stun + dam / 2);
2364 set_confused(p_ptr->confused + dam / 2);
2368 if (r_ptr->flags3 & RF3_NO_FEAR)
2369 note = _("には効果がなかった。", " is unaffected.");
2371 set_afraid(p_ptr->afraid + dam);
2378 /* No obvious effect */
2379 note = _("には効果がなかった。", " is unaffected.");
2385 if (!common_saving_throw_charm(p_ptr, dam, m_ptr))
2387 note = _("があなたに隷属した。", " is in your thrall!");
2392 switch (randint1(4))
2406 /* No "real" damage */
2413 /* Ice -- Cold + Cuts + Stun */
2416 if (seen) obvious = TRUE;
2418 if (r_ptr->flagsr & RFR_RES_ALL)
2420 note = _("には完全な耐性がある!", " is immune.");
2422 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2425 do_stun = (randint1(15) + 1) / (r + 1);
2426 if (r_ptr->flagsr & RFR_IM_COLD)
2428 note = _("にはかなり耐性がある!", " resists a lot.");
2430 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
2432 else if (r_ptr->flags3 & (RF3_HURT_COLD))
2434 note = _("はひどい痛手をうけた。", " is hit hard.");
2436 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
2443 case GF_HYPODYNAMIA:
2445 if (seen) obvious = TRUE;
2447 if (r_ptr->flagsr & RFR_RES_ALL)
2449 note = _("には完全な耐性がある!", " is immune.");
2451 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2454 if (!monster_living(m_ptr->r_idx))
2456 if (is_original_ap_and_seen(m_ptr))
2458 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2459 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2460 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2462 note = _("には効果がなかった。", " is unaffected.");
2466 else do_time = (dam+7)/8;
2474 if (seen) obvious = TRUE;
2476 if (r_ptr->flagsr & RFR_RES_ALL)
2478 note = _("には完全な耐性がある!", " is immune.");
2480 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2483 if (!monster_living(m_ptr->r_idx))
2485 if (is_original_ap_and_seen(m_ptr))
2487 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2488 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2489 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2491 note = _("には完全な耐性がある!", " is immune.");
2495 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
2496 (randint1(888) != 666)) ||
2497 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
2498 randint1(100) != 66))
2500 note = _("には耐性がある!", " resists!");
2508 /* Polymorph monster (Use "dam" as "power") */
2511 if (seen) obvious = TRUE;
2513 if (r_ptr->flagsr & RFR_RES_ALL)
2515 note = _("には効果がなかった。", " is unaffected.");
2517 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2520 /* Attempt to polymorph (see below) */
2523 /* Powerful monsters can resist */
2524 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2525 (r_ptr->flags1 & RF1_QUESTOR) ||
2526 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2528 note = _("には効果がなかった。", " is unaffected.");
2533 /* No "real" damage */
2540 /* Clone monsters (Ignore "dam") */
2543 if (seen) obvious = TRUE;
2545 if ((p_ptr->inside_arena) || is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
2547 note = _("には効果がなかった。", " is unaffected.");
2552 m_ptr->hp = m_ptr->maxhp;
2554 /* Attempt to clone. */
2555 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
2557 note = _("が分裂した!", " spawns!");
2561 /* No "real" damage */
2568 /* Heal Monster (use "dam" as amount of healing) */
2571 if (seen) obvious = TRUE;
2574 (void)set_monster_csleep(c_ptr->m_idx, 0);
2576 if (m_ptr->maxhp < m_ptr->max_maxhp)
2578 if (seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), m_name, m_poss);
2579 m_ptr->maxhp = m_ptr->max_maxhp;
2584 /* Redraw (later) if needed */
2585 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2586 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2594 if (seen) obvious = TRUE;
2597 (void)set_monster_csleep(c_ptr->m_idx, 0);
2598 if (MON_STUNNED(m_ptr))
2600 if (seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), m_name);
2601 (void)set_monster_stunned(c_ptr->m_idx, 0);
2603 if (MON_CONFUSED(m_ptr))
2605 if (seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), m_name);
2606 (void)set_monster_confused(c_ptr->m_idx, 0);
2608 if (MON_MONFEAR(m_ptr))
2610 if (seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name);
2611 (void)set_monster_monfear(c_ptr->m_idx, 0);
2615 if (m_ptr->hp < 30000) m_ptr->hp += dam;
2618 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2622 chg_virtue(V_VITALITY, 1);
2624 if (r_ptr->flags1 & RF1_UNIQUE)
2625 chg_virtue(V_INDIVIDUALISM, 1);
2627 if (is_friendly(m_ptr))
2628 chg_virtue(V_HONOUR, 1);
2629 else if (!(r_ptr->flags3 & RF3_EVIL))
2631 if (r_ptr->flags3 & RF3_GOOD)
2632 chg_virtue(V_COMPASSION, 2);
2634 chg_virtue(V_COMPASSION, 1);
2637 if (r_ptr->flags3 & RF3_ANIMAL)
2638 chg_virtue(V_NATURE, 1);
2641 if (m_ptr->r_idx == MON_LEPER)
2644 if (!who) chg_virtue(V_COMPASSION, 5);
2647 /* Redraw (later) if needed */
2648 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2649 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2651 note = _("は体力を回復したようだ。", " looks healthier.");
2653 /* No "real" damage */
2659 /* Speed Monster (Ignore "dam") */
2662 if (seen) obvious = TRUE;
2665 if (set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100))
2667 note = _("の動きが速くなった。", " starts moving faster.");
2672 if (r_ptr->flags1 & RF1_UNIQUE)
2673 chg_virtue(V_INDIVIDUALISM, 1);
2674 if (is_friendly(m_ptr))
2675 chg_virtue(V_HONOUR, 1);
2678 /* No "real" damage */
2684 /* Slow Monster (Use "dam" as "power") */
2687 if (seen) obvious = TRUE;
2689 if (r_ptr->flagsr & RFR_RES_ALL)
2691 note = _("には効果がなかった。", " is unaffected.");
2693 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2696 /* Powerful monsters can resist */
2697 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2698 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2700 note = _("には効果がなかった。", " is unaffected.");
2704 /* Normal monsters slow down */
2707 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2709 note = _("の動きが遅くなった。", " starts moving slower.");
2713 /* No "real" damage */
2719 /* Sleep (Use "dam" as "power") */
2722 if (seen) obvious = TRUE;
2724 if (r_ptr->flagsr & RFR_RES_ALL)
2726 note = _("には効果がなかった。", " is unaffected.");
2728 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2731 /* Attempt a saving throw */
2732 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2733 (r_ptr->flags3 & RF3_NO_SLEEP) ||
2734 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2736 /* Memorize a flag */
2737 if (r_ptr->flags3 & RF3_NO_SLEEP)
2739 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
2741 /* No obvious effect */
2742 note = _("には効果がなかった。", " is unaffected.");
2747 /* Go to sleep (much) later */
2748 note = _("は眠り込んでしまった!", " falls asleep!");
2752 /* No "real" damage */
2758 /* Sleep (Use "dam" as "power") */
2759 case GF_STASIS_EVIL:
2761 if (seen) obvious = TRUE;
2763 if (r_ptr->flagsr & RFR_RES_ALL)
2765 note = _("には効果がなかった!", " is immune.");
2767 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2770 /* Attempt a saving throw */
2771 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2772 !(r_ptr->flags3 & RF3_EVIL) ||
2773 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2775 note = _("には効果がなかった。", " is unaffected.");
2780 /* Go to sleep (much) later */
2781 note = _("は動けなくなった!", " is suspended!");
2785 /* No "real" damage */
2790 /* Sleep (Use "dam" as "power") */
2793 if (seen) obvious = TRUE;
2795 if (r_ptr->flagsr & RFR_RES_ALL)
2797 note = _("には効果がなかった。", " is unaffected.");
2799 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2802 /* Attempt a saving throw */
2803 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2804 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2806 note = _("には効果がなかった。", " is unaffected.");
2811 /* Go to sleep (much) later */
2812 note = _("は動けなくなった!", " is suspended!");
2816 /* No "real" damage */
2825 vir = virtue_number(V_HARMONY);
2828 dam += p_ptr->virtues[vir-1]/10;
2831 vir = virtue_number(V_INDIVIDUALISM);
2834 dam -= p_ptr->virtues[vir-1]/20;
2837 if (seen) obvious = TRUE;
2839 /* Attempt a saving throw */
2840 if (common_saving_throw_charm(p_ptr, dam, m_ptr))
2844 /* No obvious effect */
2845 note = _("には効果がなかった。", " is unaffected.");
2848 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2850 else if (p_ptr->cursed & TRC_AGGRAVATE)
2852 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2853 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2857 note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
2860 chg_virtue(V_INDIVIDUALISM, -1);
2861 if (r_ptr->flags3 & RF3_ANIMAL)
2862 chg_virtue(V_NATURE, 1);
2865 /* No "real" damage */
2870 /* Control undead */
2871 case GF_CONTROL_UNDEAD:
2874 if (seen) obvious = TRUE;
2876 vir = virtue_number(V_UNLIFE);
2879 dam += p_ptr->virtues[vir-1]/10;
2882 vir = virtue_number(V_INDIVIDUALISM);
2885 dam -= p_ptr->virtues[vir-1]/20;
2888 /* Attempt a saving throw */
2889 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2890 !(r_ptr->flags3 & RF3_UNDEAD))
2892 /* No obvious effect */
2893 note = _("には効果がなかった。", " is unaffected.");
2895 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2897 else if (p_ptr->cursed & TRC_AGGRAVATE)
2899 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2900 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2904 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2908 /* No "real" damage */
2914 case GF_CONTROL_DEMON:
2917 if (seen) obvious = TRUE;
2919 vir = virtue_number(V_UNLIFE);
2922 dam += p_ptr->virtues[vir-1]/10;
2925 vir = virtue_number(V_INDIVIDUALISM);
2928 dam -= p_ptr->virtues[vir-1]/20;
2931 /* Attempt a saving throw */
2932 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2933 !(r_ptr->flags3 & RF3_DEMON))
2935 /* No obvious effect */
2936 note = _("には効果がなかった。", " is unaffected.");
2938 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2940 else if (p_ptr->cursed & TRC_AGGRAVATE)
2942 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2943 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2947 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2951 /* No "real" damage */
2957 case GF_CONTROL_ANIMAL:
2960 if (seen) obvious = TRUE;
2962 vir = virtue_number(V_NATURE);
2965 dam += p_ptr->virtues[vir-1]/10;
2968 vir = virtue_number(V_INDIVIDUALISM);
2971 dam -= p_ptr->virtues[vir-1]/20;
2974 /* Attempt a saving throw */
2975 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2976 !(r_ptr->flags3 & RF3_ANIMAL))
2979 /* No obvious effect */
2980 note = _("には効果がなかった。", " is unaffected.");
2982 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2984 else if (p_ptr->cursed & TRC_AGGRAVATE)
2986 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2987 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2991 note = _("はなついた。", " is tamed!");
2993 if (r_ptr->flags3 & RF3_ANIMAL)
2994 chg_virtue(V_NATURE, 1);
2997 /* No "real" damage */
3003 case GF_CHARM_LIVING:
3007 vir = virtue_number(V_UNLIFE);
3008 if (seen) obvious = TRUE;
3010 vir = virtue_number(V_UNLIFE);
3013 dam -= p_ptr->virtues[vir-1]/10;
3016 vir = virtue_number(V_INDIVIDUALISM);
3019 dam -= p_ptr->virtues[vir-1]/20;
3022 msg_format(_("%sを見つめた。", "You stare into %s."), m_name);
3024 /* Attempt a saving throw */
3025 if (common_saving_throw_charm(p_ptr, dam, m_ptr) ||
3026 !monster_living(m_ptr->r_idx))
3029 /* No obvious effect */
3030 note = _("には効果がなかった。", " is unaffected.");
3032 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3034 else if (p_ptr->cursed & TRC_AGGRAVATE)
3036 note = _("はあなたに敵意を抱いている!", " hates you too much!");
3037 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3041 note = _("を支配した。", " is tamed!");
3043 if (r_ptr->flags3 & RF3_ANIMAL)
3044 chg_virtue(V_NATURE, 1);
3047 /* No "real" damage */
3052 /* Confusion (Use "dam" as "power") */
3055 if (seen) obvious = TRUE;
3057 if (r_ptr->flagsr & RFR_RES_ALL)
3059 note = _("には効果がなかった。", " is unaffected.");
3061 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3064 /* Get confused later */
3065 do_conf = damroll(3, (dam / 2)) + 1;
3067 /* Attempt a saving throw */
3068 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3069 (r_ptr->flags3 & (RF3_NO_CONF)) ||
3070 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3072 /* Memorize a flag */
3073 if (r_ptr->flags3 & (RF3_NO_CONF))
3075 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3081 /* No obvious effect */
3082 note = _("には効果がなかった。", " is unaffected.");
3086 /* No "real" damage */
3093 if (seen) obvious = TRUE;
3095 if (r_ptr->flagsr & RFR_RES_ALL)
3097 note = _("には効果がなかった。", " is unaffected.");
3099 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3102 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
3104 /* Attempt a saving throw */
3105 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3106 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3111 /* No obvious effect */
3112 note = _("には効果がなかった。", " is unaffected.");
3116 /* No "real" damage */
3124 /* Lite, but only hurts susceptible creatures */
3132 if (r_ptr->flagsr & RFR_RES_ALL)
3138 if (r_ptr->flags3 & (RF3_HURT_LITE))
3140 /* Obvious effect */
3141 if (seen) obvious = TRUE;
3143 /* Memorize the effects */
3144 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3146 /* Special effect */
3147 note = _("は光に身をすくめた!", " cringes from the light!");
3148 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3151 /* Normally no damage */
3163 /* Lite -- opposite of Dark */
3166 if (seen) obvious = TRUE;
3168 if (r_ptr->flagsr & RFR_RES_ALL)
3170 note = _("には完全な耐性がある!", " is immune.");
3172 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3175 if (r_ptr->flagsr & RFR_RES_LITE)
3177 note = _("には耐性がある!", " resists!");
3178 dam *= 2; dam /= (randint1(6)+6);
3179 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
3181 else if (r_ptr->flags3 & (RF3_HURT_LITE))
3183 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3184 note = _("は光に身をすくめた!", " cringes from the light!");
3185 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3192 /* Dark -- opposite of Lite */
3195 if (seen) obvious = TRUE;
3197 if (r_ptr->flagsr & RFR_RES_ALL)
3199 note = _("には完全な耐性がある!", " is immune.");
3201 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3204 if (r_ptr->flagsr & RFR_RES_DARK)
3206 note = _("には耐性がある!", " resists!");
3207 dam *= 2; dam /= (randint1(6)+6);
3208 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
3217 if (r_ptr->flagsr & RFR_RES_ALL)
3222 /* Hurt by rock remover */
3223 if (r_ptr->flags3 & (RF3_HURT_ROCK))
3226 if (seen) obvious = TRUE;
3228 /* Memorize the effects */
3229 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
3231 /* Cute little message */
3232 note = _("の皮膚がただれた!", " loses some skin!");
3233 note_dies = _("はドロドロに溶けた!", " dissolves!");
3236 /* Usually, ignore the effects */
3247 /* Teleport undead (Use "dam" as "power") */
3248 case GF_AWAY_UNDEAD:
3250 /* Only affect undead */
3251 if (r_ptr->flags3 & (RF3_UNDEAD))
3253 bool resists_tele = FALSE;
3255 if (r_ptr->flagsr & RFR_RES_TELE)
3257 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3259 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3260 note = _("には効果がなかった。", " is unaffected.");
3261 resists_tele = TRUE;
3263 else if (r_ptr->level > randint1(100))
3265 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3266 note = _("には耐性がある!", " resists!");
3267 resists_tele = TRUE;
3273 if (seen) obvious = TRUE;
3274 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3286 /* No "real" damage */
3292 /* Teleport evil (Use "dam" as "power") */
3295 /* Only affect evil */
3296 if (r_ptr->flags3 & (RF3_EVIL))
3298 bool resists_tele = FALSE;
3300 if (r_ptr->flagsr & RFR_RES_TELE)
3302 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3304 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3305 note = _("には効果がなかった。", " is unaffected.");
3306 resists_tele = TRUE;
3308 else if (r_ptr->level > randint1(100))
3310 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3311 note = _("には耐性がある!", " resists!");
3312 resists_tele = TRUE;
3318 if (seen) obvious = TRUE;
3319 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3331 /* No "real" damage */
3337 /* Teleport monster (Use "dam" as "power") */
3340 bool resists_tele = FALSE;
3341 if (r_ptr->flagsr & RFR_RES_TELE)
3343 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3345 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3346 note = _("には効果がなかった。", " is unaffected.");
3347 resists_tele = TRUE;
3349 else if (r_ptr->level > randint1(100))
3351 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3352 note = _("には耐性がある!", " resists!");
3353 resists_tele = TRUE;
3359 if (seen) obvious = TRUE;
3361 /* Prepare to teleport */
3365 /* No "real" damage */
3371 /* Turn undead (Use "dam" as "power") */
3372 case GF_TURN_UNDEAD:
3374 if (r_ptr->flagsr & RFR_RES_ALL)
3379 /* Only affect undead */
3380 if (r_ptr->flags3 & (RF3_UNDEAD))
3382 if (seen) obvious = TRUE;
3384 /* Learn about type */
3385 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3387 /* Apply some fear */
3388 do_fear = damroll(3, (dam / 2)) + 1;
3390 /* Attempt a saving throw */
3391 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
3393 /* No obvious effect */
3394 note = _("には効果がなかった。", " is unaffected.");
3407 /* No "real" damage */
3413 /* Turn evil (Use "dam" as "power") */
3416 if (r_ptr->flagsr & RFR_RES_ALL)
3421 /* Only affect evil */
3422 if (r_ptr->flags3 & (RF3_EVIL))
3424 if (seen) obvious = TRUE;
3426 /* Learn about type */
3427 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3429 /* Apply some fear */
3430 do_fear = damroll(3, (dam / 2)) + 1;
3432 /* Attempt a saving throw */
3433 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
3435 /* No obvious effect */
3436 note = _("には効果がなかった。", " is unaffected.");
3449 /* No "real" damage */
3455 /* Turn monster (Use "dam" as "power") */
3458 if (r_ptr->flagsr & RFR_RES_ALL)
3463 if (seen) obvious = TRUE;
3465 /* Apply some fear */
3466 do_fear = damroll(3, (dam / 2)) + 1;
3468 /* Attempt a saving throw */
3469 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3470 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
3471 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3473 /* No obvious effect */
3474 note = _("には効果がなかった。", " is unaffected.");
3479 /* No "real" damage */
3486 case GF_DISP_UNDEAD:
3488 if (r_ptr->flagsr & RFR_RES_ALL)
3494 /* Only affect undead */
3495 if (r_ptr->flags3 & (RF3_UNDEAD))
3497 if (seen) obvious = TRUE;
3499 /* Learn about type */
3500 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3502 note = _("は身震いした。", " shudders.");
3503 note_dies = _("はドロドロに溶けた!", " dissolves!");
3523 if (r_ptr->flagsr & RFR_RES_ALL)
3529 /* Only affect evil */
3530 if (r_ptr->flags3 & (RF3_EVIL))
3532 if (seen) obvious = TRUE;
3534 /* Learn about type */
3535 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3537 note = _("は身震いした。", " shudders.");
3538 note_dies = _("はドロドロに溶けた!", " dissolves!");
3557 if (r_ptr->flagsr & RFR_RES_ALL)
3563 /* Only affect good */
3564 if (r_ptr->flags3 & (RF3_GOOD))
3566 if (seen) obvious = TRUE;
3568 /* Learn about type */
3569 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
3571 note = _("は身震いした。", " shudders.");
3572 note_dies = _("はドロドロに溶けた!", " dissolves!");
3589 case GF_DISP_LIVING:
3591 if (r_ptr->flagsr & RFR_RES_ALL)
3597 /* Only affect non-undead */
3598 if (monster_living(m_ptr->r_idx))
3600 if (seen) obvious = TRUE;
3602 note = _("は身震いした。", " shudders.");
3603 note_dies = _("はドロドロに溶けた!", " dissolves!");
3622 if (r_ptr->flagsr & RFR_RES_ALL)
3628 /* Only affect demons */
3629 if (r_ptr->flags3 & (RF3_DEMON))
3631 if (seen) obvious = TRUE;
3633 /* Learn about type */
3634 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
3636 note = _("は身震いした。", " shudders.");
3637 note_dies = _("はドロドロに溶けた!", " dissolves!");
3653 /* Dispel monster */
3656 if (r_ptr->flagsr & RFR_RES_ALL)
3662 if (seen) obvious = TRUE;
3664 note = _("は身震いした。", " shudders.");
3665 note_dies = _("はドロドロに溶けた!", " dissolves!");
3672 if (seen) obvious = TRUE;
3674 if (r_ptr->flagsr & RFR_RES_ALL)
3676 note = _("には完全な耐性がある!", " is immune.");
3678 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3682 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->a_ability_flags1 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->a_ability_flags2 & ~(RF6_NOMAGIC_MASK)))
3686 /* Heal the monster */
3687 if (caster_ptr->hp < caster_ptr->maxhp)
3690 caster_ptr->hp += dam;
3691 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
3693 /* Redraw (later) if needed */
3694 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
3695 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
3697 /* Special message */
3700 monster_desc(killer, caster_ptr, 0);
3701 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), killer);
3707 msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), m_name);
3708 (void)hp_player(dam);
3713 if (see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3722 if (seen) obvious = TRUE;
3723 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3725 if (r_ptr->flagsr & RFR_RES_ALL)
3727 note = _("には完全な耐性がある!", " is immune.");
3729 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3733 /* Attempt a saving throw */
3734 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3735 (r_ptr->flags3 & RF3_NO_CONF) ||
3736 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3738 /* Memorize a flag */
3739 if (r_ptr->flags3 & (RF3_NO_CONF))
3741 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3743 note = _("には効果がなかった。", " is unaffected.");
3746 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3748 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3749 note = _("には完全な耐性がある!", " is immune.");
3752 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3754 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3755 note = _("には耐性がある。", " resists.");
3760 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3761 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3763 if (who > 0) do_conf = randint0(4) + 4;
3764 else do_conf = randint0(8) + 8;
3770 case GF_BRAIN_SMASH:
3772 if (seen) obvious = TRUE;
3773 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3775 if (r_ptr->flagsr & RFR_RES_ALL)
3777 note = _("には完全な耐性がある!", " is immune.");
3779 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3783 /* Attempt a saving throw */
3784 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3785 (r_ptr->flags3 & RF3_NO_CONF) ||
3786 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3788 /* Memorize a flag */
3789 if (r_ptr->flags3 & (RF3_NO_CONF))
3791 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3793 note = _("には効果がなかった。", " is unaffected.");
3796 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3798 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3799 note = _("には完全な耐性がある!", " is immune.");
3802 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3804 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3805 note = _("には耐性がある!", " resists!");
3810 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3811 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3815 do_conf = randint0(4) + 4;
3816 do_stun = randint0(4) + 4;
3820 do_conf = randint0(8) + 8;
3821 do_stun = randint0(8) + 8;
3823 (void)set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 10);
3831 if (seen) obvious = TRUE;
3832 if (!who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), m_name);
3834 if (r_ptr->flagsr & RFR_RES_ALL)
3836 note = _("には完全な耐性がある!", " is immune.");
3838 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3842 /* Attempt a saving throw */
3843 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3845 note = _("には効果がなかった。", " is unaffected.");
3854 if (seen) obvious = TRUE;
3855 if (!who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), m_name);
3857 if (r_ptr->flagsr & RFR_RES_ALL)
3859 note = _("には完全な耐性がある!", " is immune.");
3861 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3865 /* Attempt a saving throw */
3866 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3868 note = _("には効果がなかった。", " is unaffected.");
3877 if (seen) obvious = TRUE;
3878 if (!who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), m_name);
3880 if (r_ptr->flagsr & RFR_RES_ALL)
3882 note = _("には完全な耐性がある!", " is immune.");
3884 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3888 /* Attempt a saving throw */
3889 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3891 note = _("には効果がなかった。", " is unaffected.");
3900 if (seen) obvious = TRUE;
3902 msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
3903 "You point at %s, screaming the word, 'DIE!'."), m_name);
3905 if (r_ptr->flagsr & RFR_RES_ALL)
3907 note = _("には完全な耐性がある!", " is immune.");
3909 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3913 /* Attempt a saving throw */
3914 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
3916 note = _("には効果がなかった。", " is unaffected.");
3925 if (seen) obvious = TRUE;
3927 if (r_ptr->flagsr & RFR_RES_ALL)
3929 note = _("には完全な耐性がある!", " is immune.");
3931 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3935 if (r_ptr->flags1 & RF1_UNIQUE)
3937 note = _("には効果がなかった。", " is unaffected.");
3942 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
3943 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
3945 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
3947 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
3951 note = _("は耐性を持っている!", "resists!");
3958 /* Capture monster */
3962 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
3963 (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)
3965 msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3970 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
3971 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(m_ptr->r_idx))
3972 nokori_hp = m_ptr->maxhp * 3 / 10;
3974 nokori_hp = m_ptr->maxhp * 3 / 20;
3976 if (m_ptr->hp >= nokori_hp)
3978 msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), m_name);
3981 else if (m_ptr->hp < randint0(nokori_hp))
3983 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
3984 msg_format(_("%sを捕えた!", "You capture %^s!"), m_name);
3985 cap_mon = m_ptr->r_idx;
3986 cap_mspeed = m_ptr->mspeed;
3988 cap_maxhp = m_ptr->max_maxhp;
3989 cap_nickname = m_ptr->nickname; /* Quark transfer */
3990 if (c_ptr->m_idx == p_ptr->riding)
3992 if (rakuba(-1, FALSE))
3994 msg_format(_("地面に落とされた。", "You have fallen from %s."), m_name);
3998 delete_monster_idx(c_ptr->m_idx);
4004 msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), m_name);
4010 /* Attack (Use "dam" as attack type) */
4013 /* Return this monster's death */
4014 return py_attack(y, x, dam);
4017 /* Sleep (Use "dam" as "power") */
4023 if (seen) obvious = TRUE;
4025 if (r_ptr->flagsr & RFR_RES_ALL)
4027 note = _("には効果がなかった。", " is unaffected.");
4029 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4032 if (r_ptr->flags2 & RF2_EMPTY_MIND)
4034 note = _("には効果がなかった。", " is unaffected.");
4037 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
4040 if (MON_CSLEEP(m_ptr))
4042 note = _("には効果がなかった。", " is unaffected.");
4048 if (one_in_(5)) effect = 1;
4049 else if (one_in_(4)) effect = 2;
4050 else if (one_in_(3)) effect = 3;
4055 /* Powerful monsters can resist */
4056 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4057 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4059 note = _("には効果がなかった。", " is unaffected.");
4063 /* Normal monsters slow down */
4066 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
4068 note = _("の動きが遅くなった。", " starts moving slower.");
4073 else if (effect == 2)
4075 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
4077 /* Attempt a saving throw */
4078 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4079 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4084 /* No obvious effect */
4085 note = _("には効果がなかった。", " is unaffected.");
4090 else if (effect == 3)
4092 /* Attempt a saving throw */
4093 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4094 (r_ptr->flags3 & RF3_NO_SLEEP) ||
4095 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4097 /* Memorize a flag */
4098 if (r_ptr->flags3 & RF3_NO_SLEEP)
4100 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
4103 /* No obvious effect */
4104 note = _("には効果がなかった。", " is unaffected.");
4109 /* Go to sleep (much) later */
4110 note = _("は眠り込んでしまった!", " falls asleep!");
4117 note = _("には効果がなかった。", " is unaffected.");
4120 /* No "real" damage */
4128 if (seen) obvious = TRUE;
4130 if (r_ptr->flagsr & RFR_RES_ALL)
4132 note = _("には効果がなかった。", " is unaffected.");
4134 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4138 if (genocide_aux(c_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
4140 if (seen_msg) msg_format(_("%sは消滅した!", "%^s disappered!"), m_name);
4141 chg_virtue(V_VITALITY, -1);
4151 if (!who) msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), m_name);
4153 if (r_ptr->flags3 & (RF3_HURT_LITE))
4155 /* Obvious effect */
4156 if (seen) obvious = TRUE;
4158 /* Memorize the effects */
4159 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4161 /* Special effect */
4162 note = _("は光に身をすくめた!", " cringes from the light!");
4163 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
4166 /* Normally no damage */
4173 photo = m_ptr->r_idx;
4180 case GF_BLOOD_CURSE:
4182 if (seen) obvious = TRUE;
4184 if (r_ptr->flagsr & RFR_RES_ALL)
4186 note = _("には完全な耐性がある!", " is immune.");
4188 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4196 bool success = FALSE;
4197 if (seen) obvious = TRUE;
4199 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
4201 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
4202 if (dam < 1) dam = 1;
4204 /* No need to tame your pet */
4207 note = _("の動きが速くなった。", " starts moving faster.");
4208 (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100);
4212 /* Attempt a saving throw */
4213 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4214 (r_ptr->flags1 & (RF1_UNIQUE)) ||
4215 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4216 (p_ptr->cursed & TRC_AGGRAVATE) ||
4217 ((r_ptr->level+10) > randint1(dam)))
4220 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4224 note = _("を支配した。", " is tamed!");
4226 (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100);
4228 /* Learn about type */
4229 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4236 if (!(r_ptr->flags3 & RF3_NO_FEAR))
4238 do_fear = randint1(90)+10;
4240 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
4243 /* No "real" damage */
4250 if (seen) obvious = TRUE;
4252 if (r_ptr->flagsr & RFR_RES_ALL)
4254 note = _("には完全な耐性がある!", " is immune.");
4256 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4260 /* Attempt a saving throw */
4261 if (randint0(100 + dam) < (r_ptr->level + 50))
4263 note = _("には効果がなかった。", " is unaffected.");
4283 /* Absolutely no effect */
4284 if (skipped) return (FALSE);
4286 /* "Unique" monsters cannot be polymorphed */
4287 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
4289 /* Quest monsters cannot be polymorphed */
4290 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
4292 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
4294 /* "Unique" and "quest" monsters can only be "killed" by the player. */
4295 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
4297 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
4302 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
4303 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
4306 /* Modify the damage */
4308 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
4309 if ((tmp > 0) && (dam == 0)) note = _("はダメージを受けていない。", " is unharmed.");
4311 /* Check for death */
4312 if (dam > m_ptr->hp)
4314 /* Extract method of death */
4319 /* Sound and Impact resisters never stun */
4321 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
4322 !(r_ptr->flags3 & RF3_NO_STUN))
4324 if (seen) obvious = TRUE;
4327 if (MON_STUNNED(m_ptr))
4329 note = _("はひどくもうろうとした。", " is more dazed.");
4330 tmp = MON_STUNNED(m_ptr) + (do_stun / 2);
4334 note = _("はもうろうとした。", " is dazed.");
4339 (void)set_monster_stunned(c_ptr->m_idx, tmp);
4345 /* Confusion and Chaos resisters (and sleepers) never confuse */
4347 !(r_ptr->flags3 & RF3_NO_CONF) &&
4348 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
4350 if (seen) obvious = TRUE;
4352 /* Already partially confused */
4353 if (MON_CONFUSED(m_ptr))
4355 note = _("はさらに混乱したようだ。", " looks more confused.");
4356 tmp = MON_CONFUSED(m_ptr) + (do_conf / 2);
4359 /* Was not confused */
4362 note = _("は混乱したようだ。", " looks confused.");
4366 /* Apply confusion */
4367 (void)set_monster_confused(c_ptr->m_idx, tmp);
4375 if (seen) obvious = TRUE;
4377 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
4381 note = _("は弱くなったようだ。", " seems weakened.");
4382 m_ptr->maxhp -= do_time;
4383 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
4388 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
4389 if (do_poly && (randint1(90) > r_ptr->level))
4391 if (polymorph_monster(y, x))
4393 if (seen) obvious = TRUE;
4395 /* Monster polymorphs */
4396 note = _("が変身した!", " changes!");
4398 /* Turn off the damage */
4404 note = _("には効果がなかった。", " is unaffected.");
4407 /* Hack -- Get new monster */
4408 m_ptr = &m_list[c_ptr->m_idx];
4410 /* Hack -- Get new race */
4411 r_ptr = &r_info[m_ptr->r_idx];
4414 /* Handle "teleport" */
4417 if (seen) obvious = TRUE;
4419 note = _("が消え去った!", " disappears!");
4421 if (!who) chg_virtue(V_VALOUR, -1);
4424 teleport_away(c_ptr->m_idx, do_dist,
4425 (!who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
4427 /* Hack -- get new location */
4431 /* Hack -- get new grid */
4432 c_ptr = &cave[y][x];
4439 (void)set_monster_monfear(c_ptr->m_idx, MON_MONFEAR(m_ptr) + do_fear);
4446 if (typ == GF_DRAIN_MANA)
4448 /* Drain mana does nothing */
4451 /* If another monster did the damage, hurt the monster by hand */
4454 /* Redraw (later) if needed */
4455 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
4456 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
4458 /* Wake the monster up */
4459 (void)set_monster_csleep(c_ptr->m_idx, 0);
4461 /* Hurt the monster */
4469 if (is_pet(m_ptr) && !(m_ptr->ml))
4472 /* Give detailed messages if destroyed */
4475 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
4478 msg_format("%^s%s", m_name, note);
4486 if (who > 0) monster_gain_exp(who, m_ptr->r_idx);
4488 /* Generate treasure, etc */
4489 monster_death(c_ptr->m_idx, FALSE);
4492 delete_monster_idx(c_ptr->m_idx);
4496 msg_print(_("少し悲しい気分がした。", "You feel sad for a moment."));
4500 /* Damaged monster */
4503 /* Give detailed messages if visible or destroyed */
4504 if (note && seen_msg) msg_format("%^s%s", m_name, note);
4506 /* Hack -- Pain message */
4509 message_pain(c_ptr->m_idx, dam);
4516 /* Hack -- handle sleep */
4517 if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep);
4521 else if (heal_leper)
4523 if (seen_msg) msg_print(_("不潔な病人は病気が治った!", "The Mangy looking leper is healed!"));
4525 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
4527 char m2_name[MAX_NLEN];
4529 monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
4530 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_HEAL_LEPER, m2_name);
4533 delete_monster_idx(c_ptr->m_idx);
4536 /* If the player did it, give him experience, check fear */
4541 /* Hurt the monster, check for fear and death */
4542 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
4547 /* Damaged monster */
4550 /* HACK - anger the monster before showing the sleep message */
4551 if (do_sleep) anger_monster(m_ptr);
4553 /* Give detailed messages if visible or destroyed */
4554 if (note && seen_msg)
4555 msg_format(_("%s%s", "%^s%s"), m_name, note);
4557 /* Hack -- Pain message */
4558 else if (known && (dam || !do_fear))
4560 message_pain(c_ptr->m_idx, dam);
4563 /* Anger monsters */
4564 if (((dam > 0) || get_angry) && !do_sleep)
4565 anger_monster(m_ptr);
4567 if ((fear || do_fear) && seen)
4570 msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
4573 /* Hack -- handle sleep */
4574 if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep);
4578 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
4580 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
4584 switch (randint1(28))
4589 msg_print(_("地面が揺れた...", "The ground trembles..."));
4590 earthquake(ty, tx, 4 + randint0(4));
4591 if (!one_in_(6)) break;
4593 case 3: case 4: case 5: case 6:
4596 int extra_dam = damroll(10, 10);
4597 msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
4599 project(0, 8, ty, tx, extra_dam, GF_MANA, curse_flg, -1);
4600 if (!one_in_(6)) break;
4605 msg_print(_("空間が歪んだ!", "Space warps about you!"));
4607 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), TELEPORT_PASSIVE);
4608 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
4609 if (!one_in_(6)) break;
4611 case 9: case 10: case 11:
4612 msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!"));
4613 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
4614 if (!one_in_(6)) break;
4615 case 12: case 13: case 14: case 15: case 16:
4616 aggravate_monsters(0);
4617 if (!one_in_(6)) break;
4619 count += activate_hi_summon(ty, tx, TRUE);
4620 if (!one_in_(6)) break;
4621 case 19: case 20: case 21: case 22:
4623 bool pet = !one_in_(3);
4624 BIT_FLAGS mode = PM_ALLOW_GROUP;
4626 if (pet) mode |= PM_FORCE_PET;
4627 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
4629 count += summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode, '\0');
4630 if (!one_in_(6)) break;
4632 case 23: case 24: case 25:
4633 if (p_ptr->hold_exp && (randint0(100) < 75)) break;
4634 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
4636 if (p_ptr->hold_exp) lose_exp(p_ptr->exp / 160);
4637 else lose_exp(p_ptr->exp / 16);
4638 if (!one_in_(6)) break;
4639 case 26: case 27: case 28:
4648 (void)do_dec_stat(i);
4657 (void)do_dec_stat(randint0(6));
4666 if (p_ptr->inside_battle)
4668 p_ptr->health_who = c_ptr->m_idx;
4669 p_ptr->redraw |= (PR_HEALTH);
4673 /* Verify this code */
4674 if (m_ptr->r_idx) update_monster(c_ptr->m_idx, FALSE);
4676 /* Redraw the monster grid */
4680 /* Update monster recall window */
4681 if ((p_ptr->monster_race_idx == m_ptr->r_idx) && (seen || !m_ptr->r_idx))
4683 p_ptr->window |= (PW_MONSTER);
4686 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
4690 if (!(flg & PROJECT_NO_HANGEKI))
4692 set_target(m_ptr, monster_target_y, monster_target_x);
4695 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
4697 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
4701 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
4703 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
4704 rakubadam_m = (dam > 200) ? 200 : dam;
4714 /* Prepare to make a Blade of Chaos */
4715 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
4717 q_ptr->pval = photo;
4719 /* Mark the item as fully known */
4720 q_ptr->ident |= (IDENT_MENTAL);
4721 (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
4729 /* Return "Anything seen?" */
4734 * @brief 汎用的なビーム/ボルト/ボール系によるプレイヤーへの効果処理 / Helper function for "project()" below.
4735 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
4736 * @param who_name 効果を起こしたモンスターの名前
4737 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
4738 * @param y 目標Y座標 / Target y location (or location to travel "towards")
4739 * @param x 目標X座標 / Target x location (or location to travel "towards")
4740 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
4741 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
4743 * @param monspell 効果元のモンスター魔法ID
4744 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
4746 * Handle a beam/bolt/ball causing damage to the player.
4747 * This routine takes a "source monster" (by index), a "distance", a default
4748 * "damage", and a "damage type". See "project_m()" above.
4749 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
4750 * is reduced (see "project_m()" above). This can happen if a monster breathes
4751 * at the player and hits a wall instead.
4752 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
4753 * to know if this is actually a ball or a bolt spell
4754 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
4755 * we just assume that the effects were obvious, for historical reasons.
4757 static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
4762 /* Hack -- assume obvious */
4763 bool obvious = TRUE;
4765 /* Player blind-ness */
4766 bool blind = (p_ptr->blind ? TRUE : FALSE);
4768 /* Player needs a "description" (he is blind) */
4771 /* Source monster */
4772 monster_type *m_ptr = NULL;
4774 /* Monster name (for attacks) */
4775 GAME_TEXT m_name[MAX_NLEN];
4777 /* Monster name (for damage) */
4780 /* Hack -- messages */
4786 /* Player is not here */
4787 if (!player_bold(y, x)) return (FALSE);
4789 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
4791 if (kawarimi(TRUE)) return FALSE;
4794 /* Player cannot hurt himself */
4795 if (!who) return (FALSE);
4796 if (who == p_ptr->riding) return (FALSE);
4798 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
4801 int max_attempts = 10;
4802 sound(SOUND_REFLECT);
4805 msg_print(_("何かが跳ね返った!", "Something bounces!"));
4806 else if (p_ptr->special_defense & KATA_FUUJIN)
4807 msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
4809 msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
4812 /* Choose 'new' target */
4817 t_y = m_list[who].fy - 1 + randint1(3);
4818 t_x = m_list[who].fx - 1 + randint1(3);
4821 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(p_ptr->y, p_ptr->x, t_y, t_x));
4823 if (max_attempts < 1)
4825 t_y = m_list[who].fy;
4826 t_x = m_list[who].fx;
4831 t_y = p_ptr->y - 1 + randint1(3);
4832 t_x = p_ptr->x - 1 + randint1(3);
4835 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
4837 disturb(TRUE, TRUE);
4841 /* Limit maximum damage */
4842 if (dam > 1600) dam = 1600;
4844 /* Reduce damage by distance */
4845 dam = (dam + r) / (r + 1);
4848 /* If the player is blind, be more descriptive */
4849 if (blind) fuzzy = TRUE;
4854 m_ptr = &m_list[who];
4855 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
4856 monster_desc(m_name, m_ptr, 0);
4858 /* Get the monster's real name (gotten before polymorph!) */
4859 strcpy(killer, who_name);
4865 case PROJECT_WHO_UNCTRL_POWER:
4866 strcpy(killer, _("制御できない力の氾流", "uncontrollable power storm"));
4869 case PROJECT_WHO_GLASS_SHARDS:
4870 strcpy(killer, _("ガラスの破片", "shards of glass"));
4874 strcpy(killer, _("罠", "a trap"));
4879 strcpy(m_name, killer);
4882 /* Analyze the damage */
4885 /* Standard damage -- hurts inventory too */
4888 if (fuzzy) msg_print(_("酸で攻撃された!", "You are hit by acid!"));
4889 get_damage = acid_dam(dam, killer, monspell, FALSE);
4893 /* Standard damage -- hurts inventory too */
4896 if (fuzzy) msg_print(_("火炎で攻撃された!", "You are hit by fire!"));
4897 get_damage = fire_dam(dam, killer, monspell, FALSE);
4901 /* Standard damage -- hurts inventory too */
4904 if (fuzzy) msg_print(_("冷気で攻撃された!", "You are hit by cold!"));
4905 get_damage = cold_dam(dam, killer, monspell, FALSE);
4909 /* Standard damage -- hurts inventory too */
4912 if (fuzzy) msg_print(_("電撃で攻撃された!", "You are hit by lightning!"));
4913 get_damage = elec_dam(dam, killer, monspell, FALSE);
4917 /* Standard damage -- also poisons player */
4920 bool double_resist = IS_OPPOSE_POIS();
4921 if (fuzzy) msg_print(_("毒で攻撃された!", "You are hit by poison!"));
4923 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
4924 if (double_resist) dam = (dam + 2) / 3;
4926 if ((!(double_resist || p_ptr->resist_pois)) && one_in_(HURT_CHANCE) && !CHECK_MULTISHADOW())
4931 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4933 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4935 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4940 /* Standard damage -- also poisons / mutates player */
4943 bool double_resist = IS_OPPOSE_POIS();
4944 if (fuzzy) msg_print(_("放射能で攻撃された!", "You are hit by radiation!"));
4946 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
4947 if (double_resist) dam = (2 * dam + 2) / 5;
4948 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4949 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4951 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4953 if (one_in_(5)) /* 6 */
4955 msg_print(_("奇形的な変身を遂げた!", "You undergo a freakish metamorphosis!"));
4956 if (one_in_(4)) /* 4 */
4964 inven_damage(set_acid_destroy, 2);
4970 /* Standard damage */
4973 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4974 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4978 /* Holy Orb -- Player only takes partial damage */
4981 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4982 if (p_ptr->align > 10)
4984 else if (p_ptr->align < -10)
4986 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4992 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4993 if (p_ptr->align > 10)
4995 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4999 /* Arrow -- XXX no dodging */
5004 msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
5006 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
5008 msg_print(_("矢を斬り捨てた!", "You cut down the arrow!"));
5011 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5015 /* Plasma -- XXX No resist */
5018 if (fuzzy) msg_print(_("何かとても熱いもので攻撃された!", "You are hit by something *HOT*!"));
5019 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5021 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5023 int plus_stun = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
5024 (void)set_stun(p_ptr->stun + plus_stun);
5027 if (!(p_ptr->resist_fire || IS_OPPOSE_FIRE() || p_ptr->immune_fire))
5029 inven_damage(set_acid_destroy, 3);
5035 /* Nether -- drain experience */
5038 if (fuzzy) msg_print(_("地獄の力で攻撃された!", "You are hit by nether forces!"));
5039 if (p_ptr->resist_neth)
5041 if (!prace_is_(RACE_SPECTRE))
5043 dam *= 6; dam /= (randint1(4) + 7);
5046 else if (!CHECK_MULTISHADOW()) drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
5048 if (prace_is_(RACE_SPECTRE) && !CHECK_MULTISHADOW())
5050 msg_print(_("気分がよくなった。", "You feel invigorated!"));
5052 learn_spell(monspell);
5056 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5062 /* Water -- stun/confuse */
5065 if (fuzzy) msg_print(_("何か湿ったもので攻撃された!", "You are hit by something wet!"));
5066 if (!CHECK_MULTISHADOW())
5068 if (!p_ptr->resist_sound && !p_ptr->resist_water)
5070 set_stun(p_ptr->stun + randint1(40));
5072 if (!p_ptr->resist_conf && !p_ptr->resist_water)
5074 set_confused(p_ptr->confused + randint1(5) + 5);
5077 if (one_in_(5) && !p_ptr->resist_water)
5079 inven_damage(set_cold_destroy, 3);
5082 if (p_ptr->resist_water) get_damage /= 4;
5085 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5089 /* Chaos -- many effects */
5092 if (fuzzy) msg_print(_("無秩序の波動で攻撃された!", "You are hit by a wave of anarchy!"));
5093 if (p_ptr->resist_chaos)
5095 dam *= 6; dam /= (randint1(4) + 7);
5098 if (!CHECK_MULTISHADOW())
5100 if (!p_ptr->resist_conf)
5102 (void)set_confused(p_ptr->confused + randint0(20) + 10);
5104 if (!p_ptr->resist_chaos)
5106 (void)set_image(p_ptr->image + randint1(10));
5109 msg_print(_("あなたの身体はカオスの力で捻じ曲げられた!", "Your body is twisted by chaos!"));
5110 (void)gain_random_mutation(0);
5113 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
5115 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
5118 if (!p_ptr->resist_chaos || one_in_(9))
5120 inven_damage(set_elec_destroy, 2);
5121 inven_damage(set_fire_destroy, 2);
5125 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5129 /* Shards -- mostly cutting */
5132 if (fuzzy) msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
5133 if (p_ptr->resist_shard)
5135 dam *= 6; dam /= (randint1(4) + 7);
5137 else if (!CHECK_MULTISHADOW())
5139 (void)set_cut(p_ptr->cut + dam);
5142 if (!p_ptr->resist_shard || one_in_(13))
5144 inven_damage(set_cold_destroy, 2);
5147 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5151 /* Sound -- mostly stunning */
5154 if (fuzzy) msg_print(_("轟音で攻撃された!", "You are hit by a loud noise!"));
5155 if (p_ptr->resist_sound)
5157 dam *= 5; dam /= (randint1(4) + 7);
5159 else if (!CHECK_MULTISHADOW())
5161 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
5162 (void)set_stun(p_ptr->stun + plus_stun);
5165 if (!p_ptr->resist_sound || one_in_(13))
5167 inven_damage(set_cold_destroy, 2);
5170 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5174 /* Pure confusion */
5177 if (fuzzy) msg_print(_("何か混乱するもので攻撃された!", "You are hit by something puzzling!"));
5178 if (p_ptr->resist_conf)
5180 dam *= 5; dam /= (randint1(4) + 7);
5182 else if (!CHECK_MULTISHADOW())
5184 (void)set_confused(p_ptr->confused + randint1(20) + 10);
5186 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5190 /* Disenchantment -- see above */
5193 if (fuzzy) msg_print(_("何かさえないもので攻撃された!", "You are hit by something static!"));
5194 if (p_ptr->resist_disen)
5196 dam *= 6; dam /= (randint1(4) + 7);
5198 else if (!CHECK_MULTISHADOW())
5200 (void)apply_disenchant(0);
5202 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5206 /* Nexus -- see above */
5209 if (fuzzy) msg_print(_("何か奇妙なもので攻撃された!", "You are hit by something strange!"));
5210 if (p_ptr->resist_nexus)
5212 dam *= 6; dam /= (randint1(4) + 7);
5214 else if (!CHECK_MULTISHADOW())
5218 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5222 /* Force -- mostly stun */
5225 if (fuzzy) msg_print(_("運動エネルギーで攻撃された!", "You are hit by kinetic force!"));
5226 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5228 (void)set_stun(p_ptr->stun + randint1(20));
5230 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5235 /* Rocket -- stun, cut */
5238 if (fuzzy) msg_print(_("爆発があった!", "There is an explosion!"));
5239 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5241 (void)set_stun(p_ptr->stun + randint1(20));
5244 if (p_ptr->resist_shard)
5248 else if (!CHECK_MULTISHADOW())
5250 (void)set_cut(p_ptr->cut + (dam / 2));
5253 if (!p_ptr->resist_shard || one_in_(12))
5255 inven_damage(set_cold_destroy, 3);
5258 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5262 /* Inertia -- slowness */
5265 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
5266 if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5267 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5271 /* Lite -- blinding */
5274 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5275 if (p_ptr->resist_lite)
5277 dam *= 4; dam /= (randint1(4) + 7);
5279 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
5281 (void)set_blind(p_ptr->blind + randint1(5) + 2);
5284 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
5286 if (!CHECK_MULTISHADOW()) msg_print(_("光で肉体が焦がされた!", "The light scorches your flesh!"));
5289 else if (prace_is_(RACE_S_FAIRY))
5294 if (p_ptr->wraith_form) dam *= 2;
5295 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5297 if (p_ptr->wraith_form && !CHECK_MULTISHADOW())
5299 p_ptr->wraith_form = 0;
5300 msg_print(_("閃光のため非物質的な影の存在でいられなくなった。",
5301 "The light forces you out of your incorporeal shadow form."));
5303 p_ptr->redraw |= (PR_MAP | PR_STATUS);
5304 p_ptr->update |= (PU_MONSTERS);
5305 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5311 /* Dark -- blinding */
5314 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5315 if (p_ptr->resist_dark)
5317 dam *= 4; dam /= (randint1(4) + 7);
5319 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
5321 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
5323 (void)set_blind(p_ptr->blind + randint1(5) + 2);
5325 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5329 /* Time -- bolt fewer effects XXX */
5332 if (fuzzy) msg_print(_("過去からの衝撃に攻撃された!", "You are hit by a blast from the past!"));
5333 if (p_ptr->resist_time)
5336 dam /= (randint1(4) + 7);
5337 msg_print(_("時間が通り過ぎていく気がする。", "You feel as if time is passing you by."));
5339 else if (!CHECK_MULTISHADOW())
5341 switch (randint1(10))
5343 case 1: case 2: case 3: case 4: case 5:
5345 if (p_ptr->prace == RACE_ANDROID) break;
5346 msg_print(_("人生が逆戻りした気がする。", "You feel life has clocked back."));
5347 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
5351 case 6: case 7: case 8: case 9:
5353 switch (randint1(6))
5355 case 1: k = A_STR; act = _("強く", "strong"); break;
5356 case 2: k = A_INT; act = _("聡明で", "bright"); break;
5357 case 3: k = A_WIS; act = _("賢明で", "wise"); break;
5358 case 4: k = A_DEX; act = _("器用で", "agile"); break;
5359 case 5: k = A_CON; act = _("健康で", "hale"); break;
5360 case 6: k = A_CHR; act = _("美しく", "beautiful"); break;
5363 msg_format(_("あなたは以前ほど%sなくなってしまった...。",
5364 "You're not as %s as you used to be..."), act);
5366 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
5367 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
5368 p_ptr->update |= (PU_BONUS);
5374 msg_print(_("あなたは以前ほど力強くなくなってしまった...。",
5375 "You're not as powerful as you used to be..."));
5377 for (k = 0; k < A_MAX; k++)
5379 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
5380 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
5382 p_ptr->update |= (PU_BONUS);
5388 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5392 /* Gravity -- stun plus slowness plus teleport */
5395 if (fuzzy) msg_print(_("何か重いもので攻撃された!", "You are hit by something heavy!"));
5396 msg_print(_("周辺の重力がゆがんだ。", "Gravity warps around you."));
5398 if (!CHECK_MULTISHADOW())
5400 teleport_player(5, TELEPORT_PASSIVE);
5401 if (!p_ptr->levitation)
5402 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5403 if (!(p_ptr->resist_sound || p_ptr->levitation))
5405 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
5406 (void)set_stun(p_ptr->stun + plus_stun);
5409 if (p_ptr->levitation)
5411 dam = (dam * 2) / 3;
5414 if (!p_ptr->levitation || one_in_(13))
5416 inven_damage(set_cold_destroy, 2);
5419 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5423 /* Standard damage */
5424 case GF_DISINTEGRATE:
5426 if (fuzzy) msg_print(_("純粋なエネルギーで攻撃された!", "You are hit by pure energy!"));
5428 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5434 if (fuzzy) msg_print(_("何らかの攻撃によって気分がよくなった。", "You are hit by something invigorating!"));
5436 (void)hp_player(dam);
5443 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5444 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
5451 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
5452 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5458 if (p_ptr->free_act) break;
5459 if (fuzzy) msg_print(_("眠ってしまった!", "You fall asleep!"));
5461 if (ironman_nightmare)
5463 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
5464 /* Have some nightmares */
5465 sanity_blast(NULL, FALSE);
5468 set_paralyzed(p_ptr->paralyzed + dam);
5478 if (fuzzy) msg_print(_("魔法のオーラで攻撃された!", "You are hit by an aura of magic!"));
5479 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5486 if (fuzzy) msg_print(_("エネルギーの塊で攻撃された!", "You are hit by an energy!"));
5487 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
5494 if (fuzzy) msg_print(_("何かが空からあなたの頭上に落ちてきた!", "Something falls from the sky on you!"));
5496 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5497 if (!p_ptr->resist_shard || one_in_(13))
5499 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
5500 inven_damage(set_cold_destroy, 2);
5506 /* Ice -- cold plus stun plus cuts */
5509 if (fuzzy) msg_print(_("何か鋭く冷たいもので攻撃された!", "You are hit by something sharp and cold!"));
5510 get_damage = cold_dam(dam, killer, monspell, FALSE);
5511 if (!CHECK_MULTISHADOW())
5513 if (!p_ptr->resist_shard)
5515 (void)set_cut(p_ptr->cut + damroll(5, 8));
5517 if (!p_ptr->resist_sound)
5519 (void)set_stun(p_ptr->stun + randint1(15));
5522 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
5524 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
5534 if (fuzzy) msg_print(_("何か非常に冷たいもので攻撃された!", "You are hit by something extremely cold!"));
5536 if (p_ptr->mimic_form)
5538 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
5539 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5544 switch (p_ptr->prace)
5546 /* Some races are immune */
5560 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5572 if (CHECK_MULTISHADOW())
5574 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
5576 else if (p_ptr->csp)
5580 msg_format(_("%^sに精神エネルギーを吸い取られてしまった!", "%^s draws psychic energy from you!"), m_name);
5582 msg_print(_("精神エネルギーを吸い取られてしまった!", "Your psychic energy is drawn!"));
5585 if (dam >= p_ptr->csp)
5589 p_ptr->csp_frac = 0;
5598 learn_spell(monspell);
5599 p_ptr->redraw |= (PR_MANA);
5600 p_ptr->window |= (PW_PLAYER | PW_SPELL);
5604 /* Heal the monster */
5605 if (m_ptr->hp < m_ptr->maxhp)
5609 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
5611 /* Redraw (later) if needed */
5612 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
5613 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
5615 /* Special message */
5618 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), m_name);
5631 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
5633 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5634 learn_spell(monspell);
5638 if (!CHECK_MULTISHADOW())
5640 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
5642 if (!p_ptr->resist_conf)
5644 (void)set_confused(p_ptr->confused + randint0(4) + 4);
5647 if (!p_ptr->resist_chaos && one_in_(3))
5649 (void)set_image(p_ptr->image + randint0(250) + 150);
5656 p_ptr->csp_frac = 0;
5658 p_ptr->redraw |= PR_MANA;
5661 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5667 case GF_BRAIN_SMASH:
5669 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
5671 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5672 learn_spell(monspell);
5676 if (!CHECK_MULTISHADOW())
5678 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
5684 p_ptr->csp_frac = 0;
5686 p_ptr->redraw |= PR_MANA;
5689 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5690 if (!CHECK_MULTISHADOW())
5692 if (!p_ptr->resist_blind)
5694 (void)set_blind(p_ptr->blind + 8 + randint0(8));
5696 if (!p_ptr->resist_conf)
5698 (void)set_confused(p_ptr->confused + randint0(4) + 4);
5700 if (!p_ptr->free_act)
5702 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
5704 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5706 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
5707 (void)do_dec_stat(A_INT);
5708 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
5709 (void)do_dec_stat(A_WIS);
5711 if (!p_ptr->resist_chaos)
5713 (void)set_image(p_ptr->image + randint0(250) + 150);
5723 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5725 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5726 learn_spell(monspell);
5730 if (!CHECK_MULTISHADOW()) curse_equipment(15, 0);
5731 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5739 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5741 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5742 learn_spell(monspell);
5746 if (!CHECK_MULTISHADOW()) curse_equipment(25, MIN(rlev / 2 - 15, 5));
5747 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5755 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5757 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5758 learn_spell(monspell);
5762 if (!CHECK_MULTISHADOW()) curse_equipment(33, MIN(rlev / 2 - 15, 15));
5763 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5771 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU) && !CHECK_MULTISHADOW())
5773 msg_print(_("しかし秘孔を跳ね返した!", "You resist the effects!"));
5774 learn_spell(monspell);
5778 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5779 if (!CHECK_MULTISHADOW()) (void)set_cut(p_ptr->cut + damroll(10, 10));
5787 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5789 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5790 learn_spell(monspell);
5794 if (!CHECK_MULTISHADOW())
5796 msg_print(_("あなたは命が薄まっていくように感じた!", "You feel your life fade away!"));
5797 curse_equipment(40, 20);
5800 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
5802 if (p_ptr->chp < 1) p_ptr->chp = 1; /* Paranoia */
5817 /* Hex - revenge damage stored */
5818 revenge_store(get_damage);
5820 if ((p_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
5821 && (get_damage > 0) && !p_ptr->is_dead && (who > 0))
5823 GAME_TEXT m_name_self[80];
5826 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
5828 msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), m_name, m_name_self);
5829 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
5830 if (p_ptr->tim_eyeeye) set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
5833 if (p_ptr->riding && dam > 0)
5835 rakubadam_p = (dam > 200) ? 200 : dam;
5839 disturb(TRUE, TRUE);
5842 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
5844 (void)kawarimi(FALSE);
5847 /* Return "Anything seen?" */
5853 * Find the distance from (x, y) to a line.
5855 POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
5857 /* Vector from (x, y) to (x1, y1) */
5858 POSITION py = y1 - y;
5859 POSITION px = x1 - x;
5862 POSITION ny = x2 - x1;
5863 POSITION nx = y1 - y2;
5866 POSITION pd = distance(y1, x1, y, x);
5867 POSITION nd = distance(y1, x1, y2, x2);
5869 if (pd > nd) return distance(y, x, y2, x2);
5871 /* Component of P on N */
5872 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
5874 /* Absolute value */
5875 return((nd >= 0) ? nd : 0 - nd);
5882 * Modified version of los() for calculation of disintegration balls.
5883 * Disintegration effects are stopped by permanent walls.
5885 bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
5887 POSITION dx, dy; /* Delta */
5888 POSITION ax, ay; /* Absolute */
5889 POSITION sx, sy; /* Signs */
5890 POSITION qx, qy; /* Fractions */
5891 POSITION tx, ty; /* Scanners */
5892 POSITION f1, f2; /* Scale factors */
5893 POSITION m; /* Slope, or 1/Slope, of LOS */
5895 /* Extract the offset */
5899 /* Extract the absolute offset */
5903 /* Handle adjacent (or identical) grids */
5904 if ((ax < 2) && (ay < 2)) return (TRUE);
5906 /* Paranoia -- require "safe" origin */
5907 /* if (!in_bounds(y1, x1)) return (FALSE); */
5909 /* Directly South/North */
5912 /* South -- check for walls */
5915 for (ty = y1 + 1; ty < y2; ty++)
5917 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5921 /* North -- check for walls */
5924 for (ty = y1 - 1; ty > y2; ty--)
5926 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5934 /* Directly East/West */
5937 /* East -- check for walls */
5940 for (tx = x1 + 1; tx < x2; tx++)
5942 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5946 /* West -- check for walls */
5949 for (tx = x1 - 1; tx > x2; tx--)
5951 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5959 /* Extract some signs */
5960 sx = (dx < 0) ? -1 : 1;
5961 sy = (dy < 0) ? -1 : 1;
5963 /* Vertical "knights" */
5968 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
5972 /* Horizontal "knights" */
5977 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
5981 /* Calculate scale factor div 2 */
5984 /* Calculate scale factor */
5988 /* Travel horizontally */
5991 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
5997 /* Consider the special case where slope == 1. */
6008 /* Note (below) the case (qy == f2), where */
6009 /* the LOS exactly meets the corner of a tile. */
6012 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6023 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6036 /* Travel vertically */
6039 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
6055 /* Note (below) the case (qx == f2), where */
6056 /* the LOS exactly meets the corner of a tile. */
6059 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6070 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6091 void breath_shape(u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, EFFECT_ID typ)
6096 int brev = rad * rad / dist;
6100 int mdis = distance(y1, x1, y2, x2) + rad;
6102 while (bdis <= mdis)
6106 if ((0 < dist) && (path_n < dist))
6108 POSITION ny = GRID_Y(path_g[path_n]);
6109 POSITION nx = GRID_X(path_g[path_n]);
6110 POSITION nd = distance(ny, nx, y1, x1);
6112 /* Get next base point */
6121 /* Travel from center outward */
6122 for (cdis = 0; cdis <= brad; cdis++)
6124 /* Scan the maximal blast area of radius "cdis" */
6125 for (y = by - cdis; y <= by + cdis; y++)
6127 for (x = bx - cdis; x <= bx + cdis; x++)
6129 /* Ignore "illegal" locations */
6130 if (!in_bounds(y, x)) continue;
6132 /* Enforce a circular "ripple" */
6133 if (distance(y1, x1, y, x) != bdis) continue;
6135 /* Enforce an arc */
6136 if (distance(by, bx, y, x) != cdis) continue;
6142 /* Lights are stopped by opaque terrains */
6143 if (!los(by, bx, y, x)) continue;
6145 case GF_DISINTEGRATE:
6146 /* Disintegration are stopped only by perma-walls */
6147 if (!in_disintegration_range(by, bx, y, x)) continue;
6150 /* Ball explosions are stopped by walls */
6151 if (!projectable(by, bx, y, x)) continue;
6155 /* Save this grid */
6163 /* Encode some more "radius" info */
6164 gm[bdis + 1] = *pgrids;
6166 /* Increase the size */
6167 brad = rad * (path_n + brev) / (dist + brev);
6169 /* Find the next ripple */
6173 /* Store the effect size */
6179 * @brief 汎用的なビーム/ボルト/ボール系処理のルーチン Generic "beam"/"bolt"/"ball" projection routine.
6180 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
6181 * @param rad 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
6182 * @param y 目標Y座標 / Target y location (or location to travel "towards")
6183 * @param x 目標X座標 / Target x location (or location to travel "towards")
6184 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
6185 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
6186 * @param flg 効果フラグ / Extra bit flags (see PROJECT_xxxx in "defines.h")
6187 * @param monspell 効果元のモンスター魔法ID
6188 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
6191 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
6192 * towards a given location (optionally passing over the heads of interposing
6193 * monsters), and have it do a given amount of damage to the monsters (and
6194 * optionally objects) within the given radius of the final location.
6196 * A "bolt" travels from source to target and affects only the target grid.
6197 * A "beam" travels from source to target, affecting all grids passed through.
6198 * A "ball" travels from source to the target, exploding at the target, and
6199 * affecting everything within the given radius of the target location.
6201 * Traditionally, a "bolt" does not affect anything on the ground, and does
6202 * not pass over the heads of interposing monsters, much like a traditional
6203 * missile, and will "stop" abruptly at the "target" even if no monster is
6204 * positioned there, while a "ball", on the other hand, passes over the heads
6205 * of monsters between the source and target, and affects everything except
6206 * the source monster which lies within the final radius, while a "beam"
6207 * affects every monster between the source and target, except for the casting
6208 * monster (or player), and rarely affects things on the ground.
6210 * Two special flags allow us to use this function in special ways, the
6211 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
6212 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
6213 * actually projecting from the source monster (or player).
6215 * The player will only get "experience" for monsters killed by himself
6216 * Unique monsters can only be destroyed by attacks from the player
6218 * Only 256 grids can be affected per projection, limiting the effective
6219 * "radius" of standard ball attacks to nine units (diameter nineteen).
6221 * One can project in a given "direction" by combining PROJECT_THRU with small
6222 * offsets to the initial location (see "line_spell()"), or by calculating
6223 * "virtual targets" far away from the player.
6225 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
6226 * continuing until it actually hits somethings (useful for "stone to mud").
6228 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
6230 * Balls must explode BEFORE hitting walls, or they would affect monsters
6231 * on both sides of a wall. Some bug reports indicate that this is still
6232 * happening in 2.7.8 for Windows, though it appears to be impossible.
6234 * We "pre-calculate" the blast area only in part for efficiency.
6235 * More importantly, this lets us do "explosions" from the "inside" out.
6236 * This results in a more logical distribution of "blast" treasure.
6237 * It also produces a better (in my opinion) animation of the explosion.
6238 * It could be (but is not) used to have the treasure dropped by monsters
6239 * in the middle of the explosion fall "outwards", and then be damaged by
6240 * the blast as it spreads outwards towards the treasure drop location.
6242 * Walls and doors are included in the blast area, so that they can be
6243 * "burned" or "melted" in later versions.
6245 * This algorithm is intended to maximize simplicity, not necessarily
6246 * efficiency, since this function is not a bottleneck in the code.
6248 * We apply the blast effect from ground zero outwards, in several passes,
6249 * first affecting features, then objects, then monsters, then the player.
6250 * This allows walls to be removed before checking the object or monster
6251 * in the wall, and protects objects which are dropped by monsters killed
6252 * in the blast, and allows the player to see all affects before he is
6253 * killed or teleported away. The semantics of this method are open to
6254 * various interpretations, but they seem to work well in practice.
6256 * We process the blast area from ground-zero outwards to allow for better
6257 * distribution of treasure dropped by monsters, and because it provides a
6258 * pleasing visual effect at low cost.
6260 * Note that the damage done by "ball" explosions decreases with distance.
6261 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
6263 * Notice the "napalm" effect of "beam" weapons. First they "project" to
6264 * the target, and then the damage "flows" along this beam of destruction.
6265 * The damage at every grid is the same as at the "center" of a "ball"
6266 * explosion, since the "beam" grids are treated as if they ARE at the
6267 * center of a "ball" explosion.
6269 * Currently, specifying "beam" plus "ball" means that locations which are
6270 * covered by the initial "beam", and also covered by the final "ball", except
6271 * for the final grid (the epicenter of the ball), will be "hit twice", once
6272 * by the initial beam, and once by the exploding ball. For the grid right
6273 * next to the epicenter, this results in 150% damage being done. The center
6274 * does not have this problem, for the same reason the final grid in a "beam"
6275 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
6276 * grids which are covered by the "ball" will NOT work, as then they will
6277 * receive LESS damage than they should. Do not combine "beam" with "ball".
6279 * The array "gy[],gx[]" with current size "grids" is used to hold the
6280 * collected locations of all grids in the "blast area" plus "beam path".
6282 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
6283 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
6284 * first blast grid (see above) with radius "N" from the blast center. Note
6285 * that only the first gm[1] grids in the blast area thus take full damage.
6286 * Also, note that gm[rad+1] is always equal to "grids", which is the total
6287 * number of blast grids.
6289 * Note that once the projection is complete, (y2,x2) holds the final location
6290 * of bolts/beams, and the "epicenter" of balls.
6292 * Note also that "rad" specifies the "inclusive" radius of projection blast,
6293 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
6294 * implementation of the "distance" function. Also, a bolt can be properly
6295 * viewed as a "ball" with a "rad" of "zero".
6297 * Note that if no "target" is reached before the beam/bolt/ball travels the
6298 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
6299 * may be relevant even for bolts, since they have a "1x1" mini-blast.
6301 * Note that for consistency, we "pretend" that the bolt actually takes "time"
6302 * to move from point A to point B, even if the player cannot see part of the
6303 * projection path. Note that in general, the player will *always* see part
6304 * of the path, since it either starts at the player or ends on the player.
6306 * Hack -- we assume that every "projection" is "self-illuminating".
6308 * Hack -- when only a single monster is affected, we automatically track
6309 * (and recall) that monster, unless "PROJECT_JUMP" is used.
6311 * Note that all projections now "explode" at their final destination, even
6312 * if they were being projected at a more distant destination. This means
6313 * that "ball" spells will *always* explode.
6315 * Note that we must call "handle_stuff()" after affecting terrain features
6316 * in the blast radius, in case the "illumination" of the grid was changed,
6317 * and "update_view()" and "update_monsters()" need to be called.
6320 bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
6330 POSITION y_saver, x_saver; /* For reflecting monsters */
6332 int msec = delay_factor * delay_factor * delay_factor;
6334 /* Assume the player sees nothing */
6335 bool notice = FALSE;
6337 /* Assume the player has seen nothing */
6338 bool visual = FALSE;
6340 /* Assume the player has seen no blast grids */
6343 /* Assume to be a normal ball spell */
6344 bool breath = FALSE;
6346 /* Is the player blind? */
6347 bool blind = (p_ptr->blind ? TRUE : FALSE);
6349 bool old_hide = FALSE;
6351 /* Number of grids in the "path" */
6354 /* Actual grids in the "path" */
6357 /* Number of grids in the "blast area" (including the "beam" path) */
6360 /* Coordinates of the affected grids */
6361 POSITION gx[1024], gy[1024];
6363 /* Encoded "radius" info (see above) */
6366 /* Actual radius encoded in gm[] */
6367 POSITION gm_rad = rad;
6371 /* Attacker's name (prepared before polymorph)*/
6372 GAME_TEXT who_name[MAX_NLEN];
6374 /* Can the player see the source of this effect? */
6375 bool see_s_msg = TRUE;
6377 /* Initialize by null string */
6383 /* Default target of monsterspell is player */
6384 monster_target_y = p_ptr->y;
6385 monster_target_x = p_ptr->x;
6387 /* Hack -- Jump to target */
6388 if (flg & (PROJECT_JUMP))
6393 /* Clear the flag */
6394 flg &= ~(PROJECT_JUMP);
6399 /* Start at player */
6406 /* Start at monster */
6409 x1 = m_list[who].fx;
6410 y1 = m_list[who].fy;
6411 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
6423 /* Default "destination" */
6428 /* Hack -- verify stuff */
6429 if (flg & (PROJECT_THRU))
6431 if ((x1 == x2) && (y1 == y2))
6433 flg &= ~(PROJECT_THRU);
6437 /* Handle a breath attack */
6442 if (flg & PROJECT_HIDE) old_hide = TRUE;
6443 flg |= PROJECT_HIDE;
6447 /* Hack -- Assume there will be no blast (max radius 32) */
6448 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
6456 /* Collect beam grids */
6457 if (flg & (PROJECT_BEAM))
6468 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
6470 case GF_DISINTEGRATE:
6471 flg |= (PROJECT_GRID);
6472 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
6476 /* Calculate the projection path */
6478 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
6481 /* Giga-Hack SEEKER & SUPER_RAY */
6483 if( typ == GF_SEEKER )
6493 for (i = 0; i < path_n; ++i)
6498 int ny = GRID_Y(path_g[i]);
6499 int nx = GRID_X(path_g[i]);
6510 /* Only do visuals if requested */
6511 if (!blind && !(flg & (PROJECT_HIDE)))
6513 /* Only do visuals if the player can "see" the bolt */
6514 if (panel_contains(y, x) && player_has_los_bold(y, x))
6521 /* Obtain the bolt pict */
6522 p = bolt_pict(oy, ox, y, x, typ);
6524 /* Extract attr/char */
6528 /* Visual effects */
6529 print_rel(c, a, y, x);
6530 move_cursor_relative(y, x);
6531 /*if (fresh_before)*/ Term_fresh();
6532 Term_xtra(TERM_XTRA_DELAY, msec);
6534 /*if (fresh_before)*/ Term_fresh();
6536 /* Display "beam" grids */
6537 if (flg & (PROJECT_BEAM))
6539 /* Obtain the explosion pict */
6540 p = bolt_pict(y, x, y, x, typ);
6542 /* Extract attr/char */
6546 /* Visual effects */
6547 print_rel(c, a, y, x);
6550 /* Hack -- Activate delay */
6554 /* Hack -- delay anyway for consistency */
6557 /* Delay for consistency */
6558 Term_xtra(TERM_XTRA_DELAY, msec);
6561 if (project_o(0, 0, y, x, dam, GF_SEEKER))notice = TRUE;
6562 if (is_mirror_grid(&cave[y][x]))
6564 /* The target of monsterspell becomes tha mirror(broken) */
6565 monster_target_y = y;
6566 monster_target_x = x;
6568 remove_mirror(y, x);
6569 next_mirror(&oy, &ox, y, x);
6571 path_n = i + project_path(&(path_g[i + 1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
6572 for (j = last_i; j <= i; j++)
6574 y = GRID_Y(path_g[j]);
6575 x = GRID_X(path_g[j]);
6576 if (project_m(0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
6577 if (!who && (project_m_n == 1) && !jump) {
6578 if (cave[project_m_y][project_m_x].m_idx > 0) {
6579 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
6583 /* Hack -- auto-recall */
6584 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6586 /* Hack - auto-track */
6587 health_track(cave[project_m_y][project_m_x].m_idx);
6591 (void)project_f(0, 0, y, x, dam, GF_SEEKER);
6596 for(i = last_i ; i < path_n ; i++)
6599 py = GRID_Y(path_g[i]);
6600 px = GRID_X(path_g[i]);
6601 if (project_m(0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
6603 if (!who && (project_m_n == 1) && !jump) {
6604 if (cave[project_m_y][project_m_x].m_idx > 0)
6606 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
6610 /* Hack -- auto-recall */
6611 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6613 /* Hack - auto-track */
6614 health_track(cave[project_m_y][project_m_x].m_idx);
6618 (void)project_f(0, 0, py, px, dam, GF_SEEKER);
6622 else if(typ == GF_SUPER_RAY){
6624 int second_step = 0;
6631 for (i = 0; i < path_n; ++i)
6636 POSITION ny = GRID_Y(path_g[i]);
6637 POSITION nx = GRID_X(path_g[i]);
6648 /* Only do visuals if requested */
6649 if (!blind && !(flg & (PROJECT_HIDE)))
6651 /* Only do visuals if the player can "see" the bolt */
6652 if (panel_contains(y, x) && player_has_los_bold(y, x))
6659 /* Obtain the bolt pict */
6660 p = bolt_pict(oy, ox, y, x, typ);
6662 /* Extract attr/char */
6666 /* Visual effects */
6667 print_rel(c, a, y, x);
6668 move_cursor_relative(y, x);
6669 /*if (fresh_before)*/ Term_fresh();
6670 Term_xtra(TERM_XTRA_DELAY, msec);
6672 /*if (fresh_before)*/ Term_fresh();
6674 /* Display "beam" grids */
6675 if (flg & (PROJECT_BEAM))
6677 /* Obtain the explosion pict */
6678 p = bolt_pict(y, x, y, x, typ);
6680 /* Extract attr/char */
6684 /* Visual effects */
6685 print_rel(c, a, y, x);
6688 /* Hack -- Activate delay */
6692 /* Hack -- delay anyway for consistency */
6695 /* Delay for consistency */
6696 Term_xtra(TERM_XTRA_DELAY, msec);
6699 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
6700 if (!cave_have_flag_bold(y, x, FF_PROJECT))
6702 if( second_step )continue;
6705 if( is_mirror_grid(&cave[y][x]) && !second_step )
6707 /* The target of monsterspell becomes tha mirror(broken) */
6708 monster_target_y=(s16b)y;
6709 monster_target_x=(s16b)x;
6712 for( j = 0; j <=i ; j++ )
6714 y = GRID_Y(path_g[j]);
6715 x = GRID_X(path_g[j]);
6716 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
6720 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
6721 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
6722 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
6723 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
6724 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
6725 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
6726 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
6727 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
6730 for( i = 0; i < path_n ; i++ )
6733 py = GRID_Y(path_g[i]);
6734 px = GRID_X(path_g[i]);
6735 (void)project_m(0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
6736 if(!who && (project_m_n == 1) && !jump){
6737 if(cave[project_m_y][project_m_x].m_idx >0 ){
6738 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
6742 /* Hack -- auto-recall */
6743 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6745 /* Hack - auto-track */
6746 health_track(cave[project_m_y][project_m_x].m_idx);
6750 (void)project_f(0, 0, py, px, dam, GF_SUPER_RAY);
6755 /* Project along the path */
6756 for (i = 0; i < path_n; ++i)
6761 POSITION ny = GRID_Y(path_g[i]);
6762 POSITION nx = GRID_X(path_g[i]);
6764 if (flg & PROJECT_DISI)
6766 /* Hack -- Balls explode before reaching walls */
6767 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
6769 else if (flg & PROJECT_LOS)
6771 /* Hack -- Balls explode before reaching walls */
6772 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
6776 /* Hack -- Balls explode before reaching walls */
6777 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
6784 /* Collect beam grids */
6785 if (flg & (PROJECT_BEAM))
6792 /* Only do visuals if requested */
6793 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
6795 /* Only do visuals if the player can "see" the bolt */
6796 if (panel_contains(y, x) && player_has_los_bold(y, x))
6803 /* Obtain the bolt pict */
6804 p = bolt_pict(oy, ox, y, x, typ);
6806 /* Extract attr/char */
6810 /* Visual effects */
6811 print_rel(c, a, y, x);
6812 move_cursor_relative(y, x);
6813 /*if (fresh_before)*/ Term_fresh();
6814 Term_xtra(TERM_XTRA_DELAY, msec);
6816 /*if (fresh_before)*/ Term_fresh();
6818 /* Display "beam" grids */
6819 if (flg & (PROJECT_BEAM))
6821 /* Obtain the explosion pict */
6822 p = bolt_pict(y, x, y, x, typ);
6824 /* Extract attr/char */
6828 /* Visual effects */
6829 print_rel(c, a, y, x);
6832 /* Hack -- Activate delay */
6836 /* Hack -- delay anyway for consistency */
6839 /* Delay for consistency */
6840 Term_xtra(TERM_XTRA_DELAY, msec);
6847 /* Save the "blast epicenter" */
6851 if (breath && !path_n)
6857 flg &= ~(PROJECT_HIDE);
6861 /* Start the "explosion" */
6864 /* Hack -- make sure beams get to "explode" */
6872 /* If we found a "target", explode there */
6873 if (dist <= MAX_RANGE)
6875 /* Mega-Hack -- remove the final "beam" grid */
6876 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
6879 * Create a conical breath attack
6890 flg &= ~(PROJECT_HIDE);
6892 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
6896 /* Determine the blast area, work from the inside out */
6897 for (dist = 0; dist <= rad; dist++)
6899 /* Scan the maximal blast area of radius "dist" */
6900 for (y = by - dist; y <= by + dist; y++)
6902 for (x = bx - dist; x <= bx + dist; x++)
6904 /* Ignore "illegal" locations */
6905 if (!in_bounds2(y, x)) continue;
6907 /* Enforce a "circular" explosion */
6908 if (distance(by, bx, y, x) != dist) continue;
6914 /* Lights are stopped by opaque terrains */
6915 if (!los(by, bx, y, x)) continue;
6917 case GF_DISINTEGRATE:
6918 /* Disintegration are stopped only by perma-walls */
6919 if (!in_disintegration_range(by, bx, y, x)) continue;
6922 /* Ball explosions are stopped by walls */
6923 if (!projectable(by, bx, y, x)) continue;
6927 /* Save this grid */
6934 /* Encode some more "radius" info */
6940 /* Speed -- ignore "non-explosions" */
6941 if (!grids) return (FALSE);
6944 /* Display the "blast area" if requested */
6945 if (!blind && !(flg & (PROJECT_HIDE)))
6947 /* Then do the "blast", from inside out */
6948 for (t = 0; t <= gm_rad; t++)
6950 /* Dump everything with this radius */
6951 for (i = gm[t]; i < gm[t+1]; i++)
6953 /* Extract the location */
6957 /* Only do visuals if the player can "see" the blast */
6958 if (panel_contains(y, x) && player_has_los_bold(y, x))
6967 /* Obtain the explosion pict */
6968 p = bolt_pict(y, x, y, x, typ);
6970 /* Extract attr/char */
6974 /* Visual effects -- Display */
6975 print_rel(c, a, y, x);
6979 /* Hack -- center the cursor */
6980 move_cursor_relative(by, bx);
6982 /* Flush each "radius" seperately */
6983 /*if (fresh_before)*/ Term_fresh();
6985 /* Delay (efficiently) */
6986 if (visual || drawn)
6988 Term_xtra(TERM_XTRA_DELAY, msec);
6992 /* Flush the erasing */
6995 /* Erase the explosion drawn above */
6996 for (i = 0; i < grids; i++)
6998 /* Extract the location */
7002 /* Hack -- Erase if needed */
7003 if (panel_contains(y, x) && player_has_los_bold(y, x))
7009 /* Hack -- center the cursor */
7010 move_cursor_relative(by, bx);
7012 /* Flush the explosion */
7013 /*if (fresh_before)*/ Term_fresh();
7017 update_creature(p_ptr);
7019 if (flg & PROJECT_KILL)
7021 see_s_msg = (who > 0) ? is_seen(&m_list[who]) :
7022 (!who ? TRUE : (player_can_see_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)));
7026 /* Check features */
7027 if (flg & (PROJECT_GRID))
7029 /* Start with "dist" of zero */
7032 /* Scan for features */
7033 for (i = 0; i < grids; i++)
7035 /* Hack -- Notice new "dist" values */
7036 if (gm[dist+1] == i) dist++;
7038 /* Get the grid location */
7042 /* Find the closest point in the blast */
7045 int d = dist_to_line(y, x, y1, x1, by, bx);
7047 /* Affect the grid */
7048 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
7052 /* Affect the grid */
7053 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
7058 update_creature(p_ptr);
7061 if (flg & (PROJECT_ITEM))
7063 /* Start with "dist" of zero */
7066 /* Scan for objects */
7067 for (i = 0; i < grids; i++)
7069 /* Hack -- Notice new "dist" values */
7070 if (gm[dist+1] == i) dist++;
7072 /* Get the grid location */
7076 /* Find the closest point in the blast */
7079 int d = dist_to_line(y, x, y1, x1, by, bx);
7081 /* Affect the object in the grid */
7082 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
7086 /* Affect the object in the grid */
7087 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
7093 /* Check monsters */
7094 if (flg & (PROJECT_KILL))
7101 /* Start with "dist" of zero */
7104 /* Scan for monsters */
7105 for (i = 0; i < grids; i++)
7109 /* Hack -- Notice new "dist" values */
7110 if (gm[dist + 1] == i) dist++;
7112 /* Get the grid location */
7116 /* A single bolt may be reflected */
7119 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
7120 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
7122 if ((flg & PROJECT_REFLECTABLE) && cave[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
7123 ((cave[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
7124 (!who || dist_hack > 1) && !one_in_(10))
7127 int max_attempts = 10;
7129 /* Choose 'new' target */
7132 t_y = y_saver - 1 + randint1(3);
7133 t_x = x_saver - 1 + randint1(3);
7136 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
7138 if (max_attempts < 1)
7144 sound(SOUND_REFLECT);
7147 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
7148 msg_print(_("「北斗神拳奥義・二指真空把!」", "The attack bounces!"));
7149 else if (m_ptr->r_idx == MON_DIO)
7150 msg_print(_("ディオ・ブランドーは指一本で攻撃を弾き返した!", "The attack bounces!"));
7152 msg_print(_("攻撃は跳ね返った!", "The attack bounces!"));
7154 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
7156 /* Reflected bolts randomly target either one */
7157 if (player_bold(y, x) || one_in_(2)) flg &= ~(PROJECT_PLAYER);
7158 else flg |= PROJECT_PLAYER;
7160 /* The bolt is reflected */
7161 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
7163 /* Don't affect the monster any longer */
7169 /* Find the closest point in the blast */
7172 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
7176 effective_dist = dist;
7180 /* There is the riding player on this monster */
7181 if (p_ptr->riding && player_bold(y, x))
7183 /* Aimed on the player */
7184 if (flg & PROJECT_PLAYER)
7186 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
7189 * A beam or bolt is well aimed
7191 * So don't affects the mount.
7198 * The spell is not well aimed,
7199 * So partly affect the mount too.
7206 * This grid is the original target.
7207 * Or aimed on your horse.
7209 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
7211 /* Hit the mount with full damage */
7215 * Otherwise this grid is not the
7216 * original target, it means that line
7217 * of fire is obstructed by this
7221 * A beam or bolt will hit either
7222 * player or mount. Choose randomly.
7224 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
7228 /* Hit the mount with full damage */
7232 /* Hit the player later */
7233 flg |= PROJECT_PLAYER;
7235 /* Don't affect the mount */
7241 * The spell is not well aimed, so
7242 * partly affect both player and
7251 /* Affect the monster in the grid */
7252 if (project_m(who, effective_dist, y, x, dam, typ, flg, see_s_msg)) notice = TRUE;
7256 /* Player affected one monster (without "jumping") */
7257 if (!who && (project_m_n == 1) && !jump)
7262 /* Track if possible */
7263 if (cave[y][x].m_idx > 0)
7265 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
7269 /* Hack -- auto-recall */
7270 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
7272 /* Hack - auto-track */
7273 if (m_ptr->ml) health_track(cave[y][x].m_idx);
7281 if (flg & (PROJECT_KILL))
7283 /* Start with "dist" of zero */
7286 /* Scan for player */
7287 for (i = 0; i < grids; i++)
7291 /* Hack -- Notice new "dist" values */
7292 if (gm[dist+1] == i) dist++;
7294 /* Get the grid location */
7298 /* Affect the player? */
7299 if (!player_bold(y, x)) continue;
7301 /* Find the closest point in the blast */
7304 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
7308 effective_dist = dist;
7311 /* Target may be your horse */
7314 /* Aimed on the player */
7315 if (flg & PROJECT_PLAYER)
7317 /* Hit the player with full damage */
7321 * Hack -- When this grid was not the
7322 * original target, a beam or bolt
7323 * would hit either player or mount,
7324 * and should be choosen randomly.
7326 * But already choosen to hit the
7327 * mount at this point.
7329 * Or aimed on your horse.
7331 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
7334 * A beam or bolt is well aimed
7336 * So don't affects the player.
7343 * The spell is not well aimed,
7344 * So partly affect the player too.
7350 /* Affect the player */
7351 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
7357 GAME_TEXT m_name[MAX_NLEN];
7359 monster_desc(m_name, &m_list[p_ptr->riding], 0);
7361 if (rakubadam_m > 0)
7363 if (rakuba(rakubadam_m, FALSE))
7365 msg_format(_("%^sに振り落とされた!", "%^s has thrown you off!"), m_name);
7368 if (p_ptr->riding && rakubadam_p > 0)
7370 if(rakuba(rakubadam_p, FALSE))
7372 msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_name);
7377 /* Return "something was noticed" */
7382 * @brief 鏡魔法「封魔結界」の効果処理
7384 * @return 効果があったらTRUEを返す
7386 bool binding_field(HIT_POINT dam)
7388 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
7389 int mirror_num = 0; /* 鏡の数 */
7391 POSITION centersign;
7392 POSITION x1, x2, y1, y2;
7394 int msec = delay_factor*delay_factor*delay_factor;
7397 POSITION point_x[3];
7398 POSITION point_y[3];
7400 /* Default target of monsterspell is player */
7401 monster_target_y = p_ptr->y;
7402 monster_target_x = p_ptr->x;
7404 for (x = 0; x < cur_wid; x++)
7406 for (y = 0; y < cur_hgt; y++)
7408 if (is_mirror_grid(&cave[y][x]) &&
7409 distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
7410 distance(p_ptr->y, p_ptr->x, y, x) != 0 &&
7411 player_has_los_bold(y, x) &&
7412 projectable(p_ptr->y, p_ptr->x, y, x)
7414 mirror_y[mirror_num] = y;
7415 mirror_x[mirror_num] = x;
7421 if (mirror_num < 2)return FALSE;
7423 point_x[0] = randint0(mirror_num);
7425 point_x[1] = randint0(mirror_num);
7426 } while (point_x[0] == point_x[1]);
7428 point_y[0] = mirror_y[point_x[0]];
7429 point_x[0] = mirror_x[point_x[0]];
7430 point_y[1] = mirror_y[point_x[1]];
7431 point_x[1] = mirror_x[point_x[1]];
7432 point_y[2] = p_ptr->y;
7433 point_x[2] = p_ptr->x;
7435 x = point_x[0] + point_x[1] + point_x[2];
7436 y = point_y[0] + point_y[1] + point_y[2];
7438 centersign = (point_x[0] * 3 - x)*(point_y[1] * 3 - y)
7439 - (point_y[0] * 3 - y)*(point_x[1] * 3 - x);
7440 if (centersign == 0)return FALSE;
7442 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
7443 x1 = x1 < point_x[2] ? x1 : point_x[2];
7444 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
7445 y1 = y1 < point_y[2] ? y1 : point_y[2];
7447 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
7448 x2 = x2 > point_x[2] ? x2 : point_x[2];
7449 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
7450 y2 = y2 > point_y[2] ? y2 : point_y[2];
7452 for (y = y1; y <= y2; y++) {
7453 for (x = x1; x <= x2; x++) {
7454 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7455 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7456 centersign*((point_x[1] - x)*(point_y[2] - y)
7457 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7458 centersign*((point_x[2] - x)*(point_y[0] - y)
7459 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7461 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7462 /* Visual effects */
7464 && panel_contains(y, x)) {
7465 p = bolt_pict(y, x, y, x, GF_MANA);
7466 print_rel(PICT_C(p), PICT_A(p), y, x);
7467 move_cursor_relative(y, x);
7468 /*if (fresh_before)*/ Term_fresh();
7469 Term_xtra(TERM_XTRA_DELAY, msec);
7475 for (y = y1; y <= y2; y++) {
7476 for (x = x1; x <= x2; x++) {
7477 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7478 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7479 centersign*((point_x[1] - x)*(point_y[2] - y)
7480 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7481 centersign*((point_x[2] - x)*(point_y[0] - y)
7482 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7484 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7485 (void)project_f(0, 0, y, x, dam, GF_MANA);
7490 for (y = y1; y <= y2; y++) {
7491 for (x = x1; x <= x2; x++) {
7492 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7493 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7494 centersign*((point_x[1] - x)*(point_y[2] - y)
7495 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7496 centersign*((point_x[2] - x)*(point_y[0] - y)
7497 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7499 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7500 (void)project_o(0, 0, y, x, dam, GF_MANA);
7505 for (y = y1; y <= y2; y++) {
7506 for (x = x1; x <= x2; x++) {
7507 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7508 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7509 centersign*((point_x[1] - x)*(point_y[2] - y)
7510 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7511 centersign*((point_x[2] - x)*(point_y[0] - y)
7512 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7514 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7515 (void)project_m(0, 0, y, x, dam, GF_MANA,
7516 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE);
7522 msg_print(_("鏡が結界に耐えきれず、壊れてしまった。", "The field broke a mirror"));
7523 remove_mirror(point_y[0], point_x[0]);
7530 * @brief 鏡魔法「鏡の封印」の効果処理
7532 * @return 効果があったらTRUEを返す
7534 void seal_of_mirror(HIT_POINT dam)
7538 for (x = 0; x < cur_wid; x++)
7540 for (y = 0; y < cur_hgt; y++)
7542 if (is_mirror_grid(&cave[y][x]))
7544 if (project_m(0, 0, y, x, dam, GF_GENOCIDE,
7545 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE))
7547 if (!cave[y][x].m_idx)
7549 remove_mirror(y, x);