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.
20 #include "object-curse.h"
21 #include "player-damage.h"
22 #include "player-effects.h"
25 #include "monster-status.h"
26 #include "monster-spell.h"
28 #include "spells-status.h"
29 #include "spells-diceroll.h"
30 #include "spells-summon.h"
31 #include "monsterrace-hook.h"
39 #include "player-status.h"
40 #include "player-move.h"
41 #include "realm-hex.h"
42 #include "object-hook.h"
43 #include "object-broken.h"
44 #include "object-flavor.h"
49 #include "view-mainwindow.h"
52 static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
53 static int rakubadam_p; /*!< 落馬した際のダメージ量 */
55 int project_length = 0; /*!< 投射の射程距離 */
60 * @brief 配置した鏡リストの次を取得する /
61 * Get another mirror. for SEEKER
62 * @param next_y 次の鏡のy座標を返す参照ポインタ
63 * @param next_x 次の鏡のx座標を返す参照ポインタ
64 * @param cury 現在の鏡のy座標
65 * @param curx 現在の鏡のx座標
67 static void next_mirror(POSITION* next_y, POSITION* next_x, POSITION cury, POSITION curx)
69 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
70 int mirror_num = 0; /* 鏡の数 */
74 for (x = 0; x < current_floor_ptr->width; x++)
76 for (y = 0; y < current_floor_ptr->height; y++)
78 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x])) {
79 mirror_y[mirror_num] = y;
80 mirror_x[mirror_num] = x;
87 num = randint0(mirror_num);
88 *next_y = mirror_y[num];
89 *next_x = mirror_x[num];
92 *next_y = cury + randint0(5) - 2;
93 *next_x = curx + randint0(5) - 2;
99 * Mega-Hack -- track "affected" monsters (see "project()" comments)
101 static int project_m_n; /*!< 魔法効果範囲内にいるモンスターの数 */
102 static POSITION project_m_x; /*!< 処理中のモンスターX座標 */
103 static POSITION project_m_y; /*!< 処理中のモンスターY座標 */
104 /* Mega-Hack -- monsters target */
105 static POSITION monster_target_x; /*!< モンスターの攻撃目標X座標 */
106 static POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
110 * @brief 汎用的なビーム/ボルト/ボール系による地形効果処理 / We are called from "project()" to "damage" terrain features
111 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
112 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
113 * @param y 目標Y座標 / Target y location (or location to travel "towards")
114 * @param x 目標X座標 / Target x location (or location to travel "towards")
115 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
116 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
117 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
120 * We are called both for "beam" effects and "ball" effects.
122 * The "r" parameter is the "distance from ground zero".
124 * Note that we determine if the player can "see" anything that happens
125 * by taking into account: blindness, line-of-sight, and illumination.
127 * We return "TRUE" if the effect of the projection is "obvious".
129 * We also "see" grids which are "memorized", probably a hack
131 * Perhaps we should affect doors?
134 static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
136 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
137 feature_type *f_ptr = &f_info[g_ptr->feat];
139 bool obvious = FALSE;
140 bool known = player_has_los_bold(y, x);
145 /* Reduce damage by distance */
146 dam = (dam + r) / (r + 1);
149 if (have_flag(f_ptr->flags, FF_TREE))
157 message = _("枯れた", "was blasted."); break;
159 message = _("縮んだ", "shrank."); break;
161 message = _("溶けた", "melted."); break;
164 message = _("凍り、砕け散った", "was frozen and smashed."); break;
168 message = _("燃えた", "burns up!"); break;
180 message = _("粉砕された", "was crushed."); break;
182 message = NULL; break;
186 msg_format(_("木は%s。", "A tree %s"), message);
187 cave_set_feat(y, x, one_in_(3) ? feat_brake : feat_grass);
190 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
194 /* Analyze the type */
197 /* Ignore most effects */
232 /* Destroy Traps (and Locks) */
235 /* Reveal secret doors */
236 if (is_hidden_door(g_ptr))
241 /* Check line of sight */
249 if (is_trap(g_ptr->feat))
251 /* Check line of sight */
254 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
258 /* Destroy the trap */
259 cave_alter_feat(y, x, FF_DISARM);
262 /* Locked doors are unlocked */
263 if (is_closed_door(g_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
265 FEAT_IDX old_feat = g_ptr->feat;
267 /* Unlock the door */
268 cave_alter_feat(y, x, FF_DISARM);
270 /* Check line of sound */
271 if (known && (old_feat != g_ptr->feat))
273 msg_print(_("カチッと音がした!", "Click!"));
278 /* Remove "unsafe" flag if player is not blind */
279 if (!p_ptr->blind && player_has_los_bold(y, x))
281 g_ptr->info &= ~(CAVE_UNSAFE);
289 /* Destroy Doors (and traps) */
292 /* Destroy all doors and traps */
293 if (is_trap(g_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
295 /* Check line of sight */
298 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
302 /* Destroy the feature */
303 cave_alter_feat(y, x, FF_TUNNEL);
306 /* Remove "unsafe" flag if player is not blind */
307 if (!p_ptr->blind && player_has_los_bold(y, x))
309 g_ptr->info &= ~(CAVE_UNSAFE);
317 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
319 if (have_flag(f_ptr->flags, FF_SPIKE))
321 s16b old_mimic = g_ptr->mimic;
322 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)];
324 cave_alter_feat(y, x, FF_SPIKE);
325 g_ptr->mimic = old_mimic;
330 /* Check line of sight */
331 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
333 msg_format(_("%sに何かがつっかえて開かなくなった。", "The %s seems stuck."), f_name + mimic_f_ptr->name);
340 /* Destroy walls (and doors) */
343 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
345 if (known && (g_ptr->info & (CAVE_MARK)))
347 msg_format(_("%sが溶けて泥になった!", "The %s turns into mud!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
351 /* Destroy the wall */
352 cave_alter_feat(y, x, FF_HURT_ROCK);
353 p_ptr->update |= (PU_FLOW);
361 if (!cave_naked_bold(y, x)) break;
362 if (player_bold(y, x)) break;
363 cave_set_feat(y, x, feat_door[DOOR_DOOR].closed);
364 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
376 if (!cave_naked_bold(y, x)) break;
377 if (player_bold(y, x)) break;
378 cave_set_feat(y, x, feat_tree);
379 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
385 if (!cave_naked_bold(y, x)) break;
386 g_ptr->info |= CAVE_OBJECT;
387 g_ptr->mimic = feat_glyph;
395 if (!cave_naked_bold(y, x)) break;
396 if (player_bold(y, x)) break;
397 cave_set_feat(y, x, feat_granite);
403 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
406 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
407 cave_set_feat(y, x, feat_shallow_lava);
411 cave_set_feat(y, x, feat_deep_lava);
418 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
421 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
422 cave_set_feat(y, x, feat_shallow_water);
426 cave_set_feat(y, x, feat_deep_water);
431 /* Lite up the grid */
435 /* Turn on the light */
436 if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
438 g_ptr->info |= (CAVE_GLOW);
441 update_local_illumination(y, x);
444 if (player_can_see_bold(y, x)) obvious = TRUE;
446 /* Mega-Hack -- Update the monster in the affected grid */
447 /* This allows "spear of light" (etc) to work "correctly" */
448 if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE);
450 if (p_ptr->special_defense & NINJA_S_STEALTH)
452 if (player_bold(y, x)) set_superstealth(FALSE);
459 /* Darken the grid */
463 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(g_ptr);
466 /* Turn off the light. */
469 if (current_floor_ptr->dun_level || !is_daytime())
471 for (j = 0; j < 9; j++)
473 int by = y + ddy_ddd[j];
474 int bx = x + ddx_ddd[j];
476 if (in_bounds2(by, bx))
478 grid_type *cc_ptr = ¤t_floor_ptr->grid_array[by][bx];
480 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
491 g_ptr->info &= ~(CAVE_GLOW);
493 /* Hack -- Forget "boring" grids */
494 if (!have_flag(f_ptr->flags, FF_REMEMBER))
497 g_ptr->info &= ~(CAVE_MARK);
504 update_local_illumination(y, x);
506 if (player_can_see_bold(y, x)) obvious = TRUE;
508 /* Mega-Hack -- Update the monster in the affected grid */
509 /* This allows "spear of light" (etc) to work "correctly" */
510 if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE);
520 if (is_mirror_grid(g_ptr))
522 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
525 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
528 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 50))
530 if (known && (g_ptr->info & CAVE_MARK))
532 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
536 /* Destroy the wall */
537 cave_alter_feat(y, x, FF_HURT_ROCK);
538 p_ptr->update |= (PU_FLOW);
545 if (is_mirror_grid(g_ptr) && p_ptr->lev < 40)
547 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
550 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
553 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 200))
555 if (known && (g_ptr->info & CAVE_MARK))
557 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
561 /* Destroy the wall */
562 cave_alter_feat(y, x, FF_HURT_ROCK);
563 p_ptr->update |= (PU_FLOW);
568 case GF_DISINTEGRATE:
570 /* Destroy mirror/glyph */
571 if (is_mirror_grid(g_ptr) || is_glyph_grid(g_ptr) || is_explosive_rune_grid(g_ptr))
574 /* Permanent features don't get effect */
575 /* But not protect monsters and other objects */
576 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
578 cave_alter_feat(y, x, FF_HURT_DISI);
580 /* Update some things -- similar to GF_KILL_WALL */
581 p_ptr->update |= (PU_FLOW);
588 /* Return "Anything seen?" */
595 * @brief 汎用的なビーム/ボルト/ボール系によるアイテムオブジェクトへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
596 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
597 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
598 * @param y 目標Y座標 / Target y location (or location to travel "towards")
599 * @param x 目標X座標 / Target x location (or location to travel "towards")
600 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
601 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
602 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
605 * We are called from "project()" to "damage" objects
607 * We are called both for "beam" effects and "ball" effects.
609 * Perhaps we should only SOMETIMES damage things on the ground.
611 * The "r" parameter is the "distance from ground zero".
613 * Note that we determine if the player can "see" anything that happens
614 * by taking into account: blindness, line-of-sight, and illumination.
616 * We also "see" grids which are "memorized", probably a hack
618 * We return "TRUE" if the effect of the projection is "obvious".
621 static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
623 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
625 OBJECT_IDX this_o_idx, next_o_idx = 0;
627 bool obvious = FALSE;
628 bool known = player_has_los_bold(y, x);
630 BIT_FLAGS flgs[TR_FLAG_SIZE];
632 GAME_TEXT o_name[MAX_NLEN];
634 KIND_OBJECT_IDX k_idx = 0;
635 bool is_potion = FALSE;
640 /* Reduce damage by distance */
641 dam = (dam + r) / (r + 1);
644 /* Scan all objects in the grid */
645 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
647 object_type *o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
651 bool do_kill = FALSE;
653 concptr note_kill = NULL;
656 /* Get the "plural"-ness */
657 bool plural = (o_ptr->number > 1);
659 next_o_idx = o_ptr->next_o_idx;
660 object_flags(o_ptr, flgs);
662 /* Check for artifact */
663 if (object_is_artifact(o_ptr)) is_art = TRUE;
665 /* Analyze the type */
668 /* Acid -- Lots of things */
671 if (hates_acid(o_ptr))
674 note_kill = _("融けてしまった!", (plural ? " melt!" : " melts!"));
675 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
680 /* Elec -- Rings and Wands */
683 if (hates_elec(o_ptr))
686 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
687 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
692 /* Fire -- Flammable objects */
695 if (hates_fire(o_ptr))
698 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
699 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
704 /* Cold -- potions and flasks */
707 if (hates_cold(o_ptr))
709 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
711 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
719 if (hates_fire(o_ptr))
722 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
723 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
725 if (hates_elec(o_ptr))
729 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
730 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
738 if (hates_fire(o_ptr))
741 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
742 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
744 if (hates_cold(o_ptr))
748 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
749 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
754 /* Hack -- break potions and such */
760 if (hates_cold(o_ptr))
762 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
768 /* Mana and Chaos -- destroy everything */
774 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
778 case GF_DISINTEGRATE:
781 note_kill = _("蒸発してしまった!", (plural ? " evaporate!" : " evaporates!"));
788 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
789 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
790 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
794 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
798 if (object_is_cursed(o_ptr))
801 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
808 identify_item(o_ptr);
810 /* Auto-inscription */
811 autopick_alter_item((-this_o_idx), FALSE);
819 /* Chests are noticed only if trapped or locked */
820 if (o_ptr->tval == TV_CHEST)
822 /* Disarm/Unlock traps */
825 /* Disarm or Unlock */
826 o_ptr->pval = (0 - o_ptr->pval);
831 if (known && (o_ptr->marked & OM_FOUND))
833 msg_print(_("カチッと音がした!", "Click!"));
843 if (o_ptr->tval == TV_CORPSE)
848 if (!who || is_pet(¤t_floor_ptr->m_list[who]))
849 mode |= PM_FORCE_PET;
851 for (i = 0; i < o_ptr->number ; i++)
853 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
854 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
858 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
862 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
864 note_kill = _("生き返った。", " revived.");
868 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
879 /* Attempt to destroy the object */
882 /* Effect "observed" */
883 if (known && (o_ptr->marked & OM_FOUND))
886 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
889 /* Artifacts, and other objects, get to resist */
890 if (is_art || ignore)
892 /* Observe the resist */
893 if (known && (o_ptr->marked & OM_FOUND))
895 msg_format(_("%sは影響を受けない!",
896 (plural ? "The %s are unaffected!" : "The %s is unaffected!")), o_name);
903 /* Describe if needed */
904 if (known && (o_ptr->marked & OM_FOUND) && note_kill)
906 msg_format(_("%sは%s", "The %s%s"), o_name, note_kill);
909 k_idx = o_ptr->k_idx;
910 is_potion = object_is_potion(o_ptr);
911 delete_object_idx(this_o_idx);
913 /* Potions produce effects when 'shattered' */
916 (void)potion_smash_effect(who, y, x, k_idx);
924 /* Return "Anything seen?" */
930 * @brief 汎用的なビーム/ボルト/ボール系によるモンスターへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
931 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
932 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
933 * @param y 目標Y座標 / Target y location (or location to travel "towards")
934 * @param x 目標X座標 / Target x location (or location to travel "towards")
935 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
936 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
938 * @param see_s_msg TRUEならばメッセージを表示する
939 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
942 * This routine takes a "source monster" (by index) which is mostly used to
943 * determine if the player is causing the damage, and a "radius" (see below),
944 * which is used to decrease the power of explosions with distance, and a
945 * location, via integers which are modified by certain types of attacks
946 * (polymorph and teleport being the obvious ones), a default damage, which
947 * is modified as needed based on various properties, and finally a "damage
951 * Note that this routine can handle "no damage" attacks (like teleport) by
952 * taking a "zero" damage, and can even take "parameters" to attacks (like
953 * confuse) by accepting a "damage", using it to calculate the effect, and
954 * then setting the damage to zero. Note that the "damage" parameter is
955 * divided by the radius, so monsters not at the "epicenter" will not take
956 * as much damage (or whatever)...
959 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
960 * may result in a dereference of an invalid pointer.
963 * Various messages are produced, and damage is applied.
966 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
967 * actually be "made" of that substance, or "breathe" big balls of it.
968 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
970 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
971 * and hurts evil less. If can breath nether, then it resists it as well.
974 * Damage reductions use the following formulas:
975 * Note that "dam = dam * 6 / (randint1(6) + 6);"
976 * gives avg damage of .655, ranging from .858 to .500
977 * Note that "dam = dam * 5 / (randint1(6) + 6);"
978 * gives avg damage of .544, ranging from .714 to .417
979 * Note that "dam = dam * 4 / (randint1(6) + 6);"
980 * gives avg damage of .444, ranging from .556 to .333
981 * Note that "dam = dam * 3 / (randint1(6) + 6);"
982 * gives avg damage of .327, ranging from .427 to .250
983 * Note that "dam = dam * 2 / (randint1(6) + 6);"
984 * gives something simple.
987 * In this function, "result" messages are postponed until the end, where
988 * the "note" string is appended to the monster name, if not NULL. So,
989 * to make a spell have "no effect" just set "note" to NULL. You should
990 * also set "notice" to FALSE, or the player will learn what the spell does.
993 * We attempt to return "TRUE" if the player saw anything "useful" happen.
997 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)
1001 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
1003 monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
1004 monster_type *caster_ptr = (who > 0) ? ¤t_floor_ptr->m_list[who] : NULL;
1006 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1010 /* Is the monster "seen"? */
1011 bool seen = m_ptr->ml;
1012 bool seen_msg = is_seen(m_ptr);
1014 bool slept = (bool)MON_CSLEEP(m_ptr);
1016 /* Were the effects "obvious" (if seen)? */
1017 bool obvious = FALSE;
1019 /* Can the player know about this effect? */
1020 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1022 /* Were the effects "irrelevant"? */
1023 bool skipped = FALSE;
1025 /* Gets the monster angry at the source of the effect? */
1026 bool get_angry = FALSE;
1028 /* Polymorph setting (true or false) */
1029 bool do_poly = FALSE;
1031 /* Teleport setting (max distance) */
1034 /* Confusion setting (amount to confuse) */
1037 /* Stunning setting (amount to stun) */
1040 /* Sleep amount (amount to sleep) */
1043 /* Fear amount (amount to fear) */
1046 /* Time amount (amount to time) */
1049 bool heal_leper = FALSE;
1051 /* Hold the monster name */
1052 GAME_TEXT m_name[MAX_NLEN];
1055 PARAMETER_VALUE photo = 0;
1057 /* Assume no note */
1058 concptr note = NULL;
1060 /* Assume a default death */
1061 concptr note_dies = extract_note_dies(real_r_idx(m_ptr));
1063 DEPTH caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1066 if (!g_ptr->m_idx) return (FALSE);
1068 /* Never affect projector */
1069 if (who && (g_ptr->m_idx == who)) return (FALSE);
1070 if ((g_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1071 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1073 /* Don't affect already death monsters */
1074 /* Prevents problems with chain reactions of exploding monsters */
1075 if (m_ptr->hp < 0) return (FALSE);
1077 /* Reduce damage by distance */
1078 dam = (dam + r) / (r + 1);
1081 /* Get the monster name (BEFORE polymorphing) */
1082 monster_desc(m_name, m_ptr, 0);
1084 /* Get the monster possessive ("his"/"her"/"its") */
1085 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1087 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
1089 if (r_ptr->flagsr & RFR_RES_ALL &&
1090 typ != GF_OLD_CLONE && typ != GF_STAR_HEAL && typ != GF_OLD_HEAL
1091 && typ != GF_OLD_SPEED && typ != GF_CAPTURE && typ != GF_PHOTO)
1093 note = _("には完全な耐性がある!", " is immune.");
1095 if(is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1096 if(typ == GF_LITE_WEAK || typ == GF_KILL_WALL) skipped = TRUE;
1100 /* Analyze the damage type */
1103 /* Magic Missile -- pure damage */
1106 if (seen) obvious = TRUE;
1113 if (seen) obvious = TRUE;
1114 if (r_ptr->flagsr & RFR_IM_ACID)
1116 note = _("にはかなり耐性がある!", " resists a lot.");
1118 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1126 if (seen) obvious = TRUE;
1127 if (r_ptr->flagsr & RFR_IM_ELEC)
1129 note = _("にはかなり耐性がある!", " resists a lot.");
1131 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1139 if (seen) obvious = TRUE;
1140 if (r_ptr->flagsr & RFR_IM_FIRE)
1142 note = _("にはかなり耐性がある!", " resists a lot.");
1144 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1146 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1148 note = _("はひどい痛手をうけた。", " is hit hard.");
1150 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1158 if (seen) obvious = TRUE;
1159 if (r_ptr->flagsr & RFR_IM_COLD)
1161 note = _("にはかなり耐性がある!", " resists a lot.");
1163 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1165 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1167 note = _("はひどい痛手をうけた。", " is hit hard.");
1169 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1177 if (seen) obvious = TRUE;
1178 if (r_ptr->flagsr & RFR_IM_POIS)
1180 note = _("にはかなり耐性がある!", " resists a lot.");
1182 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1190 if (seen) obvious = TRUE;
1191 if (r_ptr->flagsr & RFR_IM_POIS)
1193 note = _("には耐性がある。", " resists.");
1194 dam *= 3; dam /= randint1(6) + 6;
1195 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1197 else if (one_in_(3)) do_poly = TRUE;
1201 /* Hellfire -- hurts Evil */
1204 if (seen) obvious = TRUE;
1205 if (r_ptr->flags3 & RF3_GOOD)
1207 note = _("はひどい痛手をうけた。", " is hit hard.");
1209 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1214 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1217 if (seen) obvious = TRUE;
1218 if (r_ptr->flags3 & RF3_EVIL)
1221 note = _("はひどい痛手をうけた。", " is hit hard.");
1222 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
1226 note = _("には耐性がある。", " resists.");
1227 dam *= 3; dam /= randint1(6) + 6;
1232 /* Arrow -- XXX no defense */
1235 if (seen) obvious = TRUE;
1239 /* Plasma -- XXX perhaps check ELEC or FIRE */
1242 if (seen) obvious = TRUE;
1243 if (r_ptr->flagsr & RFR_RES_PLAS)
1245 note = _("には耐性がある。", " resists.");
1246 dam *= 3; dam /= randint1(6) + 6;
1247 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
1252 /* Nether -- see above */
1255 if (seen) obvious = TRUE;
1256 if (r_ptr->flagsr & RFR_RES_NETH)
1258 if (r_ptr->flags3 & RF3_UNDEAD)
1260 note = _("には完全な耐性がある!", " is immune.");
1262 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
1266 note = _("には耐性がある。", " resists.");
1267 dam *= 3; dam /= randint1(6) + 6;
1269 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
1271 else if (r_ptr->flags3 & RF3_EVIL)
1273 note = _("はいくらか耐性を示した。", " resists somewhat.");
1275 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
1280 /* Water (acid) damage -- Water spirits/elementals are immune */
1283 if (seen) obvious = TRUE;
1284 if (r_ptr->flagsr & RFR_RES_WATE)
1286 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
1288 note = _("には完全な耐性がある!", " is immune.");
1293 note = _("には耐性がある。", " resists.");
1294 dam *= 3; dam /= randint1(6) + 6;
1296 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
1301 /* Chaos -- Chaos breathers resist */
1304 if (seen) obvious = TRUE;
1305 if (r_ptr->flagsr & RFR_RES_CHAO)
1307 note = _("には耐性がある。", " resists.");
1308 dam *= 3; dam /= randint1(6) + 6;
1309 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
1311 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
1313 note = _("はいくらか耐性を示した。", " resists somewhat.");
1314 dam *= 3; dam /= randint1(6) + 6;
1315 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
1320 do_conf = (5 + randint1(11) + r) / (r + 1);
1325 /* Shards -- Shard breathers resist */
1328 if (seen) obvious = TRUE;
1329 if (r_ptr->flagsr & RFR_RES_SHAR)
1331 note = _("には耐性がある。", " resists.");
1332 dam *= 3; dam /= randint1(6) + 6;
1333 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1338 /* Rocket: Shard resistance helps */
1341 if (seen) obvious = TRUE;
1342 if (r_ptr->flagsr & RFR_RES_SHAR)
1344 note = _("はいくらか耐性を示した。", " resists somewhat.");
1346 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1352 /* Sound -- Sound breathers resist */
1355 if (seen) obvious = TRUE;
1356 if (r_ptr->flagsr & RFR_RES_SOUN)
1358 note = _("には耐性がある。", " resists.");
1359 dam *= 2; dam /= randint1(6) + 6;
1360 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
1362 else do_stun = (10 + randint1(15) + r) / (r + 1);
1369 if (seen) obvious = TRUE;
1370 if (r_ptr->flags3 & RF3_NO_CONF)
1372 note = _("には耐性がある。", " resists.");
1373 dam *= 3; dam /= randint1(6) + 6;
1374 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1376 else do_conf = (10 + randint1(15) + r) / (r + 1);
1380 /* Disenchantment -- Breathers and Disenchanters resist */
1383 if (seen) obvious = TRUE;
1384 if (r_ptr->flagsr & RFR_RES_DISE)
1386 note = _("には耐性がある。", " resists.");
1387 dam *= 3; dam /= randint1(6) + 6;
1388 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
1393 /* Nexus -- Breathers and Existers resist */
1396 if (seen) obvious = TRUE;
1397 if (r_ptr->flagsr & RFR_RES_NEXU)
1399 note = _("には耐性がある。", " resists.");
1400 dam *= 3; dam /= randint1(6) + 6;
1401 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
1409 if (seen) obvious = TRUE;
1410 if (r_ptr->flagsr & RFR_RES_WALL)
1412 note = _("には耐性がある。", " resists.");
1413 dam *= 3; dam /= randint1(6) + 6;
1414 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
1416 else do_stun = (randint1(15) + r) / (r + 1);
1420 /* Inertia -- breathers resist */
1423 if (seen) obvious = TRUE;
1424 if (r_ptr->flagsr & RFR_RES_INER)
1426 note = _("には耐性がある。", " resists.");
1427 dam *= 3; dam /= randint1(6) + 6;
1428 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
1432 /* Powerful monsters can resist */
1433 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1434 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1438 /* Normal monsters slow down */
1441 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1443 note = _("の動きが遅くなった。", " starts moving slower.");
1450 /* Time -- breathers resist */
1453 if (seen) obvious = TRUE;
1454 if (r_ptr->flagsr & RFR_RES_TIME)
1456 note = _("には耐性がある。", " resists.");
1457 dam *= 3; dam /= randint1(6) + 6;
1458 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
1460 else do_time = (dam + 1) / 2;
1464 /* Gravity -- breathers resist */
1467 bool resist_tele = FALSE;
1469 if (seen) obvious = TRUE;
1470 if (r_ptr->flagsr & RFR_RES_TELE)
1472 if (r_ptr->flags1 & (RF1_UNIQUE))
1474 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1475 note = _("には効果がなかった。", " is unaffected!");
1478 else if (r_ptr->level > randint1(100))
1480 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1481 note = _("には耐性がある!", " resists!");
1486 if (!resist_tele) do_dist = 10;
1488 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1490 if (r_ptr->flagsr & RFR_RES_GRAV)
1492 note = _("には耐性がある!", " resists!");
1493 dam *= 3; dam /= randint1(6) + 6;
1495 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
1500 /* Powerful monsters can resist */
1501 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1502 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1506 /* Normal monsters slow down */
1509 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1511 note = _("の動きが遅くなった。", " starts moving slower.");
1516 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
1518 /* Attempt a saving throw */
1519 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1520 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1524 /* No obvious effect */
1525 note = _("には効果がなかった。", " is unaffected!");
1537 if (seen) obvious = TRUE;
1543 case GF_DISINTEGRATE:
1545 if (seen) obvious = TRUE;
1546 if (r_ptr->flags3 & RF3_HURT_ROCK)
1548 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
1549 note = _("の皮膚がただれた!", " loses some skin!");
1550 note_dies = _("は蒸発した!", " evaporates!");
1558 if (seen) obvious = TRUE;
1560 /* PSI only works if the monster can see you! -- RG */
1561 if (!(los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)))
1564 msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), m_name);
1568 if (r_ptr->flags2 & RF2_EMPTY_MIND)
1571 note = _("には完全な耐性がある!", " is immune.");
1572 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1575 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
1576 (r_ptr->flags3 & RF3_ANIMAL) ||
1577 (r_ptr->level > randint1(3 * dam)))
1579 note = _("には耐性がある!", " resists!");
1583 * Powerful demons & undead can current_world_ptr->game_turn a mindcrafter's
1584 * attacks back on them
1586 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1587 (r_ptr->level > p_ptr->lev / 2) &&
1591 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1592 (seen ? "%^s's corrupted mind backlashes your attack!" :
1593 "%^ss corrupted mind backlashes your attack!")), m_name);
1596 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
1598 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1602 /* Injure +/- confusion */
1603 monster_desc(killer, m_ptr, MD_WRONGDOER_NAME);
1604 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1605 if (one_in_(4) && !CHECK_MULTISHADOW())
1607 switch (randint1(4))
1610 set_confused(p_ptr->confused + 3 + randint1(dam));
1613 set_stun(p_ptr->stun + randint1(dam));
1617 if (r_ptr->flags3 & RF3_NO_FEAR)
1618 note = _("には効果がなかった。", " is unaffected.");
1620 set_afraid(p_ptr->afraid + 3 + randint1(dam));
1624 if (!p_ptr->free_act)
1625 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
1634 if ((dam > 0) && one_in_(4))
1636 switch (randint1(4))
1639 do_conf = 3 + randint1(dam);
1642 do_stun = 3 + randint1(dam);
1645 do_fear = 3 + randint1(dam);
1648 note = _("は眠り込んでしまった!", " falls asleep!");
1649 do_sleep = 3 + randint1(dam);
1654 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1660 if (seen) obvious = TRUE;
1661 if (r_ptr->flags2 & RF2_EMPTY_MIND)
1664 note = _("には完全な耐性がある!", " is immune.");
1666 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
1667 (r_ptr->flags3 & RF3_ANIMAL) ||
1668 (r_ptr->level > randint1(3 * dam)))
1670 note = _("には耐性がある!", " resists!");
1674 * Powerful demons & undead can current_world_ptr->game_turn a mindcrafter's
1675 * attacks back on them
1677 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1678 (r_ptr->level > p_ptr->lev / 2) &&
1682 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1683 (seen ? "%^s's corrupted mind backlashes your attack!" :
1684 "%^ss corrupted mind backlashes your attack!")), m_name);
1686 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
1688 msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
1692 /* Injure + mana drain */
1693 monster_desc(killer, m_ptr, MD_WRONGDOER_NAME);
1694 if (!CHECK_MULTISHADOW())
1696 msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
1697 p_ptr->csp -= damroll(5, dam) / 2;
1698 if (p_ptr->csp < 0) p_ptr->csp = 0;
1699 p_ptr->redraw |= PR_MANA;
1700 p_ptr->window |= (PW_SPELL);
1702 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1709 int b = damroll(5, dam) / 4;
1710 concptr str = (p_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
1711 concptr msg = _("あなたは%sの苦痛を%sに変換した!",
1712 (seen ? "You convert %s's pain into %s!" :
1713 "You convert %ss pain into %s!"));
1714 msg_format(msg, m_name, str);
1716 b = MIN(p_ptr->msp, p_ptr->csp + b);
1718 p_ptr->redraw |= PR_MANA;
1719 p_ptr->window |= (PW_SPELL);
1721 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1725 case GF_TELEKINESIS:
1727 if (seen) obvious = TRUE;
1730 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1735 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
1737 /* Attempt a saving throw */
1738 if ((r_ptr->flags1 & RF1_UNIQUE) ||
1739 (r_ptr->level > 5 + randint1(dam)))
1743 /* No obvious effect */
1749 /* Psycho-spear -- powerful magic missile */
1752 if (seen) obvious = TRUE;
1756 /* Meteor -- powerful magic missile */
1759 if (seen) obvious = TRUE;
1765 if (!is_hostile(m_ptr)) break;
1766 if (seen) obvious = TRUE;
1767 /* Attempt a saving throw */
1768 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
1769 (r_ptr->flags3 & RF3_NO_CONF) ||
1770 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1772 /* Memorize a flag */
1773 if (r_ptr->flags3 & RF3_NO_CONF)
1775 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1782 * Powerful demons & undead can current_world_ptr->game_turn a mindcrafter's
1783 * attacks back on them
1785 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1786 (r_ptr->level > p_ptr->lev / 2) &&
1790 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1791 (seen ? "%^s's corrupted mind backlashes your attack!" :
1792 "%^ss corrupted mind backlashes your attack!")), m_name);
1795 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
1797 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1801 /* Confuse, stun, terrify */
1802 switch (randint1(4))
1805 set_stun(p_ptr->stun + dam / 2);
1808 set_confused(p_ptr->confused + dam / 2);
1812 if (r_ptr->flags3 & RF3_NO_FEAR)
1813 note = _("には効果がなかった。", " is unaffected.");
1815 set_afraid(p_ptr->afraid + dam);
1822 /* No obvious effect */
1823 note = _("には効果がなかった。", " is unaffected.");
1829 if (!common_saving_throw_charm(p_ptr, dam, m_ptr))
1831 note = _("があなたに隷属した。", " is in your thrall!");
1836 switch (randint1(4))
1850 /* No "real" damage */
1855 /* Ice -- Cold + Cuts + Stun */
1858 if (seen) obvious = TRUE;
1859 do_stun = (randint1(15) + 1) / (r + 1);
1860 if (r_ptr->flagsr & RFR_IM_COLD)
1862 note = _("にはかなり耐性がある!", " resists a lot.");
1864 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1866 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1868 note = _("はひどい痛手をうけた。", " is hit hard.");
1870 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1877 case GF_HYPODYNAMIA:
1879 if (seen) obvious = TRUE;
1880 if (!monster_living(m_ptr->r_idx))
1882 if (is_original_ap_and_seen(m_ptr))
1884 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
1885 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
1886 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
1888 note = _("には効果がなかった。", " is unaffected.");
1892 else do_time = (dam+7)/8;
1900 if (seen) obvious = TRUE;
1901 if (!monster_living(m_ptr->r_idx))
1903 if (is_original_ap_and_seen(m_ptr))
1905 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
1906 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
1907 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
1909 note = _("には完全な耐性がある!", " is immune.");
1913 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
1914 (randint1(888) != 666)) ||
1915 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
1916 randint1(100) != 66))
1918 note = _("には耐性がある!", " resists!");
1926 /* Polymorph monster (Use "dam" as "power") */
1929 if (seen) obvious = TRUE;
1930 /* Attempt to polymorph (see below) */
1933 /* Powerful monsters can resist */
1934 if ((r_ptr->flags1 & RF1_UNIQUE) ||
1935 (r_ptr->flags1 & RF1_QUESTOR) ||
1936 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1938 note = _("には効果がなかった。", " is unaffected.");
1943 /* No "real" damage */
1950 /* Clone monsters (Ignore "dam") */
1953 if (seen) obvious = TRUE;
1955 if ((p_ptr->inside_arena) || is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
1957 note = _("には効果がなかった。", " is unaffected.");
1962 m_ptr->hp = m_ptr->maxhp;
1964 /* Attempt to clone. */
1965 if (multiply_monster(g_ptr->m_idx, TRUE, 0L))
1967 note = _("が分裂した!", " spawns!");
1971 /* No "real" damage */
1978 /* Heal Monster (use "dam" as amount of healing) */
1981 if (seen) obvious = TRUE;
1984 (void)set_monster_csleep(g_ptr->m_idx, 0);
1986 if (m_ptr->maxhp < m_ptr->max_maxhp)
1988 if (seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), m_name, m_poss);
1989 m_ptr->maxhp = m_ptr->max_maxhp;
1994 /* Redraw (later) if needed */
1995 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
1996 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2004 if (seen) obvious = TRUE;
2007 (void)set_monster_csleep(g_ptr->m_idx, 0);
2008 if (MON_STUNNED(m_ptr))
2010 if (seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), m_name);
2011 (void)set_monster_stunned(g_ptr->m_idx, 0);
2013 if (MON_CONFUSED(m_ptr))
2015 if (seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), m_name);
2016 (void)set_monster_confused(g_ptr->m_idx, 0);
2018 if (MON_MONFEAR(m_ptr))
2020 if (seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name);
2021 (void)set_monster_monfear(g_ptr->m_idx, 0);
2025 if (m_ptr->hp < 30000) m_ptr->hp += dam;
2028 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2032 chg_virtue(V_VITALITY, 1);
2034 if (r_ptr->flags1 & RF1_UNIQUE)
2035 chg_virtue(V_INDIVIDUALISM, 1);
2037 if (is_friendly(m_ptr))
2038 chg_virtue(V_HONOUR, 1);
2039 else if (!(r_ptr->flags3 & RF3_EVIL))
2041 if (r_ptr->flags3 & RF3_GOOD)
2042 chg_virtue(V_COMPASSION, 2);
2044 chg_virtue(V_COMPASSION, 1);
2047 if (r_ptr->flags3 & RF3_ANIMAL)
2048 chg_virtue(V_NATURE, 1);
2051 if (m_ptr->r_idx == MON_LEPER)
2054 if (!who) chg_virtue(V_COMPASSION, 5);
2057 /* Redraw (later) if needed */
2058 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2059 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2061 note = _("は体力を回復したようだ。", " looks healthier.");
2063 /* No "real" damage */
2069 /* Speed Monster (Ignore "dam") */
2072 if (seen) obvious = TRUE;
2075 if (set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100))
2077 note = _("の動きが速くなった。", " starts moving faster.");
2082 if (r_ptr->flags1 & RF1_UNIQUE)
2083 chg_virtue(V_INDIVIDUALISM, 1);
2084 if (is_friendly(m_ptr))
2085 chg_virtue(V_HONOUR, 1);
2088 /* No "real" damage */
2094 /* Slow Monster (Use "dam" as "power") */
2097 if (seen) obvious = TRUE;
2099 /* Powerful monsters can resist */
2100 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2101 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2103 note = _("には効果がなかった。", " is unaffected.");
2107 /* Normal monsters slow down */
2110 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2112 note = _("の動きが遅くなった。", " starts moving slower.");
2116 /* No "real" damage */
2122 /* Sleep (Use "dam" as "power") */
2125 if (seen) obvious = TRUE;
2127 /* Attempt a saving throw */
2128 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2129 (r_ptr->flags3 & RF3_NO_SLEEP) ||
2130 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2132 /* Memorize a flag */
2133 if (r_ptr->flags3 & RF3_NO_SLEEP)
2135 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
2137 /* No obvious effect */
2138 note = _("には効果がなかった。", " is unaffected.");
2143 /* Go to sleep (much) later */
2144 note = _("は眠り込んでしまった!", " falls asleep!");
2148 /* No "real" damage */
2154 /* Sleep (Use "dam" as "power") */
2155 case GF_STASIS_EVIL:
2157 if (seen) obvious = TRUE;
2159 /* Attempt a saving throw */
2160 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2161 !(r_ptr->flags3 & RF3_EVIL) ||
2162 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2164 note = _("には効果がなかった。", " is unaffected.");
2169 /* Go to sleep (much) later */
2170 note = _("は動けなくなった!", " is suspended!");
2174 /* No "real" damage */
2179 /* Sleep (Use "dam" as "power") */
2182 if (seen) obvious = TRUE;
2184 /* Attempt a saving throw */
2185 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2186 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2188 note = _("には効果がなかった。", " is unaffected.");
2193 /* Go to sleep (much) later */
2194 note = _("は動けなくなった!", " is suspended!");
2198 /* No "real" damage */
2207 vir = virtue_number(V_HARMONY);
2210 dam += p_ptr->virtues[vir-1]/10;
2213 vir = virtue_number(V_INDIVIDUALISM);
2216 dam -= p_ptr->virtues[vir-1]/20;
2219 if (seen) obvious = TRUE;
2221 /* Attempt a saving throw */
2222 if (common_saving_throw_charm(p_ptr, dam, m_ptr))
2226 /* No obvious effect */
2227 note = _("には効果がなかった。", " is unaffected.");
2230 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2232 else if (p_ptr->cursed & TRC_AGGRAVATE)
2234 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2235 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2239 note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
2242 chg_virtue(V_INDIVIDUALISM, -1);
2243 if (r_ptr->flags3 & RF3_ANIMAL)
2244 chg_virtue(V_NATURE, 1);
2247 /* No "real" damage */
2252 /* Control undead */
2253 case GF_CONTROL_UNDEAD:
2256 if (seen) obvious = TRUE;
2258 vir = virtue_number(V_UNLIFE);
2261 dam += p_ptr->virtues[vir-1]/10;
2264 vir = virtue_number(V_INDIVIDUALISM);
2267 dam -= p_ptr->virtues[vir-1]/20;
2270 /* Attempt a saving throw */
2271 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2272 !(r_ptr->flags3 & RF3_UNDEAD))
2274 /* No obvious effect */
2275 note = _("には効果がなかった。", " is unaffected.");
2277 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2279 else if (p_ptr->cursed & TRC_AGGRAVATE)
2281 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2282 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2286 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2290 /* No "real" damage */
2296 case GF_CONTROL_DEMON:
2299 if (seen) obvious = TRUE;
2301 vir = virtue_number(V_UNLIFE);
2304 dam += p_ptr->virtues[vir-1]/10;
2307 vir = virtue_number(V_INDIVIDUALISM);
2310 dam -= p_ptr->virtues[vir-1]/20;
2313 /* Attempt a saving throw */
2314 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2315 !(r_ptr->flags3 & RF3_DEMON))
2317 /* No obvious effect */
2318 note = _("には効果がなかった。", " is unaffected.");
2320 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2322 else if (p_ptr->cursed & TRC_AGGRAVATE)
2324 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2325 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2329 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2333 /* No "real" damage */
2339 case GF_CONTROL_ANIMAL:
2342 if (seen) obvious = TRUE;
2344 vir = virtue_number(V_NATURE);
2347 dam += p_ptr->virtues[vir-1]/10;
2350 vir = virtue_number(V_INDIVIDUALISM);
2353 dam -= p_ptr->virtues[vir-1]/20;
2356 /* Attempt a saving throw */
2357 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2358 !(r_ptr->flags3 & RF3_ANIMAL))
2361 /* No obvious effect */
2362 note = _("には効果がなかった。", " is unaffected.");
2364 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2366 else if (p_ptr->cursed & TRC_AGGRAVATE)
2368 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2369 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2373 note = _("はなついた。", " is tamed!");
2375 if (r_ptr->flags3 & RF3_ANIMAL)
2376 chg_virtue(V_NATURE, 1);
2379 /* No "real" damage */
2385 case GF_CHARM_LIVING:
2389 vir = virtue_number(V_UNLIFE);
2390 if (seen) obvious = TRUE;
2392 vir = virtue_number(V_UNLIFE);
2395 dam -= p_ptr->virtues[vir-1]/10;
2398 vir = virtue_number(V_INDIVIDUALISM);
2401 dam -= p_ptr->virtues[vir-1]/20;
2404 msg_format(_("%sを見つめた。", "You stare into %s."), m_name);
2406 /* Attempt a saving throw */
2407 if (common_saving_throw_charm(p_ptr, dam, m_ptr) ||
2408 !monster_living(m_ptr->r_idx))
2411 /* No obvious effect */
2412 note = _("には効果がなかった。", " is unaffected.");
2414 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2416 else if (p_ptr->cursed & TRC_AGGRAVATE)
2418 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2419 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2423 note = _("を支配した。", " is tamed!");
2425 if (r_ptr->flags3 & RF3_ANIMAL)
2426 chg_virtue(V_NATURE, 1);
2429 /* No "real" damage */
2434 /* Confusion (Use "dam" as "power") */
2437 if (seen) obvious = TRUE;
2439 /* Get confused later */
2440 do_conf = damroll(3, (dam / 2)) + 1;
2442 /* Attempt a saving throw */
2443 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2444 (r_ptr->flags3 & (RF3_NO_CONF)) ||
2445 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2447 /* Memorize a flag */
2448 if (r_ptr->flags3 & (RF3_NO_CONF))
2450 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2456 /* No obvious effect */
2457 note = _("には効果がなかった。", " is unaffected.");
2461 /* No "real" damage */
2468 if (seen) obvious = TRUE;
2470 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2472 /* Attempt a saving throw */
2473 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2474 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2479 /* No obvious effect */
2480 note = _("には効果がなかった。", " is unaffected.");
2484 /* No "real" damage */
2489 /* Lite, but only hurts susceptible creatures */
2498 if (r_ptr->flags3 & (RF3_HURT_LITE))
2500 /* Obvious effect */
2501 if (seen) obvious = TRUE;
2503 /* Memorize the effects */
2504 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
2506 /* Special effect */
2507 note = _("は光に身をすくめた!", " cringes from the light!");
2508 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
2511 /* Normally no damage */
2523 /* Lite -- opposite of Dark */
2526 if (seen) obvious = TRUE;
2528 if (r_ptr->flagsr & RFR_RES_LITE)
2530 note = _("には耐性がある!", " resists!");
2531 dam *= 2; dam /= (randint1(6)+6);
2532 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
2534 else if (r_ptr->flags3 & (RF3_HURT_LITE))
2536 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
2537 note = _("は光に身をすくめた!", " cringes from the light!");
2538 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
2545 /* Dark -- opposite of Lite */
2548 if (seen) obvious = TRUE;
2550 if (r_ptr->flagsr & RFR_RES_DARK)
2552 note = _("には耐性がある!", " resists!");
2553 dam *= 2; dam /= (randint1(6)+6);
2554 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
2563 /* Hurt by rock remover */
2564 if (r_ptr->flags3 & (RF3_HURT_ROCK))
2567 if (seen) obvious = TRUE;
2569 /* Memorize the effects */
2570 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2572 /* Cute little message */
2573 note = _("の皮膚がただれた!", " loses some skin!");
2574 note_dies = _("はドロドロに溶けた!", " dissolves!");
2577 /* Usually, ignore the effects */
2588 /* Teleport undead (Use "dam" as "power") */
2589 case GF_AWAY_UNDEAD:
2591 /* Only affect undead */
2592 if (r_ptr->flags3 & (RF3_UNDEAD))
2594 bool resists_tele = FALSE;
2596 if (r_ptr->flagsr & RFR_RES_TELE)
2598 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2600 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2601 note = _("には効果がなかった。", " is unaffected.");
2602 resists_tele = TRUE;
2604 else if (r_ptr->level > randint1(100))
2606 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2607 note = _("には耐性がある!", " resists!");
2608 resists_tele = TRUE;
2614 if (seen) obvious = TRUE;
2615 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2627 /* No "real" damage */
2633 /* Teleport evil (Use "dam" as "power") */
2636 /* Only affect evil */
2637 if (r_ptr->flags3 & (RF3_EVIL))
2639 bool resists_tele = FALSE;
2641 if (r_ptr->flagsr & RFR_RES_TELE)
2643 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2645 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2646 note = _("には効果がなかった。", " is unaffected.");
2647 resists_tele = TRUE;
2649 else if (r_ptr->level > randint1(100))
2651 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2652 note = _("には耐性がある!", " resists!");
2653 resists_tele = TRUE;
2659 if (seen) obvious = TRUE;
2660 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2672 /* No "real" damage */
2678 /* Teleport monster (Use "dam" as "power") */
2681 bool resists_tele = FALSE;
2682 if (r_ptr->flagsr & RFR_RES_TELE)
2684 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2686 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2687 note = _("には効果がなかった。", " is unaffected.");
2688 resists_tele = TRUE;
2690 else if (r_ptr->level > randint1(100))
2692 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2693 note = _("には耐性がある!", " resists!");
2694 resists_tele = TRUE;
2700 if (seen) obvious = TRUE;
2702 /* Prepare to teleport */
2706 /* No "real" damage */
2712 /* Turn undead (Use "dam" as "power") */
2713 case GF_TURN_UNDEAD:
2715 /* Only affect undead */
2716 if (r_ptr->flags3 & (RF3_UNDEAD))
2718 if (seen) obvious = TRUE;
2720 /* Learn about type */
2721 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2723 /* Apply some fear */
2724 do_fear = damroll(3, (dam / 2)) + 1;
2726 /* Attempt a saving throw */
2727 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
2729 /* No obvious effect */
2730 note = _("には効果がなかった。", " is unaffected.");
2743 /* No "real" damage */
2749 /* Turn evil (Use "dam" as "power") */
2752 /* Only affect evil */
2753 if (r_ptr->flags3 & (RF3_EVIL))
2755 if (seen) obvious = TRUE;
2757 /* Learn about type */
2758 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2760 /* Apply some fear */
2761 do_fear = damroll(3, (dam / 2)) + 1;
2763 /* Attempt a saving throw */
2764 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
2766 /* No obvious effect */
2767 note = _("には効果がなかった。", " is unaffected.");
2780 /* No "real" damage */
2786 /* Turn monster (Use "dam" as "power") */
2789 if (seen) obvious = TRUE;
2791 /* Apply some fear */
2792 do_fear = damroll(3, (dam / 2)) + 1;
2794 /* Attempt a saving throw */
2795 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2796 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
2797 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2799 /* No obvious effect */
2800 note = _("には効果がなかった。", " is unaffected.");
2805 /* No "real" damage */
2812 case GF_DISP_UNDEAD:
2814 /* Only affect undead */
2815 if (r_ptr->flags3 & (RF3_UNDEAD))
2817 if (seen) obvious = TRUE;
2819 /* Learn about type */
2820 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2822 note = _("は身震いした。", " shudders.");
2823 note_dies = _("はドロドロに溶けた!", " dissolves!");
2843 /* Only affect evil */
2844 if (r_ptr->flags3 & (RF3_EVIL))
2846 if (seen) obvious = TRUE;
2848 /* Learn about type */
2849 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2851 note = _("は身震いした。", " shudders.");
2852 note_dies = _("はドロドロに溶けた!", " dissolves!");
2871 /* Only affect good */
2872 if (r_ptr->flags3 & (RF3_GOOD))
2874 if (seen) obvious = TRUE;
2876 /* Learn about type */
2877 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
2879 note = _("は身震いした。", " shudders.");
2880 note_dies = _("はドロドロに溶けた!", " dissolves!");
2897 case GF_DISP_LIVING:
2899 /* Only affect non-undead */
2900 if (monster_living(m_ptr->r_idx))
2902 if (seen) obvious = TRUE;
2904 note = _("は身震いした。", " shudders.");
2905 note_dies = _("はドロドロに溶けた!", " dissolves!");
2924 /* Only affect demons */
2925 if (r_ptr->flags3 & (RF3_DEMON))
2927 if (seen) obvious = TRUE;
2929 /* Learn about type */
2930 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2932 note = _("は身震いした。", " shudders.");
2933 note_dies = _("はドロドロに溶けた!", " dissolves!");
2949 /* Dispel monster */
2952 if (seen) obvious = TRUE;
2953 note = _("は身震いした。", " shudders.");
2954 note_dies = _("はドロドロに溶けた!", " dissolves!");
2961 if (seen) obvious = TRUE;
2962 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->a_ability_flags1 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->a_ability_flags2 & ~(RF6_NOMAGIC_MASK)))
2966 /* Heal the monster */
2967 if (caster_ptr->hp < caster_ptr->maxhp)
2970 caster_ptr->hp += dam;
2971 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
2973 /* Redraw (later) if needed */
2974 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
2975 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
2977 /* Special message */
2980 monster_desc(killer, caster_ptr, 0);
2981 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), killer);
2987 msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), m_name);
2988 (void)hp_player(dam);
2993 if (see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3002 if (seen) obvious = TRUE;
3003 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3004 /* Attempt a saving throw */
3005 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3006 (r_ptr->flags3 & RF3_NO_CONF) ||
3007 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3009 /* Memorize a flag */
3010 if (r_ptr->flags3 & (RF3_NO_CONF))
3012 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3014 note = _("には効果がなかった。", " is unaffected.");
3017 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3019 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3020 note = _("には完全な耐性がある!", " is immune.");
3023 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3025 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3026 note = _("には耐性がある。", " resists.");
3031 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3032 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3034 if (who > 0) do_conf = randint0(4) + 4;
3035 else do_conf = randint0(8) + 8;
3041 case GF_BRAIN_SMASH:
3043 if (seen) obvious = TRUE;
3044 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3046 /* Attempt a saving throw */
3047 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3048 (r_ptr->flags3 & RF3_NO_CONF) ||
3049 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3051 /* Memorize a flag */
3052 if (r_ptr->flags3 & (RF3_NO_CONF))
3054 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3056 note = _("には効果がなかった。", " is unaffected.");
3059 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3061 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3062 note = _("には完全な耐性がある!", " is immune.");
3065 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3067 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3068 note = _("には耐性がある!", " resists!");
3073 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3074 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3078 do_conf = randint0(4) + 4;
3079 do_stun = randint0(4) + 4;
3083 do_conf = randint0(8) + 8;
3084 do_stun = randint0(8) + 8;
3086 (void)set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 10);
3094 if (seen) obvious = TRUE;
3095 if (!who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), m_name);
3096 /* Attempt a saving throw */
3097 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3099 note = _("には効果がなかった。", " is unaffected.");
3108 if (seen) obvious = TRUE;
3109 if (!who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), m_name);
3110 /* Attempt a saving throw */
3111 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3113 note = _("には効果がなかった。", " is unaffected.");
3122 if (seen) obvious = TRUE;
3123 if (!who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), m_name);
3124 /* Attempt a saving throw */
3125 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3127 note = _("には効果がなかった。", " is unaffected.");
3136 if (seen) obvious = TRUE;
3138 msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
3139 "You point at %s, screaming the word, 'DIE!'."), m_name);
3140 /* Attempt a saving throw */
3141 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
3143 note = _("には効果がなかった。", " is unaffected.");
3152 if (seen) obvious = TRUE;
3153 if (r_ptr->flags1 & RF1_UNIQUE)
3155 note = _("には効果がなかった。", " is unaffected.");
3160 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
3161 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
3163 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
3165 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
3169 note = _("は耐性を持っている!", "resists!");
3176 /* Capture monster */
3180 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
3181 (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)
3183 msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3188 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
3189 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(m_ptr->r_idx))
3190 nokori_hp = m_ptr->maxhp * 3 / 10;
3192 nokori_hp = m_ptr->maxhp * 3 / 20;
3194 if (m_ptr->hp >= nokori_hp)
3196 msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), m_name);
3199 else if (m_ptr->hp < randint0(nokori_hp))
3201 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(g_ptr->m_idx, FALSE, MON_CHAMELEON);
3202 msg_format(_("%sを捕えた!", "You capture %^s!"), m_name);
3203 cap_mon = m_ptr->r_idx;
3204 cap_mspeed = m_ptr->mspeed;
3206 cap_maxhp = m_ptr->max_maxhp;
3207 cap_nickname = m_ptr->nickname; /* Quark transfer */
3208 if (g_ptr->m_idx == p_ptr->riding)
3210 if (rakuba(-1, FALSE))
3212 msg_format(_("地面に落とされた。", "You have fallen from %s."), m_name);
3216 delete_monster_idx(g_ptr->m_idx);
3222 msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), m_name);
3228 /* Attack (Use "dam" as attack type) */
3231 /* Return this monster's death */
3232 return py_attack(y, x, dam);
3235 /* Sleep (Use "dam" as "power") */
3241 if (seen) obvious = TRUE;
3242 if (r_ptr->flags2 & RF2_EMPTY_MIND)
3244 note = _("には効果がなかった。", " is unaffected.");
3247 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3250 if (MON_CSLEEP(m_ptr))
3252 note = _("には効果がなかった。", " is unaffected.");
3258 if (one_in_(5)) effect = 1;
3259 else if (one_in_(4)) effect = 2;
3260 else if (one_in_(3)) effect = 3;
3265 /* Powerful monsters can resist */
3266 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3267 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3269 note = _("には効果がなかった。", " is unaffected.");
3273 /* Normal monsters slow down */
3276 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
3278 note = _("の動きが遅くなった。", " starts moving slower.");
3283 else if (effect == 2)
3285 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
3287 /* Attempt a saving throw */
3288 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3289 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3294 /* No obvious effect */
3295 note = _("には効果がなかった。", " is unaffected.");
3300 else if (effect == 3)
3302 /* Attempt a saving throw */
3303 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3304 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3305 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3307 /* Memorize a flag */
3308 if (r_ptr->flags3 & RF3_NO_SLEEP)
3310 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3313 /* No obvious effect */
3314 note = _("には効果がなかった。", " is unaffected.");
3319 /* Go to sleep (much) later */
3320 note = _("は眠り込んでしまった!", " falls asleep!");
3327 note = _("には効果がなかった。", " is unaffected.");
3330 /* No "real" damage */
3338 if (seen) obvious = TRUE;
3339 if (genocide_aux(g_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
3341 if (seen_msg) msg_format(_("%sは消滅した!", "%^s disappered!"), m_name);
3342 chg_virtue(V_VITALITY, -1);
3352 if (!who) msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), m_name);
3354 if (r_ptr->flags3 & (RF3_HURT_LITE))
3356 /* Obvious effect */
3357 if (seen) obvious = TRUE;
3359 /* Memorize the effects */
3360 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3362 /* Special effect */
3363 note = _("は光に身をすくめた!", " cringes from the light!");
3364 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3367 /* Normally no damage */
3374 photo = m_ptr->r_idx;
3381 case GF_BLOOD_CURSE:
3383 if (seen) obvious = TRUE;
3389 bool success = FALSE;
3390 if (seen) obvious = TRUE;
3392 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
3394 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
3395 if (dam < 1) dam = 1;
3397 /* No need to tame your pet */
3400 note = _("の動きが速くなった。", " starts moving faster.");
3401 (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100);
3405 /* Attempt a saving throw */
3406 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3407 (r_ptr->flags1 & (RF1_UNIQUE)) ||
3408 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3409 (p_ptr->cursed & TRC_AGGRAVATE) ||
3410 ((r_ptr->level+10) > randint1(dam)))
3413 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3417 note = _("を支配した。", " is tamed!");
3419 (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100);
3421 /* Learn about type */
3422 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
3429 if (!(r_ptr->flags3 & RF3_NO_FEAR))
3431 do_fear = randint1(90)+10;
3433 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
3436 /* No "real" damage */
3443 if (seen) obvious = TRUE;
3444 /* Attempt a saving throw */
3445 if (randint0(100 + dam) < (r_ptr->level + 50))
3447 note = _("には効果がなかった。", " is unaffected.");
3467 /* Absolutely no effect */
3468 if (skipped) return (FALSE);
3470 /* "Unique" monsters cannot be polymorphed */
3471 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
3473 /* Quest monsters cannot be polymorphed */
3474 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
3476 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
3478 /* "Unique" and "quest" monsters can only be "killed" by the player. */
3479 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
3481 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
3486 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
3487 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
3490 /* Modify the damage */
3492 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
3493 if ((tmp > 0) && (dam == 0)) note = _("はダメージを受けていない。", " is unharmed.");
3495 /* Check for death */
3496 if (dam > m_ptr->hp)
3498 /* Extract method of death */
3503 /* Sound and Impact resisters never stun */
3505 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
3506 !(r_ptr->flags3 & RF3_NO_STUN))
3508 if (seen) obvious = TRUE;
3511 if (MON_STUNNED(m_ptr))
3513 note = _("はひどくもうろうとした。", " is more dazed.");
3514 tmp = MON_STUNNED(m_ptr) + (do_stun / 2);
3518 note = _("はもうろうとした。", " is dazed.");
3523 (void)set_monster_stunned(g_ptr->m_idx, tmp);
3529 /* Confusion and Chaos resisters (and sleepers) never confuse */
3531 !(r_ptr->flags3 & RF3_NO_CONF) &&
3532 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
3534 if (seen) obvious = TRUE;
3536 /* Already partially confused */
3537 if (MON_CONFUSED(m_ptr))
3539 note = _("はさらに混乱したようだ。", " looks more confused.");
3540 tmp = MON_CONFUSED(m_ptr) + (do_conf / 2);
3543 /* Was not confused */
3546 note = _("は混乱したようだ。", " looks confused.");
3550 /* Apply confusion */
3551 (void)set_monster_confused(g_ptr->m_idx, tmp);
3559 if (seen) obvious = TRUE;
3561 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
3565 note = _("は弱くなったようだ。", " seems weakened.");
3566 m_ptr->maxhp -= do_time;
3567 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
3572 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
3573 if (do_poly && (randint1(90) > r_ptr->level))
3575 if (polymorph_monster(y, x))
3577 if (seen) obvious = TRUE;
3579 /* Monster polymorphs */
3580 note = _("が変身した!", " changes!");
3582 /* Turn off the damage */
3588 note = _("には効果がなかった。", " is unaffected.");
3591 /* Hack -- Get new monster */
3592 m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
3594 /* Hack -- Get new race */
3595 r_ptr = &r_info[m_ptr->r_idx];
3598 /* Handle "teleport" */
3601 if (seen) obvious = TRUE;
3603 note = _("が消え去った!", " disappears!");
3605 if (!who) chg_virtue(V_VALOUR, -1);
3608 teleport_away(g_ptr->m_idx, do_dist,
3609 (!who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
3611 /* Hack -- get new location */
3615 /* Hack -- get new grid */
3616 g_ptr = ¤t_floor_ptr->grid_array[y][x];
3623 (void)set_monster_monfear(g_ptr->m_idx, MON_MONFEAR(m_ptr) + do_fear);
3630 if (typ == GF_DRAIN_MANA)
3632 /* Drain mana does nothing */
3635 /* If another monster did the damage, hurt the monster by hand */
3638 /* Redraw (later) if needed */
3639 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3640 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3642 /* Wake the monster up */
3643 (void)set_monster_csleep(g_ptr->m_idx, 0);
3645 /* Hurt the monster */
3653 if (is_pet(m_ptr) && !(m_ptr->ml))
3656 /* Give detailed messages if destroyed */
3659 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
3662 msg_format("%^s%s", m_name, note);
3670 if (who > 0) monster_gain_exp(who, m_ptr->r_idx);
3672 /* Generate treasure, etc */
3673 monster_death(g_ptr->m_idx, FALSE);
3676 delete_monster_idx(g_ptr->m_idx);
3680 msg_print(_("少し悲しい気分がした。", "You feel sad for a moment."));
3684 /* Damaged monster */
3687 /* Give detailed messages if visible or destroyed */
3688 if (note && seen_msg) msg_format("%^s%s", m_name, note);
3690 /* Hack -- Pain message */
3693 message_pain(g_ptr->m_idx, dam);
3700 /* Hack -- handle sleep */
3701 if (do_sleep) (void)set_monster_csleep(g_ptr->m_idx, do_sleep);
3705 else if (heal_leper)
3707 if (seen_msg) msg_print(_("不潔な病人は病気が治った!", "The Mangy looking leper is healed!"));
3709 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
3711 char m2_name[MAX_NLEN];
3713 monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
3714 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_HEAL_LEPER, m2_name);
3717 delete_monster_idx(g_ptr->m_idx);
3720 /* If the player did it, give him experience, check fear */
3725 /* Hurt the monster, check for fear and death */
3726 if (mon_take_hit(g_ptr->m_idx, dam, &fear, note_dies))
3731 /* Damaged monster */
3734 /* HACK - anger the monster before showing the sleep message */
3735 if (do_sleep) anger_monster(m_ptr);
3737 /* Give detailed messages if visible or destroyed */
3738 if (note && seen_msg)
3739 msg_format(_("%s%s", "%^s%s"), m_name, note);
3741 /* Hack -- Pain message */
3742 else if (known && (dam || !do_fear))
3744 message_pain(g_ptr->m_idx, dam);
3747 /* Anger monsters */
3748 if (((dam > 0) || get_angry) && !do_sleep)
3749 anger_monster(m_ptr);
3751 if ((fear || do_fear) && seen)
3754 msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
3757 /* Hack -- handle sleep */
3758 if (do_sleep) (void)set_monster_csleep(g_ptr->m_idx, do_sleep);
3762 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
3764 blood_curse_to_enemy(who);
3767 if (p_ptr->inside_battle)
3769 p_ptr->health_who = g_ptr->m_idx;
3770 p_ptr->redraw |= (PR_HEALTH);
3774 /* Verify this code */
3775 if (m_ptr->r_idx) update_monster(g_ptr->m_idx, FALSE);
3777 /* Redraw the monster grid */
3780 /* Update monster recall window */
3781 if ((p_ptr->monster_race_idx == m_ptr->r_idx) && (seen || !m_ptr->r_idx))
3783 p_ptr->window |= (PW_MONSTER);
3786 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
3790 if (!(flg & PROJECT_NO_HANGEKI))
3792 set_target(m_ptr, monster_target_y, monster_target_x);
3795 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
3797 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
3801 if (p_ptr->riding && (p_ptr->riding == g_ptr->m_idx) && (dam > 0))
3803 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
3804 rakubadam_m = (dam > 200) ? 200 : dam;
3814 /* Prepare to make a Blade of Chaos */
3815 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
3817 q_ptr->pval = photo;
3819 /* Mark the item as fully known */
3820 q_ptr->ident |= (IDENT_MENTAL);
3821 (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
3829 /* Return "Anything seen?" */
3834 * @brief 汎用的なビーム/ボルト/ボール系によるプレイヤーへの効果処理 / Helper function for "project()" below.
3835 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
3836 * @param who_name 効果を起こしたモンスターの名前
3837 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
3838 * @param y 目標Y座標 / Target y location (or location to travel "towards")
3839 * @param x 目標X座標 / Target x location (or location to travel "towards")
3840 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
3841 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
3843 * @param monspell 効果元のモンスター魔法ID
3844 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
3846 * Handle a beam/bolt/ball causing damage to the player.
3847 * This routine takes a "source monster" (by index), a "distance", a default
3848 * "damage", and a "damage type". See "project_m()" above.
3849 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
3850 * is reduced (see "project_m()" above). This can happen if a monster breathes
3851 * at the player and hits a wall instead.
3852 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
3853 * to know if this is actually a ball or a bolt spell
3854 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
3855 * we just assume that the effects were obvious, for historical reasons.
3857 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)
3862 /* Hack -- assume obvious */
3863 bool obvious = TRUE;
3865 /* Player blind-ness */
3866 bool blind = (p_ptr->blind ? TRUE : FALSE);
3868 /* Player needs a "description" (he is blind) */
3871 /* Source monster */
3872 monster_type *m_ptr = NULL;
3874 /* Monster name (for attacks) */
3875 GAME_TEXT m_name[MAX_NLEN];
3877 /* Monster name (for damage) */
3880 /* Hack -- messages */
3886 /* Player is not here */
3887 if (!player_bold(y, x)) return (FALSE);
3889 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
3891 if (kawarimi(TRUE)) return FALSE;
3894 /* Player cannot hurt himself */
3895 if (!who) return (FALSE);
3896 if (who == p_ptr->riding) return (FALSE);
3898 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
3901 int max_attempts = 10;
3902 sound(SOUND_REFLECT);
3905 msg_print(_("何かが跳ね返った!", "Something bounces!"));
3906 else if (p_ptr->special_defense & KATA_FUUJIN)
3907 msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
3909 msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
3912 /* Choose 'new' target */
3917 t_y = current_floor_ptr->m_list[who].fy - 1 + randint1(3);
3918 t_x = current_floor_ptr->m_list[who].fx - 1 + randint1(3);
3921 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(p_ptr->y, p_ptr->x, t_y, t_x));
3923 if (max_attempts < 1)
3925 t_y = current_floor_ptr->m_list[who].fy;
3926 t_x = current_floor_ptr->m_list[who].fx;
3931 t_y = p_ptr->y - 1 + randint1(3);
3932 t_x = p_ptr->x - 1 + randint1(3);
3935 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
3937 disturb(TRUE, TRUE);
3941 /* Limit maximum damage */
3942 if (dam > 1600) dam = 1600;
3944 /* Reduce damage by distance */
3945 dam = (dam + r) / (r + 1);
3948 /* If the player is blind, be more descriptive */
3949 if (blind) fuzzy = TRUE;
3954 m_ptr = ¤t_floor_ptr->m_list[who];
3955 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
3956 monster_desc(m_name, m_ptr, 0);
3958 /* Get the monster's real name (gotten before polymorph!) */
3959 strcpy(killer, who_name);
3965 case PROJECT_WHO_UNCTRL_POWER:
3966 strcpy(killer, _("制御できない力の氾流", "uncontrollable power storm"));
3969 case PROJECT_WHO_GLASS_SHARDS:
3970 strcpy(killer, _("ガラスの破片", "shards of glass"));
3974 strcpy(killer, _("罠", "a trap"));
3977 strcpy(m_name, killer);
3980 /* Analyze the damage */
3983 /* Standard damage -- hurts inventory too */
3986 if (fuzzy) msg_print(_("酸で攻撃された!", "You are hit by acid!"));
3987 get_damage = acid_dam(dam, killer, monspell, FALSE);
3991 /* Standard damage -- hurts inventory too */
3994 if (fuzzy) msg_print(_("火炎で攻撃された!", "You are hit by fire!"));
3995 get_damage = fire_dam(dam, killer, monspell, FALSE);
3999 /* Standard damage -- hurts inventory too */
4002 if (fuzzy) msg_print(_("冷気で攻撃された!", "You are hit by cold!"));
4003 get_damage = cold_dam(dam, killer, monspell, FALSE);
4007 /* Standard damage -- hurts inventory too */
4010 if (fuzzy) msg_print(_("電撃で攻撃された!", "You are hit by lightning!"));
4011 get_damage = elec_dam(dam, killer, monspell, FALSE);
4015 /* Standard damage -- also poisons player */
4018 bool double_resist = IS_OPPOSE_POIS();
4019 if (fuzzy) msg_print(_("毒で攻撃された!", "You are hit by poison!"));
4021 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
4022 if (double_resist) dam = (dam + 2) / 3;
4024 if ((!(double_resist || p_ptr->resist_pois)) && one_in_(HURT_CHANCE) && !CHECK_MULTISHADOW())
4029 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4031 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4033 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4038 /* Standard damage -- also poisons / mutates player */
4041 bool double_resist = IS_OPPOSE_POIS();
4042 if (fuzzy) msg_print(_("放射能で攻撃された!", "You are hit by radiation!"));
4044 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
4045 if (double_resist) dam = (2 * dam + 2) / 5;
4046 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4047 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4049 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4051 if (one_in_(5)) /* 6 */
4053 msg_print(_("奇形的な変身を遂げた!", "You undergo a freakish metamorphosis!"));
4054 if (one_in_(4)) /* 4 */
4062 inven_damage(set_acid_destroy, 2);
4068 /* Standard damage */
4071 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4072 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4076 /* Holy Orb -- Player only takes partial damage */
4079 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4080 if (p_ptr->align > 10)
4082 else if (p_ptr->align < -10)
4084 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4090 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4091 if (p_ptr->align > 10)
4093 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4097 /* Arrow -- XXX no dodging */
4102 msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
4104 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
4106 msg_print(_("矢を斬り捨てた!", "You cut down the arrow!"));
4109 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4113 /* Plasma -- XXX No resist */
4116 if (fuzzy) msg_print(_("何かとても熱いもので攻撃された!", "You are hit by something *HOT*!"));
4117 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4119 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4121 int plus_stun = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
4122 (void)set_stun(p_ptr->stun + plus_stun);
4125 if (!(p_ptr->resist_fire || IS_OPPOSE_FIRE() || p_ptr->immune_fire))
4127 inven_damage(set_acid_destroy, 3);
4133 /* Nether -- drain experience */
4136 if (fuzzy) msg_print(_("地獄の力で攻撃された!", "You are hit by nether forces!"));
4137 if (p_ptr->resist_neth)
4139 if (!prace_is_(RACE_SPECTRE))
4141 dam *= 6; dam /= (randint1(4) + 7);
4144 else if (!CHECK_MULTISHADOW()) drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
4146 if (prace_is_(RACE_SPECTRE) && !CHECK_MULTISHADOW())
4148 msg_print(_("気分がよくなった。", "You feel invigorated!"));
4150 learn_spell(monspell);
4154 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4160 /* Water -- stun/confuse */
4163 if (fuzzy) msg_print(_("何か湿ったもので攻撃された!", "You are hit by something wet!"));
4164 if (!CHECK_MULTISHADOW())
4166 if (!p_ptr->resist_sound && !p_ptr->resist_water)
4168 set_stun(p_ptr->stun + randint1(40));
4170 if (!p_ptr->resist_conf && !p_ptr->resist_water)
4172 set_confused(p_ptr->confused + randint1(5) + 5);
4175 if (one_in_(5) && !p_ptr->resist_water)
4177 inven_damage(set_cold_destroy, 3);
4180 if (p_ptr->resist_water) get_damage /= 4;
4183 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4187 /* Chaos -- many effects */
4190 if (fuzzy) msg_print(_("無秩序の波動で攻撃された!", "You are hit by a wave of anarchy!"));
4191 if (p_ptr->resist_chaos)
4193 dam *= 6; dam /= (randint1(4) + 7);
4196 if (!CHECK_MULTISHADOW())
4198 if (!p_ptr->resist_conf)
4200 (void)set_confused(p_ptr->confused + randint0(20) + 10);
4202 if (!p_ptr->resist_chaos)
4204 (void)set_image(p_ptr->image + randint1(10));
4207 msg_print(_("あなたの身体はカオスの力で捻じ曲げられた!", "Your body is twisted by chaos!"));
4208 (void)gain_mutation(p_ptr, 0);
4211 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
4213 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
4216 if (!p_ptr->resist_chaos || one_in_(9))
4218 inven_damage(set_elec_destroy, 2);
4219 inven_damage(set_fire_destroy, 2);
4223 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4227 /* Shards -- mostly cutting */
4230 if (fuzzy) msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
4231 if (p_ptr->resist_shard)
4233 dam *= 6; dam /= (randint1(4) + 7);
4235 else if (!CHECK_MULTISHADOW())
4237 (void)set_cut(p_ptr->cut + dam);
4240 if (!p_ptr->resist_shard || one_in_(13))
4242 inven_damage(set_cold_destroy, 2);
4245 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4249 /* Sound -- mostly stunning */
4252 if (fuzzy) msg_print(_("轟音で攻撃された!", "You are hit by a loud noise!"));
4253 if (p_ptr->resist_sound)
4255 dam *= 5; dam /= (randint1(4) + 7);
4257 else if (!CHECK_MULTISHADOW())
4259 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
4260 (void)set_stun(p_ptr->stun + plus_stun);
4263 if (!p_ptr->resist_sound || one_in_(13))
4265 inven_damage(set_cold_destroy, 2);
4268 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4272 /* Pure confusion */
4275 if (fuzzy) msg_print(_("何か混乱するもので攻撃された!", "You are hit by something puzzling!"));
4276 if (p_ptr->resist_conf)
4278 dam *= 5; dam /= (randint1(4) + 7);
4280 else if (!CHECK_MULTISHADOW())
4282 (void)set_confused(p_ptr->confused + randint1(20) + 10);
4284 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4288 /* Disenchantment -- see above */
4291 if (fuzzy) msg_print(_("何かさえないもので攻撃された!", "You are hit by something static!"));
4292 if (p_ptr->resist_disen)
4294 dam *= 6; dam /= (randint1(4) + 7);
4296 else if (!CHECK_MULTISHADOW())
4298 (void)apply_disenchant(0);
4300 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4304 /* Nexus -- see above */
4307 if (fuzzy) msg_print(_("何か奇妙なもので攻撃された!", "You are hit by something strange!"));
4308 if (p_ptr->resist_nexus)
4310 dam *= 6; dam /= (randint1(4) + 7);
4312 else if (!CHECK_MULTISHADOW())
4316 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4320 /* Force -- mostly stun */
4323 if (fuzzy) msg_print(_("運動エネルギーで攻撃された!", "You are hit by kinetic force!"));
4324 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4326 (void)set_stun(p_ptr->stun + randint1(20));
4328 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4333 /* Rocket -- stun, cut */
4336 if (fuzzy) msg_print(_("爆発があった!", "There is an explosion!"));
4337 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4339 (void)set_stun(p_ptr->stun + randint1(20));
4342 if (p_ptr->resist_shard)
4346 else if (!CHECK_MULTISHADOW())
4348 (void)set_cut(p_ptr->cut + (dam / 2));
4351 if (!p_ptr->resist_shard || one_in_(12))
4353 inven_damage(set_cold_destroy, 3);
4356 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4360 /* Inertia -- slowness */
4363 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
4364 if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4365 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4369 /* Lite -- blinding */
4372 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4373 if (p_ptr->resist_lite)
4375 dam *= 4; dam /= (randint1(4) + 7);
4377 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
4379 (void)set_blind(p_ptr->blind + randint1(5) + 2);
4382 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
4384 if (!CHECK_MULTISHADOW()) msg_print(_("光で肉体が焦がされた!", "The light scorches your flesh!"));
4387 else if (prace_is_(RACE_S_FAIRY))
4392 if (p_ptr->wraith_form) dam *= 2;
4393 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4395 if (p_ptr->wraith_form && !CHECK_MULTISHADOW())
4397 p_ptr->wraith_form = 0;
4398 msg_print(_("閃光のため非物質的な影の存在でいられなくなった。",
4399 "The light forces you out of your incorporeal shadow form."));
4401 p_ptr->redraw |= (PR_MAP | PR_STATUS);
4402 p_ptr->update |= (PU_MONSTERS);
4403 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4409 /* Dark -- blinding */
4412 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4413 if (p_ptr->resist_dark)
4415 dam *= 4; dam /= (randint1(4) + 7);
4417 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
4419 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
4421 (void)set_blind(p_ptr->blind + randint1(5) + 2);
4423 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4427 /* Time -- bolt fewer effects XXX */
4430 if (fuzzy) msg_print(_("過去からの衝撃に攻撃された!", "You are hit by a blast from the past!"));
4431 if (p_ptr->resist_time)
4434 dam /= (randint1(4) + 7);
4435 msg_print(_("時間が通り過ぎていく気がする。", "You feel as if time is passing you by."));
4437 else if (!CHECK_MULTISHADOW())
4439 switch (randint1(10))
4441 case 1: case 2: case 3: case 4: case 5:
4443 if (p_ptr->prace == RACE_ANDROID) break;
4444 msg_print(_("人生が逆戻りした気がする。", "You feel life has clocked back."));
4445 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
4449 case 6: case 7: case 8: case 9:
4451 switch (randint1(6))
4453 case 1: k = A_STR; act = _("強く", "strong"); break;
4454 case 2: k = A_INT; act = _("聡明で", "bright"); break;
4455 case 3: k = A_WIS; act = _("賢明で", "wise"); break;
4456 case 4: k = A_DEX; act = _("器用で", "agile"); break;
4457 case 5: k = A_CON; act = _("健康で", "hale"); break;
4458 case 6: k = A_CHR; act = _("美しく", "beautiful"); break;
4461 msg_format(_("あなたは以前ほど%sなくなってしまった...。",
4462 "You're not as %s as you used to be..."), act);
4464 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
4465 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
4466 p_ptr->update |= (PU_BONUS);
4472 msg_print(_("あなたは以前ほど力強くなくなってしまった...。",
4473 "You're not as powerful as you used to be..."));
4475 for (k = 0; k < A_MAX; k++)
4477 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
4478 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
4480 p_ptr->update |= (PU_BONUS);
4486 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4490 /* Gravity -- stun plus slowness plus teleport */
4493 if (fuzzy) msg_print(_("何か重いもので攻撃された!", "You are hit by something heavy!"));
4494 msg_print(_("周辺の重力がゆがんだ。", "Gravity warps around you."));
4496 if (!CHECK_MULTISHADOW())
4498 teleport_player(5, TELEPORT_PASSIVE);
4499 if (!p_ptr->levitation)
4500 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4501 if (!(p_ptr->resist_sound || p_ptr->levitation))
4503 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
4504 (void)set_stun(p_ptr->stun + plus_stun);
4507 if (p_ptr->levitation)
4509 dam = (dam * 2) / 3;
4512 if (!p_ptr->levitation || one_in_(13))
4514 inven_damage(set_cold_destroy, 2);
4517 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4521 /* Standard damage */
4522 case GF_DISINTEGRATE:
4524 if (fuzzy) msg_print(_("純粋なエネルギーで攻撃された!", "You are hit by pure energy!"));
4526 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4532 if (fuzzy) msg_print(_("何らかの攻撃によって気分がよくなった。", "You are hit by something invigorating!"));
4534 (void)hp_player(dam);
4541 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4542 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
4549 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
4550 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4556 if (p_ptr->free_act) break;
4557 if (fuzzy) msg_print(_("眠ってしまった!", "You fall asleep!"));
4559 if (ironman_nightmare)
4561 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
4562 /* Have some nightmares */
4563 sanity_blast(NULL, FALSE);
4566 set_paralyzed(p_ptr->paralyzed + dam);
4576 if (fuzzy) msg_print(_("魔法のオーラで攻撃された!", "You are hit by an aura of magic!"));
4577 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4584 if (fuzzy) msg_print(_("エネルギーの塊で攻撃された!", "You are hit by an energy!"));
4585 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
4592 if (fuzzy) msg_print(_("何かが空からあなたの頭上に落ちてきた!", "Something falls from the sky on you!"));
4594 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4595 if (!p_ptr->resist_shard || one_in_(13))
4597 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
4598 inven_damage(set_cold_destroy, 2);
4604 /* Ice -- cold plus stun plus cuts */
4607 if (fuzzy) msg_print(_("何か鋭く冷たいもので攻撃された!", "You are hit by something sharp and cold!"));
4608 get_damage = cold_dam(dam, killer, monspell, FALSE);
4609 if (!CHECK_MULTISHADOW())
4611 if (!p_ptr->resist_shard)
4613 (void)set_cut(p_ptr->cut + damroll(5, 8));
4615 if (!p_ptr->resist_sound)
4617 (void)set_stun(p_ptr->stun + randint1(15));
4620 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
4622 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
4632 if (fuzzy) msg_print(_("何か非常に冷たいもので攻撃された!", "You are hit by something extremely cold!"));
4634 if (p_ptr->mimic_form)
4636 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
4637 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4642 switch (p_ptr->prace)
4644 /* Some races are immune */
4658 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4670 if (CHECK_MULTISHADOW())
4672 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
4674 else if (p_ptr->csp)
4678 msg_format(_("%^sに精神エネルギーを吸い取られてしまった!", "%^s draws psychic energy from you!"), m_name);
4680 msg_print(_("精神エネルギーを吸い取られてしまった!", "Your psychic energy is drawn!"));
4683 if (dam >= p_ptr->csp)
4687 p_ptr->csp_frac = 0;
4696 learn_spell(monspell);
4697 p_ptr->redraw |= (PR_MANA);
4698 p_ptr->window |= (PW_PLAYER | PW_SPELL);
4702 /* Heal the monster */
4703 if (m_ptr->hp < m_ptr->maxhp)
4707 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
4709 /* Redraw (later) if needed */
4710 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4711 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4713 /* Special message */
4716 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), m_name);
4729 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
4731 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4732 learn_spell(monspell);
4736 if (!CHECK_MULTISHADOW())
4738 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
4740 if (!p_ptr->resist_conf)
4742 (void)set_confused(p_ptr->confused + randint0(4) + 4);
4745 if (!p_ptr->resist_chaos && one_in_(3))
4747 (void)set_image(p_ptr->image + randint0(250) + 150);
4754 p_ptr->csp_frac = 0;
4756 p_ptr->redraw |= PR_MANA;
4759 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4765 case GF_BRAIN_SMASH:
4767 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
4769 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4770 learn_spell(monspell);
4774 if (!CHECK_MULTISHADOW())
4776 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
4782 p_ptr->csp_frac = 0;
4784 p_ptr->redraw |= PR_MANA;
4787 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4788 if (!CHECK_MULTISHADOW())
4790 if (!p_ptr->resist_blind)
4792 (void)set_blind(p_ptr->blind + 8 + randint0(8));
4794 if (!p_ptr->resist_conf)
4796 (void)set_confused(p_ptr->confused + randint0(4) + 4);
4798 if (!p_ptr->free_act)
4800 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
4802 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4804 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
4805 (void)do_dec_stat(A_INT);
4806 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
4807 (void)do_dec_stat(A_WIS);
4809 if (!p_ptr->resist_chaos)
4811 (void)set_image(p_ptr->image + randint0(250) + 150);
4821 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4823 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4824 learn_spell(monspell);
4828 if (!CHECK_MULTISHADOW()) curse_equipment(15, 0);
4829 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4837 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4839 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4840 learn_spell(monspell);
4844 if (!CHECK_MULTISHADOW()) curse_equipment(25, MIN(rlev / 2 - 15, 5));
4845 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4853 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4855 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4856 learn_spell(monspell);
4860 if (!CHECK_MULTISHADOW()) curse_equipment(33, MIN(rlev / 2 - 15, 15));
4861 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4869 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU) && !CHECK_MULTISHADOW())
4871 msg_print(_("しかし秘孔を跳ね返した!", "You resist the effects!"));
4872 learn_spell(monspell);
4876 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4877 if (!CHECK_MULTISHADOW()) (void)set_cut(p_ptr->cut + damroll(10, 10));
4885 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4887 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4888 learn_spell(monspell);
4892 if (!CHECK_MULTISHADOW())
4894 msg_print(_("あなたは命が薄まっていくように感じた!", "You feel your life fade away!"));
4895 curse_equipment(40, 20);
4898 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
4900 if (p_ptr->chp < 1) p_ptr->chp = 1;
4915 /* Hex - revenge damage stored */
4916 revenge_store(get_damage);
4918 if ((p_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
4919 && (get_damage > 0) && !p_ptr->is_dead && (who > 0))
4921 GAME_TEXT m_name_self[80];
4924 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
4926 msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), m_name, m_name_self);
4927 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
4928 if (p_ptr->tim_eyeeye) set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
4931 if (p_ptr->riding && dam > 0)
4933 rakubadam_p = (dam > 200) ? 200 : dam;
4937 disturb(TRUE, TRUE);
4940 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
4942 (void)kawarimi(FALSE);
4945 /* Return "Anything seen?" */
4951 * Find the distance from (x, y) to a line.
4953 POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
4955 /* Vector from (x, y) to (x1, y1) */
4956 POSITION py = y1 - y;
4957 POSITION px = x1 - x;
4960 POSITION ny = x2 - x1;
4961 POSITION nx = y1 - y2;
4964 POSITION pd = distance(y1, x1, y, x);
4965 POSITION nd = distance(y1, x1, y2, x2);
4967 if (pd > nd) return distance(y, x, y2, x2);
4969 /* Component of P on N */
4970 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
4972 /* Absolute value */
4973 return((nd >= 0) ? nd : 0 - nd);
4980 * Modified version of los() for calculation of disintegration balls.
4981 * Disintegration effects are stopped by permanent walls.
4983 bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
4985 POSITION dx, dy; /* Delta */
4986 POSITION ax, ay; /* Absolute */
4987 POSITION sx, sy; /* Signs */
4988 POSITION qx, qy; /* Fractions */
4989 POSITION tx, ty; /* Scanners */
4990 POSITION f1, f2; /* Scale factors */
4991 POSITION m; /* Slope, or 1/Slope, of LOS */
4993 /* Extract the offset */
4997 /* Extract the absolute offset */
5001 /* Handle adjacent (or identical) grids */
5002 if ((ax < 2) && (ay < 2)) return (TRUE);
5004 /* Paranoia -- require "safe" origin */
5005 /* if (!in_bounds(y1, x1)) return (FALSE); */
5007 /* Directly South/North */
5010 /* South -- check for walls */
5013 for (ty = y1 + 1; ty < y2; ty++)
5015 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5019 /* North -- check for walls */
5022 for (ty = y1 - 1; ty > y2; ty--)
5024 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5032 /* Directly East/West */
5035 /* East -- check for walls */
5038 for (tx = x1 + 1; tx < x2; tx++)
5040 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5044 /* West -- check for walls */
5047 for (tx = x1 - 1; tx > x2; tx--)
5049 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5057 /* Extract some signs */
5058 sx = (dx < 0) ? -1 : 1;
5059 sy = (dy < 0) ? -1 : 1;
5061 /* Vertical "knights" */
5066 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
5070 /* Horizontal "knights" */
5075 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
5079 /* Calculate scale factor div 2 */
5082 /* Calculate scale factor */
5086 /* Travel horizontally */
5089 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
5095 /* Consider the special case where slope == 1. */
5106 /* Note (below) the case (qy == f2), where */
5107 /* the LOS exactly meets the corner of a tile. */
5110 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5121 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5134 /* Travel vertically */
5137 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
5153 /* Note (below) the case (qx == f2), where */
5154 /* the LOS exactly meets the corner of a tile. */
5157 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5168 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5189 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)
5194 int brev = rad * rad / dist;
5198 int mdis = distance(y1, x1, y2, x2) + rad;
5200 while (bdis <= mdis)
5204 if ((0 < dist) && (path_n < dist))
5206 POSITION ny = GRID_Y(path_g[path_n]);
5207 POSITION nx = GRID_X(path_g[path_n]);
5208 POSITION nd = distance(ny, nx, y1, x1);
5210 /* Get next base point */
5219 /* Travel from center outward */
5220 for (cdis = 0; cdis <= brad; cdis++)
5222 /* Scan the maximal blast area of radius "cdis" */
5223 for (y = by - cdis; y <= by + cdis; y++)
5225 for (x = bx - cdis; x <= bx + cdis; x++)
5227 /* Ignore "illegal" locations */
5228 if (!in_bounds(y, x)) continue;
5230 /* Enforce a circular "ripple" */
5231 if (distance(y1, x1, y, x) != bdis) continue;
5233 /* Enforce an arc */
5234 if (distance(by, bx, y, x) != cdis) continue;
5240 /* Lights are stopped by opaque terrains */
5241 if (!los(by, bx, y, x)) continue;
5243 case GF_DISINTEGRATE:
5244 /* Disintegration are stopped only by perma-walls */
5245 if (!in_disintegration_range(by, bx, y, x)) continue;
5248 /* Ball explosions are stopped by walls */
5249 if (!projectable(by, bx, y, x)) continue;
5253 /* Save this grid */
5261 /* Encode some more "radius" info */
5262 gm[bdis + 1] = *pgrids;
5264 /* Increase the size */
5265 brad = rad * (path_n + brev) / (dist + brev);
5267 /* Find the next ripple */
5271 /* Store the effect size */
5277 * @brief 汎用的なビーム/ボルト/ボール系処理のルーチン Generic "beam"/"bolt"/"ball" projection routine.
5278 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
5279 * @param rad 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
5280 * @param y 目標Y座標 / Target y location (or location to travel "towards")
5281 * @param x 目標X座標 / Target x location (or location to travel "towards")
5282 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
5283 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
5284 * @param flg 効果フラグ / Extra bit flags (see PROJECT_xxxx in "defines.h")
5285 * @param monspell 効果元のモンスター魔法ID
5286 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
5289 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
5290 * towards a given location (optionally passing over the heads of interposing
5291 * monsters), and have it do a given amount of damage to the monsters (and
5292 * optionally objects) within the given radius of the final location.
5294 * A "bolt" travels from source to target and affects only the target grid.
5295 * A "beam" travels from source to target, affecting all grids passed through.
5296 * A "ball" travels from source to the target, exploding at the target, and
5297 * affecting everything within the given radius of the target location.
5299 * Traditionally, a "bolt" does not affect anything on the ground, and does
5300 * not pass over the heads of interposing monsters, much like a traditional
5301 * missile, and will "stop" abruptly at the "target" even if no monster is
5302 * positioned there, while a "ball", on the other hand, passes over the heads
5303 * of monsters between the source and target, and affects everything except
5304 * the source monster which lies within the final radius, while a "beam"
5305 * affects every monster between the source and target, except for the casting
5306 * monster (or player), and rarely affects things on the ground.
5308 * Two special flags allow us to use this function in special ways, the
5309 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
5310 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
5311 * actually projecting from the source monster (or player).
5313 * The player will only get "experience" for monsters killed by himself
5314 * Unique monsters can only be destroyed by attacks from the player
5316 * Only 256 grids can be affected per projection, limiting the effective
5317 * "radius" of standard ball attacks to nine units (diameter nineteen).
5319 * One can project in a given "direction" by combining PROJECT_THRU with small
5320 * offsets to the initial location (see "line_spell()"), or by calculating
5321 * "virtual targets" far away from the player.
5323 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
5324 * continuing until it actually hits somethings (useful for "stone to mud").
5326 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
5328 * Balls must explode BEFORE hitting walls, or they would affect monsters
5329 * on both sides of a wall. Some bug reports indicate that this is still
5330 * happening in 2.7.8 for Windows, though it appears to be impossible.
5332 * We "pre-calculate" the blast area only in part for efficiency.
5333 * More importantly, this lets us do "explosions" from the "inside" out.
5334 * This results in a more logical distribution of "blast" treasure.
5335 * It also produces a better (in my opinion) animation of the explosion.
5336 * It could be (but is not) used to have the treasure dropped by monsters
5337 * in the middle of the explosion fall "outwards", and then be damaged by
5338 * the blast as it spreads outwards towards the treasure drop location.
5340 * Walls and doors are included in the blast area, so that they can be
5341 * "burned" or "melted" in later versions.
5343 * This algorithm is intended to maximize simplicity, not necessarily
5344 * efficiency, since this function is not a bottleneck in the code.
5346 * We apply the blast effect from ground zero outwards, in several passes,
5347 * first affecting features, then objects, then monsters, then the player.
5348 * This allows walls to be removed before checking the object or monster
5349 * in the wall, and protects objects which are dropped by monsters killed
5350 * in the blast, and allows the player to see all affects before he is
5351 * killed or teleported away. The semantics of this method are open to
5352 * various interpretations, but they seem to work well in practice.
5354 * We process the blast area from ground-zero outwards to allow for better
5355 * distribution of treasure dropped by monsters, and because it provides a
5356 * pleasing visual effect at low cost.
5358 * Note that the damage done by "ball" explosions decreases with distance.
5359 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
5361 * Notice the "napalm" effect of "beam" weapons. First they "project" to
5362 * the target, and then the damage "flows" along this beam of destruction.
5363 * The damage at every grid is the same as at the "center" of a "ball"
5364 * explosion, since the "beam" grids are treated as if they ARE at the
5365 * center of a "ball" explosion.
5367 * Currently, specifying "beam" plus "ball" means that locations which are
5368 * covered by the initial "beam", and also covered by the final "ball", except
5369 * for the final grid (the epicenter of the ball), will be "hit twice", once
5370 * by the initial beam, and once by the exploding ball. For the grid right
5371 * next to the epicenter, this results in 150% damage being done. The center
5372 * does not have this problem, for the same reason the final grid in a "beam"
5373 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
5374 * grids which are covered by the "ball" will NOT work, as then they will
5375 * receive LESS damage than they should. Do not combine "beam" with "ball".
5377 * The array "gy[],gx[]" with current size "grids" is used to hold the
5378 * collected locations of all grids in the "blast area" plus "beam path".
5380 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
5381 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
5382 * first blast grid (see above) with radius "N" from the blast center. Note
5383 * that only the first gm[1] grids in the blast area thus take full damage.
5384 * Also, note that gm[rad+1] is always equal to "grids", which is the total
5385 * number of blast grids.
5387 * Note that once the projection is complete, (y2,x2) holds the final location
5388 * of bolts/beams, and the "epicenter" of balls.
5390 * Note also that "rad" specifies the "inclusive" radius of projection blast,
5391 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
5392 * implementation of the "distance" function. Also, a bolt can be properly
5393 * viewed as a "ball" with a "rad" of "zero".
5395 * Note that if no "target" is reached before the beam/bolt/ball travels the
5396 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
5397 * may be relevant even for bolts, since they have a "1x1" mini-blast.
5399 * Note that for consistency, we "pretend" that the bolt actually takes "time"
5400 * to move from point A to point B, even if the player cannot see part of the
5401 * projection path. Note that in general, the player will *always* see part
5402 * of the path, since it either starts at the player or ends on the player.
5404 * Hack -- we assume that every "projection" is "self-illuminating".
5406 * Hack -- when only a single monster is affected, we automatically track
5407 * (and recall) that monster, unless "PROJECT_JUMP" is used.
5409 * Note that all projections now "explode" at their final destination, even
5410 * if they were being projected at a more distant destination. This means
5411 * that "ball" spells will *always* explode.
5413 * Note that we must call "handle_stuff()" after affecting terrain features
5414 * in the blast radius, in case the "illumination" of the grid was changed,
5415 * and "update_view()" and "update_monsters()" need to be called.
5418 bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
5428 POSITION y_saver, x_saver; /* For reflecting monsters */
5430 int msec = delay_factor * delay_factor * delay_factor;
5432 /* Assume the player sees nothing */
5433 bool notice = FALSE;
5435 /* Assume the player has seen nothing */
5436 bool visual = FALSE;
5438 /* Assume the player has seen no blast grids */
5441 /* Assume to be a normal ball spell */
5442 bool breath = FALSE;
5444 /* Is the player blind? */
5445 bool blind = (p_ptr->blind ? TRUE : FALSE);
5447 bool old_hide = FALSE;
5449 /* Number of grids in the "path" */
5452 /* Actual grids in the "path" */
5455 /* Number of grids in the "blast area" (including the "beam" path) */
5458 /* Coordinates of the affected grids */
5459 POSITION gx[1024], gy[1024];
5461 /* Encoded "radius" info (see above) */
5464 /* Actual radius encoded in gm[] */
5465 POSITION gm_rad = rad;
5469 /* Attacker's name (prepared before polymorph)*/
5470 GAME_TEXT who_name[MAX_NLEN];
5472 /* Can the player see the source of this effect? */
5473 bool see_s_msg = TRUE;
5475 /* Initialize by null string */
5481 /* Default target of monsterspell is player */
5482 monster_target_y = p_ptr->y;
5483 monster_target_x = p_ptr->x;
5485 /* Hack -- Jump to target */
5486 if (flg & (PROJECT_JUMP))
5491 /* Clear the flag */
5492 flg &= ~(PROJECT_JUMP);
5497 /* Start at player */
5504 /* Start at monster */
5507 x1 = current_floor_ptr->m_list[who].fx;
5508 y1 = current_floor_ptr->m_list[who].fy;
5509 monster_desc(who_name, ¤t_floor_ptr->m_list[who], MD_WRONGDOER_NAME);
5521 /* Default "destination" */
5526 /* Hack -- verify stuff */
5527 if (flg & (PROJECT_THRU))
5529 if ((x1 == x2) && (y1 == y2))
5531 flg &= ~(PROJECT_THRU);
5535 /* Handle a breath attack */
5540 if (flg & PROJECT_HIDE) old_hide = TRUE;
5541 flg |= PROJECT_HIDE;
5545 /* Hack -- Assume there will be no blast (max radius 32) */
5546 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
5554 /* Collect beam grids */
5555 if (flg & (PROJECT_BEAM))
5566 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
5568 case GF_DISINTEGRATE:
5569 flg |= (PROJECT_GRID);
5570 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
5574 /* Calculate the projection path */
5576 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
5579 /* Giga-Hack SEEKER & SUPER_RAY */
5581 if( typ == GF_SEEKER )
5591 for (i = 0; i < path_n; ++i)
5596 POSITION ny = GRID_Y(path_g[i]);
5597 POSITION nx = GRID_X(path_g[i]);
5608 /* Only do visuals if requested */
5609 if (!blind && !(flg & (PROJECT_HIDE)))
5611 /* Only do visuals if the player can "see" the bolt */
5612 if (panel_contains(y, x) && player_has_los_bold(y, x))
5619 /* Obtain the bolt pict */
5620 p = bolt_pict(oy, ox, y, x, typ);
5622 /* Extract attr/char */
5626 /* Visual effects */
5627 print_rel(c, a, y, x);
5628 move_cursor_relative(y, x);
5629 /*if (fresh_before)*/ Term_fresh();
5630 Term_xtra(TERM_XTRA_DELAY, msec);
5632 /*if (fresh_before)*/ Term_fresh();
5634 /* Display "beam" grids */
5635 if (flg & (PROJECT_BEAM))
5637 /* Obtain the explosion pict */
5638 p = bolt_pict(y, x, y, x, typ);
5640 /* Extract attr/char */
5644 /* Visual effects */
5645 print_rel(c, a, y, x);
5648 /* Hack -- Activate delay */
5652 /* Hack -- delay anyway for consistency */
5655 /* Delay for consistency */
5656 Term_xtra(TERM_XTRA_DELAY, msec);
5659 if (project_o(0, 0, y, x, dam, GF_SEEKER))notice = TRUE;
5660 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
5662 /* The target of monsterspell becomes tha mirror(broken) */
5663 monster_target_y = y;
5664 monster_target_x = x;
5666 remove_mirror(y, x);
5667 next_mirror(&oy, &ox, y, x);
5669 path_n = i + project_path(&(path_g[i + 1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
5670 for (j = last_i; j <= i; j++)
5672 y = GRID_Y(path_g[j]);
5673 x = GRID_X(path_g[j]);
5674 if (project_m(0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
5675 if (!who && (project_m_n == 1) && !jump) {
5676 if (current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0) {
5677 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5681 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5682 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5686 (void)project_f(0, 0, y, x, dam, GF_SEEKER);
5691 for(i = last_i ; i < path_n ; i++)
5694 py = GRID_Y(path_g[i]);
5695 px = GRID_X(path_g[i]);
5696 if (project_m(0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
5698 if (!who && (project_m_n == 1) && !jump) {
5699 if (current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0)
5701 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5705 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5706 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5710 (void)project_f(0, 0, py, px, dam, GF_SEEKER);
5714 else if(typ == GF_SUPER_RAY){
5716 int second_step = 0;
5723 for (i = 0; i < path_n; ++i)
5728 POSITION ny = GRID_Y(path_g[i]);
5729 POSITION nx = GRID_X(path_g[i]);
5740 /* Only do visuals if requested */
5741 if (!blind && !(flg & (PROJECT_HIDE)))
5743 /* Only do visuals if the player can "see" the bolt */
5744 if (panel_contains(y, x) && player_has_los_bold(y, x))
5751 /* Obtain the bolt pict */
5752 p = bolt_pict(oy, ox, y, x, typ);
5754 /* Extract attr/char */
5758 /* Visual effects */
5759 print_rel(c, a, y, x);
5760 move_cursor_relative(y, x);
5761 /*if (fresh_before)*/ Term_fresh();
5762 Term_xtra(TERM_XTRA_DELAY, msec);
5764 /*if (fresh_before)*/ Term_fresh();
5766 /* Display "beam" grids */
5767 if (flg & (PROJECT_BEAM))
5769 /* Obtain the explosion pict */
5770 p = bolt_pict(y, x, y, x, typ);
5772 /* Extract attr/char */
5776 /* Visual effects */
5777 print_rel(c, a, y, x);
5780 /* Hack -- Activate delay */
5784 /* Hack -- delay anyway for consistency */
5787 /* Delay for consistency */
5788 Term_xtra(TERM_XTRA_DELAY, msec);
5791 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
5792 if (!cave_have_flag_bold(y, x, FF_PROJECT))
5794 if( second_step )continue;
5797 if( is_mirror_grid(¤t_floor_ptr->grid_array[y][x]) && !second_step )
5799 /* The target of monsterspell becomes tha mirror(broken) */
5800 monster_target_y = y;
5801 monster_target_x = x;
5804 for( j = 0; j <=i ; j++ )
5806 y = GRID_Y(path_g[j]);
5807 x = GRID_X(path_g[j]);
5808 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
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-1, x , flg);
5814 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
5815 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
5816 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
5817 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
5818 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
5819 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
5822 for( i = 0; i < path_n ; i++ )
5825 py = GRID_Y(path_g[i]);
5826 px = GRID_X(path_g[i]);
5827 (void)project_m(0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
5828 if(!who && (project_m_n == 1) && !jump){
5829 if(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx >0 ){
5830 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5834 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5835 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5839 (void)project_f(0, 0, py, px, dam, GF_SUPER_RAY);
5844 /* Project along the path */
5845 for (i = 0; i < path_n; ++i)
5850 POSITION ny = GRID_Y(path_g[i]);
5851 POSITION nx = GRID_X(path_g[i]);
5853 if (flg & PROJECT_DISI)
5855 /* Hack -- Balls explode before reaching walls */
5856 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
5858 else if (flg & PROJECT_LOS)
5860 /* Hack -- Balls explode before reaching walls */
5861 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
5865 /* Hack -- Balls explode before reaching walls */
5866 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
5873 /* Collect beam grids */
5874 if (flg & (PROJECT_BEAM))
5881 /* Only do visuals if requested */
5882 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
5884 /* Only do visuals if the player can "see" the bolt */
5885 if (panel_contains(y, x) && player_has_los_bold(y, x))
5892 /* Obtain the bolt pict */
5893 p = bolt_pict(oy, ox, y, x, typ);
5895 /* Extract attr/char */
5899 /* Visual effects */
5900 print_rel(c, a, y, x);
5901 move_cursor_relative(y, x);
5902 /*if (fresh_before)*/ Term_fresh();
5903 Term_xtra(TERM_XTRA_DELAY, msec);
5905 /*if (fresh_before)*/ Term_fresh();
5907 /* Display "beam" grids */
5908 if (flg & (PROJECT_BEAM))
5910 /* Obtain the explosion pict */
5911 p = bolt_pict(y, x, y, x, typ);
5913 /* Extract attr/char */
5917 /* Visual effects */
5918 print_rel(c, a, y, x);
5921 /* Hack -- Activate delay */
5925 /* Hack -- delay anyway for consistency */
5928 /* Delay for consistency */
5929 Term_xtra(TERM_XTRA_DELAY, msec);
5936 /* Save the "blast epicenter" */
5940 if (breath && !path_n)
5946 flg &= ~(PROJECT_HIDE);
5950 /* Start the "explosion" */
5953 /* Hack -- make sure beams get to "explode" */
5961 /* If we found a "target", explode there */
5962 if (dist <= MAX_RANGE)
5964 /* Mega-Hack -- remove the final "beam" grid */
5965 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
5968 * Create a conical breath attack
5979 flg &= ~(PROJECT_HIDE);
5981 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
5985 /* Determine the blast area, work from the inside out */
5986 for (dist = 0; dist <= rad; dist++)
5988 /* Scan the maximal blast area of radius "dist" */
5989 for (y = by - dist; y <= by + dist; y++)
5991 for (x = bx - dist; x <= bx + dist; x++)
5993 /* Ignore "illegal" locations */
5994 if (!in_bounds2(y, x)) continue;
5996 /* Enforce a "circular" explosion */
5997 if (distance(by, bx, y, x) != dist) continue;
6003 /* Lights are stopped by opaque terrains */
6004 if (!los(by, bx, y, x)) continue;
6006 case GF_DISINTEGRATE:
6007 /* Disintegration are stopped only by perma-walls */
6008 if (!in_disintegration_range(by, bx, y, x)) continue;
6011 /* Ball explosions are stopped by walls */
6012 if (!projectable(by, bx, y, x)) continue;
6016 /* Save this grid */
6023 /* Encode some more "radius" info */
6029 /* Speed -- ignore "non-explosions" */
6030 if (!grids) return (FALSE);
6033 /* Display the "blast area" if requested */
6034 if (!blind && !(flg & (PROJECT_HIDE)))
6036 /* Then do the "blast", from inside out */
6037 for (t = 0; t <= gm_rad; t++)
6039 /* Dump everything with this radius */
6040 for (i = gm[t]; i < gm[t+1]; i++)
6042 /* Extract the location */
6046 /* Only do visuals if the player can "see" the blast */
6047 if (panel_contains(y, x) && player_has_los_bold(y, x))
6056 /* Obtain the explosion pict */
6057 p = bolt_pict(y, x, y, x, typ);
6059 /* Extract attr/char */
6063 /* Visual effects -- Display */
6064 print_rel(c, a, y, x);
6068 /* Hack -- center the cursor */
6069 move_cursor_relative(by, bx);
6071 /* Flush each "radius" seperately */
6072 /*if (fresh_before)*/ Term_fresh();
6074 /* Delay (efficiently) */
6075 if (visual || drawn)
6077 Term_xtra(TERM_XTRA_DELAY, msec);
6081 /* Flush the erasing */
6084 /* Erase the explosion drawn above */
6085 for (i = 0; i < grids; i++)
6087 /* Extract the location */
6091 /* Hack -- Erase if needed */
6092 if (panel_contains(y, x) && player_has_los_bold(y, x))
6098 /* Hack -- center the cursor */
6099 move_cursor_relative(by, bx);
6101 /* Flush the explosion */
6102 /*if (fresh_before)*/ Term_fresh();
6106 update_creature(p_ptr);
6108 if (flg & PROJECT_KILL)
6110 see_s_msg = (who > 0) ? is_seen(¤t_floor_ptr->m_list[who]) :
6111 (!who ? TRUE : (player_can_see_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)));
6115 /* Check features */
6116 if (flg & (PROJECT_GRID))
6118 /* Start with "dist" of zero */
6121 /* Scan for features */
6122 for (i = 0; i < grids; i++)
6124 /* Hack -- Notice new "dist" values */
6125 if (gm[dist+1] == i) dist++;
6127 /* Get the grid location */
6131 /* Find the closest point in the blast */
6134 int d = dist_to_line(y, x, y1, x1, by, bx);
6136 /* Affect the grid */
6137 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
6141 /* Affect the grid */
6142 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
6147 update_creature(p_ptr);
6150 if (flg & (PROJECT_ITEM))
6152 /* Start with "dist" of zero */
6155 /* Scan for objects */
6156 for (i = 0; i < grids; i++)
6158 /* Hack -- Notice new "dist" values */
6159 if (gm[dist+1] == i) dist++;
6161 /* Get the grid location */
6165 /* Find the closest point in the blast */
6168 int d = dist_to_line(y, x, y1, x1, by, bx);
6170 /* Affect the object in the grid */
6171 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
6175 /* Affect the object in the grid */
6176 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
6182 /* Check monsters */
6183 if (flg & (PROJECT_KILL))
6190 /* Start with "dist" of zero */
6193 /* Scan for monsters */
6194 for (i = 0; i < grids; i++)
6198 /* Hack -- Notice new "dist" values */
6199 if (gm[dist + 1] == i) dist++;
6201 /* Get the grid location */
6205 /* A single bolt may be reflected */
6208 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
6209 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
6211 if ((flg & PROJECT_REFLECTABLE) && current_floor_ptr->grid_array[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
6212 ((current_floor_ptr->grid_array[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
6213 (!who || dist_hack > 1) && !one_in_(10))
6216 int max_attempts = 10;
6218 /* Choose 'new' target */
6221 t_y = y_saver - 1 + randint1(3);
6222 t_x = x_saver - 1 + randint1(3);
6225 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
6227 if (max_attempts < 1)
6233 sound(SOUND_REFLECT);
6236 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
6237 msg_print(_("「北斗神拳奥義・二指真空把!」", "The attack bounces!"));
6238 else if (m_ptr->r_idx == MON_DIO)
6239 msg_print(_("ディオ・ブランドーは指一本で攻撃を弾き返した!", "The attack bounces!"));
6241 msg_print(_("攻撃は跳ね返った!", "The attack bounces!"));
6243 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
6245 /* Reflected bolts randomly target either one */
6246 if (player_bold(y, x) || one_in_(2)) flg &= ~(PROJECT_PLAYER);
6247 else flg |= PROJECT_PLAYER;
6249 /* The bolt is reflected */
6250 project(current_floor_ptr->grid_array[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
6252 /* Don't affect the monster any longer */
6258 /* Find the closest point in the blast */
6261 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
6265 effective_dist = dist;
6269 /* There is the riding player on this monster */
6270 if (p_ptr->riding && player_bold(y, x))
6272 /* Aimed on the player */
6273 if (flg & PROJECT_PLAYER)
6275 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
6278 * A beam or bolt is well aimed
6280 * So don't affects the mount.
6287 * The spell is not well aimed,
6288 * So partly affect the mount too.
6295 * This grid is the original target.
6296 * Or aimed on your horse.
6298 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
6300 /* Hit the mount with full damage */
6304 * Otherwise this grid is not the
6305 * original target, it means that line
6306 * of fire is obstructed by this
6310 * A beam or bolt will hit either
6311 * player or mount. Choose randomly.
6313 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
6317 /* Hit the mount with full damage */
6321 /* Hit the player later */
6322 flg |= PROJECT_PLAYER;
6324 /* Don't affect the mount */
6330 * The spell is not well aimed, so
6331 * partly affect both player and
6340 /* Affect the monster in the grid */
6341 if (project_m(who, effective_dist, y, x, dam, typ, flg, see_s_msg)) notice = TRUE;
6345 /* Player affected one monster (without "jumping") */
6346 if (!who && (project_m_n == 1) && !jump)
6351 /* Track if possible */
6352 if (current_floor_ptr->grid_array[y][x].m_idx > 0)
6354 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
6358 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6359 health_track(current_floor_ptr->grid_array[y][x].m_idx);
6367 if (flg & (PROJECT_KILL))
6369 /* Start with "dist" of zero */
6372 /* Scan for player */
6373 for (i = 0; i < grids; i++)
6377 /* Hack -- Notice new "dist" values */
6378 if (gm[dist+1] == i) dist++;
6380 /* Get the grid location */
6384 /* Affect the player? */
6385 if (!player_bold(y, x)) continue;
6387 /* Find the closest point in the blast */
6390 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
6394 effective_dist = dist;
6397 /* Target may be your horse */
6400 /* Aimed on the player */
6401 if (flg & PROJECT_PLAYER)
6403 /* Hit the player with full damage */
6407 * Hack -- When this grid was not the
6408 * original target, a beam or bolt
6409 * would hit either player or mount,
6410 * and should be choosen randomly.
6412 * But already choosen to hit the
6413 * mount at this point.
6415 * Or aimed on your horse.
6417 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
6420 * A beam or bolt is well aimed
6422 * So don't affects the player.
6429 * The spell is not well aimed,
6430 * So partly affect the player too.
6436 /* Affect the player */
6437 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
6443 GAME_TEXT m_name[MAX_NLEN];
6445 monster_desc(m_name, ¤t_floor_ptr->m_list[p_ptr->riding], 0);
6447 if (rakubadam_m > 0)
6449 if (rakuba(rakubadam_m, FALSE))
6451 msg_format(_("%^sに振り落とされた!", "%^s has thrown you off!"), m_name);
6454 if (p_ptr->riding && rakubadam_p > 0)
6456 if(rakuba(rakubadam_p, FALSE))
6458 msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_name);
6463 /* Return "something was noticed" */
6468 * @brief 鏡魔法「封魔結界」の効果処理
6470 * @return 効果があったらTRUEを返す
6472 bool binding_field(HIT_POINT dam)
6474 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
6475 int mirror_num = 0; /* 鏡の数 */
6477 POSITION centersign;
6478 POSITION x1, x2, y1, y2;
6480 int msec = delay_factor*delay_factor*delay_factor;
6483 POSITION point_x[3];
6484 POSITION point_y[3];
6486 /* Default target of monsterspell is player */
6487 monster_target_y = p_ptr->y;
6488 monster_target_x = p_ptr->x;
6490 for (x = 0; x < current_floor_ptr->width; x++)
6492 for (y = 0; y < current_floor_ptr->height; y++)
6494 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]) &&
6495 distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
6496 distance(p_ptr->y, p_ptr->x, y, x) != 0 &&
6497 player_has_los_bold(y, x) &&
6498 projectable(p_ptr->y, p_ptr->x, y, x)
6500 mirror_y[mirror_num] = y;
6501 mirror_x[mirror_num] = x;
6507 if (mirror_num < 2)return FALSE;
6509 point_x[0] = randint0(mirror_num);
6511 point_x[1] = randint0(mirror_num);
6512 } while (point_x[0] == point_x[1]);
6514 point_y[0] = mirror_y[point_x[0]];
6515 point_x[0] = mirror_x[point_x[0]];
6516 point_y[1] = mirror_y[point_x[1]];
6517 point_x[1] = mirror_x[point_x[1]];
6518 point_y[2] = p_ptr->y;
6519 point_x[2] = p_ptr->x;
6521 x = point_x[0] + point_x[1] + point_x[2];
6522 y = point_y[0] + point_y[1] + point_y[2];
6524 centersign = (point_x[0] * 3 - x)*(point_y[1] * 3 - y)
6525 - (point_y[0] * 3 - y)*(point_x[1] * 3 - x);
6526 if (centersign == 0)return FALSE;
6528 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
6529 x1 = x1 < point_x[2] ? x1 : point_x[2];
6530 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
6531 y1 = y1 < point_y[2] ? y1 : point_y[2];
6533 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
6534 x2 = x2 > point_x[2] ? x2 : point_x[2];
6535 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
6536 y2 = y2 > point_y[2] ? y2 : point_y[2];
6538 for (y = y1; y <= y2; y++) {
6539 for (x = x1; x <= x2; x++) {
6540 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6541 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6542 centersign*((point_x[1] - x)*(point_y[2] - y)
6543 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6544 centersign*((point_x[2] - x)*(point_y[0] - y)
6545 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6547 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6548 /* Visual effects */
6550 && panel_contains(y, x)) {
6551 p = bolt_pict(y, x, y, x, GF_MANA);
6552 print_rel(PICT_C(p), PICT_A(p), y, x);
6553 move_cursor_relative(y, x);
6554 /*if (fresh_before)*/ Term_fresh();
6555 Term_xtra(TERM_XTRA_DELAY, msec);
6561 for (y = y1; y <= y2; y++) {
6562 for (x = x1; x <= x2; x++) {
6563 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6564 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6565 centersign*((point_x[1] - x)*(point_y[2] - y)
6566 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6567 centersign*((point_x[2] - x)*(point_y[0] - y)
6568 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6570 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6571 (void)project_f(0, 0, y, x, dam, GF_MANA);
6576 for (y = y1; y <= y2; y++) {
6577 for (x = x1; x <= x2; x++) {
6578 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6579 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6580 centersign*((point_x[1] - x)*(point_y[2] - y)
6581 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6582 centersign*((point_x[2] - x)*(point_y[0] - y)
6583 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6585 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6586 (void)project_o(0, 0, y, x, dam, GF_MANA);
6591 for (y = y1; y <= y2; y++) {
6592 for (x = x1; x <= x2; x++) {
6593 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6594 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6595 centersign*((point_x[1] - x)*(point_y[2] - y)
6596 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6597 centersign*((point_x[2] - x)*(point_y[0] - y)
6598 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6600 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6601 (void)project_m(0, 0, y, x, dam, GF_MANA,
6602 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE);
6608 msg_print(_("鏡が結界に耐えきれず、壊れてしまった。", "The field broke a mirror"));
6609 remove_mirror(point_y[0], point_x[0]);
6616 * @brief 鏡魔法「鏡の封印」の効果処理
6618 * @return 効果があったらTRUEを返す
6620 void seal_of_mirror(HIT_POINT dam)
6624 for (x = 0; x < current_floor_ptr->width; x++)
6626 for (y = 0; y < current_floor_ptr->height; y++)
6628 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
6630 if (project_m(0, 0, y, x, dam, GF_GENOCIDE,
6631 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE))
6633 if (!current_floor_ptr->grid_array[y][x].m_idx)
6635 remove_mirror(y, x);
6647 * @brief 領域魔法に応じて技能の名称を返す。
6648 * @param tval 魔法書のtval
6649 * @return 領域魔法の技能名称を保管した文字列ポインタ
6651 concptr spell_category_name(OBJECT_TYPE_VALUE tval)
6655 case TV_HISSATSU_BOOK:
6656 return _("必殺技", "art");
6658 return _("祈り", "prayer");
6660 return _("歌", "song");
6662 return _("呪文", "spell");