3 * @brief 魔法による遠隔処理の実装 / Spell projection
7 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research,
9 * and not for profit purposes provided that this copyright and statement
10 * are included in all such copies. Other copyrights may also apply.
17 #include "object-curse.h"
18 #include "player-damage.h"
21 #include "monster-status.h"
22 #include "spells-diceroll.h"
23 #include "spells-summon.h"
24 #include "monsterrace-hook.h"
28 #include "projection.h"
33 #include "player-status.h"
34 #include "realm-hex.h"
35 #include "object-hook.h"
41 static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
42 static int rakubadam_p; /*!< 落馬した際のダメージ量 */
44 int project_length = 0; /*!< 投射の射程距離 */
49 * @brief 配置した鏡リストの次を取得する /
50 * Get another mirror. for SEEKER
51 * @param next_y 次の鏡のy座標を返す参照ポインタ
52 * @param next_x 次の鏡のx座標を返す参照ポインタ
53 * @param cury 現在の鏡のy座標
54 * @param curx 現在の鏡のx座標
56 static void next_mirror(POSITION* next_y, POSITION* next_x, POSITION cury, POSITION curx)
58 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
59 int mirror_num = 0; /* 鏡の数 */
63 for (x = 0; x < current_floor_ptr->width; x++)
65 for (y = 0; y < current_floor_ptr->height; y++)
67 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x])) {
68 mirror_y[mirror_num] = y;
69 mirror_x[mirror_num] = x;
76 num = randint0(mirror_num);
77 *next_y = mirror_y[num];
78 *next_x = mirror_x[num];
81 *next_y = cury + randint0(5) - 2;
82 *next_x = curx + randint0(5) - 2;
88 * Mega-Hack -- track "affected" monsters (see "project()" comments)
90 static int project_m_n; /*!< 魔法効果範囲内にいるモンスターの数 */
91 static POSITION project_m_x; /*!< 処理中のモンスターX座標 */
92 static POSITION project_m_y; /*!< 処理中のモンスターY座標 */
93 /* Mega-Hack -- monsters target */
94 static POSITION monster_target_x; /*!< モンスターの攻撃目標X座標 */
95 static POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
99 * @brief 汎用的なビーム/ボルト/ボール系による地形効果処理 / We are called from "project()" to "damage" terrain features
100 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
101 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
102 * @param y 目標Y座標 / Target y location (or location to travel "towards")
103 * @param x 目標X座標 / Target x location (or location to travel "towards")
104 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
105 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
106 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
109 * We are called both for "beam" effects and "ball" effects.
111 * The "r" parameter is the "distance from ground zero".
113 * Note that we determine if the player can "see" anything that happens
114 * by taking into account: blindness, line-of-sight, and illumination.
116 * We return "TRUE" if the effect of the projection is "obvious".
118 * We also "see" grids which are "memorized", probably a hack
120 * Perhaps we should affect doors?
123 static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
125 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
126 feature_type *f_ptr = &f_info[g_ptr->feat];
128 bool obvious = FALSE;
129 bool known = player_has_los_bold(y, x);
134 /* Reduce damage by distance */
135 dam = (dam + r) / (r + 1);
138 if (have_flag(f_ptr->flags, FF_TREE))
146 message = _("枯れた", "was blasted."); break;
148 message = _("縮んだ", "shrank."); break;
150 message = _("溶けた", "melted."); break;
153 message = _("凍り、砕け散った", "was frozen and smashed."); break;
157 message = _("燃えた", "burns up!"); break;
169 message = _("粉砕された", "was crushed."); break;
171 message = NULL; break;
175 msg_format(_("木は%s。", "A tree %s"), message);
176 cave_set_feat(y, x, one_in_(3) ? feat_brake : feat_grass);
179 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
183 /* Analyze the type */
186 /* Ignore most effects */
221 /* Destroy Traps (and Locks) */
224 /* Reveal secret doors */
225 if (is_hidden_door(g_ptr))
230 /* Check line of sight */
238 if (is_trap(g_ptr->feat))
240 /* Check line of sight */
243 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
247 /* Destroy the trap */
248 cave_alter_feat(y, x, FF_DISARM);
251 /* Locked doors are unlocked */
252 if (is_closed_door(g_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
254 FEAT_IDX old_feat = g_ptr->feat;
256 /* Unlock the door */
257 cave_alter_feat(y, x, FF_DISARM);
259 /* Check line of sound */
260 if (known && (old_feat != g_ptr->feat))
262 msg_print(_("カチッと音がした!", "Click!"));
267 /* Remove "unsafe" flag if player is not blind */
268 if (!p_ptr->blind && player_has_los_bold(y, x))
270 g_ptr->info &= ~(CAVE_UNSAFE);
278 /* Destroy Doors (and traps) */
281 /* Destroy all doors and traps */
282 if (is_trap(g_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
284 /* Check line of sight */
287 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
291 /* Destroy the feature */
292 cave_alter_feat(y, x, FF_TUNNEL);
295 /* Remove "unsafe" flag if player is not blind */
296 if (!p_ptr->blind && player_has_los_bold(y, x))
298 g_ptr->info &= ~(CAVE_UNSAFE);
306 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
308 if (have_flag(f_ptr->flags, FF_SPIKE))
310 s16b old_mimic = g_ptr->mimic;
311 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)];
313 cave_alter_feat(y, x, FF_SPIKE);
314 g_ptr->mimic = old_mimic;
319 /* Check line of sight */
320 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
322 msg_format(_("%sに何かがつっかえて開かなくなった。", "The %s seems stuck."), f_name + mimic_f_ptr->name);
329 /* Destroy walls (and doors) */
332 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
334 if (known && (g_ptr->info & (CAVE_MARK)))
336 msg_format(_("%sが溶けて泥になった!", "The %s turns into mud!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
340 /* Destroy the wall */
341 cave_alter_feat(y, x, FF_HURT_ROCK);
343 /* Update some things */
344 p_ptr->update |= (PU_FLOW);
352 if (!cave_naked_bold(y, x)) break;
353 if (player_bold(y, x)) break;
354 cave_set_feat(y, x, feat_door[DOOR_DOOR].closed);
355 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
367 if (!cave_naked_bold(y, x)) break;
368 if (player_bold(y, x)) break;
369 cave_set_feat(y, x, feat_tree);
370 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
376 if (!cave_naked_bold(y, x)) break;
377 g_ptr->info |= CAVE_OBJECT;
378 g_ptr->mimic = feat_glyph;
386 if (!cave_naked_bold(y, x)) break;
387 if (player_bold(y, x)) break;
388 cave_set_feat(y, x, feat_granite);
394 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
397 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
398 cave_set_feat(y, x, feat_shallow_lava);
402 cave_set_feat(y, x, feat_deep_lava);
409 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
412 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
413 cave_set_feat(y, x, feat_shallow_water);
417 cave_set_feat(y, x, feat_deep_water);
422 /* Lite up the grid */
426 /* Turn on the light */
427 if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
429 g_ptr->info |= (CAVE_GLOW);
432 update_local_illumination(y, x);
435 if (player_can_see_bold(y, x)) obvious = TRUE;
437 /* Mega-Hack -- Update the monster in the affected grid */
438 /* This allows "spear of light" (etc) to work "correctly" */
439 if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE);
441 if (p_ptr->special_defense & NINJA_S_STEALTH)
443 if (player_bold(y, x)) set_superstealth(FALSE);
450 /* Darken the grid */
454 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(g_ptr);
457 /* Turn off the light. */
460 if (current_floor_ptr->dun_level || !is_daytime())
462 for (j = 0; j < 9; j++)
464 int by = y + ddy_ddd[j];
465 int bx = x + ddx_ddd[j];
467 if (in_bounds2(by, bx))
469 grid_type *cc_ptr = ¤t_floor_ptr->grid_array[by][bx];
471 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
482 g_ptr->info &= ~(CAVE_GLOW);
484 /* Hack -- Forget "boring" grids */
485 if (!have_flag(f_ptr->flags, FF_REMEMBER))
488 g_ptr->info &= ~(CAVE_MARK);
495 update_local_illumination(y, x);
497 if (player_can_see_bold(y, x)) obvious = TRUE;
499 /* Mega-Hack -- Update the monster in the affected grid */
500 /* This allows "spear of light" (etc) to work "correctly" */
501 if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE);
511 if (is_mirror_grid(g_ptr))
513 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
516 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
519 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 50))
521 if (known && (g_ptr->info & CAVE_MARK))
523 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
527 /* Destroy the wall */
528 cave_alter_feat(y, x, FF_HURT_ROCK);
530 /* Update some things */
531 p_ptr->update |= (PU_FLOW);
538 if (is_mirror_grid(g_ptr) && p_ptr->lev < 40)
540 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
543 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
546 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 200))
548 if (known && (g_ptr->info & CAVE_MARK))
550 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
554 /* Destroy the wall */
555 cave_alter_feat(y, x, FF_HURT_ROCK);
557 /* Update some things */
558 p_ptr->update |= (PU_FLOW);
563 case GF_DISINTEGRATE:
565 /* Destroy mirror/glyph */
566 if (is_mirror_grid(g_ptr) || is_glyph_grid(g_ptr) || is_explosive_rune_grid(g_ptr))
569 /* Permanent features don't get effect */
570 /* But not protect monsters and other objects */
571 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
573 cave_alter_feat(y, x, FF_HURT_DISI);
575 /* Update some things -- similar to GF_KILL_WALL */
576 p_ptr->update |= (PU_FLOW);
583 /* Return "Anything seen?" */
590 * @brief 汎用的なビーム/ボルト/ボール系によるアイテムオブジェクトへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
591 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
592 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
593 * @param y 目標Y座標 / Target y location (or location to travel "towards")
594 * @param x 目標X座標 / Target x location (or location to travel "towards")
595 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
596 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
597 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
600 * We are called from "project()" to "damage" objects
602 * We are called both for "beam" effects and "ball" effects.
604 * Perhaps we should only SOMETIMES damage things on the ground.
606 * The "r" parameter is the "distance from ground zero".
608 * Note that we determine if the player can "see" anything that happens
609 * by taking into account: blindness, line-of-sight, and illumination.
611 * We also "see" grids which are "memorized", probably a hack
613 * We return "TRUE" if the effect of the projection is "obvious".
616 static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
618 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
620 OBJECT_IDX this_o_idx, next_o_idx = 0;
622 bool obvious = FALSE;
623 bool known = player_has_los_bold(y, x);
625 BIT_FLAGS flgs[TR_FLAG_SIZE];
627 GAME_TEXT o_name[MAX_NLEN];
629 KIND_OBJECT_IDX k_idx = 0;
630 bool is_potion = FALSE;
635 /* Reduce damage by distance */
636 dam = (dam + r) / (r + 1);
639 /* Scan all objects in the grid */
640 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
642 object_type *o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
646 bool do_kill = FALSE;
648 concptr note_kill = NULL;
651 /* Get the "plural"-ness */
652 bool plural = (o_ptr->number > 1);
655 /* Acquire next object */
656 next_o_idx = o_ptr->next_o_idx;
657 object_flags(o_ptr, flgs);
659 /* Check for artifact */
660 if (object_is_artifact(o_ptr)) is_art = TRUE;
662 /* Analyze the type */
665 /* Acid -- Lots of things */
668 if (hates_acid(o_ptr))
671 note_kill = _("融けてしまった!", (plural ? " melt!" : " melts!"));
672 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
677 /* Elec -- Rings and Wands */
680 if (hates_elec(o_ptr))
683 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
684 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
689 /* Fire -- Flammable objects */
692 if (hates_fire(o_ptr))
695 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
696 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
701 /* Cold -- potions and flasks */
704 if (hates_cold(o_ptr))
706 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
708 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
716 if (hates_fire(o_ptr))
719 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
720 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
722 if (hates_elec(o_ptr))
726 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
727 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
735 if (hates_fire(o_ptr))
738 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
739 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
741 if (hates_cold(o_ptr))
745 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
746 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
751 /* Hack -- break potions and such */
757 if (hates_cold(o_ptr))
759 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
765 /* Mana and Chaos -- destroy everything */
771 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
775 case GF_DISINTEGRATE:
778 note_kill = _("蒸発してしまった!", (plural ? " evaporate!" : " evaporates!"));
785 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
786 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
787 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
791 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
795 if (object_is_cursed(o_ptr))
798 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
805 identify_item(o_ptr);
807 /* Auto-inscription */
808 autopick_alter_item((-this_o_idx), FALSE);
816 /* Chests are noticed only if trapped or locked */
817 if (o_ptr->tval == TV_CHEST)
819 /* Disarm/Unlock traps */
822 /* Disarm or Unlock */
823 o_ptr->pval = (0 - o_ptr->pval);
828 if (known && (o_ptr->marked & OM_FOUND))
830 msg_print(_("カチッと音がした!", "Click!"));
840 if (o_ptr->tval == TV_CORPSE)
845 if (!who || is_pet(¤t_floor_ptr->m_list[who]))
846 mode |= PM_FORCE_PET;
848 for (i = 0; i < o_ptr->number ; i++)
850 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
851 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
855 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
859 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
861 note_kill = _("生き返った。", " revived.");
865 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
876 /* Attempt to destroy the object */
879 /* Effect "observed" */
880 if (known && (o_ptr->marked & OM_FOUND))
883 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
886 /* Artifacts, and other objects, get to resist */
887 if (is_art || ignore)
889 /* Observe the resist */
890 if (known && (o_ptr->marked & OM_FOUND))
892 msg_format(_("%sは影響を受けない!",
893 (plural ? "The %s are unaffected!" : "The %s is unaffected!")), o_name);
900 /* Describe if needed */
901 if (known && (o_ptr->marked & OM_FOUND) && note_kill)
903 msg_format(_("%sは%s", "The %s%s"), o_name, note_kill);
906 k_idx = o_ptr->k_idx;
907 is_potion = object_is_potion(o_ptr);
908 delete_object_idx(this_o_idx);
910 /* Potions produce effects when 'shattered' */
913 (void)potion_smash_effect(who, y, x, k_idx);
921 /* Return "Anything seen?" */
927 * @brief 汎用的なビーム/ボルト/ボール系によるモンスターへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
928 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
929 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
930 * @param y 目標Y座標 / Target y location (or location to travel "towards")
931 * @param x 目標X座標 / Target x location (or location to travel "towards")
932 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
933 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
935 * @param see_s_msg TRUEならばメッセージを表示する
936 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
939 * This routine takes a "source monster" (by index) which is mostly used to
940 * determine if the player is causing the damage, and a "radius" (see below),
941 * which is used to decrease the power of explosions with distance, and a
942 * location, via integers which are modified by certain types of attacks
943 * (polymorph and teleport being the obvious ones), a default damage, which
944 * is modified as needed based on various properties, and finally a "damage
948 * Note that this routine can handle "no damage" attacks (like teleport) by
949 * taking a "zero" damage, and can even take "parameters" to attacks (like
950 * confuse) by accepting a "damage", using it to calculate the effect, and
951 * then setting the damage to zero. Note that the "damage" parameter is
952 * divided by the radius, so monsters not at the "epicenter" will not take
953 * as much damage (or whatever)...
956 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
957 * may result in a dereference of an invalid pointer.
960 * Various messages are produced, and damage is applied.
963 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
964 * actually be "made" of that substance, or "breathe" big balls of it.
965 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
967 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
968 * and hurts evil less. If can breath nether, then it resists it as well.
971 * Damage reductions use the following formulas:
972 * Note that "dam = dam * 6 / (randint1(6) + 6);"
973 * gives avg damage of .655, ranging from .858 to .500
974 * Note that "dam = dam * 5 / (randint1(6) + 6);"
975 * gives avg damage of .544, ranging from .714 to .417
976 * Note that "dam = dam * 4 / (randint1(6) + 6);"
977 * gives avg damage of .444, ranging from .556 to .333
978 * Note that "dam = dam * 3 / (randint1(6) + 6);"
979 * gives avg damage of .327, ranging from .427 to .250
980 * Note that "dam = dam * 2 / (randint1(6) + 6);"
981 * gives something simple.
984 * In this function, "result" messages are postponed until the end, where
985 * the "note" string is appended to the monster name, if not NULL. So,
986 * to make a spell have "no effect" just set "note" to NULL. You should
987 * also set "notice" to FALSE, or the player will learn what the spell does.
990 * We attempt to return "TRUE" if the player saw anything "useful" happen.
994 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)
998 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
1000 monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
1001 monster_type *caster_ptr = (who > 0) ? ¤t_floor_ptr->m_list[who] : NULL;
1003 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1007 /* Is the monster "seen"? */
1008 bool seen = m_ptr->ml;
1009 bool seen_msg = is_seen(m_ptr);
1011 bool slept = (bool)MON_CSLEEP(m_ptr);
1013 /* Were the effects "obvious" (if seen)? */
1014 bool obvious = FALSE;
1016 /* Can the player know about this effect? */
1017 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1019 /* Were the effects "irrelevant"? */
1020 bool skipped = FALSE;
1022 /* Gets the monster angry at the source of the effect? */
1023 bool get_angry = FALSE;
1025 /* Polymorph setting (true or false) */
1026 bool do_poly = FALSE;
1028 /* Teleport setting (max distance) */
1031 /* Confusion setting (amount to confuse) */
1034 /* Stunning setting (amount to stun) */
1037 /* Sleep amount (amount to sleep) */
1040 /* Fear amount (amount to fear) */
1043 /* Time amount (amount to time) */
1046 bool heal_leper = FALSE;
1048 /* Hold the monster name */
1049 GAME_TEXT m_name[MAX_NLEN];
1052 PARAMETER_VALUE photo = 0;
1054 /* Assume no note */
1055 concptr note = NULL;
1057 /* Assume a default death */
1058 concptr note_dies = extract_note_dies(real_r_idx(m_ptr));
1060 DEPTH caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1063 if (!g_ptr->m_idx) return (FALSE);
1065 /* Never affect projector */
1066 if (who && (g_ptr->m_idx == who)) return (FALSE);
1067 if ((g_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1068 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1070 /* Don't affect already death monsters */
1071 /* Prevents problems with chain reactions of exploding monsters */
1072 if (m_ptr->hp < 0) return (FALSE);
1074 /* Reduce damage by distance */
1075 dam = (dam + r) / (r + 1);
1078 /* Get the monster name (BEFORE polymorphing) */
1079 monster_desc(m_name, m_ptr, 0);
1081 /* Get the monster possessive ("his"/"her"/"its") */
1082 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1084 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
1086 if (r_ptr->flagsr & RFR_RES_ALL &&
1087 typ != GF_OLD_CLONE && typ != GF_STAR_HEAL && typ != GF_OLD_HEAL
1088 && typ != GF_OLD_SPEED && typ != GF_CAPTURE && typ != GF_PHOTO)
1090 note = _("には完全な耐性がある!", " is immune.");
1092 if(is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1093 if(typ == GF_LITE_WEAK || typ == GF_KILL_WALL) skipped = TRUE;
1097 /* Analyze the damage type */
1100 /* Magic Missile -- pure damage */
1103 if (seen) obvious = TRUE;
1110 if (seen) obvious = TRUE;
1111 if (r_ptr->flagsr & RFR_IM_ACID)
1113 note = _("にはかなり耐性がある!", " resists a lot.");
1115 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1123 if (seen) obvious = TRUE;
1124 if (r_ptr->flagsr & RFR_IM_ELEC)
1126 note = _("にはかなり耐性がある!", " resists a lot.");
1128 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1136 if (seen) obvious = TRUE;
1137 if (r_ptr->flagsr & RFR_IM_FIRE)
1139 note = _("にはかなり耐性がある!", " resists a lot.");
1141 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1143 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1145 note = _("はひどい痛手をうけた。", " is hit hard.");
1147 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1155 if (seen) obvious = TRUE;
1156 if (r_ptr->flagsr & RFR_IM_COLD)
1158 note = _("にはかなり耐性がある!", " resists a lot.");
1160 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1162 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1164 note = _("はひどい痛手をうけた。", " is hit hard.");
1166 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1174 if (seen) obvious = TRUE;
1175 if (r_ptr->flagsr & RFR_IM_POIS)
1177 note = _("にはかなり耐性がある!", " resists a lot.");
1179 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1187 if (seen) obvious = TRUE;
1188 if (r_ptr->flagsr & RFR_IM_POIS)
1190 note = _("には耐性がある。", " resists.");
1191 dam *= 3; dam /= randint1(6) + 6;
1192 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1194 else if (one_in_(3)) do_poly = TRUE;
1198 /* Hellfire -- hurts Evil */
1201 if (seen) obvious = TRUE;
1202 if (r_ptr->flags3 & RF3_GOOD)
1204 note = _("はひどい痛手をうけた。", " is hit hard.");
1206 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1211 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1214 if (seen) obvious = TRUE;
1215 if (r_ptr->flags3 & RF3_EVIL)
1218 note = _("はひどい痛手をうけた。", " is hit hard.");
1219 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
1223 note = _("には耐性がある。", " resists.");
1224 dam *= 3; dam /= randint1(6) + 6;
1229 /* Arrow -- XXX no defense */
1232 if (seen) obvious = TRUE;
1236 /* Plasma -- XXX perhaps check ELEC or FIRE */
1239 if (seen) obvious = TRUE;
1240 if (r_ptr->flagsr & RFR_RES_PLAS)
1242 note = _("には耐性がある。", " resists.");
1243 dam *= 3; dam /= randint1(6) + 6;
1244 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
1249 /* Nether -- see above */
1252 if (seen) obvious = TRUE;
1253 if (r_ptr->flagsr & RFR_RES_NETH)
1255 if (r_ptr->flags3 & RF3_UNDEAD)
1257 note = _("には完全な耐性がある!", " is immune.");
1259 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
1263 note = _("には耐性がある。", " resists.");
1264 dam *= 3; dam /= randint1(6) + 6;
1266 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
1268 else if (r_ptr->flags3 & RF3_EVIL)
1270 note = _("はいくらか耐性を示した。", " resists somewhat.");
1272 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
1277 /* Water (acid) damage -- Water spirits/elementals are immune */
1280 if (seen) obvious = TRUE;
1281 if (r_ptr->flagsr & RFR_RES_WATE)
1283 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
1285 note = _("には完全な耐性がある!", " is immune.");
1290 note = _("には耐性がある。", " resists.");
1291 dam *= 3; dam /= randint1(6) + 6;
1293 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
1298 /* Chaos -- Chaos breathers resist */
1301 if (seen) obvious = TRUE;
1302 if (r_ptr->flagsr & RFR_RES_CHAO)
1304 note = _("には耐性がある。", " resists.");
1305 dam *= 3; dam /= randint1(6) + 6;
1306 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
1308 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
1310 note = _("はいくらか耐性を示した。", " resists somewhat.");
1311 dam *= 3; dam /= randint1(6) + 6;
1312 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
1317 do_conf = (5 + randint1(11) + r) / (r + 1);
1322 /* Shards -- Shard breathers resist */
1325 if (seen) obvious = TRUE;
1326 if (r_ptr->flagsr & RFR_RES_SHAR)
1328 note = _("には耐性がある。", " resists.");
1329 dam *= 3; dam /= randint1(6) + 6;
1330 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1335 /* Rocket: Shard resistance helps */
1338 if (seen) obvious = TRUE;
1339 if (r_ptr->flagsr & RFR_RES_SHAR)
1341 note = _("はいくらか耐性を示した。", " resists somewhat.");
1343 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1349 /* Sound -- Sound breathers resist */
1352 if (seen) obvious = TRUE;
1353 if (r_ptr->flagsr & RFR_RES_SOUN)
1355 note = _("には耐性がある。", " resists.");
1356 dam *= 2; dam /= randint1(6) + 6;
1357 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
1359 else do_stun = (10 + randint1(15) + r) / (r + 1);
1366 if (seen) obvious = TRUE;
1367 if (r_ptr->flags3 & RF3_NO_CONF)
1369 note = _("には耐性がある。", " resists.");
1370 dam *= 3; dam /= randint1(6) + 6;
1371 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1373 else do_conf = (10 + randint1(15) + r) / (r + 1);
1377 /* Disenchantment -- Breathers and Disenchanters resist */
1380 if (seen) obvious = TRUE;
1381 if (r_ptr->flagsr & RFR_RES_DISE)
1383 note = _("には耐性がある。", " resists.");
1384 dam *= 3; dam /= randint1(6) + 6;
1385 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
1390 /* Nexus -- Breathers and Existers resist */
1393 if (seen) obvious = TRUE;
1394 if (r_ptr->flagsr & RFR_RES_NEXU)
1396 note = _("には耐性がある。", " resists.");
1397 dam *= 3; dam /= randint1(6) + 6;
1398 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
1406 if (seen) obvious = TRUE;
1407 if (r_ptr->flagsr & RFR_RES_WALL)
1409 note = _("には耐性がある。", " resists.");
1410 dam *= 3; dam /= randint1(6) + 6;
1411 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
1413 else do_stun = (randint1(15) + r) / (r + 1);
1417 /* Inertia -- breathers resist */
1420 if (seen) obvious = TRUE;
1421 if (r_ptr->flagsr & RFR_RES_INER)
1423 note = _("には耐性がある。", " resists.");
1424 dam *= 3; dam /= randint1(6) + 6;
1425 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
1429 /* Powerful monsters can resist */
1430 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1431 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1435 /* Normal monsters slow down */
1438 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1440 note = _("の動きが遅くなった。", " starts moving slower.");
1447 /* Time -- breathers resist */
1450 if (seen) obvious = TRUE;
1451 if (r_ptr->flagsr & RFR_RES_TIME)
1453 note = _("には耐性がある。", " resists.");
1454 dam *= 3; dam /= randint1(6) + 6;
1455 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
1457 else do_time = (dam + 1) / 2;
1461 /* Gravity -- breathers resist */
1464 bool resist_tele = FALSE;
1466 if (seen) obvious = TRUE;
1467 if (r_ptr->flagsr & RFR_RES_TELE)
1469 if (r_ptr->flags1 & (RF1_UNIQUE))
1471 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1472 note = _("には効果がなかった。", " is unaffected!");
1475 else if (r_ptr->level > randint1(100))
1477 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1478 note = _("には耐性がある!", " resists!");
1483 if (!resist_tele) do_dist = 10;
1485 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1487 if (r_ptr->flagsr & RFR_RES_GRAV)
1489 note = _("には耐性がある!", " resists!");
1490 dam *= 3; dam /= randint1(6) + 6;
1492 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
1497 /* Powerful monsters can resist */
1498 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1499 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1503 /* Normal monsters slow down */
1506 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1508 note = _("の動きが遅くなった。", " starts moving slower.");
1513 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
1515 /* Attempt a saving throw */
1516 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1517 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1521 /* No obvious effect */
1522 note = _("には効果がなかった。", " is unaffected!");
1534 if (seen) obvious = TRUE;
1540 case GF_DISINTEGRATE:
1542 if (seen) obvious = TRUE;
1543 if (r_ptr->flags3 & RF3_HURT_ROCK)
1545 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
1546 note = _("の皮膚がただれた!", " loses some skin!");
1547 note_dies = _("は蒸発した!", " evaporates!");
1555 if (seen) obvious = TRUE;
1557 /* PSI only works if the monster can see you! -- RG */
1558 if (!(los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)))
1561 msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), m_name);
1565 if (r_ptr->flags2 & RF2_EMPTY_MIND)
1568 note = _("には完全な耐性がある!", " is immune.");
1569 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1572 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
1573 (r_ptr->flags3 & RF3_ANIMAL) ||
1574 (r_ptr->level > randint1(3 * dam)))
1576 note = _("には耐性がある!", " resists!");
1580 * Powerful demons & undead can current_world_ptr->game_turn a mindcrafter's
1581 * attacks back on them
1583 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1584 (r_ptr->level > p_ptr->lev / 2) &&
1588 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1589 (seen ? "%^s's corrupted mind backlashes your attack!" :
1590 "%^ss corrupted mind backlashes your attack!")), m_name);
1593 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
1595 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1599 /* Injure +/- confusion */
1600 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
1601 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1602 if (one_in_(4) && !CHECK_MULTISHADOW())
1604 switch (randint1(4))
1607 set_confused(p_ptr->confused + 3 + randint1(dam));
1610 set_stun(p_ptr->stun + randint1(dam));
1614 if (r_ptr->flags3 & RF3_NO_FEAR)
1615 note = _("には効果がなかった。", " is unaffected.");
1617 set_afraid(p_ptr->afraid + 3 + randint1(dam));
1621 if (!p_ptr->free_act)
1622 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
1631 if ((dam > 0) && one_in_(4))
1633 switch (randint1(4))
1636 do_conf = 3 + randint1(dam);
1639 do_stun = 3 + randint1(dam);
1642 do_fear = 3 + randint1(dam);
1645 note = _("は眠り込んでしまった!", " falls asleep!");
1646 do_sleep = 3 + randint1(dam);
1651 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1657 if (seen) obvious = TRUE;
1658 if (r_ptr->flags2 & RF2_EMPTY_MIND)
1661 note = _("には完全な耐性がある!", " is immune.");
1663 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
1664 (r_ptr->flags3 & RF3_ANIMAL) ||
1665 (r_ptr->level > randint1(3 * dam)))
1667 note = _("には耐性がある!", " resists!");
1671 * Powerful demons & undead can current_world_ptr->game_turn a mindcrafter's
1672 * attacks back on them
1674 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1675 (r_ptr->level > p_ptr->lev / 2) &&
1679 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1680 (seen ? "%^s's corrupted mind backlashes your attack!" :
1681 "%^ss corrupted mind backlashes your attack!")), m_name);
1683 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
1685 msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
1689 /* Injure + mana drain */
1690 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
1691 if (!CHECK_MULTISHADOW())
1693 msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
1694 p_ptr->csp -= damroll(5, dam) / 2;
1695 if (p_ptr->csp < 0) p_ptr->csp = 0;
1696 p_ptr->redraw |= PR_MANA;
1697 p_ptr->window |= (PW_SPELL);
1699 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1706 int b = damroll(5, dam) / 4;
1707 concptr str = (p_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
1708 concptr msg = _("あなたは%sの苦痛を%sに変換した!",
1709 (seen ? "You convert %s's pain into %s!" :
1710 "You convert %ss pain into %s!"));
1711 msg_format(msg, m_name, str);
1713 b = MIN(p_ptr->msp, p_ptr->csp + b);
1715 p_ptr->redraw |= PR_MANA;
1716 p_ptr->window |= (PW_SPELL);
1718 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1722 case GF_TELEKINESIS:
1724 if (seen) obvious = TRUE;
1727 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1732 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
1734 /* Attempt a saving throw */
1735 if ((r_ptr->flags1 & RF1_UNIQUE) ||
1736 (r_ptr->level > 5 + randint1(dam)))
1740 /* No obvious effect */
1746 /* Psycho-spear -- powerful magic missile */
1749 if (seen) obvious = TRUE;
1753 /* Meteor -- powerful magic missile */
1756 if (seen) obvious = TRUE;
1762 if (!is_hostile(m_ptr)) break;
1763 if (seen) obvious = TRUE;
1764 /* Attempt a saving throw */
1765 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
1766 (r_ptr->flags3 & RF3_NO_CONF) ||
1767 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1769 /* Memorize a flag */
1770 if (r_ptr->flags3 & RF3_NO_CONF)
1772 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1779 * Powerful demons & undead can current_world_ptr->game_turn a mindcrafter's
1780 * attacks back on them
1782 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1783 (r_ptr->level > p_ptr->lev / 2) &&
1787 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1788 (seen ? "%^s's corrupted mind backlashes your attack!" :
1789 "%^ss corrupted mind backlashes your attack!")), m_name);
1792 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
1794 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1798 /* Confuse, stun, terrify */
1799 switch (randint1(4))
1802 set_stun(p_ptr->stun + dam / 2);
1805 set_confused(p_ptr->confused + dam / 2);
1809 if (r_ptr->flags3 & RF3_NO_FEAR)
1810 note = _("には効果がなかった。", " is unaffected.");
1812 set_afraid(p_ptr->afraid + dam);
1819 /* No obvious effect */
1820 note = _("には効果がなかった。", " is unaffected.");
1826 if (!common_saving_throw_charm(p_ptr, dam, m_ptr))
1828 note = _("があなたに隷属した。", " is in your thrall!");
1833 switch (randint1(4))
1847 /* No "real" damage */
1852 /* Ice -- Cold + Cuts + Stun */
1855 if (seen) obvious = TRUE;
1856 do_stun = (randint1(15) + 1) / (r + 1);
1857 if (r_ptr->flagsr & RFR_IM_COLD)
1859 note = _("にはかなり耐性がある!", " resists a lot.");
1861 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1863 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1865 note = _("はひどい痛手をうけた。", " is hit hard.");
1867 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1874 case GF_HYPODYNAMIA:
1876 if (seen) obvious = TRUE;
1877 if (!monster_living(m_ptr->r_idx))
1879 if (is_original_ap_and_seen(m_ptr))
1881 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
1882 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
1883 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
1885 note = _("には効果がなかった。", " is unaffected.");
1889 else do_time = (dam+7)/8;
1897 if (seen) obvious = TRUE;
1898 if (!monster_living(m_ptr->r_idx))
1900 if (is_original_ap_and_seen(m_ptr))
1902 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
1903 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
1904 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
1906 note = _("には完全な耐性がある!", " is immune.");
1910 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
1911 (randint1(888) != 666)) ||
1912 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
1913 randint1(100) != 66))
1915 note = _("には耐性がある!", " resists!");
1923 /* Polymorph monster (Use "dam" as "power") */
1926 if (seen) obvious = TRUE;
1927 /* Attempt to polymorph (see below) */
1930 /* Powerful monsters can resist */
1931 if ((r_ptr->flags1 & RF1_UNIQUE) ||
1932 (r_ptr->flags1 & RF1_QUESTOR) ||
1933 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1935 note = _("には効果がなかった。", " is unaffected.");
1940 /* No "real" damage */
1947 /* Clone monsters (Ignore "dam") */
1950 if (seen) obvious = TRUE;
1952 if ((p_ptr->inside_arena) || is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
1954 note = _("には効果がなかった。", " is unaffected.");
1959 m_ptr->hp = m_ptr->maxhp;
1961 /* Attempt to clone. */
1962 if (multiply_monster(g_ptr->m_idx, TRUE, 0L))
1964 note = _("が分裂した!", " spawns!");
1968 /* No "real" damage */
1975 /* Heal Monster (use "dam" as amount of healing) */
1978 if (seen) obvious = TRUE;
1981 (void)set_monster_csleep(g_ptr->m_idx, 0);
1983 if (m_ptr->maxhp < m_ptr->max_maxhp)
1985 if (seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), m_name, m_poss);
1986 m_ptr->maxhp = m_ptr->max_maxhp;
1991 /* Redraw (later) if needed */
1992 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
1993 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2001 if (seen) obvious = TRUE;
2004 (void)set_monster_csleep(g_ptr->m_idx, 0);
2005 if (MON_STUNNED(m_ptr))
2007 if (seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), m_name);
2008 (void)set_monster_stunned(g_ptr->m_idx, 0);
2010 if (MON_CONFUSED(m_ptr))
2012 if (seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), m_name);
2013 (void)set_monster_confused(g_ptr->m_idx, 0);
2015 if (MON_MONFEAR(m_ptr))
2017 if (seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name);
2018 (void)set_monster_monfear(g_ptr->m_idx, 0);
2022 if (m_ptr->hp < 30000) m_ptr->hp += dam;
2025 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2029 chg_virtue(V_VITALITY, 1);
2031 if (r_ptr->flags1 & RF1_UNIQUE)
2032 chg_virtue(V_INDIVIDUALISM, 1);
2034 if (is_friendly(m_ptr))
2035 chg_virtue(V_HONOUR, 1);
2036 else if (!(r_ptr->flags3 & RF3_EVIL))
2038 if (r_ptr->flags3 & RF3_GOOD)
2039 chg_virtue(V_COMPASSION, 2);
2041 chg_virtue(V_COMPASSION, 1);
2044 if (r_ptr->flags3 & RF3_ANIMAL)
2045 chg_virtue(V_NATURE, 1);
2048 if (m_ptr->r_idx == MON_LEPER)
2051 if (!who) chg_virtue(V_COMPASSION, 5);
2054 /* Redraw (later) if needed */
2055 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2056 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2058 note = _("は体力を回復したようだ。", " looks healthier.");
2060 /* No "real" damage */
2066 /* Speed Monster (Ignore "dam") */
2069 if (seen) obvious = TRUE;
2072 if (set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100))
2074 note = _("の動きが速くなった。", " starts moving faster.");
2079 if (r_ptr->flags1 & RF1_UNIQUE)
2080 chg_virtue(V_INDIVIDUALISM, 1);
2081 if (is_friendly(m_ptr))
2082 chg_virtue(V_HONOUR, 1);
2085 /* No "real" damage */
2091 /* Slow Monster (Use "dam" as "power") */
2094 if (seen) obvious = TRUE;
2096 /* Powerful monsters can resist */
2097 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2098 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2100 note = _("には効果がなかった。", " is unaffected.");
2104 /* Normal monsters slow down */
2107 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2109 note = _("の動きが遅くなった。", " starts moving slower.");
2113 /* No "real" damage */
2119 /* Sleep (Use "dam" as "power") */
2122 if (seen) obvious = TRUE;
2124 /* Attempt a saving throw */
2125 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2126 (r_ptr->flags3 & RF3_NO_SLEEP) ||
2127 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2129 /* Memorize a flag */
2130 if (r_ptr->flags3 & RF3_NO_SLEEP)
2132 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
2134 /* No obvious effect */
2135 note = _("には効果がなかった。", " is unaffected.");
2140 /* Go to sleep (much) later */
2141 note = _("は眠り込んでしまった!", " falls asleep!");
2145 /* No "real" damage */
2151 /* Sleep (Use "dam" as "power") */
2152 case GF_STASIS_EVIL:
2154 if (seen) obvious = TRUE;
2156 /* Attempt a saving throw */
2157 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2158 !(r_ptr->flags3 & RF3_EVIL) ||
2159 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2161 note = _("には効果がなかった。", " is unaffected.");
2166 /* Go to sleep (much) later */
2167 note = _("は動けなくなった!", " is suspended!");
2171 /* No "real" damage */
2176 /* Sleep (Use "dam" as "power") */
2179 if (seen) obvious = TRUE;
2181 /* Attempt a saving throw */
2182 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2183 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2185 note = _("には効果がなかった。", " is unaffected.");
2190 /* Go to sleep (much) later */
2191 note = _("は動けなくなった!", " is suspended!");
2195 /* No "real" damage */
2204 vir = virtue_number(V_HARMONY);
2207 dam += p_ptr->virtues[vir-1]/10;
2210 vir = virtue_number(V_INDIVIDUALISM);
2213 dam -= p_ptr->virtues[vir-1]/20;
2216 if (seen) obvious = TRUE;
2218 /* Attempt a saving throw */
2219 if (common_saving_throw_charm(p_ptr, dam, m_ptr))
2223 /* No obvious effect */
2224 note = _("には効果がなかった。", " is unaffected.");
2227 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2229 else if (p_ptr->cursed & TRC_AGGRAVATE)
2231 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2232 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2236 note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
2239 chg_virtue(V_INDIVIDUALISM, -1);
2240 if (r_ptr->flags3 & RF3_ANIMAL)
2241 chg_virtue(V_NATURE, 1);
2244 /* No "real" damage */
2249 /* Control undead */
2250 case GF_CONTROL_UNDEAD:
2253 if (seen) obvious = TRUE;
2255 vir = virtue_number(V_UNLIFE);
2258 dam += p_ptr->virtues[vir-1]/10;
2261 vir = virtue_number(V_INDIVIDUALISM);
2264 dam -= p_ptr->virtues[vir-1]/20;
2267 /* Attempt a saving throw */
2268 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2269 !(r_ptr->flags3 & RF3_UNDEAD))
2271 /* No obvious effect */
2272 note = _("には効果がなかった。", " is unaffected.");
2274 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2276 else if (p_ptr->cursed & TRC_AGGRAVATE)
2278 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2279 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2283 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2287 /* No "real" damage */
2293 case GF_CONTROL_DEMON:
2296 if (seen) obvious = TRUE;
2298 vir = virtue_number(V_UNLIFE);
2301 dam += p_ptr->virtues[vir-1]/10;
2304 vir = virtue_number(V_INDIVIDUALISM);
2307 dam -= p_ptr->virtues[vir-1]/20;
2310 /* Attempt a saving throw */
2311 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2312 !(r_ptr->flags3 & RF3_DEMON))
2314 /* No obvious effect */
2315 note = _("には効果がなかった。", " is unaffected.");
2317 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2319 else if (p_ptr->cursed & TRC_AGGRAVATE)
2321 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2322 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2326 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2330 /* No "real" damage */
2336 case GF_CONTROL_ANIMAL:
2339 if (seen) obvious = TRUE;
2341 vir = virtue_number(V_NATURE);
2344 dam += p_ptr->virtues[vir-1]/10;
2347 vir = virtue_number(V_INDIVIDUALISM);
2350 dam -= p_ptr->virtues[vir-1]/20;
2353 /* Attempt a saving throw */
2354 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2355 !(r_ptr->flags3 & RF3_ANIMAL))
2358 /* No obvious effect */
2359 note = _("には効果がなかった。", " is unaffected.");
2361 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2363 else if (p_ptr->cursed & TRC_AGGRAVATE)
2365 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2366 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2370 note = _("はなついた。", " is tamed!");
2372 if (r_ptr->flags3 & RF3_ANIMAL)
2373 chg_virtue(V_NATURE, 1);
2376 /* No "real" damage */
2382 case GF_CHARM_LIVING:
2386 vir = virtue_number(V_UNLIFE);
2387 if (seen) obvious = TRUE;
2389 vir = virtue_number(V_UNLIFE);
2392 dam -= p_ptr->virtues[vir-1]/10;
2395 vir = virtue_number(V_INDIVIDUALISM);
2398 dam -= p_ptr->virtues[vir-1]/20;
2401 msg_format(_("%sを見つめた。", "You stare into %s."), m_name);
2403 /* Attempt a saving throw */
2404 if (common_saving_throw_charm(p_ptr, dam, m_ptr) ||
2405 !monster_living(m_ptr->r_idx))
2408 /* No obvious effect */
2409 note = _("には効果がなかった。", " is unaffected.");
2411 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2413 else if (p_ptr->cursed & TRC_AGGRAVATE)
2415 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2416 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2420 note = _("を支配した。", " is tamed!");
2422 if (r_ptr->flags3 & RF3_ANIMAL)
2423 chg_virtue(V_NATURE, 1);
2426 /* No "real" damage */
2431 /* Confusion (Use "dam" as "power") */
2434 if (seen) obvious = TRUE;
2436 /* Get confused later */
2437 do_conf = damroll(3, (dam / 2)) + 1;
2439 /* Attempt a saving throw */
2440 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2441 (r_ptr->flags3 & (RF3_NO_CONF)) ||
2442 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2444 /* Memorize a flag */
2445 if (r_ptr->flags3 & (RF3_NO_CONF))
2447 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2453 /* No obvious effect */
2454 note = _("には効果がなかった。", " is unaffected.");
2458 /* No "real" damage */
2465 if (seen) obvious = TRUE;
2467 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2469 /* Attempt a saving throw */
2470 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2471 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2476 /* No obvious effect */
2477 note = _("には効果がなかった。", " is unaffected.");
2481 /* No "real" damage */
2486 /* Lite, but only hurts susceptible creatures */
2495 if (r_ptr->flags3 & (RF3_HURT_LITE))
2497 /* Obvious effect */
2498 if (seen) obvious = TRUE;
2500 /* Memorize the effects */
2501 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
2503 /* Special effect */
2504 note = _("は光に身をすくめた!", " cringes from the light!");
2505 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
2508 /* Normally no damage */
2520 /* Lite -- opposite of Dark */
2523 if (seen) obvious = TRUE;
2525 if (r_ptr->flagsr & RFR_RES_LITE)
2527 note = _("には耐性がある!", " resists!");
2528 dam *= 2; dam /= (randint1(6)+6);
2529 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
2531 else if (r_ptr->flags3 & (RF3_HURT_LITE))
2533 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
2534 note = _("は光に身をすくめた!", " cringes from the light!");
2535 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
2542 /* Dark -- opposite of Lite */
2545 if (seen) obvious = TRUE;
2547 if (r_ptr->flagsr & RFR_RES_DARK)
2549 note = _("には耐性がある!", " resists!");
2550 dam *= 2; dam /= (randint1(6)+6);
2551 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
2560 /* Hurt by rock remover */
2561 if (r_ptr->flags3 & (RF3_HURT_ROCK))
2564 if (seen) obvious = TRUE;
2566 /* Memorize the effects */
2567 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2569 /* Cute little message */
2570 note = _("の皮膚がただれた!", " loses some skin!");
2571 note_dies = _("はドロドロに溶けた!", " dissolves!");
2574 /* Usually, ignore the effects */
2585 /* Teleport undead (Use "dam" as "power") */
2586 case GF_AWAY_UNDEAD:
2588 /* Only affect undead */
2589 if (r_ptr->flags3 & (RF3_UNDEAD))
2591 bool resists_tele = FALSE;
2593 if (r_ptr->flagsr & RFR_RES_TELE)
2595 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2597 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2598 note = _("には効果がなかった。", " is unaffected.");
2599 resists_tele = TRUE;
2601 else if (r_ptr->level > randint1(100))
2603 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2604 note = _("には耐性がある!", " resists!");
2605 resists_tele = TRUE;
2611 if (seen) obvious = TRUE;
2612 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2624 /* No "real" damage */
2630 /* Teleport evil (Use "dam" as "power") */
2633 /* Only affect evil */
2634 if (r_ptr->flags3 & (RF3_EVIL))
2636 bool resists_tele = FALSE;
2638 if (r_ptr->flagsr & RFR_RES_TELE)
2640 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2642 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2643 note = _("には効果がなかった。", " is unaffected.");
2644 resists_tele = TRUE;
2646 else if (r_ptr->level > randint1(100))
2648 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2649 note = _("には耐性がある!", " resists!");
2650 resists_tele = TRUE;
2656 if (seen) obvious = TRUE;
2657 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2669 /* No "real" damage */
2675 /* Teleport monster (Use "dam" as "power") */
2678 bool resists_tele = FALSE;
2679 if (r_ptr->flagsr & RFR_RES_TELE)
2681 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2683 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2684 note = _("には効果がなかった。", " is unaffected.");
2685 resists_tele = TRUE;
2687 else if (r_ptr->level > randint1(100))
2689 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2690 note = _("には耐性がある!", " resists!");
2691 resists_tele = TRUE;
2697 if (seen) obvious = TRUE;
2699 /* Prepare to teleport */
2703 /* No "real" damage */
2709 /* Turn undead (Use "dam" as "power") */
2710 case GF_TURN_UNDEAD:
2712 /* Only affect undead */
2713 if (r_ptr->flags3 & (RF3_UNDEAD))
2715 if (seen) obvious = TRUE;
2717 /* Learn about type */
2718 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2720 /* Apply some fear */
2721 do_fear = damroll(3, (dam / 2)) + 1;
2723 /* Attempt a saving throw */
2724 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
2726 /* No obvious effect */
2727 note = _("には効果がなかった。", " is unaffected.");
2740 /* No "real" damage */
2746 /* Turn evil (Use "dam" as "power") */
2749 /* Only affect evil */
2750 if (r_ptr->flags3 & (RF3_EVIL))
2752 if (seen) obvious = TRUE;
2754 /* Learn about type */
2755 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2757 /* Apply some fear */
2758 do_fear = damroll(3, (dam / 2)) + 1;
2760 /* Attempt a saving throw */
2761 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
2763 /* No obvious effect */
2764 note = _("には効果がなかった。", " is unaffected.");
2777 /* No "real" damage */
2783 /* Turn monster (Use "dam" as "power") */
2786 if (seen) obvious = TRUE;
2788 /* Apply some fear */
2789 do_fear = damroll(3, (dam / 2)) + 1;
2791 /* Attempt a saving throw */
2792 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2793 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
2794 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2796 /* No obvious effect */
2797 note = _("には効果がなかった。", " is unaffected.");
2802 /* No "real" damage */
2809 case GF_DISP_UNDEAD:
2811 /* Only affect undead */
2812 if (r_ptr->flags3 & (RF3_UNDEAD))
2814 if (seen) obvious = TRUE;
2816 /* Learn about type */
2817 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2819 note = _("は身震いした。", " shudders.");
2820 note_dies = _("はドロドロに溶けた!", " dissolves!");
2840 /* Only affect evil */
2841 if (r_ptr->flags3 & (RF3_EVIL))
2843 if (seen) obvious = TRUE;
2845 /* Learn about type */
2846 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2848 note = _("は身震いした。", " shudders.");
2849 note_dies = _("はドロドロに溶けた!", " dissolves!");
2868 /* Only affect good */
2869 if (r_ptr->flags3 & (RF3_GOOD))
2871 if (seen) obvious = TRUE;
2873 /* Learn about type */
2874 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
2876 note = _("は身震いした。", " shudders.");
2877 note_dies = _("はドロドロに溶けた!", " dissolves!");
2894 case GF_DISP_LIVING:
2896 /* Only affect non-undead */
2897 if (monster_living(m_ptr->r_idx))
2899 if (seen) obvious = TRUE;
2901 note = _("は身震いした。", " shudders.");
2902 note_dies = _("はドロドロに溶けた!", " dissolves!");
2921 /* Only affect demons */
2922 if (r_ptr->flags3 & (RF3_DEMON))
2924 if (seen) obvious = TRUE;
2926 /* Learn about type */
2927 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2929 note = _("は身震いした。", " shudders.");
2930 note_dies = _("はドロドロに溶けた!", " dissolves!");
2946 /* Dispel monster */
2949 if (seen) obvious = TRUE;
2950 note = _("は身震いした。", " shudders.");
2951 note_dies = _("はドロドロに溶けた!", " dissolves!");
2958 if (seen) obvious = TRUE;
2959 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->a_ability_flags1 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->a_ability_flags2 & ~(RF6_NOMAGIC_MASK)))
2963 /* Heal the monster */
2964 if (caster_ptr->hp < caster_ptr->maxhp)
2967 caster_ptr->hp += dam;
2968 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
2970 /* Redraw (later) if needed */
2971 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
2972 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
2974 /* Special message */
2977 monster_desc(killer, caster_ptr, 0);
2978 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), killer);
2984 msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), m_name);
2985 (void)hp_player(dam);
2990 if (see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
2999 if (seen) obvious = TRUE;
3000 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3001 /* Attempt a saving throw */
3002 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3003 (r_ptr->flags3 & RF3_NO_CONF) ||
3004 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3006 /* Memorize a flag */
3007 if (r_ptr->flags3 & (RF3_NO_CONF))
3009 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3011 note = _("には効果がなかった。", " is unaffected.");
3014 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3016 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3017 note = _("には完全な耐性がある!", " is immune.");
3020 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3022 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3023 note = _("には耐性がある。", " resists.");
3028 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3029 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3031 if (who > 0) do_conf = randint0(4) + 4;
3032 else do_conf = randint0(8) + 8;
3038 case GF_BRAIN_SMASH:
3040 if (seen) obvious = TRUE;
3041 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3043 /* Attempt a saving throw */
3044 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3045 (r_ptr->flags3 & RF3_NO_CONF) ||
3046 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3048 /* Memorize a flag */
3049 if (r_ptr->flags3 & (RF3_NO_CONF))
3051 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3053 note = _("には効果がなかった。", " is unaffected.");
3056 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3058 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3059 note = _("には完全な耐性がある!", " is immune.");
3062 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3064 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3065 note = _("には耐性がある!", " resists!");
3070 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3071 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3075 do_conf = randint0(4) + 4;
3076 do_stun = randint0(4) + 4;
3080 do_conf = randint0(8) + 8;
3081 do_stun = randint0(8) + 8;
3083 (void)set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 10);
3091 if (seen) obvious = TRUE;
3092 if (!who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), m_name);
3093 /* Attempt a saving throw */
3094 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3096 note = _("には効果がなかった。", " is unaffected.");
3105 if (seen) obvious = TRUE;
3106 if (!who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), m_name);
3107 /* Attempt a saving throw */
3108 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3110 note = _("には効果がなかった。", " is unaffected.");
3119 if (seen) obvious = TRUE;
3120 if (!who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), m_name);
3121 /* Attempt a saving throw */
3122 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3124 note = _("には効果がなかった。", " is unaffected.");
3133 if (seen) obvious = TRUE;
3135 msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
3136 "You point at %s, screaming the word, 'DIE!'."), m_name);
3137 /* Attempt a saving throw */
3138 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
3140 note = _("には効果がなかった。", " is unaffected.");
3149 if (seen) obvious = TRUE;
3150 if (r_ptr->flags1 & RF1_UNIQUE)
3152 note = _("には効果がなかった。", " is unaffected.");
3157 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
3158 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
3160 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
3162 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
3166 note = _("は耐性を持っている!", "resists!");
3173 /* Capture monster */
3177 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
3178 (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)
3180 msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3185 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
3186 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(m_ptr->r_idx))
3187 nokori_hp = m_ptr->maxhp * 3 / 10;
3189 nokori_hp = m_ptr->maxhp * 3 / 20;
3191 if (m_ptr->hp >= nokori_hp)
3193 msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), m_name);
3196 else if (m_ptr->hp < randint0(nokori_hp))
3198 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(g_ptr->m_idx, FALSE, MON_CHAMELEON);
3199 msg_format(_("%sを捕えた!", "You capture %^s!"), m_name);
3200 cap_mon = m_ptr->r_idx;
3201 cap_mspeed = m_ptr->mspeed;
3203 cap_maxhp = m_ptr->max_maxhp;
3204 cap_nickname = m_ptr->nickname; /* Quark transfer */
3205 if (g_ptr->m_idx == p_ptr->riding)
3207 if (rakuba(-1, FALSE))
3209 msg_format(_("地面に落とされた。", "You have fallen from %s."), m_name);
3213 delete_monster_idx(g_ptr->m_idx);
3219 msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), m_name);
3225 /* Attack (Use "dam" as attack type) */
3228 /* Return this monster's death */
3229 return py_attack(y, x, dam);
3232 /* Sleep (Use "dam" as "power") */
3238 if (seen) obvious = TRUE;
3239 if (r_ptr->flags2 & RF2_EMPTY_MIND)
3241 note = _("には効果がなかった。", " is unaffected.");
3244 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3247 if (MON_CSLEEP(m_ptr))
3249 note = _("には効果がなかった。", " is unaffected.");
3255 if (one_in_(5)) effect = 1;
3256 else if (one_in_(4)) effect = 2;
3257 else if (one_in_(3)) effect = 3;
3262 /* Powerful monsters can resist */
3263 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3264 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3266 note = _("には効果がなかった。", " is unaffected.");
3270 /* Normal monsters slow down */
3273 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
3275 note = _("の動きが遅くなった。", " starts moving slower.");
3280 else if (effect == 2)
3282 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
3284 /* Attempt a saving throw */
3285 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3286 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3291 /* No obvious effect */
3292 note = _("には効果がなかった。", " is unaffected.");
3297 else if (effect == 3)
3299 /* Attempt a saving throw */
3300 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3301 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3302 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3304 /* Memorize a flag */
3305 if (r_ptr->flags3 & RF3_NO_SLEEP)
3307 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3310 /* No obvious effect */
3311 note = _("には効果がなかった。", " is unaffected.");
3316 /* Go to sleep (much) later */
3317 note = _("は眠り込んでしまった!", " falls asleep!");
3324 note = _("には効果がなかった。", " is unaffected.");
3327 /* No "real" damage */
3335 if (seen) obvious = TRUE;
3336 if (genocide_aux(g_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
3338 if (seen_msg) msg_format(_("%sは消滅した!", "%^s disappered!"), m_name);
3339 chg_virtue(V_VITALITY, -1);
3349 if (!who) msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), m_name);
3351 if (r_ptr->flags3 & (RF3_HURT_LITE))
3353 /* Obvious effect */
3354 if (seen) obvious = TRUE;
3356 /* Memorize the effects */
3357 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3359 /* Special effect */
3360 note = _("は光に身をすくめた!", " cringes from the light!");
3361 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3364 /* Normally no damage */
3371 photo = m_ptr->r_idx;
3378 case GF_BLOOD_CURSE:
3380 if (seen) obvious = TRUE;
3386 bool success = FALSE;
3387 if (seen) obvious = TRUE;
3389 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
3391 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
3392 if (dam < 1) dam = 1;
3394 /* No need to tame your pet */
3397 note = _("の動きが速くなった。", " starts moving faster.");
3398 (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100);
3402 /* Attempt a saving throw */
3403 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3404 (r_ptr->flags1 & (RF1_UNIQUE)) ||
3405 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3406 (p_ptr->cursed & TRC_AGGRAVATE) ||
3407 ((r_ptr->level+10) > randint1(dam)))
3410 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3414 note = _("を支配した。", " is tamed!");
3416 (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100);
3418 /* Learn about type */
3419 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
3426 if (!(r_ptr->flags3 & RF3_NO_FEAR))
3428 do_fear = randint1(90)+10;
3430 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
3433 /* No "real" damage */
3440 if (seen) obvious = TRUE;
3441 /* Attempt a saving throw */
3442 if (randint0(100 + dam) < (r_ptr->level + 50))
3444 note = _("には効果がなかった。", " is unaffected.");
3464 /* Absolutely no effect */
3465 if (skipped) return (FALSE);
3467 /* "Unique" monsters cannot be polymorphed */
3468 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
3470 /* Quest monsters cannot be polymorphed */
3471 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
3473 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
3475 /* "Unique" and "quest" monsters can only be "killed" by the player. */
3476 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
3478 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
3483 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
3484 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
3487 /* Modify the damage */
3489 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
3490 if ((tmp > 0) && (dam == 0)) note = _("はダメージを受けていない。", " is unharmed.");
3492 /* Check for death */
3493 if (dam > m_ptr->hp)
3495 /* Extract method of death */
3500 /* Sound and Impact resisters never stun */
3502 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
3503 !(r_ptr->flags3 & RF3_NO_STUN))
3505 if (seen) obvious = TRUE;
3508 if (MON_STUNNED(m_ptr))
3510 note = _("はひどくもうろうとした。", " is more dazed.");
3511 tmp = MON_STUNNED(m_ptr) + (do_stun / 2);
3515 note = _("はもうろうとした。", " is dazed.");
3520 (void)set_monster_stunned(g_ptr->m_idx, tmp);
3526 /* Confusion and Chaos resisters (and sleepers) never confuse */
3528 !(r_ptr->flags3 & RF3_NO_CONF) &&
3529 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
3531 if (seen) obvious = TRUE;
3533 /* Already partially confused */
3534 if (MON_CONFUSED(m_ptr))
3536 note = _("はさらに混乱したようだ。", " looks more confused.");
3537 tmp = MON_CONFUSED(m_ptr) + (do_conf / 2);
3540 /* Was not confused */
3543 note = _("は混乱したようだ。", " looks confused.");
3547 /* Apply confusion */
3548 (void)set_monster_confused(g_ptr->m_idx, tmp);
3556 if (seen) obvious = TRUE;
3558 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
3562 note = _("は弱くなったようだ。", " seems weakened.");
3563 m_ptr->maxhp -= do_time;
3564 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
3569 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
3570 if (do_poly && (randint1(90) > r_ptr->level))
3572 if (polymorph_monster(y, x))
3574 if (seen) obvious = TRUE;
3576 /* Monster polymorphs */
3577 note = _("が変身した!", " changes!");
3579 /* Turn off the damage */
3585 note = _("には効果がなかった。", " is unaffected.");
3588 /* Hack -- Get new monster */
3589 m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
3591 /* Hack -- Get new race */
3592 r_ptr = &r_info[m_ptr->r_idx];
3595 /* Handle "teleport" */
3598 if (seen) obvious = TRUE;
3600 note = _("が消え去った!", " disappears!");
3602 if (!who) chg_virtue(V_VALOUR, -1);
3605 teleport_away(g_ptr->m_idx, do_dist,
3606 (!who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
3608 /* Hack -- get new location */
3612 /* Hack -- get new grid */
3613 g_ptr = ¤t_floor_ptr->grid_array[y][x];
3620 (void)set_monster_monfear(g_ptr->m_idx, MON_MONFEAR(m_ptr) + do_fear);
3627 if (typ == GF_DRAIN_MANA)
3629 /* Drain mana does nothing */
3632 /* If another monster did the damage, hurt the monster by hand */
3635 /* Redraw (later) if needed */
3636 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3637 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3639 /* Wake the monster up */
3640 (void)set_monster_csleep(g_ptr->m_idx, 0);
3642 /* Hurt the monster */
3650 if (is_pet(m_ptr) && !(m_ptr->ml))
3653 /* Give detailed messages if destroyed */
3656 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
3659 msg_format("%^s%s", m_name, note);
3667 if (who > 0) monster_gain_exp(who, m_ptr->r_idx);
3669 /* Generate treasure, etc */
3670 monster_death(g_ptr->m_idx, FALSE);
3673 delete_monster_idx(g_ptr->m_idx);
3677 msg_print(_("少し悲しい気分がした。", "You feel sad for a moment."));
3681 /* Damaged monster */
3684 /* Give detailed messages if visible or destroyed */
3685 if (note && seen_msg) msg_format("%^s%s", m_name, note);
3687 /* Hack -- Pain message */
3690 message_pain(g_ptr->m_idx, dam);
3697 /* Hack -- handle sleep */
3698 if (do_sleep) (void)set_monster_csleep(g_ptr->m_idx, do_sleep);
3702 else if (heal_leper)
3704 if (seen_msg) msg_print(_("不潔な病人は病気が治った!", "The Mangy looking leper is healed!"));
3706 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
3708 char m2_name[MAX_NLEN];
3710 monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
3711 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_HEAL_LEPER, m2_name);
3714 delete_monster_idx(g_ptr->m_idx);
3717 /* If the player did it, give him experience, check fear */
3722 /* Hurt the monster, check for fear and death */
3723 if (mon_take_hit(g_ptr->m_idx, dam, &fear, note_dies))
3728 /* Damaged monster */
3731 /* HACK - anger the monster before showing the sleep message */
3732 if (do_sleep) anger_monster(m_ptr);
3734 /* Give detailed messages if visible or destroyed */
3735 if (note && seen_msg)
3736 msg_format(_("%s%s", "%^s%s"), m_name, note);
3738 /* Hack -- Pain message */
3739 else if (known && (dam || !do_fear))
3741 message_pain(g_ptr->m_idx, dam);
3744 /* Anger monsters */
3745 if (((dam > 0) || get_angry) && !do_sleep)
3746 anger_monster(m_ptr);
3748 if ((fear || do_fear) && seen)
3751 msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
3754 /* Hack -- handle sleep */
3755 if (do_sleep) (void)set_monster_csleep(g_ptr->m_idx, do_sleep);
3759 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
3761 blood_curse_to_enemy(who);
3764 if (p_ptr->inside_battle)
3766 p_ptr->health_who = g_ptr->m_idx;
3767 p_ptr->redraw |= (PR_HEALTH);
3771 /* Verify this code */
3772 if (m_ptr->r_idx) update_monster(g_ptr->m_idx, FALSE);
3774 /* Redraw the monster grid */
3777 /* Update monster recall window */
3778 if ((p_ptr->monster_race_idx == m_ptr->r_idx) && (seen || !m_ptr->r_idx))
3780 p_ptr->window |= (PW_MONSTER);
3783 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
3787 if (!(flg & PROJECT_NO_HANGEKI))
3789 set_target(m_ptr, monster_target_y, monster_target_x);
3792 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
3794 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
3798 if (p_ptr->riding && (p_ptr->riding == g_ptr->m_idx) && (dam > 0))
3800 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
3801 rakubadam_m = (dam > 200) ? 200 : dam;
3811 /* Prepare to make a Blade of Chaos */
3812 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
3814 q_ptr->pval = photo;
3816 /* Mark the item as fully known */
3817 q_ptr->ident |= (IDENT_MENTAL);
3818 (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
3826 /* Return "Anything seen?" */
3831 * @brief 汎用的なビーム/ボルト/ボール系によるプレイヤーへの効果処理 / Helper function for "project()" below.
3832 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
3833 * @param who_name 効果を起こしたモンスターの名前
3834 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
3835 * @param y 目標Y座標 / Target y location (or location to travel "towards")
3836 * @param x 目標X座標 / Target x location (or location to travel "towards")
3837 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
3838 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
3840 * @param monspell 効果元のモンスター魔法ID
3841 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
3843 * Handle a beam/bolt/ball causing damage to the player.
3844 * This routine takes a "source monster" (by index), a "distance", a default
3845 * "damage", and a "damage type". See "project_m()" above.
3846 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
3847 * is reduced (see "project_m()" above). This can happen if a monster breathes
3848 * at the player and hits a wall instead.
3849 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
3850 * to know if this is actually a ball or a bolt spell
3851 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
3852 * we just assume that the effects were obvious, for historical reasons.
3854 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)
3859 /* Hack -- assume obvious */
3860 bool obvious = TRUE;
3862 /* Player blind-ness */
3863 bool blind = (p_ptr->blind ? TRUE : FALSE);
3865 /* Player needs a "description" (he is blind) */
3868 /* Source monster */
3869 monster_type *m_ptr = NULL;
3871 /* Monster name (for attacks) */
3872 GAME_TEXT m_name[MAX_NLEN];
3874 /* Monster name (for damage) */
3877 /* Hack -- messages */
3883 /* Player is not here */
3884 if (!player_bold(y, x)) return (FALSE);
3886 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
3888 if (kawarimi(TRUE)) return FALSE;
3891 /* Player cannot hurt himself */
3892 if (!who) return (FALSE);
3893 if (who == p_ptr->riding) return (FALSE);
3895 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
3898 int max_attempts = 10;
3899 sound(SOUND_REFLECT);
3902 msg_print(_("何かが跳ね返った!", "Something bounces!"));
3903 else if (p_ptr->special_defense & KATA_FUUJIN)
3904 msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
3906 msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
3909 /* Choose 'new' target */
3914 t_y = current_floor_ptr->m_list[who].fy - 1 + randint1(3);
3915 t_x = current_floor_ptr->m_list[who].fx - 1 + randint1(3);
3918 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(p_ptr->y, p_ptr->x, t_y, t_x));
3920 if (max_attempts < 1)
3922 t_y = current_floor_ptr->m_list[who].fy;
3923 t_x = current_floor_ptr->m_list[who].fx;
3928 t_y = p_ptr->y - 1 + randint1(3);
3929 t_x = p_ptr->x - 1 + randint1(3);
3932 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
3934 disturb(TRUE, TRUE);
3938 /* Limit maximum damage */
3939 if (dam > 1600) dam = 1600;
3941 /* Reduce damage by distance */
3942 dam = (dam + r) / (r + 1);
3945 /* If the player is blind, be more descriptive */
3946 if (blind) fuzzy = TRUE;
3951 m_ptr = ¤t_floor_ptr->m_list[who];
3952 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
3953 monster_desc(m_name, m_ptr, 0);
3955 /* Get the monster's real name (gotten before polymorph!) */
3956 strcpy(killer, who_name);
3962 case PROJECT_WHO_UNCTRL_POWER:
3963 strcpy(killer, _("制御できない力の氾流", "uncontrollable power storm"));
3966 case PROJECT_WHO_GLASS_SHARDS:
3967 strcpy(killer, _("ガラスの破片", "shards of glass"));
3971 strcpy(killer, _("罠", "a trap"));
3976 strcpy(m_name, killer);
3979 /* Analyze the damage */
3982 /* Standard damage -- hurts inventory too */
3985 if (fuzzy) msg_print(_("酸で攻撃された!", "You are hit by acid!"));
3986 get_damage = acid_dam(dam, killer, monspell, FALSE);
3990 /* Standard damage -- hurts inventory too */
3993 if (fuzzy) msg_print(_("火炎で攻撃された!", "You are hit by fire!"));
3994 get_damage = fire_dam(dam, killer, monspell, FALSE);
3998 /* Standard damage -- hurts inventory too */
4001 if (fuzzy) msg_print(_("冷気で攻撃された!", "You are hit by cold!"));
4002 get_damage = cold_dam(dam, killer, monspell, FALSE);
4006 /* Standard damage -- hurts inventory too */
4009 if (fuzzy) msg_print(_("電撃で攻撃された!", "You are hit by lightning!"));
4010 get_damage = elec_dam(dam, killer, monspell, FALSE);
4014 /* Standard damage -- also poisons player */
4017 bool double_resist = IS_OPPOSE_POIS();
4018 if (fuzzy) msg_print(_("毒で攻撃された!", "You are hit by poison!"));
4020 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
4021 if (double_resist) dam = (dam + 2) / 3;
4023 if ((!(double_resist || p_ptr->resist_pois)) && one_in_(HURT_CHANCE) && !CHECK_MULTISHADOW())
4028 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4030 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4032 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4037 /* Standard damage -- also poisons / mutates player */
4040 bool double_resist = IS_OPPOSE_POIS();
4041 if (fuzzy) msg_print(_("放射能で攻撃された!", "You are hit by radiation!"));
4043 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
4044 if (double_resist) dam = (2 * dam + 2) / 5;
4045 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4046 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4048 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4050 if (one_in_(5)) /* 6 */
4052 msg_print(_("奇形的な変身を遂げた!", "You undergo a freakish metamorphosis!"));
4053 if (one_in_(4)) /* 4 */
4061 inven_damage(set_acid_destroy, 2);
4067 /* Standard damage */
4070 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4071 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4075 /* Holy Orb -- Player only takes partial damage */
4078 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4079 if (p_ptr->align > 10)
4081 else if (p_ptr->align < -10)
4083 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4089 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4090 if (p_ptr->align > 10)
4092 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4096 /* Arrow -- XXX no dodging */
4101 msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
4103 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
4105 msg_print(_("矢を斬り捨てた!", "You cut down the arrow!"));
4108 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4112 /* Plasma -- XXX No resist */
4115 if (fuzzy) msg_print(_("何かとても熱いもので攻撃された!", "You are hit by something *HOT*!"));
4116 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4118 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4120 int plus_stun = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
4121 (void)set_stun(p_ptr->stun + plus_stun);
4124 if (!(p_ptr->resist_fire || IS_OPPOSE_FIRE() || p_ptr->immune_fire))
4126 inven_damage(set_acid_destroy, 3);
4132 /* Nether -- drain experience */
4135 if (fuzzy) msg_print(_("地獄の力で攻撃された!", "You are hit by nether forces!"));
4136 if (p_ptr->resist_neth)
4138 if (!prace_is_(RACE_SPECTRE))
4140 dam *= 6; dam /= (randint1(4) + 7);
4143 else if (!CHECK_MULTISHADOW()) drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
4145 if (prace_is_(RACE_SPECTRE) && !CHECK_MULTISHADOW())
4147 msg_print(_("気分がよくなった。", "You feel invigorated!"));
4149 learn_spell(monspell);
4153 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4159 /* Water -- stun/confuse */
4162 if (fuzzy) msg_print(_("何か湿ったもので攻撃された!", "You are hit by something wet!"));
4163 if (!CHECK_MULTISHADOW())
4165 if (!p_ptr->resist_sound && !p_ptr->resist_water)
4167 set_stun(p_ptr->stun + randint1(40));
4169 if (!p_ptr->resist_conf && !p_ptr->resist_water)
4171 set_confused(p_ptr->confused + randint1(5) + 5);
4174 if (one_in_(5) && !p_ptr->resist_water)
4176 inven_damage(set_cold_destroy, 3);
4179 if (p_ptr->resist_water) get_damage /= 4;
4182 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4186 /* Chaos -- many effects */
4189 if (fuzzy) msg_print(_("無秩序の波動で攻撃された!", "You are hit by a wave of anarchy!"));
4190 if (p_ptr->resist_chaos)
4192 dam *= 6; dam /= (randint1(4) + 7);
4195 if (!CHECK_MULTISHADOW())
4197 if (!p_ptr->resist_conf)
4199 (void)set_confused(p_ptr->confused + randint0(20) + 10);
4201 if (!p_ptr->resist_chaos)
4203 (void)set_image(p_ptr->image + randint1(10));
4206 msg_print(_("あなたの身体はカオスの力で捻じ曲げられた!", "Your body is twisted by chaos!"));
4207 (void)gain_mutation(p_ptr, 0);
4210 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
4212 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
4215 if (!p_ptr->resist_chaos || one_in_(9))
4217 inven_damage(set_elec_destroy, 2);
4218 inven_damage(set_fire_destroy, 2);
4222 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4226 /* Shards -- mostly cutting */
4229 if (fuzzy) msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
4230 if (p_ptr->resist_shard)
4232 dam *= 6; dam /= (randint1(4) + 7);
4234 else if (!CHECK_MULTISHADOW())
4236 (void)set_cut(p_ptr->cut + dam);
4239 if (!p_ptr->resist_shard || one_in_(13))
4241 inven_damage(set_cold_destroy, 2);
4244 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4248 /* Sound -- mostly stunning */
4251 if (fuzzy) msg_print(_("轟音で攻撃された!", "You are hit by a loud noise!"));
4252 if (p_ptr->resist_sound)
4254 dam *= 5; dam /= (randint1(4) + 7);
4256 else if (!CHECK_MULTISHADOW())
4258 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
4259 (void)set_stun(p_ptr->stun + plus_stun);
4262 if (!p_ptr->resist_sound || one_in_(13))
4264 inven_damage(set_cold_destroy, 2);
4267 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4271 /* Pure confusion */
4274 if (fuzzy) msg_print(_("何か混乱するもので攻撃された!", "You are hit by something puzzling!"));
4275 if (p_ptr->resist_conf)
4277 dam *= 5; dam /= (randint1(4) + 7);
4279 else if (!CHECK_MULTISHADOW())
4281 (void)set_confused(p_ptr->confused + randint1(20) + 10);
4283 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4287 /* Disenchantment -- see above */
4290 if (fuzzy) msg_print(_("何かさえないもので攻撃された!", "You are hit by something static!"));
4291 if (p_ptr->resist_disen)
4293 dam *= 6; dam /= (randint1(4) + 7);
4295 else if (!CHECK_MULTISHADOW())
4297 (void)apply_disenchant(0);
4299 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4303 /* Nexus -- see above */
4306 if (fuzzy) msg_print(_("何か奇妙なもので攻撃された!", "You are hit by something strange!"));
4307 if (p_ptr->resist_nexus)
4309 dam *= 6; dam /= (randint1(4) + 7);
4311 else if (!CHECK_MULTISHADOW())
4315 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4319 /* Force -- mostly stun */
4322 if (fuzzy) msg_print(_("運動エネルギーで攻撃された!", "You are hit by kinetic force!"));
4323 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4325 (void)set_stun(p_ptr->stun + randint1(20));
4327 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4332 /* Rocket -- stun, cut */
4335 if (fuzzy) msg_print(_("爆発があった!", "There is an explosion!"));
4336 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4338 (void)set_stun(p_ptr->stun + randint1(20));
4341 if (p_ptr->resist_shard)
4345 else if (!CHECK_MULTISHADOW())
4347 (void)set_cut(p_ptr->cut + (dam / 2));
4350 if (!p_ptr->resist_shard || one_in_(12))
4352 inven_damage(set_cold_destroy, 3);
4355 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4359 /* Inertia -- slowness */
4362 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
4363 if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4364 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4368 /* Lite -- blinding */
4371 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4372 if (p_ptr->resist_lite)
4374 dam *= 4; dam /= (randint1(4) + 7);
4376 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
4378 (void)set_blind(p_ptr->blind + randint1(5) + 2);
4381 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
4383 if (!CHECK_MULTISHADOW()) msg_print(_("光で肉体が焦がされた!", "The light scorches your flesh!"));
4386 else if (prace_is_(RACE_S_FAIRY))
4391 if (p_ptr->wraith_form) dam *= 2;
4392 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4394 if (p_ptr->wraith_form && !CHECK_MULTISHADOW())
4396 p_ptr->wraith_form = 0;
4397 msg_print(_("閃光のため非物質的な影の存在でいられなくなった。",
4398 "The light forces you out of your incorporeal shadow form."));
4400 p_ptr->redraw |= (PR_MAP | PR_STATUS);
4401 p_ptr->update |= (PU_MONSTERS);
4402 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4408 /* Dark -- blinding */
4411 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4412 if (p_ptr->resist_dark)
4414 dam *= 4; dam /= (randint1(4) + 7);
4416 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
4418 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
4420 (void)set_blind(p_ptr->blind + randint1(5) + 2);
4422 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4426 /* Time -- bolt fewer effects XXX */
4429 if (fuzzy) msg_print(_("過去からの衝撃に攻撃された!", "You are hit by a blast from the past!"));
4430 if (p_ptr->resist_time)
4433 dam /= (randint1(4) + 7);
4434 msg_print(_("時間が通り過ぎていく気がする。", "You feel as if time is passing you by."));
4436 else if (!CHECK_MULTISHADOW())
4438 switch (randint1(10))
4440 case 1: case 2: case 3: case 4: case 5:
4442 if (p_ptr->prace == RACE_ANDROID) break;
4443 msg_print(_("人生が逆戻りした気がする。", "You feel life has clocked back."));
4444 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
4448 case 6: case 7: case 8: case 9:
4450 switch (randint1(6))
4452 case 1: k = A_STR; act = _("強く", "strong"); break;
4453 case 2: k = A_INT; act = _("聡明で", "bright"); break;
4454 case 3: k = A_WIS; act = _("賢明で", "wise"); break;
4455 case 4: k = A_DEX; act = _("器用で", "agile"); break;
4456 case 5: k = A_CON; act = _("健康で", "hale"); break;
4457 case 6: k = A_CHR; act = _("美しく", "beautiful"); break;
4460 msg_format(_("あなたは以前ほど%sなくなってしまった...。",
4461 "You're not as %s as you used to be..."), act);
4463 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
4464 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
4465 p_ptr->update |= (PU_BONUS);
4471 msg_print(_("あなたは以前ほど力強くなくなってしまった...。",
4472 "You're not as powerful as you used to be..."));
4474 for (k = 0; k < A_MAX; k++)
4476 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
4477 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
4479 p_ptr->update |= (PU_BONUS);
4485 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4489 /* Gravity -- stun plus slowness plus teleport */
4492 if (fuzzy) msg_print(_("何か重いもので攻撃された!", "You are hit by something heavy!"));
4493 msg_print(_("周辺の重力がゆがんだ。", "Gravity warps around you."));
4495 if (!CHECK_MULTISHADOW())
4497 teleport_player(5, TELEPORT_PASSIVE);
4498 if (!p_ptr->levitation)
4499 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4500 if (!(p_ptr->resist_sound || p_ptr->levitation))
4502 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
4503 (void)set_stun(p_ptr->stun + plus_stun);
4506 if (p_ptr->levitation)
4508 dam = (dam * 2) / 3;
4511 if (!p_ptr->levitation || one_in_(13))
4513 inven_damage(set_cold_destroy, 2);
4516 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4520 /* Standard damage */
4521 case GF_DISINTEGRATE:
4523 if (fuzzy) msg_print(_("純粋なエネルギーで攻撃された!", "You are hit by pure energy!"));
4525 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4531 if (fuzzy) msg_print(_("何らかの攻撃によって気分がよくなった。", "You are hit by something invigorating!"));
4533 (void)hp_player(dam);
4540 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4541 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
4548 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
4549 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4555 if (p_ptr->free_act) break;
4556 if (fuzzy) msg_print(_("眠ってしまった!", "You fall asleep!"));
4558 if (ironman_nightmare)
4560 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
4561 /* Have some nightmares */
4562 sanity_blast(NULL, FALSE);
4565 set_paralyzed(p_ptr->paralyzed + dam);
4575 if (fuzzy) msg_print(_("魔法のオーラで攻撃された!", "You are hit by an aura of magic!"));
4576 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4583 if (fuzzy) msg_print(_("エネルギーの塊で攻撃された!", "You are hit by an energy!"));
4584 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
4591 if (fuzzy) msg_print(_("何かが空からあなたの頭上に落ちてきた!", "Something falls from the sky on you!"));
4593 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4594 if (!p_ptr->resist_shard || one_in_(13))
4596 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
4597 inven_damage(set_cold_destroy, 2);
4603 /* Ice -- cold plus stun plus cuts */
4606 if (fuzzy) msg_print(_("何か鋭く冷たいもので攻撃された!", "You are hit by something sharp and cold!"));
4607 get_damage = cold_dam(dam, killer, monspell, FALSE);
4608 if (!CHECK_MULTISHADOW())
4610 if (!p_ptr->resist_shard)
4612 (void)set_cut(p_ptr->cut + damroll(5, 8));
4614 if (!p_ptr->resist_sound)
4616 (void)set_stun(p_ptr->stun + randint1(15));
4619 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
4621 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
4631 if (fuzzy) msg_print(_("何か非常に冷たいもので攻撃された!", "You are hit by something extremely cold!"));
4633 if (p_ptr->mimic_form)
4635 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
4636 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4641 switch (p_ptr->prace)
4643 /* Some races are immune */
4657 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4669 if (CHECK_MULTISHADOW())
4671 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
4673 else if (p_ptr->csp)
4677 msg_format(_("%^sに精神エネルギーを吸い取られてしまった!", "%^s draws psychic energy from you!"), m_name);
4679 msg_print(_("精神エネルギーを吸い取られてしまった!", "Your psychic energy is drawn!"));
4682 if (dam >= p_ptr->csp)
4686 p_ptr->csp_frac = 0;
4695 learn_spell(monspell);
4696 p_ptr->redraw |= (PR_MANA);
4697 p_ptr->window |= (PW_PLAYER | PW_SPELL);
4701 /* Heal the monster */
4702 if (m_ptr->hp < m_ptr->maxhp)
4706 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
4708 /* Redraw (later) if needed */
4709 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4710 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4712 /* Special message */
4715 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), m_name);
4728 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
4730 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4731 learn_spell(monspell);
4735 if (!CHECK_MULTISHADOW())
4737 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
4739 if (!p_ptr->resist_conf)
4741 (void)set_confused(p_ptr->confused + randint0(4) + 4);
4744 if (!p_ptr->resist_chaos && one_in_(3))
4746 (void)set_image(p_ptr->image + randint0(250) + 150);
4753 p_ptr->csp_frac = 0;
4755 p_ptr->redraw |= PR_MANA;
4758 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4764 case GF_BRAIN_SMASH:
4766 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
4768 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4769 learn_spell(monspell);
4773 if (!CHECK_MULTISHADOW())
4775 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
4781 p_ptr->csp_frac = 0;
4783 p_ptr->redraw |= PR_MANA;
4786 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4787 if (!CHECK_MULTISHADOW())
4789 if (!p_ptr->resist_blind)
4791 (void)set_blind(p_ptr->blind + 8 + randint0(8));
4793 if (!p_ptr->resist_conf)
4795 (void)set_confused(p_ptr->confused + randint0(4) + 4);
4797 if (!p_ptr->free_act)
4799 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
4801 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4803 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
4804 (void)do_dec_stat(A_INT);
4805 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
4806 (void)do_dec_stat(A_WIS);
4808 if (!p_ptr->resist_chaos)
4810 (void)set_image(p_ptr->image + randint0(250) + 150);
4820 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4822 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4823 learn_spell(monspell);
4827 if (!CHECK_MULTISHADOW()) curse_equipment(15, 0);
4828 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4836 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4838 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4839 learn_spell(monspell);
4843 if (!CHECK_MULTISHADOW()) curse_equipment(25, MIN(rlev / 2 - 15, 5));
4844 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4852 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4854 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4855 learn_spell(monspell);
4859 if (!CHECK_MULTISHADOW()) curse_equipment(33, MIN(rlev / 2 - 15, 15));
4860 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4868 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU) && !CHECK_MULTISHADOW())
4870 msg_print(_("しかし秘孔を跳ね返した!", "You resist the effects!"));
4871 learn_spell(monspell);
4875 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4876 if (!CHECK_MULTISHADOW()) (void)set_cut(p_ptr->cut + damroll(10, 10));
4884 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4886 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4887 learn_spell(monspell);
4891 if (!CHECK_MULTISHADOW())
4893 msg_print(_("あなたは命が薄まっていくように感じた!", "You feel your life fade away!"));
4894 curse_equipment(40, 20);
4897 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
4899 if (p_ptr->chp < 1) p_ptr->chp = 1; /* Paranoia */
4914 /* Hex - revenge damage stored */
4915 revenge_store(get_damage);
4917 if ((p_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
4918 && (get_damage > 0) && !p_ptr->is_dead && (who > 0))
4920 GAME_TEXT m_name_self[80];
4923 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
4925 msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), m_name, m_name_self);
4926 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
4927 if (p_ptr->tim_eyeeye) set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
4930 if (p_ptr->riding && dam > 0)
4932 rakubadam_p = (dam > 200) ? 200 : dam;
4936 disturb(TRUE, TRUE);
4939 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
4941 (void)kawarimi(FALSE);
4944 /* Return "Anything seen?" */
4950 * Find the distance from (x, y) to a line.
4952 POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
4954 /* Vector from (x, y) to (x1, y1) */
4955 POSITION py = y1 - y;
4956 POSITION px = x1 - x;
4959 POSITION ny = x2 - x1;
4960 POSITION nx = y1 - y2;
4963 POSITION pd = distance(y1, x1, y, x);
4964 POSITION nd = distance(y1, x1, y2, x2);
4966 if (pd > nd) return distance(y, x, y2, x2);
4968 /* Component of P on N */
4969 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
4971 /* Absolute value */
4972 return((nd >= 0) ? nd : 0 - nd);
4979 * Modified version of los() for calculation of disintegration balls.
4980 * Disintegration effects are stopped by permanent walls.
4982 bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
4984 POSITION dx, dy; /* Delta */
4985 POSITION ax, ay; /* Absolute */
4986 POSITION sx, sy; /* Signs */
4987 POSITION qx, qy; /* Fractions */
4988 POSITION tx, ty; /* Scanners */
4989 POSITION f1, f2; /* Scale factors */
4990 POSITION m; /* Slope, or 1/Slope, of LOS */
4992 /* Extract the offset */
4996 /* Extract the absolute offset */
5000 /* Handle adjacent (or identical) grids */
5001 if ((ax < 2) && (ay < 2)) return (TRUE);
5003 /* Paranoia -- require "safe" origin */
5004 /* if (!in_bounds(y1, x1)) return (FALSE); */
5006 /* Directly South/North */
5009 /* South -- check for walls */
5012 for (ty = y1 + 1; ty < y2; ty++)
5014 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5018 /* North -- check for walls */
5021 for (ty = y1 - 1; ty > y2; ty--)
5023 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5031 /* Directly East/West */
5034 /* East -- check for walls */
5037 for (tx = x1 + 1; tx < x2; tx++)
5039 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5043 /* West -- check for walls */
5046 for (tx = x1 - 1; tx > x2; tx--)
5048 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5056 /* Extract some signs */
5057 sx = (dx < 0) ? -1 : 1;
5058 sy = (dy < 0) ? -1 : 1;
5060 /* Vertical "knights" */
5065 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
5069 /* Horizontal "knights" */
5074 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
5078 /* Calculate scale factor div 2 */
5081 /* Calculate scale factor */
5085 /* Travel horizontally */
5088 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
5094 /* Consider the special case where slope == 1. */
5105 /* Note (below) the case (qy == f2), where */
5106 /* the LOS exactly meets the corner of a tile. */
5109 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5120 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5133 /* Travel vertically */
5136 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
5152 /* Note (below) the case (qx == f2), where */
5153 /* the LOS exactly meets the corner of a tile. */
5156 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5167 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5188 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)
5193 int brev = rad * rad / dist;
5197 int mdis = distance(y1, x1, y2, x2) + rad;
5199 while (bdis <= mdis)
5203 if ((0 < dist) && (path_n < dist))
5205 POSITION ny = GRID_Y(path_g[path_n]);
5206 POSITION nx = GRID_X(path_g[path_n]);
5207 POSITION nd = distance(ny, nx, y1, x1);
5209 /* Get next base point */
5218 /* Travel from center outward */
5219 for (cdis = 0; cdis <= brad; cdis++)
5221 /* Scan the maximal blast area of radius "cdis" */
5222 for (y = by - cdis; y <= by + cdis; y++)
5224 for (x = bx - cdis; x <= bx + cdis; x++)
5226 /* Ignore "illegal" locations */
5227 if (!in_bounds(y, x)) continue;
5229 /* Enforce a circular "ripple" */
5230 if (distance(y1, x1, y, x) != bdis) continue;
5232 /* Enforce an arc */
5233 if (distance(by, bx, y, x) != cdis) continue;
5239 /* Lights are stopped by opaque terrains */
5240 if (!los(by, bx, y, x)) continue;
5242 case GF_DISINTEGRATE:
5243 /* Disintegration are stopped only by perma-walls */
5244 if (!in_disintegration_range(by, bx, y, x)) continue;
5247 /* Ball explosions are stopped by walls */
5248 if (!projectable(by, bx, y, x)) continue;
5252 /* Save this grid */
5260 /* Encode some more "radius" info */
5261 gm[bdis + 1] = *pgrids;
5263 /* Increase the size */
5264 brad = rad * (path_n + brev) / (dist + brev);
5266 /* Find the next ripple */
5270 /* Store the effect size */
5276 * @brief 汎用的なビーム/ボルト/ボール系処理のルーチン Generic "beam"/"bolt"/"ball" projection routine.
5277 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
5278 * @param rad 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
5279 * @param y 目標Y座標 / Target y location (or location to travel "towards")
5280 * @param x 目標X座標 / Target x location (or location to travel "towards")
5281 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
5282 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
5283 * @param flg 効果フラグ / Extra bit flags (see PROJECT_xxxx in "defines.h")
5284 * @param monspell 効果元のモンスター魔法ID
5285 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
5288 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
5289 * towards a given location (optionally passing over the heads of interposing
5290 * monsters), and have it do a given amount of damage to the monsters (and
5291 * optionally objects) within the given radius of the final location.
5293 * A "bolt" travels from source to target and affects only the target grid.
5294 * A "beam" travels from source to target, affecting all grids passed through.
5295 * A "ball" travels from source to the target, exploding at the target, and
5296 * affecting everything within the given radius of the target location.
5298 * Traditionally, a "bolt" does not affect anything on the ground, and does
5299 * not pass over the heads of interposing monsters, much like a traditional
5300 * missile, and will "stop" abruptly at the "target" even if no monster is
5301 * positioned there, while a "ball", on the other hand, passes over the heads
5302 * of monsters between the source and target, and affects everything except
5303 * the source monster which lies within the final radius, while a "beam"
5304 * affects every monster between the source and target, except for the casting
5305 * monster (or player), and rarely affects things on the ground.
5307 * Two special flags allow us to use this function in special ways, the
5308 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
5309 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
5310 * actually projecting from the source monster (or player).
5312 * The player will only get "experience" for monsters killed by himself
5313 * Unique monsters can only be destroyed by attacks from the player
5315 * Only 256 grids can be affected per projection, limiting the effective
5316 * "radius" of standard ball attacks to nine units (diameter nineteen).
5318 * One can project in a given "direction" by combining PROJECT_THRU with small
5319 * offsets to the initial location (see "line_spell()"), or by calculating
5320 * "virtual targets" far away from the player.
5322 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
5323 * continuing until it actually hits somethings (useful for "stone to mud").
5325 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
5327 * Balls must explode BEFORE hitting walls, or they would affect monsters
5328 * on both sides of a wall. Some bug reports indicate that this is still
5329 * happening in 2.7.8 for Windows, though it appears to be impossible.
5331 * We "pre-calculate" the blast area only in part for efficiency.
5332 * More importantly, this lets us do "explosions" from the "inside" out.
5333 * This results in a more logical distribution of "blast" treasure.
5334 * It also produces a better (in my opinion) animation of the explosion.
5335 * It could be (but is not) used to have the treasure dropped by monsters
5336 * in the middle of the explosion fall "outwards", and then be damaged by
5337 * the blast as it spreads outwards towards the treasure drop location.
5339 * Walls and doors are included in the blast area, so that they can be
5340 * "burned" or "melted" in later versions.
5342 * This algorithm is intended to maximize simplicity, not necessarily
5343 * efficiency, since this function is not a bottleneck in the code.
5345 * We apply the blast effect from ground zero outwards, in several passes,
5346 * first affecting features, then objects, then monsters, then the player.
5347 * This allows walls to be removed before checking the object or monster
5348 * in the wall, and protects objects which are dropped by monsters killed
5349 * in the blast, and allows the player to see all affects before he is
5350 * killed or teleported away. The semantics of this method are open to
5351 * various interpretations, but they seem to work well in practice.
5353 * We process the blast area from ground-zero outwards to allow for better
5354 * distribution of treasure dropped by monsters, and because it provides a
5355 * pleasing visual effect at low cost.
5357 * Note that the damage done by "ball" explosions decreases with distance.
5358 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
5360 * Notice the "napalm" effect of "beam" weapons. First they "project" to
5361 * the target, and then the damage "flows" along this beam of destruction.
5362 * The damage at every grid is the same as at the "center" of a "ball"
5363 * explosion, since the "beam" grids are treated as if they ARE at the
5364 * center of a "ball" explosion.
5366 * Currently, specifying "beam" plus "ball" means that locations which are
5367 * covered by the initial "beam", and also covered by the final "ball", except
5368 * for the final grid (the epicenter of the ball), will be "hit twice", once
5369 * by the initial beam, and once by the exploding ball. For the grid right
5370 * next to the epicenter, this results in 150% damage being done. The center
5371 * does not have this problem, for the same reason the final grid in a "beam"
5372 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
5373 * grids which are covered by the "ball" will NOT work, as then they will
5374 * receive LESS damage than they should. Do not combine "beam" with "ball".
5376 * The array "gy[],gx[]" with current size "grids" is used to hold the
5377 * collected locations of all grids in the "blast area" plus "beam path".
5379 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
5380 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
5381 * first blast grid (see above) with radius "N" from the blast center. Note
5382 * that only the first gm[1] grids in the blast area thus take full damage.
5383 * Also, note that gm[rad+1] is always equal to "grids", which is the total
5384 * number of blast grids.
5386 * Note that once the projection is complete, (y2,x2) holds the final location
5387 * of bolts/beams, and the "epicenter" of balls.
5389 * Note also that "rad" specifies the "inclusive" radius of projection blast,
5390 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
5391 * implementation of the "distance" function. Also, a bolt can be properly
5392 * viewed as a "ball" with a "rad" of "zero".
5394 * Note that if no "target" is reached before the beam/bolt/ball travels the
5395 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
5396 * may be relevant even for bolts, since they have a "1x1" mini-blast.
5398 * Note that for consistency, we "pretend" that the bolt actually takes "time"
5399 * to move from point A to point B, even if the player cannot see part of the
5400 * projection path. Note that in general, the player will *always* see part
5401 * of the path, since it either starts at the player or ends on the player.
5403 * Hack -- we assume that every "projection" is "self-illuminating".
5405 * Hack -- when only a single monster is affected, we automatically track
5406 * (and recall) that monster, unless "PROJECT_JUMP" is used.
5408 * Note that all projections now "explode" at their final destination, even
5409 * if they were being projected at a more distant destination. This means
5410 * that "ball" spells will *always* explode.
5412 * Note that we must call "handle_stuff()" after affecting terrain features
5413 * in the blast radius, in case the "illumination" of the grid was changed,
5414 * and "update_view()" and "update_monsters()" need to be called.
5417 bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
5427 POSITION y_saver, x_saver; /* For reflecting monsters */
5429 int msec = delay_factor * delay_factor * delay_factor;
5431 /* Assume the player sees nothing */
5432 bool notice = FALSE;
5434 /* Assume the player has seen nothing */
5435 bool visual = FALSE;
5437 /* Assume the player has seen no blast grids */
5440 /* Assume to be a normal ball spell */
5441 bool breath = FALSE;
5443 /* Is the player blind? */
5444 bool blind = (p_ptr->blind ? TRUE : FALSE);
5446 bool old_hide = FALSE;
5448 /* Number of grids in the "path" */
5451 /* Actual grids in the "path" */
5454 /* Number of grids in the "blast area" (including the "beam" path) */
5457 /* Coordinates of the affected grids */
5458 POSITION gx[1024], gy[1024];
5460 /* Encoded "radius" info (see above) */
5463 /* Actual radius encoded in gm[] */
5464 POSITION gm_rad = rad;
5468 /* Attacker's name (prepared before polymorph)*/
5469 GAME_TEXT who_name[MAX_NLEN];
5471 /* Can the player see the source of this effect? */
5472 bool see_s_msg = TRUE;
5474 /* Initialize by null string */
5480 /* Default target of monsterspell is player */
5481 monster_target_y = p_ptr->y;
5482 monster_target_x = p_ptr->x;
5484 /* Hack -- Jump to target */
5485 if (flg & (PROJECT_JUMP))
5490 /* Clear the flag */
5491 flg &= ~(PROJECT_JUMP);
5496 /* Start at player */
5503 /* Start at monster */
5506 x1 = current_floor_ptr->m_list[who].fx;
5507 y1 = current_floor_ptr->m_list[who].fy;
5508 monster_desc(who_name, ¤t_floor_ptr->m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
5520 /* Default "destination" */
5525 /* Hack -- verify stuff */
5526 if (flg & (PROJECT_THRU))
5528 if ((x1 == x2) && (y1 == y2))
5530 flg &= ~(PROJECT_THRU);
5534 /* Handle a breath attack */
5539 if (flg & PROJECT_HIDE) old_hide = TRUE;
5540 flg |= PROJECT_HIDE;
5544 /* Hack -- Assume there will be no blast (max radius 32) */
5545 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
5553 /* Collect beam grids */
5554 if (flg & (PROJECT_BEAM))
5565 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
5567 case GF_DISINTEGRATE:
5568 flg |= (PROJECT_GRID);
5569 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
5573 /* Calculate the projection path */
5575 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
5578 /* Giga-Hack SEEKER & SUPER_RAY */
5580 if( typ == GF_SEEKER )
5590 for (i = 0; i < path_n; ++i)
5595 POSITION ny = GRID_Y(path_g[i]);
5596 POSITION nx = GRID_X(path_g[i]);
5607 /* Only do visuals if requested */
5608 if (!blind && !(flg & (PROJECT_HIDE)))
5610 /* Only do visuals if the player can "see" the bolt */
5611 if (panel_contains(y, x) && player_has_los_bold(y, x))
5618 /* Obtain the bolt pict */
5619 p = bolt_pict(oy, ox, y, x, typ);
5621 /* Extract attr/char */
5625 /* Visual effects */
5626 print_rel(c, a, y, x);
5627 move_cursor_relative(y, x);
5628 /*if (fresh_before)*/ Term_fresh();
5629 Term_xtra(TERM_XTRA_DELAY, msec);
5631 /*if (fresh_before)*/ Term_fresh();
5633 /* Display "beam" grids */
5634 if (flg & (PROJECT_BEAM))
5636 /* Obtain the explosion pict */
5637 p = bolt_pict(y, x, y, x, typ);
5639 /* Extract attr/char */
5643 /* Visual effects */
5644 print_rel(c, a, y, x);
5647 /* Hack -- Activate delay */
5651 /* Hack -- delay anyway for consistency */
5654 /* Delay for consistency */
5655 Term_xtra(TERM_XTRA_DELAY, msec);
5658 if (project_o(0, 0, y, x, dam, GF_SEEKER))notice = TRUE;
5659 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
5661 /* The target of monsterspell becomes tha mirror(broken) */
5662 monster_target_y = y;
5663 monster_target_x = x;
5665 remove_mirror(y, x);
5666 next_mirror(&oy, &ox, y, x);
5668 path_n = i + project_path(&(path_g[i + 1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
5669 for (j = last_i; j <= i; j++)
5671 y = GRID_Y(path_g[j]);
5672 x = GRID_X(path_g[j]);
5673 if (project_m(0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
5674 if (!who && (project_m_n == 1) && !jump) {
5675 if (current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0) {
5676 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5680 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5681 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5685 (void)project_f(0, 0, y, x, dam, GF_SEEKER);
5690 for(i = last_i ; i < path_n ; i++)
5693 py = GRID_Y(path_g[i]);
5694 px = GRID_X(path_g[i]);
5695 if (project_m(0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
5697 if (!who && (project_m_n == 1) && !jump) {
5698 if (current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0)
5700 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5704 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5705 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5709 (void)project_f(0, 0, py, px, dam, GF_SEEKER);
5713 else if(typ == GF_SUPER_RAY){
5715 int second_step = 0;
5722 for (i = 0; i < path_n; ++i)
5727 POSITION ny = GRID_Y(path_g[i]);
5728 POSITION nx = GRID_X(path_g[i]);
5739 /* Only do visuals if requested */
5740 if (!blind && !(flg & (PROJECT_HIDE)))
5742 /* Only do visuals if the player can "see" the bolt */
5743 if (panel_contains(y, x) && player_has_los_bold(y, x))
5750 /* Obtain the bolt pict */
5751 p = bolt_pict(oy, ox, y, x, typ);
5753 /* Extract attr/char */
5757 /* Visual effects */
5758 print_rel(c, a, y, x);
5759 move_cursor_relative(y, x);
5760 /*if (fresh_before)*/ Term_fresh();
5761 Term_xtra(TERM_XTRA_DELAY, msec);
5763 /*if (fresh_before)*/ Term_fresh();
5765 /* Display "beam" grids */
5766 if (flg & (PROJECT_BEAM))
5768 /* Obtain the explosion pict */
5769 p = bolt_pict(y, x, y, x, typ);
5771 /* Extract attr/char */
5775 /* Visual effects */
5776 print_rel(c, a, y, x);
5779 /* Hack -- Activate delay */
5783 /* Hack -- delay anyway for consistency */
5786 /* Delay for consistency */
5787 Term_xtra(TERM_XTRA_DELAY, msec);
5790 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
5791 if (!cave_have_flag_bold(y, x, FF_PROJECT))
5793 if( second_step )continue;
5796 if( is_mirror_grid(¤t_floor_ptr->grid_array[y][x]) && !second_step )
5798 /* The target of monsterspell becomes tha mirror(broken) */
5799 monster_target_y = y;
5800 monster_target_x = x;
5803 for( j = 0; j <=i ; j++ )
5805 y = GRID_Y(path_g[j]);
5806 x = GRID_X(path_g[j]);
5807 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
5811 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
5812 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
5813 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
5814 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
5815 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
5816 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
5817 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
5818 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
5821 for( i = 0; i < path_n ; i++ )
5824 py = GRID_Y(path_g[i]);
5825 px = GRID_X(path_g[i]);
5826 (void)project_m(0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
5827 if(!who && (project_m_n == 1) && !jump){
5828 if(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx >0 ){
5829 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5833 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5834 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5838 (void)project_f(0, 0, py, px, dam, GF_SUPER_RAY);
5843 /* Project along the path */
5844 for (i = 0; i < path_n; ++i)
5849 POSITION ny = GRID_Y(path_g[i]);
5850 POSITION nx = GRID_X(path_g[i]);
5852 if (flg & PROJECT_DISI)
5854 /* Hack -- Balls explode before reaching walls */
5855 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
5857 else if (flg & PROJECT_LOS)
5859 /* Hack -- Balls explode before reaching walls */
5860 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
5864 /* Hack -- Balls explode before reaching walls */
5865 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
5872 /* Collect beam grids */
5873 if (flg & (PROJECT_BEAM))
5880 /* Only do visuals if requested */
5881 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
5883 /* Only do visuals if the player can "see" the bolt */
5884 if (panel_contains(y, x) && player_has_los_bold(y, x))
5891 /* Obtain the bolt pict */
5892 p = bolt_pict(oy, ox, y, x, typ);
5894 /* Extract attr/char */
5898 /* Visual effects */
5899 print_rel(c, a, y, x);
5900 move_cursor_relative(y, x);
5901 /*if (fresh_before)*/ Term_fresh();
5902 Term_xtra(TERM_XTRA_DELAY, msec);
5904 /*if (fresh_before)*/ Term_fresh();
5906 /* Display "beam" grids */
5907 if (flg & (PROJECT_BEAM))
5909 /* Obtain the explosion pict */
5910 p = bolt_pict(y, x, y, x, typ);
5912 /* Extract attr/char */
5916 /* Visual effects */
5917 print_rel(c, a, y, x);
5920 /* Hack -- Activate delay */
5924 /* Hack -- delay anyway for consistency */
5927 /* Delay for consistency */
5928 Term_xtra(TERM_XTRA_DELAY, msec);
5935 /* Save the "blast epicenter" */
5939 if (breath && !path_n)
5945 flg &= ~(PROJECT_HIDE);
5949 /* Start the "explosion" */
5952 /* Hack -- make sure beams get to "explode" */
5960 /* If we found a "target", explode there */
5961 if (dist <= MAX_RANGE)
5963 /* Mega-Hack -- remove the final "beam" grid */
5964 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
5967 * Create a conical breath attack
5978 flg &= ~(PROJECT_HIDE);
5980 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
5984 /* Determine the blast area, work from the inside out */
5985 for (dist = 0; dist <= rad; dist++)
5987 /* Scan the maximal blast area of radius "dist" */
5988 for (y = by - dist; y <= by + dist; y++)
5990 for (x = bx - dist; x <= bx + dist; x++)
5992 /* Ignore "illegal" locations */
5993 if (!in_bounds2(y, x)) continue;
5995 /* Enforce a "circular" explosion */
5996 if (distance(by, bx, y, x) != dist) continue;
6002 /* Lights are stopped by opaque terrains */
6003 if (!los(by, bx, y, x)) continue;
6005 case GF_DISINTEGRATE:
6006 /* Disintegration are stopped only by perma-walls */
6007 if (!in_disintegration_range(by, bx, y, x)) continue;
6010 /* Ball explosions are stopped by walls */
6011 if (!projectable(by, bx, y, x)) continue;
6015 /* Save this grid */
6022 /* Encode some more "radius" info */
6028 /* Speed -- ignore "non-explosions" */
6029 if (!grids) return (FALSE);
6032 /* Display the "blast area" if requested */
6033 if (!blind && !(flg & (PROJECT_HIDE)))
6035 /* Then do the "blast", from inside out */
6036 for (t = 0; t <= gm_rad; t++)
6038 /* Dump everything with this radius */
6039 for (i = gm[t]; i < gm[t+1]; i++)
6041 /* Extract the location */
6045 /* Only do visuals if the player can "see" the blast */
6046 if (panel_contains(y, x) && player_has_los_bold(y, x))
6055 /* Obtain the explosion pict */
6056 p = bolt_pict(y, x, y, x, typ);
6058 /* Extract attr/char */
6062 /* Visual effects -- Display */
6063 print_rel(c, a, y, x);
6067 /* Hack -- center the cursor */
6068 move_cursor_relative(by, bx);
6070 /* Flush each "radius" seperately */
6071 /*if (fresh_before)*/ Term_fresh();
6073 /* Delay (efficiently) */
6074 if (visual || drawn)
6076 Term_xtra(TERM_XTRA_DELAY, msec);
6080 /* Flush the erasing */
6083 /* Erase the explosion drawn above */
6084 for (i = 0; i < grids; i++)
6086 /* Extract the location */
6090 /* Hack -- Erase if needed */
6091 if (panel_contains(y, x) && player_has_los_bold(y, x))
6097 /* Hack -- center the cursor */
6098 move_cursor_relative(by, bx);
6100 /* Flush the explosion */
6101 /*if (fresh_before)*/ Term_fresh();
6105 update_creature(p_ptr);
6107 if (flg & PROJECT_KILL)
6109 see_s_msg = (who > 0) ? is_seen(¤t_floor_ptr->m_list[who]) :
6110 (!who ? TRUE : (player_can_see_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)));
6114 /* Check features */
6115 if (flg & (PROJECT_GRID))
6117 /* Start with "dist" of zero */
6120 /* Scan for features */
6121 for (i = 0; i < grids; i++)
6123 /* Hack -- Notice new "dist" values */
6124 if (gm[dist+1] == i) dist++;
6126 /* Get the grid location */
6130 /* Find the closest point in the blast */
6133 int d = dist_to_line(y, x, y1, x1, by, bx);
6135 /* Affect the grid */
6136 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
6140 /* Affect the grid */
6141 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
6146 update_creature(p_ptr);
6149 if (flg & (PROJECT_ITEM))
6151 /* Start with "dist" of zero */
6154 /* Scan for objects */
6155 for (i = 0; i < grids; i++)
6157 /* Hack -- Notice new "dist" values */
6158 if (gm[dist+1] == i) dist++;
6160 /* Get the grid location */
6164 /* Find the closest point in the blast */
6167 int d = dist_to_line(y, x, y1, x1, by, bx);
6169 /* Affect the object in the grid */
6170 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
6174 /* Affect the object in the grid */
6175 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
6181 /* Check monsters */
6182 if (flg & (PROJECT_KILL))
6189 /* Start with "dist" of zero */
6192 /* Scan for monsters */
6193 for (i = 0; i < grids; i++)
6197 /* Hack -- Notice new "dist" values */
6198 if (gm[dist + 1] == i) dist++;
6200 /* Get the grid location */
6204 /* A single bolt may be reflected */
6207 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
6208 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
6210 if ((flg & PROJECT_REFLECTABLE) && current_floor_ptr->grid_array[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
6211 ((current_floor_ptr->grid_array[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
6212 (!who || dist_hack > 1) && !one_in_(10))
6215 int max_attempts = 10;
6217 /* Choose 'new' target */
6220 t_y = y_saver - 1 + randint1(3);
6221 t_x = x_saver - 1 + randint1(3);
6224 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
6226 if (max_attempts < 1)
6232 sound(SOUND_REFLECT);
6235 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
6236 msg_print(_("「北斗神拳奥義・二指真空把!」", "The attack bounces!"));
6237 else if (m_ptr->r_idx == MON_DIO)
6238 msg_print(_("ディオ・ブランドーは指一本で攻撃を弾き返した!", "The attack bounces!"));
6240 msg_print(_("攻撃は跳ね返った!", "The attack bounces!"));
6242 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
6244 /* Reflected bolts randomly target either one */
6245 if (player_bold(y, x) || one_in_(2)) flg &= ~(PROJECT_PLAYER);
6246 else flg |= PROJECT_PLAYER;
6248 /* The bolt is reflected */
6249 project(current_floor_ptr->grid_array[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
6251 /* Don't affect the monster any longer */
6257 /* Find the closest point in the blast */
6260 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
6264 effective_dist = dist;
6268 /* There is the riding player on this monster */
6269 if (p_ptr->riding && player_bold(y, x))
6271 /* Aimed on the player */
6272 if (flg & PROJECT_PLAYER)
6274 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
6277 * A beam or bolt is well aimed
6279 * So don't affects the mount.
6286 * The spell is not well aimed,
6287 * So partly affect the mount too.
6294 * This grid is the original target.
6295 * Or aimed on your horse.
6297 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
6299 /* Hit the mount with full damage */
6303 * Otherwise this grid is not the
6304 * original target, it means that line
6305 * of fire is obstructed by this
6309 * A beam or bolt will hit either
6310 * player or mount. Choose randomly.
6312 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
6316 /* Hit the mount with full damage */
6320 /* Hit the player later */
6321 flg |= PROJECT_PLAYER;
6323 /* Don't affect the mount */
6329 * The spell is not well aimed, so
6330 * partly affect both player and
6339 /* Affect the monster in the grid */
6340 if (project_m(who, effective_dist, y, x, dam, typ, flg, see_s_msg)) notice = TRUE;
6344 /* Player affected one monster (without "jumping") */
6345 if (!who && (project_m_n == 1) && !jump)
6350 /* Track if possible */
6351 if (current_floor_ptr->grid_array[y][x].m_idx > 0)
6353 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
6357 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6358 health_track(current_floor_ptr->grid_array[y][x].m_idx);
6366 if (flg & (PROJECT_KILL))
6368 /* Start with "dist" of zero */
6371 /* Scan for player */
6372 for (i = 0; i < grids; i++)
6376 /* Hack -- Notice new "dist" values */
6377 if (gm[dist+1] == i) dist++;
6379 /* Get the grid location */
6383 /* Affect the player? */
6384 if (!player_bold(y, x)) continue;
6386 /* Find the closest point in the blast */
6389 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
6393 effective_dist = dist;
6396 /* Target may be your horse */
6399 /* Aimed on the player */
6400 if (flg & PROJECT_PLAYER)
6402 /* Hit the player with full damage */
6406 * Hack -- When this grid was not the
6407 * original target, a beam or bolt
6408 * would hit either player or mount,
6409 * and should be choosen randomly.
6411 * But already choosen to hit the
6412 * mount at this point.
6414 * Or aimed on your horse.
6416 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
6419 * A beam or bolt is well aimed
6421 * So don't affects the player.
6428 * The spell is not well aimed,
6429 * So partly affect the player too.
6435 /* Affect the player */
6436 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
6442 GAME_TEXT m_name[MAX_NLEN];
6444 monster_desc(m_name, ¤t_floor_ptr->m_list[p_ptr->riding], 0);
6446 if (rakubadam_m > 0)
6448 if (rakuba(rakubadam_m, FALSE))
6450 msg_format(_("%^sに振り落とされた!", "%^s has thrown you off!"), m_name);
6453 if (p_ptr->riding && rakubadam_p > 0)
6455 if(rakuba(rakubadam_p, FALSE))
6457 msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_name);
6462 /* Return "something was noticed" */
6467 * @brief 鏡魔法「封魔結界」の効果処理
6469 * @return 効果があったらTRUEを返す
6471 bool binding_field(HIT_POINT dam)
6473 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
6474 int mirror_num = 0; /* 鏡の数 */
6476 POSITION centersign;
6477 POSITION x1, x2, y1, y2;
6479 int msec = delay_factor*delay_factor*delay_factor;
6482 POSITION point_x[3];
6483 POSITION point_y[3];
6485 /* Default target of monsterspell is player */
6486 monster_target_y = p_ptr->y;
6487 monster_target_x = p_ptr->x;
6489 for (x = 0; x < current_floor_ptr->width; x++)
6491 for (y = 0; y < current_floor_ptr->height; y++)
6493 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]) &&
6494 distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
6495 distance(p_ptr->y, p_ptr->x, y, x) != 0 &&
6496 player_has_los_bold(y, x) &&
6497 projectable(p_ptr->y, p_ptr->x, y, x)
6499 mirror_y[mirror_num] = y;
6500 mirror_x[mirror_num] = x;
6506 if (mirror_num < 2)return FALSE;
6508 point_x[0] = randint0(mirror_num);
6510 point_x[1] = randint0(mirror_num);
6511 } while (point_x[0] == point_x[1]);
6513 point_y[0] = mirror_y[point_x[0]];
6514 point_x[0] = mirror_x[point_x[0]];
6515 point_y[1] = mirror_y[point_x[1]];
6516 point_x[1] = mirror_x[point_x[1]];
6517 point_y[2] = p_ptr->y;
6518 point_x[2] = p_ptr->x;
6520 x = point_x[0] + point_x[1] + point_x[2];
6521 y = point_y[0] + point_y[1] + point_y[2];
6523 centersign = (point_x[0] * 3 - x)*(point_y[1] * 3 - y)
6524 - (point_y[0] * 3 - y)*(point_x[1] * 3 - x);
6525 if (centersign == 0)return FALSE;
6527 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
6528 x1 = x1 < point_x[2] ? x1 : point_x[2];
6529 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
6530 y1 = y1 < point_y[2] ? y1 : point_y[2];
6532 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
6533 x2 = x2 > point_x[2] ? x2 : point_x[2];
6534 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
6535 y2 = y2 > point_y[2] ? y2 : point_y[2];
6537 for (y = y1; y <= y2; y++) {
6538 for (x = x1; x <= x2; x++) {
6539 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6540 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6541 centersign*((point_x[1] - x)*(point_y[2] - y)
6542 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6543 centersign*((point_x[2] - x)*(point_y[0] - y)
6544 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6546 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6547 /* Visual effects */
6549 && panel_contains(y, x)) {
6550 p = bolt_pict(y, x, y, x, GF_MANA);
6551 print_rel(PICT_C(p), PICT_A(p), y, x);
6552 move_cursor_relative(y, x);
6553 /*if (fresh_before)*/ Term_fresh();
6554 Term_xtra(TERM_XTRA_DELAY, msec);
6560 for (y = y1; y <= y2; y++) {
6561 for (x = x1; x <= x2; x++) {
6562 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6563 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6564 centersign*((point_x[1] - x)*(point_y[2] - y)
6565 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6566 centersign*((point_x[2] - x)*(point_y[0] - y)
6567 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6569 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6570 (void)project_f(0, 0, y, x, dam, GF_MANA);
6575 for (y = y1; y <= y2; y++) {
6576 for (x = x1; x <= x2; x++) {
6577 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6578 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6579 centersign*((point_x[1] - x)*(point_y[2] - y)
6580 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6581 centersign*((point_x[2] - x)*(point_y[0] - y)
6582 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6584 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6585 (void)project_o(0, 0, y, x, dam, GF_MANA);
6590 for (y = y1; y <= y2; y++) {
6591 for (x = x1; x <= x2; x++) {
6592 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6593 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6594 centersign*((point_x[1] - x)*(point_y[2] - y)
6595 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6596 centersign*((point_x[2] - x)*(point_y[0] - y)
6597 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6599 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6600 (void)project_m(0, 0, y, x, dam, GF_MANA,
6601 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE);
6607 msg_print(_("鏡が結界に耐えきれず、壊れてしまった。", "The field broke a mirror"));
6608 remove_mirror(point_y[0], point_x[0]);
6615 * @brief 鏡魔法「鏡の封印」の効果処理
6617 * @return 効果があったらTRUEを返す
6619 void seal_of_mirror(HIT_POINT dam)
6623 for (x = 0; x < current_floor_ptr->width; x++)
6625 for (y = 0; y < current_floor_ptr->height; y++)
6627 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
6629 if (project_m(0, 0, y, x, dam, GF_GENOCIDE,
6630 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE))
6632 if (!current_floor_ptr->grid_array[y][x].m_idx)
6634 remove_mirror(y, x);
6646 * @brief 領域魔法に応じて技能の名称を返す。
6647 * @param tval 魔法書のtval
6648 * @return 領域魔法の技能名称を保管した文字列ポインタ
6650 concptr spell_category_name(OBJECT_TYPE_VALUE tval)
6654 case TV_HISSATSU_BOOK:
6655 return _("必殺技", "art");
6657 return _("祈り", "prayer");
6659 return _("歌", "song");
6661 return _("呪文", "spell");