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 "monster-spell.h"
23 #include "spells-status.h"
24 #include "spells-diceroll.h"
25 #include "spells-summon.h"
26 #include "monsterrace-hook.h"
30 #include "projection.h"
35 #include "player-status.h"
36 #include "player-move.h"
37 #include "realm-hex.h"
38 #include "object-hook.h"
39 #include "object-broken.h"
45 static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
46 static int rakubadam_p; /*!< 落馬した際のダメージ量 */
48 int project_length = 0; /*!< 投射の射程距離 */
53 * @brief 配置した鏡リストの次を取得する /
54 * Get another mirror. for SEEKER
55 * @param next_y 次の鏡のy座標を返す参照ポインタ
56 * @param next_x 次の鏡のx座標を返す参照ポインタ
57 * @param cury 現在の鏡のy座標
58 * @param curx 現在の鏡のx座標
60 static void next_mirror(POSITION* next_y, POSITION* next_x, POSITION cury, POSITION curx)
62 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
63 int mirror_num = 0; /* 鏡の数 */
67 for (x = 0; x < current_floor_ptr->width; x++)
69 for (y = 0; y < current_floor_ptr->height; y++)
71 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x])) {
72 mirror_y[mirror_num] = y;
73 mirror_x[mirror_num] = x;
80 num = randint0(mirror_num);
81 *next_y = mirror_y[num];
82 *next_x = mirror_x[num];
85 *next_y = cury + randint0(5) - 2;
86 *next_x = curx + randint0(5) - 2;
92 * Mega-Hack -- track "affected" monsters (see "project()" comments)
94 static int project_m_n; /*!< 魔法効果範囲内にいるモンスターの数 */
95 static POSITION project_m_x; /*!< 処理中のモンスターX座標 */
96 static POSITION project_m_y; /*!< 処理中のモンスターY座標 */
97 /* Mega-Hack -- monsters target */
98 static POSITION monster_target_x; /*!< モンスターの攻撃目標X座標 */
99 static POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
103 * @brief 汎用的なビーム/ボルト/ボール系による地形効果処理 / We are called from "project()" to "damage" terrain features
104 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
105 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
106 * @param y 目標Y座標 / Target y location (or location to travel "towards")
107 * @param x 目標X座標 / Target x location (or location to travel "towards")
108 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
109 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
110 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
113 * We are called both for "beam" effects and "ball" effects.
115 * The "r" parameter is the "distance from ground zero".
117 * Note that we determine if the player can "see" anything that happens
118 * by taking into account: blindness, line-of-sight, and illumination.
120 * We return "TRUE" if the effect of the projection is "obvious".
122 * We also "see" grids which are "memorized", probably a hack
124 * Perhaps we should affect doors?
127 static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
129 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
130 feature_type *f_ptr = &f_info[g_ptr->feat];
132 bool obvious = FALSE;
133 bool known = player_has_los_bold(y, x);
138 /* Reduce damage by distance */
139 dam = (dam + r) / (r + 1);
142 if (have_flag(f_ptr->flags, FF_TREE))
150 message = _("枯れた", "was blasted."); break;
152 message = _("縮んだ", "shrank."); break;
154 message = _("溶けた", "melted."); break;
157 message = _("凍り、砕け散った", "was frozen and smashed."); break;
161 message = _("燃えた", "burns up!"); break;
173 message = _("粉砕された", "was crushed."); break;
175 message = NULL; break;
179 msg_format(_("木は%s。", "A tree %s"), message);
180 cave_set_feat(y, x, one_in_(3) ? feat_brake : feat_grass);
183 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
187 /* Analyze the type */
190 /* Ignore most effects */
225 /* Destroy Traps (and Locks) */
228 /* Reveal secret doors */
229 if (is_hidden_door(g_ptr))
234 /* Check line of sight */
242 if (is_trap(g_ptr->feat))
244 /* Check line of sight */
247 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
251 /* Destroy the trap */
252 cave_alter_feat(y, x, FF_DISARM);
255 /* Locked doors are unlocked */
256 if (is_closed_door(g_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
258 FEAT_IDX old_feat = g_ptr->feat;
260 /* Unlock the door */
261 cave_alter_feat(y, x, FF_DISARM);
263 /* Check line of sound */
264 if (known && (old_feat != g_ptr->feat))
266 msg_print(_("カチッと音がした!", "Click!"));
271 /* Remove "unsafe" flag if player is not blind */
272 if (!p_ptr->blind && player_has_los_bold(y, x))
274 g_ptr->info &= ~(CAVE_UNSAFE);
282 /* Destroy Doors (and traps) */
285 /* Destroy all doors and traps */
286 if (is_trap(g_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
288 /* Check line of sight */
291 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
295 /* Destroy the feature */
296 cave_alter_feat(y, x, FF_TUNNEL);
299 /* Remove "unsafe" flag if player is not blind */
300 if (!p_ptr->blind && player_has_los_bold(y, x))
302 g_ptr->info &= ~(CAVE_UNSAFE);
310 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
312 if (have_flag(f_ptr->flags, FF_SPIKE))
314 s16b old_mimic = g_ptr->mimic;
315 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)];
317 cave_alter_feat(y, x, FF_SPIKE);
318 g_ptr->mimic = old_mimic;
323 /* Check line of sight */
324 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
326 msg_format(_("%sに何かがつっかえて開かなくなった。", "The %s seems stuck."), f_name + mimic_f_ptr->name);
333 /* Destroy walls (and doors) */
336 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
338 if (known && (g_ptr->info & (CAVE_MARK)))
340 msg_format(_("%sが溶けて泥になった!", "The %s turns into mud!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
344 /* Destroy the wall */
345 cave_alter_feat(y, x, FF_HURT_ROCK);
346 p_ptr->update |= (PU_FLOW);
354 if (!cave_naked_bold(y, x)) break;
355 if (player_bold(y, x)) break;
356 cave_set_feat(y, x, feat_door[DOOR_DOOR].closed);
357 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
369 if (!cave_naked_bold(y, x)) break;
370 if (player_bold(y, x)) break;
371 cave_set_feat(y, x, feat_tree);
372 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
378 if (!cave_naked_bold(y, x)) break;
379 g_ptr->info |= CAVE_OBJECT;
380 g_ptr->mimic = feat_glyph;
388 if (!cave_naked_bold(y, x)) break;
389 if (player_bold(y, x)) break;
390 cave_set_feat(y, x, feat_granite);
396 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
399 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
400 cave_set_feat(y, x, feat_shallow_lava);
404 cave_set_feat(y, x, feat_deep_lava);
411 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
414 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
415 cave_set_feat(y, x, feat_shallow_water);
419 cave_set_feat(y, x, feat_deep_water);
424 /* Lite up the grid */
428 /* Turn on the light */
429 if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
431 g_ptr->info |= (CAVE_GLOW);
434 update_local_illumination(y, x);
437 if (player_can_see_bold(y, x)) obvious = TRUE;
439 /* Mega-Hack -- Update the monster in the affected grid */
440 /* This allows "spear of light" (etc) to work "correctly" */
441 if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE);
443 if (p_ptr->special_defense & NINJA_S_STEALTH)
445 if (player_bold(y, x)) set_superstealth(FALSE);
452 /* Darken the grid */
456 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(g_ptr);
459 /* Turn off the light. */
462 if (current_floor_ptr->dun_level || !is_daytime())
464 for (j = 0; j < 9; j++)
466 int by = y + ddy_ddd[j];
467 int bx = x + ddx_ddd[j];
469 if (in_bounds2(by, bx))
471 grid_type *cc_ptr = ¤t_floor_ptr->grid_array[by][bx];
473 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
484 g_ptr->info &= ~(CAVE_GLOW);
486 /* Hack -- Forget "boring" grids */
487 if (!have_flag(f_ptr->flags, FF_REMEMBER))
490 g_ptr->info &= ~(CAVE_MARK);
497 update_local_illumination(y, x);
499 if (player_can_see_bold(y, x)) obvious = TRUE;
501 /* Mega-Hack -- Update the monster in the affected grid */
502 /* This allows "spear of light" (etc) to work "correctly" */
503 if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE);
513 if (is_mirror_grid(g_ptr))
515 msg_print(_("鏡が割れた!", "The mirror was shattered!"));
518 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
521 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 50))
523 if (known && (g_ptr->info & CAVE_MARK))
525 msg_format(_("%sが割れた!", "The %s crumbled!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
529 /* Destroy the wall */
530 cave_alter_feat(y, x, FF_HURT_ROCK);
531 p_ptr->update |= (PU_FLOW);
538 if (is_mirror_grid(g_ptr) && p_ptr->lev < 40)
540 msg_print(_("鏡が割れた!", "The mirror was shattered!"));
543 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
546 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 200))
548 if (known && (g_ptr->info & CAVE_MARK))
550 msg_format(_("%sが割れた!", "The %s crumbled!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
554 /* Destroy the wall */
555 cave_alter_feat(y, x, FF_HURT_ROCK);
556 p_ptr->update |= (PU_FLOW);
561 case GF_DISINTEGRATE:
563 /* Destroy mirror/glyph */
564 if (is_mirror_grid(g_ptr) || is_glyph_grid(g_ptr) || is_explosive_rune_grid(g_ptr))
567 /* Permanent features don't get effect */
568 /* But not protect monsters and other objects */
569 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
571 cave_alter_feat(y, x, FF_HURT_DISI);
573 /* Update some things -- similar to GF_KILL_WALL */
574 p_ptr->update |= (PU_FLOW);
581 /* Return "Anything seen?" */
588 * @brief 汎用的なビーム/ボルト/ボール系によるアイテムオブジェクトへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
589 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
590 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
591 * @param y 目標Y座標 / Target y location (or location to travel "towards")
592 * @param x 目標X座標 / Target x location (or location to travel "towards")
593 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
594 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
595 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
598 * We are called from "project()" to "damage" objects
600 * We are called both for "beam" effects and "ball" effects.
602 * Perhaps we should only SOMETIMES damage things on the ground.
604 * The "r" parameter is the "distance from ground zero".
606 * Note that we determine if the player can "see" anything that happens
607 * by taking into account: blindness, line-of-sight, and illumination.
609 * We also "see" grids which are "memorized", probably a hack
611 * We return "TRUE" if the effect of the projection is "obvious".
614 static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
616 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
618 OBJECT_IDX this_o_idx, next_o_idx = 0;
620 bool obvious = FALSE;
621 bool known = player_has_los_bold(y, x);
623 BIT_FLAGS flgs[TR_FLAG_SIZE];
625 GAME_TEXT o_name[MAX_NLEN];
627 KIND_OBJECT_IDX k_idx = 0;
628 bool is_potion = FALSE;
633 /* Reduce damage by distance */
634 dam = (dam + r) / (r + 1);
637 /* Scan all objects in the grid */
638 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
640 object_type *o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
644 bool do_kill = FALSE;
646 concptr note_kill = NULL;
649 /* Get the "plural"-ness */
650 bool plural = (o_ptr->number > 1);
652 next_o_idx = o_ptr->next_o_idx;
653 object_flags(o_ptr, flgs);
655 /* Check for artifact */
656 if (object_is_artifact(o_ptr)) is_art = TRUE;
658 /* Analyze the type */
661 /* Acid -- Lots of things */
664 if (hates_acid(o_ptr))
667 note_kill = _("融けてしまった!", (plural ? " melt!" : " melts!"));
668 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
673 /* Elec -- Rings and Wands */
676 if (hates_elec(o_ptr))
679 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
680 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
685 /* Fire -- Flammable objects */
688 if (hates_fire(o_ptr))
691 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
692 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
697 /* Cold -- potions and flasks */
700 if (hates_cold(o_ptr))
702 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
704 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
712 if (hates_fire(o_ptr))
715 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
716 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
718 if (hates_elec(o_ptr))
722 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
723 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
731 if (hates_fire(o_ptr))
734 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
735 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
737 if (hates_cold(o_ptr))
741 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
742 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
747 /* Hack -- break potions and such */
753 if (hates_cold(o_ptr))
755 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
761 /* Mana and Chaos -- destroy everything */
767 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
771 case GF_DISINTEGRATE:
774 note_kill = _("蒸発してしまった!", (plural ? " evaporate!" : " evaporates!"));
781 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
782 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
783 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
787 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
791 if (object_is_cursed(o_ptr))
794 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
801 identify_item(o_ptr);
803 /* Auto-inscription */
804 autopick_alter_item((-this_o_idx), FALSE);
812 /* Chests are noticed only if trapped or locked */
813 if (o_ptr->tval == TV_CHEST)
815 /* Disarm/Unlock traps */
818 /* Disarm or Unlock */
819 o_ptr->pval = (0 - o_ptr->pval);
824 if (known && (o_ptr->marked & OM_FOUND))
826 msg_print(_("カチッと音がした!", "Click!"));
836 if (o_ptr->tval == TV_CORPSE)
841 if (!who || is_pet(¤t_floor_ptr->m_list[who]))
842 mode |= PM_FORCE_PET;
844 for (i = 0; i < o_ptr->number ; i++)
846 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
847 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
851 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
855 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
857 note_kill = _("生き返った。", " revived.");
861 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
872 /* Attempt to destroy the object */
875 /* Effect "observed" */
876 if (known && (o_ptr->marked & OM_FOUND))
879 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
882 /* Artifacts, and other objects, get to resist */
883 if (is_art || ignore)
885 /* Observe the resist */
886 if (known && (o_ptr->marked & OM_FOUND))
888 msg_format(_("%sは影響を受けない!",
889 (plural ? "The %s are unaffected!" : "The %s is unaffected!")), o_name);
896 /* Describe if needed */
897 if (known && (o_ptr->marked & OM_FOUND) && note_kill)
899 msg_format(_("%sは%s", "The %s%s"), o_name, note_kill);
902 k_idx = o_ptr->k_idx;
903 is_potion = object_is_potion(o_ptr);
904 delete_object_idx(this_o_idx);
906 /* Potions produce effects when 'shattered' */
909 (void)potion_smash_effect(who, y, x, k_idx);
917 /* Return "Anything seen?" */
923 * @brief 汎用的なビーム/ボルト/ボール系によるモンスターへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
924 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
925 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
926 * @param y 目標Y座標 / Target y location (or location to travel "towards")
927 * @param x 目標X座標 / Target x location (or location to travel "towards")
928 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
929 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
931 * @param see_s_msg TRUEならばメッセージを表示する
932 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
935 * This routine takes a "source monster" (by index) which is mostly used to
936 * determine if the player is causing the damage, and a "radius" (see below),
937 * which is used to decrease the power of explosions with distance, and a
938 * location, via integers which are modified by certain types of attacks
939 * (polymorph and teleport being the obvious ones), a default damage, which
940 * is modified as needed based on various properties, and finally a "damage
944 * Note that this routine can handle "no damage" attacks (like teleport) by
945 * taking a "zero" damage, and can even take "parameters" to attacks (like
946 * confuse) by accepting a "damage", using it to calculate the effect, and
947 * then setting the damage to zero. Note that the "damage" parameter is
948 * divided by the radius, so monsters not at the "epicenter" will not take
949 * as much damage (or whatever)...
952 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
953 * may result in a dereference of an invalid pointer.
956 * Various messages are produced, and damage is applied.
959 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
960 * actually be "made" of that substance, or "breathe" big balls of it.
961 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
963 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
964 * and hurts evil less. If can breath nether, then it resists it as well.
967 * Damage reductions use the following formulas:
968 * Note that "dam = dam * 6 / (randint1(6) + 6);"
969 * gives avg damage of .655, ranging from .858 to .500
970 * Note that "dam = dam * 5 / (randint1(6) + 6);"
971 * gives avg damage of .544, ranging from .714 to .417
972 * Note that "dam = dam * 4 / (randint1(6) + 6);"
973 * gives avg damage of .444, ranging from .556 to .333
974 * Note that "dam = dam * 3 / (randint1(6) + 6);"
975 * gives avg damage of .327, ranging from .427 to .250
976 * Note that "dam = dam * 2 / (randint1(6) + 6);"
977 * gives something simple.
980 * In this function, "result" messages are postponed until the end, where
981 * the "note" string is appended to the monster name, if not NULL. So,
982 * to make a spell have "no effect" just set "note" to NULL. You should
983 * also set "notice" to FALSE, or the player will learn what the spell does.
986 * We attempt to return "TRUE" if the player saw anything "useful" happen.
990 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)
994 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
996 monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
997 monster_type *caster_ptr = (who > 0) ? ¤t_floor_ptr->m_list[who] : NULL;
999 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1003 /* Is the monster "seen"? */
1004 bool seen = m_ptr->ml;
1005 bool seen_msg = is_seen(m_ptr);
1007 bool slept = (bool)MON_CSLEEP(m_ptr);
1009 /* Were the effects "obvious" (if seen)? */
1010 bool obvious = FALSE;
1012 /* Can the player know about this effect? */
1013 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1015 /* Were the effects "irrelevant"? */
1016 bool skipped = FALSE;
1018 /* Gets the monster angry at the source of the effect? */
1019 bool get_angry = FALSE;
1021 /* Polymorph setting (true or false) */
1022 bool do_poly = FALSE;
1024 /* Teleport setting (max distance) */
1027 /* Confusion setting (amount to confuse) */
1030 /* Stunning setting (amount to stun) */
1033 /* Sleep amount (amount to sleep) */
1036 /* Fear amount (amount to fear) */
1039 /* Time amount (amount to time) */
1042 bool heal_leper = FALSE;
1044 /* Hold the monster name */
1045 GAME_TEXT m_name[MAX_NLEN];
1048 PARAMETER_VALUE photo = 0;
1050 /* Assume no note */
1051 concptr note = NULL;
1053 /* Assume a default death */
1054 concptr note_dies = extract_note_dies(real_r_idx(m_ptr));
1056 DEPTH caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1059 if (!g_ptr->m_idx) return (FALSE);
1061 /* Never affect projector */
1062 if (who && (g_ptr->m_idx == who)) return (FALSE);
1063 if ((g_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1064 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1066 /* Don't affect already death monsters */
1067 /* Prevents problems with chain reactions of exploding monsters */
1068 if (m_ptr->hp < 0) return (FALSE);
1070 /* Reduce damage by distance */
1071 dam = (dam + r) / (r + 1);
1074 /* Get the monster name (BEFORE polymorphing) */
1075 monster_desc(m_name, m_ptr, 0);
1077 /* Get the monster possessive ("his"/"her"/"its") */
1078 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1080 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
1082 if (r_ptr->flagsr & RFR_RES_ALL &&
1083 typ != GF_OLD_CLONE && typ != GF_STAR_HEAL && typ != GF_OLD_HEAL
1084 && typ != GF_OLD_SPEED && typ != GF_CAPTURE && typ != GF_PHOTO)
1086 note = _("には完全な耐性がある!", " is immune.");
1088 if(is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1089 if(typ == GF_LITE_WEAK || typ == GF_KILL_WALL) skipped = TRUE;
1093 /* Analyze the damage type */
1096 /* Magic Missile -- pure damage */
1099 if (seen) obvious = TRUE;
1106 if (seen) obvious = TRUE;
1107 if (r_ptr->flagsr & RFR_IM_ACID)
1109 note = _("にはかなり耐性がある!", " resists a lot.");
1111 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1119 if (seen) obvious = TRUE;
1120 if (r_ptr->flagsr & RFR_IM_ELEC)
1122 note = _("にはかなり耐性がある!", " resists a lot.");
1124 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1132 if (seen) obvious = TRUE;
1133 if (r_ptr->flagsr & RFR_IM_FIRE)
1135 note = _("にはかなり耐性がある!", " resists a lot.");
1137 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1139 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1141 note = _("はひどい痛手をうけた。", " is hit hard.");
1143 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1151 if (seen) obvious = TRUE;
1152 if (r_ptr->flagsr & RFR_IM_COLD)
1154 note = _("にはかなり耐性がある!", " resists a lot.");
1156 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1158 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1160 note = _("はひどい痛手をうけた。", " is hit hard.");
1162 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1170 if (seen) obvious = TRUE;
1171 if (r_ptr->flagsr & RFR_IM_POIS)
1173 note = _("にはかなり耐性がある!", " resists a lot.");
1175 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1183 if (seen) obvious = TRUE;
1184 if (r_ptr->flagsr & RFR_IM_POIS)
1186 note = _("には耐性がある。", " resists.");
1187 dam *= 3; dam /= randint1(6) + 6;
1188 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1190 else if (one_in_(3)) do_poly = TRUE;
1194 /* Hellfire -- hurts Evil */
1197 if (seen) obvious = TRUE;
1198 if (r_ptr->flags3 & RF3_GOOD)
1200 note = _("はひどい痛手をうけた。", " is hit hard.");
1202 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1207 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1210 if (seen) obvious = TRUE;
1211 if (r_ptr->flags3 & RF3_EVIL)
1214 note = _("はひどい痛手をうけた。", " is hit hard.");
1215 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
1219 note = _("には耐性がある。", " resists.");
1220 dam *= 3; dam /= randint1(6) + 6;
1225 /* Arrow -- XXX no defense */
1228 if (seen) obvious = TRUE;
1232 /* Plasma -- XXX perhaps check ELEC or FIRE */
1235 if (seen) obvious = TRUE;
1236 if (r_ptr->flagsr & RFR_RES_PLAS)
1238 note = _("には耐性がある。", " resists.");
1239 dam *= 3; dam /= randint1(6) + 6;
1240 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
1245 /* Nether -- see above */
1248 if (seen) obvious = TRUE;
1249 if (r_ptr->flagsr & RFR_RES_NETH)
1251 if (r_ptr->flags3 & RF3_UNDEAD)
1253 note = _("には完全な耐性がある!", " is immune.");
1255 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
1259 note = _("には耐性がある。", " resists.");
1260 dam *= 3; dam /= randint1(6) + 6;
1262 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
1264 else if (r_ptr->flags3 & RF3_EVIL)
1266 note = _("はいくらか耐性を示した。", " resists somewhat.");
1268 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
1273 /* Water (acid) damage -- Water spirits/elementals are immune */
1276 if (seen) obvious = TRUE;
1277 if (r_ptr->flagsr & RFR_RES_WATE)
1279 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
1281 note = _("には完全な耐性がある!", " is immune.");
1286 note = _("には耐性がある。", " resists.");
1287 dam *= 3; dam /= randint1(6) + 6;
1289 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
1294 /* Chaos -- Chaos breathers resist */
1297 if (seen) obvious = TRUE;
1298 if (r_ptr->flagsr & RFR_RES_CHAO)
1300 note = _("には耐性がある。", " resists.");
1301 dam *= 3; dam /= randint1(6) + 6;
1302 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
1304 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
1306 note = _("はいくらか耐性を示した。", " resists somewhat.");
1307 dam *= 3; dam /= randint1(6) + 6;
1308 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
1313 do_conf = (5 + randint1(11) + r) / (r + 1);
1318 /* Shards -- Shard breathers resist */
1321 if (seen) obvious = TRUE;
1322 if (r_ptr->flagsr & RFR_RES_SHAR)
1324 note = _("には耐性がある。", " resists.");
1325 dam *= 3; dam /= randint1(6) + 6;
1326 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1331 /* Rocket: Shard resistance helps */
1334 if (seen) obvious = TRUE;
1335 if (r_ptr->flagsr & RFR_RES_SHAR)
1337 note = _("はいくらか耐性を示した。", " resists somewhat.");
1339 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1345 /* Sound -- Sound breathers resist */
1348 if (seen) obvious = TRUE;
1349 if (r_ptr->flagsr & RFR_RES_SOUN)
1351 note = _("には耐性がある。", " resists.");
1352 dam *= 2; dam /= randint1(6) + 6;
1353 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
1355 else do_stun = (10 + randint1(15) + r) / (r + 1);
1362 if (seen) obvious = TRUE;
1363 if (r_ptr->flags3 & RF3_NO_CONF)
1365 note = _("には耐性がある。", " resists.");
1366 dam *= 3; dam /= randint1(6) + 6;
1367 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1369 else do_conf = (10 + randint1(15) + r) / (r + 1);
1373 /* Disenchantment -- Breathers and Disenchanters resist */
1376 if (seen) obvious = TRUE;
1377 if (r_ptr->flagsr & RFR_RES_DISE)
1379 note = _("には耐性がある。", " resists.");
1380 dam *= 3; dam /= randint1(6) + 6;
1381 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
1386 /* Nexus -- Breathers and Existers resist */
1389 if (seen) obvious = TRUE;
1390 if (r_ptr->flagsr & RFR_RES_NEXU)
1392 note = _("には耐性がある。", " resists.");
1393 dam *= 3; dam /= randint1(6) + 6;
1394 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
1402 if (seen) obvious = TRUE;
1403 if (r_ptr->flagsr & RFR_RES_WALL)
1405 note = _("には耐性がある。", " resists.");
1406 dam *= 3; dam /= randint1(6) + 6;
1407 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
1409 else do_stun = (randint1(15) + r) / (r + 1);
1413 /* Inertia -- breathers resist */
1416 if (seen) obvious = TRUE;
1417 if (r_ptr->flagsr & RFR_RES_INER)
1419 note = _("には耐性がある。", " resists.");
1420 dam *= 3; dam /= randint1(6) + 6;
1421 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
1425 /* Powerful monsters can resist */
1426 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1427 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1431 /* Normal monsters slow down */
1434 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1436 note = _("の動きが遅くなった。", " starts moving slower.");
1443 /* Time -- breathers resist */
1446 if (seen) obvious = TRUE;
1447 if (r_ptr->flagsr & RFR_RES_TIME)
1449 note = _("には耐性がある。", " resists.");
1450 dam *= 3; dam /= randint1(6) + 6;
1451 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
1453 else do_time = (dam + 1) / 2;
1457 /* Gravity -- breathers resist */
1460 bool resist_tele = FALSE;
1462 if (seen) obvious = TRUE;
1463 if (r_ptr->flagsr & RFR_RES_TELE)
1465 if (r_ptr->flags1 & (RF1_UNIQUE))
1467 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1468 note = _("には効果がなかった。", " is unaffected!");
1471 else if (r_ptr->level > randint1(100))
1473 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1474 note = _("には耐性がある!", " resists!");
1479 if (!resist_tele) do_dist = 10;
1481 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1483 if (r_ptr->flagsr & RFR_RES_GRAV)
1485 note = _("には耐性がある!", " resists!");
1486 dam *= 3; dam /= randint1(6) + 6;
1488 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
1493 /* Powerful monsters can resist */
1494 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1495 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1499 /* Normal monsters slow down */
1502 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1504 note = _("の動きが遅くなった。", " starts moving slower.");
1509 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
1511 /* Attempt a saving throw */
1512 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1513 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1517 /* No obvious effect */
1518 note = _("には効果がなかった。", " is unaffected!");
1530 if (seen) obvious = TRUE;
1536 case GF_DISINTEGRATE:
1538 if (seen) obvious = TRUE;
1539 if (r_ptr->flags3 & RF3_HURT_ROCK)
1541 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
1542 note = _("の皮膚がただれた!", " loses some skin!");
1543 note_dies = _("は蒸発した!", " evaporates!");
1551 if (seen) obvious = TRUE;
1553 /* PSI only works if the monster can see you! -- RG */
1554 if (!(los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)))
1557 msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), m_name);
1561 if (r_ptr->flags2 & RF2_EMPTY_MIND)
1564 note = _("には完全な耐性がある!", " is immune.");
1565 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1568 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
1569 (r_ptr->flags3 & RF3_ANIMAL) ||
1570 (r_ptr->level > randint1(3 * dam)))
1572 note = _("には耐性がある!", " resists!");
1576 * Powerful demons & undead can turn a mindcrafter's
1577 * attacks back on them
1579 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1580 (r_ptr->level > p_ptr->lev / 2) &&
1584 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1585 (seen ? "%^s's corrupted mind backlashes your attack!" :
1586 "%^ss corrupted mind backlashes your attack!")), m_name);
1589 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
1591 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1595 /* Injure +/- confusion */
1596 monster_desc(killer, m_ptr, MD_WRONGDOER_NAME);
1597 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1598 if (one_in_(4) && !CHECK_MULTISHADOW())
1600 switch (randint1(4))
1603 set_confused(p_ptr->confused + 3 + randint1(dam));
1606 set_stun(p_ptr->stun + randint1(dam));
1610 if (r_ptr->flags3 & RF3_NO_FEAR)
1611 note = _("には効果がなかった。", " is unaffected.");
1613 set_afraid(p_ptr->afraid + 3 + randint1(dam));
1617 if (!p_ptr->free_act)
1618 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
1627 if ((dam > 0) && one_in_(4))
1629 switch (randint1(4))
1632 do_conf = 3 + randint1(dam);
1635 do_stun = 3 + randint1(dam);
1638 do_fear = 3 + randint1(dam);
1641 note = _("は眠り込んでしまった!", " falls asleep!");
1642 do_sleep = 3 + randint1(dam);
1647 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1653 if (seen) obvious = TRUE;
1654 if (r_ptr->flags2 & RF2_EMPTY_MIND)
1657 note = _("には完全な耐性がある!", " is immune.");
1659 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
1660 (r_ptr->flags3 & RF3_ANIMAL) ||
1661 (r_ptr->level > randint1(3 * dam)))
1663 note = _("には耐性がある!", " resists!");
1667 * Powerful demons & undead can turn a mindcrafter's
1668 * attacks back on them
1670 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1671 (r_ptr->level > p_ptr->lev / 2) &&
1675 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1676 (seen ? "%^s's corrupted mind backlashes your attack!" :
1677 "%^ss corrupted mind backlashes your attack!")), m_name);
1679 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
1681 msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
1685 /* Injure + mana drain */
1686 monster_desc(killer, m_ptr, MD_WRONGDOER_NAME);
1687 if (!CHECK_MULTISHADOW())
1689 msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
1690 p_ptr->csp -= damroll(5, dam) / 2;
1691 if (p_ptr->csp < 0) p_ptr->csp = 0;
1692 p_ptr->redraw |= PR_MANA;
1693 p_ptr->window |= (PW_SPELL);
1695 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1702 int b = damroll(5, dam) / 4;
1703 concptr str = (p_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
1704 concptr msg = _("あなたは%sの苦痛を%sに変換した!",
1705 (seen ? "You convert %s's pain into %s!" :
1706 "You convert %ss pain into %s!"));
1707 msg_format(msg, m_name, str);
1709 b = MIN(p_ptr->msp, p_ptr->csp + b);
1711 p_ptr->redraw |= PR_MANA;
1712 p_ptr->window |= (PW_SPELL);
1714 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1718 case GF_TELEKINESIS:
1720 if (seen) obvious = TRUE;
1723 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1728 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
1730 /* Attempt a saving throw */
1731 if ((r_ptr->flags1 & RF1_UNIQUE) ||
1732 (r_ptr->level > 5 + randint1(dam)))
1736 /* No obvious effect */
1742 /* Psycho-spear -- powerful magic missile */
1745 if (seen) obvious = TRUE;
1749 /* Meteor -- powerful magic missile */
1752 if (seen) obvious = TRUE;
1758 if (!is_hostile(m_ptr)) break;
1759 if (seen) obvious = TRUE;
1760 /* Attempt a saving throw */
1761 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
1762 (r_ptr->flags3 & RF3_NO_CONF) ||
1763 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1765 /* Memorize a flag */
1766 if (r_ptr->flags3 & RF3_NO_CONF)
1768 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1775 * Powerful demons & undead can turn a mindcrafter's
1776 * attacks back on them
1778 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1779 (r_ptr->level > p_ptr->lev / 2) &&
1783 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1784 (seen ? "%^s's corrupted mind backlashes your attack!" :
1785 "%^ss corrupted mind backlashes your attack!")), m_name);
1788 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
1790 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1794 /* Confuse, stun, terrify */
1795 switch (randint1(4))
1798 set_stun(p_ptr->stun + dam / 2);
1801 set_confused(p_ptr->confused + dam / 2);
1805 if (r_ptr->flags3 & RF3_NO_FEAR)
1806 note = _("には効果がなかった。", " is unaffected.");
1808 set_afraid(p_ptr->afraid + dam);
1815 /* No obvious effect */
1816 note = _("には効果がなかった。", " is unaffected.");
1822 if (!common_saving_throw_charm(p_ptr, dam, m_ptr))
1824 note = _("があなたに隷属した。", " is in your thrall!");
1829 switch (randint1(4))
1843 /* No "real" damage */
1848 /* Ice -- Cold + Cuts + Stun */
1851 if (seen) obvious = TRUE;
1852 do_stun = (randint1(15) + 1) / (r + 1);
1853 if (r_ptr->flagsr & RFR_IM_COLD)
1855 note = _("にはかなり耐性がある!", " resists a lot.");
1857 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1859 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1861 note = _("はひどい痛手をうけた。", " is hit hard.");
1863 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1870 case GF_HYPODYNAMIA:
1872 if (seen) obvious = TRUE;
1873 if (!monster_living(m_ptr->r_idx))
1875 if (is_original_ap_and_seen(m_ptr))
1877 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
1878 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
1879 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
1881 note = _("には効果がなかった。", " is unaffected.");
1885 else do_time = (dam+7)/8;
1893 if (seen) obvious = TRUE;
1894 if (!monster_living(m_ptr->r_idx))
1896 if (is_original_ap_and_seen(m_ptr))
1898 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
1899 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
1900 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
1902 note = _("には完全な耐性がある!", " is immune.");
1906 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
1907 (randint1(888) != 666)) ||
1908 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
1909 randint1(100) != 66))
1911 note = _("には耐性がある!", " resists!");
1919 /* Polymorph monster (Use "dam" as "power") */
1922 if (seen) obvious = TRUE;
1923 /* Attempt to polymorph (see below) */
1926 /* Powerful monsters can resist */
1927 if ((r_ptr->flags1 & RF1_UNIQUE) ||
1928 (r_ptr->flags1 & RF1_QUESTOR) ||
1929 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1931 note = _("には効果がなかった。", " is unaffected.");
1936 /* No "real" damage */
1943 /* Clone monsters (Ignore "dam") */
1946 if (seen) obvious = TRUE;
1948 if ((p_ptr->inside_arena) || is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
1950 note = _("には効果がなかった。", " is unaffected.");
1955 m_ptr->hp = m_ptr->maxhp;
1957 /* Attempt to clone. */
1958 if (multiply_monster(g_ptr->m_idx, TRUE, 0L))
1960 note = _("が分裂した!", " spawns!");
1964 /* No "real" damage */
1971 /* Heal Monster (use "dam" as amount of healing) */
1974 if (seen) obvious = TRUE;
1977 (void)set_monster_csleep(g_ptr->m_idx, 0);
1979 if (m_ptr->maxhp < m_ptr->max_maxhp)
1981 if (seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), m_name, m_poss);
1982 m_ptr->maxhp = m_ptr->max_maxhp;
1987 /* Redraw (later) if needed */
1988 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
1989 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
1997 if (seen) obvious = TRUE;
2000 (void)set_monster_csleep(g_ptr->m_idx, 0);
2001 if (MON_STUNNED(m_ptr))
2003 if (seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), m_name);
2004 (void)set_monster_stunned(g_ptr->m_idx, 0);
2006 if (MON_CONFUSED(m_ptr))
2008 if (seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), m_name);
2009 (void)set_monster_confused(g_ptr->m_idx, 0);
2011 if (MON_MONFEAR(m_ptr))
2013 if (seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name, m_poss);
2014 (void)set_monster_monfear(g_ptr->m_idx, 0);
2018 if (m_ptr->hp < 30000) m_ptr->hp += dam;
2021 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2025 chg_virtue(V_VITALITY, 1);
2027 if (r_ptr->flags1 & RF1_UNIQUE)
2028 chg_virtue(V_INDIVIDUALISM, 1);
2030 if (is_friendly(m_ptr))
2031 chg_virtue(V_HONOUR, 1);
2032 else if (!(r_ptr->flags3 & RF3_EVIL))
2034 if (r_ptr->flags3 & RF3_GOOD)
2035 chg_virtue(V_COMPASSION, 2);
2037 chg_virtue(V_COMPASSION, 1);
2040 if (r_ptr->flags3 & RF3_ANIMAL)
2041 chg_virtue(V_NATURE, 1);
2044 if (m_ptr->r_idx == MON_LEPER)
2047 if (!who) chg_virtue(V_COMPASSION, 5);
2050 /* Redraw (later) if needed */
2051 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2052 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2054 note = _("は体力を回復したようだ。", " looks healthier.");
2056 /* No "real" damage */
2062 /* Speed Monster (Ignore "dam") */
2065 if (seen) obvious = TRUE;
2068 if (set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100))
2070 note = _("の動きが速くなった。", " starts moving faster.");
2075 if (r_ptr->flags1 & RF1_UNIQUE)
2076 chg_virtue(V_INDIVIDUALISM, 1);
2077 if (is_friendly(m_ptr))
2078 chg_virtue(V_HONOUR, 1);
2081 /* No "real" damage */
2087 /* Slow Monster (Use "dam" as "power") */
2090 if (seen) obvious = TRUE;
2092 /* Powerful monsters can resist */
2093 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2094 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2096 note = _("には効果がなかった。", " is unaffected.");
2100 /* Normal monsters slow down */
2103 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2105 note = _("の動きが遅くなった。", " starts moving slower.");
2109 /* No "real" damage */
2115 /* Sleep (Use "dam" as "power") */
2118 if (seen) obvious = TRUE;
2120 /* Attempt a saving throw */
2121 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2122 (r_ptr->flags3 & RF3_NO_SLEEP) ||
2123 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2125 /* Memorize a flag */
2126 if (r_ptr->flags3 & RF3_NO_SLEEP)
2128 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
2130 /* No obvious effect */
2131 note = _("には効果がなかった。", " is unaffected.");
2136 /* Go to sleep (much) later */
2137 note = _("は眠り込んでしまった!", " falls asleep!");
2141 /* No "real" damage */
2147 /* Sleep (Use "dam" as "power") */
2148 case GF_STASIS_EVIL:
2150 if (seen) obvious = TRUE;
2152 /* Attempt a saving throw */
2153 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2154 !(r_ptr->flags3 & RF3_EVIL) ||
2155 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2157 note = _("には効果がなかった。", " is unaffected.");
2162 /* Go to sleep (much) later */
2163 note = _("は動けなくなった!", " is suspended!");
2167 /* No "real" damage */
2172 /* Sleep (Use "dam" as "power") */
2175 if (seen) obvious = TRUE;
2177 /* Attempt a saving throw */
2178 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2179 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2181 note = _("には効果がなかった。", " is unaffected.");
2186 /* Go to sleep (much) later */
2187 note = _("は動けなくなった!", " is suspended!");
2191 /* No "real" damage */
2200 vir = virtue_number(V_HARMONY);
2203 dam += p_ptr->virtues[vir-1]/10;
2206 vir = virtue_number(V_INDIVIDUALISM);
2209 dam -= p_ptr->virtues[vir-1]/20;
2212 if (seen) obvious = TRUE;
2214 /* Attempt a saving throw */
2215 if (common_saving_throw_charm(p_ptr, dam, m_ptr))
2219 /* No obvious effect */
2220 note = _("には効果がなかった。", " is unaffected.");
2223 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2225 else if (p_ptr->cursed & TRC_AGGRAVATE)
2227 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2228 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2232 note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
2235 chg_virtue(V_INDIVIDUALISM, -1);
2236 if (r_ptr->flags3 & RF3_ANIMAL)
2237 chg_virtue(V_NATURE, 1);
2240 /* No "real" damage */
2245 /* Control undead */
2246 case GF_CONTROL_UNDEAD:
2249 if (seen) obvious = TRUE;
2251 vir = virtue_number(V_UNLIFE);
2254 dam += p_ptr->virtues[vir-1]/10;
2257 vir = virtue_number(V_INDIVIDUALISM);
2260 dam -= p_ptr->virtues[vir-1]/20;
2263 /* Attempt a saving throw */
2264 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2265 !(r_ptr->flags3 & RF3_UNDEAD))
2267 /* No obvious effect */
2268 note = _("には効果がなかった。", " is unaffected.");
2270 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2272 else if (p_ptr->cursed & TRC_AGGRAVATE)
2274 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2275 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2279 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2283 /* No "real" damage */
2289 case GF_CONTROL_DEMON:
2292 if (seen) obvious = TRUE;
2294 vir = virtue_number(V_UNLIFE);
2297 dam += p_ptr->virtues[vir-1]/10;
2300 vir = virtue_number(V_INDIVIDUALISM);
2303 dam -= p_ptr->virtues[vir-1]/20;
2306 /* Attempt a saving throw */
2307 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2308 !(r_ptr->flags3 & RF3_DEMON))
2310 /* No obvious effect */
2311 note = _("には効果がなかった。", " is unaffected.");
2313 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2315 else if (p_ptr->cursed & TRC_AGGRAVATE)
2317 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2318 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2322 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2326 /* No "real" damage */
2332 case GF_CONTROL_ANIMAL:
2335 if (seen) obvious = TRUE;
2337 vir = virtue_number(V_NATURE);
2340 dam += p_ptr->virtues[vir-1]/10;
2343 vir = virtue_number(V_INDIVIDUALISM);
2346 dam -= p_ptr->virtues[vir-1]/20;
2349 /* Attempt a saving throw */
2350 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2351 !(r_ptr->flags3 & RF3_ANIMAL))
2354 /* No obvious effect */
2355 note = _("には効果がなかった。", " is unaffected.");
2357 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2359 else if (p_ptr->cursed & TRC_AGGRAVATE)
2361 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2362 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2366 note = _("はなついた。", " is tamed!");
2368 if (r_ptr->flags3 & RF3_ANIMAL)
2369 chg_virtue(V_NATURE, 1);
2372 /* No "real" damage */
2378 case GF_CHARM_LIVING:
2382 vir = virtue_number(V_UNLIFE);
2383 if (seen) obvious = TRUE;
2385 vir = virtue_number(V_UNLIFE);
2388 dam -= p_ptr->virtues[vir-1]/10;
2391 vir = virtue_number(V_INDIVIDUALISM);
2394 dam -= p_ptr->virtues[vir-1]/20;
2397 msg_format(_("%sを見つめた。", "You stare into %s."), m_name);
2399 /* Attempt a saving throw */
2400 if (common_saving_throw_charm(p_ptr, dam, m_ptr) ||
2401 !monster_living(m_ptr->r_idx))
2404 /* No obvious effect */
2405 note = _("には効果がなかった。", " is unaffected.");
2407 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2409 else if (p_ptr->cursed & TRC_AGGRAVATE)
2411 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2412 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2416 note = _("を支配した。", " is tamed!");
2418 if (r_ptr->flags3 & RF3_ANIMAL)
2419 chg_virtue(V_NATURE, 1);
2422 /* No "real" damage */
2427 /* Confusion (Use "dam" as "power") */
2430 if (seen) obvious = TRUE;
2432 /* Get confused later */
2433 do_conf = damroll(3, (dam / 2)) + 1;
2435 /* Attempt a saving throw */
2436 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2437 (r_ptr->flags3 & (RF3_NO_CONF)) ||
2438 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2440 /* Memorize a flag */
2441 if (r_ptr->flags3 & (RF3_NO_CONF))
2443 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2449 /* No obvious effect */
2450 note = _("には効果がなかった。", " is unaffected.");
2454 /* No "real" damage */
2461 if (seen) obvious = TRUE;
2463 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2465 /* Attempt a saving throw */
2466 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2467 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2472 /* No obvious effect */
2473 note = _("には効果がなかった。", " is unaffected.");
2477 /* No "real" damage */
2482 /* Lite, but only hurts susceptible creatures */
2491 if (r_ptr->flags3 & (RF3_HURT_LITE))
2493 /* Obvious effect */
2494 if (seen) obvious = TRUE;
2496 /* Memorize the effects */
2497 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
2499 /* Special effect */
2500 note = _("は光に身をすくめた!", " cringes from the light!");
2501 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
2504 /* Normally no damage */
2516 /* Lite -- opposite of Dark */
2519 if (seen) obvious = TRUE;
2521 if (r_ptr->flagsr & RFR_RES_LITE)
2523 note = _("には耐性がある!", " resists!");
2524 dam *= 2; dam /= (randint1(6)+6);
2525 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
2527 else if (r_ptr->flags3 & (RF3_HURT_LITE))
2529 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
2530 note = _("は光に身をすくめた!", " cringes from the light!");
2531 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
2538 /* Dark -- opposite of Lite */
2541 if (seen) obvious = TRUE;
2543 if (r_ptr->flagsr & RFR_RES_DARK)
2545 note = _("には耐性がある!", " resists!");
2546 dam *= 2; dam /= (randint1(6)+6);
2547 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
2556 /* Hurt by rock remover */
2557 if (r_ptr->flags3 & (RF3_HURT_ROCK))
2560 if (seen) obvious = TRUE;
2562 /* Memorize the effects */
2563 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2565 /* Cute little message */
2566 note = _("の皮膚がただれた!", " loses some skin!");
2567 note_dies = _("はドロドロに溶けた!", " dissolves!");
2570 /* Usually, ignore the effects */
2581 /* Teleport undead (Use "dam" as "power") */
2582 case GF_AWAY_UNDEAD:
2584 /* Only affect undead */
2585 if (r_ptr->flags3 & (RF3_UNDEAD))
2587 bool resists_tele = FALSE;
2589 if (r_ptr->flagsr & RFR_RES_TELE)
2591 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2593 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2594 note = _("には効果がなかった。", " is unaffected.");
2595 resists_tele = TRUE;
2597 else if (r_ptr->level > randint1(100))
2599 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2600 note = _("には耐性がある!", " resists!");
2601 resists_tele = TRUE;
2607 if (seen) obvious = TRUE;
2608 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2620 /* No "real" damage */
2626 /* Teleport evil (Use "dam" as "power") */
2629 /* Only affect evil */
2630 if (r_ptr->flags3 & (RF3_EVIL))
2632 bool resists_tele = FALSE;
2634 if (r_ptr->flagsr & RFR_RES_TELE)
2636 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2638 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2639 note = _("には効果がなかった。", " is unaffected.");
2640 resists_tele = TRUE;
2642 else if (r_ptr->level > randint1(100))
2644 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2645 note = _("には耐性がある!", " resists!");
2646 resists_tele = TRUE;
2652 if (seen) obvious = TRUE;
2653 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2665 /* No "real" damage */
2671 /* Teleport monster (Use "dam" as "power") */
2674 bool resists_tele = FALSE;
2675 if (r_ptr->flagsr & RFR_RES_TELE)
2677 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2679 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2680 note = _("には効果がなかった。", " is unaffected.");
2681 resists_tele = TRUE;
2683 else if (r_ptr->level > randint1(100))
2685 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2686 note = _("には耐性がある!", " resists!");
2687 resists_tele = TRUE;
2693 if (seen) obvious = TRUE;
2695 /* Prepare to teleport */
2699 /* No "real" damage */
2705 /* Turn undead (Use "dam" as "power") */
2706 case GF_TURN_UNDEAD:
2708 /* Only affect undead */
2709 if (r_ptr->flags3 & (RF3_UNDEAD))
2711 if (seen) obvious = TRUE;
2713 /* Learn about type */
2714 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2716 /* Apply some fear */
2717 do_fear = damroll(3, (dam / 2)) + 1;
2719 /* Attempt a saving throw */
2720 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
2722 /* No obvious effect */
2723 note = _("には効果がなかった。", " is unaffected.");
2736 /* No "real" damage */
2742 /* Turn evil (Use "dam" as "power") */
2745 /* Only affect evil */
2746 if (r_ptr->flags3 & (RF3_EVIL))
2748 if (seen) obvious = TRUE;
2750 /* Learn about type */
2751 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2753 /* Apply some fear */
2754 do_fear = damroll(3, (dam / 2)) + 1;
2756 /* Attempt a saving throw */
2757 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
2759 /* No obvious effect */
2760 note = _("には効果がなかった。", " is unaffected.");
2773 /* No "real" damage */
2779 /* Turn monster (Use "dam" as "power") */
2782 if (seen) obvious = TRUE;
2784 /* Apply some fear */
2785 do_fear = damroll(3, (dam / 2)) + 1;
2787 /* Attempt a saving throw */
2788 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2789 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
2790 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2792 /* No obvious effect */
2793 note = _("には効果がなかった。", " is unaffected.");
2798 /* No "real" damage */
2805 case GF_DISP_UNDEAD:
2807 /* Only affect undead */
2808 if (r_ptr->flags3 & (RF3_UNDEAD))
2810 if (seen) obvious = TRUE;
2812 /* Learn about type */
2813 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2815 note = _("は身震いした。", " shudders.");
2816 note_dies = _("はドロドロに溶けた!", " dissolves!");
2836 /* Only affect evil */
2837 if (r_ptr->flags3 & (RF3_EVIL))
2839 if (seen) obvious = TRUE;
2841 /* Learn about type */
2842 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2844 note = _("は身震いした。", " shudders.");
2845 note_dies = _("はドロドロに溶けた!", " dissolves!");
2864 /* Only affect good */
2865 if (r_ptr->flags3 & (RF3_GOOD))
2867 if (seen) obvious = TRUE;
2869 /* Learn about type */
2870 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
2872 note = _("は身震いした。", " shudders.");
2873 note_dies = _("はドロドロに溶けた!", " dissolves!");
2890 case GF_DISP_LIVING:
2892 /* Only affect non-undead */
2893 if (monster_living(m_ptr->r_idx))
2895 if (seen) obvious = TRUE;
2897 note = _("は身震いした。", " shudders.");
2898 note_dies = _("はドロドロに溶けた!", " dissolves!");
2917 /* Only affect demons */
2918 if (r_ptr->flags3 & (RF3_DEMON))
2920 if (seen) obvious = TRUE;
2922 /* Learn about type */
2923 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2925 note = _("は身震いした。", " shudders.");
2926 note_dies = _("はドロドロに溶けた!", " dissolves!");
2942 /* Dispel monster */
2945 if (seen) obvious = TRUE;
2946 note = _("は身震いした。", " shudders.");
2947 note_dies = _("はドロドロに溶けた!", " dissolves!");
2954 if (seen) obvious = TRUE;
2955 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->a_ability_flags1 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->a_ability_flags2 & ~(RF6_NOMAGIC_MASK)))
2959 /* Heal the monster */
2960 if (caster_ptr->hp < caster_ptr->maxhp)
2963 caster_ptr->hp += dam;
2964 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
2966 /* Redraw (later) if needed */
2967 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
2968 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
2970 /* Special message */
2973 monster_desc(killer, caster_ptr, 0);
2974 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), killer);
2980 msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), m_name);
2981 (void)hp_player(dam);
2986 if (see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
2995 if (seen) obvious = TRUE;
2996 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
2997 /* Attempt a saving throw */
2998 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2999 (r_ptr->flags3 & RF3_NO_CONF) ||
3000 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3002 /* Memorize a flag */
3003 if (r_ptr->flags3 & (RF3_NO_CONF))
3005 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3007 note = _("には効果がなかった。", " is unaffected.");
3010 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3012 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3013 note = _("には完全な耐性がある!", " is immune.");
3016 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3018 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3019 note = _("には耐性がある。", " resists.");
3024 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3025 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3027 if (who > 0) do_conf = randint0(4) + 4;
3028 else do_conf = randint0(8) + 8;
3034 case GF_BRAIN_SMASH:
3036 if (seen) obvious = TRUE;
3037 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3039 /* Attempt a saving throw */
3040 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3041 (r_ptr->flags3 & RF3_NO_CONF) ||
3042 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3044 /* Memorize a flag */
3045 if (r_ptr->flags3 & (RF3_NO_CONF))
3047 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3049 note = _("には効果がなかった。", " is unaffected.");
3052 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3054 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3055 note = _("には完全な耐性がある!", " is immune.");
3058 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3060 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3061 note = _("には耐性がある!", " resists!");
3066 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3067 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3071 do_conf = randint0(4) + 4;
3072 do_stun = randint0(4) + 4;
3076 do_conf = randint0(8) + 8;
3077 do_stun = randint0(8) + 8;
3079 (void)set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 10);
3087 if (seen) obvious = TRUE;
3088 if (!who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), m_name);
3089 /* Attempt a saving throw */
3090 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3092 note = _("には効果がなかった。", " is unaffected.");
3101 if (seen) obvious = TRUE;
3102 if (!who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), m_name);
3103 /* Attempt a saving throw */
3104 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3106 note = _("には効果がなかった。", " is unaffected.");
3115 if (seen) obvious = TRUE;
3116 if (!who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), m_name);
3117 /* Attempt a saving throw */
3118 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3120 note = _("には効果がなかった。", " is unaffected.");
3129 if (seen) obvious = TRUE;
3131 msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
3132 "You point at %s, screaming the word, 'DIE!'."), m_name);
3133 /* Attempt a saving throw */
3134 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
3136 note = _("には効果がなかった。", " is unaffected.");
3145 if (seen) obvious = TRUE;
3146 if (r_ptr->flags1 & RF1_UNIQUE)
3148 note = _("には効果がなかった。", " is unaffected.");
3153 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
3154 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
3156 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
3158 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
3162 note = _("は耐性を持っている!", "resists!");
3169 /* Capture monster */
3173 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
3174 (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)
3176 msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3181 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
3182 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(m_ptr->r_idx))
3183 nokori_hp = m_ptr->maxhp * 3 / 10;
3185 nokori_hp = m_ptr->maxhp * 3 / 20;
3187 if (m_ptr->hp >= nokori_hp)
3189 msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), m_name);
3192 else if (m_ptr->hp < randint0(nokori_hp))
3194 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(g_ptr->m_idx, FALSE, MON_CHAMELEON);
3195 msg_format(_("%sを捕えた!", "You capture %^s!"), m_name);
3196 cap_mon = m_ptr->r_idx;
3197 cap_mspeed = m_ptr->mspeed;
3199 cap_maxhp = m_ptr->max_maxhp;
3200 cap_nickname = m_ptr->nickname; /* Quark transfer */
3201 if (g_ptr->m_idx == p_ptr->riding)
3203 if (rakuba(-1, FALSE))
3205 msg_format(_("地面に落とされた。", "You have fallen from %s."), m_name);
3209 delete_monster_idx(g_ptr->m_idx);
3215 msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), m_name);
3221 /* Attack (Use "dam" as attack type) */
3224 /* Return this monster's death */
3225 return py_attack(y, x, dam);
3228 /* Sleep (Use "dam" as "power") */
3234 if (seen) obvious = TRUE;
3235 if (r_ptr->flags2 & RF2_EMPTY_MIND)
3237 note = _("には効果がなかった。", " is unaffected.");
3240 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3243 if (MON_CSLEEP(m_ptr))
3245 note = _("には効果がなかった。", " is unaffected.");
3251 if (one_in_(5)) effect = 1;
3252 else if (one_in_(4)) effect = 2;
3253 else if (one_in_(3)) effect = 3;
3258 /* Powerful monsters can resist */
3259 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3260 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3262 note = _("には効果がなかった。", " is unaffected.");
3266 /* Normal monsters slow down */
3269 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
3271 note = _("の動きが遅くなった。", " starts moving slower.");
3276 else if (effect == 2)
3278 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
3280 /* Attempt a saving throw */
3281 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3282 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3287 /* No obvious effect */
3288 note = _("には効果がなかった。", " is unaffected.");
3293 else if (effect == 3)
3295 /* Attempt a saving throw */
3296 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3297 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3298 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3300 /* Memorize a flag */
3301 if (r_ptr->flags3 & RF3_NO_SLEEP)
3303 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3306 /* No obvious effect */
3307 note = _("には効果がなかった。", " is unaffected.");
3312 /* Go to sleep (much) later */
3313 note = _("は眠り込んでしまった!", " falls asleep!");
3320 note = _("には効果がなかった。", " is unaffected.");
3323 /* No "real" damage */
3331 if (seen) obvious = TRUE;
3332 if (genocide_aux(g_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
3334 if (seen_msg) msg_format(_("%sは消滅した!", "%^s disappeared!"), m_name);
3335 chg_virtue(V_VITALITY, -1);
3345 if (!who) msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), m_name);
3347 if (r_ptr->flags3 & (RF3_HURT_LITE))
3349 /* Obvious effect */
3350 if (seen) obvious = TRUE;
3352 /* Memorize the effects */
3353 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3355 /* Special effect */
3356 note = _("は光に身をすくめた!", " cringes from the light!");
3357 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3360 /* Normally no damage */
3367 photo = m_ptr->r_idx;
3374 case GF_BLOOD_CURSE:
3376 if (seen) obvious = TRUE;
3382 bool success = FALSE;
3383 if (seen) obvious = TRUE;
3385 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
3387 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
3388 if (dam < 1) dam = 1;
3390 /* No need to tame your pet */
3393 note = _("の動きが速くなった。", " starts moving faster.");
3394 (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100);
3398 /* Attempt a saving throw */
3399 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3400 (r_ptr->flags1 & (RF1_UNIQUE)) ||
3401 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3402 (p_ptr->cursed & TRC_AGGRAVATE) ||
3403 ((r_ptr->level+10) > randint1(dam)))
3406 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3410 note = _("を支配した。", " is tamed!");
3412 (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100);
3414 /* Learn about type */
3415 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
3422 if (!(r_ptr->flags3 & RF3_NO_FEAR))
3424 do_fear = randint1(90)+10;
3426 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
3429 /* No "real" damage */
3436 if (seen) obvious = TRUE;
3437 /* Attempt a saving throw */
3438 if (randint0(100 + dam) < (r_ptr->level + 50))
3440 note = _("には効果がなかった。", " is unaffected.");
3460 /* Absolutely no effect */
3461 if (skipped) return (FALSE);
3463 /* "Unique" monsters cannot be polymorphed */
3464 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
3466 /* Quest monsters cannot be polymorphed */
3467 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
3469 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
3471 /* "Unique" and "quest" monsters can only be "killed" by the player. */
3472 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
3474 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
3479 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
3480 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
3483 /* Modify the damage */
3485 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
3486 if ((tmp > 0) && (dam == 0)) note = _("はダメージを受けていない。", " is unharmed.");
3488 /* Check for death */
3489 if (dam > m_ptr->hp)
3491 /* Extract method of death */
3496 /* Sound and Impact resisters never stun */
3498 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
3499 !(r_ptr->flags3 & RF3_NO_STUN))
3501 if (seen) obvious = TRUE;
3504 if (MON_STUNNED(m_ptr))
3506 note = _("はひどくもうろうとした。", " is more dazed.");
3507 tmp = MON_STUNNED(m_ptr) + (do_stun / 2);
3511 note = _("はもうろうとした。", " is dazed.");
3516 (void)set_monster_stunned(g_ptr->m_idx, tmp);
3522 /* Confusion and Chaos resisters (and sleepers) never confuse */
3524 !(r_ptr->flags3 & RF3_NO_CONF) &&
3525 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
3527 if (seen) obvious = TRUE;
3529 /* Already partially confused */
3530 if (MON_CONFUSED(m_ptr))
3532 note = _("はさらに混乱したようだ。", " looks more confused.");
3533 tmp = MON_CONFUSED(m_ptr) + (do_conf / 2);
3536 /* Was not confused */
3539 note = _("は混乱したようだ。", " looks confused.");
3543 /* Apply confusion */
3544 (void)set_monster_confused(g_ptr->m_idx, tmp);
3552 if (seen) obvious = TRUE;
3554 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
3558 note = _("は弱くなったようだ。", " seems weakened.");
3559 m_ptr->maxhp -= do_time;
3560 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
3565 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
3566 if (do_poly && (randint1(90) > r_ptr->level))
3568 if (polymorph_monster(y, x))
3570 if (seen) obvious = TRUE;
3572 /* Monster polymorphs */
3573 note = _("が変身した!", " changes!");
3575 /* Turn off the damage */
3581 note = _("には効果がなかった。", " is unaffected.");
3584 /* Hack -- Get new monster */
3585 m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
3587 /* Hack -- Get new race */
3588 r_ptr = &r_info[m_ptr->r_idx];
3591 /* Handle "teleport" */
3594 if (seen) obvious = TRUE;
3596 note = _("が消え去った!", " disappears!");
3598 if (!who) chg_virtue(V_VALOUR, -1);
3601 teleport_away(g_ptr->m_idx, do_dist,
3602 (!who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
3604 /* Hack -- get new location */
3608 /* Hack -- get new grid */
3609 g_ptr = ¤t_floor_ptr->grid_array[y][x];
3616 (void)set_monster_monfear(g_ptr->m_idx, MON_MONFEAR(m_ptr) + do_fear);
3623 if (typ == GF_DRAIN_MANA)
3625 /* Drain mana does nothing */
3628 /* If another monster did the damage, hurt the monster by hand */
3631 /* Redraw (later) if needed */
3632 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3633 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3635 /* Wake the monster up */
3636 (void)set_monster_csleep(g_ptr->m_idx, 0);
3638 /* Hurt the monster */
3646 if (is_pet(m_ptr) && !(m_ptr->ml))
3649 /* Give detailed messages if destroyed */
3652 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
3655 msg_format("%^s%s", m_name, note);
3663 if (who > 0) monster_gain_exp(who, m_ptr->r_idx);
3665 /* Generate treasure, etc */
3666 monster_death(g_ptr->m_idx, FALSE);
3669 delete_monster_idx(g_ptr->m_idx);
3673 msg_print(_("少し悲しい気分がした。", "You feel sad for a moment."));
3677 /* Damaged monster */
3680 /* Give detailed messages if visible or destroyed */
3681 if (note && seen_msg) msg_format("%^s%s", m_name, note);
3683 /* Hack -- Pain message */
3686 message_pain(g_ptr->m_idx, dam);
3693 /* Hack -- handle sleep */
3694 if (do_sleep) (void)set_monster_csleep(g_ptr->m_idx, do_sleep);
3698 else if (heal_leper)
3700 if (seen_msg) msg_print(_("不潔な病人は病気が治った!", "The Mangy looking leper is healed!"));
3702 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
3704 char m2_name[MAX_NLEN];
3706 monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
3707 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_HEAL_LEPER, m2_name);
3710 delete_monster_idx(g_ptr->m_idx);
3713 /* If the player did it, give him experience, check fear */
3718 /* Hurt the monster, check for fear and death */
3719 if (mon_take_hit(g_ptr->m_idx, dam, &fear, note_dies))
3724 /* Damaged monster */
3727 /* HACK - anger the monster before showing the sleep message */
3728 if (do_sleep) anger_monster(m_ptr);
3730 /* Give detailed messages if visible or destroyed */
3731 if (note && seen_msg)
3732 msg_format(_("%s%s", "%^s%s"), m_name, note);
3734 /* Hack -- Pain message */
3735 else if (known && (dam || !do_fear))
3737 message_pain(g_ptr->m_idx, dam);
3740 /* Anger monsters */
3741 if (((dam > 0) || get_angry) && !do_sleep)
3742 anger_monster(m_ptr);
3744 if ((fear || do_fear) && seen)
3747 msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
3750 /* Hack -- handle sleep */
3751 if (do_sleep) (void)set_monster_csleep(g_ptr->m_idx, do_sleep);
3755 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
3757 blood_curse_to_enemy(who);
3760 if (p_ptr->inside_battle)
3762 p_ptr->health_who = g_ptr->m_idx;
3763 p_ptr->redraw |= (PR_HEALTH);
3767 /* Verify this code */
3768 if (m_ptr->r_idx) update_monster(g_ptr->m_idx, FALSE);
3770 /* Redraw the monster grid */
3773 /* Update monster recall window */
3774 if ((p_ptr->monster_race_idx == m_ptr->r_idx) && (seen || !m_ptr->r_idx))
3776 p_ptr->window |= (PW_MONSTER);
3779 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
3783 if (!(flg & PROJECT_NO_HANGEKI))
3785 set_target(m_ptr, monster_target_y, monster_target_x);
3788 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
3790 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
3794 if (p_ptr->riding && (p_ptr->riding == g_ptr->m_idx) && (dam > 0))
3796 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
3797 rakubadam_m = (dam > 200) ? 200 : dam;
3807 /* Prepare to make a Blade of Chaos */
3808 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
3810 q_ptr->pval = photo;
3812 /* Mark the item as fully known */
3813 q_ptr->ident |= (IDENT_MENTAL);
3814 (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
3822 /* Return "Anything seen?" */
3827 * @brief 汎用的なビーム/ボルト/ボール系によるプレイヤーへの効果処理 / Helper function for "project()" below.
3828 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
3829 * @param who_name 効果を起こしたモンスターの名前
3830 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
3831 * @param y 目標Y座標 / Target y location (or location to travel "towards")
3832 * @param x 目標X座標 / Target x location (or location to travel "towards")
3833 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
3834 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
3836 * @param monspell 効果元のモンスター魔法ID
3837 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
3839 * Handle a beam/bolt/ball causing damage to the player.
3840 * This routine takes a "source monster" (by index), a "distance", a default
3841 * "damage", and a "damage type". See "project_m()" above.
3842 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
3843 * is reduced (see "project_m()" above). This can happen if a monster breathes
3844 * at the player and hits a wall instead.
3845 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
3846 * to know if this is actually a ball or a bolt spell
3847 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
3848 * we just assume that the effects were obvious, for historical reasons.
3850 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)
3855 /* Hack -- assume obvious */
3856 bool obvious = TRUE;
3858 /* Player blind-ness */
3859 bool blind = (p_ptr->blind ? TRUE : FALSE);
3861 /* Player needs a "description" (he is blind) */
3864 /* Source monster */
3865 monster_type *m_ptr = NULL;
3867 /* Monster name (for attacks) */
3868 GAME_TEXT m_name[MAX_NLEN];
3870 /* Monster name (for damage) */
3873 /* Hack -- messages */
3879 /* Player is not here */
3880 if (!player_bold(y, x)) return (FALSE);
3882 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
3884 if (kawarimi(TRUE)) return FALSE;
3887 /* Player cannot hurt himself */
3888 if (!who) return (FALSE);
3889 if (who == p_ptr->riding) return (FALSE);
3891 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
3894 int max_attempts = 10;
3895 sound(SOUND_REFLECT);
3898 msg_print(_("何かが跳ね返った!", "Something bounces!"));
3899 else if (p_ptr->special_defense & KATA_FUUJIN)
3900 msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
3902 msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
3905 /* Choose 'new' target */
3910 t_y = current_floor_ptr->m_list[who].fy - 1 + randint1(3);
3911 t_x = current_floor_ptr->m_list[who].fx - 1 + randint1(3);
3914 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(p_ptr->y, p_ptr->x, t_y, t_x));
3916 if (max_attempts < 1)
3918 t_y = current_floor_ptr->m_list[who].fy;
3919 t_x = current_floor_ptr->m_list[who].fx;
3924 t_y = p_ptr->y - 1 + randint1(3);
3925 t_x = p_ptr->x - 1 + randint1(3);
3928 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
3930 disturb(TRUE, TRUE);
3934 /* Limit maximum damage */
3935 if (dam > 1600) dam = 1600;
3937 /* Reduce damage by distance */
3938 dam = (dam + r) / (r + 1);
3941 /* If the player is blind, be more descriptive */
3942 if (blind) fuzzy = TRUE;
3947 m_ptr = ¤t_floor_ptr->m_list[who];
3948 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
3949 monster_desc(m_name, m_ptr, 0);
3951 /* Get the monster's real name (gotten before polymorph!) */
3952 strcpy(killer, who_name);
3958 case PROJECT_WHO_UNCTRL_POWER:
3959 strcpy(killer, _("制御できない力の氾流", "uncontrollable power storm"));
3962 case PROJECT_WHO_GLASS_SHARDS:
3963 strcpy(killer, _("ガラスの破片", "shards of glass"));
3967 strcpy(killer, _("罠", "a trap"));
3970 strcpy(m_name, killer);
3973 /* Analyze the damage */
3976 /* Standard damage -- hurts inventory too */
3979 if (fuzzy) msg_print(_("酸で攻撃された!", "You are hit by acid!"));
3980 get_damage = acid_dam(dam, killer, monspell, FALSE);
3984 /* Standard damage -- hurts inventory too */
3987 if (fuzzy) msg_print(_("火炎で攻撃された!", "You are hit by fire!"));
3988 get_damage = fire_dam(dam, killer, monspell, FALSE);
3992 /* Standard damage -- hurts inventory too */
3995 if (fuzzy) msg_print(_("冷気で攻撃された!", "You are hit by cold!"));
3996 get_damage = cold_dam(dam, killer, monspell, FALSE);
4000 /* Standard damage -- hurts inventory too */
4003 if (fuzzy) msg_print(_("電撃で攻撃された!", "You are hit by lightning!"));
4004 get_damage = elec_dam(dam, killer, monspell, FALSE);
4008 /* Standard damage -- also poisons player */
4011 bool double_resist = IS_OPPOSE_POIS();
4012 if (fuzzy) msg_print(_("毒で攻撃された!", "You are hit by poison!"));
4014 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
4015 if (double_resist) dam = (dam + 2) / 3;
4017 if ((!(double_resist || p_ptr->resist_pois)) && one_in_(HURT_CHANCE) && !CHECK_MULTISHADOW())
4022 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4024 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4026 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4031 /* Standard damage -- also poisons / mutates player */
4034 bool double_resist = IS_OPPOSE_POIS();
4035 if (fuzzy) msg_print(_("放射能で攻撃された!", "You are hit by radiation!"));
4037 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
4038 if (double_resist) dam = (2 * dam + 2) / 5;
4039 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4040 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4042 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4044 if (one_in_(5)) /* 6 */
4046 msg_print(_("奇形的な変身を遂げた!", "You undergo a freakish metamorphosis!"));
4047 if (one_in_(4)) /* 4 */
4055 inven_damage(set_acid_destroy, 2);
4061 /* Standard damage */
4064 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4065 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4069 /* Holy Orb -- Player only takes partial damage */
4072 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4073 if (p_ptr->align > 10)
4075 else if (p_ptr->align < -10)
4077 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4083 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4084 if (p_ptr->align > 10)
4086 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4090 /* Arrow -- XXX no dodging */
4095 msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
4097 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
4099 msg_print(_("矢を斬り捨てた!", "You cut down the arrow!"));
4102 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4106 /* Plasma -- XXX No resist */
4109 if (fuzzy) msg_print(_("何かとても熱いもので攻撃された!", "You are hit by something *HOT*!"));
4110 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4112 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4114 int plus_stun = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
4115 (void)set_stun(p_ptr->stun + plus_stun);
4118 if (!(p_ptr->resist_fire || IS_OPPOSE_FIRE() || p_ptr->immune_fire))
4120 inven_damage(set_acid_destroy, 3);
4126 /* Nether -- drain experience */
4129 if (fuzzy) msg_print(_("地獄の力で攻撃された!", "You are hit by nether forces!"));
4130 if (p_ptr->resist_neth)
4132 if (!prace_is_(RACE_SPECTRE))
4134 dam *= 6; dam /= (randint1(4) + 7);
4137 else if (!CHECK_MULTISHADOW()) drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
4139 if (prace_is_(RACE_SPECTRE) && !CHECK_MULTISHADOW())
4141 msg_print(_("気分がよくなった。", "You feel invigorated!"));
4143 learn_spell(monspell);
4147 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4153 /* Water -- stun/confuse */
4156 if (fuzzy) msg_print(_("何か湿ったもので攻撃された!", "You are hit by something wet!"));
4157 if (!CHECK_MULTISHADOW())
4159 if (!p_ptr->resist_sound && !p_ptr->resist_water)
4161 set_stun(p_ptr->stun + randint1(40));
4163 if (!p_ptr->resist_conf && !p_ptr->resist_water)
4165 set_confused(p_ptr->confused + randint1(5) + 5);
4168 if (one_in_(5) && !p_ptr->resist_water)
4170 inven_damage(set_cold_destroy, 3);
4173 if (p_ptr->resist_water) get_damage /= 4;
4176 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4180 /* Chaos -- many effects */
4183 if (fuzzy) msg_print(_("無秩序の波動で攻撃された!", "You are hit by a wave of anarchy!"));
4184 if (p_ptr->resist_chaos)
4186 dam *= 6; dam /= (randint1(4) + 7);
4189 if (!CHECK_MULTISHADOW())
4191 if (!p_ptr->resist_conf)
4193 (void)set_confused(p_ptr->confused + randint0(20) + 10);
4195 if (!p_ptr->resist_chaos)
4197 (void)set_image(p_ptr->image + randint1(10));
4200 msg_print(_("あなたの身体はカオスの力で捻じ曲げられた!", "Your body is twisted by chaos!"));
4201 (void)gain_mutation(p_ptr, 0);
4204 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
4206 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
4209 if (!p_ptr->resist_chaos || one_in_(9))
4211 inven_damage(set_elec_destroy, 2);
4212 inven_damage(set_fire_destroy, 2);
4216 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4220 /* Shards -- mostly cutting */
4223 if (fuzzy) msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
4224 if (p_ptr->resist_shard)
4226 dam *= 6; dam /= (randint1(4) + 7);
4228 else if (!CHECK_MULTISHADOW())
4230 (void)set_cut(p_ptr->cut + dam);
4233 if (!p_ptr->resist_shard || one_in_(13))
4235 inven_damage(set_cold_destroy, 2);
4238 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4242 /* Sound -- mostly stunning */
4245 if (fuzzy) msg_print(_("轟音で攻撃された!", "You are hit by a loud noise!"));
4246 if (p_ptr->resist_sound)
4248 dam *= 5; dam /= (randint1(4) + 7);
4250 else if (!CHECK_MULTISHADOW())
4252 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
4253 (void)set_stun(p_ptr->stun + plus_stun);
4256 if (!p_ptr->resist_sound || one_in_(13))
4258 inven_damage(set_cold_destroy, 2);
4261 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4265 /* Pure confusion */
4268 if (fuzzy) msg_print(_("何か混乱するもので攻撃された!", "You are hit by something puzzling!"));
4269 if (p_ptr->resist_conf)
4271 dam *= 5; dam /= (randint1(4) + 7);
4273 else if (!CHECK_MULTISHADOW())
4275 (void)set_confused(p_ptr->confused + randint1(20) + 10);
4277 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4281 /* Disenchantment -- see above */
4284 if (fuzzy) msg_print(_("何かさえないもので攻撃された!", "You are hit by something static!"));
4285 if (p_ptr->resist_disen)
4287 dam *= 6; dam /= (randint1(4) + 7);
4289 else if (!CHECK_MULTISHADOW())
4291 (void)apply_disenchant(0);
4293 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4297 /* Nexus -- see above */
4300 if (fuzzy) msg_print(_("何か奇妙なもので攻撃された!", "You are hit by something strange!"));
4301 if (p_ptr->resist_nexus)
4303 dam *= 6; dam /= (randint1(4) + 7);
4305 else if (!CHECK_MULTISHADOW())
4309 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4313 /* Force -- mostly stun */
4316 if (fuzzy) msg_print(_("運動エネルギーで攻撃された!", "You are hit by kinetic force!"));
4317 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4319 (void)set_stun(p_ptr->stun + randint1(20));
4321 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4326 /* Rocket -- stun, cut */
4329 if (fuzzy) msg_print(_("爆発があった!", "There is an explosion!"));
4330 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4332 (void)set_stun(p_ptr->stun + randint1(20));
4335 if (p_ptr->resist_shard)
4339 else if (!CHECK_MULTISHADOW())
4341 (void)set_cut(p_ptr->cut + (dam / 2));
4344 if (!p_ptr->resist_shard || one_in_(12))
4346 inven_damage(set_cold_destroy, 3);
4349 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4353 /* Inertia -- slowness */
4356 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
4357 if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4358 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4362 /* Lite -- blinding */
4365 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4366 if (p_ptr->resist_lite)
4368 dam *= 4; dam /= (randint1(4) + 7);
4370 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
4372 (void)set_blind(p_ptr->blind + randint1(5) + 2);
4375 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
4377 if (!CHECK_MULTISHADOW()) msg_print(_("光で肉体が焦がされた!", "The light scorches your flesh!"));
4380 else if (prace_is_(RACE_S_FAIRY))
4385 if (p_ptr->wraith_form) dam *= 2;
4386 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4388 if (p_ptr->wraith_form && !CHECK_MULTISHADOW())
4390 p_ptr->wraith_form = 0;
4391 msg_print(_("閃光のため非物質的な影の存在でいられなくなった。",
4392 "The light forces you out of your incorporeal shadow form."));
4394 p_ptr->redraw |= (PR_MAP | PR_STATUS);
4395 p_ptr->update |= (PU_MONSTERS);
4396 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4402 /* Dark -- blinding */
4405 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4406 if (p_ptr->resist_dark)
4408 dam *= 4; dam /= (randint1(4) + 7);
4410 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
4412 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
4414 (void)set_blind(p_ptr->blind + randint1(5) + 2);
4416 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4420 /* Time -- bolt fewer effects XXX */
4423 if (fuzzy) msg_print(_("過去からの衝撃に攻撃された!", "You are hit by a blast from the past!"));
4424 if (p_ptr->resist_time)
4427 dam /= (randint1(4) + 7);
4428 msg_print(_("時間が通り過ぎていく気がする。", "You feel as if time is passing you by."));
4430 else if (!CHECK_MULTISHADOW())
4432 switch (randint1(10))
4434 case 1: case 2: case 3: case 4: case 5:
4436 if (p_ptr->prace == RACE_ANDROID) break;
4437 msg_print(_("人生が逆戻りした気がする。", "You feel like a chunk of the past has been ripped away."));
4438 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
4442 case 6: case 7: case 8: case 9:
4444 switch (randint1(6))
4446 case 1: k = A_STR; act = _("強く", "strong"); break;
4447 case 2: k = A_INT; act = _("聡明で", "bright"); break;
4448 case 3: k = A_WIS; act = _("賢明で", "wise"); break;
4449 case 4: k = A_DEX; act = _("器用で", "agile"); break;
4450 case 5: k = A_CON; act = _("健康で", "hale"); break;
4451 case 6: k = A_CHR; act = _("美しく", "beautiful"); break;
4454 msg_format(_("あなたは以前ほど%sなくなってしまった...。",
4455 "You're not as %s as you used to be..."), act);
4457 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
4458 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
4459 p_ptr->update |= (PU_BONUS);
4465 msg_print(_("あなたは以前ほど力強くなくなってしまった...。",
4466 "You're not as powerful as you used to be..."));
4468 for (k = 0; k < A_MAX; k++)
4470 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
4471 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
4473 p_ptr->update |= (PU_BONUS);
4479 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4483 /* Gravity -- stun plus slowness plus teleport */
4486 if (fuzzy) msg_print(_("何か重いもので攻撃された!", "You are hit by something heavy!"));
4487 msg_print(_("周辺の重力がゆがんだ。", "Gravity warps around you."));
4489 if (!CHECK_MULTISHADOW())
4491 teleport_player(5, TELEPORT_PASSIVE);
4492 if (!p_ptr->levitation)
4493 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4494 if (!(p_ptr->resist_sound || p_ptr->levitation))
4496 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
4497 (void)set_stun(p_ptr->stun + plus_stun);
4500 if (p_ptr->levitation)
4502 dam = (dam * 2) / 3;
4505 if (!p_ptr->levitation || one_in_(13))
4507 inven_damage(set_cold_destroy, 2);
4510 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4514 /* Standard damage */
4515 case GF_DISINTEGRATE:
4517 if (fuzzy) msg_print(_("純粋なエネルギーで攻撃された!", "You are hit by pure energy!"));
4519 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4525 if (fuzzy) msg_print(_("何らかの攻撃によって気分がよくなった。", "You are hit by something invigorating!"));
4527 (void)hp_player(dam);
4534 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4535 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
4542 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
4543 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4549 if (p_ptr->free_act) break;
4550 if (fuzzy) msg_print(_("眠ってしまった!", "You fall asleep!"));
4552 if (ironman_nightmare)
4554 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
4555 /* Have some nightmares */
4556 sanity_blast(NULL, FALSE);
4559 set_paralyzed(p_ptr->paralyzed + dam);
4569 if (fuzzy) msg_print(_("魔法のオーラで攻撃された!", "You are hit by an aura of magic!"));
4570 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4577 if (fuzzy) msg_print(_("エネルギーの塊で攻撃された!", "You are hit by an energy!"));
4578 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
4585 if (fuzzy) msg_print(_("何かが空からあなたの頭上に落ちてきた!", "Something falls from the sky on you!"));
4587 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4588 if (!p_ptr->resist_shard || one_in_(13))
4590 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
4591 inven_damage(set_cold_destroy, 2);
4597 /* Ice -- cold plus stun plus cuts */
4600 if (fuzzy) msg_print(_("何か鋭く冷たいもので攻撃された!", "You are hit by something sharp and cold!"));
4601 get_damage = cold_dam(dam, killer, monspell, FALSE);
4602 if (!CHECK_MULTISHADOW())
4604 if (!p_ptr->resist_shard)
4606 (void)set_cut(p_ptr->cut + damroll(5, 8));
4608 if (!p_ptr->resist_sound)
4610 (void)set_stun(p_ptr->stun + randint1(15));
4613 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
4615 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
4625 if (fuzzy) msg_print(_("何か非常に冷たいもので攻撃された!", "You are hit by something extremely cold!"));
4627 if (p_ptr->mimic_form)
4629 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
4630 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4635 switch (p_ptr->prace)
4637 /* Some races are immune */
4651 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4663 if (CHECK_MULTISHADOW())
4665 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, but you are unharmed!"));
4667 else if (p_ptr->csp)
4671 msg_format(_("%^sに精神エネルギーを吸い取られてしまった!", "%^s draws psychic energy from you!"), m_name);
4673 msg_print(_("精神エネルギーを吸い取られてしまった!", "Your psychic energy is drawn!"));
4676 if (dam >= p_ptr->csp)
4680 p_ptr->csp_frac = 0;
4689 learn_spell(monspell);
4690 p_ptr->redraw |= (PR_MANA);
4691 p_ptr->window |= (PW_PLAYER | PW_SPELL);
4695 /* Heal the monster */
4696 if (m_ptr->hp < m_ptr->maxhp)
4700 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
4702 /* Redraw (later) if needed */
4703 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4704 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4706 /* Special message */
4709 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), m_name);
4722 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
4724 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4725 learn_spell(monspell);
4729 if (!CHECK_MULTISHADOW())
4731 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psionic energy."));
4733 if (!p_ptr->resist_conf)
4735 (void)set_confused(p_ptr->confused + randint0(4) + 4);
4738 if (!p_ptr->resist_chaos && one_in_(3))
4740 (void)set_image(p_ptr->image + randint0(250) + 150);
4747 p_ptr->csp_frac = 0;
4749 p_ptr->redraw |= PR_MANA;
4752 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4758 case GF_BRAIN_SMASH:
4760 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
4762 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4763 learn_spell(monspell);
4767 if (!CHECK_MULTISHADOW())
4769 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psionic energy."));
4775 p_ptr->csp_frac = 0;
4777 p_ptr->redraw |= PR_MANA;
4780 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4781 if (!CHECK_MULTISHADOW())
4783 if (!p_ptr->resist_blind)
4785 (void)set_blind(p_ptr->blind + 8 + randint0(8));
4787 if (!p_ptr->resist_conf)
4789 (void)set_confused(p_ptr->confused + randint0(4) + 4);
4791 if (!p_ptr->free_act)
4793 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
4795 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4797 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
4798 (void)do_dec_stat(A_INT);
4799 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
4800 (void)do_dec_stat(A_WIS);
4802 if (!p_ptr->resist_chaos)
4804 (void)set_image(p_ptr->image + randint0(250) + 150);
4814 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4816 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4817 learn_spell(monspell);
4821 if (!CHECK_MULTISHADOW()) curse_equipment(15, 0);
4822 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4830 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4832 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4833 learn_spell(monspell);
4837 if (!CHECK_MULTISHADOW()) curse_equipment(25, MIN(rlev / 2 - 15, 5));
4838 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4846 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4848 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4849 learn_spell(monspell);
4853 if (!CHECK_MULTISHADOW()) curse_equipment(33, MIN(rlev / 2 - 15, 15));
4854 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4862 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU) && !CHECK_MULTISHADOW())
4864 msg_print(_("しかし秘孔を跳ね返した!", "You resist the effects!"));
4865 learn_spell(monspell);
4869 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4870 if (!CHECK_MULTISHADOW()) (void)set_cut(p_ptr->cut + damroll(10, 10));
4878 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4880 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4881 learn_spell(monspell);
4885 if (!CHECK_MULTISHADOW())
4887 msg_print(_("あなたは命が薄まっていくように感じた!", "You feel your life fade away!"));
4888 curse_equipment(40, 20);
4891 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
4893 if (p_ptr->chp < 1) p_ptr->chp = 1;
4908 /* Hex - revenge damage stored */
4909 revenge_store(get_damage);
4911 if ((p_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
4912 && (get_damage > 0) && !p_ptr->is_dead && (who > 0))
4914 GAME_TEXT m_name_self[80];
4917 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
4919 msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), m_name, m_name_self);
4920 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
4921 if (p_ptr->tim_eyeeye) set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
4924 if (p_ptr->riding && dam > 0)
4926 rakubadam_p = (dam > 200) ? 200 : dam;
4930 disturb(TRUE, TRUE);
4933 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
4935 (void)kawarimi(FALSE);
4938 /* Return "Anything seen?" */
4944 * Find the distance from (x, y) to a line.
4946 POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
4948 /* Vector from (x, y) to (x1, y1) */
4949 POSITION py = y1 - y;
4950 POSITION px = x1 - x;
4953 POSITION ny = x2 - x1;
4954 POSITION nx = y1 - y2;
4957 POSITION pd = distance(y1, x1, y, x);
4958 POSITION nd = distance(y1, x1, y2, x2);
4960 if (pd > nd) return distance(y, x, y2, x2);
4962 /* Component of P on N */
4963 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
4965 /* Absolute value */
4966 return((nd >= 0) ? nd : 0 - nd);
4973 * Modified version of los() for calculation of disintegration balls.
4974 * Disintegration effects are stopped by permanent walls.
4976 bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
4978 POSITION dx, dy; /* Delta */
4979 POSITION ax, ay; /* Absolute */
4980 POSITION sx, sy; /* Signs */
4981 POSITION qx, qy; /* Fractions */
4982 POSITION tx, ty; /* Scanners */
4983 POSITION f1, f2; /* Scale factors */
4984 POSITION m; /* Slope, or 1/Slope, of LOS */
4986 /* Extract the offset */
4990 /* Extract the absolute offset */
4994 /* Handle adjacent (or identical) grids */
4995 if ((ax < 2) && (ay < 2)) return (TRUE);
4997 /* Paranoia -- require "safe" origin */
4998 /* if (!in_bounds(y1, x1)) return (FALSE); */
5000 /* Directly South/North */
5003 /* South -- check for walls */
5006 for (ty = y1 + 1; ty < y2; ty++)
5008 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5012 /* North -- check for walls */
5015 for (ty = y1 - 1; ty > y2; ty--)
5017 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5025 /* Directly East/West */
5028 /* East -- check for walls */
5031 for (tx = x1 + 1; tx < x2; tx++)
5033 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5037 /* West -- check for walls */
5040 for (tx = x1 - 1; tx > x2; tx--)
5042 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5050 /* Extract some signs */
5051 sx = (dx < 0) ? -1 : 1;
5052 sy = (dy < 0) ? -1 : 1;
5054 /* Vertical "knights" */
5059 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
5063 /* Horizontal "knights" */
5068 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
5072 /* Calculate scale factor div 2 */
5075 /* Calculate scale factor */
5079 /* Travel horizontally */
5082 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
5088 /* Consider the special case where slope == 1. */
5099 /* Note (below) the case (qy == f2), where */
5100 /* the LOS exactly meets the corner of a tile. */
5103 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5114 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5127 /* Travel vertically */
5130 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
5146 /* Note (below) the case (qx == f2), where */
5147 /* the LOS exactly meets the corner of a tile. */
5150 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5161 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5182 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)
5187 int brev = rad * rad / dist;
5191 int mdis = distance(y1, x1, y2, x2) + rad;
5193 while (bdis <= mdis)
5197 if ((0 < dist) && (path_n < dist))
5199 POSITION ny = GRID_Y(path_g[path_n]);
5200 POSITION nx = GRID_X(path_g[path_n]);
5201 POSITION nd = distance(ny, nx, y1, x1);
5203 /* Get next base point */
5212 /* Travel from center outward */
5213 for (cdis = 0; cdis <= brad; cdis++)
5215 /* Scan the maximal blast area of radius "cdis" */
5216 for (y = by - cdis; y <= by + cdis; y++)
5218 for (x = bx - cdis; x <= bx + cdis; x++)
5220 /* Ignore "illegal" locations */
5221 if (!in_bounds(y, x)) continue;
5223 /* Enforce a circular "ripple" */
5224 if (distance(y1, x1, y, x) != bdis) continue;
5226 /* Enforce an arc */
5227 if (distance(by, bx, y, x) != cdis) continue;
5233 /* Lights are stopped by opaque terrains */
5234 if (!los(by, bx, y, x)) continue;
5236 case GF_DISINTEGRATE:
5237 /* Disintegration are stopped only by perma-walls */
5238 if (!in_disintegration_range(by, bx, y, x)) continue;
5241 /* Ball explosions are stopped by walls */
5242 if (!projectable(by, bx, y, x)) continue;
5246 /* Save this grid */
5254 /* Encode some more "radius" info */
5255 gm[bdis + 1] = *pgrids;
5257 /* Increase the size */
5258 brad = rad * (path_n + brev) / (dist + brev);
5260 /* Find the next ripple */
5264 /* Store the effect size */
5270 * @brief 汎用的なビーム/ボルト/ボール系処理のルーチン Generic "beam"/"bolt"/"ball" projection routine.
5271 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
5272 * @param rad 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
5273 * @param y 目標Y座標 / Target y location (or location to travel "towards")
5274 * @param x 目標X座標 / Target x location (or location to travel "towards")
5275 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
5276 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
5277 * @param flg 効果フラグ / Extra bit flags (see PROJECT_xxxx in "defines.h")
5278 * @param monspell 効果元のモンスター魔法ID
5279 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
5282 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
5283 * towards a given location (optionally passing over the heads of interposing
5284 * monsters), and have it do a given amount of damage to the monsters (and
5285 * optionally objects) within the given radius of the final location.
5287 * A "bolt" travels from source to target and affects only the target grid.
5288 * A "beam" travels from source to target, affecting all grids passed through.
5289 * A "ball" travels from source to the target, exploding at the target, and
5290 * affecting everything within the given radius of the target location.
5292 * Traditionally, a "bolt" does not affect anything on the ground, and does
5293 * not pass over the heads of interposing monsters, much like a traditional
5294 * missile, and will "stop" abruptly at the "target" even if no monster is
5295 * positioned there, while a "ball", on the other hand, passes over the heads
5296 * of monsters between the source and target, and affects everything except
5297 * the source monster which lies within the final radius, while a "beam"
5298 * affects every monster between the source and target, except for the casting
5299 * monster (or player), and rarely affects things on the ground.
5301 * Two special flags allow us to use this function in special ways, the
5302 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
5303 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
5304 * actually projecting from the source monster (or player).
5306 * The player will only get "experience" for monsters killed by himself
5307 * Unique monsters can only be destroyed by attacks from the player
5309 * Only 256 grids can be affected per projection, limiting the effective
5310 * "radius" of standard ball attacks to nine units (diameter nineteen).
5312 * One can project in a given "direction" by combining PROJECT_THRU with small
5313 * offsets to the initial location (see "line_spell()"), or by calculating
5314 * "virtual targets" far away from the player.
5316 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
5317 * continuing until it actually hits somethings (useful for "stone to mud").
5319 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
5321 * Balls must explode BEFORE hitting walls, or they would affect monsters
5322 * on both sides of a wall. Some bug reports indicate that this is still
5323 * happening in 2.7.8 for Windows, though it appears to be impossible.
5325 * We "pre-calculate" the blast area only in part for efficiency.
5326 * More importantly, this lets us do "explosions" from the "inside" out.
5327 * This results in a more logical distribution of "blast" treasure.
5328 * It also produces a better (in my opinion) animation of the explosion.
5329 * It could be (but is not) used to have the treasure dropped by monsters
5330 * in the middle of the explosion fall "outwards", and then be damaged by
5331 * the blast as it spreads outwards towards the treasure drop location.
5333 * Walls and doors are included in the blast area, so that they can be
5334 * "burned" or "melted" in later versions.
5336 * This algorithm is intended to maximize simplicity, not necessarily
5337 * efficiency, since this function is not a bottleneck in the code.
5339 * We apply the blast effect from ground zero outwards, in several passes,
5340 * first affecting features, then objects, then monsters, then the player.
5341 * This allows walls to be removed before checking the object or monster
5342 * in the wall, and protects objects which are dropped by monsters killed
5343 * in the blast, and allows the player to see all affects before he is
5344 * killed or teleported away. The semantics of this method are open to
5345 * various interpretations, but they seem to work well in practice.
5347 * We process the blast area from ground-zero outwards to allow for better
5348 * distribution of treasure dropped by monsters, and because it provides a
5349 * pleasing visual effect at low cost.
5351 * Note that the damage done by "ball" explosions decreases with distance.
5352 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
5354 * Notice the "napalm" effect of "beam" weapons. First they "project" to
5355 * the target, and then the damage "flows" along this beam of destruction.
5356 * The damage at every grid is the same as at the "center" of a "ball"
5357 * explosion, since the "beam" grids are treated as if they ARE at the
5358 * center of a "ball" explosion.
5360 * Currently, specifying "beam" plus "ball" means that locations which are
5361 * covered by the initial "beam", and also covered by the final "ball", except
5362 * for the final grid (the epicenter of the ball), will be "hit twice", once
5363 * by the initial beam, and once by the exploding ball. For the grid right
5364 * next to the epicenter, this results in 150% damage being done. The center
5365 * does not have this problem, for the same reason the final grid in a "beam"
5366 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
5367 * grids which are covered by the "ball" will NOT work, as then they will
5368 * receive LESS damage than they should. Do not combine "beam" with "ball".
5370 * The array "gy[],gx[]" with current size "grids" is used to hold the
5371 * collected locations of all grids in the "blast area" plus "beam path".
5373 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
5374 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
5375 * first blast grid (see above) with radius "N" from the blast center. Note
5376 * that only the first gm[1] grids in the blast area thus take full damage.
5377 * Also, note that gm[rad+1] is always equal to "grids", which is the total
5378 * number of blast grids.
5380 * Note that once the projection is complete, (y2,x2) holds the final location
5381 * of bolts/beams, and the "epicenter" of balls.
5383 * Note also that "rad" specifies the "inclusive" radius of projection blast,
5384 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
5385 * implementation of the "distance" function. Also, a bolt can be properly
5386 * viewed as a "ball" with a "rad" of "zero".
5388 * Note that if no "target" is reached before the beam/bolt/ball travels the
5389 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
5390 * may be relevant even for bolts, since they have a "1x1" mini-blast.
5392 * Note that for consistency, we "pretend" that the bolt actually takes "time"
5393 * to move from point A to point B, even if the player cannot see part of the
5394 * projection path. Note that in general, the player will *always* see part
5395 * of the path, since it either starts at the player or ends on the player.
5397 * Hack -- we assume that every "projection" is "self-illuminating".
5399 * Hack -- when only a single monster is affected, we automatically track
5400 * (and recall) that monster, unless "PROJECT_JUMP" is used.
5402 * Note that all projections now "explode" at their final destination, even
5403 * if they were being projected at a more distant destination. This means
5404 * that "ball" spells will *always* explode.
5406 * Note that we must call "handle_stuff()" after affecting terrain features
5407 * in the blast radius, in case the "illumination" of the grid was changed,
5408 * and "update_view()" and "update_monsters()" need to be called.
5411 bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
5421 POSITION y_saver, x_saver; /* For reflecting monsters */
5423 int msec = delay_factor * delay_factor * delay_factor;
5425 /* Assume the player sees nothing */
5426 bool notice = FALSE;
5428 /* Assume the player has seen nothing */
5429 bool visual = FALSE;
5431 /* Assume the player has seen no blast grids */
5434 /* Assume to be a normal ball spell */
5435 bool breath = FALSE;
5437 /* Is the player blind? */
5438 bool blind = (p_ptr->blind ? TRUE : FALSE);
5440 bool old_hide = FALSE;
5442 /* Number of grids in the "path" */
5445 /* Actual grids in the "path" */
5448 /* Number of grids in the "blast area" (including the "beam" path) */
5451 /* Coordinates of the affected grids */
5452 POSITION gx[1024], gy[1024];
5454 /* Encoded "radius" info (see above) */
5457 /* Actual radius encoded in gm[] */
5458 POSITION gm_rad = rad;
5462 /* Attacker's name (prepared before polymorph)*/
5463 GAME_TEXT who_name[MAX_NLEN];
5465 /* Can the player see the source of this effect? */
5466 bool see_s_msg = TRUE;
5468 /* Initialize by null string */
5474 /* Default target of monsterspell is player */
5475 monster_target_y = p_ptr->y;
5476 monster_target_x = p_ptr->x;
5478 /* Hack -- Jump to target */
5479 if (flg & (PROJECT_JUMP))
5484 /* Clear the flag */
5485 flg &= ~(PROJECT_JUMP);
5490 /* Start at player */
5497 /* Start at monster */
5500 x1 = current_floor_ptr->m_list[who].fx;
5501 y1 = current_floor_ptr->m_list[who].fy;
5502 monster_desc(who_name, ¤t_floor_ptr->m_list[who], MD_WRONGDOER_NAME);
5514 /* Default "destination" */
5519 /* Hack -- verify stuff */
5520 if (flg & (PROJECT_THRU))
5522 if ((x1 == x2) && (y1 == y2))
5524 flg &= ~(PROJECT_THRU);
5528 /* Handle a breath attack */
5533 if (flg & PROJECT_HIDE) old_hide = TRUE;
5534 flg |= PROJECT_HIDE;
5538 /* Hack -- Assume there will be no blast (max radius 32) */
5539 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
5547 /* Collect beam grids */
5548 if (flg & (PROJECT_BEAM))
5559 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
5561 case GF_DISINTEGRATE:
5562 flg |= (PROJECT_GRID);
5563 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
5567 /* Calculate the projection path */
5569 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
5572 /* Giga-Hack SEEKER & SUPER_RAY */
5574 if( typ == GF_SEEKER )
5584 for (i = 0; i < path_n; ++i)
5589 POSITION ny = GRID_Y(path_g[i]);
5590 POSITION nx = GRID_X(path_g[i]);
5601 /* Only do visuals if requested */
5602 if (!blind && !(flg & (PROJECT_HIDE)))
5604 /* Only do visuals if the player can "see" the bolt */
5605 if (panel_contains(y, x) && player_has_los_bold(y, x))
5612 /* Obtain the bolt pict */
5613 p = bolt_pict(oy, ox, y, x, typ);
5615 /* Extract attr/char */
5619 /* Visual effects */
5620 print_rel(c, a, y, x);
5621 move_cursor_relative(y, x);
5622 /*if (fresh_before)*/ Term_fresh();
5623 Term_xtra(TERM_XTRA_DELAY, msec);
5625 /*if (fresh_before)*/ Term_fresh();
5627 /* Display "beam" grids */
5628 if (flg & (PROJECT_BEAM))
5630 /* Obtain the explosion pict */
5631 p = bolt_pict(y, x, y, x, typ);
5633 /* Extract attr/char */
5637 /* Visual effects */
5638 print_rel(c, a, y, x);
5641 /* Hack -- Activate delay */
5645 /* Hack -- delay anyway for consistency */
5648 /* Delay for consistency */
5649 Term_xtra(TERM_XTRA_DELAY, msec);
5652 if (project_o(0, 0, y, x, dam, GF_SEEKER))notice = TRUE;
5653 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
5655 /* The target of monsterspell becomes tha mirror(broken) */
5656 monster_target_y = y;
5657 monster_target_x = x;
5659 remove_mirror(y, x);
5660 next_mirror(&oy, &ox, y, x);
5662 path_n = i + project_path(&(path_g[i + 1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
5663 for (j = last_i; j <= i; j++)
5665 y = GRID_Y(path_g[j]);
5666 x = GRID_X(path_g[j]);
5667 if (project_m(0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
5668 if (!who && (project_m_n == 1) && !jump) {
5669 if (current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0) {
5670 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5674 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5675 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5679 (void)project_f(0, 0, y, x, dam, GF_SEEKER);
5684 for(i = last_i ; i < path_n ; i++)
5687 py = GRID_Y(path_g[i]);
5688 px = GRID_X(path_g[i]);
5689 if (project_m(0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
5691 if (!who && (project_m_n == 1) && !jump) {
5692 if (current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0)
5694 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5698 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5699 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5703 (void)project_f(0, 0, py, px, dam, GF_SEEKER);
5707 else if(typ == GF_SUPER_RAY){
5709 int second_step = 0;
5716 for (i = 0; i < path_n; ++i)
5721 POSITION ny = GRID_Y(path_g[i]);
5722 POSITION nx = GRID_X(path_g[i]);
5733 /* Only do visuals if requested */
5734 if (!blind && !(flg & (PROJECT_HIDE)))
5736 /* Only do visuals if the player can "see" the bolt */
5737 if (panel_contains(y, x) && player_has_los_bold(y, x))
5744 /* Obtain the bolt pict */
5745 p = bolt_pict(oy, ox, y, x, typ);
5747 /* Extract attr/char */
5751 /* Visual effects */
5752 print_rel(c, a, y, x);
5753 move_cursor_relative(y, x);
5754 /*if (fresh_before)*/ Term_fresh();
5755 Term_xtra(TERM_XTRA_DELAY, msec);
5757 /*if (fresh_before)*/ Term_fresh();
5759 /* Display "beam" grids */
5760 if (flg & (PROJECT_BEAM))
5762 /* Obtain the explosion pict */
5763 p = bolt_pict(y, x, y, x, typ);
5765 /* Extract attr/char */
5769 /* Visual effects */
5770 print_rel(c, a, y, x);
5773 /* Hack -- Activate delay */
5777 /* Hack -- delay anyway for consistency */
5780 /* Delay for consistency */
5781 Term_xtra(TERM_XTRA_DELAY, msec);
5784 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
5785 if (!cave_have_flag_bold(y, x, FF_PROJECT))
5787 if( second_step )continue;
5790 if( is_mirror_grid(¤t_floor_ptr->grid_array[y][x]) && !second_step )
5792 /* The target of monsterspell becomes tha mirror(broken) */
5793 monster_target_y = y;
5794 monster_target_x = x;
5797 for( j = 0; j <=i ; j++ )
5799 y = GRID_Y(path_g[j]);
5800 x = GRID_X(path_g[j]);
5801 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
5805 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
5806 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
5807 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
5808 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
5809 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
5810 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
5811 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
5812 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
5815 for( i = 0; i < path_n ; i++ )
5818 py = GRID_Y(path_g[i]);
5819 px = GRID_X(path_g[i]);
5820 (void)project_m(0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
5821 if(!who && (project_m_n == 1) && !jump){
5822 if(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx >0 ){
5823 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5827 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5828 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5832 (void)project_f(0, 0, py, px, dam, GF_SUPER_RAY);
5837 /* Project along the path */
5838 for (i = 0; i < path_n; ++i)
5843 POSITION ny = GRID_Y(path_g[i]);
5844 POSITION nx = GRID_X(path_g[i]);
5846 if (flg & PROJECT_DISI)
5848 /* Hack -- Balls explode before reaching walls */
5849 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
5851 else if (flg & PROJECT_LOS)
5853 /* Hack -- Balls explode before reaching walls */
5854 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
5858 /* Hack -- Balls explode before reaching walls */
5859 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
5866 /* Collect beam grids */
5867 if (flg & (PROJECT_BEAM))
5874 /* Only do visuals if requested */
5875 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
5877 /* Only do visuals if the player can "see" the bolt */
5878 if (panel_contains(y, x) && player_has_los_bold(y, x))
5885 /* Obtain the bolt pict */
5886 p = bolt_pict(oy, ox, y, x, typ);
5888 /* Extract attr/char */
5892 /* Visual effects */
5893 print_rel(c, a, y, x);
5894 move_cursor_relative(y, x);
5895 /*if (fresh_before)*/ Term_fresh();
5896 Term_xtra(TERM_XTRA_DELAY, msec);
5898 /*if (fresh_before)*/ Term_fresh();
5900 /* Display "beam" grids */
5901 if (flg & (PROJECT_BEAM))
5903 /* Obtain the explosion pict */
5904 p = bolt_pict(y, x, y, x, typ);
5906 /* Extract attr/char */
5910 /* Visual effects */
5911 print_rel(c, a, y, x);
5914 /* Hack -- Activate delay */
5918 /* Hack -- delay anyway for consistency */
5921 /* Delay for consistency */
5922 Term_xtra(TERM_XTRA_DELAY, msec);
5929 /* Save the "blast epicenter" */
5933 if (breath && !path_n)
5939 flg &= ~(PROJECT_HIDE);
5943 /* Start the "explosion" */
5946 /* Hack -- make sure beams get to "explode" */
5954 /* If we found a "target", explode there */
5955 if (dist <= MAX_RANGE)
5957 /* Mega-Hack -- remove the final "beam" grid */
5958 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
5961 * Create a conical breath attack
5972 flg &= ~(PROJECT_HIDE);
5974 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
5978 /* Determine the blast area, work from the inside out */
5979 for (dist = 0; dist <= rad; dist++)
5981 /* Scan the maximal blast area of radius "dist" */
5982 for (y = by - dist; y <= by + dist; y++)
5984 for (x = bx - dist; x <= bx + dist; x++)
5986 /* Ignore "illegal" locations */
5987 if (!in_bounds2(y, x)) continue;
5989 /* Enforce a "circular" explosion */
5990 if (distance(by, bx, y, x) != dist) continue;
5996 /* Lights are stopped by opaque terrains */
5997 if (!los(by, bx, y, x)) continue;
5999 case GF_DISINTEGRATE:
6000 /* Disintegration are stopped only by perma-walls */
6001 if (!in_disintegration_range(by, bx, y, x)) continue;
6004 /* Ball explosions are stopped by walls */
6005 if (!projectable(by, bx, y, x)) continue;
6009 /* Save this grid */
6016 /* Encode some more "radius" info */
6022 /* Speed -- ignore "non-explosions" */
6023 if (!grids) return (FALSE);
6026 /* Display the "blast area" if requested */
6027 if (!blind && !(flg & (PROJECT_HIDE)))
6029 /* Then do the "blast", from inside out */
6030 for (t = 0; t <= gm_rad; t++)
6032 /* Dump everything with this radius */
6033 for (i = gm[t]; i < gm[t+1]; i++)
6035 /* Extract the location */
6039 /* Only do visuals if the player can "see" the blast */
6040 if (panel_contains(y, x) && player_has_los_bold(y, x))
6049 /* Obtain the explosion pict */
6050 p = bolt_pict(y, x, y, x, typ);
6052 /* Extract attr/char */
6056 /* Visual effects -- Display */
6057 print_rel(c, a, y, x);
6061 /* Hack -- center the cursor */
6062 move_cursor_relative(by, bx);
6064 /* Flush each "radius" seperately */
6065 /*if (fresh_before)*/ Term_fresh();
6067 /* Delay (efficiently) */
6068 if (visual || drawn)
6070 Term_xtra(TERM_XTRA_DELAY, msec);
6074 /* Flush the erasing */
6077 /* Erase the explosion drawn above */
6078 for (i = 0; i < grids; i++)
6080 /* Extract the location */
6084 /* Hack -- Erase if needed */
6085 if (panel_contains(y, x) && player_has_los_bold(y, x))
6091 /* Hack -- center the cursor */
6092 move_cursor_relative(by, bx);
6094 /* Flush the explosion */
6095 /*if (fresh_before)*/ Term_fresh();
6099 update_creature(p_ptr);
6101 if (flg & PROJECT_KILL)
6103 see_s_msg = (who > 0) ? is_seen(¤t_floor_ptr->m_list[who]) :
6104 (!who ? TRUE : (player_can_see_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)));
6108 /* Check features */
6109 if (flg & (PROJECT_GRID))
6111 /* Start with "dist" of zero */
6114 /* Scan for features */
6115 for (i = 0; i < grids; i++)
6117 /* Hack -- Notice new "dist" values */
6118 if (gm[dist+1] == i) dist++;
6120 /* Get the grid location */
6124 /* Find the closest point in the blast */
6127 int d = dist_to_line(y, x, y1, x1, by, bx);
6129 /* Affect the grid */
6130 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
6134 /* Affect the grid */
6135 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
6140 update_creature(p_ptr);
6143 if (flg & (PROJECT_ITEM))
6145 /* Start with "dist" of zero */
6148 /* Scan for objects */
6149 for (i = 0; i < grids; i++)
6151 /* Hack -- Notice new "dist" values */
6152 if (gm[dist+1] == i) dist++;
6154 /* Get the grid location */
6158 /* Find the closest point in the blast */
6161 int d = dist_to_line(y, x, y1, x1, by, bx);
6163 /* Affect the object in the grid */
6164 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
6168 /* Affect the object in the grid */
6169 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
6175 /* Check monsters */
6176 if (flg & (PROJECT_KILL))
6183 /* Start with "dist" of zero */
6186 /* Scan for monsters */
6187 for (i = 0; i < grids; i++)
6191 /* Hack -- Notice new "dist" values */
6192 if (gm[dist + 1] == i) dist++;
6194 /* Get the grid location */
6198 /* A single bolt may be reflected */
6201 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
6202 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
6204 if ((flg & PROJECT_REFLECTABLE) && current_floor_ptr->grid_array[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
6205 ((current_floor_ptr->grid_array[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
6206 (!who || dist_hack > 1) && !one_in_(10))
6209 int max_attempts = 10;
6211 /* Choose 'new' target */
6214 t_y = y_saver - 1 + randint1(3);
6215 t_x = x_saver - 1 + randint1(3);
6218 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
6220 if (max_attempts < 1)
6226 sound(SOUND_REFLECT);
6229 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
6230 msg_print(_("「北斗神拳奥義・二指真空把!」", "The attack bounces!"));
6231 else if (m_ptr->r_idx == MON_DIO)
6232 msg_print(_("ディオ・ブランドーは指一本で攻撃を弾き返した!", "The attack bounces!"));
6234 msg_print(_("攻撃は跳ね返った!", "The attack bounces!"));
6236 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
6238 /* Reflected bolts randomly target either one */
6239 if (player_bold(y, x) || one_in_(2)) flg &= ~(PROJECT_PLAYER);
6240 else flg |= PROJECT_PLAYER;
6242 /* The bolt is reflected */
6243 project(current_floor_ptr->grid_array[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
6245 /* Don't affect the monster any longer */
6251 /* Find the closest point in the blast */
6254 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
6258 effective_dist = dist;
6262 /* There is the riding player on this monster */
6263 if (p_ptr->riding && player_bold(y, x))
6265 /* Aimed on the player */
6266 if (flg & PROJECT_PLAYER)
6268 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
6271 * A beam or bolt is well aimed
6273 * So don't affects the mount.
6280 * The spell is not well aimed,
6281 * So partly affect the mount too.
6288 * This grid is the original target.
6289 * Or aimed on your horse.
6291 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
6293 /* Hit the mount with full damage */
6297 * Otherwise this grid is not the
6298 * original target, it means that line
6299 * of fire is obstructed by this
6303 * A beam or bolt will hit either
6304 * player or mount. Choose randomly.
6306 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
6310 /* Hit the mount with full damage */
6314 /* Hit the player later */
6315 flg |= PROJECT_PLAYER;
6317 /* Don't affect the mount */
6323 * The spell is not well aimed, so
6324 * partly affect both player and
6333 /* Affect the monster in the grid */
6334 if (project_m(who, effective_dist, y, x, dam, typ, flg, see_s_msg)) notice = TRUE;
6338 /* Player affected one monster (without "jumping") */
6339 if (!who && (project_m_n == 1) && !jump)
6344 /* Track if possible */
6345 if (current_floor_ptr->grid_array[y][x].m_idx > 0)
6347 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
6351 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6352 health_track(current_floor_ptr->grid_array[y][x].m_idx);
6360 if (flg & (PROJECT_KILL))
6362 /* Start with "dist" of zero */
6365 /* Scan for player */
6366 for (i = 0; i < grids; i++)
6370 /* Hack -- Notice new "dist" values */
6371 if (gm[dist+1] == i) dist++;
6373 /* Get the grid location */
6377 /* Affect the player? */
6378 if (!player_bold(y, x)) continue;
6380 /* Find the closest point in the blast */
6383 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
6387 effective_dist = dist;
6390 /* Target may be your horse */
6393 /* Aimed on the player */
6394 if (flg & PROJECT_PLAYER)
6396 /* Hit the player with full damage */
6400 * Hack -- When this grid was not the
6401 * original target, a beam or bolt
6402 * would hit either player or mount,
6403 * and should be choosen randomly.
6405 * But already choosen to hit the
6406 * mount at this point.
6408 * Or aimed on your horse.
6410 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
6413 * A beam or bolt is well aimed
6415 * So don't affects the player.
6422 * The spell is not well aimed,
6423 * So partly affect the player too.
6429 /* Affect the player */
6430 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
6436 GAME_TEXT m_name[MAX_NLEN];
6438 monster_desc(m_name, ¤t_floor_ptr->m_list[p_ptr->riding], 0);
6440 if (rakubadam_m > 0)
6442 if (rakuba(rakubadam_m, FALSE))
6444 msg_format(_("%^sに振り落とされた!", "%^s has thrown you off!"), m_name);
6447 if (p_ptr->riding && rakubadam_p > 0)
6449 if(rakuba(rakubadam_p, FALSE))
6451 msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_name);
6456 /* Return "something was noticed" */
6461 * @brief 鏡魔法「封魔結界」の効果処理
6463 * @return 効果があったらTRUEを返す
6465 bool binding_field(HIT_POINT dam)
6467 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
6468 int mirror_num = 0; /* 鏡の数 */
6470 POSITION centersign;
6471 POSITION x1, x2, y1, y2;
6473 int msec = delay_factor*delay_factor*delay_factor;
6476 POSITION point_x[3];
6477 POSITION point_y[3];
6479 /* Default target of monsterspell is player */
6480 monster_target_y = p_ptr->y;
6481 monster_target_x = p_ptr->x;
6483 for (x = 0; x < current_floor_ptr->width; x++)
6485 for (y = 0; y < current_floor_ptr->height; y++)
6487 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]) &&
6488 distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
6489 distance(p_ptr->y, p_ptr->x, y, x) != 0 &&
6490 player_has_los_bold(y, x) &&
6491 projectable(p_ptr->y, p_ptr->x, y, x)
6493 mirror_y[mirror_num] = y;
6494 mirror_x[mirror_num] = x;
6500 if (mirror_num < 2)return FALSE;
6502 point_x[0] = randint0(mirror_num);
6504 point_x[1] = randint0(mirror_num);
6505 } while (point_x[0] == point_x[1]);
6507 point_y[0] = mirror_y[point_x[0]];
6508 point_x[0] = mirror_x[point_x[0]];
6509 point_y[1] = mirror_y[point_x[1]];
6510 point_x[1] = mirror_x[point_x[1]];
6511 point_y[2] = p_ptr->y;
6512 point_x[2] = p_ptr->x;
6514 x = point_x[0] + point_x[1] + point_x[2];
6515 y = point_y[0] + point_y[1] + point_y[2];
6517 centersign = (point_x[0] * 3 - x)*(point_y[1] * 3 - y)
6518 - (point_y[0] * 3 - y)*(point_x[1] * 3 - x);
6519 if (centersign == 0)return FALSE;
6521 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
6522 x1 = x1 < point_x[2] ? x1 : point_x[2];
6523 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
6524 y1 = y1 < point_y[2] ? y1 : point_y[2];
6526 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
6527 x2 = x2 > point_x[2] ? x2 : point_x[2];
6528 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
6529 y2 = y2 > point_y[2] ? y2 : point_y[2];
6531 for (y = y1; y <= y2; y++) {
6532 for (x = x1; x <= x2; x++) {
6533 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6534 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6535 centersign*((point_x[1] - x)*(point_y[2] - y)
6536 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6537 centersign*((point_x[2] - x)*(point_y[0] - y)
6538 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6540 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6541 /* Visual effects */
6543 && panel_contains(y, x)) {
6544 p = bolt_pict(y, x, y, x, GF_MANA);
6545 print_rel(PICT_C(p), PICT_A(p), y, x);
6546 move_cursor_relative(y, x);
6547 /*if (fresh_before)*/ Term_fresh();
6548 Term_xtra(TERM_XTRA_DELAY, msec);
6554 for (y = y1; y <= y2; y++) {
6555 for (x = x1; x <= x2; x++) {
6556 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6557 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6558 centersign*((point_x[1] - x)*(point_y[2] - y)
6559 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6560 centersign*((point_x[2] - x)*(point_y[0] - y)
6561 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6563 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6564 (void)project_f(0, 0, y, x, dam, GF_MANA);
6569 for (y = y1; y <= y2; y++) {
6570 for (x = x1; x <= x2; x++) {
6571 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6572 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6573 centersign*((point_x[1] - x)*(point_y[2] - y)
6574 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6575 centersign*((point_x[2] - x)*(point_y[0] - y)
6576 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6578 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6579 (void)project_o(0, 0, y, x, dam, GF_MANA);
6584 for (y = y1; y <= y2; y++) {
6585 for (x = x1; x <= x2; x++) {
6586 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6587 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6588 centersign*((point_x[1] - x)*(point_y[2] - y)
6589 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6590 centersign*((point_x[2] - x)*(point_y[0] - y)
6591 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6593 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6594 (void)project_m(0, 0, y, x, dam, GF_MANA,
6595 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE);
6601 msg_print(_("鏡が結界に耐えきれず、壊れてしまった。", "The field broke a mirror"));
6602 remove_mirror(point_y[0], point_x[0]);
6609 * @brief 鏡魔法「鏡の封印」の効果処理
6611 * @return 効果があったらTRUEを返す
6613 void seal_of_mirror(HIT_POINT dam)
6617 for (x = 0; x < current_floor_ptr->width; x++)
6619 for (y = 0; y < current_floor_ptr->height; y++)
6621 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
6623 if (project_m(0, 0, y, x, dam, GF_GENOCIDE,
6624 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE))
6626 if (!current_floor_ptr->grid_array[y][x].m_idx)
6628 remove_mirror(y, x);
6640 * @brief 領域魔法に応じて技能の名称を返す。
6641 * @param tval 魔法書のtval
6642 * @return 領域魔法の技能名称を保管した文字列ポインタ
6644 concptr spell_category_name(OBJECT_TYPE_VALUE tval)
6648 case TV_HISSATSU_BOOK:
6649 return _("必殺技", "art");
6651 return _("祈り", "prayer");
6653 return _("歌", "song");
6655 return _("呪文", "spell");