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"
34 static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
35 static int rakubadam_p; /*!< 落馬した際のダメージ量 */
37 int project_length = 0; /*!< 投射の射程距離 */
41 * @brief モンスター魅了用セービングスロー共通部(汎用系)
43 * @param m_ptr 対象モンスター
44 * @return 魅了に抵抗したらTRUE
46 static bool_hack common_saving_throw_charm(player_type *player_ptr, HIT_POINT pow, monster_type *m_ptr)
48 monster_race *r_ptr = &r_info[m_ptr->r_idx];
50 if(p_ptr->inside_arena) return TRUE;
53 if (r_ptr->flagsr & RFR_RES_ALL)
55 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
59 if (r_ptr->flags3 & RF3_NO_CONF)
61 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
65 if (r_ptr->flags1 & RF1_QUESTOR || m_ptr->mflag2 & MFLAG2_NOPET) return TRUE;
67 pow += (adj_chr_chm[player_ptr->stat_ind[A_CHR]] - 1);
68 if((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) pow = pow * 2 / 3;
69 return (r_ptr->level > randint1((pow - 10) < 1 ? 1 : (pow - 10)) + 5);
73 * @brief モンスター服従用セービングスロー共通部(部族依存系)
75 * @param m_ptr 対象モンスター
76 * @return 服従に抵抗したらTRUE
78 static bool_hack common_saving_throw_control(player_type *player_ptr, HIT_POINT pow, monster_type *m_ptr)
80 monster_race *r_ptr = &r_info[m_ptr->r_idx];
82 if (p_ptr->inside_arena) return TRUE;
85 if (r_ptr->flagsr & RFR_RES_ALL)
87 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
91 if (r_ptr->flags1 & RF1_QUESTOR || m_ptr->mflag2 & MFLAG2_NOPET) return TRUE;
93 pow += adj_chr_chm[player_ptr->stat_ind[A_CHR]] - 1;
94 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) pow = pow * 2 / 3;
95 return (r_ptr->level > randint1((pow - 10) < 1 ? 1 : (pow - 10)) + 5);
99 * @brief 一部ボルト魔法のビーム化確率を算出する / Prepare standard probability to become beam for fire_bolt_or_beam()
102 * ハードコーティングによる実装が行われている。
103 * メイジは(レベル)%、ハイメイジ、スペルマスターは(レベル)%、それ以外の職業は(レベル/2)%
105 PERCENTAGE beam_chance(void)
107 if (p_ptr->pclass == CLASS_MAGE)
108 return (PERCENTAGE)(p_ptr->lev);
109 if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
110 return (PERCENTAGE)(p_ptr->lev + 10);
112 return (PERCENTAGE)(p_ptr->lev / 2);
117 * @brief 配置した鏡リストの次を取得する /
118 * Get another mirror. for SEEKER
119 * @param next_y 次の鏡のy座標を返す参照ポインタ
120 * @param next_x 次の鏡のx座標を返す参照ポインタ
121 * @param cury 現在の鏡のy座標
122 * @param curx 現在の鏡のx座標
124 static void next_mirror(POSITION* next_y, POSITION* next_x, POSITION cury, POSITION curx)
126 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
127 int mirror_num = 0; /* 鏡の数 */
131 for (x = 0; x < cur_wid; x++)
133 for (y = 0; y < cur_hgt; y++)
135 if (is_mirror_grid(&cave[y][x])) {
136 mirror_y[mirror_num] = y;
137 mirror_x[mirror_num] = x;
144 num = randint0(mirror_num);
145 *next_y = mirror_y[num];
146 *next_x = mirror_x[num];
149 *next_y = cury + randint0(5) - 2;
150 *next_x = curx + randint0(5) - 2;
155 * @brief 万色表現用にランダムな色を選択する関数 /
156 * Get a legal "multi-hued" color for drawing "spells"
160 static TERM_COLOR mh_attr(int max)
162 switch (randint1(max))
164 case 1: return (TERM_RED);
165 case 2: return (TERM_GREEN);
166 case 3: return (TERM_BLUE);
167 case 4: return (TERM_YELLOW);
168 case 5: return (TERM_ORANGE);
169 case 6: return (TERM_VIOLET);
170 case 7: return (TERM_L_RED);
171 case 8: return (TERM_L_GREEN);
172 case 9: return (TERM_L_BLUE);
173 case 10: return (TERM_UMBER);
174 case 11: return (TERM_L_UMBER);
175 case 12: return (TERM_SLATE);
176 case 13: return (TERM_WHITE);
177 case 14: return (TERM_L_WHITE);
178 case 15: return (TERM_L_DARK);
186 * @brief 魔法属性に応じたエフェクトの色を返す /
187 * Return a color to use for the bolt/ball spells
191 static TERM_COLOR spell_color(int type)
193 /* Check if A.B.'s new graphics should be used (rr9) */
194 if (streq(ANGBAND_GRAF, "new") || streq(ANGBAND_GRAF, "ne2"))
199 case GF_PSY_SPEAR: return (0x06);
200 case GF_MISSILE: return (0x0F);
201 case GF_ACID: return (0x04);
202 case GF_ELEC: return (0x02);
203 case GF_FIRE: return (0x00);
204 case GF_COLD: return (0x01);
205 case GF_POIS: return (0x03);
206 case GF_HOLY_FIRE: return (0x00);
207 case GF_HELL_FIRE: return (0x00);
208 case GF_MANA: return (0x0E);
210 case GF_SEEKER: return (0x0E);
211 case GF_SUPER_RAY: return (0x0E);
213 case GF_ARROW: return (0x0F);
214 case GF_WATER: return (0x04);
215 case GF_NETHER: return (0x07);
216 case GF_CHAOS: return (mh_attr(15));
217 case GF_DISENCHANT: return (0x05);
218 case GF_NEXUS: return (0x0C);
219 case GF_CONFUSION: return (mh_attr(4));
220 case GF_SOUND: return (0x09);
221 case GF_SHARDS: return (0x08);
222 case GF_FORCE: return (0x09);
223 case GF_INERTIAL: return (0x09);
224 case GF_GRAVITY: return (0x09);
225 case GF_TIME: return (0x09);
226 case GF_LITE_WEAK: return (0x06);
227 case GF_LITE: return (0x06);
228 case GF_DARK_WEAK: return (0x07);
229 case GF_DARK: return (0x07);
230 case GF_PLASMA: return (0x0B);
231 case GF_METEOR: return (0x00);
232 case GF_ICE: return (0x01);
233 case GF_ROCKET: return (0x0F);
234 case GF_DEATH_RAY: return (0x07);
235 case GF_NUKE: return (mh_attr(2));
236 case GF_DISINTEGRATE: return (0x05);
248 case GF_CAUSE_4: return (0x0E);
249 case GF_HAND_DOOM: return (0x07);
250 case GF_CAPTURE : return (0x0E);
251 case GF_IDENTIFY: return (0x01);
252 case GF_ATTACK: return (0x0F);
253 case GF_PHOTO : return (0x06);
256 /* Normal tiles or ASCII */
262 /* Lookup the default colors for this type */
263 concptr s = quark_str(gf_color[type]);
265 if (!s) return (TERM_WHITE);
267 /* Pick a random color */
268 c = s[randint0(strlen(s))];
270 /* Lookup this color */
271 a = my_strchr(color_char, c) - color_char;
273 /* Invalid color (note check for < 0 removed, gave a silly
274 * warning because bytes are always >= 0 -- RG) */
275 if (a > 15) return (TERM_WHITE);
281 /* Standard "color" */
287 * @brief 始点から終点にかけた方向毎にボルトのキャラクタを返す /
288 * Find the attr/char pair to use for a spell effect
297 * It is moving (or has moved) from (x,y) to (nx,ny).
298 * If the distance is not "one", we (may) return "*".
301 u16b bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, EFFECT_ID typ)
311 if ((ny == y) && (nx == x)) base = 0x30;
314 else if (nx == x) base = 0x40;
317 else if (ny == y) base = 0x50;
320 else if ((ny - y) == (x - nx)) base = 0x60;
323 else if ((ny - y) == (nx - x)) base = 0x70;
328 /* Basic spell color */
329 k = spell_color(typ);
331 /* Obtain attr/char */
332 a = misc_to_attr[base + k];
333 c = misc_to_char[base + k];
342 * Mega-Hack -- track "affected" monsters (see "project()" comments)
344 static int project_m_n; /*!< 魔法効果範囲内にいるモンスターの数 */
345 static POSITION project_m_x; /*!< 処理中のモンスターX座標 */
346 static POSITION project_m_y; /*!< 処理中のモンスターY座標 */
347 /* Mega-Hack -- monsters target */
348 static POSITION monster_target_x; /*!< モンスターの攻撃目標X座標 */
349 static POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
353 * @brief 汎用的なビーム/ボルト/ボール系による地形効果処理 / We are called from "project()" to "damage" terrain features
354 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
355 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
356 * @param y 目標Y座標 / Target y location (or location to travel "towards")
357 * @param x 目標X座標 / Target x location (or location to travel "towards")
358 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
359 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
360 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
363 * We are called both for "beam" effects and "ball" effects.
365 * The "r" parameter is the "distance from ground zero".
367 * Note that we determine if the player can "see" anything that happens
368 * by taking into account: blindness, line-of-sight, and illumination.
370 * We return "TRUE" if the effect of the projection is "obvious".
372 * We also "see" grids which are "memorized", probably a hack
374 * Perhaps we should affect doors?
377 static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
379 cave_type *c_ptr = &cave[y][x];
380 feature_type *f_ptr = &f_info[c_ptr->feat];
382 bool obvious = FALSE;
383 bool known = player_has_los_bold(y, x);
388 /* Reduce damage by distance */
389 dam = (dam + r) / (r + 1);
392 if (have_flag(f_ptr->flags, FF_TREE))
400 message = _("枯れた", "was blasted."); break;
402 message = _("縮んだ", "shrank."); break;
404 message = _("溶けた", "melted."); break;
407 message = _("凍り、砕け散った", "was frozen and smashed."); break;
411 message = _("燃えた", "burns up!"); break;
423 message = _("粉砕された", "was crushed."); break;
425 message = NULL; break;
429 msg_format(_("木は%s。", "A tree %s"), message);
430 cave_set_feat(y, x, one_in_(3) ? feat_brake : feat_grass);
433 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
437 /* Analyze the type */
440 /* Ignore most effects */
475 /* Destroy Traps (and Locks) */
478 /* Reveal secret doors */
479 if (is_hidden_door(c_ptr))
484 /* Check line of sight */
492 if (is_trap(c_ptr->feat))
494 /* Check line of sight */
497 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
501 /* Destroy the trap */
502 cave_alter_feat(y, x, FF_DISARM);
505 /* Locked doors are unlocked */
506 if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
508 s16b old_feat = c_ptr->feat;
510 /* Unlock the door */
511 cave_alter_feat(y, x, FF_DISARM);
513 /* Check line of sound */
514 if (known && (old_feat != c_ptr->feat))
516 msg_print(_("カチッと音がした!", "Click!"));
521 /* Remove "unsafe" flag if player is not blind */
522 if (!p_ptr->blind && player_has_los_bold(y, x))
524 c_ptr->info &= ~(CAVE_UNSAFE);
532 /* Destroy Doors (and traps) */
535 /* Destroy all doors and traps */
536 if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
538 /* Check line of sight */
541 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
545 /* Destroy the feature */
546 cave_alter_feat(y, x, FF_TUNNEL);
549 /* Remove "unsafe" flag if player is not blind */
550 if (!p_ptr->blind && player_has_los_bold(y, x))
552 c_ptr->info &= ~(CAVE_UNSAFE);
560 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
562 if (have_flag(f_ptr->flags, FF_SPIKE))
564 s16b old_mimic = c_ptr->mimic;
565 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
567 cave_alter_feat(y, x, FF_SPIKE);
568 c_ptr->mimic = old_mimic;
573 /* Check line of sight */
574 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
576 msg_format(_("%sに何かがつっかえて開かなくなった。", "The %s seems stuck."), f_name + mimic_f_ptr->name);
583 /* Destroy walls (and doors) */
586 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
588 if (known && (c_ptr->info & (CAVE_MARK)))
590 msg_format(_("%sが溶けて泥になった!", "The %s turns into mud!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
594 /* Destroy the wall */
595 cave_alter_feat(y, x, FF_HURT_ROCK);
597 /* Update some things */
598 p_ptr->update |= (PU_FLOW);
607 /* Require a "naked" floor grid */
608 if (!cave_naked_bold(y, x)) break;
610 /* Not on the player */
611 if (player_bold(y, x)) break;
613 /* Create a closed door */
614 cave_set_feat(y, x, feat_door[DOOR_DOOR].closed);
617 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
634 /* Require a "naked" floor grid */
635 if (!cave_naked_bold(y, x)) break;
637 /* Not on the player */
638 if (player_bold(y, x)) break;
640 /* Create a closed door */
641 cave_set_feat(y, x, feat_tree);
644 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
652 /* Require a "naked" floor grid */
653 if (!cave_naked_bold(y, x)) break;
656 c_ptr->info |= CAVE_OBJECT;
657 c_ptr->mimic = feat_glyph;
668 /* Require a "naked" floor grid */
669 if (!cave_naked_bold(y, x)) break;
671 /* Not on the player */
672 if (player_bold(y, x)) break;
675 cave_set_feat(y, x, feat_granite);
683 /* Ignore permanent grid */
684 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
689 /* Ignore grid without enough space */
690 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
692 /* Place a shallow lava */
693 cave_set_feat(y, x, feat_shallow_lava);
698 /* Place a deep lava */
699 cave_set_feat(y, x, feat_deep_lava);
706 /* Ignore permanent grid */
707 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
712 /* Ignore grid without enough space */
713 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
715 /* Place a shallow water */
716 cave_set_feat(y, x, feat_shallow_water);
721 /* Place a deep water */
722 cave_set_feat(y, x, feat_deep_water);
727 /* Lite up the grid */
731 /* Turn on the light */
732 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
734 c_ptr->info |= (CAVE_GLOW);
737 update_local_illumination(y, x);
740 if (player_can_see_bold(y, x)) obvious = TRUE;
742 /* Mega-Hack -- Update the monster in the affected grid */
743 /* This allows "spear of light" (etc) to work "correctly" */
744 if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
746 if (p_ptr->special_defense & NINJA_S_STEALTH)
748 if (player_bold(y, x)) set_superstealth(FALSE);
755 /* Darken the grid */
759 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(c_ptr);
762 /* Turn off the light. */
765 if (dun_level || !is_daytime())
767 for (j = 0; j < 9; j++)
769 int by = y + ddy_ddd[j];
770 int bx = x + ddx_ddd[j];
772 if (in_bounds2(by, bx))
774 cave_type *cc_ptr = &cave[by][bx];
776 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
787 c_ptr->info &= ~(CAVE_GLOW);
789 /* Hack -- Forget "boring" grids */
790 if (!have_flag(f_ptr->flags, FF_REMEMBER))
793 c_ptr->info &= ~(CAVE_MARK);
800 update_local_illumination(y, x);
802 if (player_can_see_bold(y, x)) obvious = TRUE;
804 /* Mega-Hack -- Update the monster in the affected grid */
805 /* This allows "spear of light" (etc) to work "correctly" */
806 if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
816 if (is_mirror_grid(c_ptr))
818 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
821 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
824 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 50))
826 if (known && (c_ptr->info & CAVE_MARK))
828 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
832 /* Destroy the wall */
833 cave_alter_feat(y, x, FF_HURT_ROCK);
835 /* Update some things */
836 p_ptr->update |= (PU_FLOW);
843 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
845 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
848 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
851 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 200))
853 if (known && (c_ptr->info & CAVE_MARK))
855 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
859 /* Destroy the wall */
860 cave_alter_feat(y, x, FF_HURT_ROCK);
862 /* Update some things */
863 p_ptr->update |= (PU_FLOW);
868 case GF_DISINTEGRATE:
870 /* Destroy mirror/glyph */
871 if (is_mirror_grid(c_ptr) || is_glyph_grid(c_ptr) || is_explosive_rune_grid(c_ptr))
874 /* Permanent features don't get effect */
875 /* But not protect monsters and other objects */
876 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
878 cave_alter_feat(y, x, FF_HURT_DISI);
880 /* Update some things -- similar to GF_KILL_WALL */
881 p_ptr->update |= (PU_FLOW);
888 /* Return "Anything seen?" */
895 * @brief 汎用的なビーム/ボルト/ボール系によるアイテムオブジェクトへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
896 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
897 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
898 * @param y 目標Y座標 / Target y location (or location to travel "towards")
899 * @param x 目標X座標 / Target x location (or location to travel "towards")
900 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
901 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
902 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
905 * We are called from "project()" to "damage" objects
907 * We are called both for "beam" effects and "ball" effects.
909 * Perhaps we should only SOMETIMES damage things on the ground.
911 * The "r" parameter is the "distance from ground zero".
913 * Note that we determine if the player can "see" anything that happens
914 * by taking into account: blindness, line-of-sight, and illumination.
916 * We also "see" grids which are "memorized", probably a hack
918 * We return "TRUE" if the effect of the projection is "obvious".
921 static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
923 cave_type *c_ptr = &cave[y][x];
925 OBJECT_IDX this_o_idx, next_o_idx = 0;
927 bool obvious = FALSE;
928 bool known = player_has_los_bold(y, x);
930 BIT_FLAGS flgs[TR_FLAG_SIZE];
932 GAME_TEXT o_name[MAX_NLEN];
934 KIND_OBJECT_IDX k_idx = 0;
935 bool is_potion = FALSE;
940 /* Reduce damage by distance */
941 dam = (dam + r) / (r + 1);
944 /* Scan all objects in the grid */
945 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
947 object_type *o_ptr = &o_list[this_o_idx];
951 bool do_kill = FALSE;
953 concptr note_kill = NULL;
956 /* Get the "plural"-ness */
957 bool plural = (o_ptr->number > 1);
960 /* Acquire next object */
961 next_o_idx = o_ptr->next_o_idx;
962 object_flags(o_ptr, flgs);
964 /* Check for artifact */
965 if (object_is_artifact(o_ptr)) is_art = TRUE;
967 /* Analyze the type */
970 /* Acid -- Lots of things */
973 if (hates_acid(o_ptr))
976 note_kill = _("融けてしまった!", (plural ? " melt!" : " melts!"));
977 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
982 /* Elec -- Rings and Wands */
985 if (hates_elec(o_ptr))
988 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
989 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
994 /* Fire -- Flammable objects */
997 if (hates_fire(o_ptr))
1000 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1001 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1006 /* Cold -- potions and flasks */
1009 if (hates_cold(o_ptr))
1011 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1013 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1021 if (hates_fire(o_ptr))
1024 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1025 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1027 if (hates_elec(o_ptr))
1031 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1032 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1040 if (hates_fire(o_ptr))
1043 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1044 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1046 if (hates_cold(o_ptr))
1050 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1051 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1056 /* Hack -- break potions and such */
1062 if (hates_cold(o_ptr))
1064 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1070 /* Mana and Chaos -- destroy everything */
1076 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1080 case GF_DISINTEGRATE:
1083 note_kill = _("蒸発してしまった!", (plural ? " evaporate!" : " evaporates!"));
1090 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1091 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1092 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1096 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1100 if (object_is_cursed(o_ptr))
1103 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1110 identify_item(o_ptr);
1112 /* Auto-inscription */
1113 autopick_alter_item((-this_o_idx), FALSE);
1121 /* Chests are noticed only if trapped or locked */
1122 if (o_ptr->tval == TV_CHEST)
1124 /* Disarm/Unlock traps */
1125 if (o_ptr->pval > 0)
1127 /* Disarm or Unlock */
1128 o_ptr->pval = (0 - o_ptr->pval);
1131 object_known(o_ptr);
1133 if (known && (o_ptr->marked & OM_FOUND))
1135 msg_print(_("カチッと音がした!", "Click!"));
1145 if (o_ptr->tval == TV_CORPSE)
1148 BIT_FLAGS mode = 0L;
1150 if (!who || is_pet(&m_list[who]))
1151 mode |= PM_FORCE_PET;
1153 for (i = 0; i < o_ptr->number ; i++)
1155 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1156 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1160 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
1164 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1166 note_kill = _("生き返った。", " revived.");
1168 else if (!note_kill)
1170 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
1181 /* Attempt to destroy the object */
1184 /* Effect "observed" */
1185 if (known && (o_ptr->marked & OM_FOUND))
1188 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1191 /* Artifacts, and other objects, get to resist */
1192 if (is_art || ignore)
1194 /* Observe the resist */
1195 if (known && (o_ptr->marked & OM_FOUND))
1197 msg_format(_("%sは影響を受けない!",
1198 (plural ? "The %s are unaffected!" : "The %s is unaffected!")), o_name);
1205 /* Describe if needed */
1206 if (known && (o_ptr->marked & OM_FOUND) && note_kill)
1208 msg_format(_("%sは%s", "The %s%s"), o_name, note_kill);
1211 k_idx = o_ptr->k_idx;
1212 is_potion = object_is_potion(o_ptr);
1213 delete_object_idx(this_o_idx);
1215 /* Potions produce effects when 'shattered' */
1218 (void)potion_smash_effect(who, y, x, k_idx);
1226 /* Return "Anything seen?" */
1232 * @brief 汎用的なビーム/ボルト/ボール系によるモンスターへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
1233 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
1234 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
1235 * @param y 目標Y座標 / Target y location (or location to travel "towards")
1236 * @param x 目標X座標 / Target x location (or location to travel "towards")
1237 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
1238 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
1240 * @param see_s_msg TRUEならばメッセージを表示する
1241 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
1244 * This routine takes a "source monster" (by index) which is mostly used to
1245 * determine if the player is causing the damage, and a "radius" (see below),
1246 * which is used to decrease the power of explosions with distance, and a
1247 * location, via integers which are modified by certain types of attacks
1248 * (polymorph and teleport being the obvious ones), a default damage, which
1249 * is modified as needed based on various properties, and finally a "damage
1250 * type" (see below).
1253 * Note that this routine can handle "no damage" attacks (like teleport) by
1254 * taking a "zero" damage, and can even take "parameters" to attacks (like
1255 * confuse) by accepting a "damage", using it to calculate the effect, and
1256 * then setting the damage to zero. Note that the "damage" parameter is
1257 * divided by the radius, so monsters not at the "epicenter" will not take
1258 * as much damage (or whatever)...
1261 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1262 * may result in a dereference of an invalid pointer.
1265 * Various messages are produced, and damage is applied.
1268 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1269 * actually be "made" of that substance, or "breathe" big balls of it.
1270 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1272 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1273 * and hurts evil less. If can breath nether, then it resists it as well.
1276 * Damage reductions use the following formulas:
1277 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1278 * gives avg damage of .655, ranging from .858 to .500
1279 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1280 * gives avg damage of .544, ranging from .714 to .417
1281 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1282 * gives avg damage of .444, ranging from .556 to .333
1283 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1284 * gives avg damage of .327, ranging from .427 to .250
1285 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1286 * gives something simple.
1289 * In this function, "result" messages are postponed until the end, where
1290 * the "note" string is appended to the monster name, if not NULL. So,
1291 * to make a spell have "no effect" just set "note" to NULL. You should
1292 * also set "notice" to FALSE, or the player will learn what the spell does.
1295 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1299 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)
1303 cave_type *c_ptr = &cave[y][x];
1305 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1306 monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
1308 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1312 /* Is the monster "seen"? */
1313 bool seen = m_ptr->ml;
1314 bool seen_msg = is_seen(m_ptr);
1316 bool slept = (bool)MON_CSLEEP(m_ptr);
1318 /* Were the effects "obvious" (if seen)? */
1319 bool obvious = FALSE;
1321 /* Can the player know about this effect? */
1322 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1324 /* Were the effects "irrelevant"? */
1325 bool skipped = FALSE;
1327 /* Gets the monster angry at the source of the effect? */
1328 bool get_angry = FALSE;
1330 /* Polymorph setting (true or false) */
1331 bool do_poly = FALSE;
1333 /* Teleport setting (max distance) */
1336 /* Confusion setting (amount to confuse) */
1339 /* Stunning setting (amount to stun) */
1342 /* Sleep amount (amount to sleep) */
1345 /* Fear amount (amount to fear) */
1348 /* Time amount (amount to time) */
1351 bool heal_leper = FALSE;
1353 /* Hold the monster name */
1354 GAME_TEXT m_name[MAX_NLEN];
1357 PARAMETER_VALUE photo = 0;
1359 /* Assume no note */
1360 concptr note = NULL;
1362 /* Assume a default death */
1363 concptr note_dies = extract_note_dies(real_r_idx(m_ptr));
1365 POSITION ty = m_ptr->fy;
1366 POSITION tx = m_ptr->fx;
1368 DEPTH caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1371 if (!c_ptr->m_idx) return (FALSE);
1373 /* Never affect projector */
1374 if (who && (c_ptr->m_idx == who)) return (FALSE);
1375 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1376 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1378 /* Don't affect already death monsters */
1379 /* Prevents problems with chain reactions of exploding monsters */
1380 if (m_ptr->hp < 0) return (FALSE);
1382 /* Reduce damage by distance */
1383 dam = (dam + r) / (r + 1);
1386 /* Get the monster name (BEFORE polymorphing) */
1387 monster_desc(m_name, m_ptr, 0);
1389 /* Get the monster possessive ("his"/"her"/"its") */
1390 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1392 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
1394 /* Analyze the damage type */
1397 /* Magic Missile -- pure damage */
1400 if (seen) obvious = TRUE;
1402 if (r_ptr->flagsr & RFR_RES_ALL)
1404 note = _("には完全な耐性がある!", " is immune.");
1406 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1415 if (seen) obvious = TRUE;
1417 if (r_ptr->flagsr & RFR_RES_ALL)
1419 note = _("には完全な耐性がある!", " is immune.");
1421 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1424 if (r_ptr->flagsr & RFR_IM_ACID)
1426 note = _("にはかなり耐性がある!", " resists a lot.");
1428 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1436 if (seen) obvious = TRUE;
1438 if (r_ptr->flagsr & RFR_RES_ALL)
1440 note = _("には完全な耐性がある!", " is immune.");
1442 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1445 if (r_ptr->flagsr & RFR_IM_ELEC)
1447 note = _("にはかなり耐性がある!", " resists a lot.");
1449 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1457 if (seen) obvious = TRUE;
1459 if (r_ptr->flagsr & RFR_RES_ALL)
1461 note = _("には完全な耐性がある!", " is immune.");
1463 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1466 if (r_ptr->flagsr & RFR_IM_FIRE)
1468 note = _("にはかなり耐性がある!", " resists a lot.");
1470 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1472 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1474 note = _("はひどい痛手をうけた。", " is hit hard.");
1476 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1484 if (seen) obvious = TRUE;
1486 if (r_ptr->flagsr & RFR_RES_ALL)
1488 note = _("には完全な耐性がある!", " is immune.");
1490 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1493 if (r_ptr->flagsr & RFR_IM_COLD)
1495 note = _("にはかなり耐性がある!", " resists a lot.");
1497 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1499 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1501 note = _("はひどい痛手をうけた。", " is hit hard.");
1503 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1511 if (seen) obvious = TRUE;
1513 if (r_ptr->flagsr & RFR_RES_ALL)
1515 note = _("には完全な耐性がある!", " is immune.");
1517 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1520 if (r_ptr->flagsr & RFR_IM_POIS)
1522 note = _("にはかなり耐性がある!", " resists a lot.");
1524 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1532 if (seen) obvious = TRUE;
1534 if (r_ptr->flagsr & RFR_RES_ALL)
1536 note = _("には完全な耐性がある!", " is immune.");
1538 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1541 if (r_ptr->flagsr & RFR_IM_POIS)
1543 note = _("には耐性がある。", " resists.");
1544 dam *= 3; dam /= randint1(6) + 6;
1545 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1547 else if (one_in_(3)) do_poly = TRUE;
1551 /* Hellfire -- hurts Evil */
1554 if (seen) obvious = TRUE;
1556 if (r_ptr->flagsr & RFR_RES_ALL)
1558 note = _("には完全な耐性がある!", " is immune.");
1560 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1563 if (r_ptr->flags3 & RF3_GOOD)
1565 note = _("はひどい痛手をうけた。", " is hit hard.");
1567 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1572 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1575 if (seen) obvious = TRUE;
1577 if (r_ptr->flagsr & RFR_RES_ALL)
1579 note = _("には完全な耐性がある!", " is immune.");
1581 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1584 if (r_ptr->flags3 & RF3_GOOD)
1586 note = _("には完全な耐性がある!", " is immune.");
1588 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
1590 else if (r_ptr->flags3 & RF3_EVIL)
1593 note = _("はひどい痛手をうけた。", " is hit hard.");
1594 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
1598 note = _("には耐性がある。", " resists.");
1599 dam *= 3; dam /= randint1(6) + 6;
1604 /* Arrow -- XXX no defense */
1607 if (seen) obvious = TRUE;
1609 if (r_ptr->flagsr & RFR_RES_ALL)
1611 note = _("には完全な耐性がある!", " is immune.");
1613 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1619 /* Plasma -- XXX perhaps check ELEC or FIRE */
1622 if (seen) obvious = TRUE;
1624 if (r_ptr->flagsr & RFR_RES_ALL)
1626 note = _("には完全な耐性がある!", " is immune.");
1628 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1631 if (r_ptr->flagsr & RFR_RES_PLAS)
1633 note = _("には耐性がある。", " resists.");
1634 dam *= 3; dam /= randint1(6) + 6;
1635 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
1640 /* Nether -- see above */
1643 if (seen) obvious = TRUE;
1645 if (r_ptr->flagsr & RFR_RES_ALL)
1647 note = _("には完全な耐性がある!", " is immune.");
1649 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1652 if (r_ptr->flagsr & RFR_RES_NETH)
1654 if (r_ptr->flags3 & RF3_UNDEAD)
1656 note = _("には完全な耐性がある!", " is immune.");
1658 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
1662 note = _("には耐性がある。", " resists.");
1663 dam *= 3; dam /= randint1(6) + 6;
1665 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
1667 else if (r_ptr->flags3 & RF3_EVIL)
1669 note = _("はいくらか耐性を示した。", " resists somewhat.");
1671 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
1676 /* Water (acid) damage -- Water spirits/elementals are immune */
1679 if (seen) obvious = TRUE;
1681 if (r_ptr->flagsr & RFR_RES_ALL)
1683 note = _("には完全な耐性がある!", " is immune.");
1685 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1688 if (r_ptr->flagsr & RFR_RES_WATE)
1690 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
1692 note = _("には完全な耐性がある!", " is immune.");
1697 note = _("には耐性がある。", " resists.");
1698 dam *= 3; dam /= randint1(6) + 6;
1700 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
1705 /* Chaos -- Chaos breathers resist */
1708 if (seen) obvious = TRUE;
1710 if (r_ptr->flagsr & RFR_RES_ALL)
1712 note = _("には完全な耐性がある!", " is immune.");
1714 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1717 if (r_ptr->flagsr & RFR_RES_CHAO)
1719 note = _("には耐性がある。", " resists.");
1720 dam *= 3; dam /= randint1(6) + 6;
1721 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
1723 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
1725 note = _("はいくらか耐性を示した。", " resists somewhat.");
1726 dam *= 3; dam /= randint1(6) + 6;
1727 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
1732 do_conf = (5 + randint1(11) + r) / (r + 1);
1737 /* Shards -- Shard breathers resist */
1740 if (seen) obvious = TRUE;
1742 if (r_ptr->flagsr & RFR_RES_ALL)
1744 note = _("には完全な耐性がある!", " is immune.");
1746 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1749 if (r_ptr->flagsr & RFR_RES_SHAR)
1751 note = _("には耐性がある。", " resists.");
1752 dam *= 3; dam /= randint1(6) + 6;
1753 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1758 /* Rocket: Shard resistance helps */
1761 if (seen) obvious = TRUE;
1763 if (r_ptr->flagsr & RFR_RES_ALL)
1765 note = _("には完全な耐性がある!", " is immune.");
1767 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1770 if (r_ptr->flagsr & RFR_RES_SHAR)
1772 note = _("はいくらか耐性を示した。", " resists somewhat.");
1774 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1780 /* Sound -- Sound breathers resist */
1783 if (seen) obvious = TRUE;
1785 if (r_ptr->flagsr & RFR_RES_ALL)
1787 note = _("には完全な耐性がある!", " is immune.");
1789 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1792 if (r_ptr->flagsr & RFR_RES_SOUN)
1794 note = _("には耐性がある。", " resists.");
1795 dam *= 2; dam /= randint1(6) + 6;
1796 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
1798 else do_stun = (10 + randint1(15) + r) / (r + 1);
1805 if (seen) obvious = TRUE;
1807 if (r_ptr->flagsr & RFR_RES_ALL)
1809 note = _("には完全な耐性がある!", " is immune.");
1811 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1814 if (r_ptr->flags3 & RF3_NO_CONF)
1816 note = _("には耐性がある。", " resists.");
1817 dam *= 3; dam /= randint1(6) + 6;
1818 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1820 else do_conf = (10 + randint1(15) + r) / (r + 1);
1824 /* Disenchantment -- Breathers and Disenchanters resist */
1827 if (seen) obvious = TRUE;
1829 if (r_ptr->flagsr & RFR_RES_ALL)
1831 note = _("には完全な耐性がある!", " is immune.");
1833 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1836 if (r_ptr->flagsr & RFR_RES_DISE)
1838 note = _("には耐性がある。", " resists.");
1839 dam *= 3; dam /= randint1(6) + 6;
1840 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
1845 /* Nexus -- Breathers and Existers resist */
1848 if (seen) obvious = TRUE;
1850 if (r_ptr->flagsr & RFR_RES_ALL)
1852 note = _("には完全な耐性がある!", " is immune.");
1854 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1857 if (r_ptr->flagsr & RFR_RES_NEXU)
1859 note = _("には耐性がある。", " resists.");
1860 dam *= 3; dam /= randint1(6) + 6;
1861 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
1869 if (seen) obvious = TRUE;
1871 if (r_ptr->flagsr & RFR_RES_ALL)
1873 note = _("には完全な耐性がある!", " is immune.");
1875 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1878 if (r_ptr->flagsr & RFR_RES_WALL)
1880 note = _("には耐性がある。", " resists.");
1881 dam *= 3; dam /= randint1(6) + 6;
1882 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
1884 else do_stun = (randint1(15) + r) / (r + 1);
1888 /* Inertia -- breathers resist */
1891 if (seen) obvious = TRUE;
1893 if (r_ptr->flagsr & RFR_RES_ALL)
1895 note = _("には完全な耐性がある!", " is immune.");
1897 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1900 if (r_ptr->flagsr & RFR_RES_INER)
1902 note = _("には耐性がある。", " resists.");
1903 dam *= 3; dam /= randint1(6) + 6;
1904 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
1908 /* Powerful monsters can resist */
1909 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1910 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1914 /* Normal monsters slow down */
1917 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1919 note = _("の動きが遅くなった。", " starts moving slower.");
1926 /* Time -- breathers resist */
1929 if (seen) obvious = TRUE;
1931 if (r_ptr->flagsr & RFR_RES_ALL)
1933 note = _("には完全な耐性がある!", " is immune.");
1935 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1938 if (r_ptr->flagsr & RFR_RES_TIME)
1940 note = _("には耐性がある。", " resists.");
1941 dam *= 3; dam /= randint1(6) + 6;
1942 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
1944 else do_time = (dam + 1) / 2;
1948 /* Gravity -- breathers resist */
1951 bool resist_tele = FALSE;
1953 if (seen) obvious = TRUE;
1955 if (r_ptr->flagsr & RFR_RES_ALL)
1957 note = _("には完全な耐性がある!", " is immune.");
1959 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1962 if (r_ptr->flagsr & RFR_RES_TELE)
1964 if (r_ptr->flags1 & (RF1_UNIQUE))
1966 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1967 note = _("には効果がなかった。", " is unaffected!");
1970 else if (r_ptr->level > randint1(100))
1972 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1973 note = _("には耐性がある!", " resists!");
1978 if (!resist_tele) do_dist = 10;
1980 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1982 if (r_ptr->flagsr & RFR_RES_GRAV)
1984 note = _("には耐性がある!", " resists!");
1985 dam *= 3; dam /= randint1(6) + 6;
1987 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
1992 /* Powerful monsters can resist */
1993 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1994 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1998 /* Normal monsters slow down */
2001 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2003 note = _("の動きが遅くなった。", " starts moving slower.");
2008 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2010 /* Attempt a saving throw */
2011 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2012 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2016 /* No obvious effect */
2017 note = _("には効果がなかった。", " is unaffected!");
2029 if (seen) obvious = TRUE;
2031 if (r_ptr->flagsr & RFR_RES_ALL)
2033 note = _("には完全な耐性がある!", " is immune.");
2035 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2043 case GF_DISINTEGRATE:
2045 if (seen) obvious = TRUE;
2047 if (r_ptr->flagsr & RFR_RES_ALL)
2049 note = _("には完全な耐性がある!", " is immune.");
2051 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2054 if (r_ptr->flags3 & RF3_HURT_ROCK)
2056 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2057 note = _("の皮膚がただれた!", " loses some skin!");
2058 note_dies = _("は蒸発した!", " evaporates!");
2066 if (seen) obvious = TRUE;
2068 /* PSI only works if the monster can see you! -- RG */
2069 if (!(los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)))
2072 msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), m_name);
2077 if (r_ptr->flagsr & RFR_RES_ALL)
2079 note = _("には完全な耐性がある!", " is immune.");
2081 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2084 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2087 note = _("には完全な耐性がある!", " is immune.");
2088 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2091 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2092 (r_ptr->flags3 & RF3_ANIMAL) ||
2093 (r_ptr->level > randint1(3 * dam)))
2095 note = _("には耐性がある!", " resists!");
2099 * Powerful demons & undead can turn a mindcrafter's
2100 * attacks back on them
2102 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2103 (r_ptr->level > p_ptr->lev / 2) &&
2107 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2108 (seen ? "%^s's corrupted mind backlashes your attack!" :
2109 "%^ss corrupted mind backlashes your attack!")), m_name);
2112 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
2114 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
2118 /* Injure +/- confusion */
2119 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2120 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2121 if (one_in_(4) && !CHECK_MULTISHADOW())
2123 switch (randint1(4))
2126 set_confused(p_ptr->confused + 3 + randint1(dam));
2129 set_stun(p_ptr->stun + randint1(dam));
2133 if (r_ptr->flags3 & RF3_NO_FEAR)
2134 note = _("には効果がなかった。", " is unaffected.");
2136 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2140 if (!p_ptr->free_act)
2141 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2150 if ((dam > 0) && one_in_(4))
2152 switch (randint1(4))
2155 do_conf = 3 + randint1(dam);
2158 do_stun = 3 + randint1(dam);
2161 do_fear = 3 + randint1(dam);
2164 note = _("は眠り込んでしまった!", " falls asleep!");
2165 do_sleep = 3 + randint1(dam);
2170 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
2176 if (seen) obvious = TRUE;
2178 if (r_ptr->flagsr & RFR_RES_ALL)
2180 note = _("には完全な耐性がある!", " is immune.");
2182 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2185 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2188 note = _("には完全な耐性がある!", " is immune.");
2190 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2191 (r_ptr->flags3 & RF3_ANIMAL) ||
2192 (r_ptr->level > randint1(3 * dam)))
2194 note = _("には耐性がある!", " resists!");
2198 * Powerful demons & undead can turn a mindcrafter's
2199 * attacks back on them
2201 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2202 (r_ptr->level > p_ptr->lev / 2) &&
2206 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2207 (seen ? "%^s's corrupted mind backlashes your attack!" :
2208 "%^ss corrupted mind backlashes your attack!")), m_name);
2210 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
2212 msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
2216 /* Injure + mana drain */
2217 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2218 if (!CHECK_MULTISHADOW())
2220 msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
2221 p_ptr->csp -= damroll(5, dam) / 2;
2222 if (p_ptr->csp < 0) p_ptr->csp = 0;
2223 p_ptr->redraw |= PR_MANA;
2224 p_ptr->window |= (PW_SPELL);
2226 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2233 int b = damroll(5, dam) / 4;
2234 concptr str = (p_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
2235 concptr msg = _("あなたは%sの苦痛を%sに変換した!",
2236 (seen ? "You convert %s's pain into %s!" :
2237 "You convert %ss pain into %s!"));
2238 msg_format(msg, m_name, str);
2240 b = MIN(p_ptr->msp, p_ptr->csp + b);
2242 p_ptr->redraw |= PR_MANA;
2243 p_ptr->window |= (PW_SPELL);
2245 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
2249 case GF_TELEKINESIS:
2251 if (seen) obvious = TRUE;
2253 if (r_ptr->flagsr & RFR_RES_ALL)
2255 note = _("には完全な耐性がある!", " is immune.");
2257 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2262 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2267 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2269 /* Attempt a saving throw */
2270 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2271 (r_ptr->level > 5 + randint1(dam)))
2275 /* No obvious effect */
2281 /* Psycho-spear -- powerful magic missile */
2284 if (seen) obvious = TRUE;
2286 if (r_ptr->flagsr & RFR_RES_ALL)
2288 note = _("には完全な耐性がある!", " is immune.");
2290 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2296 /* Meteor -- powerful magic missile */
2299 if (seen) obvious = TRUE;
2301 if (r_ptr->flagsr & RFR_RES_ALL)
2303 note = _("には完全な耐性がある!", " is immune.");
2305 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2313 if (!is_hostile(m_ptr)) break;
2315 if (seen) obvious = TRUE;
2317 if (r_ptr->flagsr & RFR_RES_ALL)
2319 note = _("には効果がなかった!", " is immune.");
2321 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2324 /* Attempt a saving throw */
2325 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
2326 (r_ptr->flags3 & RF3_NO_CONF) ||
2327 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2329 /* Memorize a flag */
2330 if (r_ptr->flags3 & RF3_NO_CONF)
2332 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2339 * Powerful demons & undead can turn a mindcrafter's
2340 * attacks back on them
2342 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2343 (r_ptr->level > p_ptr->lev / 2) &&
2347 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2348 (seen ? "%^s's corrupted mind backlashes your attack!" :
2349 "%^ss corrupted mind backlashes your attack!")), m_name);
2352 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2354 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
2358 /* Confuse, stun, terrify */
2359 switch (randint1(4))
2362 set_stun(p_ptr->stun + dam / 2);
2365 set_confused(p_ptr->confused + dam / 2);
2369 if (r_ptr->flags3 & RF3_NO_FEAR)
2370 note = _("には効果がなかった。", " is unaffected.");
2372 set_afraid(p_ptr->afraid + dam);
2379 /* No obvious effect */
2380 note = _("には効果がなかった。", " is unaffected.");
2386 if (!common_saving_throw_charm(p_ptr, dam, m_ptr))
2388 note = _("があなたに隷属した。", " is in your thrall!");
2393 switch (randint1(4))
2407 /* No "real" damage */
2414 /* Ice -- Cold + Cuts + Stun */
2417 if (seen) obvious = TRUE;
2419 if (r_ptr->flagsr & RFR_RES_ALL)
2421 note = _("には完全な耐性がある!", " is immune.");
2423 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2426 do_stun = (randint1(15) + 1) / (r + 1);
2427 if (r_ptr->flagsr & RFR_IM_COLD)
2429 note = _("にはかなり耐性がある!", " resists a lot.");
2431 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
2433 else if (r_ptr->flags3 & (RF3_HURT_COLD))
2435 note = _("はひどい痛手をうけた。", " is hit hard.");
2437 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
2444 case GF_HYPODYNAMIA:
2446 if (seen) obvious = TRUE;
2448 if (r_ptr->flagsr & RFR_RES_ALL)
2450 note = _("には完全な耐性がある!", " is immune.");
2452 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2455 if (!monster_living(m_ptr->r_idx))
2457 if (is_original_ap_and_seen(m_ptr))
2459 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2460 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2461 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2463 note = _("には効果がなかった。", " is unaffected.");
2467 else do_time = (dam+7)/8;
2475 if (seen) obvious = TRUE;
2477 if (r_ptr->flagsr & RFR_RES_ALL)
2479 note = _("には完全な耐性がある!", " is immune.");
2481 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2484 if (!monster_living(m_ptr->r_idx))
2486 if (is_original_ap_and_seen(m_ptr))
2488 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2489 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2490 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2492 note = _("には完全な耐性がある!", " is immune.");
2496 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
2497 (randint1(888) != 666)) ||
2498 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
2499 randint1(100) != 66))
2501 note = _("には耐性がある!", " resists!");
2509 /* Polymorph monster (Use "dam" as "power") */
2512 if (seen) obvious = TRUE;
2514 if (r_ptr->flagsr & RFR_RES_ALL)
2516 note = _("には効果がなかった。", " is unaffected.");
2518 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2521 /* Attempt to polymorph (see below) */
2524 /* Powerful monsters can resist */
2525 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2526 (r_ptr->flags1 & RF1_QUESTOR) ||
2527 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2529 note = _("には効果がなかった。", " is unaffected.");
2534 /* No "real" damage */
2541 /* Clone monsters (Ignore "dam") */
2544 if (seen) obvious = TRUE;
2546 if ((p_ptr->inside_arena) || is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
2548 note = _("には効果がなかった。", " is unaffected.");
2553 m_ptr->hp = m_ptr->maxhp;
2555 /* Attempt to clone. */
2556 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
2558 note = _("が分裂した!", " spawns!");
2562 /* No "real" damage */
2569 /* Heal Monster (use "dam" as amount of healing) */
2572 if (seen) obvious = TRUE;
2575 (void)set_monster_csleep(c_ptr->m_idx, 0);
2577 if (m_ptr->maxhp < m_ptr->max_maxhp)
2579 if (seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), m_name, m_poss);
2580 m_ptr->maxhp = m_ptr->max_maxhp;
2585 /* Redraw (later) if needed */
2586 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2587 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2595 if (seen) obvious = TRUE;
2598 (void)set_monster_csleep(c_ptr->m_idx, 0);
2599 if (MON_STUNNED(m_ptr))
2601 if (seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), m_name);
2602 (void)set_monster_stunned(c_ptr->m_idx, 0);
2604 if (MON_CONFUSED(m_ptr))
2606 if (seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), m_name);
2607 (void)set_monster_confused(c_ptr->m_idx, 0);
2609 if (MON_MONFEAR(m_ptr))
2611 if (seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name);
2612 (void)set_monster_monfear(c_ptr->m_idx, 0);
2616 if (m_ptr->hp < 30000) m_ptr->hp += dam;
2619 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2623 chg_virtue(V_VITALITY, 1);
2625 if (r_ptr->flags1 & RF1_UNIQUE)
2626 chg_virtue(V_INDIVIDUALISM, 1);
2628 if (is_friendly(m_ptr))
2629 chg_virtue(V_HONOUR, 1);
2630 else if (!(r_ptr->flags3 & RF3_EVIL))
2632 if (r_ptr->flags3 & RF3_GOOD)
2633 chg_virtue(V_COMPASSION, 2);
2635 chg_virtue(V_COMPASSION, 1);
2638 if (r_ptr->flags3 & RF3_ANIMAL)
2639 chg_virtue(V_NATURE, 1);
2642 if (m_ptr->r_idx == MON_LEPER)
2645 if (!who) chg_virtue(V_COMPASSION, 5);
2648 /* Redraw (later) if needed */
2649 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2650 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2652 note = _("は体力を回復したようだ。", " looks healthier.");
2654 /* No "real" damage */
2660 /* Speed Monster (Ignore "dam") */
2663 if (seen) obvious = TRUE;
2666 if (set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100))
2668 note = _("の動きが速くなった。", " starts moving faster.");
2673 if (r_ptr->flags1 & RF1_UNIQUE)
2674 chg_virtue(V_INDIVIDUALISM, 1);
2675 if (is_friendly(m_ptr))
2676 chg_virtue(V_HONOUR, 1);
2679 /* No "real" damage */
2685 /* Slow Monster (Use "dam" as "power") */
2688 if (seen) obvious = TRUE;
2690 if (r_ptr->flagsr & RFR_RES_ALL)
2692 note = _("には効果がなかった。", " is unaffected.");
2694 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2697 /* Powerful monsters can resist */
2698 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2699 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2701 note = _("には効果がなかった。", " is unaffected.");
2705 /* Normal monsters slow down */
2708 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2710 note = _("の動きが遅くなった。", " starts moving slower.");
2714 /* No "real" damage */
2720 /* Sleep (Use "dam" as "power") */
2723 if (seen) obvious = TRUE;
2725 if (r_ptr->flagsr & RFR_RES_ALL)
2727 note = _("には効果がなかった。", " is unaffected.");
2729 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2732 /* Attempt a saving throw */
2733 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2734 (r_ptr->flags3 & RF3_NO_SLEEP) ||
2735 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2737 /* Memorize a flag */
2738 if (r_ptr->flags3 & RF3_NO_SLEEP)
2740 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
2742 /* No obvious effect */
2743 note = _("には効果がなかった。", " is unaffected.");
2748 /* Go to sleep (much) later */
2749 note = _("は眠り込んでしまった!", " falls asleep!");
2753 /* No "real" damage */
2759 /* Sleep (Use "dam" as "power") */
2760 case GF_STASIS_EVIL:
2762 if (seen) obvious = TRUE;
2764 if (r_ptr->flagsr & RFR_RES_ALL)
2766 note = _("には効果がなかった!", " is immune.");
2768 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2771 /* Attempt a saving throw */
2772 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2773 !(r_ptr->flags3 & RF3_EVIL) ||
2774 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2776 note = _("には効果がなかった。", " is unaffected.");
2781 /* Go to sleep (much) later */
2782 note = _("は動けなくなった!", " is suspended!");
2786 /* No "real" damage */
2791 /* Sleep (Use "dam" as "power") */
2794 if (seen) obvious = TRUE;
2796 if (r_ptr->flagsr & RFR_RES_ALL)
2798 note = _("には効果がなかった。", " is unaffected.");
2800 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2803 /* Attempt a saving throw */
2804 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2805 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2807 note = _("には効果がなかった。", " is unaffected.");
2812 /* Go to sleep (much) later */
2813 note = _("は動けなくなった!", " is suspended!");
2817 /* No "real" damage */
2826 vir = virtue_number(V_HARMONY);
2829 dam += p_ptr->virtues[vir-1]/10;
2832 vir = virtue_number(V_INDIVIDUALISM);
2835 dam -= p_ptr->virtues[vir-1]/20;
2838 if (seen) obvious = TRUE;
2840 /* Attempt a saving throw */
2841 if (common_saving_throw_charm(p_ptr, dam, m_ptr))
2845 /* No obvious effect */
2846 note = _("には効果がなかった。", " is unaffected.");
2849 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2851 else if (p_ptr->cursed & TRC_AGGRAVATE)
2853 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2854 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2858 note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
2861 chg_virtue(V_INDIVIDUALISM, -1);
2862 if (r_ptr->flags3 & RF3_ANIMAL)
2863 chg_virtue(V_NATURE, 1);
2866 /* No "real" damage */
2871 /* Control undead */
2872 case GF_CONTROL_UNDEAD:
2875 if (seen) obvious = TRUE;
2877 vir = virtue_number(V_UNLIFE);
2880 dam += p_ptr->virtues[vir-1]/10;
2883 vir = virtue_number(V_INDIVIDUALISM);
2886 dam -= p_ptr->virtues[vir-1]/20;
2889 /* Attempt a saving throw */
2890 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2891 !(r_ptr->flags3 & RF3_UNDEAD))
2893 /* No obvious effect */
2894 note = _("には効果がなかった。", " is unaffected.");
2896 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2898 else if (p_ptr->cursed & TRC_AGGRAVATE)
2900 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2901 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2905 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2909 /* No "real" damage */
2915 case GF_CONTROL_DEMON:
2918 if (seen) obvious = TRUE;
2920 vir = virtue_number(V_UNLIFE);
2923 dam += p_ptr->virtues[vir-1]/10;
2926 vir = virtue_number(V_INDIVIDUALISM);
2929 dam -= p_ptr->virtues[vir-1]/20;
2932 /* Attempt a saving throw */
2933 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2934 !(r_ptr->flags3 & RF3_DEMON))
2936 /* No obvious effect */
2937 note = _("には効果がなかった。", " is unaffected.");
2939 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2941 else if (p_ptr->cursed & TRC_AGGRAVATE)
2943 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2944 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2948 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2952 /* No "real" damage */
2958 case GF_CONTROL_ANIMAL:
2961 if (seen) obvious = TRUE;
2963 vir = virtue_number(V_NATURE);
2966 dam += p_ptr->virtues[vir-1]/10;
2969 vir = virtue_number(V_INDIVIDUALISM);
2972 dam -= p_ptr->virtues[vir-1]/20;
2975 /* Attempt a saving throw */
2976 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2977 !(r_ptr->flags3 & RF3_ANIMAL))
2980 /* No obvious effect */
2981 note = _("には効果がなかった。", " is unaffected.");
2983 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2985 else if (p_ptr->cursed & TRC_AGGRAVATE)
2987 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2988 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2992 note = _("はなついた。", " is tamed!");
2994 if (r_ptr->flags3 & RF3_ANIMAL)
2995 chg_virtue(V_NATURE, 1);
2998 /* No "real" damage */
3004 case GF_CHARM_LIVING:
3008 vir = virtue_number(V_UNLIFE);
3009 if (seen) obvious = TRUE;
3011 vir = virtue_number(V_UNLIFE);
3014 dam -= p_ptr->virtues[vir-1]/10;
3017 vir = virtue_number(V_INDIVIDUALISM);
3020 dam -= p_ptr->virtues[vir-1]/20;
3023 msg_format(_("%sを見つめた。", "You stare into %s."), m_name);
3025 /* Attempt a saving throw */
3026 if (common_saving_throw_charm(p_ptr, dam, m_ptr) ||
3027 !monster_living(m_ptr->r_idx))
3030 /* No obvious effect */
3031 note = _("には効果がなかった。", " is unaffected.");
3033 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3035 else if (p_ptr->cursed & TRC_AGGRAVATE)
3037 note = _("はあなたに敵意を抱いている!", " hates you too much!");
3038 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3042 note = _("を支配した。", " is tamed!");
3044 if (r_ptr->flags3 & RF3_ANIMAL)
3045 chg_virtue(V_NATURE, 1);
3048 /* No "real" damage */
3053 /* Confusion (Use "dam" as "power") */
3056 if (seen) obvious = TRUE;
3058 if (r_ptr->flagsr & RFR_RES_ALL)
3060 note = _("には効果がなかった。", " is unaffected.");
3062 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3065 /* Get confused later */
3066 do_conf = damroll(3, (dam / 2)) + 1;
3068 /* Attempt a saving throw */
3069 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3070 (r_ptr->flags3 & (RF3_NO_CONF)) ||
3071 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3073 /* Memorize a flag */
3074 if (r_ptr->flags3 & (RF3_NO_CONF))
3076 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3082 /* No obvious effect */
3083 note = _("には効果がなかった。", " is unaffected.");
3087 /* No "real" damage */
3094 if (seen) obvious = TRUE;
3096 if (r_ptr->flagsr & RFR_RES_ALL)
3098 note = _("には効果がなかった。", " is unaffected.");
3100 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3103 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
3105 /* Attempt a saving throw */
3106 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3107 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3112 /* No obvious effect */
3113 note = _("には効果がなかった。", " is unaffected.");
3117 /* No "real" damage */
3125 /* Lite, but only hurts susceptible creatures */
3133 if (r_ptr->flagsr & RFR_RES_ALL)
3139 if (r_ptr->flags3 & (RF3_HURT_LITE))
3141 /* Obvious effect */
3142 if (seen) obvious = TRUE;
3144 /* Memorize the effects */
3145 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3147 /* Special effect */
3148 note = _("は光に身をすくめた!", " cringes from the light!");
3149 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3152 /* Normally no damage */
3164 /* Lite -- opposite of Dark */
3167 if (seen) obvious = TRUE;
3169 if (r_ptr->flagsr & RFR_RES_ALL)
3171 note = _("には完全な耐性がある!", " is immune.");
3173 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3176 if (r_ptr->flagsr & RFR_RES_LITE)
3178 note = _("には耐性がある!", " resists!");
3179 dam *= 2; dam /= (randint1(6)+6);
3180 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
3182 else if (r_ptr->flags3 & (RF3_HURT_LITE))
3184 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3185 note = _("は光に身をすくめた!", " cringes from the light!");
3186 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3193 /* Dark -- opposite of Lite */
3196 if (seen) obvious = TRUE;
3198 if (r_ptr->flagsr & RFR_RES_ALL)
3200 note = _("には完全な耐性がある!", " is immune.");
3202 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3205 if (r_ptr->flagsr & RFR_RES_DARK)
3207 note = _("には耐性がある!", " resists!");
3208 dam *= 2; dam /= (randint1(6)+6);
3209 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
3218 if (r_ptr->flagsr & RFR_RES_ALL)
3223 /* Hurt by rock remover */
3224 if (r_ptr->flags3 & (RF3_HURT_ROCK))
3227 if (seen) obvious = TRUE;
3229 /* Memorize the effects */
3230 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
3232 /* Cute little message */
3233 note = _("の皮膚がただれた!", " loses some skin!");
3234 note_dies = _("はドロドロに溶けた!", " dissolves!");
3237 /* Usually, ignore the effects */
3248 /* Teleport undead (Use "dam" as "power") */
3249 case GF_AWAY_UNDEAD:
3251 /* Only affect undead */
3252 if (r_ptr->flags3 & (RF3_UNDEAD))
3254 bool resists_tele = FALSE;
3256 if (r_ptr->flagsr & RFR_RES_TELE)
3258 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3260 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3261 note = _("には効果がなかった。", " is unaffected.");
3262 resists_tele = TRUE;
3264 else if (r_ptr->level > randint1(100))
3266 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3267 note = _("には耐性がある!", " resists!");
3268 resists_tele = TRUE;
3274 if (seen) obvious = TRUE;
3275 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3287 /* No "real" damage */
3293 /* Teleport evil (Use "dam" as "power") */
3296 /* Only affect evil */
3297 if (r_ptr->flags3 & (RF3_EVIL))
3299 bool resists_tele = FALSE;
3301 if (r_ptr->flagsr & RFR_RES_TELE)
3303 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3305 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3306 note = _("には効果がなかった。", " is unaffected.");
3307 resists_tele = TRUE;
3309 else if (r_ptr->level > randint1(100))
3311 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3312 note = _("には耐性がある!", " resists!");
3313 resists_tele = TRUE;
3319 if (seen) obvious = TRUE;
3320 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3332 /* No "real" damage */
3338 /* Teleport monster (Use "dam" as "power") */
3341 bool resists_tele = FALSE;
3342 if (r_ptr->flagsr & RFR_RES_TELE)
3344 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3346 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3347 note = _("には効果がなかった。", " is unaffected.");
3348 resists_tele = TRUE;
3350 else if (r_ptr->level > randint1(100))
3352 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3353 note = _("には耐性がある!", " resists!");
3354 resists_tele = TRUE;
3360 if (seen) obvious = TRUE;
3362 /* Prepare to teleport */
3366 /* No "real" damage */
3372 /* Turn undead (Use "dam" as "power") */
3373 case GF_TURN_UNDEAD:
3375 if (r_ptr->flagsr & RFR_RES_ALL)
3380 /* Only affect undead */
3381 if (r_ptr->flags3 & (RF3_UNDEAD))
3383 if (seen) obvious = TRUE;
3385 /* Learn about type */
3386 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3388 /* Apply some fear */
3389 do_fear = damroll(3, (dam / 2)) + 1;
3391 /* Attempt a saving throw */
3392 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
3394 /* No obvious effect */
3395 note = _("には効果がなかった。", " is unaffected.");
3408 /* No "real" damage */
3414 /* Turn evil (Use "dam" as "power") */
3417 if (r_ptr->flagsr & RFR_RES_ALL)
3422 /* Only affect evil */
3423 if (r_ptr->flags3 & (RF3_EVIL))
3425 if (seen) obvious = TRUE;
3427 /* Learn about type */
3428 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3430 /* Apply some fear */
3431 do_fear = damroll(3, (dam / 2)) + 1;
3433 /* Attempt a saving throw */
3434 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
3436 /* No obvious effect */
3437 note = _("には効果がなかった。", " is unaffected.");
3450 /* No "real" damage */
3456 /* Turn monster (Use "dam" as "power") */
3459 if (r_ptr->flagsr & RFR_RES_ALL)
3464 if (seen) obvious = TRUE;
3466 /* Apply some fear */
3467 do_fear = damroll(3, (dam / 2)) + 1;
3469 /* Attempt a saving throw */
3470 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3471 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
3472 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3474 /* No obvious effect */
3475 note = _("には効果がなかった。", " is unaffected.");
3480 /* No "real" damage */
3487 case GF_DISP_UNDEAD:
3489 if (r_ptr->flagsr & RFR_RES_ALL)
3495 /* Only affect undead */
3496 if (r_ptr->flags3 & (RF3_UNDEAD))
3498 if (seen) obvious = TRUE;
3500 /* Learn about type */
3501 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3503 note = _("は身震いした。", " shudders.");
3504 note_dies = _("はドロドロに溶けた!", " dissolves!");
3524 if (r_ptr->flagsr & RFR_RES_ALL)
3530 /* Only affect evil */
3531 if (r_ptr->flags3 & (RF3_EVIL))
3533 if (seen) obvious = TRUE;
3535 /* Learn about type */
3536 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3538 note = _("は身震いした。", " shudders.");
3539 note_dies = _("はドロドロに溶けた!", " dissolves!");
3558 if (r_ptr->flagsr & RFR_RES_ALL)
3564 /* Only affect good */
3565 if (r_ptr->flags3 & (RF3_GOOD))
3567 if (seen) obvious = TRUE;
3569 /* Learn about type */
3570 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
3572 note = _("は身震いした。", " shudders.");
3573 note_dies = _("はドロドロに溶けた!", " dissolves!");
3590 case GF_DISP_LIVING:
3592 if (r_ptr->flagsr & RFR_RES_ALL)
3598 /* Only affect non-undead */
3599 if (monster_living(m_ptr->r_idx))
3601 if (seen) obvious = TRUE;
3603 note = _("は身震いした。", " shudders.");
3604 note_dies = _("はドロドロに溶けた!", " dissolves!");
3623 if (r_ptr->flagsr & RFR_RES_ALL)
3629 /* Only affect demons */
3630 if (r_ptr->flags3 & (RF3_DEMON))
3632 if (seen) obvious = TRUE;
3634 /* Learn about type */
3635 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
3637 note = _("は身震いした。", " shudders.");
3638 note_dies = _("はドロドロに溶けた!", " dissolves!");
3654 /* Dispel monster */
3657 if (r_ptr->flagsr & RFR_RES_ALL)
3663 if (seen) obvious = TRUE;
3665 note = _("は身震いした。", " shudders.");
3666 note_dies = _("はドロドロに溶けた!", " dissolves!");
3673 if (seen) obvious = TRUE;
3675 if (r_ptr->flagsr & RFR_RES_ALL)
3677 note = _("には完全な耐性がある!", " is immune.");
3679 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3683 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->a_ability_flags1 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->a_ability_flags2 & ~(RF6_NOMAGIC_MASK)))
3687 /* Heal the monster */
3688 if (caster_ptr->hp < caster_ptr->maxhp)
3691 caster_ptr->hp += dam;
3692 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
3694 /* Redraw (later) if needed */
3695 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
3696 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
3698 /* Special message */
3701 monster_desc(killer, caster_ptr, 0);
3702 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), killer);
3708 msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), m_name);
3709 (void)hp_player(dam);
3714 if (see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3723 if (seen) obvious = TRUE;
3724 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3726 if (r_ptr->flagsr & RFR_RES_ALL)
3728 note = _("には完全な耐性がある!", " is immune.");
3730 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3734 /* Attempt a saving throw */
3735 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3736 (r_ptr->flags3 & RF3_NO_CONF) ||
3737 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3739 /* Memorize a flag */
3740 if (r_ptr->flags3 & (RF3_NO_CONF))
3742 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3744 note = _("には効果がなかった。", " is unaffected.");
3747 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3749 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3750 note = _("には完全な耐性がある!", " is immune.");
3753 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3755 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3756 note = _("には耐性がある。", " resists.");
3761 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3762 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3764 if (who > 0) do_conf = randint0(4) + 4;
3765 else do_conf = randint0(8) + 8;
3771 case GF_BRAIN_SMASH:
3773 if (seen) obvious = TRUE;
3774 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3776 if (r_ptr->flagsr & RFR_RES_ALL)
3778 note = _("には完全な耐性がある!", " is immune.");
3780 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3784 /* Attempt a saving throw */
3785 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3786 (r_ptr->flags3 & RF3_NO_CONF) ||
3787 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3789 /* Memorize a flag */
3790 if (r_ptr->flags3 & (RF3_NO_CONF))
3792 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3794 note = _("には効果がなかった。", " is unaffected.");
3797 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3799 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3800 note = _("には完全な耐性がある!", " is immune.");
3803 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3805 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3806 note = _("には耐性がある!", " resists!");
3811 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3812 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3816 do_conf = randint0(4) + 4;
3817 do_stun = randint0(4) + 4;
3821 do_conf = randint0(8) + 8;
3822 do_stun = randint0(8) + 8;
3824 (void)set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 10);
3832 if (seen) obvious = TRUE;
3833 if (!who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), m_name);
3835 if (r_ptr->flagsr & RFR_RES_ALL)
3837 note = _("には完全な耐性がある!", " is immune.");
3839 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3843 /* Attempt a saving throw */
3844 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3846 note = _("には効果がなかった。", " is unaffected.");
3855 if (seen) obvious = TRUE;
3856 if (!who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), m_name);
3858 if (r_ptr->flagsr & RFR_RES_ALL)
3860 note = _("には完全な耐性がある!", " is immune.");
3862 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3866 /* Attempt a saving throw */
3867 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3869 note = _("には効果がなかった。", " is unaffected.");
3878 if (seen) obvious = TRUE;
3879 if (!who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), m_name);
3881 if (r_ptr->flagsr & RFR_RES_ALL)
3883 note = _("には完全な耐性がある!", " is immune.");
3885 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3889 /* Attempt a saving throw */
3890 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3892 note = _("には効果がなかった。", " is unaffected.");
3901 if (seen) obvious = TRUE;
3903 msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
3904 "You point at %s, screaming the word, 'DIE!'."), m_name);
3906 if (r_ptr->flagsr & RFR_RES_ALL)
3908 note = _("には完全な耐性がある!", " is immune.");
3910 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3914 /* Attempt a saving throw */
3915 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
3917 note = _("には効果がなかった。", " is unaffected.");
3926 if (seen) obvious = TRUE;
3928 if (r_ptr->flagsr & RFR_RES_ALL)
3930 note = _("には完全な耐性がある!", " is immune.");
3932 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3936 if (r_ptr->flags1 & RF1_UNIQUE)
3938 note = _("には効果がなかった。", " is unaffected.");
3943 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
3944 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
3946 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
3948 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
3952 note = _("は耐性を持っている!", "resists!");
3959 /* Capture monster */
3963 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
3964 (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)
3966 msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3971 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
3972 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(m_ptr->r_idx))
3973 nokori_hp = m_ptr->maxhp * 3 / 10;
3975 nokori_hp = m_ptr->maxhp * 3 / 20;
3977 if (m_ptr->hp >= nokori_hp)
3979 msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), m_name);
3982 else if (m_ptr->hp < randint0(nokori_hp))
3984 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
3985 msg_format(_("%sを捕えた!", "You capture %^s!"), m_name);
3986 cap_mon = m_ptr->r_idx;
3987 cap_mspeed = m_ptr->mspeed;
3989 cap_maxhp = m_ptr->max_maxhp;
3990 cap_nickname = m_ptr->nickname; /* Quark transfer */
3991 if (c_ptr->m_idx == p_ptr->riding)
3993 if (rakuba(-1, FALSE))
3995 msg_format(_("地面に落とされた。", "You have fallen from %s."), m_name);
3999 delete_monster_idx(c_ptr->m_idx);
4005 msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), m_name);
4011 /* Attack (Use "dam" as attack type) */
4014 /* Return this monster's death */
4015 return py_attack(y, x, dam);
4018 /* Sleep (Use "dam" as "power") */
4024 if (seen) obvious = TRUE;
4026 if (r_ptr->flagsr & RFR_RES_ALL)
4028 note = _("には効果がなかった。", " is unaffected.");
4030 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4033 if (r_ptr->flags2 & RF2_EMPTY_MIND)
4035 note = _("には効果がなかった。", " is unaffected.");
4038 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
4041 if (MON_CSLEEP(m_ptr))
4043 note = _("には効果がなかった。", " is unaffected.");
4049 if (one_in_(5)) effect = 1;
4050 else if (one_in_(4)) effect = 2;
4051 else if (one_in_(3)) effect = 3;
4056 /* Powerful monsters can resist */
4057 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4058 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4060 note = _("には効果がなかった。", " is unaffected.");
4064 /* Normal monsters slow down */
4067 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
4069 note = _("の動きが遅くなった。", " starts moving slower.");
4074 else if (effect == 2)
4076 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
4078 /* Attempt a saving throw */
4079 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4080 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4085 /* No obvious effect */
4086 note = _("には効果がなかった。", " is unaffected.");
4091 else if (effect == 3)
4093 /* Attempt a saving throw */
4094 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4095 (r_ptr->flags3 & RF3_NO_SLEEP) ||
4096 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4098 /* Memorize a flag */
4099 if (r_ptr->flags3 & RF3_NO_SLEEP)
4101 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
4104 /* No obvious effect */
4105 note = _("には効果がなかった。", " is unaffected.");
4110 /* Go to sleep (much) later */
4111 note = _("は眠り込んでしまった!", " falls asleep!");
4118 note = _("には効果がなかった。", " is unaffected.");
4121 /* No "real" damage */
4129 if (seen) obvious = TRUE;
4131 if (r_ptr->flagsr & RFR_RES_ALL)
4133 note = _("には効果がなかった。", " is unaffected.");
4135 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4139 if (genocide_aux(c_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
4141 if (seen_msg) msg_format(_("%sは消滅した!", "%^s disappered!"), m_name);
4142 chg_virtue(V_VITALITY, -1);
4152 if (!who) msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), m_name);
4154 if (r_ptr->flags3 & (RF3_HURT_LITE))
4156 /* Obvious effect */
4157 if (seen) obvious = TRUE;
4159 /* Memorize the effects */
4160 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4162 /* Special effect */
4163 note = _("は光に身をすくめた!", " cringes from the light!");
4164 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
4167 /* Normally no damage */
4174 photo = m_ptr->r_idx;
4181 case GF_BLOOD_CURSE:
4183 if (seen) obvious = TRUE;
4185 if (r_ptr->flagsr & RFR_RES_ALL)
4187 note = _("には完全な耐性がある!", " is immune.");
4189 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4197 bool success = FALSE;
4198 if (seen) obvious = TRUE;
4200 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
4202 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
4203 if (dam < 1) dam = 1;
4205 /* No need to tame your pet */
4208 note = _("の動きが速くなった。", " starts moving faster.");
4209 (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100);
4213 /* Attempt a saving throw */
4214 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4215 (r_ptr->flags1 & (RF1_UNIQUE)) ||
4216 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4217 (p_ptr->cursed & TRC_AGGRAVATE) ||
4218 ((r_ptr->level+10) > randint1(dam)))
4221 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4225 note = _("を支配した。", " is tamed!");
4227 (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100);
4229 /* Learn about type */
4230 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4237 if (!(r_ptr->flags3 & RF3_NO_FEAR))
4239 do_fear = randint1(90)+10;
4241 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
4244 /* No "real" damage */
4251 if (seen) obvious = TRUE;
4253 if (r_ptr->flagsr & RFR_RES_ALL)
4255 note = _("には完全な耐性がある!", " is immune.");
4257 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4261 /* Attempt a saving throw */
4262 if (randint0(100 + dam) < (r_ptr->level + 50))
4264 note = _("には効果がなかった。", " is unaffected.");
4284 /* Absolutely no effect */
4285 if (skipped) return (FALSE);
4287 /* "Unique" monsters cannot be polymorphed */
4288 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
4290 /* Quest monsters cannot be polymorphed */
4291 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
4293 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
4295 /* "Unique" and "quest" monsters can only be "killed" by the player. */
4296 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
4298 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
4303 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
4304 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
4307 /* Modify the damage */
4309 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
4310 if ((tmp > 0) && (dam == 0)) note = _("はダメージを受けていない。", " is unharmed.");
4312 /* Check for death */
4313 if (dam > m_ptr->hp)
4315 /* Extract method of death */
4320 /* Sound and Impact resisters never stun */
4322 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
4323 !(r_ptr->flags3 & RF3_NO_STUN))
4325 if (seen) obvious = TRUE;
4328 if (MON_STUNNED(m_ptr))
4330 note = _("はひどくもうろうとした。", " is more dazed.");
4331 tmp = MON_STUNNED(m_ptr) + (do_stun / 2);
4335 note = _("はもうろうとした。", " is dazed.");
4340 (void)set_monster_stunned(c_ptr->m_idx, tmp);
4346 /* Confusion and Chaos resisters (and sleepers) never confuse */
4348 !(r_ptr->flags3 & RF3_NO_CONF) &&
4349 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
4351 if (seen) obvious = TRUE;
4353 /* Already partially confused */
4354 if (MON_CONFUSED(m_ptr))
4356 note = _("はさらに混乱したようだ。", " looks more confused.");
4357 tmp = MON_CONFUSED(m_ptr) + (do_conf / 2);
4360 /* Was not confused */
4363 note = _("は混乱したようだ。", " looks confused.");
4367 /* Apply confusion */
4368 (void)set_monster_confused(c_ptr->m_idx, tmp);
4376 if (seen) obvious = TRUE;
4378 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
4382 note = _("は弱くなったようだ。", " seems weakened.");
4383 m_ptr->maxhp -= do_time;
4384 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
4389 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
4390 if (do_poly && (randint1(90) > r_ptr->level))
4392 if (polymorph_monster(y, x))
4394 if (seen) obvious = TRUE;
4396 /* Monster polymorphs */
4397 note = _("が変身した!", " changes!");
4399 /* Turn off the damage */
4405 note = _("には効果がなかった。", " is unaffected.");
4408 /* Hack -- Get new monster */
4409 m_ptr = &m_list[c_ptr->m_idx];
4411 /* Hack -- Get new race */
4412 r_ptr = &r_info[m_ptr->r_idx];
4415 /* Handle "teleport" */
4418 if (seen) obvious = TRUE;
4420 note = _("が消え去った!", " disappears!");
4422 if (!who) chg_virtue(V_VALOUR, -1);
4425 teleport_away(c_ptr->m_idx, do_dist,
4426 (!who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
4428 /* Hack -- get new location */
4432 /* Hack -- get new grid */
4433 c_ptr = &cave[y][x];
4440 (void)set_monster_monfear(c_ptr->m_idx, MON_MONFEAR(m_ptr) + do_fear);
4447 if (typ == GF_DRAIN_MANA)
4449 /* Drain mana does nothing */
4452 /* If another monster did the damage, hurt the monster by hand */
4455 /* Redraw (later) if needed */
4456 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
4457 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
4459 /* Wake the monster up */
4460 (void)set_monster_csleep(c_ptr->m_idx, 0);
4462 /* Hurt the monster */
4470 if (is_pet(m_ptr) && !(m_ptr->ml))
4473 /* Give detailed messages if destroyed */
4476 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
4479 msg_format("%^s%s", m_name, note);
4487 if (who > 0) monster_gain_exp(who, m_ptr->r_idx);
4489 /* Generate treasure, etc */
4490 monster_death(c_ptr->m_idx, FALSE);
4493 delete_monster_idx(c_ptr->m_idx);
4497 msg_print(_("少し悲しい気分がした。", "You feel sad for a moment."));
4501 /* Damaged monster */
4504 /* Give detailed messages if visible or destroyed */
4505 if (note && seen_msg) msg_format("%^s%s", m_name, note);
4507 /* Hack -- Pain message */
4510 message_pain(c_ptr->m_idx, dam);
4517 /* Hack -- handle sleep */
4518 if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep);
4522 else if (heal_leper)
4524 if (seen_msg) msg_print(_("不潔な病人は病気が治った!", "The Mangy looking leper is healed!"));
4526 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
4528 char m2_name[MAX_NLEN];
4530 monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
4531 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_HEAL_LEPER, m2_name);
4534 delete_monster_idx(c_ptr->m_idx);
4537 /* If the player did it, give him experience, check fear */
4542 /* Hurt the monster, check for fear and death */
4543 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
4548 /* Damaged monster */
4551 /* HACK - anger the monster before showing the sleep message */
4552 if (do_sleep) anger_monster(m_ptr);
4554 /* Give detailed messages if visible or destroyed */
4555 if (note && seen_msg)
4556 msg_format(_("%s%s", "%^s%s"), m_name, note);
4558 /* Hack -- Pain message */
4559 else if (known && (dam || !do_fear))
4561 message_pain(c_ptr->m_idx, dam);
4564 /* Anger monsters */
4565 if (((dam > 0) || get_angry) && !do_sleep)
4566 anger_monster(m_ptr);
4568 if ((fear || do_fear) && seen)
4571 msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
4574 /* Hack -- handle sleep */
4575 if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep);
4579 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
4581 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
4585 switch (randint1(28))
4590 msg_print(_("地面が揺れた...", "The ground trembles..."));
4591 earthquake(ty, tx, 4 + randint0(4));
4592 if (!one_in_(6)) break;
4594 case 3: case 4: case 5: case 6:
4597 int extra_dam = damroll(10, 10);
4598 msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
4600 project(0, 8, ty, tx, extra_dam, GF_MANA, curse_flg, -1);
4601 if (!one_in_(6)) break;
4606 msg_print(_("空間が歪んだ!", "Space warps about you!"));
4608 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), TELEPORT_PASSIVE);
4609 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
4610 if (!one_in_(6)) break;
4612 case 9: case 10: case 11:
4613 msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!"));
4614 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
4615 if (!one_in_(6)) break;
4616 case 12: case 13: case 14: case 15: case 16:
4617 aggravate_monsters(0);
4618 if (!one_in_(6)) break;
4620 count += activate_hi_summon(ty, tx, TRUE);
4621 if (!one_in_(6)) break;
4622 case 19: case 20: case 21: case 22:
4624 bool pet = !one_in_(3);
4625 BIT_FLAGS mode = PM_ALLOW_GROUP;
4627 if (pet) mode |= PM_FORCE_PET;
4628 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
4630 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');
4631 if (!one_in_(6)) break;
4633 case 23: case 24: case 25:
4634 if (p_ptr->hold_exp && (randint0(100) < 75)) break;
4635 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
4637 if (p_ptr->hold_exp) lose_exp(p_ptr->exp / 160);
4638 else lose_exp(p_ptr->exp / 16);
4639 if (!one_in_(6)) break;
4640 case 26: case 27: case 28:
4649 (void)do_dec_stat(i);
4658 (void)do_dec_stat(randint0(6));
4667 if (p_ptr->inside_battle)
4669 p_ptr->health_who = c_ptr->m_idx;
4670 p_ptr->redraw |= (PR_HEALTH);
4674 /* Verify this code */
4675 if (m_ptr->r_idx) update_monster(c_ptr->m_idx, FALSE);
4677 /* Redraw the monster grid */
4681 /* Update monster recall window */
4682 if ((p_ptr->monster_race_idx == m_ptr->r_idx) && (seen || !m_ptr->r_idx))
4684 p_ptr->window |= (PW_MONSTER);
4687 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
4691 if (!(flg & PROJECT_NO_HANGEKI))
4693 set_target(m_ptr, monster_target_y, monster_target_x);
4696 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
4698 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
4702 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
4704 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
4705 rakubadam_m = (dam > 200) ? 200 : dam;
4715 /* Prepare to make a Blade of Chaos */
4716 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
4718 q_ptr->pval = photo;
4720 /* Mark the item as fully known */
4721 q_ptr->ident |= (IDENT_MENTAL);
4722 (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
4730 /* Return "Anything seen?" */
4735 * @brief 汎用的なビーム/ボルト/ボール系によるプレイヤーへの効果処理 / Helper function for "project()" below.
4736 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
4737 * @param who_name 効果を起こしたモンスターの名前
4738 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
4739 * @param y 目標Y座標 / Target y location (or location to travel "towards")
4740 * @param x 目標X座標 / Target x location (or location to travel "towards")
4741 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
4742 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
4744 * @param monspell 効果元のモンスター魔法ID
4745 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
4747 * Handle a beam/bolt/ball causing damage to the player.
4748 * This routine takes a "source monster" (by index), a "distance", a default
4749 * "damage", and a "damage type". See "project_m()" above.
4750 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
4751 * is reduced (see "project_m()" above). This can happen if a monster breathes
4752 * at the player and hits a wall instead.
4753 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
4754 * to know if this is actually a ball or a bolt spell
4755 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
4756 * we just assume that the effects were obvious, for historical reasons.
4758 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)
4763 /* Hack -- assume obvious */
4764 bool obvious = TRUE;
4766 /* Player blind-ness */
4767 bool blind = (p_ptr->blind ? TRUE : FALSE);
4769 /* Player needs a "description" (he is blind) */
4772 /* Source monster */
4773 monster_type *m_ptr = NULL;
4775 /* Monster name (for attacks) */
4776 GAME_TEXT m_name[MAX_NLEN];
4778 /* Monster name (for damage) */
4781 /* Hack -- messages */
4787 /* Player is not here */
4788 if (!player_bold(y, x)) return (FALSE);
4790 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
4792 if (kawarimi(TRUE)) return FALSE;
4795 /* Player cannot hurt himself */
4796 if (!who) return (FALSE);
4797 if (who == p_ptr->riding) return (FALSE);
4799 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
4802 int max_attempts = 10;
4803 sound(SOUND_REFLECT);
4806 msg_print(_("何かが跳ね返った!", "Something bounces!"));
4807 else if (p_ptr->special_defense & KATA_FUUJIN)
4808 msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
4810 msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
4813 /* Choose 'new' target */
4818 t_y = m_list[who].fy - 1 + randint1(3);
4819 t_x = m_list[who].fx - 1 + randint1(3);
4822 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(p_ptr->y, p_ptr->x, t_y, t_x));
4824 if (max_attempts < 1)
4826 t_y = m_list[who].fy;
4827 t_x = m_list[who].fx;
4832 t_y = p_ptr->y - 1 + randint1(3);
4833 t_x = p_ptr->x - 1 + randint1(3);
4836 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
4838 disturb(TRUE, TRUE);
4842 /* Limit maximum damage */
4843 if (dam > 1600) dam = 1600;
4845 /* Reduce damage by distance */
4846 dam = (dam + r) / (r + 1);
4849 /* If the player is blind, be more descriptive */
4850 if (blind) fuzzy = TRUE;
4855 m_ptr = &m_list[who];
4856 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
4857 monster_desc(m_name, m_ptr, 0);
4859 /* Get the monster's real name (gotten before polymorph!) */
4860 strcpy(killer, who_name);
4866 case PROJECT_WHO_UNCTRL_POWER:
4867 strcpy(killer, _("制御できない力の氾流", "uncontrollable power storm"));
4870 case PROJECT_WHO_GLASS_SHARDS:
4871 strcpy(killer, _("ガラスの破片", "shards of glass"));
4875 strcpy(killer, _("罠", "a trap"));
4880 strcpy(m_name, killer);
4883 /* Analyze the damage */
4886 /* Standard damage -- hurts inventory too */
4889 if (fuzzy) msg_print(_("酸で攻撃された!", "You are hit by acid!"));
4890 get_damage = acid_dam(dam, killer, monspell, FALSE);
4894 /* Standard damage -- hurts inventory too */
4897 if (fuzzy) msg_print(_("火炎で攻撃された!", "You are hit by fire!"));
4898 get_damage = fire_dam(dam, killer, monspell, FALSE);
4902 /* Standard damage -- hurts inventory too */
4905 if (fuzzy) msg_print(_("冷気で攻撃された!", "You are hit by cold!"));
4906 get_damage = cold_dam(dam, killer, monspell, FALSE);
4910 /* Standard damage -- hurts inventory too */
4913 if (fuzzy) msg_print(_("電撃で攻撃された!", "You are hit by lightning!"));
4914 get_damage = elec_dam(dam, killer, monspell, FALSE);
4918 /* Standard damage -- also poisons player */
4921 bool double_resist = IS_OPPOSE_POIS();
4922 if (fuzzy) msg_print(_("毒で攻撃された!", "You are hit by poison!"));
4924 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
4925 if (double_resist) dam = (dam + 2) / 3;
4927 if ((!(double_resist || p_ptr->resist_pois)) && one_in_(HURT_CHANCE) && !CHECK_MULTISHADOW())
4932 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4934 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4936 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4941 /* Standard damage -- also poisons / mutates player */
4944 bool double_resist = IS_OPPOSE_POIS();
4945 if (fuzzy) msg_print(_("放射能で攻撃された!", "You are hit by radiation!"));
4947 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
4948 if (double_resist) dam = (2 * dam + 2) / 5;
4949 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4950 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4952 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4954 if (one_in_(5)) /* 6 */
4956 msg_print(_("奇形的な変身を遂げた!", "You undergo a freakish metamorphosis!"));
4957 if (one_in_(4)) /* 4 */
4965 inven_damage(set_acid_destroy, 2);
4971 /* Standard damage */
4974 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4975 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4979 /* Holy Orb -- Player only takes partial damage */
4982 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4983 if (p_ptr->align > 10)
4985 else if (p_ptr->align < -10)
4987 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4993 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4994 if (p_ptr->align > 10)
4996 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5000 /* Arrow -- XXX no dodging */
5005 msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
5007 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
5009 msg_print(_("矢を斬り捨てた!", "You cut down the arrow!"));
5012 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5016 /* Plasma -- XXX No resist */
5019 if (fuzzy) msg_print(_("何かとても熱いもので攻撃された!", "You are hit by something *HOT*!"));
5020 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5022 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5024 int plus_stun = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
5025 (void)set_stun(p_ptr->stun + plus_stun);
5028 if (!(p_ptr->resist_fire || IS_OPPOSE_FIRE() || p_ptr->immune_fire))
5030 inven_damage(set_acid_destroy, 3);
5036 /* Nether -- drain experience */
5039 if (fuzzy) msg_print(_("地獄の力で攻撃された!", "You are hit by nether forces!"));
5040 if (p_ptr->resist_neth)
5042 if (!prace_is_(RACE_SPECTRE))
5044 dam *= 6; dam /= (randint1(4) + 7);
5047 else if (!CHECK_MULTISHADOW()) drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
5049 if (prace_is_(RACE_SPECTRE) && !CHECK_MULTISHADOW())
5051 msg_print(_("気分がよくなった。", "You feel invigorated!"));
5053 learn_spell(monspell);
5057 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5063 /* Water -- stun/confuse */
5066 if (fuzzy) msg_print(_("何か湿ったもので攻撃された!", "You are hit by something wet!"));
5067 if (!CHECK_MULTISHADOW())
5069 if (!p_ptr->resist_sound && !p_ptr->resist_water)
5071 set_stun(p_ptr->stun + randint1(40));
5073 if (!p_ptr->resist_conf && !p_ptr->resist_water)
5075 set_confused(p_ptr->confused + randint1(5) + 5);
5078 if (one_in_(5) && !p_ptr->resist_water)
5080 inven_damage(set_cold_destroy, 3);
5083 if (p_ptr->resist_water) get_damage /= 4;
5086 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5090 /* Chaos -- many effects */
5093 if (fuzzy) msg_print(_("無秩序の波動で攻撃された!", "You are hit by a wave of anarchy!"));
5094 if (p_ptr->resist_chaos)
5096 dam *= 6; dam /= (randint1(4) + 7);
5099 if (!CHECK_MULTISHADOW())
5101 if (!p_ptr->resist_conf)
5103 (void)set_confused(p_ptr->confused + randint0(20) + 10);
5105 if (!p_ptr->resist_chaos)
5107 (void)set_image(p_ptr->image + randint1(10));
5110 msg_print(_("あなたの身体はカオスの力で捻じ曲げられた!", "Your body is twisted by chaos!"));
5111 (void)gain_random_mutation(0);
5114 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
5116 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
5119 if (!p_ptr->resist_chaos || one_in_(9))
5121 inven_damage(set_elec_destroy, 2);
5122 inven_damage(set_fire_destroy, 2);
5126 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5130 /* Shards -- mostly cutting */
5133 if (fuzzy) msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
5134 if (p_ptr->resist_shard)
5136 dam *= 6; dam /= (randint1(4) + 7);
5138 else if (!CHECK_MULTISHADOW())
5140 (void)set_cut(p_ptr->cut + dam);
5143 if (!p_ptr->resist_shard || one_in_(13))
5145 inven_damage(set_cold_destroy, 2);
5148 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5152 /* Sound -- mostly stunning */
5155 if (fuzzy) msg_print(_("轟音で攻撃された!", "You are hit by a loud noise!"));
5156 if (p_ptr->resist_sound)
5158 dam *= 5; dam /= (randint1(4) + 7);
5160 else if (!CHECK_MULTISHADOW())
5162 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
5163 (void)set_stun(p_ptr->stun + plus_stun);
5166 if (!p_ptr->resist_sound || one_in_(13))
5168 inven_damage(set_cold_destroy, 2);
5171 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5175 /* Pure confusion */
5178 if (fuzzy) msg_print(_("何か混乱するもので攻撃された!", "You are hit by something puzzling!"));
5179 if (p_ptr->resist_conf)
5181 dam *= 5; dam /= (randint1(4) + 7);
5183 else if (!CHECK_MULTISHADOW())
5185 (void)set_confused(p_ptr->confused + randint1(20) + 10);
5187 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5191 /* Disenchantment -- see above */
5194 if (fuzzy) msg_print(_("何かさえないもので攻撃された!", "You are hit by something static!"));
5195 if (p_ptr->resist_disen)
5197 dam *= 6; dam /= (randint1(4) + 7);
5199 else if (!CHECK_MULTISHADOW())
5201 (void)apply_disenchant(0);
5203 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5207 /* Nexus -- see above */
5210 if (fuzzy) msg_print(_("何か奇妙なもので攻撃された!", "You are hit by something strange!"));
5211 if (p_ptr->resist_nexus)
5213 dam *= 6; dam /= (randint1(4) + 7);
5215 else if (!CHECK_MULTISHADOW())
5219 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5223 /* Force -- mostly stun */
5226 if (fuzzy) msg_print(_("運動エネルギーで攻撃された!", "You are hit by kinetic force!"));
5227 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5229 (void)set_stun(p_ptr->stun + randint1(20));
5231 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5236 /* Rocket -- stun, cut */
5239 if (fuzzy) msg_print(_("爆発があった!", "There is an explosion!"));
5240 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5242 (void)set_stun(p_ptr->stun + randint1(20));
5245 if (p_ptr->resist_shard)
5249 else if (!CHECK_MULTISHADOW())
5251 (void)set_cut(p_ptr->cut + (dam / 2));
5254 if (!p_ptr->resist_shard || one_in_(12))
5256 inven_damage(set_cold_destroy, 3);
5259 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5263 /* Inertia -- slowness */
5266 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
5267 if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5268 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5272 /* Lite -- blinding */
5275 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5276 if (p_ptr->resist_lite)
5278 dam *= 4; dam /= (randint1(4) + 7);
5280 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
5282 (void)set_blind(p_ptr->blind + randint1(5) + 2);
5285 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
5287 if (!CHECK_MULTISHADOW()) msg_print(_("光で肉体が焦がされた!", "The light scorches your flesh!"));
5290 else if (prace_is_(RACE_S_FAIRY))
5295 if (p_ptr->wraith_form) dam *= 2;
5296 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5298 if (p_ptr->wraith_form && !CHECK_MULTISHADOW())
5300 p_ptr->wraith_form = 0;
5301 msg_print(_("閃光のため非物質的な影の存在でいられなくなった。",
5302 "The light forces you out of your incorporeal shadow form."));
5304 p_ptr->redraw |= (PR_MAP | PR_STATUS);
5305 p_ptr->update |= (PU_MONSTERS);
5306 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5312 /* Dark -- blinding */
5315 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5316 if (p_ptr->resist_dark)
5318 dam *= 4; dam /= (randint1(4) + 7);
5320 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
5322 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
5324 (void)set_blind(p_ptr->blind + randint1(5) + 2);
5326 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5330 /* Time -- bolt fewer effects XXX */
5333 if (fuzzy) msg_print(_("過去からの衝撃に攻撃された!", "You are hit by a blast from the past!"));
5334 if (p_ptr->resist_time)
5337 dam /= (randint1(4) + 7);
5338 msg_print(_("時間が通り過ぎていく気がする。", "You feel as if time is passing you by."));
5340 else if (!CHECK_MULTISHADOW())
5342 switch (randint1(10))
5344 case 1: case 2: case 3: case 4: case 5:
5346 if (p_ptr->prace == RACE_ANDROID) break;
5347 msg_print(_("人生が逆戻りした気がする。", "You feel life has clocked back."));
5348 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
5352 case 6: case 7: case 8: case 9:
5354 switch (randint1(6))
5356 case 1: k = A_STR; act = _("強く", "strong"); break;
5357 case 2: k = A_INT; act = _("聡明で", "bright"); break;
5358 case 3: k = A_WIS; act = _("賢明で", "wise"); break;
5359 case 4: k = A_DEX; act = _("器用で", "agile"); break;
5360 case 5: k = A_CON; act = _("健康で", "hale"); break;
5361 case 6: k = A_CHR; act = _("美しく", "beautiful"); break;
5364 msg_format(_("あなたは以前ほど%sなくなってしまった...。",
5365 "You're not as %s as you used to be..."), act);
5367 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
5368 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
5369 p_ptr->update |= (PU_BONUS);
5375 msg_print(_("あなたは以前ほど力強くなくなってしまった...。",
5376 "You're not as powerful as you used to be..."));
5378 for (k = 0; k < A_MAX; k++)
5380 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
5381 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
5383 p_ptr->update |= (PU_BONUS);
5389 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5393 /* Gravity -- stun plus slowness plus teleport */
5396 if (fuzzy) msg_print(_("何か重いもので攻撃された!", "You are hit by something heavy!"));
5397 msg_print(_("周辺の重力がゆがんだ。", "Gravity warps around you."));
5399 if (!CHECK_MULTISHADOW())
5401 teleport_player(5, TELEPORT_PASSIVE);
5402 if (!p_ptr->levitation)
5403 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5404 if (!(p_ptr->resist_sound || p_ptr->levitation))
5406 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
5407 (void)set_stun(p_ptr->stun + plus_stun);
5410 if (p_ptr->levitation)
5412 dam = (dam * 2) / 3;
5415 if (!p_ptr->levitation || one_in_(13))
5417 inven_damage(set_cold_destroy, 2);
5420 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5424 /* Standard damage */
5425 case GF_DISINTEGRATE:
5427 if (fuzzy) msg_print(_("純粋なエネルギーで攻撃された!", "You are hit by pure energy!"));
5429 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5435 if (fuzzy) msg_print(_("何らかの攻撃によって気分がよくなった。", "You are hit by something invigorating!"));
5437 (void)hp_player(dam);
5444 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5445 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
5452 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
5453 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5459 if (p_ptr->free_act) break;
5460 if (fuzzy) msg_print(_("眠ってしまった!", "You fall asleep!"));
5462 if (ironman_nightmare)
5464 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
5465 /* Have some nightmares */
5466 sanity_blast(NULL, FALSE);
5469 set_paralyzed(p_ptr->paralyzed + dam);
5479 if (fuzzy) msg_print(_("魔法のオーラで攻撃された!", "You are hit by an aura of magic!"));
5480 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5487 if (fuzzy) msg_print(_("エネルギーの塊で攻撃された!", "You are hit by an energy!"));
5488 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
5495 if (fuzzy) msg_print(_("何かが空からあなたの頭上に落ちてきた!", "Something falls from the sky on you!"));
5497 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5498 if (!p_ptr->resist_shard || one_in_(13))
5500 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
5501 inven_damage(set_cold_destroy, 2);
5507 /* Ice -- cold plus stun plus cuts */
5510 if (fuzzy) msg_print(_("何か鋭く冷たいもので攻撃された!", "You are hit by something sharp and cold!"));
5511 get_damage = cold_dam(dam, killer, monspell, FALSE);
5512 if (!CHECK_MULTISHADOW())
5514 if (!p_ptr->resist_shard)
5516 (void)set_cut(p_ptr->cut + damroll(5, 8));
5518 if (!p_ptr->resist_sound)
5520 (void)set_stun(p_ptr->stun + randint1(15));
5523 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
5525 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
5535 if (fuzzy) msg_print(_("何か非常に冷たいもので攻撃された!", "You are hit by something extremely cold!"));
5537 if (p_ptr->mimic_form)
5539 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
5540 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5545 switch (p_ptr->prace)
5547 /* Some races are immune */
5561 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5573 if (CHECK_MULTISHADOW())
5575 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
5577 else if (p_ptr->csp)
5581 msg_format(_("%^sに精神エネルギーを吸い取られてしまった!", "%^s draws psychic energy from you!"), m_name);
5583 msg_print(_("精神エネルギーを吸い取られてしまった!", "Your psychic energy is drawn!"));
5586 if (dam >= p_ptr->csp)
5590 p_ptr->csp_frac = 0;
5599 learn_spell(monspell);
5600 p_ptr->redraw |= (PR_MANA);
5601 p_ptr->window |= (PW_PLAYER | PW_SPELL);
5605 /* Heal the monster */
5606 if (m_ptr->hp < m_ptr->maxhp)
5610 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
5612 /* Redraw (later) if needed */
5613 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
5614 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
5616 /* Special message */
5619 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), m_name);
5632 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
5634 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5635 learn_spell(monspell);
5639 if (!CHECK_MULTISHADOW())
5641 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
5643 if (!p_ptr->resist_conf)
5645 (void)set_confused(p_ptr->confused + randint0(4) + 4);
5648 if (!p_ptr->resist_chaos && one_in_(3))
5650 (void)set_image(p_ptr->image + randint0(250) + 150);
5657 p_ptr->csp_frac = 0;
5659 p_ptr->redraw |= PR_MANA;
5662 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5668 case GF_BRAIN_SMASH:
5670 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
5672 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5673 learn_spell(monspell);
5677 if (!CHECK_MULTISHADOW())
5679 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
5685 p_ptr->csp_frac = 0;
5687 p_ptr->redraw |= PR_MANA;
5690 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5691 if (!CHECK_MULTISHADOW())
5693 if (!p_ptr->resist_blind)
5695 (void)set_blind(p_ptr->blind + 8 + randint0(8));
5697 if (!p_ptr->resist_conf)
5699 (void)set_confused(p_ptr->confused + randint0(4) + 4);
5701 if (!p_ptr->free_act)
5703 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
5705 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5707 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
5708 (void)do_dec_stat(A_INT);
5709 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
5710 (void)do_dec_stat(A_WIS);
5712 if (!p_ptr->resist_chaos)
5714 (void)set_image(p_ptr->image + randint0(250) + 150);
5724 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5726 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5727 learn_spell(monspell);
5731 if (!CHECK_MULTISHADOW()) curse_equipment(15, 0);
5732 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5740 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5742 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5743 learn_spell(monspell);
5747 if (!CHECK_MULTISHADOW()) curse_equipment(25, MIN(rlev / 2 - 15, 5));
5748 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5756 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5758 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5759 learn_spell(monspell);
5763 if (!CHECK_MULTISHADOW()) curse_equipment(33, MIN(rlev / 2 - 15, 15));
5764 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5772 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU) && !CHECK_MULTISHADOW())
5774 msg_print(_("しかし秘孔を跳ね返した!", "You resist the effects!"));
5775 learn_spell(monspell);
5779 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5780 if (!CHECK_MULTISHADOW()) (void)set_cut(p_ptr->cut + damroll(10, 10));
5788 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5790 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5791 learn_spell(monspell);
5795 if (!CHECK_MULTISHADOW())
5797 msg_print(_("あなたは命が薄まっていくように感じた!", "You feel your life fade away!"));
5798 curse_equipment(40, 20);
5801 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
5803 if (p_ptr->chp < 1) p_ptr->chp = 1; /* Paranoia */
5818 /* Hex - revenge damage stored */
5819 revenge_store(get_damage);
5821 if ((p_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
5822 && (get_damage > 0) && !p_ptr->is_dead && (who > 0))
5824 GAME_TEXT m_name_self[80];
5827 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
5829 msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), m_name, m_name_self);
5830 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
5831 if (p_ptr->tim_eyeeye) set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
5834 if (p_ptr->riding && dam > 0)
5836 rakubadam_p = (dam > 200) ? 200 : dam;
5840 disturb(TRUE, TRUE);
5843 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
5845 (void)kawarimi(FALSE);
5848 /* Return "Anything seen?" */
5854 * Find the distance from (x, y) to a line.
5856 POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
5858 /* Vector from (x, y) to (x1, y1) */
5859 POSITION py = y1 - y;
5860 POSITION px = x1 - x;
5863 POSITION ny = x2 - x1;
5864 POSITION nx = y1 - y2;
5867 POSITION pd = distance(y1, x1, y, x);
5868 POSITION nd = distance(y1, x1, y2, x2);
5870 if (pd > nd) return distance(y, x, y2, x2);
5872 /* Component of P on N */
5873 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
5875 /* Absolute value */
5876 return((nd >= 0) ? nd : 0 - nd);
5883 * Modified version of los() for calculation of disintegration balls.
5884 * Disintegration effects are stopped by permanent walls.
5886 bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
5888 POSITION dx, dy; /* Delta */
5889 POSITION ax, ay; /* Absolute */
5890 POSITION sx, sy; /* Signs */
5891 POSITION qx, qy; /* Fractions */
5892 POSITION tx, ty; /* Scanners */
5893 POSITION f1, f2; /* Scale factors */
5894 POSITION m; /* Slope, or 1/Slope, of LOS */
5896 /* Extract the offset */
5900 /* Extract the absolute offset */
5904 /* Handle adjacent (or identical) grids */
5905 if ((ax < 2) && (ay < 2)) return (TRUE);
5907 /* Paranoia -- require "safe" origin */
5908 /* if (!in_bounds(y1, x1)) return (FALSE); */
5910 /* Directly South/North */
5913 /* South -- check for walls */
5916 for (ty = y1 + 1; ty < y2; ty++)
5918 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5922 /* North -- check for walls */
5925 for (ty = y1 - 1; ty > y2; ty--)
5927 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5935 /* Directly East/West */
5938 /* East -- check for walls */
5941 for (tx = x1 + 1; tx < x2; tx++)
5943 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5947 /* West -- check for walls */
5950 for (tx = x1 - 1; tx > x2; tx--)
5952 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5960 /* Extract some signs */
5961 sx = (dx < 0) ? -1 : 1;
5962 sy = (dy < 0) ? -1 : 1;
5964 /* Vertical "knights" */
5969 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
5973 /* Horizontal "knights" */
5978 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
5982 /* Calculate scale factor div 2 */
5985 /* Calculate scale factor */
5989 /* Travel horizontally */
5992 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
5998 /* Consider the special case where slope == 1. */
6009 /* Note (below) the case (qy == f2), where */
6010 /* the LOS exactly meets the corner of a tile. */
6013 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6024 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6037 /* Travel vertically */
6040 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
6056 /* Note (below) the case (qx == f2), where */
6057 /* the LOS exactly meets the corner of a tile. */
6060 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6071 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6092 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)
6097 int brev = rad * rad / dist;
6101 int mdis = distance(y1, x1, y2, x2) + rad;
6103 while (bdis <= mdis)
6107 if ((0 < dist) && (path_n < dist))
6109 POSITION ny = GRID_Y(path_g[path_n]);
6110 POSITION nx = GRID_X(path_g[path_n]);
6111 POSITION nd = distance(ny, nx, y1, x1);
6113 /* Get next base point */
6122 /* Travel from center outward */
6123 for (cdis = 0; cdis <= brad; cdis++)
6125 /* Scan the maximal blast area of radius "cdis" */
6126 for (y = by - cdis; y <= by + cdis; y++)
6128 for (x = bx - cdis; x <= bx + cdis; x++)
6130 /* Ignore "illegal" locations */
6131 if (!in_bounds(y, x)) continue;
6133 /* Enforce a circular "ripple" */
6134 if (distance(y1, x1, y, x) != bdis) continue;
6136 /* Enforce an arc */
6137 if (distance(by, bx, y, x) != cdis) continue;
6143 /* Lights are stopped by opaque terrains */
6144 if (!los(by, bx, y, x)) continue;
6146 case GF_DISINTEGRATE:
6147 /* Disintegration are stopped only by perma-walls */
6148 if (!in_disintegration_range(by, bx, y, x)) continue;
6151 /* Ball explosions are stopped by walls */
6152 if (!projectable(by, bx, y, x)) continue;
6156 /* Save this grid */
6164 /* Encode some more "radius" info */
6165 gm[bdis + 1] = *pgrids;
6167 /* Increase the size */
6168 brad = rad * (path_n + brev) / (dist + brev);
6170 /* Find the next ripple */
6174 /* Store the effect size */
6180 * @brief 汎用的なビーム/ボルト/ボール系処理のルーチン Generic "beam"/"bolt"/"ball" projection routine.
6181 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
6182 * @param rad 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
6183 * @param y 目標Y座標 / Target y location (or location to travel "towards")
6184 * @param x 目標X座標 / Target x location (or location to travel "towards")
6185 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
6186 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
6187 * @param flg 効果フラグ / Extra bit flags (see PROJECT_xxxx in "defines.h")
6188 * @param monspell 効果元のモンスター魔法ID
6189 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
6192 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
6193 * towards a given location (optionally passing over the heads of interposing
6194 * monsters), and have it do a given amount of damage to the monsters (and
6195 * optionally objects) within the given radius of the final location.
6197 * A "bolt" travels from source to target and affects only the target grid.
6198 * A "beam" travels from source to target, affecting all grids passed through.
6199 * A "ball" travels from source to the target, exploding at the target, and
6200 * affecting everything within the given radius of the target location.
6202 * Traditionally, a "bolt" does not affect anything on the ground, and does
6203 * not pass over the heads of interposing monsters, much like a traditional
6204 * missile, and will "stop" abruptly at the "target" even if no monster is
6205 * positioned there, while a "ball", on the other hand, passes over the heads
6206 * of monsters between the source and target, and affects everything except
6207 * the source monster which lies within the final radius, while a "beam"
6208 * affects every monster between the source and target, except for the casting
6209 * monster (or player), and rarely affects things on the ground.
6211 * Two special flags allow us to use this function in special ways, the
6212 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
6213 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
6214 * actually projecting from the source monster (or player).
6216 * The player will only get "experience" for monsters killed by himself
6217 * Unique monsters can only be destroyed by attacks from the player
6219 * Only 256 grids can be affected per projection, limiting the effective
6220 * "radius" of standard ball attacks to nine units (diameter nineteen).
6222 * One can project in a given "direction" by combining PROJECT_THRU with small
6223 * offsets to the initial location (see "line_spell()"), or by calculating
6224 * "virtual targets" far away from the player.
6226 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
6227 * continuing until it actually hits somethings (useful for "stone to mud").
6229 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
6231 * Balls must explode BEFORE hitting walls, or they would affect monsters
6232 * on both sides of a wall. Some bug reports indicate that this is still
6233 * happening in 2.7.8 for Windows, though it appears to be impossible.
6235 * We "pre-calculate" the blast area only in part for efficiency.
6236 * More importantly, this lets us do "explosions" from the "inside" out.
6237 * This results in a more logical distribution of "blast" treasure.
6238 * It also produces a better (in my opinion) animation of the explosion.
6239 * It could be (but is not) used to have the treasure dropped by monsters
6240 * in the middle of the explosion fall "outwards", and then be damaged by
6241 * the blast as it spreads outwards towards the treasure drop location.
6243 * Walls and doors are included in the blast area, so that they can be
6244 * "burned" or "melted" in later versions.
6246 * This algorithm is intended to maximize simplicity, not necessarily
6247 * efficiency, since this function is not a bottleneck in the code.
6249 * We apply the blast effect from ground zero outwards, in several passes,
6250 * first affecting features, then objects, then monsters, then the player.
6251 * This allows walls to be removed before checking the object or monster
6252 * in the wall, and protects objects which are dropped by monsters killed
6253 * in the blast, and allows the player to see all affects before he is
6254 * killed or teleported away. The semantics of this method are open to
6255 * various interpretations, but they seem to work well in practice.
6257 * We process the blast area from ground-zero outwards to allow for better
6258 * distribution of treasure dropped by monsters, and because it provides a
6259 * pleasing visual effect at low cost.
6261 * Note that the damage done by "ball" explosions decreases with distance.
6262 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
6264 * Notice the "napalm" effect of "beam" weapons. First they "project" to
6265 * the target, and then the damage "flows" along this beam of destruction.
6266 * The damage at every grid is the same as at the "center" of a "ball"
6267 * explosion, since the "beam" grids are treated as if they ARE at the
6268 * center of a "ball" explosion.
6270 * Currently, specifying "beam" plus "ball" means that locations which are
6271 * covered by the initial "beam", and also covered by the final "ball", except
6272 * for the final grid (the epicenter of the ball), will be "hit twice", once
6273 * by the initial beam, and once by the exploding ball. For the grid right
6274 * next to the epicenter, this results in 150% damage being done. The center
6275 * does not have this problem, for the same reason the final grid in a "beam"
6276 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
6277 * grids which are covered by the "ball" will NOT work, as then they will
6278 * receive LESS damage than they should. Do not combine "beam" with "ball".
6280 * The array "gy[],gx[]" with current size "grids" is used to hold the
6281 * collected locations of all grids in the "blast area" plus "beam path".
6283 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
6284 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
6285 * first blast grid (see above) with radius "N" from the blast center. Note
6286 * that only the first gm[1] grids in the blast area thus take full damage.
6287 * Also, note that gm[rad+1] is always equal to "grids", which is the total
6288 * number of blast grids.
6290 * Note that once the projection is complete, (y2,x2) holds the final location
6291 * of bolts/beams, and the "epicenter" of balls.
6293 * Note also that "rad" specifies the "inclusive" radius of projection blast,
6294 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
6295 * implementation of the "distance" function. Also, a bolt can be properly
6296 * viewed as a "ball" with a "rad" of "zero".
6298 * Note that if no "target" is reached before the beam/bolt/ball travels the
6299 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
6300 * may be relevant even for bolts, since they have a "1x1" mini-blast.
6302 * Note that for consistency, we "pretend" that the bolt actually takes "time"
6303 * to move from point A to point B, even if the player cannot see part of the
6304 * projection path. Note that in general, the player will *always* see part
6305 * of the path, since it either starts at the player or ends on the player.
6307 * Hack -- we assume that every "projection" is "self-illuminating".
6309 * Hack -- when only a single monster is affected, we automatically track
6310 * (and recall) that monster, unless "PROJECT_JUMP" is used.
6312 * Note that all projections now "explode" at their final destination, even
6313 * if they were being projected at a more distant destination. This means
6314 * that "ball" spells will *always* explode.
6316 * Note that we must call "handle_stuff()" after affecting terrain features
6317 * in the blast radius, in case the "illumination" of the grid was changed,
6318 * and "update_view()" and "update_monsters()" need to be called.
6321 bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
6331 POSITION y_saver, x_saver; /* For reflecting monsters */
6333 int msec = delay_factor * delay_factor * delay_factor;
6335 /* Assume the player sees nothing */
6336 bool notice = FALSE;
6338 /* Assume the player has seen nothing */
6339 bool visual = FALSE;
6341 /* Assume the player has seen no blast grids */
6344 /* Assume to be a normal ball spell */
6345 bool breath = FALSE;
6347 /* Is the player blind? */
6348 bool blind = (p_ptr->blind ? TRUE : FALSE);
6350 bool old_hide = FALSE;
6352 /* Number of grids in the "path" */
6355 /* Actual grids in the "path" */
6358 /* Number of grids in the "blast area" (including the "beam" path) */
6361 /* Coordinates of the affected grids */
6362 POSITION gx[1024], gy[1024];
6364 /* Encoded "radius" info (see above) */
6367 /* Actual radius encoded in gm[] */
6368 POSITION gm_rad = rad;
6372 /* Attacker's name (prepared before polymorph)*/
6373 GAME_TEXT who_name[MAX_NLEN];
6375 /* Can the player see the source of this effect? */
6376 bool see_s_msg = TRUE;
6378 /* Initialize by null string */
6384 /* Default target of monsterspell is player */
6385 monster_target_y = p_ptr->y;
6386 monster_target_x = p_ptr->x;
6388 /* Hack -- Jump to target */
6389 if (flg & (PROJECT_JUMP))
6394 /* Clear the flag */
6395 flg &= ~(PROJECT_JUMP);
6400 /* Start at player */
6407 /* Start at monster */
6410 x1 = m_list[who].fx;
6411 y1 = m_list[who].fy;
6412 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
6424 /* Default "destination" */
6429 /* Hack -- verify stuff */
6430 if (flg & (PROJECT_THRU))
6432 if ((x1 == x2) && (y1 == y2))
6434 flg &= ~(PROJECT_THRU);
6438 /* Handle a breath attack */
6443 if (flg & PROJECT_HIDE) old_hide = TRUE;
6444 flg |= PROJECT_HIDE;
6448 /* Hack -- Assume there will be no blast (max radius 32) */
6449 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
6457 /* Collect beam grids */
6458 if (flg & (PROJECT_BEAM))
6469 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
6471 case GF_DISINTEGRATE:
6472 flg |= (PROJECT_GRID);
6473 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
6477 /* Calculate the projection path */
6479 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
6482 /* Giga-Hack SEEKER & SUPER_RAY */
6484 if( typ == GF_SEEKER )
6494 for (i = 0; i < path_n; ++i)
6499 int ny = GRID_Y(path_g[i]);
6500 int nx = GRID_X(path_g[i]);
6511 /* Only do visuals if requested */
6512 if (!blind && !(flg & (PROJECT_HIDE)))
6514 /* Only do visuals if the player can "see" the bolt */
6515 if (panel_contains(y, x) && player_has_los_bold(y, x))
6522 /* Obtain the bolt pict */
6523 p = bolt_pict(oy, ox, y, x, typ);
6525 /* Extract attr/char */
6529 /* Visual effects */
6530 print_rel(c, a, y, x);
6531 move_cursor_relative(y, x);
6532 /*if (fresh_before)*/ Term_fresh();
6533 Term_xtra(TERM_XTRA_DELAY, msec);
6535 /*if (fresh_before)*/ Term_fresh();
6537 /* Display "beam" grids */
6538 if (flg & (PROJECT_BEAM))
6540 /* Obtain the explosion pict */
6541 p = bolt_pict(y, x, y, x, typ);
6543 /* Extract attr/char */
6547 /* Visual effects */
6548 print_rel(c, a, y, x);
6551 /* Hack -- Activate delay */
6555 /* Hack -- delay anyway for consistency */
6558 /* Delay for consistency */
6559 Term_xtra(TERM_XTRA_DELAY, msec);
6562 if (project_o(0, 0, y, x, dam, GF_SEEKER))notice = TRUE;
6563 if (is_mirror_grid(&cave[y][x]))
6565 /* The target of monsterspell becomes tha mirror(broken) */
6566 monster_target_y = y;
6567 monster_target_x = x;
6569 remove_mirror(y, x);
6570 next_mirror(&oy, &ox, y, x);
6572 path_n = i + project_path(&(path_g[i + 1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
6573 for (j = last_i; j <= i; j++)
6575 y = GRID_Y(path_g[j]);
6576 x = GRID_X(path_g[j]);
6577 if (project_m(0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
6578 if (!who && (project_m_n == 1) && !jump) {
6579 if (cave[project_m_y][project_m_x].m_idx > 0) {
6580 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
6584 /* Hack -- auto-recall */
6585 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6587 /* Hack - auto-track */
6588 health_track(cave[project_m_y][project_m_x].m_idx);
6592 (void)project_f(0, 0, y, x, dam, GF_SEEKER);
6597 for(i = last_i ; i < path_n ; i++)
6600 py = GRID_Y(path_g[i]);
6601 px = GRID_X(path_g[i]);
6602 if (project_m(0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
6604 if (!who && (project_m_n == 1) && !jump) {
6605 if (cave[project_m_y][project_m_x].m_idx > 0)
6607 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
6611 /* Hack -- auto-recall */
6612 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6614 /* Hack - auto-track */
6615 health_track(cave[project_m_y][project_m_x].m_idx);
6619 (void)project_f(0, 0, py, px, dam, GF_SEEKER);
6623 else if(typ == GF_SUPER_RAY){
6625 int second_step = 0;
6632 for (i = 0; i < path_n; ++i)
6637 POSITION ny = GRID_Y(path_g[i]);
6638 POSITION nx = GRID_X(path_g[i]);
6649 /* Only do visuals if requested */
6650 if (!blind && !(flg & (PROJECT_HIDE)))
6652 /* Only do visuals if the player can "see" the bolt */
6653 if (panel_contains(y, x) && player_has_los_bold(y, x))
6660 /* Obtain the bolt pict */
6661 p = bolt_pict(oy, ox, y, x, typ);
6663 /* Extract attr/char */
6667 /* Visual effects */
6668 print_rel(c, a, y, x);
6669 move_cursor_relative(y, x);
6670 /*if (fresh_before)*/ Term_fresh();
6671 Term_xtra(TERM_XTRA_DELAY, msec);
6673 /*if (fresh_before)*/ Term_fresh();
6675 /* Display "beam" grids */
6676 if (flg & (PROJECT_BEAM))
6678 /* Obtain the explosion pict */
6679 p = bolt_pict(y, x, y, x, typ);
6681 /* Extract attr/char */
6685 /* Visual effects */
6686 print_rel(c, a, y, x);
6689 /* Hack -- Activate delay */
6693 /* Hack -- delay anyway for consistency */
6696 /* Delay for consistency */
6697 Term_xtra(TERM_XTRA_DELAY, msec);
6700 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
6701 if (!cave_have_flag_bold(y, x, FF_PROJECT))
6703 if( second_step )continue;
6706 if( is_mirror_grid(&cave[y][x]) && !second_step )
6708 /* The target of monsterspell becomes tha mirror(broken) */
6709 monster_target_y=(s16b)y;
6710 monster_target_x=(s16b)x;
6713 for( j = 0; j <=i ; j++ )
6715 y = GRID_Y(path_g[j]);
6716 x = GRID_X(path_g[j]);
6717 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
6721 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
6722 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
6723 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, 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 , x+1, flg);
6726 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
6727 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
6728 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
6731 for( i = 0; i < path_n ; i++ )
6734 py = GRID_Y(path_g[i]);
6735 px = GRID_X(path_g[i]);
6736 (void)project_m(0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
6737 if(!who && (project_m_n == 1) && !jump){
6738 if(cave[project_m_y][project_m_x].m_idx >0 ){
6739 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
6743 /* Hack -- auto-recall */
6744 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6746 /* Hack - auto-track */
6747 health_track(cave[project_m_y][project_m_x].m_idx);
6751 (void)project_f(0, 0, py, px, dam, GF_SUPER_RAY);
6756 /* Project along the path */
6757 for (i = 0; i < path_n; ++i)
6762 POSITION ny = GRID_Y(path_g[i]);
6763 POSITION nx = GRID_X(path_g[i]);
6765 if (flg & PROJECT_DISI)
6767 /* Hack -- Balls explode before reaching walls */
6768 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
6770 else if (flg & PROJECT_LOS)
6772 /* Hack -- Balls explode before reaching walls */
6773 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
6777 /* Hack -- Balls explode before reaching walls */
6778 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
6785 /* Collect beam grids */
6786 if (flg & (PROJECT_BEAM))
6793 /* Only do visuals if requested */
6794 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
6796 /* Only do visuals if the player can "see" the bolt */
6797 if (panel_contains(y, x) && player_has_los_bold(y, x))
6804 /* Obtain the bolt pict */
6805 p = bolt_pict(oy, ox, y, x, typ);
6807 /* Extract attr/char */
6811 /* Visual effects */
6812 print_rel(c, a, y, x);
6813 move_cursor_relative(y, x);
6814 /*if (fresh_before)*/ Term_fresh();
6815 Term_xtra(TERM_XTRA_DELAY, msec);
6817 /*if (fresh_before)*/ Term_fresh();
6819 /* Display "beam" grids */
6820 if (flg & (PROJECT_BEAM))
6822 /* Obtain the explosion pict */
6823 p = bolt_pict(y, x, y, x, typ);
6825 /* Extract attr/char */
6829 /* Visual effects */
6830 print_rel(c, a, y, x);
6833 /* Hack -- Activate delay */
6837 /* Hack -- delay anyway for consistency */
6840 /* Delay for consistency */
6841 Term_xtra(TERM_XTRA_DELAY, msec);
6848 /* Save the "blast epicenter" */
6852 if (breath && !path_n)
6858 flg &= ~(PROJECT_HIDE);
6862 /* Start the "explosion" */
6865 /* Hack -- make sure beams get to "explode" */
6873 /* If we found a "target", explode there */
6874 if (dist <= MAX_RANGE)
6876 /* Mega-Hack -- remove the final "beam" grid */
6877 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
6880 * Create a conical breath attack
6891 flg &= ~(PROJECT_HIDE);
6893 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
6897 /* Determine the blast area, work from the inside out */
6898 for (dist = 0; dist <= rad; dist++)
6900 /* Scan the maximal blast area of radius "dist" */
6901 for (y = by - dist; y <= by + dist; y++)
6903 for (x = bx - dist; x <= bx + dist; x++)
6905 /* Ignore "illegal" locations */
6906 if (!in_bounds2(y, x)) continue;
6908 /* Enforce a "circular" explosion */
6909 if (distance(by, bx, y, x) != dist) continue;
6915 /* Lights are stopped by opaque terrains */
6916 if (!los(by, bx, y, x)) continue;
6918 case GF_DISINTEGRATE:
6919 /* Disintegration are stopped only by perma-walls */
6920 if (!in_disintegration_range(by, bx, y, x)) continue;
6923 /* Ball explosions are stopped by walls */
6924 if (!projectable(by, bx, y, x)) continue;
6928 /* Save this grid */
6935 /* Encode some more "radius" info */
6941 /* Speed -- ignore "non-explosions" */
6942 if (!grids) return (FALSE);
6945 /* Display the "blast area" if requested */
6946 if (!blind && !(flg & (PROJECT_HIDE)))
6948 /* Then do the "blast", from inside out */
6949 for (t = 0; t <= gm_rad; t++)
6951 /* Dump everything with this radius */
6952 for (i = gm[t]; i < gm[t+1]; i++)
6954 /* Extract the location */
6958 /* Only do visuals if the player can "see" the blast */
6959 if (panel_contains(y, x) && player_has_los_bold(y, x))
6968 /* Obtain the explosion pict */
6969 p = bolt_pict(y, x, y, x, typ);
6971 /* Extract attr/char */
6975 /* Visual effects -- Display */
6976 print_rel(c, a, y, x);
6980 /* Hack -- center the cursor */
6981 move_cursor_relative(by, bx);
6983 /* Flush each "radius" seperately */
6984 /*if (fresh_before)*/ Term_fresh();
6986 /* Delay (efficiently) */
6987 if (visual || drawn)
6989 Term_xtra(TERM_XTRA_DELAY, msec);
6993 /* Flush the erasing */
6996 /* Erase the explosion drawn above */
6997 for (i = 0; i < grids; i++)
6999 /* Extract the location */
7003 /* Hack -- Erase if needed */
7004 if (panel_contains(y, x) && player_has_los_bold(y, x))
7010 /* Hack -- center the cursor */
7011 move_cursor_relative(by, bx);
7013 /* Flush the explosion */
7014 /*if (fresh_before)*/ Term_fresh();
7018 update_creature(p_ptr);
7020 if (flg & PROJECT_KILL)
7022 see_s_msg = (who > 0) ? is_seen(&m_list[who]) :
7023 (!who ? TRUE : (player_can_see_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)));
7027 /* Check features */
7028 if (flg & (PROJECT_GRID))
7030 /* Start with "dist" of zero */
7033 /* Scan for features */
7034 for (i = 0; i < grids; i++)
7036 /* Hack -- Notice new "dist" values */
7037 if (gm[dist+1] == i) dist++;
7039 /* Get the grid location */
7043 /* Find the closest point in the blast */
7046 int d = dist_to_line(y, x, y1, x1, by, bx);
7048 /* Affect the grid */
7049 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
7053 /* Affect the grid */
7054 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
7059 update_creature(p_ptr);
7062 if (flg & (PROJECT_ITEM))
7064 /* Start with "dist" of zero */
7067 /* Scan for objects */
7068 for (i = 0; i < grids; i++)
7070 /* Hack -- Notice new "dist" values */
7071 if (gm[dist+1] == i) dist++;
7073 /* Get the grid location */
7077 /* Find the closest point in the blast */
7080 int d = dist_to_line(y, x, y1, x1, by, bx);
7082 /* Affect the object in the grid */
7083 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
7087 /* Affect the object in the grid */
7088 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
7094 /* Check monsters */
7095 if (flg & (PROJECT_KILL))
7102 /* Start with "dist" of zero */
7105 /* Scan for monsters */
7106 for (i = 0; i < grids; i++)
7110 /* Hack -- Notice new "dist" values */
7111 if (gm[dist + 1] == i) dist++;
7113 /* Get the grid location */
7117 /* A single bolt may be reflected */
7120 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
7121 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
7123 if ((flg & PROJECT_REFLECTABLE) && cave[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
7124 ((cave[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
7125 (!who || dist_hack > 1) && !one_in_(10))
7128 int max_attempts = 10;
7130 /* Choose 'new' target */
7133 t_y = y_saver - 1 + randint1(3);
7134 t_x = x_saver - 1 + randint1(3);
7137 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
7139 if (max_attempts < 1)
7145 sound(SOUND_REFLECT);
7148 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
7149 msg_print(_("「北斗神拳奥義・二指真空把!」", "The attack bounces!"));
7150 else if (m_ptr->r_idx == MON_DIO)
7151 msg_print(_("ディオ・ブランドーは指一本で攻撃を弾き返した!", "The attack bounces!"));
7153 msg_print(_("攻撃は跳ね返った!", "The attack bounces!"));
7155 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
7157 /* Reflected bolts randomly target either one */
7158 if (player_bold(y, x) || one_in_(2)) flg &= ~(PROJECT_PLAYER);
7159 else flg |= PROJECT_PLAYER;
7161 /* The bolt is reflected */
7162 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
7164 /* Don't affect the monster any longer */
7170 /* Find the closest point in the blast */
7173 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
7177 effective_dist = dist;
7181 /* There is the riding player on this monster */
7182 if (p_ptr->riding && player_bold(y, x))
7184 /* Aimed on the player */
7185 if (flg & PROJECT_PLAYER)
7187 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
7190 * A beam or bolt is well aimed
7192 * So don't affects the mount.
7199 * The spell is not well aimed,
7200 * So partly affect the mount too.
7207 * This grid is the original target.
7208 * Or aimed on your horse.
7210 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
7212 /* Hit the mount with full damage */
7216 * Otherwise this grid is not the
7217 * original target, it means that line
7218 * of fire is obstructed by this
7222 * A beam or bolt will hit either
7223 * player or mount. Choose randomly.
7225 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
7229 /* Hit the mount with full damage */
7233 /* Hit the player later */
7234 flg |= PROJECT_PLAYER;
7236 /* Don't affect the mount */
7242 * The spell is not well aimed, so
7243 * partly affect both player and
7252 /* Affect the monster in the grid */
7253 if (project_m(who, effective_dist, y, x, dam, typ, flg, see_s_msg)) notice = TRUE;
7257 /* Player affected one monster (without "jumping") */
7258 if (!who && (project_m_n == 1) && !jump)
7263 /* Track if possible */
7264 if (cave[y][x].m_idx > 0)
7266 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
7270 /* Hack -- auto-recall */
7271 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
7273 /* Hack - auto-track */
7274 if (m_ptr->ml) health_track(cave[y][x].m_idx);
7282 if (flg & (PROJECT_KILL))
7284 /* Start with "dist" of zero */
7287 /* Scan for player */
7288 for (i = 0; i < grids; i++)
7292 /* Hack -- Notice new "dist" values */
7293 if (gm[dist+1] == i) dist++;
7295 /* Get the grid location */
7299 /* Affect the player? */
7300 if (!player_bold(y, x)) continue;
7302 /* Find the closest point in the blast */
7305 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
7309 effective_dist = dist;
7312 /* Target may be your horse */
7315 /* Aimed on the player */
7316 if (flg & PROJECT_PLAYER)
7318 /* Hit the player with full damage */
7322 * Hack -- When this grid was not the
7323 * original target, a beam or bolt
7324 * would hit either player or mount,
7325 * and should be choosen randomly.
7327 * But already choosen to hit the
7328 * mount at this point.
7330 * Or aimed on your horse.
7332 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
7335 * A beam or bolt is well aimed
7337 * So don't affects the player.
7344 * The spell is not well aimed,
7345 * So partly affect the player too.
7351 /* Affect the player */
7352 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
7358 GAME_TEXT m_name[MAX_NLEN];
7360 monster_desc(m_name, &m_list[p_ptr->riding], 0);
7362 if (rakubadam_m > 0)
7364 if (rakuba(rakubadam_m, FALSE))
7366 msg_format(_("%^sに振り落とされた!", "%^s has thrown you off!"), m_name);
7369 if (p_ptr->riding && rakubadam_p > 0)
7371 if(rakuba(rakubadam_p, FALSE))
7373 msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_name);
7378 /* Return "something was noticed" */
7383 * @brief 鏡魔法「封魔結界」の効果処理
7385 * @return 効果があったらTRUEを返す
7387 bool binding_field(HIT_POINT dam)
7389 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
7390 int mirror_num = 0; /* 鏡の数 */
7392 POSITION centersign;
7393 POSITION x1, x2, y1, y2;
7395 int msec = delay_factor*delay_factor*delay_factor;
7398 POSITION point_x[3];
7399 POSITION point_y[3];
7401 /* Default target of monsterspell is player */
7402 monster_target_y = p_ptr->y;
7403 monster_target_x = p_ptr->x;
7405 for (x = 0; x < cur_wid; x++)
7407 for (y = 0; y < cur_hgt; y++)
7409 if (is_mirror_grid(&cave[y][x]) &&
7410 distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
7411 distance(p_ptr->y, p_ptr->x, y, x) != 0 &&
7412 player_has_los_bold(y, x) &&
7413 projectable(p_ptr->y, p_ptr->x, y, x)
7415 mirror_y[mirror_num] = y;
7416 mirror_x[mirror_num] = x;
7422 if (mirror_num < 2)return FALSE;
7424 point_x[0] = randint0(mirror_num);
7426 point_x[1] = randint0(mirror_num);
7427 } while (point_x[0] == point_x[1]);
7429 point_y[0] = mirror_y[point_x[0]];
7430 point_x[0] = mirror_x[point_x[0]];
7431 point_y[1] = mirror_y[point_x[1]];
7432 point_x[1] = mirror_x[point_x[1]];
7433 point_y[2] = p_ptr->y;
7434 point_x[2] = p_ptr->x;
7436 x = point_x[0] + point_x[1] + point_x[2];
7437 y = point_y[0] + point_y[1] + point_y[2];
7439 centersign = (point_x[0] * 3 - x)*(point_y[1] * 3 - y)
7440 - (point_y[0] * 3 - y)*(point_x[1] * 3 - x);
7441 if (centersign == 0)return FALSE;
7443 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
7444 x1 = x1 < point_x[2] ? x1 : point_x[2];
7445 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
7446 y1 = y1 < point_y[2] ? y1 : point_y[2];
7448 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
7449 x2 = x2 > point_x[2] ? x2 : point_x[2];
7450 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
7451 y2 = y2 > point_y[2] ? y2 : point_y[2];
7453 for (y = y1; y <= y2; y++) {
7454 for (x = x1; x <= x2; x++) {
7455 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7456 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7457 centersign*((point_x[1] - x)*(point_y[2] - y)
7458 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7459 centersign*((point_x[2] - x)*(point_y[0] - y)
7460 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7462 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7463 /* Visual effects */
7465 && panel_contains(y, x)) {
7466 p = bolt_pict(y, x, y, x, GF_MANA);
7467 print_rel(PICT_C(p), PICT_A(p), y, x);
7468 move_cursor_relative(y, x);
7469 /*if (fresh_before)*/ Term_fresh();
7470 Term_xtra(TERM_XTRA_DELAY, msec);
7476 for (y = y1; y <= y2; y++) {
7477 for (x = x1; x <= x2; x++) {
7478 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7479 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7480 centersign*((point_x[1] - x)*(point_y[2] - y)
7481 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7482 centersign*((point_x[2] - x)*(point_y[0] - y)
7483 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7485 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7486 (void)project_f(0, 0, y, x, dam, GF_MANA);
7491 for (y = y1; y <= y2; y++) {
7492 for (x = x1; x <= x2; x++) {
7493 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7494 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7495 centersign*((point_x[1] - x)*(point_y[2] - y)
7496 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7497 centersign*((point_x[2] - x)*(point_y[0] - y)
7498 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7500 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7501 (void)project_o(0, 0, y, x, dam, GF_MANA);
7506 for (y = y1; y <= y2; y++) {
7507 for (x = x1; x <= x2; x++) {
7508 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7509 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7510 centersign*((point_x[1] - x)*(point_y[2] - y)
7511 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7512 centersign*((point_x[2] - x)*(point_y[0] - y)
7513 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7515 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7516 (void)project_m(0, 0, y, x, dam, GF_MANA,
7517 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE);
7523 msg_print(_("鏡が結界に耐えきれず、壊れてしまった。", "The field broke a mirror"));
7524 remove_mirror(point_y[0], point_x[0]);
7531 * @brief 鏡魔法「鏡の封印」の効果処理
7533 * @return 効果があったらTRUEを返す
7535 void seal_of_mirror(HIT_POINT dam)
7539 for (x = 0; x < cur_wid; x++)
7541 for (y = 0; y < cur_hgt; y++)
7543 if (is_mirror_grid(&cave[y][x]))
7545 if (project_m(0, 0, y, x, dam, GF_GENOCIDE,
7546 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE))
7548 if (!cave[y][x].m_idx)
7550 remove_mirror(y, x);