3 * @brief 魔法による遠隔処理の実装 / Spell projection
7 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research,
9 * and not for profit purposes provided that this copyright and statement
10 * are included in all such copies. Other copyrights may also apply.
17 #include "object-curse.h"
18 #include "player-damage.h"
21 #include "monster-status.h"
22 #include "spells-diceroll.h"
23 #include "spells-summon.h"
24 #include "monsterrace-hook.h"
28 #include "projection.h"
33 #include "player-status.h"
34 #include "player-move.h"
35 #include "realm-hex.h"
36 #include "object-hook.h"
42 static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
43 static int rakubadam_p; /*!< 落馬した際のダメージ量 */
45 int project_length = 0; /*!< 投射の射程距離 */
50 * @brief 配置した鏡リストの次を取得する /
51 * Get another mirror. for SEEKER
52 * @param next_y 次の鏡のy座標を返す参照ポインタ
53 * @param next_x 次の鏡のx座標を返す参照ポインタ
54 * @param cury 現在の鏡のy座標
55 * @param curx 現在の鏡のx座標
57 static void next_mirror(POSITION* next_y, POSITION* next_x, POSITION cury, POSITION curx)
59 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
60 int mirror_num = 0; /* 鏡の数 */
64 for (x = 0; x < current_floor_ptr->width; x++)
66 for (y = 0; y < current_floor_ptr->height; y++)
68 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x])) {
69 mirror_y[mirror_num] = y;
70 mirror_x[mirror_num] = x;
77 num = randint0(mirror_num);
78 *next_y = mirror_y[num];
79 *next_x = mirror_x[num];
82 *next_y = cury + randint0(5) - 2;
83 *next_x = curx + randint0(5) - 2;
89 * Mega-Hack -- track "affected" monsters (see "project()" comments)
91 static int project_m_n; /*!< 魔法効果範囲内にいるモンスターの数 */
92 static POSITION project_m_x; /*!< 処理中のモンスターX座標 */
93 static POSITION project_m_y; /*!< 処理中のモンスターY座標 */
94 /* Mega-Hack -- monsters target */
95 static POSITION monster_target_x; /*!< モンスターの攻撃目標X座標 */
96 static POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
100 * @brief 汎用的なビーム/ボルト/ボール系による地形効果処理 / We are called from "project()" to "damage" terrain features
101 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
102 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
103 * @param y 目標Y座標 / Target y location (or location to travel "towards")
104 * @param x 目標X座標 / Target x location (or location to travel "towards")
105 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
106 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
107 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
110 * We are called both for "beam" effects and "ball" effects.
112 * The "r" parameter is the "distance from ground zero".
114 * Note that we determine if the player can "see" anything that happens
115 * by taking into account: blindness, line-of-sight, and illumination.
117 * We return "TRUE" if the effect of the projection is "obvious".
119 * We also "see" grids which are "memorized", probably a hack
121 * Perhaps we should affect doors?
124 static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
126 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
127 feature_type *f_ptr = &f_info[g_ptr->feat];
129 bool obvious = FALSE;
130 bool known = player_has_los_bold(y, x);
135 /* Reduce damage by distance */
136 dam = (dam + r) / (r + 1);
139 if (have_flag(f_ptr->flags, FF_TREE))
147 message = _("枯れた", "was blasted."); break;
149 message = _("縮んだ", "shrank."); break;
151 message = _("溶けた", "melted."); break;
154 message = _("凍り、砕け散った", "was frozen and smashed."); break;
158 message = _("燃えた", "burns up!"); break;
170 message = _("粉砕された", "was crushed."); break;
172 message = NULL; break;
176 msg_format(_("木は%s。", "A tree %s"), message);
177 cave_set_feat(y, x, one_in_(3) ? feat_brake : feat_grass);
180 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
184 /* Analyze the type */
187 /* Ignore most effects */
222 /* Destroy Traps (and Locks) */
225 /* Reveal secret doors */
226 if (is_hidden_door(g_ptr))
231 /* Check line of sight */
239 if (is_trap(g_ptr->feat))
241 /* Check line of sight */
244 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
248 /* Destroy the trap */
249 cave_alter_feat(y, x, FF_DISARM);
252 /* Locked doors are unlocked */
253 if (is_closed_door(g_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
255 FEAT_IDX old_feat = g_ptr->feat;
257 /* Unlock the door */
258 cave_alter_feat(y, x, FF_DISARM);
260 /* Check line of sound */
261 if (known && (old_feat != g_ptr->feat))
263 msg_print(_("カチッと音がした!", "Click!"));
268 /* Remove "unsafe" flag if player is not blind */
269 if (!p_ptr->blind && player_has_los_bold(y, x))
271 g_ptr->info &= ~(CAVE_UNSAFE);
279 /* Destroy Doors (and traps) */
282 /* Destroy all doors and traps */
283 if (is_trap(g_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
285 /* Check line of sight */
288 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
292 /* Destroy the feature */
293 cave_alter_feat(y, x, FF_TUNNEL);
296 /* Remove "unsafe" flag if player is not blind */
297 if (!p_ptr->blind && player_has_los_bold(y, x))
299 g_ptr->info &= ~(CAVE_UNSAFE);
307 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
309 if (have_flag(f_ptr->flags, FF_SPIKE))
311 s16b old_mimic = g_ptr->mimic;
312 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)];
314 cave_alter_feat(y, x, FF_SPIKE);
315 g_ptr->mimic = old_mimic;
320 /* Check line of sight */
321 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
323 msg_format(_("%sに何かがつっかえて開かなくなった。", "The %s seems stuck."), f_name + mimic_f_ptr->name);
330 /* Destroy walls (and doors) */
333 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
335 if (known && (g_ptr->info & (CAVE_MARK)))
337 msg_format(_("%sが溶けて泥になった!", "The %s turns into mud!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
341 /* Destroy the wall */
342 cave_alter_feat(y, x, FF_HURT_ROCK);
344 /* Update some things */
345 p_ptr->update |= (PU_FLOW);
353 if (!cave_naked_bold(y, x)) break;
354 if (player_bold(y, x)) break;
355 cave_set_feat(y, x, feat_door[DOOR_DOOR].closed);
356 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
368 if (!cave_naked_bold(y, x)) break;
369 if (player_bold(y, x)) break;
370 cave_set_feat(y, x, feat_tree);
371 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
377 if (!cave_naked_bold(y, x)) break;
378 g_ptr->info |= CAVE_OBJECT;
379 g_ptr->mimic = feat_glyph;
387 if (!cave_naked_bold(y, x)) break;
388 if (player_bold(y, x)) break;
389 cave_set_feat(y, x, feat_granite);
395 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
398 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
399 cave_set_feat(y, x, feat_shallow_lava);
403 cave_set_feat(y, x, feat_deep_lava);
410 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
413 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
414 cave_set_feat(y, x, feat_shallow_water);
418 cave_set_feat(y, x, feat_deep_water);
423 /* Lite up the grid */
427 /* Turn on the light */
428 if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
430 g_ptr->info |= (CAVE_GLOW);
433 update_local_illumination(y, x);
436 if (player_can_see_bold(y, x)) obvious = TRUE;
438 /* Mega-Hack -- Update the monster in the affected grid */
439 /* This allows "spear of light" (etc) to work "correctly" */
440 if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE);
442 if (p_ptr->special_defense & NINJA_S_STEALTH)
444 if (player_bold(y, x)) set_superstealth(FALSE);
451 /* Darken the grid */
455 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(g_ptr);
458 /* Turn off the light. */
461 if (current_floor_ptr->dun_level || !is_daytime())
463 for (j = 0; j < 9; j++)
465 int by = y + ddy_ddd[j];
466 int bx = x + ddx_ddd[j];
468 if (in_bounds2(by, bx))
470 grid_type *cc_ptr = ¤t_floor_ptr->grid_array[by][bx];
472 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
483 g_ptr->info &= ~(CAVE_GLOW);
485 /* Hack -- Forget "boring" grids */
486 if (!have_flag(f_ptr->flags, FF_REMEMBER))
489 g_ptr->info &= ~(CAVE_MARK);
496 update_local_illumination(y, x);
498 if (player_can_see_bold(y, x)) obvious = TRUE;
500 /* Mega-Hack -- Update the monster in the affected grid */
501 /* This allows "spear of light" (etc) to work "correctly" */
502 if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE);
512 if (is_mirror_grid(g_ptr))
514 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
517 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
520 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 50))
522 if (known && (g_ptr->info & CAVE_MARK))
524 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
528 /* Destroy the wall */
529 cave_alter_feat(y, x, FF_HURT_ROCK);
531 /* Update some things */
532 p_ptr->update |= (PU_FLOW);
539 if (is_mirror_grid(g_ptr) && p_ptr->lev < 40)
541 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
544 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
547 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 200))
549 if (known && (g_ptr->info & CAVE_MARK))
551 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
555 /* Destroy the wall */
556 cave_alter_feat(y, x, FF_HURT_ROCK);
558 /* Update some things */
559 p_ptr->update |= (PU_FLOW);
564 case GF_DISINTEGRATE:
566 /* Destroy mirror/glyph */
567 if (is_mirror_grid(g_ptr) || is_glyph_grid(g_ptr) || is_explosive_rune_grid(g_ptr))
570 /* Permanent features don't get effect */
571 /* But not protect monsters and other objects */
572 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
574 cave_alter_feat(y, x, FF_HURT_DISI);
576 /* Update some things -- similar to GF_KILL_WALL */
577 p_ptr->update |= (PU_FLOW);
584 /* Return "Anything seen?" */
591 * @brief 汎用的なビーム/ボルト/ボール系によるアイテムオブジェクトへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
592 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
593 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
594 * @param y 目標Y座標 / Target y location (or location to travel "towards")
595 * @param x 目標X座標 / Target x location (or location to travel "towards")
596 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
597 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
598 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
601 * We are called from "project()" to "damage" objects
603 * We are called both for "beam" effects and "ball" effects.
605 * Perhaps we should only SOMETIMES damage things on the ground.
607 * The "r" parameter is the "distance from ground zero".
609 * Note that we determine if the player can "see" anything that happens
610 * by taking into account: blindness, line-of-sight, and illumination.
612 * We also "see" grids which are "memorized", probably a hack
614 * We return "TRUE" if the effect of the projection is "obvious".
617 static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
619 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
621 OBJECT_IDX this_o_idx, next_o_idx = 0;
623 bool obvious = FALSE;
624 bool known = player_has_los_bold(y, x);
626 BIT_FLAGS flgs[TR_FLAG_SIZE];
628 GAME_TEXT o_name[MAX_NLEN];
630 KIND_OBJECT_IDX k_idx = 0;
631 bool is_potion = FALSE;
636 /* Reduce damage by distance */
637 dam = (dam + r) / (r + 1);
640 /* Scan all objects in the grid */
641 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
643 object_type *o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
647 bool do_kill = FALSE;
649 concptr note_kill = NULL;
652 /* Get the "plural"-ness */
653 bool plural = (o_ptr->number > 1);
655 next_o_idx = o_ptr->next_o_idx;
656 object_flags(o_ptr, flgs);
658 /* Check for artifact */
659 if (object_is_artifact(o_ptr)) is_art = TRUE;
661 /* Analyze the type */
664 /* Acid -- Lots of things */
667 if (hates_acid(o_ptr))
670 note_kill = _("融けてしまった!", (plural ? " melt!" : " melts!"));
671 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
676 /* Elec -- Rings and Wands */
679 if (hates_elec(o_ptr))
682 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
683 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
688 /* Fire -- Flammable objects */
691 if (hates_fire(o_ptr))
694 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
695 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
700 /* Cold -- potions and flasks */
703 if (hates_cold(o_ptr))
705 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
707 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
715 if (hates_fire(o_ptr))
718 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
719 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
721 if (hates_elec(o_ptr))
725 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
726 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
734 if (hates_fire(o_ptr))
737 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
738 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
740 if (hates_cold(o_ptr))
744 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
745 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
750 /* Hack -- break potions and such */
756 if (hates_cold(o_ptr))
758 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
764 /* Mana and Chaos -- destroy everything */
770 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
774 case GF_DISINTEGRATE:
777 note_kill = _("蒸発してしまった!", (plural ? " evaporate!" : " evaporates!"));
784 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
785 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
786 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
790 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
794 if (object_is_cursed(o_ptr))
797 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
804 identify_item(o_ptr);
806 /* Auto-inscription */
807 autopick_alter_item((-this_o_idx), FALSE);
815 /* Chests are noticed only if trapped or locked */
816 if (o_ptr->tval == TV_CHEST)
818 /* Disarm/Unlock traps */
821 /* Disarm or Unlock */
822 o_ptr->pval = (0 - o_ptr->pval);
827 if (known && (o_ptr->marked & OM_FOUND))
829 msg_print(_("カチッと音がした!", "Click!"));
839 if (o_ptr->tval == TV_CORPSE)
844 if (!who || is_pet(¤t_floor_ptr->m_list[who]))
845 mode |= PM_FORCE_PET;
847 for (i = 0; i < o_ptr->number ; i++)
849 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
850 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
854 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
858 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
860 note_kill = _("生き返った。", " revived.");
864 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
875 /* Attempt to destroy the object */
878 /* Effect "observed" */
879 if (known && (o_ptr->marked & OM_FOUND))
882 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
885 /* Artifacts, and other objects, get to resist */
886 if (is_art || ignore)
888 /* Observe the resist */
889 if (known && (o_ptr->marked & OM_FOUND))
891 msg_format(_("%sは影響を受けない!",
892 (plural ? "The %s are unaffected!" : "The %s is unaffected!")), o_name);
899 /* Describe if needed */
900 if (known && (o_ptr->marked & OM_FOUND) && note_kill)
902 msg_format(_("%sは%s", "The %s%s"), o_name, note_kill);
905 k_idx = o_ptr->k_idx;
906 is_potion = object_is_potion(o_ptr);
907 delete_object_idx(this_o_idx);
909 /* Potions produce effects when 'shattered' */
912 (void)potion_smash_effect(who, y, x, k_idx);
920 /* Return "Anything seen?" */
926 * @brief 汎用的なビーム/ボルト/ボール系によるモンスターへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
927 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
928 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
929 * @param y 目標Y座標 / Target y location (or location to travel "towards")
930 * @param x 目標X座標 / Target x location (or location to travel "towards")
931 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
932 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
934 * @param see_s_msg TRUEならばメッセージを表示する
935 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
938 * This routine takes a "source monster" (by index) which is mostly used to
939 * determine if the player is causing the damage, and a "radius" (see below),
940 * which is used to decrease the power of explosions with distance, and a
941 * location, via integers which are modified by certain types of attacks
942 * (polymorph and teleport being the obvious ones), a default damage, which
943 * is modified as needed based on various properties, and finally a "damage
947 * Note that this routine can handle "no damage" attacks (like teleport) by
948 * taking a "zero" damage, and can even take "parameters" to attacks (like
949 * confuse) by accepting a "damage", using it to calculate the effect, and
950 * then setting the damage to zero. Note that the "damage" parameter is
951 * divided by the radius, so monsters not at the "epicenter" will not take
952 * as much damage (or whatever)...
955 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
956 * may result in a dereference of an invalid pointer.
959 * Various messages are produced, and damage is applied.
962 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
963 * actually be "made" of that substance, or "breathe" big balls of it.
964 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
966 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
967 * and hurts evil less. If can breath nether, then it resists it as well.
970 * Damage reductions use the following formulas:
971 * Note that "dam = dam * 6 / (randint1(6) + 6);"
972 * gives avg damage of .655, ranging from .858 to .500
973 * Note that "dam = dam * 5 / (randint1(6) + 6);"
974 * gives avg damage of .544, ranging from .714 to .417
975 * Note that "dam = dam * 4 / (randint1(6) + 6);"
976 * gives avg damage of .444, ranging from .556 to .333
977 * Note that "dam = dam * 3 / (randint1(6) + 6);"
978 * gives avg damage of .327, ranging from .427 to .250
979 * Note that "dam = dam * 2 / (randint1(6) + 6);"
980 * gives something simple.
983 * In this function, "result" messages are postponed until the end, where
984 * the "note" string is appended to the monster name, if not NULL. So,
985 * to make a spell have "no effect" just set "note" to NULL. You should
986 * also set "notice" to FALSE, or the player will learn what the spell does.
989 * We attempt to return "TRUE" if the player saw anything "useful" happen.
993 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)
997 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
999 monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
1000 monster_type *caster_ptr = (who > 0) ? ¤t_floor_ptr->m_list[who] : NULL;
1002 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1006 /* Is the monster "seen"? */
1007 bool seen = m_ptr->ml;
1008 bool seen_msg = is_seen(m_ptr);
1010 bool slept = (bool)MON_CSLEEP(m_ptr);
1012 /* Were the effects "obvious" (if seen)? */
1013 bool obvious = FALSE;
1015 /* Can the player know about this effect? */
1016 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1018 /* Were the effects "irrelevant"? */
1019 bool skipped = FALSE;
1021 /* Gets the monster angry at the source of the effect? */
1022 bool get_angry = FALSE;
1024 /* Polymorph setting (true or false) */
1025 bool do_poly = FALSE;
1027 /* Teleport setting (max distance) */
1030 /* Confusion setting (amount to confuse) */
1033 /* Stunning setting (amount to stun) */
1036 /* Sleep amount (amount to sleep) */
1039 /* Fear amount (amount to fear) */
1042 /* Time amount (amount to time) */
1045 bool heal_leper = FALSE;
1047 /* Hold the monster name */
1048 GAME_TEXT m_name[MAX_NLEN];
1051 PARAMETER_VALUE photo = 0;
1053 /* Assume no note */
1054 concptr note = NULL;
1056 /* Assume a default death */
1057 concptr note_dies = extract_note_dies(real_r_idx(m_ptr));
1059 DEPTH caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1062 if (!g_ptr->m_idx) return (FALSE);
1064 /* Never affect projector */
1065 if (who && (g_ptr->m_idx == who)) return (FALSE);
1066 if ((g_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1067 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1069 /* Don't affect already death monsters */
1070 /* Prevents problems with chain reactions of exploding monsters */
1071 if (m_ptr->hp < 0) return (FALSE);
1073 /* Reduce damage by distance */
1074 dam = (dam + r) / (r + 1);
1077 /* Get the monster name (BEFORE polymorphing) */
1078 monster_desc(m_name, m_ptr, 0);
1080 /* Get the monster possessive ("his"/"her"/"its") */
1081 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1083 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
1085 if (r_ptr->flagsr & RFR_RES_ALL &&
1086 typ != GF_OLD_CLONE && typ != GF_STAR_HEAL && typ != GF_OLD_HEAL
1087 && typ != GF_OLD_SPEED && typ != GF_CAPTURE && typ != GF_PHOTO)
1089 note = _("には完全な耐性がある!", " is immune.");
1091 if(is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1092 if(typ == GF_LITE_WEAK || typ == GF_KILL_WALL) skipped = TRUE;
1096 /* Analyze the damage type */
1099 /* Magic Missile -- pure damage */
1102 if (seen) obvious = TRUE;
1109 if (seen) obvious = TRUE;
1110 if (r_ptr->flagsr & RFR_IM_ACID)
1112 note = _("にはかなり耐性がある!", " resists a lot.");
1114 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1122 if (seen) obvious = TRUE;
1123 if (r_ptr->flagsr & RFR_IM_ELEC)
1125 note = _("にはかなり耐性がある!", " resists a lot.");
1127 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1135 if (seen) obvious = TRUE;
1136 if (r_ptr->flagsr & RFR_IM_FIRE)
1138 note = _("にはかなり耐性がある!", " resists a lot.");
1140 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1142 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1144 note = _("はひどい痛手をうけた。", " is hit hard.");
1146 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1154 if (seen) obvious = TRUE;
1155 if (r_ptr->flagsr & RFR_IM_COLD)
1157 note = _("にはかなり耐性がある!", " resists a lot.");
1159 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1161 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1163 note = _("はひどい痛手をうけた。", " is hit hard.");
1165 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1173 if (seen) obvious = TRUE;
1174 if (r_ptr->flagsr & RFR_IM_POIS)
1176 note = _("にはかなり耐性がある!", " resists a lot.");
1178 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1186 if (seen) obvious = TRUE;
1187 if (r_ptr->flagsr & RFR_IM_POIS)
1189 note = _("には耐性がある。", " resists.");
1190 dam *= 3; dam /= randint1(6) + 6;
1191 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1193 else if (one_in_(3)) do_poly = TRUE;
1197 /* Hellfire -- hurts Evil */
1200 if (seen) obvious = TRUE;
1201 if (r_ptr->flags3 & RF3_GOOD)
1203 note = _("はひどい痛手をうけた。", " is hit hard.");
1205 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1210 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1213 if (seen) obvious = TRUE;
1214 if (r_ptr->flags3 & RF3_EVIL)
1217 note = _("はひどい痛手をうけた。", " is hit hard.");
1218 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
1222 note = _("には耐性がある。", " resists.");
1223 dam *= 3; dam /= randint1(6) + 6;
1228 /* Arrow -- XXX no defense */
1231 if (seen) obvious = TRUE;
1235 /* Plasma -- XXX perhaps check ELEC or FIRE */
1238 if (seen) obvious = TRUE;
1239 if (r_ptr->flagsr & RFR_RES_PLAS)
1241 note = _("には耐性がある。", " resists.");
1242 dam *= 3; dam /= randint1(6) + 6;
1243 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
1248 /* Nether -- see above */
1251 if (seen) obvious = TRUE;
1252 if (r_ptr->flagsr & RFR_RES_NETH)
1254 if (r_ptr->flags3 & RF3_UNDEAD)
1256 note = _("には完全な耐性がある!", " is immune.");
1258 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
1262 note = _("には耐性がある。", " resists.");
1263 dam *= 3; dam /= randint1(6) + 6;
1265 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
1267 else if (r_ptr->flags3 & RF3_EVIL)
1269 note = _("はいくらか耐性を示した。", " resists somewhat.");
1271 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
1276 /* Water (acid) damage -- Water spirits/elementals are immune */
1279 if (seen) obvious = TRUE;
1280 if (r_ptr->flagsr & RFR_RES_WATE)
1282 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
1284 note = _("には完全な耐性がある!", " is immune.");
1289 note = _("には耐性がある。", " resists.");
1290 dam *= 3; dam /= randint1(6) + 6;
1292 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
1297 /* Chaos -- Chaos breathers resist */
1300 if (seen) obvious = TRUE;
1301 if (r_ptr->flagsr & RFR_RES_CHAO)
1303 note = _("には耐性がある。", " resists.");
1304 dam *= 3; dam /= randint1(6) + 6;
1305 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
1307 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
1309 note = _("はいくらか耐性を示した。", " resists somewhat.");
1310 dam *= 3; dam /= randint1(6) + 6;
1311 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
1316 do_conf = (5 + randint1(11) + r) / (r + 1);
1321 /* Shards -- Shard breathers resist */
1324 if (seen) obvious = TRUE;
1325 if (r_ptr->flagsr & RFR_RES_SHAR)
1327 note = _("には耐性がある。", " resists.");
1328 dam *= 3; dam /= randint1(6) + 6;
1329 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1334 /* Rocket: Shard resistance helps */
1337 if (seen) obvious = TRUE;
1338 if (r_ptr->flagsr & RFR_RES_SHAR)
1340 note = _("はいくらか耐性を示した。", " resists somewhat.");
1342 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1348 /* Sound -- Sound breathers resist */
1351 if (seen) obvious = TRUE;
1352 if (r_ptr->flagsr & RFR_RES_SOUN)
1354 note = _("には耐性がある。", " resists.");
1355 dam *= 2; dam /= randint1(6) + 6;
1356 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
1358 else do_stun = (10 + randint1(15) + r) / (r + 1);
1365 if (seen) obvious = TRUE;
1366 if (r_ptr->flags3 & RF3_NO_CONF)
1368 note = _("には耐性がある。", " resists.");
1369 dam *= 3; dam /= randint1(6) + 6;
1370 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1372 else do_conf = (10 + randint1(15) + r) / (r + 1);
1376 /* Disenchantment -- Breathers and Disenchanters resist */
1379 if (seen) obvious = TRUE;
1380 if (r_ptr->flagsr & RFR_RES_DISE)
1382 note = _("には耐性がある。", " resists.");
1383 dam *= 3; dam /= randint1(6) + 6;
1384 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
1389 /* Nexus -- Breathers and Existers resist */
1392 if (seen) obvious = TRUE;
1393 if (r_ptr->flagsr & RFR_RES_NEXU)
1395 note = _("には耐性がある。", " resists.");
1396 dam *= 3; dam /= randint1(6) + 6;
1397 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
1405 if (seen) obvious = TRUE;
1406 if (r_ptr->flagsr & RFR_RES_WALL)
1408 note = _("には耐性がある。", " resists.");
1409 dam *= 3; dam /= randint1(6) + 6;
1410 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
1412 else do_stun = (randint1(15) + r) / (r + 1);
1416 /* Inertia -- breathers resist */
1419 if (seen) obvious = TRUE;
1420 if (r_ptr->flagsr & RFR_RES_INER)
1422 note = _("には耐性がある。", " resists.");
1423 dam *= 3; dam /= randint1(6) + 6;
1424 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
1428 /* Powerful monsters can resist */
1429 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1430 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1434 /* Normal monsters slow down */
1437 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1439 note = _("の動きが遅くなった。", " starts moving slower.");
1446 /* Time -- breathers resist */
1449 if (seen) obvious = TRUE;
1450 if (r_ptr->flagsr & RFR_RES_TIME)
1452 note = _("には耐性がある。", " resists.");
1453 dam *= 3; dam /= randint1(6) + 6;
1454 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
1456 else do_time = (dam + 1) / 2;
1460 /* Gravity -- breathers resist */
1463 bool resist_tele = FALSE;
1465 if (seen) obvious = TRUE;
1466 if (r_ptr->flagsr & RFR_RES_TELE)
1468 if (r_ptr->flags1 & (RF1_UNIQUE))
1470 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1471 note = _("には効果がなかった。", " is unaffected!");
1474 else if (r_ptr->level > randint1(100))
1476 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1477 note = _("には耐性がある!", " resists!");
1482 if (!resist_tele) do_dist = 10;
1484 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1486 if (r_ptr->flagsr & RFR_RES_GRAV)
1488 note = _("には耐性がある!", " resists!");
1489 dam *= 3; dam /= randint1(6) + 6;
1491 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
1496 /* Powerful monsters can resist */
1497 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1498 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1502 /* Normal monsters slow down */
1505 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1507 note = _("の動きが遅くなった。", " starts moving slower.");
1512 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
1514 /* Attempt a saving throw */
1515 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1516 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1520 /* No obvious effect */
1521 note = _("には効果がなかった。", " is unaffected!");
1533 if (seen) obvious = TRUE;
1539 case GF_DISINTEGRATE:
1541 if (seen) obvious = TRUE;
1542 if (r_ptr->flags3 & RF3_HURT_ROCK)
1544 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
1545 note = _("の皮膚がただれた!", " loses some skin!");
1546 note_dies = _("は蒸発した!", " evaporates!");
1554 if (seen) obvious = TRUE;
1556 /* PSI only works if the monster can see you! -- RG */
1557 if (!(los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)))
1560 msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), m_name);
1564 if (r_ptr->flags2 & RF2_EMPTY_MIND)
1567 note = _("には完全な耐性がある!", " is immune.");
1568 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1571 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
1572 (r_ptr->flags3 & RF3_ANIMAL) ||
1573 (r_ptr->level > randint1(3 * dam)))
1575 note = _("には耐性がある!", " resists!");
1579 * Powerful demons & undead can current_world_ptr->game_turn a mindcrafter's
1580 * attacks back on them
1582 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1583 (r_ptr->level > p_ptr->lev / 2) &&
1587 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1588 (seen ? "%^s's corrupted mind backlashes your attack!" :
1589 "%^ss corrupted mind backlashes your attack!")), m_name);
1592 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
1594 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1598 /* Injure +/- confusion */
1599 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
1600 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1601 if (one_in_(4) && !CHECK_MULTISHADOW())
1603 switch (randint1(4))
1606 set_confused(p_ptr->confused + 3 + randint1(dam));
1609 set_stun(p_ptr->stun + randint1(dam));
1613 if (r_ptr->flags3 & RF3_NO_FEAR)
1614 note = _("には効果がなかった。", " is unaffected.");
1616 set_afraid(p_ptr->afraid + 3 + randint1(dam));
1620 if (!p_ptr->free_act)
1621 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
1630 if ((dam > 0) && one_in_(4))
1632 switch (randint1(4))
1635 do_conf = 3 + randint1(dam);
1638 do_stun = 3 + randint1(dam);
1641 do_fear = 3 + randint1(dam);
1644 note = _("は眠り込んでしまった!", " falls asleep!");
1645 do_sleep = 3 + randint1(dam);
1650 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1656 if (seen) obvious = TRUE;
1657 if (r_ptr->flags2 & RF2_EMPTY_MIND)
1660 note = _("には完全な耐性がある!", " is immune.");
1662 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
1663 (r_ptr->flags3 & RF3_ANIMAL) ||
1664 (r_ptr->level > randint1(3 * dam)))
1666 note = _("には耐性がある!", " resists!");
1670 * Powerful demons & undead can current_world_ptr->game_turn a mindcrafter's
1671 * attacks back on them
1673 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1674 (r_ptr->level > p_ptr->lev / 2) &&
1678 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1679 (seen ? "%^s's corrupted mind backlashes your attack!" :
1680 "%^ss corrupted mind backlashes your attack!")), m_name);
1682 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
1684 msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
1688 /* Injure + mana drain */
1689 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
1690 if (!CHECK_MULTISHADOW())
1692 msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
1693 p_ptr->csp -= damroll(5, dam) / 2;
1694 if (p_ptr->csp < 0) p_ptr->csp = 0;
1695 p_ptr->redraw |= PR_MANA;
1696 p_ptr->window |= (PW_SPELL);
1698 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1705 int b = damroll(5, dam) / 4;
1706 concptr str = (p_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
1707 concptr msg = _("あなたは%sの苦痛を%sに変換した!",
1708 (seen ? "You convert %s's pain into %s!" :
1709 "You convert %ss pain into %s!"));
1710 msg_format(msg, m_name, str);
1712 b = MIN(p_ptr->msp, p_ptr->csp + b);
1714 p_ptr->redraw |= PR_MANA;
1715 p_ptr->window |= (PW_SPELL);
1717 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1721 case GF_TELEKINESIS:
1723 if (seen) obvious = TRUE;
1726 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1731 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
1733 /* Attempt a saving throw */
1734 if ((r_ptr->flags1 & RF1_UNIQUE) ||
1735 (r_ptr->level > 5 + randint1(dam)))
1739 /* No obvious effect */
1745 /* Psycho-spear -- powerful magic missile */
1748 if (seen) obvious = TRUE;
1752 /* Meteor -- powerful magic missile */
1755 if (seen) obvious = TRUE;
1761 if (!is_hostile(m_ptr)) break;
1762 if (seen) obvious = TRUE;
1763 /* Attempt a saving throw */
1764 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
1765 (r_ptr->flags3 & RF3_NO_CONF) ||
1766 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1768 /* Memorize a flag */
1769 if (r_ptr->flags3 & RF3_NO_CONF)
1771 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1778 * Powerful demons & undead can current_world_ptr->game_turn a mindcrafter's
1779 * attacks back on them
1781 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1782 (r_ptr->level > p_ptr->lev / 2) &&
1786 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1787 (seen ? "%^s's corrupted mind backlashes your attack!" :
1788 "%^ss corrupted mind backlashes your attack!")), m_name);
1791 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
1793 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1797 /* Confuse, stun, terrify */
1798 switch (randint1(4))
1801 set_stun(p_ptr->stun + dam / 2);
1804 set_confused(p_ptr->confused + dam / 2);
1808 if (r_ptr->flags3 & RF3_NO_FEAR)
1809 note = _("には効果がなかった。", " is unaffected.");
1811 set_afraid(p_ptr->afraid + dam);
1818 /* No obvious effect */
1819 note = _("には効果がなかった。", " is unaffected.");
1825 if (!common_saving_throw_charm(p_ptr, dam, m_ptr))
1827 note = _("があなたに隷属した。", " is in your thrall!");
1832 switch (randint1(4))
1846 /* No "real" damage */
1851 /* Ice -- Cold + Cuts + Stun */
1854 if (seen) obvious = TRUE;
1855 do_stun = (randint1(15) + 1) / (r + 1);
1856 if (r_ptr->flagsr & RFR_IM_COLD)
1858 note = _("にはかなり耐性がある!", " resists a lot.");
1860 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1862 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1864 note = _("はひどい痛手をうけた。", " is hit hard.");
1866 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1873 case GF_HYPODYNAMIA:
1875 if (seen) obvious = TRUE;
1876 if (!monster_living(m_ptr->r_idx))
1878 if (is_original_ap_and_seen(m_ptr))
1880 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
1881 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
1882 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
1884 note = _("には効果がなかった。", " is unaffected.");
1888 else do_time = (dam+7)/8;
1896 if (seen) obvious = TRUE;
1897 if (!monster_living(m_ptr->r_idx))
1899 if (is_original_ap_and_seen(m_ptr))
1901 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
1902 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
1903 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
1905 note = _("には完全な耐性がある!", " is immune.");
1909 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
1910 (randint1(888) != 666)) ||
1911 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
1912 randint1(100) != 66))
1914 note = _("には耐性がある!", " resists!");
1922 /* Polymorph monster (Use "dam" as "power") */
1925 if (seen) obvious = TRUE;
1926 /* Attempt to polymorph (see below) */
1929 /* Powerful monsters can resist */
1930 if ((r_ptr->flags1 & RF1_UNIQUE) ||
1931 (r_ptr->flags1 & RF1_QUESTOR) ||
1932 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1934 note = _("には効果がなかった。", " is unaffected.");
1939 /* No "real" damage */
1946 /* Clone monsters (Ignore "dam") */
1949 if (seen) obvious = TRUE;
1951 if ((p_ptr->inside_arena) || is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
1953 note = _("には効果がなかった。", " is unaffected.");
1958 m_ptr->hp = m_ptr->maxhp;
1960 /* Attempt to clone. */
1961 if (multiply_monster(g_ptr->m_idx, TRUE, 0L))
1963 note = _("が分裂した!", " spawns!");
1967 /* No "real" damage */
1974 /* Heal Monster (use "dam" as amount of healing) */
1977 if (seen) obvious = TRUE;
1980 (void)set_monster_csleep(g_ptr->m_idx, 0);
1982 if (m_ptr->maxhp < m_ptr->max_maxhp)
1984 if (seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), m_name, m_poss);
1985 m_ptr->maxhp = m_ptr->max_maxhp;
1990 /* Redraw (later) if needed */
1991 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
1992 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2000 if (seen) obvious = TRUE;
2003 (void)set_monster_csleep(g_ptr->m_idx, 0);
2004 if (MON_STUNNED(m_ptr))
2006 if (seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), m_name);
2007 (void)set_monster_stunned(g_ptr->m_idx, 0);
2009 if (MON_CONFUSED(m_ptr))
2011 if (seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), m_name);
2012 (void)set_monster_confused(g_ptr->m_idx, 0);
2014 if (MON_MONFEAR(m_ptr))
2016 if (seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name);
2017 (void)set_monster_monfear(g_ptr->m_idx, 0);
2021 if (m_ptr->hp < 30000) m_ptr->hp += dam;
2024 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2028 chg_virtue(V_VITALITY, 1);
2030 if (r_ptr->flags1 & RF1_UNIQUE)
2031 chg_virtue(V_INDIVIDUALISM, 1);
2033 if (is_friendly(m_ptr))
2034 chg_virtue(V_HONOUR, 1);
2035 else if (!(r_ptr->flags3 & RF3_EVIL))
2037 if (r_ptr->flags3 & RF3_GOOD)
2038 chg_virtue(V_COMPASSION, 2);
2040 chg_virtue(V_COMPASSION, 1);
2043 if (r_ptr->flags3 & RF3_ANIMAL)
2044 chg_virtue(V_NATURE, 1);
2047 if (m_ptr->r_idx == MON_LEPER)
2050 if (!who) chg_virtue(V_COMPASSION, 5);
2053 /* Redraw (later) if needed */
2054 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2055 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2057 note = _("は体力を回復したようだ。", " looks healthier.");
2059 /* No "real" damage */
2065 /* Speed Monster (Ignore "dam") */
2068 if (seen) obvious = TRUE;
2071 if (set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100))
2073 note = _("の動きが速くなった。", " starts moving faster.");
2078 if (r_ptr->flags1 & RF1_UNIQUE)
2079 chg_virtue(V_INDIVIDUALISM, 1);
2080 if (is_friendly(m_ptr))
2081 chg_virtue(V_HONOUR, 1);
2084 /* No "real" damage */
2090 /* Slow Monster (Use "dam" as "power") */
2093 if (seen) obvious = TRUE;
2095 /* Powerful monsters can resist */
2096 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2097 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2099 note = _("には効果がなかった。", " is unaffected.");
2103 /* Normal monsters slow down */
2106 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2108 note = _("の動きが遅くなった。", " starts moving slower.");
2112 /* No "real" damage */
2118 /* Sleep (Use "dam" as "power") */
2121 if (seen) obvious = TRUE;
2123 /* Attempt a saving throw */
2124 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2125 (r_ptr->flags3 & RF3_NO_SLEEP) ||
2126 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2128 /* Memorize a flag */
2129 if (r_ptr->flags3 & RF3_NO_SLEEP)
2131 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
2133 /* No obvious effect */
2134 note = _("には効果がなかった。", " is unaffected.");
2139 /* Go to sleep (much) later */
2140 note = _("は眠り込んでしまった!", " falls asleep!");
2144 /* No "real" damage */
2150 /* Sleep (Use "dam" as "power") */
2151 case GF_STASIS_EVIL:
2153 if (seen) obvious = TRUE;
2155 /* Attempt a saving throw */
2156 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2157 !(r_ptr->flags3 & RF3_EVIL) ||
2158 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2160 note = _("には効果がなかった。", " is unaffected.");
2165 /* Go to sleep (much) later */
2166 note = _("は動けなくなった!", " is suspended!");
2170 /* No "real" damage */
2175 /* Sleep (Use "dam" as "power") */
2178 if (seen) obvious = TRUE;
2180 /* Attempt a saving throw */
2181 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2182 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2184 note = _("には効果がなかった。", " is unaffected.");
2189 /* Go to sleep (much) later */
2190 note = _("は動けなくなった!", " is suspended!");
2194 /* No "real" damage */
2203 vir = virtue_number(V_HARMONY);
2206 dam += p_ptr->virtues[vir-1]/10;
2209 vir = virtue_number(V_INDIVIDUALISM);
2212 dam -= p_ptr->virtues[vir-1]/20;
2215 if (seen) obvious = TRUE;
2217 /* Attempt a saving throw */
2218 if (common_saving_throw_charm(p_ptr, dam, m_ptr))
2222 /* No obvious effect */
2223 note = _("には効果がなかった。", " is unaffected.");
2226 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2228 else if (p_ptr->cursed & TRC_AGGRAVATE)
2230 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2231 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2235 note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
2238 chg_virtue(V_INDIVIDUALISM, -1);
2239 if (r_ptr->flags3 & RF3_ANIMAL)
2240 chg_virtue(V_NATURE, 1);
2243 /* No "real" damage */
2248 /* Control undead */
2249 case GF_CONTROL_UNDEAD:
2252 if (seen) obvious = TRUE;
2254 vir = virtue_number(V_UNLIFE);
2257 dam += p_ptr->virtues[vir-1]/10;
2260 vir = virtue_number(V_INDIVIDUALISM);
2263 dam -= p_ptr->virtues[vir-1]/20;
2266 /* Attempt a saving throw */
2267 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2268 !(r_ptr->flags3 & RF3_UNDEAD))
2270 /* No obvious effect */
2271 note = _("には効果がなかった。", " is unaffected.");
2273 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2275 else if (p_ptr->cursed & TRC_AGGRAVATE)
2277 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2278 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2282 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2286 /* No "real" damage */
2292 case GF_CONTROL_DEMON:
2295 if (seen) obvious = TRUE;
2297 vir = virtue_number(V_UNLIFE);
2300 dam += p_ptr->virtues[vir-1]/10;
2303 vir = virtue_number(V_INDIVIDUALISM);
2306 dam -= p_ptr->virtues[vir-1]/20;
2309 /* Attempt a saving throw */
2310 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2311 !(r_ptr->flags3 & RF3_DEMON))
2313 /* No obvious effect */
2314 note = _("には効果がなかった。", " is unaffected.");
2316 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2318 else if (p_ptr->cursed & TRC_AGGRAVATE)
2320 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2321 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2325 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2329 /* No "real" damage */
2335 case GF_CONTROL_ANIMAL:
2338 if (seen) obvious = TRUE;
2340 vir = virtue_number(V_NATURE);
2343 dam += p_ptr->virtues[vir-1]/10;
2346 vir = virtue_number(V_INDIVIDUALISM);
2349 dam -= p_ptr->virtues[vir-1]/20;
2352 /* Attempt a saving throw */
2353 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2354 !(r_ptr->flags3 & RF3_ANIMAL))
2357 /* No obvious effect */
2358 note = _("には効果がなかった。", " is unaffected.");
2360 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2362 else if (p_ptr->cursed & TRC_AGGRAVATE)
2364 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2365 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2369 note = _("はなついた。", " is tamed!");
2371 if (r_ptr->flags3 & RF3_ANIMAL)
2372 chg_virtue(V_NATURE, 1);
2375 /* No "real" damage */
2381 case GF_CHARM_LIVING:
2385 vir = virtue_number(V_UNLIFE);
2386 if (seen) obvious = TRUE;
2388 vir = virtue_number(V_UNLIFE);
2391 dam -= p_ptr->virtues[vir-1]/10;
2394 vir = virtue_number(V_INDIVIDUALISM);
2397 dam -= p_ptr->virtues[vir-1]/20;
2400 msg_format(_("%sを見つめた。", "You stare into %s."), m_name);
2402 /* Attempt a saving throw */
2403 if (common_saving_throw_charm(p_ptr, dam, m_ptr) ||
2404 !monster_living(m_ptr->r_idx))
2407 /* No obvious effect */
2408 note = _("には効果がなかった。", " is unaffected.");
2410 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2412 else if (p_ptr->cursed & TRC_AGGRAVATE)
2414 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2415 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2419 note = _("を支配した。", " is tamed!");
2421 if (r_ptr->flags3 & RF3_ANIMAL)
2422 chg_virtue(V_NATURE, 1);
2425 /* No "real" damage */
2430 /* Confusion (Use "dam" as "power") */
2433 if (seen) obvious = TRUE;
2435 /* Get confused later */
2436 do_conf = damroll(3, (dam / 2)) + 1;
2438 /* Attempt a saving throw */
2439 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2440 (r_ptr->flags3 & (RF3_NO_CONF)) ||
2441 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2443 /* Memorize a flag */
2444 if (r_ptr->flags3 & (RF3_NO_CONF))
2446 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2452 /* No obvious effect */
2453 note = _("には効果がなかった。", " is unaffected.");
2457 /* No "real" damage */
2464 if (seen) obvious = TRUE;
2466 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2468 /* Attempt a saving throw */
2469 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2470 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2475 /* No obvious effect */
2476 note = _("には効果がなかった。", " is unaffected.");
2480 /* No "real" damage */
2485 /* Lite, but only hurts susceptible creatures */
2494 if (r_ptr->flags3 & (RF3_HURT_LITE))
2496 /* Obvious effect */
2497 if (seen) obvious = TRUE;
2499 /* Memorize the effects */
2500 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
2502 /* Special effect */
2503 note = _("は光に身をすくめた!", " cringes from the light!");
2504 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
2507 /* Normally no damage */
2519 /* Lite -- opposite of Dark */
2522 if (seen) obvious = TRUE;
2524 if (r_ptr->flagsr & RFR_RES_LITE)
2526 note = _("には耐性がある!", " resists!");
2527 dam *= 2; dam /= (randint1(6)+6);
2528 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
2530 else if (r_ptr->flags3 & (RF3_HURT_LITE))
2532 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
2533 note = _("は光に身をすくめた!", " cringes from the light!");
2534 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
2541 /* Dark -- opposite of Lite */
2544 if (seen) obvious = TRUE;
2546 if (r_ptr->flagsr & RFR_RES_DARK)
2548 note = _("には耐性がある!", " resists!");
2549 dam *= 2; dam /= (randint1(6)+6);
2550 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
2559 /* Hurt by rock remover */
2560 if (r_ptr->flags3 & (RF3_HURT_ROCK))
2563 if (seen) obvious = TRUE;
2565 /* Memorize the effects */
2566 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2568 /* Cute little message */
2569 note = _("の皮膚がただれた!", " loses some skin!");
2570 note_dies = _("はドロドロに溶けた!", " dissolves!");
2573 /* Usually, ignore the effects */
2584 /* Teleport undead (Use "dam" as "power") */
2585 case GF_AWAY_UNDEAD:
2587 /* Only affect undead */
2588 if (r_ptr->flags3 & (RF3_UNDEAD))
2590 bool resists_tele = FALSE;
2592 if (r_ptr->flagsr & RFR_RES_TELE)
2594 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2596 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2597 note = _("には効果がなかった。", " is unaffected.");
2598 resists_tele = TRUE;
2600 else if (r_ptr->level > randint1(100))
2602 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2603 note = _("には耐性がある!", " resists!");
2604 resists_tele = TRUE;
2610 if (seen) obvious = TRUE;
2611 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2623 /* No "real" damage */
2629 /* Teleport evil (Use "dam" as "power") */
2632 /* Only affect evil */
2633 if (r_ptr->flags3 & (RF3_EVIL))
2635 bool resists_tele = FALSE;
2637 if (r_ptr->flagsr & RFR_RES_TELE)
2639 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2641 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2642 note = _("には効果がなかった。", " is unaffected.");
2643 resists_tele = TRUE;
2645 else if (r_ptr->level > randint1(100))
2647 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2648 note = _("には耐性がある!", " resists!");
2649 resists_tele = TRUE;
2655 if (seen) obvious = TRUE;
2656 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2668 /* No "real" damage */
2674 /* Teleport monster (Use "dam" as "power") */
2677 bool resists_tele = FALSE;
2678 if (r_ptr->flagsr & RFR_RES_TELE)
2680 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2682 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2683 note = _("には効果がなかった。", " is unaffected.");
2684 resists_tele = TRUE;
2686 else if (r_ptr->level > randint1(100))
2688 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2689 note = _("には耐性がある!", " resists!");
2690 resists_tele = TRUE;
2696 if (seen) obvious = TRUE;
2698 /* Prepare to teleport */
2702 /* No "real" damage */
2708 /* Turn undead (Use "dam" as "power") */
2709 case GF_TURN_UNDEAD:
2711 /* Only affect undead */
2712 if (r_ptr->flags3 & (RF3_UNDEAD))
2714 if (seen) obvious = TRUE;
2716 /* Learn about type */
2717 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2719 /* Apply some fear */
2720 do_fear = damroll(3, (dam / 2)) + 1;
2722 /* Attempt a saving throw */
2723 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
2725 /* No obvious effect */
2726 note = _("には効果がなかった。", " is unaffected.");
2739 /* No "real" damage */
2745 /* Turn evil (Use "dam" as "power") */
2748 /* Only affect evil */
2749 if (r_ptr->flags3 & (RF3_EVIL))
2751 if (seen) obvious = TRUE;
2753 /* Learn about type */
2754 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2756 /* Apply some fear */
2757 do_fear = damroll(3, (dam / 2)) + 1;
2759 /* Attempt a saving throw */
2760 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
2762 /* No obvious effect */
2763 note = _("には効果がなかった。", " is unaffected.");
2776 /* No "real" damage */
2782 /* Turn monster (Use "dam" as "power") */
2785 if (seen) obvious = TRUE;
2787 /* Apply some fear */
2788 do_fear = damroll(3, (dam / 2)) + 1;
2790 /* Attempt a saving throw */
2791 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2792 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
2793 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2795 /* No obvious effect */
2796 note = _("には効果がなかった。", " is unaffected.");
2801 /* No "real" damage */
2808 case GF_DISP_UNDEAD:
2810 /* Only affect undead */
2811 if (r_ptr->flags3 & (RF3_UNDEAD))
2813 if (seen) obvious = TRUE;
2815 /* Learn about type */
2816 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2818 note = _("は身震いした。", " shudders.");
2819 note_dies = _("はドロドロに溶けた!", " dissolves!");
2839 /* Only affect evil */
2840 if (r_ptr->flags3 & (RF3_EVIL))
2842 if (seen) obvious = TRUE;
2844 /* Learn about type */
2845 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2847 note = _("は身震いした。", " shudders.");
2848 note_dies = _("はドロドロに溶けた!", " dissolves!");
2867 /* Only affect good */
2868 if (r_ptr->flags3 & (RF3_GOOD))
2870 if (seen) obvious = TRUE;
2872 /* Learn about type */
2873 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
2875 note = _("は身震いした。", " shudders.");
2876 note_dies = _("はドロドロに溶けた!", " dissolves!");
2893 case GF_DISP_LIVING:
2895 /* Only affect non-undead */
2896 if (monster_living(m_ptr->r_idx))
2898 if (seen) obvious = TRUE;
2900 note = _("は身震いした。", " shudders.");
2901 note_dies = _("はドロドロに溶けた!", " dissolves!");
2920 /* Only affect demons */
2921 if (r_ptr->flags3 & (RF3_DEMON))
2923 if (seen) obvious = TRUE;
2925 /* Learn about type */
2926 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2928 note = _("は身震いした。", " shudders.");
2929 note_dies = _("はドロドロに溶けた!", " dissolves!");
2945 /* Dispel monster */
2948 if (seen) obvious = TRUE;
2949 note = _("は身震いした。", " shudders.");
2950 note_dies = _("はドロドロに溶けた!", " dissolves!");
2957 if (seen) obvious = TRUE;
2958 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->a_ability_flags1 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->a_ability_flags2 & ~(RF6_NOMAGIC_MASK)))
2962 /* Heal the monster */
2963 if (caster_ptr->hp < caster_ptr->maxhp)
2966 caster_ptr->hp += dam;
2967 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
2969 /* Redraw (later) if needed */
2970 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
2971 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
2973 /* Special message */
2976 monster_desc(killer, caster_ptr, 0);
2977 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), killer);
2983 msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), m_name);
2984 (void)hp_player(dam);
2989 if (see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
2998 if (seen) obvious = TRUE;
2999 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3000 /* Attempt a saving throw */
3001 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3002 (r_ptr->flags3 & RF3_NO_CONF) ||
3003 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3005 /* Memorize a flag */
3006 if (r_ptr->flags3 & (RF3_NO_CONF))
3008 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3010 note = _("には効果がなかった。", " is unaffected.");
3013 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3015 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3016 note = _("には完全な耐性がある!", " is immune.");
3019 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3021 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3022 note = _("には耐性がある。", " resists.");
3027 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3028 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3030 if (who > 0) do_conf = randint0(4) + 4;
3031 else do_conf = randint0(8) + 8;
3037 case GF_BRAIN_SMASH:
3039 if (seen) obvious = TRUE;
3040 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3042 /* Attempt a saving throw */
3043 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3044 (r_ptr->flags3 & RF3_NO_CONF) ||
3045 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3047 /* Memorize a flag */
3048 if (r_ptr->flags3 & (RF3_NO_CONF))
3050 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3052 note = _("には効果がなかった。", " is unaffected.");
3055 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3057 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3058 note = _("には完全な耐性がある!", " is immune.");
3061 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3063 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3064 note = _("には耐性がある!", " resists!");
3069 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3070 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3074 do_conf = randint0(4) + 4;
3075 do_stun = randint0(4) + 4;
3079 do_conf = randint0(8) + 8;
3080 do_stun = randint0(8) + 8;
3082 (void)set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 10);
3090 if (seen) obvious = TRUE;
3091 if (!who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), m_name);
3092 /* Attempt a saving throw */
3093 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3095 note = _("には効果がなかった。", " is unaffected.");
3104 if (seen) obvious = TRUE;
3105 if (!who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), m_name);
3106 /* Attempt a saving throw */
3107 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3109 note = _("には効果がなかった。", " is unaffected.");
3118 if (seen) obvious = TRUE;
3119 if (!who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), m_name);
3120 /* Attempt a saving throw */
3121 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3123 note = _("には効果がなかった。", " is unaffected.");
3132 if (seen) obvious = TRUE;
3134 msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
3135 "You point at %s, screaming the word, 'DIE!'."), m_name);
3136 /* Attempt a saving throw */
3137 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
3139 note = _("には効果がなかった。", " is unaffected.");
3148 if (seen) obvious = TRUE;
3149 if (r_ptr->flags1 & RF1_UNIQUE)
3151 note = _("には効果がなかった。", " is unaffected.");
3156 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
3157 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
3159 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
3161 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
3165 note = _("は耐性を持っている!", "resists!");
3172 /* Capture monster */
3176 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
3177 (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)
3179 msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3184 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
3185 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(m_ptr->r_idx))
3186 nokori_hp = m_ptr->maxhp * 3 / 10;
3188 nokori_hp = m_ptr->maxhp * 3 / 20;
3190 if (m_ptr->hp >= nokori_hp)
3192 msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), m_name);
3195 else if (m_ptr->hp < randint0(nokori_hp))
3197 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(g_ptr->m_idx, FALSE, MON_CHAMELEON);
3198 msg_format(_("%sを捕えた!", "You capture %^s!"), m_name);
3199 cap_mon = m_ptr->r_idx;
3200 cap_mspeed = m_ptr->mspeed;
3202 cap_maxhp = m_ptr->max_maxhp;
3203 cap_nickname = m_ptr->nickname; /* Quark transfer */
3204 if (g_ptr->m_idx == p_ptr->riding)
3206 if (rakuba(-1, FALSE))
3208 msg_format(_("地面に落とされた。", "You have fallen from %s."), m_name);
3212 delete_monster_idx(g_ptr->m_idx);
3218 msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), m_name);
3224 /* Attack (Use "dam" as attack type) */
3227 /* Return this monster's death */
3228 return py_attack(y, x, dam);
3231 /* Sleep (Use "dam" as "power") */
3237 if (seen) obvious = TRUE;
3238 if (r_ptr->flags2 & RF2_EMPTY_MIND)
3240 note = _("には効果がなかった。", " is unaffected.");
3243 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3246 if (MON_CSLEEP(m_ptr))
3248 note = _("には効果がなかった。", " is unaffected.");
3254 if (one_in_(5)) effect = 1;
3255 else if (one_in_(4)) effect = 2;
3256 else if (one_in_(3)) effect = 3;
3261 /* Powerful monsters can resist */
3262 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3263 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3265 note = _("には効果がなかった。", " is unaffected.");
3269 /* Normal monsters slow down */
3272 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
3274 note = _("の動きが遅くなった。", " starts moving slower.");
3279 else if (effect == 2)
3281 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
3283 /* Attempt a saving throw */
3284 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3285 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3290 /* No obvious effect */
3291 note = _("には効果がなかった。", " is unaffected.");
3296 else if (effect == 3)
3298 /* Attempt a saving throw */
3299 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3300 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3301 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3303 /* Memorize a flag */
3304 if (r_ptr->flags3 & RF3_NO_SLEEP)
3306 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3309 /* No obvious effect */
3310 note = _("には効果がなかった。", " is unaffected.");
3315 /* Go to sleep (much) later */
3316 note = _("は眠り込んでしまった!", " falls asleep!");
3323 note = _("には効果がなかった。", " is unaffected.");
3326 /* No "real" damage */
3334 if (seen) obvious = TRUE;
3335 if (genocide_aux(g_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
3337 if (seen_msg) msg_format(_("%sは消滅した!", "%^s disappered!"), m_name);
3338 chg_virtue(V_VITALITY, -1);
3348 if (!who) msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), m_name);
3350 if (r_ptr->flags3 & (RF3_HURT_LITE))
3352 /* Obvious effect */
3353 if (seen) obvious = TRUE;
3355 /* Memorize the effects */
3356 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3358 /* Special effect */
3359 note = _("は光に身をすくめた!", " cringes from the light!");
3360 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3363 /* Normally no damage */
3370 photo = m_ptr->r_idx;
3377 case GF_BLOOD_CURSE:
3379 if (seen) obvious = TRUE;
3385 bool success = FALSE;
3386 if (seen) obvious = TRUE;
3388 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
3390 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
3391 if (dam < 1) dam = 1;
3393 /* No need to tame your pet */
3396 note = _("の動きが速くなった。", " starts moving faster.");
3397 (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100);
3401 /* Attempt a saving throw */
3402 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3403 (r_ptr->flags1 & (RF1_UNIQUE)) ||
3404 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3405 (p_ptr->cursed & TRC_AGGRAVATE) ||
3406 ((r_ptr->level+10) > randint1(dam)))
3409 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3413 note = _("を支配した。", " is tamed!");
3415 (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100);
3417 /* Learn about type */
3418 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
3425 if (!(r_ptr->flags3 & RF3_NO_FEAR))
3427 do_fear = randint1(90)+10;
3429 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
3432 /* No "real" damage */
3439 if (seen) obvious = TRUE;
3440 /* Attempt a saving throw */
3441 if (randint0(100 + dam) < (r_ptr->level + 50))
3443 note = _("には効果がなかった。", " is unaffected.");
3463 /* Absolutely no effect */
3464 if (skipped) return (FALSE);
3466 /* "Unique" monsters cannot be polymorphed */
3467 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
3469 /* Quest monsters cannot be polymorphed */
3470 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
3472 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
3474 /* "Unique" and "quest" monsters can only be "killed" by the player. */
3475 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
3477 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
3482 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
3483 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
3486 /* Modify the damage */
3488 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
3489 if ((tmp > 0) && (dam == 0)) note = _("はダメージを受けていない。", " is unharmed.");
3491 /* Check for death */
3492 if (dam > m_ptr->hp)
3494 /* Extract method of death */
3499 /* Sound and Impact resisters never stun */
3501 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
3502 !(r_ptr->flags3 & RF3_NO_STUN))
3504 if (seen) obvious = TRUE;
3507 if (MON_STUNNED(m_ptr))
3509 note = _("はひどくもうろうとした。", " is more dazed.");
3510 tmp = MON_STUNNED(m_ptr) + (do_stun / 2);
3514 note = _("はもうろうとした。", " is dazed.");
3519 (void)set_monster_stunned(g_ptr->m_idx, tmp);
3525 /* Confusion and Chaos resisters (and sleepers) never confuse */
3527 !(r_ptr->flags3 & RF3_NO_CONF) &&
3528 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
3530 if (seen) obvious = TRUE;
3532 /* Already partially confused */
3533 if (MON_CONFUSED(m_ptr))
3535 note = _("はさらに混乱したようだ。", " looks more confused.");
3536 tmp = MON_CONFUSED(m_ptr) + (do_conf / 2);
3539 /* Was not confused */
3542 note = _("は混乱したようだ。", " looks confused.");
3546 /* Apply confusion */
3547 (void)set_monster_confused(g_ptr->m_idx, tmp);
3555 if (seen) obvious = TRUE;
3557 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
3561 note = _("は弱くなったようだ。", " seems weakened.");
3562 m_ptr->maxhp -= do_time;
3563 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
3568 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
3569 if (do_poly && (randint1(90) > r_ptr->level))
3571 if (polymorph_monster(y, x))
3573 if (seen) obvious = TRUE;
3575 /* Monster polymorphs */
3576 note = _("が変身した!", " changes!");
3578 /* Turn off the damage */
3584 note = _("には効果がなかった。", " is unaffected.");
3587 /* Hack -- Get new monster */
3588 m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
3590 /* Hack -- Get new race */
3591 r_ptr = &r_info[m_ptr->r_idx];
3594 /* Handle "teleport" */
3597 if (seen) obvious = TRUE;
3599 note = _("が消え去った!", " disappears!");
3601 if (!who) chg_virtue(V_VALOUR, -1);
3604 teleport_away(g_ptr->m_idx, do_dist,
3605 (!who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
3607 /* Hack -- get new location */
3611 /* Hack -- get new grid */
3612 g_ptr = ¤t_floor_ptr->grid_array[y][x];
3619 (void)set_monster_monfear(g_ptr->m_idx, MON_MONFEAR(m_ptr) + do_fear);
3626 if (typ == GF_DRAIN_MANA)
3628 /* Drain mana does nothing */
3631 /* If another monster did the damage, hurt the monster by hand */
3634 /* Redraw (later) if needed */
3635 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3636 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3638 /* Wake the monster up */
3639 (void)set_monster_csleep(g_ptr->m_idx, 0);
3641 /* Hurt the monster */
3649 if (is_pet(m_ptr) && !(m_ptr->ml))
3652 /* Give detailed messages if destroyed */
3655 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
3658 msg_format("%^s%s", m_name, note);
3666 if (who > 0) monster_gain_exp(who, m_ptr->r_idx);
3668 /* Generate treasure, etc */
3669 monster_death(g_ptr->m_idx, FALSE);
3672 delete_monster_idx(g_ptr->m_idx);
3676 msg_print(_("少し悲しい気分がした。", "You feel sad for a moment."));
3680 /* Damaged monster */
3683 /* Give detailed messages if visible or destroyed */
3684 if (note && seen_msg) msg_format("%^s%s", m_name, note);
3686 /* Hack -- Pain message */
3689 message_pain(g_ptr->m_idx, dam);
3696 /* Hack -- handle sleep */
3697 if (do_sleep) (void)set_monster_csleep(g_ptr->m_idx, do_sleep);
3701 else if (heal_leper)
3703 if (seen_msg) msg_print(_("不潔な病人は病気が治った!", "The Mangy looking leper is healed!"));
3705 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
3707 char m2_name[MAX_NLEN];
3709 monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
3710 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_HEAL_LEPER, m2_name);
3713 delete_monster_idx(g_ptr->m_idx);
3716 /* If the player did it, give him experience, check fear */
3721 /* Hurt the monster, check for fear and death */
3722 if (mon_take_hit(g_ptr->m_idx, dam, &fear, note_dies))
3727 /* Damaged monster */
3730 /* HACK - anger the monster before showing the sleep message */
3731 if (do_sleep) anger_monster(m_ptr);
3733 /* Give detailed messages if visible or destroyed */
3734 if (note && seen_msg)
3735 msg_format(_("%s%s", "%^s%s"), m_name, note);
3737 /* Hack -- Pain message */
3738 else if (known && (dam || !do_fear))
3740 message_pain(g_ptr->m_idx, dam);
3743 /* Anger monsters */
3744 if (((dam > 0) || get_angry) && !do_sleep)
3745 anger_monster(m_ptr);
3747 if ((fear || do_fear) && seen)
3750 msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
3753 /* Hack -- handle sleep */
3754 if (do_sleep) (void)set_monster_csleep(g_ptr->m_idx, do_sleep);
3758 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
3760 blood_curse_to_enemy(who);
3763 if (p_ptr->inside_battle)
3765 p_ptr->health_who = g_ptr->m_idx;
3766 p_ptr->redraw |= (PR_HEALTH);
3770 /* Verify this code */
3771 if (m_ptr->r_idx) update_monster(g_ptr->m_idx, FALSE);
3773 /* Redraw the monster grid */
3776 /* Update monster recall window */
3777 if ((p_ptr->monster_race_idx == m_ptr->r_idx) && (seen || !m_ptr->r_idx))
3779 p_ptr->window |= (PW_MONSTER);
3782 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
3786 if (!(flg & PROJECT_NO_HANGEKI))
3788 set_target(m_ptr, monster_target_y, monster_target_x);
3791 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
3793 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
3797 if (p_ptr->riding && (p_ptr->riding == g_ptr->m_idx) && (dam > 0))
3799 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
3800 rakubadam_m = (dam > 200) ? 200 : dam;
3810 /* Prepare to make a Blade of Chaos */
3811 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
3813 q_ptr->pval = photo;
3815 /* Mark the item as fully known */
3816 q_ptr->ident |= (IDENT_MENTAL);
3817 (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
3825 /* Return "Anything seen?" */
3830 * @brief 汎用的なビーム/ボルト/ボール系によるプレイヤーへの効果処理 / Helper function for "project()" below.
3831 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
3832 * @param who_name 効果を起こしたモンスターの名前
3833 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
3834 * @param y 目標Y座標 / Target y location (or location to travel "towards")
3835 * @param x 目標X座標 / Target x location (or location to travel "towards")
3836 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
3837 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
3839 * @param monspell 効果元のモンスター魔法ID
3840 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
3842 * Handle a beam/bolt/ball causing damage to the player.
3843 * This routine takes a "source monster" (by index), a "distance", a default
3844 * "damage", and a "damage type". See "project_m()" above.
3845 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
3846 * is reduced (see "project_m()" above). This can happen if a monster breathes
3847 * at the player and hits a wall instead.
3848 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
3849 * to know if this is actually a ball or a bolt spell
3850 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
3851 * we just assume that the effects were obvious, for historical reasons.
3853 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)
3858 /* Hack -- assume obvious */
3859 bool obvious = TRUE;
3861 /* Player blind-ness */
3862 bool blind = (p_ptr->blind ? TRUE : FALSE);
3864 /* Player needs a "description" (he is blind) */
3867 /* Source monster */
3868 monster_type *m_ptr = NULL;
3870 /* Monster name (for attacks) */
3871 GAME_TEXT m_name[MAX_NLEN];
3873 /* Monster name (for damage) */
3876 /* Hack -- messages */
3882 /* Player is not here */
3883 if (!player_bold(y, x)) return (FALSE);
3885 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
3887 if (kawarimi(TRUE)) return FALSE;
3890 /* Player cannot hurt himself */
3891 if (!who) return (FALSE);
3892 if (who == p_ptr->riding) return (FALSE);
3894 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
3897 int max_attempts = 10;
3898 sound(SOUND_REFLECT);
3901 msg_print(_("何かが跳ね返った!", "Something bounces!"));
3902 else if (p_ptr->special_defense & KATA_FUUJIN)
3903 msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
3905 msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
3908 /* Choose 'new' target */
3913 t_y = current_floor_ptr->m_list[who].fy - 1 + randint1(3);
3914 t_x = current_floor_ptr->m_list[who].fx - 1 + randint1(3);
3917 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(p_ptr->y, p_ptr->x, t_y, t_x));
3919 if (max_attempts < 1)
3921 t_y = current_floor_ptr->m_list[who].fy;
3922 t_x = current_floor_ptr->m_list[who].fx;
3927 t_y = p_ptr->y - 1 + randint1(3);
3928 t_x = p_ptr->x - 1 + randint1(3);
3931 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
3933 disturb(TRUE, TRUE);
3937 /* Limit maximum damage */
3938 if (dam > 1600) dam = 1600;
3940 /* Reduce damage by distance */
3941 dam = (dam + r) / (r + 1);
3944 /* If the player is blind, be more descriptive */
3945 if (blind) fuzzy = TRUE;
3950 m_ptr = ¤t_floor_ptr->m_list[who];
3951 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
3952 monster_desc(m_name, m_ptr, 0);
3954 /* Get the monster's real name (gotten before polymorph!) */
3955 strcpy(killer, who_name);
3961 case PROJECT_WHO_UNCTRL_POWER:
3962 strcpy(killer, _("制御できない力の氾流", "uncontrollable power storm"));
3965 case PROJECT_WHO_GLASS_SHARDS:
3966 strcpy(killer, _("ガラスの破片", "shards of glass"));
3970 strcpy(killer, _("罠", "a trap"));
3975 strcpy(m_name, killer);
3978 /* Analyze the damage */
3981 /* Standard damage -- hurts inventory too */
3984 if (fuzzy) msg_print(_("酸で攻撃された!", "You are hit by acid!"));
3985 get_damage = acid_dam(dam, killer, monspell, FALSE);
3989 /* Standard damage -- hurts inventory too */
3992 if (fuzzy) msg_print(_("火炎で攻撃された!", "You are hit by fire!"));
3993 get_damage = fire_dam(dam, killer, monspell, FALSE);
3997 /* Standard damage -- hurts inventory too */
4000 if (fuzzy) msg_print(_("冷気で攻撃された!", "You are hit by cold!"));
4001 get_damage = cold_dam(dam, killer, monspell, FALSE);
4005 /* Standard damage -- hurts inventory too */
4008 if (fuzzy) msg_print(_("電撃で攻撃された!", "You are hit by lightning!"));
4009 get_damage = elec_dam(dam, killer, monspell, FALSE);
4013 /* Standard damage -- also poisons player */
4016 bool double_resist = IS_OPPOSE_POIS();
4017 if (fuzzy) msg_print(_("毒で攻撃された!", "You are hit by poison!"));
4019 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
4020 if (double_resist) dam = (dam + 2) / 3;
4022 if ((!(double_resist || p_ptr->resist_pois)) && one_in_(HURT_CHANCE) && !CHECK_MULTISHADOW())
4027 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4029 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4031 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4036 /* Standard damage -- also poisons / mutates player */
4039 bool double_resist = IS_OPPOSE_POIS();
4040 if (fuzzy) msg_print(_("放射能で攻撃された!", "You are hit by radiation!"));
4042 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
4043 if (double_resist) dam = (2 * dam + 2) / 5;
4044 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4045 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4047 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4049 if (one_in_(5)) /* 6 */
4051 msg_print(_("奇形的な変身を遂げた!", "You undergo a freakish metamorphosis!"));
4052 if (one_in_(4)) /* 4 */
4060 inven_damage(set_acid_destroy, 2);
4066 /* Standard damage */
4069 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4070 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4074 /* Holy Orb -- Player only takes partial damage */
4077 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4078 if (p_ptr->align > 10)
4080 else if (p_ptr->align < -10)
4082 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4088 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4089 if (p_ptr->align > 10)
4091 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4095 /* Arrow -- XXX no dodging */
4100 msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
4102 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
4104 msg_print(_("矢を斬り捨てた!", "You cut down the arrow!"));
4107 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4111 /* Plasma -- XXX No resist */
4114 if (fuzzy) msg_print(_("何かとても熱いもので攻撃された!", "You are hit by something *HOT*!"));
4115 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4117 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4119 int plus_stun = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
4120 (void)set_stun(p_ptr->stun + plus_stun);
4123 if (!(p_ptr->resist_fire || IS_OPPOSE_FIRE() || p_ptr->immune_fire))
4125 inven_damage(set_acid_destroy, 3);
4131 /* Nether -- drain experience */
4134 if (fuzzy) msg_print(_("地獄の力で攻撃された!", "You are hit by nether forces!"));
4135 if (p_ptr->resist_neth)
4137 if (!prace_is_(RACE_SPECTRE))
4139 dam *= 6; dam /= (randint1(4) + 7);
4142 else if (!CHECK_MULTISHADOW()) drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
4144 if (prace_is_(RACE_SPECTRE) && !CHECK_MULTISHADOW())
4146 msg_print(_("気分がよくなった。", "You feel invigorated!"));
4148 learn_spell(monspell);
4152 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4158 /* Water -- stun/confuse */
4161 if (fuzzy) msg_print(_("何か湿ったもので攻撃された!", "You are hit by something wet!"));
4162 if (!CHECK_MULTISHADOW())
4164 if (!p_ptr->resist_sound && !p_ptr->resist_water)
4166 set_stun(p_ptr->stun + randint1(40));
4168 if (!p_ptr->resist_conf && !p_ptr->resist_water)
4170 set_confused(p_ptr->confused + randint1(5) + 5);
4173 if (one_in_(5) && !p_ptr->resist_water)
4175 inven_damage(set_cold_destroy, 3);
4178 if (p_ptr->resist_water) get_damage /= 4;
4181 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4185 /* Chaos -- many effects */
4188 if (fuzzy) msg_print(_("無秩序の波動で攻撃された!", "You are hit by a wave of anarchy!"));
4189 if (p_ptr->resist_chaos)
4191 dam *= 6; dam /= (randint1(4) + 7);
4194 if (!CHECK_MULTISHADOW())
4196 if (!p_ptr->resist_conf)
4198 (void)set_confused(p_ptr->confused + randint0(20) + 10);
4200 if (!p_ptr->resist_chaos)
4202 (void)set_image(p_ptr->image + randint1(10));
4205 msg_print(_("あなたの身体はカオスの力で捻じ曲げられた!", "Your body is twisted by chaos!"));
4206 (void)gain_mutation(p_ptr, 0);
4209 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
4211 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
4214 if (!p_ptr->resist_chaos || one_in_(9))
4216 inven_damage(set_elec_destroy, 2);
4217 inven_damage(set_fire_destroy, 2);
4221 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4225 /* Shards -- mostly cutting */
4228 if (fuzzy) msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
4229 if (p_ptr->resist_shard)
4231 dam *= 6; dam /= (randint1(4) + 7);
4233 else if (!CHECK_MULTISHADOW())
4235 (void)set_cut(p_ptr->cut + dam);
4238 if (!p_ptr->resist_shard || one_in_(13))
4240 inven_damage(set_cold_destroy, 2);
4243 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4247 /* Sound -- mostly stunning */
4250 if (fuzzy) msg_print(_("轟音で攻撃された!", "You are hit by a loud noise!"));
4251 if (p_ptr->resist_sound)
4253 dam *= 5; dam /= (randint1(4) + 7);
4255 else if (!CHECK_MULTISHADOW())
4257 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
4258 (void)set_stun(p_ptr->stun + plus_stun);
4261 if (!p_ptr->resist_sound || one_in_(13))
4263 inven_damage(set_cold_destroy, 2);
4266 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4270 /* Pure confusion */
4273 if (fuzzy) msg_print(_("何か混乱するもので攻撃された!", "You are hit by something puzzling!"));
4274 if (p_ptr->resist_conf)
4276 dam *= 5; dam /= (randint1(4) + 7);
4278 else if (!CHECK_MULTISHADOW())
4280 (void)set_confused(p_ptr->confused + randint1(20) + 10);
4282 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4286 /* Disenchantment -- see above */
4289 if (fuzzy) msg_print(_("何かさえないもので攻撃された!", "You are hit by something static!"));
4290 if (p_ptr->resist_disen)
4292 dam *= 6; dam /= (randint1(4) + 7);
4294 else if (!CHECK_MULTISHADOW())
4296 (void)apply_disenchant(0);
4298 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4302 /* Nexus -- see above */
4305 if (fuzzy) msg_print(_("何か奇妙なもので攻撃された!", "You are hit by something strange!"));
4306 if (p_ptr->resist_nexus)
4308 dam *= 6; dam /= (randint1(4) + 7);
4310 else if (!CHECK_MULTISHADOW())
4314 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4318 /* Force -- mostly stun */
4321 if (fuzzy) msg_print(_("運動エネルギーで攻撃された!", "You are hit by kinetic force!"));
4322 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4324 (void)set_stun(p_ptr->stun + randint1(20));
4326 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4331 /* Rocket -- stun, cut */
4334 if (fuzzy) msg_print(_("爆発があった!", "There is an explosion!"));
4335 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4337 (void)set_stun(p_ptr->stun + randint1(20));
4340 if (p_ptr->resist_shard)
4344 else if (!CHECK_MULTISHADOW())
4346 (void)set_cut(p_ptr->cut + (dam / 2));
4349 if (!p_ptr->resist_shard || one_in_(12))
4351 inven_damage(set_cold_destroy, 3);
4354 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4358 /* Inertia -- slowness */
4361 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
4362 if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4363 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4367 /* Lite -- blinding */
4370 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4371 if (p_ptr->resist_lite)
4373 dam *= 4; dam /= (randint1(4) + 7);
4375 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
4377 (void)set_blind(p_ptr->blind + randint1(5) + 2);
4380 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
4382 if (!CHECK_MULTISHADOW()) msg_print(_("光で肉体が焦がされた!", "The light scorches your flesh!"));
4385 else if (prace_is_(RACE_S_FAIRY))
4390 if (p_ptr->wraith_form) dam *= 2;
4391 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4393 if (p_ptr->wraith_form && !CHECK_MULTISHADOW())
4395 p_ptr->wraith_form = 0;
4396 msg_print(_("閃光のため非物質的な影の存在でいられなくなった。",
4397 "The light forces you out of your incorporeal shadow form."));
4399 p_ptr->redraw |= (PR_MAP | PR_STATUS);
4400 p_ptr->update |= (PU_MONSTERS);
4401 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4407 /* Dark -- blinding */
4410 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4411 if (p_ptr->resist_dark)
4413 dam *= 4; dam /= (randint1(4) + 7);
4415 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
4417 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
4419 (void)set_blind(p_ptr->blind + randint1(5) + 2);
4421 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4425 /* Time -- bolt fewer effects XXX */
4428 if (fuzzy) msg_print(_("過去からの衝撃に攻撃された!", "You are hit by a blast from the past!"));
4429 if (p_ptr->resist_time)
4432 dam /= (randint1(4) + 7);
4433 msg_print(_("時間が通り過ぎていく気がする。", "You feel as if time is passing you by."));
4435 else if (!CHECK_MULTISHADOW())
4437 switch (randint1(10))
4439 case 1: case 2: case 3: case 4: case 5:
4441 if (p_ptr->prace == RACE_ANDROID) break;
4442 msg_print(_("人生が逆戻りした気がする。", "You feel life has clocked back."));
4443 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
4447 case 6: case 7: case 8: case 9:
4449 switch (randint1(6))
4451 case 1: k = A_STR; act = _("強く", "strong"); break;
4452 case 2: k = A_INT; act = _("聡明で", "bright"); break;
4453 case 3: k = A_WIS; act = _("賢明で", "wise"); break;
4454 case 4: k = A_DEX; act = _("器用で", "agile"); break;
4455 case 5: k = A_CON; act = _("健康で", "hale"); break;
4456 case 6: k = A_CHR; act = _("美しく", "beautiful"); break;
4459 msg_format(_("あなたは以前ほど%sなくなってしまった...。",
4460 "You're not as %s as you used to be..."), act);
4462 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
4463 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
4464 p_ptr->update |= (PU_BONUS);
4470 msg_print(_("あなたは以前ほど力強くなくなってしまった...。",
4471 "You're not as powerful as you used to be..."));
4473 for (k = 0; k < A_MAX; k++)
4475 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
4476 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
4478 p_ptr->update |= (PU_BONUS);
4484 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4488 /* Gravity -- stun plus slowness plus teleport */
4491 if (fuzzy) msg_print(_("何か重いもので攻撃された!", "You are hit by something heavy!"));
4492 msg_print(_("周辺の重力がゆがんだ。", "Gravity warps around you."));
4494 if (!CHECK_MULTISHADOW())
4496 teleport_player(5, TELEPORT_PASSIVE);
4497 if (!p_ptr->levitation)
4498 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4499 if (!(p_ptr->resist_sound || p_ptr->levitation))
4501 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
4502 (void)set_stun(p_ptr->stun + plus_stun);
4505 if (p_ptr->levitation)
4507 dam = (dam * 2) / 3;
4510 if (!p_ptr->levitation || one_in_(13))
4512 inven_damage(set_cold_destroy, 2);
4515 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4519 /* Standard damage */
4520 case GF_DISINTEGRATE:
4522 if (fuzzy) msg_print(_("純粋なエネルギーで攻撃された!", "You are hit by pure energy!"));
4524 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4530 if (fuzzy) msg_print(_("何らかの攻撃によって気分がよくなった。", "You are hit by something invigorating!"));
4532 (void)hp_player(dam);
4539 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4540 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
4547 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
4548 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4554 if (p_ptr->free_act) break;
4555 if (fuzzy) msg_print(_("眠ってしまった!", "You fall asleep!"));
4557 if (ironman_nightmare)
4559 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
4560 /* Have some nightmares */
4561 sanity_blast(NULL, FALSE);
4564 set_paralyzed(p_ptr->paralyzed + dam);
4574 if (fuzzy) msg_print(_("魔法のオーラで攻撃された!", "You are hit by an aura of magic!"));
4575 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4582 if (fuzzy) msg_print(_("エネルギーの塊で攻撃された!", "You are hit by an energy!"));
4583 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
4590 if (fuzzy) msg_print(_("何かが空からあなたの頭上に落ちてきた!", "Something falls from the sky on you!"));
4592 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4593 if (!p_ptr->resist_shard || one_in_(13))
4595 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
4596 inven_damage(set_cold_destroy, 2);
4602 /* Ice -- cold plus stun plus cuts */
4605 if (fuzzy) msg_print(_("何か鋭く冷たいもので攻撃された!", "You are hit by something sharp and cold!"));
4606 get_damage = cold_dam(dam, killer, monspell, FALSE);
4607 if (!CHECK_MULTISHADOW())
4609 if (!p_ptr->resist_shard)
4611 (void)set_cut(p_ptr->cut + damroll(5, 8));
4613 if (!p_ptr->resist_sound)
4615 (void)set_stun(p_ptr->stun + randint1(15));
4618 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
4620 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
4630 if (fuzzy) msg_print(_("何か非常に冷たいもので攻撃された!", "You are hit by something extremely cold!"));
4632 if (p_ptr->mimic_form)
4634 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
4635 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4640 switch (p_ptr->prace)
4642 /* Some races are immune */
4656 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4668 if (CHECK_MULTISHADOW())
4670 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
4672 else if (p_ptr->csp)
4676 msg_format(_("%^sに精神エネルギーを吸い取られてしまった!", "%^s draws psychic energy from you!"), m_name);
4678 msg_print(_("精神エネルギーを吸い取られてしまった!", "Your psychic energy is drawn!"));
4681 if (dam >= p_ptr->csp)
4685 p_ptr->csp_frac = 0;
4694 learn_spell(monspell);
4695 p_ptr->redraw |= (PR_MANA);
4696 p_ptr->window |= (PW_PLAYER | PW_SPELL);
4700 /* Heal the monster */
4701 if (m_ptr->hp < m_ptr->maxhp)
4705 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
4707 /* Redraw (later) if needed */
4708 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4709 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4711 /* Special message */
4714 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), m_name);
4727 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
4729 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4730 learn_spell(monspell);
4734 if (!CHECK_MULTISHADOW())
4736 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
4738 if (!p_ptr->resist_conf)
4740 (void)set_confused(p_ptr->confused + randint0(4) + 4);
4743 if (!p_ptr->resist_chaos && one_in_(3))
4745 (void)set_image(p_ptr->image + randint0(250) + 150);
4752 p_ptr->csp_frac = 0;
4754 p_ptr->redraw |= PR_MANA;
4757 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4763 case GF_BRAIN_SMASH:
4765 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
4767 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4768 learn_spell(monspell);
4772 if (!CHECK_MULTISHADOW())
4774 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
4780 p_ptr->csp_frac = 0;
4782 p_ptr->redraw |= PR_MANA;
4785 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4786 if (!CHECK_MULTISHADOW())
4788 if (!p_ptr->resist_blind)
4790 (void)set_blind(p_ptr->blind + 8 + randint0(8));
4792 if (!p_ptr->resist_conf)
4794 (void)set_confused(p_ptr->confused + randint0(4) + 4);
4796 if (!p_ptr->free_act)
4798 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
4800 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4802 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
4803 (void)do_dec_stat(A_INT);
4804 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
4805 (void)do_dec_stat(A_WIS);
4807 if (!p_ptr->resist_chaos)
4809 (void)set_image(p_ptr->image + randint0(250) + 150);
4819 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4821 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4822 learn_spell(monspell);
4826 if (!CHECK_MULTISHADOW()) curse_equipment(15, 0);
4827 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4835 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4837 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4838 learn_spell(monspell);
4842 if (!CHECK_MULTISHADOW()) curse_equipment(25, MIN(rlev / 2 - 15, 5));
4843 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4851 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4853 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4854 learn_spell(monspell);
4858 if (!CHECK_MULTISHADOW()) curse_equipment(33, MIN(rlev / 2 - 15, 15));
4859 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4867 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU) && !CHECK_MULTISHADOW())
4869 msg_print(_("しかし秘孔を跳ね返した!", "You resist the effects!"));
4870 learn_spell(monspell);
4874 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4875 if (!CHECK_MULTISHADOW()) (void)set_cut(p_ptr->cut + damroll(10, 10));
4883 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4885 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4886 learn_spell(monspell);
4890 if (!CHECK_MULTISHADOW())
4892 msg_print(_("あなたは命が薄まっていくように感じた!", "You feel your life fade away!"));
4893 curse_equipment(40, 20);
4896 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
4898 if (p_ptr->chp < 1) p_ptr->chp = 1; /* Paranoia */
4913 /* Hex - revenge damage stored */
4914 revenge_store(get_damage);
4916 if ((p_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
4917 && (get_damage > 0) && !p_ptr->is_dead && (who > 0))
4919 GAME_TEXT m_name_self[80];
4922 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
4924 msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), m_name, m_name_self);
4925 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
4926 if (p_ptr->tim_eyeeye) set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
4929 if (p_ptr->riding && dam > 0)
4931 rakubadam_p = (dam > 200) ? 200 : dam;
4935 disturb(TRUE, TRUE);
4938 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
4940 (void)kawarimi(FALSE);
4943 /* Return "Anything seen?" */
4949 * Find the distance from (x, y) to a line.
4951 POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
4953 /* Vector from (x, y) to (x1, y1) */
4954 POSITION py = y1 - y;
4955 POSITION px = x1 - x;
4958 POSITION ny = x2 - x1;
4959 POSITION nx = y1 - y2;
4962 POSITION pd = distance(y1, x1, y, x);
4963 POSITION nd = distance(y1, x1, y2, x2);
4965 if (pd > nd) return distance(y, x, y2, x2);
4967 /* Component of P on N */
4968 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
4970 /* Absolute value */
4971 return((nd >= 0) ? nd : 0 - nd);
4978 * Modified version of los() for calculation of disintegration balls.
4979 * Disintegration effects are stopped by permanent walls.
4981 bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
4983 POSITION dx, dy; /* Delta */
4984 POSITION ax, ay; /* Absolute */
4985 POSITION sx, sy; /* Signs */
4986 POSITION qx, qy; /* Fractions */
4987 POSITION tx, ty; /* Scanners */
4988 POSITION f1, f2; /* Scale factors */
4989 POSITION m; /* Slope, or 1/Slope, of LOS */
4991 /* Extract the offset */
4995 /* Extract the absolute offset */
4999 /* Handle adjacent (or identical) grids */
5000 if ((ax < 2) && (ay < 2)) return (TRUE);
5002 /* Paranoia -- require "safe" origin */
5003 /* if (!in_bounds(y1, x1)) return (FALSE); */
5005 /* Directly South/North */
5008 /* South -- check for walls */
5011 for (ty = y1 + 1; ty < y2; ty++)
5013 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5017 /* North -- check for walls */
5020 for (ty = y1 - 1; ty > y2; ty--)
5022 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5030 /* Directly East/West */
5033 /* East -- check for walls */
5036 for (tx = x1 + 1; tx < x2; tx++)
5038 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5042 /* West -- check for walls */
5045 for (tx = x1 - 1; tx > x2; tx--)
5047 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5055 /* Extract some signs */
5056 sx = (dx < 0) ? -1 : 1;
5057 sy = (dy < 0) ? -1 : 1;
5059 /* Vertical "knights" */
5064 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
5068 /* Horizontal "knights" */
5073 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
5077 /* Calculate scale factor div 2 */
5080 /* Calculate scale factor */
5084 /* Travel horizontally */
5087 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
5093 /* Consider the special case where slope == 1. */
5104 /* Note (below) the case (qy == f2), where */
5105 /* the LOS exactly meets the corner of a tile. */
5108 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5119 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5132 /* Travel vertically */
5135 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
5151 /* Note (below) the case (qx == f2), where */
5152 /* the LOS exactly meets the corner of a tile. */
5155 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5166 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5187 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)
5192 int brev = rad * rad / dist;
5196 int mdis = distance(y1, x1, y2, x2) + rad;
5198 while (bdis <= mdis)
5202 if ((0 < dist) && (path_n < dist))
5204 POSITION ny = GRID_Y(path_g[path_n]);
5205 POSITION nx = GRID_X(path_g[path_n]);
5206 POSITION nd = distance(ny, nx, y1, x1);
5208 /* Get next base point */
5217 /* Travel from center outward */
5218 for (cdis = 0; cdis <= brad; cdis++)
5220 /* Scan the maximal blast area of radius "cdis" */
5221 for (y = by - cdis; y <= by + cdis; y++)
5223 for (x = bx - cdis; x <= bx + cdis; x++)
5225 /* Ignore "illegal" locations */
5226 if (!in_bounds(y, x)) continue;
5228 /* Enforce a circular "ripple" */
5229 if (distance(y1, x1, y, x) != bdis) continue;
5231 /* Enforce an arc */
5232 if (distance(by, bx, y, x) != cdis) continue;
5238 /* Lights are stopped by opaque terrains */
5239 if (!los(by, bx, y, x)) continue;
5241 case GF_DISINTEGRATE:
5242 /* Disintegration are stopped only by perma-walls */
5243 if (!in_disintegration_range(by, bx, y, x)) continue;
5246 /* Ball explosions are stopped by walls */
5247 if (!projectable(by, bx, y, x)) continue;
5251 /* Save this grid */
5259 /* Encode some more "radius" info */
5260 gm[bdis + 1] = *pgrids;
5262 /* Increase the size */
5263 brad = rad * (path_n + brev) / (dist + brev);
5265 /* Find the next ripple */
5269 /* Store the effect size */
5275 * @brief 汎用的なビーム/ボルト/ボール系処理のルーチン Generic "beam"/"bolt"/"ball" projection routine.
5276 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
5277 * @param rad 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
5278 * @param y 目標Y座標 / Target y location (or location to travel "towards")
5279 * @param x 目標X座標 / Target x location (or location to travel "towards")
5280 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
5281 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
5282 * @param flg 効果フラグ / Extra bit flags (see PROJECT_xxxx in "defines.h")
5283 * @param monspell 効果元のモンスター魔法ID
5284 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
5287 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
5288 * towards a given location (optionally passing over the heads of interposing
5289 * monsters), and have it do a given amount of damage to the monsters (and
5290 * optionally objects) within the given radius of the final location.
5292 * A "bolt" travels from source to target and affects only the target grid.
5293 * A "beam" travels from source to target, affecting all grids passed through.
5294 * A "ball" travels from source to the target, exploding at the target, and
5295 * affecting everything within the given radius of the target location.
5297 * Traditionally, a "bolt" does not affect anything on the ground, and does
5298 * not pass over the heads of interposing monsters, much like a traditional
5299 * missile, and will "stop" abruptly at the "target" even if no monster is
5300 * positioned there, while a "ball", on the other hand, passes over the heads
5301 * of monsters between the source and target, and affects everything except
5302 * the source monster which lies within the final radius, while a "beam"
5303 * affects every monster between the source and target, except for the casting
5304 * monster (or player), and rarely affects things on the ground.
5306 * Two special flags allow us to use this function in special ways, the
5307 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
5308 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
5309 * actually projecting from the source monster (or player).
5311 * The player will only get "experience" for monsters killed by himself
5312 * Unique monsters can only be destroyed by attacks from the player
5314 * Only 256 grids can be affected per projection, limiting the effective
5315 * "radius" of standard ball attacks to nine units (diameter nineteen).
5317 * One can project in a given "direction" by combining PROJECT_THRU with small
5318 * offsets to the initial location (see "line_spell()"), or by calculating
5319 * "virtual targets" far away from the player.
5321 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
5322 * continuing until it actually hits somethings (useful for "stone to mud").
5324 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
5326 * Balls must explode BEFORE hitting walls, or they would affect monsters
5327 * on both sides of a wall. Some bug reports indicate that this is still
5328 * happening in 2.7.8 for Windows, though it appears to be impossible.
5330 * We "pre-calculate" the blast area only in part for efficiency.
5331 * More importantly, this lets us do "explosions" from the "inside" out.
5332 * This results in a more logical distribution of "blast" treasure.
5333 * It also produces a better (in my opinion) animation of the explosion.
5334 * It could be (but is not) used to have the treasure dropped by monsters
5335 * in the middle of the explosion fall "outwards", and then be damaged by
5336 * the blast as it spreads outwards towards the treasure drop location.
5338 * Walls and doors are included in the blast area, so that they can be
5339 * "burned" or "melted" in later versions.
5341 * This algorithm is intended to maximize simplicity, not necessarily
5342 * efficiency, since this function is not a bottleneck in the code.
5344 * We apply the blast effect from ground zero outwards, in several passes,
5345 * first affecting features, then objects, then monsters, then the player.
5346 * This allows walls to be removed before checking the object or monster
5347 * in the wall, and protects objects which are dropped by monsters killed
5348 * in the blast, and allows the player to see all affects before he is
5349 * killed or teleported away. The semantics of this method are open to
5350 * various interpretations, but they seem to work well in practice.
5352 * We process the blast area from ground-zero outwards to allow for better
5353 * distribution of treasure dropped by monsters, and because it provides a
5354 * pleasing visual effect at low cost.
5356 * Note that the damage done by "ball" explosions decreases with distance.
5357 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
5359 * Notice the "napalm" effect of "beam" weapons. First they "project" to
5360 * the target, and then the damage "flows" along this beam of destruction.
5361 * The damage at every grid is the same as at the "center" of a "ball"
5362 * explosion, since the "beam" grids are treated as if they ARE at the
5363 * center of a "ball" explosion.
5365 * Currently, specifying "beam" plus "ball" means that locations which are
5366 * covered by the initial "beam", and also covered by the final "ball", except
5367 * for the final grid (the epicenter of the ball), will be "hit twice", once
5368 * by the initial beam, and once by the exploding ball. For the grid right
5369 * next to the epicenter, this results in 150% damage being done. The center
5370 * does not have this problem, for the same reason the final grid in a "beam"
5371 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
5372 * grids which are covered by the "ball" will NOT work, as then they will
5373 * receive LESS damage than they should. Do not combine "beam" with "ball".
5375 * The array "gy[],gx[]" with current size "grids" is used to hold the
5376 * collected locations of all grids in the "blast area" plus "beam path".
5378 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
5379 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
5380 * first blast grid (see above) with radius "N" from the blast center. Note
5381 * that only the first gm[1] grids in the blast area thus take full damage.
5382 * Also, note that gm[rad+1] is always equal to "grids", which is the total
5383 * number of blast grids.
5385 * Note that once the projection is complete, (y2,x2) holds the final location
5386 * of bolts/beams, and the "epicenter" of balls.
5388 * Note also that "rad" specifies the "inclusive" radius of projection blast,
5389 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
5390 * implementation of the "distance" function. Also, a bolt can be properly
5391 * viewed as a "ball" with a "rad" of "zero".
5393 * Note that if no "target" is reached before the beam/bolt/ball travels the
5394 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
5395 * may be relevant even for bolts, since they have a "1x1" mini-blast.
5397 * Note that for consistency, we "pretend" that the bolt actually takes "time"
5398 * to move from point A to point B, even if the player cannot see part of the
5399 * projection path. Note that in general, the player will *always* see part
5400 * of the path, since it either starts at the player or ends on the player.
5402 * Hack -- we assume that every "projection" is "self-illuminating".
5404 * Hack -- when only a single monster is affected, we automatically track
5405 * (and recall) that monster, unless "PROJECT_JUMP" is used.
5407 * Note that all projections now "explode" at their final destination, even
5408 * if they were being projected at a more distant destination. This means
5409 * that "ball" spells will *always* explode.
5411 * Note that we must call "handle_stuff()" after affecting terrain features
5412 * in the blast radius, in case the "illumination" of the grid was changed,
5413 * and "update_view()" and "update_monsters()" need to be called.
5416 bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
5426 POSITION y_saver, x_saver; /* For reflecting monsters */
5428 int msec = delay_factor * delay_factor * delay_factor;
5430 /* Assume the player sees nothing */
5431 bool notice = FALSE;
5433 /* Assume the player has seen nothing */
5434 bool visual = FALSE;
5436 /* Assume the player has seen no blast grids */
5439 /* Assume to be a normal ball spell */
5440 bool breath = FALSE;
5442 /* Is the player blind? */
5443 bool blind = (p_ptr->blind ? TRUE : FALSE);
5445 bool old_hide = FALSE;
5447 /* Number of grids in the "path" */
5450 /* Actual grids in the "path" */
5453 /* Number of grids in the "blast area" (including the "beam" path) */
5456 /* Coordinates of the affected grids */
5457 POSITION gx[1024], gy[1024];
5459 /* Encoded "radius" info (see above) */
5462 /* Actual radius encoded in gm[] */
5463 POSITION gm_rad = rad;
5467 /* Attacker's name (prepared before polymorph)*/
5468 GAME_TEXT who_name[MAX_NLEN];
5470 /* Can the player see the source of this effect? */
5471 bool see_s_msg = TRUE;
5473 /* Initialize by null string */
5479 /* Default target of monsterspell is player */
5480 monster_target_y = p_ptr->y;
5481 monster_target_x = p_ptr->x;
5483 /* Hack -- Jump to target */
5484 if (flg & (PROJECT_JUMP))
5489 /* Clear the flag */
5490 flg &= ~(PROJECT_JUMP);
5495 /* Start at player */
5502 /* Start at monster */
5505 x1 = current_floor_ptr->m_list[who].fx;
5506 y1 = current_floor_ptr->m_list[who].fy;
5507 monster_desc(who_name, ¤t_floor_ptr->m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
5519 /* Default "destination" */
5524 /* Hack -- verify stuff */
5525 if (flg & (PROJECT_THRU))
5527 if ((x1 == x2) && (y1 == y2))
5529 flg &= ~(PROJECT_THRU);
5533 /* Handle a breath attack */
5538 if (flg & PROJECT_HIDE) old_hide = TRUE;
5539 flg |= PROJECT_HIDE;
5543 /* Hack -- Assume there will be no blast (max radius 32) */
5544 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
5552 /* Collect beam grids */
5553 if (flg & (PROJECT_BEAM))
5564 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
5566 case GF_DISINTEGRATE:
5567 flg |= (PROJECT_GRID);
5568 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
5572 /* Calculate the projection path */
5574 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
5577 /* Giga-Hack SEEKER & SUPER_RAY */
5579 if( typ == GF_SEEKER )
5589 for (i = 0; i < path_n; ++i)
5594 POSITION ny = GRID_Y(path_g[i]);
5595 POSITION nx = GRID_X(path_g[i]);
5606 /* Only do visuals if requested */
5607 if (!blind && !(flg & (PROJECT_HIDE)))
5609 /* Only do visuals if the player can "see" the bolt */
5610 if (panel_contains(y, x) && player_has_los_bold(y, x))
5617 /* Obtain the bolt pict */
5618 p = bolt_pict(oy, ox, y, x, typ);
5620 /* Extract attr/char */
5624 /* Visual effects */
5625 print_rel(c, a, y, x);
5626 move_cursor_relative(y, x);
5627 /*if (fresh_before)*/ Term_fresh();
5628 Term_xtra(TERM_XTRA_DELAY, msec);
5630 /*if (fresh_before)*/ Term_fresh();
5632 /* Display "beam" grids */
5633 if (flg & (PROJECT_BEAM))
5635 /* Obtain the explosion pict */
5636 p = bolt_pict(y, x, y, x, typ);
5638 /* Extract attr/char */
5642 /* Visual effects */
5643 print_rel(c, a, y, x);
5646 /* Hack -- Activate delay */
5650 /* Hack -- delay anyway for consistency */
5653 /* Delay for consistency */
5654 Term_xtra(TERM_XTRA_DELAY, msec);
5657 if (project_o(0, 0, y, x, dam, GF_SEEKER))notice = TRUE;
5658 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
5660 /* The target of monsterspell becomes tha mirror(broken) */
5661 monster_target_y = y;
5662 monster_target_x = x;
5664 remove_mirror(y, x);
5665 next_mirror(&oy, &ox, y, x);
5667 path_n = i + project_path(&(path_g[i + 1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
5668 for (j = last_i; j <= i; j++)
5670 y = GRID_Y(path_g[j]);
5671 x = GRID_X(path_g[j]);
5672 if (project_m(0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
5673 if (!who && (project_m_n == 1) && !jump) {
5674 if (current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0) {
5675 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5679 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5680 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5684 (void)project_f(0, 0, y, x, dam, GF_SEEKER);
5689 for(i = last_i ; i < path_n ; i++)
5692 py = GRID_Y(path_g[i]);
5693 px = GRID_X(path_g[i]);
5694 if (project_m(0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
5696 if (!who && (project_m_n == 1) && !jump) {
5697 if (current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0)
5699 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5703 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5704 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5708 (void)project_f(0, 0, py, px, dam, GF_SEEKER);
5712 else if(typ == GF_SUPER_RAY){
5714 int second_step = 0;
5721 for (i = 0; i < path_n; ++i)
5726 POSITION ny = GRID_Y(path_g[i]);
5727 POSITION nx = GRID_X(path_g[i]);
5738 /* Only do visuals if requested */
5739 if (!blind && !(flg & (PROJECT_HIDE)))
5741 /* Only do visuals if the player can "see" the bolt */
5742 if (panel_contains(y, x) && player_has_los_bold(y, x))
5749 /* Obtain the bolt pict */
5750 p = bolt_pict(oy, ox, y, x, typ);
5752 /* Extract attr/char */
5756 /* Visual effects */
5757 print_rel(c, a, y, x);
5758 move_cursor_relative(y, x);
5759 /*if (fresh_before)*/ Term_fresh();
5760 Term_xtra(TERM_XTRA_DELAY, msec);
5762 /*if (fresh_before)*/ Term_fresh();
5764 /* Display "beam" grids */
5765 if (flg & (PROJECT_BEAM))
5767 /* Obtain the explosion pict */
5768 p = bolt_pict(y, x, y, x, typ);
5770 /* Extract attr/char */
5774 /* Visual effects */
5775 print_rel(c, a, y, x);
5778 /* Hack -- Activate delay */
5782 /* Hack -- delay anyway for consistency */
5785 /* Delay for consistency */
5786 Term_xtra(TERM_XTRA_DELAY, msec);
5789 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
5790 if (!cave_have_flag_bold(y, x, FF_PROJECT))
5792 if( second_step )continue;
5795 if( is_mirror_grid(¤t_floor_ptr->grid_array[y][x]) && !second_step )
5797 /* The target of monsterspell becomes tha mirror(broken) */
5798 monster_target_y = y;
5799 monster_target_x = x;
5802 for( j = 0; j <=i ; j++ )
5804 y = GRID_Y(path_g[j]);
5805 x = GRID_X(path_g[j]);
5806 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
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);
5813 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
5814 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
5815 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
5816 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
5817 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
5820 for( i = 0; i < path_n ; i++ )
5823 py = GRID_Y(path_g[i]);
5824 px = GRID_X(path_g[i]);
5825 (void)project_m(0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
5826 if(!who && (project_m_n == 1) && !jump){
5827 if(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx >0 ){
5828 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5832 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5833 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5837 (void)project_f(0, 0, py, px, dam, GF_SUPER_RAY);
5842 /* Project along the path */
5843 for (i = 0; i < path_n; ++i)
5848 POSITION ny = GRID_Y(path_g[i]);
5849 POSITION nx = GRID_X(path_g[i]);
5851 if (flg & PROJECT_DISI)
5853 /* Hack -- Balls explode before reaching walls */
5854 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
5856 else if (flg & PROJECT_LOS)
5858 /* Hack -- Balls explode before reaching walls */
5859 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
5863 /* Hack -- Balls explode before reaching walls */
5864 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
5871 /* Collect beam grids */
5872 if (flg & (PROJECT_BEAM))
5879 /* Only do visuals if requested */
5880 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
5882 /* Only do visuals if the player can "see" the bolt */
5883 if (panel_contains(y, x) && player_has_los_bold(y, x))
5890 /* Obtain the bolt pict */
5891 p = bolt_pict(oy, ox, y, x, typ);
5893 /* Extract attr/char */
5897 /* Visual effects */
5898 print_rel(c, a, y, x);
5899 move_cursor_relative(y, x);
5900 /*if (fresh_before)*/ Term_fresh();
5901 Term_xtra(TERM_XTRA_DELAY, msec);
5903 /*if (fresh_before)*/ Term_fresh();
5905 /* Display "beam" grids */
5906 if (flg & (PROJECT_BEAM))
5908 /* Obtain the explosion pict */
5909 p = bolt_pict(y, x, y, x, typ);
5911 /* Extract attr/char */
5915 /* Visual effects */
5916 print_rel(c, a, y, x);
5919 /* Hack -- Activate delay */
5923 /* Hack -- delay anyway for consistency */
5926 /* Delay for consistency */
5927 Term_xtra(TERM_XTRA_DELAY, msec);
5934 /* Save the "blast epicenter" */
5938 if (breath && !path_n)
5944 flg &= ~(PROJECT_HIDE);
5948 /* Start the "explosion" */
5951 /* Hack -- make sure beams get to "explode" */
5959 /* If we found a "target", explode there */
5960 if (dist <= MAX_RANGE)
5962 /* Mega-Hack -- remove the final "beam" grid */
5963 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
5966 * Create a conical breath attack
5977 flg &= ~(PROJECT_HIDE);
5979 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
5983 /* Determine the blast area, work from the inside out */
5984 for (dist = 0; dist <= rad; dist++)
5986 /* Scan the maximal blast area of radius "dist" */
5987 for (y = by - dist; y <= by + dist; y++)
5989 for (x = bx - dist; x <= bx + dist; x++)
5991 /* Ignore "illegal" locations */
5992 if (!in_bounds2(y, x)) continue;
5994 /* Enforce a "circular" explosion */
5995 if (distance(by, bx, y, x) != dist) continue;
6001 /* Lights are stopped by opaque terrains */
6002 if (!los(by, bx, y, x)) continue;
6004 case GF_DISINTEGRATE:
6005 /* Disintegration are stopped only by perma-walls */
6006 if (!in_disintegration_range(by, bx, y, x)) continue;
6009 /* Ball explosions are stopped by walls */
6010 if (!projectable(by, bx, y, x)) continue;
6014 /* Save this grid */
6021 /* Encode some more "radius" info */
6027 /* Speed -- ignore "non-explosions" */
6028 if (!grids) return (FALSE);
6031 /* Display the "blast area" if requested */
6032 if (!blind && !(flg & (PROJECT_HIDE)))
6034 /* Then do the "blast", from inside out */
6035 for (t = 0; t <= gm_rad; t++)
6037 /* Dump everything with this radius */
6038 for (i = gm[t]; i < gm[t+1]; i++)
6040 /* Extract the location */
6044 /* Only do visuals if the player can "see" the blast */
6045 if (panel_contains(y, x) && player_has_los_bold(y, x))
6054 /* Obtain the explosion pict */
6055 p = bolt_pict(y, x, y, x, typ);
6057 /* Extract attr/char */
6061 /* Visual effects -- Display */
6062 print_rel(c, a, y, x);
6066 /* Hack -- center the cursor */
6067 move_cursor_relative(by, bx);
6069 /* Flush each "radius" seperately */
6070 /*if (fresh_before)*/ Term_fresh();
6072 /* Delay (efficiently) */
6073 if (visual || drawn)
6075 Term_xtra(TERM_XTRA_DELAY, msec);
6079 /* Flush the erasing */
6082 /* Erase the explosion drawn above */
6083 for (i = 0; i < grids; i++)
6085 /* Extract the location */
6089 /* Hack -- Erase if needed */
6090 if (panel_contains(y, x) && player_has_los_bold(y, x))
6096 /* Hack -- center the cursor */
6097 move_cursor_relative(by, bx);
6099 /* Flush the explosion */
6100 /*if (fresh_before)*/ Term_fresh();
6104 update_creature(p_ptr);
6106 if (flg & PROJECT_KILL)
6108 see_s_msg = (who > 0) ? is_seen(¤t_floor_ptr->m_list[who]) :
6109 (!who ? TRUE : (player_can_see_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)));
6113 /* Check features */
6114 if (flg & (PROJECT_GRID))
6116 /* Start with "dist" of zero */
6119 /* Scan for features */
6120 for (i = 0; i < grids; i++)
6122 /* Hack -- Notice new "dist" values */
6123 if (gm[dist+1] == i) dist++;
6125 /* Get the grid location */
6129 /* Find the closest point in the blast */
6132 int d = dist_to_line(y, x, y1, x1, by, bx);
6134 /* Affect the grid */
6135 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
6139 /* Affect the grid */
6140 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
6145 update_creature(p_ptr);
6148 if (flg & (PROJECT_ITEM))
6150 /* Start with "dist" of zero */
6153 /* Scan for objects */
6154 for (i = 0; i < grids; i++)
6156 /* Hack -- Notice new "dist" values */
6157 if (gm[dist+1] == i) dist++;
6159 /* Get the grid location */
6163 /* Find the closest point in the blast */
6166 int d = dist_to_line(y, x, y1, x1, by, bx);
6168 /* Affect the object in the grid */
6169 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
6173 /* Affect the object in the grid */
6174 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
6180 /* Check monsters */
6181 if (flg & (PROJECT_KILL))
6188 /* Start with "dist" of zero */
6191 /* Scan for monsters */
6192 for (i = 0; i < grids; i++)
6196 /* Hack -- Notice new "dist" values */
6197 if (gm[dist + 1] == i) dist++;
6199 /* Get the grid location */
6203 /* A single bolt may be reflected */
6206 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
6207 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
6209 if ((flg & PROJECT_REFLECTABLE) && current_floor_ptr->grid_array[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
6210 ((current_floor_ptr->grid_array[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
6211 (!who || dist_hack > 1) && !one_in_(10))
6214 int max_attempts = 10;
6216 /* Choose 'new' target */
6219 t_y = y_saver - 1 + randint1(3);
6220 t_x = x_saver - 1 + randint1(3);
6223 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
6225 if (max_attempts < 1)
6231 sound(SOUND_REFLECT);
6234 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
6235 msg_print(_("「北斗神拳奥義・二指真空把!」", "The attack bounces!"));
6236 else if (m_ptr->r_idx == MON_DIO)
6237 msg_print(_("ディオ・ブランドーは指一本で攻撃を弾き返した!", "The attack bounces!"));
6239 msg_print(_("攻撃は跳ね返った!", "The attack bounces!"));
6241 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
6243 /* Reflected bolts randomly target either one */
6244 if (player_bold(y, x) || one_in_(2)) flg &= ~(PROJECT_PLAYER);
6245 else flg |= PROJECT_PLAYER;
6247 /* The bolt is reflected */
6248 project(current_floor_ptr->grid_array[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
6250 /* Don't affect the monster any longer */
6256 /* Find the closest point in the blast */
6259 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
6263 effective_dist = dist;
6267 /* There is the riding player on this monster */
6268 if (p_ptr->riding && player_bold(y, x))
6270 /* Aimed on the player */
6271 if (flg & PROJECT_PLAYER)
6273 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
6276 * A beam or bolt is well aimed
6278 * So don't affects the mount.
6285 * The spell is not well aimed,
6286 * So partly affect the mount too.
6293 * This grid is the original target.
6294 * Or aimed on your horse.
6296 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
6298 /* Hit the mount with full damage */
6302 * Otherwise this grid is not the
6303 * original target, it means that line
6304 * of fire is obstructed by this
6308 * A beam or bolt will hit either
6309 * player or mount. Choose randomly.
6311 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
6315 /* Hit the mount with full damage */
6319 /* Hit the player later */
6320 flg |= PROJECT_PLAYER;
6322 /* Don't affect the mount */
6328 * The spell is not well aimed, so
6329 * partly affect both player and
6338 /* Affect the monster in the grid */
6339 if (project_m(who, effective_dist, y, x, dam, typ, flg, see_s_msg)) notice = TRUE;
6343 /* Player affected one monster (without "jumping") */
6344 if (!who && (project_m_n == 1) && !jump)
6349 /* Track if possible */
6350 if (current_floor_ptr->grid_array[y][x].m_idx > 0)
6352 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
6356 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6357 health_track(current_floor_ptr->grid_array[y][x].m_idx);
6365 if (flg & (PROJECT_KILL))
6367 /* Start with "dist" of zero */
6370 /* Scan for player */
6371 for (i = 0; i < grids; i++)
6375 /* Hack -- Notice new "dist" values */
6376 if (gm[dist+1] == i) dist++;
6378 /* Get the grid location */
6382 /* Affect the player? */
6383 if (!player_bold(y, x)) continue;
6385 /* Find the closest point in the blast */
6388 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
6392 effective_dist = dist;
6395 /* Target may be your horse */
6398 /* Aimed on the player */
6399 if (flg & PROJECT_PLAYER)
6401 /* Hit the player with full damage */
6405 * Hack -- When this grid was not the
6406 * original target, a beam or bolt
6407 * would hit either player or mount,
6408 * and should be choosen randomly.
6410 * But already choosen to hit the
6411 * mount at this point.
6413 * Or aimed on your horse.
6415 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
6418 * A beam or bolt is well aimed
6420 * So don't affects the player.
6427 * The spell is not well aimed,
6428 * So partly affect the player too.
6434 /* Affect the player */
6435 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
6441 GAME_TEXT m_name[MAX_NLEN];
6443 monster_desc(m_name, ¤t_floor_ptr->m_list[p_ptr->riding], 0);
6445 if (rakubadam_m > 0)
6447 if (rakuba(rakubadam_m, FALSE))
6449 msg_format(_("%^sに振り落とされた!", "%^s has thrown you off!"), m_name);
6452 if (p_ptr->riding && rakubadam_p > 0)
6454 if(rakuba(rakubadam_p, FALSE))
6456 msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_name);
6461 /* Return "something was noticed" */
6466 * @brief 鏡魔法「封魔結界」の効果処理
6468 * @return 効果があったらTRUEを返す
6470 bool binding_field(HIT_POINT dam)
6472 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
6473 int mirror_num = 0; /* 鏡の数 */
6475 POSITION centersign;
6476 POSITION x1, x2, y1, y2;
6478 int msec = delay_factor*delay_factor*delay_factor;
6481 POSITION point_x[3];
6482 POSITION point_y[3];
6484 /* Default target of monsterspell is player */
6485 monster_target_y = p_ptr->y;
6486 monster_target_x = p_ptr->x;
6488 for (x = 0; x < current_floor_ptr->width; x++)
6490 for (y = 0; y < current_floor_ptr->height; y++)
6492 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]) &&
6493 distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
6494 distance(p_ptr->y, p_ptr->x, y, x) != 0 &&
6495 player_has_los_bold(y, x) &&
6496 projectable(p_ptr->y, p_ptr->x, y, x)
6498 mirror_y[mirror_num] = y;
6499 mirror_x[mirror_num] = x;
6505 if (mirror_num < 2)return FALSE;
6507 point_x[0] = randint0(mirror_num);
6509 point_x[1] = randint0(mirror_num);
6510 } while (point_x[0] == point_x[1]);
6512 point_y[0] = mirror_y[point_x[0]];
6513 point_x[0] = mirror_x[point_x[0]];
6514 point_y[1] = mirror_y[point_x[1]];
6515 point_x[1] = mirror_x[point_x[1]];
6516 point_y[2] = p_ptr->y;
6517 point_x[2] = p_ptr->x;
6519 x = point_x[0] + point_x[1] + point_x[2];
6520 y = point_y[0] + point_y[1] + point_y[2];
6522 centersign = (point_x[0] * 3 - x)*(point_y[1] * 3 - y)
6523 - (point_y[0] * 3 - y)*(point_x[1] * 3 - x);
6524 if (centersign == 0)return FALSE;
6526 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
6527 x1 = x1 < point_x[2] ? x1 : point_x[2];
6528 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
6529 y1 = y1 < point_y[2] ? y1 : point_y[2];
6531 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
6532 x2 = x2 > point_x[2] ? x2 : point_x[2];
6533 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
6534 y2 = y2 > point_y[2] ? y2 : point_y[2];
6536 for (y = y1; y <= y2; y++) {
6537 for (x = x1; x <= x2; x++) {
6538 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6539 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6540 centersign*((point_x[1] - x)*(point_y[2] - y)
6541 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6542 centersign*((point_x[2] - x)*(point_y[0] - y)
6543 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6545 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6546 /* Visual effects */
6548 && panel_contains(y, x)) {
6549 p = bolt_pict(y, x, y, x, GF_MANA);
6550 print_rel(PICT_C(p), PICT_A(p), y, x);
6551 move_cursor_relative(y, x);
6552 /*if (fresh_before)*/ Term_fresh();
6553 Term_xtra(TERM_XTRA_DELAY, msec);
6559 for (y = y1; y <= y2; y++) {
6560 for (x = x1; x <= x2; x++) {
6561 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6562 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6563 centersign*((point_x[1] - x)*(point_y[2] - y)
6564 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6565 centersign*((point_x[2] - x)*(point_y[0] - y)
6566 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6568 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6569 (void)project_f(0, 0, y, x, dam, GF_MANA);
6574 for (y = y1; y <= y2; y++) {
6575 for (x = x1; x <= x2; x++) {
6576 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6577 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6578 centersign*((point_x[1] - x)*(point_y[2] - y)
6579 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6580 centersign*((point_x[2] - x)*(point_y[0] - y)
6581 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6583 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6584 (void)project_o(0, 0, y, x, dam, GF_MANA);
6589 for (y = y1; y <= y2; y++) {
6590 for (x = x1; x <= x2; x++) {
6591 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6592 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6593 centersign*((point_x[1] - x)*(point_y[2] - y)
6594 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6595 centersign*((point_x[2] - x)*(point_y[0] - y)
6596 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6598 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6599 (void)project_m(0, 0, y, x, dam, GF_MANA,
6600 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE);
6606 msg_print(_("鏡が結界に耐えきれず、壊れてしまった。", "The field broke a mirror"));
6607 remove_mirror(point_y[0], point_x[0]);
6614 * @brief 鏡魔法「鏡の封印」の効果処理
6616 * @return 効果があったらTRUEを返す
6618 void seal_of_mirror(HIT_POINT dam)
6622 for (x = 0; x < current_floor_ptr->width; x++)
6624 for (y = 0; y < current_floor_ptr->height; y++)
6626 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
6628 if (project_m(0, 0, y, x, dam, GF_GENOCIDE,
6629 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE))
6631 if (!current_floor_ptr->grid_array[y][x].m_idx)
6633 remove_mirror(y, x);
6645 * @brief 領域魔法に応じて技能の名称を返す。
6646 * @param tval 魔法書のtval
6647 * @return 領域魔法の技能名称を保管した文字列ポインタ
6649 concptr spell_category_name(OBJECT_TYPE_VALUE tval)
6653 case TV_HISSATSU_BOOK:
6654 return _("必殺技", "art");
6656 return _("祈り", "prayer");
6658 return _("歌", "song");
6660 return _("呪文", "spell");