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.
22 #include "object-curse.h"
23 #include "player-damage.h"
24 #include "player-effects.h"
25 #include "player-race.h"
28 #include "monster-status.h"
29 #include "monster-spell.h"
31 #include "spells-status.h"
32 #include "spells-diceroll.h"
33 #include "spells-summon.h"
34 #include "monsterrace-hook.h"
42 #include "player-status.h"
43 #include "player-move.h"
44 #include "realm-hex.h"
45 #include "object-hook.h"
46 #include "object-broken.h"
47 #include "object-flavor.h"
52 #include "view-mainwindow.h"
56 static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
57 static int rakubadam_p; /*!< 落馬した際のダメージ量 */
59 int project_length = 0; /*!< 投射の射程距離 */
65 STR_OFFSET cap_nickname;
68 * @brief 歌、剣術、呪術領域情報テーブル
70 const magic_type technic_info[NUM_TECHNIC][32] =
193 * @brief 配置した鏡リストの次を取得する /
194 * Get another mirror. for SEEKER
195 * @param next_y 次の鏡のy座標を返す参照ポインタ
196 * @param next_x 次の鏡のx座標を返す参照ポインタ
197 * @param cury 現在の鏡のy座標
198 * @param curx 現在の鏡のx座標
200 static void next_mirror(POSITION* next_y, POSITION* next_x, POSITION cury, POSITION curx)
202 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
203 int mirror_num = 0; /* 鏡の数 */
207 for (x = 0; x < current_floor_ptr->width; x++)
209 for (y = 0; y < current_floor_ptr->height; y++)
211 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x])) {
212 mirror_y[mirror_num] = y;
213 mirror_x[mirror_num] = x;
220 num = randint0(mirror_num);
221 *next_y = mirror_y[num];
222 *next_x = mirror_x[num];
225 *next_y = cury + randint0(5) - 2;
226 *next_x = curx + randint0(5) - 2;
232 * Mega-Hack -- track "affected" monsters (see "project()" comments)
234 static int project_m_n; /*!< 魔法効果範囲内にいるモンスターの数 */
235 static POSITION project_m_x; /*!< 処理中のモンスターX座標 */
236 static POSITION project_m_y; /*!< 処理中のモンスターY座標 */
237 /* Mega-Hack -- monsters target */
238 static POSITION monster_target_x; /*!< モンスターの攻撃目標X座標 */
239 static POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
243 * @brief 汎用的なビーム/ボルト/ボール系による地形効果処理 / We are called from "project()" to "damage" terrain features
244 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
245 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
246 * @param y 目標Y座標 / Target y location (or location to travel "towards")
247 * @param x 目標X座標 / Target x location (or location to travel "towards")
248 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
249 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
250 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
253 * We are called both for "beam" effects and "ball" effects.
255 * The "r" parameter is the "distance from ground zero".
257 * Note that we determine if the player can "see" anything that happens
258 * by taking into account: blindness, line-of-sight, and illumination.
260 * We return "TRUE" if the effect of the projection is "obvious".
262 * We also "see" grids which are "memorized", probably a hack
264 * Perhaps we should affect doors?
267 static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
269 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
270 feature_type *f_ptr = &f_info[g_ptr->feat];
272 bool obvious = FALSE;
273 bool known = player_has_los_bold(y, x);
278 /* Reduce damage by distance */
279 dam = (dam + r) / (r + 1);
282 if (have_flag(f_ptr->flags, FF_TREE))
290 message = _("枯れた", "was blasted."); break;
292 message = _("縮んだ", "shrank."); break;
294 message = _("溶けた", "melted."); break;
297 message = _("凍り、砕け散った", "was frozen and smashed."); break;
301 message = _("燃えた", "burns up!"); break;
313 message = _("粉砕された", "was crushed."); break;
315 message = NULL; break;
319 msg_format(_("木は%s。", "A tree %s"), message);
320 cave_set_feat(y, x, one_in_(3) ? feat_brake : feat_grass);
323 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
327 /* Analyze the type */
330 /* Ignore most effects */
365 /* Destroy Traps (and Locks) */
368 /* Reveal secret doors */
369 if (is_hidden_door(g_ptr))
374 /* Check line of sight */
382 if (is_trap(g_ptr->feat))
384 /* Check line of sight */
387 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
391 /* Destroy the trap */
392 cave_alter_feat(y, x, FF_DISARM);
395 /* Locked doors are unlocked */
396 if (is_closed_door(g_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
398 FEAT_IDX old_feat = g_ptr->feat;
400 /* Unlock the door */
401 cave_alter_feat(y, x, FF_DISARM);
403 /* Check line of sound */
404 if (known && (old_feat != g_ptr->feat))
406 msg_print(_("カチッと音がした!", "Click!"));
411 /* Remove "unsafe" flag if player is not blind */
412 if (!p_ptr->blind && player_has_los_bold(y, x))
414 g_ptr->info &= ~(CAVE_UNSAFE);
422 /* Destroy Doors (and traps) */
425 /* Destroy all doors and traps */
426 if (is_trap(g_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
428 /* Check line of sight */
431 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
435 /* Destroy the feature */
436 cave_alter_feat(y, x, FF_TUNNEL);
439 /* Remove "unsafe" flag if player is not blind */
440 if (!p_ptr->blind && player_has_los_bold(y, x))
442 g_ptr->info &= ~(CAVE_UNSAFE);
450 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
452 if (have_flag(f_ptr->flags, FF_SPIKE))
454 s16b old_mimic = g_ptr->mimic;
455 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)];
457 cave_alter_feat(y, x, FF_SPIKE);
458 g_ptr->mimic = old_mimic;
463 /* Check line of sight */
464 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
466 msg_format(_("%sに何かがつっかえて開かなくなった。", "The %s seems stuck."), f_name + mimic_f_ptr->name);
473 /* Destroy walls (and doors) */
476 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
478 if (known && (g_ptr->info & (CAVE_MARK)))
480 msg_format(_("%sが溶けて泥になった!", "The %s turns into mud!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
484 /* Destroy the wall */
485 cave_alter_feat(y, x, FF_HURT_ROCK);
486 p_ptr->update |= (PU_FLOW);
494 if (!cave_naked_bold(y, x)) break;
495 if (player_bold(y, x)) break;
496 cave_set_feat(y, x, feat_door[DOOR_DOOR].closed);
497 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
509 if (!cave_naked_bold(y, x)) break;
510 if (player_bold(y, x)) break;
511 cave_set_feat(y, x, feat_tree);
512 if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
518 if (!cave_naked_bold(y, x)) break;
519 g_ptr->info |= CAVE_OBJECT;
520 g_ptr->mimic = feat_glyph;
528 if (!cave_naked_bold(y, x)) break;
529 if (player_bold(y, x)) break;
530 cave_set_feat(y, x, feat_granite);
536 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
539 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
540 cave_set_feat(y, x, feat_shallow_lava);
544 cave_set_feat(y, x, feat_deep_lava);
551 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
554 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
555 cave_set_feat(y, x, feat_shallow_water);
559 cave_set_feat(y, x, feat_deep_water);
564 /* Lite up the grid */
568 /* Turn on the light */
569 if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
571 g_ptr->info |= (CAVE_GLOW);
574 update_local_illumination(y, x);
577 if (player_can_see_bold(y, x)) obvious = TRUE;
579 /* Mega-Hack -- Update the monster in the affected grid */
580 /* This allows "spear of light" (etc) to work "correctly" */
581 if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE);
583 if (p_ptr->special_defense & NINJA_S_STEALTH)
585 if (player_bold(y, x)) set_superstealth(FALSE);
592 /* Darken the grid */
596 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(g_ptr);
599 /* Turn off the light. */
602 if (current_floor_ptr->dun_level || !is_daytime())
604 for (j = 0; j < 9; j++)
606 int by = y + ddy_ddd[j];
607 int bx = x + ddx_ddd[j];
609 if (in_bounds2(by, bx))
611 grid_type *cc_ptr = ¤t_floor_ptr->grid_array[by][bx];
613 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
624 g_ptr->info &= ~(CAVE_GLOW);
626 /* Hack -- Forget "boring" grids */
627 if (!have_flag(f_ptr->flags, FF_REMEMBER))
630 g_ptr->info &= ~(CAVE_MARK);
637 update_local_illumination(y, x);
639 if (player_can_see_bold(y, x)) obvious = TRUE;
641 /* Mega-Hack -- Update the monster in the affected grid */
642 /* This allows "spear of light" (etc) to work "correctly" */
643 if (g_ptr->m_idx) update_monster(g_ptr->m_idx, FALSE);
653 if (is_mirror_grid(g_ptr))
655 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
658 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
661 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 50))
663 if (known && (g_ptr->info & CAVE_MARK))
665 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
669 /* Destroy the wall */
670 cave_alter_feat(y, x, FF_HURT_ROCK);
671 p_ptr->update |= (PU_FLOW);
678 if (is_mirror_grid(g_ptr) && p_ptr->lev < 40)
680 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
683 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
686 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 200))
688 if (known && (g_ptr->info & CAVE_MARK))
690 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(g_ptr)].name);
694 /* Destroy the wall */
695 cave_alter_feat(y, x, FF_HURT_ROCK);
696 p_ptr->update |= (PU_FLOW);
701 case GF_DISINTEGRATE:
703 /* Destroy mirror/glyph */
704 if (is_mirror_grid(g_ptr) || is_glyph_grid(g_ptr) || is_explosive_rune_grid(g_ptr))
707 /* Permanent features don't get effect */
708 /* But not protect monsters and other objects */
709 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
711 cave_alter_feat(y, x, FF_HURT_DISI);
713 /* Update some things -- similar to GF_KILL_WALL */
714 p_ptr->update |= (PU_FLOW);
721 /* Return "Anything seen?" */
728 * @brief 汎用的なビーム/ボルト/ボール系によるアイテムオブジェクトへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
729 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
730 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
731 * @param y 目標Y座標 / Target y location (or location to travel "towards")
732 * @param x 目標X座標 / Target x location (or location to travel "towards")
733 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
734 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
735 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
738 * We are called from "project()" to "damage" objects
740 * We are called both for "beam" effects and "ball" effects.
742 * Perhaps we should only SOMETIMES damage things on the ground.
744 * The "r" parameter is the "distance from ground zero".
746 * Note that we determine if the player can "see" anything that happens
747 * by taking into account: blindness, line-of-sight, and illumination.
749 * We also "see" grids which are "memorized", probably a hack
751 * We return "TRUE" if the effect of the projection is "obvious".
754 static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
756 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
758 OBJECT_IDX this_o_idx, next_o_idx = 0;
760 bool obvious = FALSE;
761 bool known = player_has_los_bold(y, x);
763 BIT_FLAGS flgs[TR_FLAG_SIZE];
765 GAME_TEXT o_name[MAX_NLEN];
767 KIND_OBJECT_IDX k_idx = 0;
768 bool is_potion = FALSE;
773 /* Reduce damage by distance */
774 dam = (dam + r) / (r + 1);
777 /* Scan all objects in the grid */
778 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
780 object_type *o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
784 bool do_kill = FALSE;
786 concptr note_kill = NULL;
789 /* Get the "plural"-ness */
790 bool plural = (o_ptr->number > 1);
792 next_o_idx = o_ptr->next_o_idx;
793 object_flags(o_ptr, flgs);
795 /* Check for artifact */
796 if (object_is_artifact(o_ptr)) is_art = TRUE;
798 /* Analyze the type */
801 /* Acid -- Lots of things */
804 if (hates_acid(o_ptr))
807 note_kill = _("融けてしまった!", (plural ? " melt!" : " melts!"));
808 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
813 /* Elec -- Rings and Wands */
816 if (hates_elec(o_ptr))
819 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
820 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
825 /* Fire -- Flammable objects */
828 if (hates_fire(o_ptr))
831 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
832 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
837 /* Cold -- potions and flasks */
840 if (hates_cold(o_ptr))
842 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
844 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
852 if (hates_fire(o_ptr))
855 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
856 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
858 if (hates_elec(o_ptr))
862 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
863 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
871 if (hates_fire(o_ptr))
874 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
875 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
877 if (hates_cold(o_ptr))
881 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
882 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
887 /* Hack -- break potions and such */
893 if (hates_cold(o_ptr))
895 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
901 /* Mana and Chaos -- destroy everything */
907 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
911 case GF_DISINTEGRATE:
914 note_kill = _("蒸発してしまった!", (plural ? " evaporate!" : " evaporates!"));
921 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
922 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
923 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
927 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
931 if (object_is_cursed(o_ptr))
934 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
941 identify_item(o_ptr);
943 /* Auto-inscription */
944 autopick_alter_item((-this_o_idx), FALSE);
952 /* Chests are noticed only if trapped or locked */
953 if (o_ptr->tval == TV_CHEST)
955 /* Disarm/Unlock traps */
958 /* Disarm or Unlock */
959 o_ptr->pval = (0 - o_ptr->pval);
964 if (known && (o_ptr->marked & OM_FOUND))
966 msg_print(_("カチッと音がした!", "Click!"));
976 if (o_ptr->tval == TV_CORPSE)
981 if (!who || is_pet(¤t_floor_ptr->m_list[who]))
982 mode |= PM_FORCE_PET;
984 for (i = 0; i < o_ptr->number ; i++)
986 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
987 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
991 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
995 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
997 note_kill = _("生き返った。", " revived.");
1001 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
1012 /* Attempt to destroy the object */
1015 /* Effect "observed" */
1016 if (known && (o_ptr->marked & OM_FOUND))
1019 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1022 /* Artifacts, and other objects, get to resist */
1023 if (is_art || ignore)
1025 /* Observe the resist */
1026 if (known && (o_ptr->marked & OM_FOUND))
1028 msg_format(_("%sは影響を受けない!",
1029 (plural ? "The %s are unaffected!" : "The %s is unaffected!")), o_name);
1036 /* Describe if needed */
1037 if (known && (o_ptr->marked & OM_FOUND) && note_kill)
1039 msg_format(_("%sは%s", "The %s%s"), o_name, note_kill);
1042 k_idx = o_ptr->k_idx;
1043 is_potion = object_is_potion(o_ptr);
1044 delete_object_idx(this_o_idx);
1046 /* Potions produce effects when 'shattered' */
1049 (void)potion_smash_effect(who, y, x, k_idx);
1057 /* Return "Anything seen?" */
1063 * @brief 汎用的なビーム/ボルト/ボール系によるモンスターへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
1064 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
1065 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
1066 * @param y 目標Y座標 / Target y location (or location to travel "towards")
1067 * @param x 目標X座標 / Target x location (or location to travel "towards")
1068 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
1069 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
1071 * @param see_s_msg TRUEならばメッセージを表示する
1072 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
1075 * This routine takes a "source monster" (by index) which is mostly used to
1076 * determine if the player is causing the damage, and a "radius" (see below),
1077 * which is used to decrease the power of explosions with distance, and a
1078 * location, via integers which are modified by certain types of attacks
1079 * (polymorph and teleport being the obvious ones), a default damage, which
1080 * is modified as needed based on various properties, and finally a "damage
1081 * type" (see below).
1084 * Note that this routine can handle "no damage" attacks (like teleport) by
1085 * taking a "zero" damage, and can even take "parameters" to attacks (like
1086 * confuse) by accepting a "damage", using it to calculate the effect, and
1087 * then setting the damage to zero. Note that the "damage" parameter is
1088 * divided by the radius, so monsters not at the "epicenter" will not take
1089 * as much damage (or whatever)...
1092 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1093 * may result in a dereference of an invalid pointer.
1096 * Various messages are produced, and damage is applied.
1099 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1100 * actually be "made" of that substance, or "breathe" big balls of it.
1101 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1103 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1104 * and hurts evil less. If can breath nether, then it resists it as well.
1107 * Damage reductions use the following formulas:
1108 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1109 * gives avg damage of .655, ranging from .858 to .500
1110 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1111 * gives avg damage of .544, ranging from .714 to .417
1112 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1113 * gives avg damage of .444, ranging from .556 to .333
1114 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1115 * gives avg damage of .327, ranging from .427 to .250
1116 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1117 * gives something simple.
1120 * In this function, "result" messages are postponed until the end, where
1121 * the "note" string is appended to the monster name, if not NULL. So,
1122 * to make a spell have "no effect" just set "note" to NULL. You should
1123 * also set "notice" to FALSE, or the player will learn what the spell does.
1126 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1130 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)
1134 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
1136 monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
1137 monster_type *caster_ptr = (who > 0) ? ¤t_floor_ptr->m_list[who] : NULL;
1139 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1143 /* Is the monster "seen"? */
1144 bool seen = m_ptr->ml;
1145 bool seen_msg = is_seen(m_ptr);
1147 bool slept = (bool)MON_CSLEEP(m_ptr);
1149 /* Were the effects "obvious" (if seen)? */
1150 bool obvious = FALSE;
1152 /* Can the player know about this effect? */
1153 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1155 /* Were the effects "irrelevant"? */
1156 bool skipped = FALSE;
1158 /* Gets the monster angry at the source of the effect? */
1159 bool get_angry = FALSE;
1161 /* Polymorph setting (true or false) */
1162 bool do_poly = FALSE;
1164 /* Teleport setting (max distance) */
1167 /* Confusion setting (amount to confuse) */
1170 /* Stunning setting (amount to stun) */
1173 /* Sleep amount (amount to sleep) */
1176 /* Fear amount (amount to fear) */
1179 /* Time amount (amount to time) */
1182 bool heal_leper = FALSE;
1184 /* Hold the monster name */
1185 GAME_TEXT m_name[MAX_NLEN];
1188 PARAMETER_VALUE photo = 0;
1190 /* Assume no note */
1191 concptr note = NULL;
1193 /* Assume a default death */
1194 concptr note_dies = extract_note_dies(real_r_idx(m_ptr));
1196 DEPTH caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1199 if (!g_ptr->m_idx) return (FALSE);
1201 /* Never affect projector */
1202 if (who && (g_ptr->m_idx == who)) return (FALSE);
1203 if ((g_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1204 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1206 /* Don't affect already death monsters */
1207 /* Prevents problems with chain reactions of exploding monsters */
1208 if (m_ptr->hp < 0) return (FALSE);
1210 /* Reduce damage by distance */
1211 dam = (dam + r) / (r + 1);
1214 /* Get the monster name (BEFORE polymorphing) */
1215 monster_desc(m_name, m_ptr, 0);
1217 /* Get the monster possessive ("his"/"her"/"its") */
1218 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1220 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
1222 if (r_ptr->flagsr & RFR_RES_ALL &&
1223 typ != GF_OLD_CLONE && typ != GF_STAR_HEAL && typ != GF_OLD_HEAL
1224 && typ != GF_OLD_SPEED && typ != GF_CAPTURE && typ != GF_PHOTO)
1226 note = _("には完全な耐性がある!", " is immune.");
1228 if(is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1229 if(typ == GF_LITE_WEAK || typ == GF_KILL_WALL) skipped = TRUE;
1233 /* Analyze the damage type */
1236 /* Magic Missile -- pure damage */
1239 if (seen) obvious = TRUE;
1246 if (seen) obvious = TRUE;
1247 if (r_ptr->flagsr & RFR_IM_ACID)
1249 note = _("にはかなり耐性がある!", " resists a lot.");
1251 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1259 if (seen) obvious = TRUE;
1260 if (r_ptr->flagsr & RFR_IM_ELEC)
1262 note = _("にはかなり耐性がある!", " resists a lot.");
1264 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1272 if (seen) obvious = TRUE;
1273 if (r_ptr->flagsr & RFR_IM_FIRE)
1275 note = _("にはかなり耐性がある!", " resists a lot.");
1277 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1279 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1281 note = _("はひどい痛手をうけた。", " is hit hard.");
1283 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1291 if (seen) obvious = TRUE;
1292 if (r_ptr->flagsr & RFR_IM_COLD)
1294 note = _("にはかなり耐性がある!", " resists a lot.");
1296 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1298 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1300 note = _("はひどい痛手をうけた。", " is hit hard.");
1302 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1310 if (seen) obvious = TRUE;
1311 if (r_ptr->flagsr & RFR_IM_POIS)
1313 note = _("にはかなり耐性がある!", " resists a lot.");
1315 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1323 if (seen) obvious = TRUE;
1324 if (r_ptr->flagsr & RFR_IM_POIS)
1326 note = _("には耐性がある。", " resists.");
1327 dam *= 3; dam /= randint1(6) + 6;
1328 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1330 else if (one_in_(3)) do_poly = TRUE;
1334 /* Hellfire -- hurts Evil */
1337 if (seen) obvious = TRUE;
1338 if (r_ptr->flags3 & RF3_GOOD)
1340 note = _("はひどい痛手をうけた。", " is hit hard.");
1342 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1347 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1350 if (seen) obvious = TRUE;
1351 if (r_ptr->flags3 & RF3_EVIL)
1354 note = _("はひどい痛手をうけた。", " is hit hard.");
1355 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
1359 note = _("には耐性がある。", " resists.");
1360 dam *= 3; dam /= randint1(6) + 6;
1365 /* Arrow -- XXX no defense */
1368 if (seen) obvious = TRUE;
1372 /* Plasma -- XXX perhaps check ELEC or FIRE */
1375 if (seen) obvious = TRUE;
1376 if (r_ptr->flagsr & RFR_RES_PLAS)
1378 note = _("には耐性がある。", " resists.");
1379 dam *= 3; dam /= randint1(6) + 6;
1380 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
1385 /* Nether -- see above */
1388 if (seen) obvious = TRUE;
1389 if (r_ptr->flagsr & RFR_RES_NETH)
1391 if (r_ptr->flags3 & RF3_UNDEAD)
1393 note = _("には完全な耐性がある!", " is immune.");
1395 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
1399 note = _("には耐性がある。", " resists.");
1400 dam *= 3; dam /= randint1(6) + 6;
1402 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
1404 else if (r_ptr->flags3 & RF3_EVIL)
1406 note = _("はいくらか耐性を示した。", " resists somewhat.");
1408 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
1413 /* Water (acid) damage -- Water spirits/elementals are immune */
1416 if (seen) obvious = TRUE;
1417 if (r_ptr->flagsr & RFR_RES_WATE)
1419 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
1421 note = _("には完全な耐性がある!", " is immune.");
1426 note = _("には耐性がある。", " resists.");
1427 dam *= 3; dam /= randint1(6) + 6;
1429 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
1434 /* Chaos -- Chaos breathers resist */
1437 if (seen) obvious = TRUE;
1438 if (r_ptr->flagsr & RFR_RES_CHAO)
1440 note = _("には耐性がある。", " resists.");
1441 dam *= 3; dam /= randint1(6) + 6;
1442 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
1444 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
1446 note = _("はいくらか耐性を示した。", " resists somewhat.");
1447 dam *= 3; dam /= randint1(6) + 6;
1448 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
1453 do_conf = (5 + randint1(11) + r) / (r + 1);
1458 /* Shards -- Shard breathers resist */
1461 if (seen) obvious = TRUE;
1462 if (r_ptr->flagsr & RFR_RES_SHAR)
1464 note = _("には耐性がある。", " resists.");
1465 dam *= 3; dam /= randint1(6) + 6;
1466 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1471 /* Rocket: Shard resistance helps */
1474 if (seen) obvious = TRUE;
1475 if (r_ptr->flagsr & RFR_RES_SHAR)
1477 note = _("はいくらか耐性を示した。", " resists somewhat.");
1479 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1485 /* Sound -- Sound breathers resist */
1488 if (seen) obvious = TRUE;
1489 if (r_ptr->flagsr & RFR_RES_SOUN)
1491 note = _("には耐性がある。", " resists.");
1492 dam *= 2; dam /= randint1(6) + 6;
1493 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
1495 else do_stun = (10 + randint1(15) + r) / (r + 1);
1502 if (seen) obvious = TRUE;
1503 if (r_ptr->flags3 & RF3_NO_CONF)
1505 note = _("には耐性がある。", " resists.");
1506 dam *= 3; dam /= randint1(6) + 6;
1507 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1509 else do_conf = (10 + randint1(15) + r) / (r + 1);
1513 /* Disenchantment -- Breathers and Disenchanters resist */
1516 if (seen) obvious = TRUE;
1517 if (r_ptr->flagsr & RFR_RES_DISE)
1519 note = _("には耐性がある。", " resists.");
1520 dam *= 3; dam /= randint1(6) + 6;
1521 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
1526 /* Nexus -- Breathers and Existers resist */
1529 if (seen) obvious = TRUE;
1530 if (r_ptr->flagsr & RFR_RES_NEXU)
1532 note = _("には耐性がある。", " resists.");
1533 dam *= 3; dam /= randint1(6) + 6;
1534 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
1542 if (seen) obvious = TRUE;
1543 if (r_ptr->flagsr & RFR_RES_WALL)
1545 note = _("には耐性がある。", " resists.");
1546 dam *= 3; dam /= randint1(6) + 6;
1547 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
1549 else do_stun = (randint1(15) + r) / (r + 1);
1553 /* Inertia -- breathers resist */
1556 if (seen) obvious = TRUE;
1557 if (r_ptr->flagsr & RFR_RES_INER)
1559 note = _("には耐性がある。", " resists.");
1560 dam *= 3; dam /= randint1(6) + 6;
1561 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
1565 /* Powerful monsters can resist */
1566 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1567 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1571 /* Normal monsters slow down */
1574 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1576 note = _("の動きが遅くなった。", " starts moving slower.");
1583 /* Time -- breathers resist */
1586 if (seen) obvious = TRUE;
1587 if (r_ptr->flagsr & RFR_RES_TIME)
1589 note = _("には耐性がある。", " resists.");
1590 dam *= 3; dam /= randint1(6) + 6;
1591 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
1593 else do_time = (dam + 1) / 2;
1597 /* Gravity -- breathers resist */
1600 bool resist_tele = FALSE;
1602 if (seen) obvious = TRUE;
1603 if (r_ptr->flagsr & RFR_RES_TELE)
1605 if (r_ptr->flags1 & (RF1_UNIQUE))
1607 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1608 note = _("には効果がなかった。", " is unaffected!");
1611 else if (r_ptr->level > randint1(100))
1613 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1614 note = _("には耐性がある!", " resists!");
1619 if (!resist_tele) do_dist = 10;
1621 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1623 if (r_ptr->flagsr & RFR_RES_GRAV)
1625 note = _("には耐性がある!", " resists!");
1626 dam *= 3; dam /= randint1(6) + 6;
1628 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
1633 /* Powerful monsters can resist */
1634 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1635 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1639 /* Normal monsters slow down */
1642 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1644 note = _("の動きが遅くなった。", " starts moving slower.");
1649 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
1651 /* Attempt a saving throw */
1652 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1653 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1657 /* No obvious effect */
1658 note = _("には効果がなかった。", " is unaffected!");
1670 if (seen) obvious = TRUE;
1676 case GF_DISINTEGRATE:
1678 if (seen) obvious = TRUE;
1679 if (r_ptr->flags3 & RF3_HURT_ROCK)
1681 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
1682 note = _("の皮膚がただれた!", " loses some skin!");
1683 note_dies = _("は蒸発した!", " evaporates!");
1691 if (seen) obvious = TRUE;
1693 /* PSI only works if the monster can see you! -- RG */
1694 if (!(los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)))
1697 msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), m_name);
1701 if (r_ptr->flags2 & RF2_EMPTY_MIND)
1704 note = _("には完全な耐性がある!", " is immune.");
1705 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
1708 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
1709 (r_ptr->flags3 & RF3_ANIMAL) ||
1710 (r_ptr->level > randint1(3 * dam)))
1712 note = _("には耐性がある!", " resists!");
1716 * Powerful demons & undead can current_world_ptr->game_turn a mindcrafter's
1717 * attacks back on them
1719 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1720 (r_ptr->level > p_ptr->lev / 2) &&
1724 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1725 (seen ? "%^s's corrupted mind backlashes your attack!" :
1726 "%^ss corrupted mind backlashes your attack!")), m_name);
1729 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
1731 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1735 /* Injure +/- confusion */
1736 monster_desc(killer, m_ptr, MD_WRONGDOER_NAME);
1737 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1738 if (one_in_(4) && !CHECK_MULTISHADOW())
1740 switch (randint1(4))
1743 set_confused(p_ptr->confused + 3 + randint1(dam));
1746 set_stun(p_ptr->stun + randint1(dam));
1750 if (r_ptr->flags3 & RF3_NO_FEAR)
1751 note = _("には効果がなかった。", " is unaffected.");
1753 set_afraid(p_ptr->afraid + 3 + randint1(dam));
1757 if (!p_ptr->free_act)
1758 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
1767 if ((dam > 0) && one_in_(4))
1769 switch (randint1(4))
1772 do_conf = 3 + randint1(dam);
1775 do_stun = 3 + randint1(dam);
1778 do_fear = 3 + randint1(dam);
1781 note = _("は眠り込んでしまった!", " falls asleep!");
1782 do_sleep = 3 + randint1(dam);
1787 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1793 if (seen) obvious = TRUE;
1794 if (r_ptr->flags2 & RF2_EMPTY_MIND)
1797 note = _("には完全な耐性がある!", " is immune.");
1799 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
1800 (r_ptr->flags3 & RF3_ANIMAL) ||
1801 (r_ptr->level > randint1(3 * dam)))
1803 note = _("には耐性がある!", " resists!");
1807 * Powerful demons & undead can current_world_ptr->game_turn a mindcrafter's
1808 * attacks back on them
1810 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1811 (r_ptr->level > p_ptr->lev / 2) &&
1815 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1816 (seen ? "%^s's corrupted mind backlashes your attack!" :
1817 "%^ss corrupted mind backlashes your attack!")), m_name);
1819 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
1821 msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
1825 /* Injure + mana drain */
1826 monster_desc(killer, m_ptr, MD_WRONGDOER_NAME);
1827 if (!CHECK_MULTISHADOW())
1829 msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
1830 p_ptr->csp -= damroll(5, dam) / 2;
1831 if (p_ptr->csp < 0) p_ptr->csp = 0;
1832 p_ptr->redraw |= PR_MANA;
1833 p_ptr->window |= (PW_SPELL);
1835 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
1842 int b = damroll(5, dam) / 4;
1843 concptr str = (p_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
1844 concptr msg = _("あなたは%sの苦痛を%sに変換した!",
1845 (seen ? "You convert %s's pain into %s!" :
1846 "You convert %ss pain into %s!"));
1847 msg_format(msg, m_name, str);
1849 b = MIN(p_ptr->msp, p_ptr->csp + b);
1851 p_ptr->redraw |= PR_MANA;
1852 p_ptr->window |= (PW_SPELL);
1854 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
1858 case GF_TELEKINESIS:
1860 if (seen) obvious = TRUE;
1863 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1868 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
1870 /* Attempt a saving throw */
1871 if ((r_ptr->flags1 & RF1_UNIQUE) ||
1872 (r_ptr->level > 5 + randint1(dam)))
1876 /* No obvious effect */
1882 /* Psycho-spear -- powerful magic missile */
1885 if (seen) obvious = TRUE;
1889 /* Meteor -- powerful magic missile */
1892 if (seen) obvious = TRUE;
1898 if (!is_hostile(m_ptr)) break;
1899 if (seen) obvious = TRUE;
1900 /* Attempt a saving throw */
1901 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
1902 (r_ptr->flags3 & RF3_NO_CONF) ||
1903 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1905 /* Memorize a flag */
1906 if (r_ptr->flags3 & RF3_NO_CONF)
1908 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1915 * Powerful demons & undead can current_world_ptr->game_turn a mindcrafter's
1916 * attacks back on them
1918 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
1919 (r_ptr->level > p_ptr->lev / 2) &&
1923 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
1924 (seen ? "%^s's corrupted mind backlashes your attack!" :
1925 "%^ss corrupted mind backlashes your attack!")), m_name);
1928 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
1930 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1934 /* Confuse, stun, terrify */
1935 switch (randint1(4))
1938 set_stun(p_ptr->stun + dam / 2);
1941 set_confused(p_ptr->confused + dam / 2);
1945 if (r_ptr->flags3 & RF3_NO_FEAR)
1946 note = _("には効果がなかった。", " is unaffected.");
1948 set_afraid(p_ptr->afraid + dam);
1955 /* No obvious effect */
1956 note = _("には効果がなかった。", " is unaffected.");
1962 if (!common_saving_throw_charm(p_ptr, dam, m_ptr))
1964 note = _("があなたに隷属した。", " is in your thrall!");
1969 switch (randint1(4))
1983 /* No "real" damage */
1988 /* Ice -- Cold + Cuts + Stun */
1991 if (seen) obvious = TRUE;
1992 do_stun = (randint1(15) + 1) / (r + 1);
1993 if (r_ptr->flagsr & RFR_IM_COLD)
1995 note = _("にはかなり耐性がある!", " resists a lot.");
1997 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1999 else if (r_ptr->flags3 & (RF3_HURT_COLD))
2001 note = _("はひどい痛手をうけた。", " is hit hard.");
2003 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
2010 case GF_HYPODYNAMIA:
2012 if (seen) obvious = TRUE;
2013 if (!monster_living(m_ptr->r_idx))
2015 if (is_original_ap_and_seen(m_ptr))
2017 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2018 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2019 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2021 note = _("には効果がなかった。", " is unaffected.");
2025 else do_time = (dam+7)/8;
2033 if (seen) obvious = TRUE;
2034 if (!monster_living(m_ptr->r_idx))
2036 if (is_original_ap_and_seen(m_ptr))
2038 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2039 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2040 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2042 note = _("には完全な耐性がある!", " is immune.");
2046 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
2047 (randint1(888) != 666)) ||
2048 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
2049 randint1(100) != 66))
2051 note = _("には耐性がある!", " resists!");
2059 /* Polymorph monster (Use "dam" as "power") */
2062 if (seen) obvious = TRUE;
2063 /* Attempt to polymorph (see below) */
2066 /* Powerful monsters can resist */
2067 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2068 (r_ptr->flags1 & RF1_QUESTOR) ||
2069 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2071 note = _("には効果がなかった。", " is unaffected.");
2076 /* No "real" damage */
2083 /* Clone monsters (Ignore "dam") */
2086 if (seen) obvious = TRUE;
2088 if ((p_ptr->inside_arena) || is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
2090 note = _("には効果がなかった。", " is unaffected.");
2095 m_ptr->hp = m_ptr->maxhp;
2097 /* Attempt to clone. */
2098 if (multiply_monster(g_ptr->m_idx, TRUE, 0L))
2100 note = _("が分裂した!", " spawns!");
2104 /* No "real" damage */
2111 /* Heal Monster (use "dam" as amount of healing) */
2114 if (seen) obvious = TRUE;
2117 (void)set_monster_csleep(g_ptr->m_idx, 0);
2119 if (m_ptr->maxhp < m_ptr->max_maxhp)
2121 if (seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), m_name, m_poss);
2122 m_ptr->maxhp = m_ptr->max_maxhp;
2127 /* Redraw (later) if needed */
2128 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2129 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2137 if (seen) obvious = TRUE;
2140 (void)set_monster_csleep(g_ptr->m_idx, 0);
2141 if (MON_STUNNED(m_ptr))
2143 if (seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), m_name);
2144 (void)set_monster_stunned(g_ptr->m_idx, 0);
2146 if (MON_CONFUSED(m_ptr))
2148 if (seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), m_name);
2149 (void)set_monster_confused(g_ptr->m_idx, 0);
2151 if (MON_MONFEAR(m_ptr))
2153 if (seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name);
2154 (void)set_monster_monfear(g_ptr->m_idx, 0);
2158 if (m_ptr->hp < 30000) m_ptr->hp += dam;
2161 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2165 chg_virtue(V_VITALITY, 1);
2167 if (r_ptr->flags1 & RF1_UNIQUE)
2168 chg_virtue(V_INDIVIDUALISM, 1);
2170 if (is_friendly(m_ptr))
2171 chg_virtue(V_HONOUR, 1);
2172 else if (!(r_ptr->flags3 & RF3_EVIL))
2174 if (r_ptr->flags3 & RF3_GOOD)
2175 chg_virtue(V_COMPASSION, 2);
2177 chg_virtue(V_COMPASSION, 1);
2180 if (r_ptr->flags3 & RF3_ANIMAL)
2181 chg_virtue(V_NATURE, 1);
2184 if (m_ptr->r_idx == MON_LEPER)
2187 if (!who) chg_virtue(V_COMPASSION, 5);
2190 /* Redraw (later) if needed */
2191 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2192 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2194 note = _("は体力を回復したようだ。", " looks healthier.");
2196 /* No "real" damage */
2202 /* Speed Monster (Ignore "dam") */
2205 if (seen) obvious = TRUE;
2208 if (set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100))
2210 note = _("の動きが速くなった。", " starts moving faster.");
2215 if (r_ptr->flags1 & RF1_UNIQUE)
2216 chg_virtue(V_INDIVIDUALISM, 1);
2217 if (is_friendly(m_ptr))
2218 chg_virtue(V_HONOUR, 1);
2221 /* No "real" damage */
2227 /* Slow Monster (Use "dam" as "power") */
2230 if (seen) obvious = TRUE;
2232 /* Powerful monsters can resist */
2233 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2234 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2236 note = _("には効果がなかった。", " is unaffected.");
2240 /* Normal monsters slow down */
2243 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2245 note = _("の動きが遅くなった。", " starts moving slower.");
2249 /* No "real" damage */
2255 /* Sleep (Use "dam" as "power") */
2258 if (seen) obvious = TRUE;
2260 /* Attempt a saving throw */
2261 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2262 (r_ptr->flags3 & RF3_NO_SLEEP) ||
2263 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2265 /* Memorize a flag */
2266 if (r_ptr->flags3 & RF3_NO_SLEEP)
2268 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
2270 /* No obvious effect */
2271 note = _("には効果がなかった。", " is unaffected.");
2276 /* Go to sleep (much) later */
2277 note = _("は眠り込んでしまった!", " falls asleep!");
2281 /* No "real" damage */
2287 /* Sleep (Use "dam" as "power") */
2288 case GF_STASIS_EVIL:
2290 if (seen) obvious = TRUE;
2292 /* Attempt a saving throw */
2293 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2294 !(r_ptr->flags3 & RF3_EVIL) ||
2295 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2297 note = _("には効果がなかった。", " is unaffected.");
2302 /* Go to sleep (much) later */
2303 note = _("は動けなくなった!", " is suspended!");
2307 /* No "real" damage */
2312 /* Sleep (Use "dam" as "power") */
2315 if (seen) obvious = TRUE;
2317 /* Attempt a saving throw */
2318 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2319 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2321 note = _("には効果がなかった。", " is unaffected.");
2326 /* Go to sleep (much) later */
2327 note = _("は動けなくなった!", " is suspended!");
2331 /* No "real" damage */
2340 vir = virtue_number(V_HARMONY);
2343 dam += p_ptr->virtues[vir-1]/10;
2346 vir = virtue_number(V_INDIVIDUALISM);
2349 dam -= p_ptr->virtues[vir-1]/20;
2352 if (seen) obvious = TRUE;
2354 /* Attempt a saving throw */
2355 if (common_saving_throw_charm(p_ptr, dam, m_ptr))
2359 /* No obvious effect */
2360 note = _("には効果がなかった。", " is unaffected.");
2363 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2365 else if (p_ptr->cursed & TRC_AGGRAVATE)
2367 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2368 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2372 note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
2375 chg_virtue(V_INDIVIDUALISM, -1);
2376 if (r_ptr->flags3 & RF3_ANIMAL)
2377 chg_virtue(V_NATURE, 1);
2380 /* No "real" damage */
2385 /* Control undead */
2386 case GF_CONTROL_UNDEAD:
2389 if (seen) obvious = TRUE;
2391 vir = virtue_number(V_UNLIFE);
2394 dam += p_ptr->virtues[vir-1]/10;
2397 vir = virtue_number(V_INDIVIDUALISM);
2400 dam -= p_ptr->virtues[vir-1]/20;
2403 /* Attempt a saving throw */
2404 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2405 !(r_ptr->flags3 & RF3_UNDEAD))
2407 /* No obvious effect */
2408 note = _("には効果がなかった。", " is unaffected.");
2410 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2412 else if (p_ptr->cursed & TRC_AGGRAVATE)
2414 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2415 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2419 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2423 /* No "real" damage */
2429 case GF_CONTROL_DEMON:
2432 if (seen) obvious = TRUE;
2434 vir = virtue_number(V_UNLIFE);
2437 dam += p_ptr->virtues[vir-1]/10;
2440 vir = virtue_number(V_INDIVIDUALISM);
2443 dam -= p_ptr->virtues[vir-1]/20;
2446 /* Attempt a saving throw */
2447 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2448 !(r_ptr->flags3 & RF3_DEMON))
2450 /* No obvious effect */
2451 note = _("には効果がなかった。", " is unaffected.");
2453 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2455 else if (p_ptr->cursed & TRC_AGGRAVATE)
2457 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2458 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2462 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2466 /* No "real" damage */
2472 case GF_CONTROL_ANIMAL:
2475 if (seen) obvious = TRUE;
2477 vir = virtue_number(V_NATURE);
2480 dam += p_ptr->virtues[vir-1]/10;
2483 vir = virtue_number(V_INDIVIDUALISM);
2486 dam -= p_ptr->virtues[vir-1]/20;
2489 /* Attempt a saving throw */
2490 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2491 !(r_ptr->flags3 & RF3_ANIMAL))
2494 /* No obvious effect */
2495 note = _("には効果がなかった。", " is unaffected.");
2497 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2499 else if (p_ptr->cursed & TRC_AGGRAVATE)
2501 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2502 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2506 note = _("はなついた。", " is tamed!");
2508 if (r_ptr->flags3 & RF3_ANIMAL)
2509 chg_virtue(V_NATURE, 1);
2512 /* No "real" damage */
2518 case GF_CHARM_LIVING:
2522 vir = virtue_number(V_UNLIFE);
2523 if (seen) obvious = TRUE;
2525 vir = virtue_number(V_UNLIFE);
2528 dam -= p_ptr->virtues[vir-1]/10;
2531 vir = virtue_number(V_INDIVIDUALISM);
2534 dam -= p_ptr->virtues[vir-1]/20;
2537 msg_format(_("%sを見つめた。", "You stare into %s."), m_name);
2539 /* Attempt a saving throw */
2540 if (common_saving_throw_charm(p_ptr, dam, m_ptr) ||
2541 !monster_living(m_ptr->r_idx))
2544 /* No obvious effect */
2545 note = _("には効果がなかった。", " is unaffected.");
2547 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2549 else if (p_ptr->cursed & TRC_AGGRAVATE)
2551 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2552 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2556 note = _("を支配した。", " is tamed!");
2558 if (r_ptr->flags3 & RF3_ANIMAL)
2559 chg_virtue(V_NATURE, 1);
2562 /* No "real" damage */
2567 /* Confusion (Use "dam" as "power") */
2570 if (seen) obvious = TRUE;
2572 /* Get confused later */
2573 do_conf = damroll(3, (dam / 2)) + 1;
2575 /* Attempt a saving throw */
2576 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2577 (r_ptr->flags3 & (RF3_NO_CONF)) ||
2578 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2580 /* Memorize a flag */
2581 if (r_ptr->flags3 & (RF3_NO_CONF))
2583 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2589 /* No obvious effect */
2590 note = _("には効果がなかった。", " is unaffected.");
2594 /* No "real" damage */
2601 if (seen) obvious = TRUE;
2603 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2605 /* Attempt a saving throw */
2606 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2607 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2612 /* No obvious effect */
2613 note = _("には効果がなかった。", " is unaffected.");
2617 /* No "real" damage */
2622 /* Lite, but only hurts susceptible creatures */
2631 if (r_ptr->flags3 & (RF3_HURT_LITE))
2633 /* Obvious effect */
2634 if (seen) obvious = TRUE;
2636 /* Memorize the effects */
2637 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
2639 /* Special effect */
2640 note = _("は光に身をすくめた!", " cringes from the light!");
2641 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
2644 /* Normally no damage */
2656 /* Lite -- opposite of Dark */
2659 if (seen) obvious = TRUE;
2661 if (r_ptr->flagsr & RFR_RES_LITE)
2663 note = _("には耐性がある!", " resists!");
2664 dam *= 2; dam /= (randint1(6)+6);
2665 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
2667 else if (r_ptr->flags3 & (RF3_HURT_LITE))
2669 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
2670 note = _("は光に身をすくめた!", " cringes from the light!");
2671 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
2678 /* Dark -- opposite of Lite */
2681 if (seen) obvious = TRUE;
2683 if (r_ptr->flagsr & RFR_RES_DARK)
2685 note = _("には耐性がある!", " resists!");
2686 dam *= 2; dam /= (randint1(6)+6);
2687 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
2696 /* Hurt by rock remover */
2697 if (r_ptr->flags3 & (RF3_HURT_ROCK))
2700 if (seen) obvious = TRUE;
2702 /* Memorize the effects */
2703 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2705 /* Cute little message */
2706 note = _("の皮膚がただれた!", " loses some skin!");
2707 note_dies = _("はドロドロに溶けた!", " dissolves!");
2710 /* Usually, ignore the effects */
2721 /* Teleport undead (Use "dam" as "power") */
2722 case GF_AWAY_UNDEAD:
2724 /* Only affect undead */
2725 if (r_ptr->flags3 & (RF3_UNDEAD))
2727 bool resists_tele = FALSE;
2729 if (r_ptr->flagsr & RFR_RES_TELE)
2731 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2733 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2734 note = _("には効果がなかった。", " is unaffected.");
2735 resists_tele = TRUE;
2737 else if (r_ptr->level > randint1(100))
2739 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2740 note = _("には耐性がある!", " resists!");
2741 resists_tele = TRUE;
2747 if (seen) obvious = TRUE;
2748 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2760 /* No "real" damage */
2766 /* Teleport evil (Use "dam" as "power") */
2769 /* Only affect evil */
2770 if (r_ptr->flags3 & (RF3_EVIL))
2772 bool resists_tele = FALSE;
2774 if (r_ptr->flagsr & RFR_RES_TELE)
2776 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2778 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2779 note = _("には効果がなかった。", " is unaffected.");
2780 resists_tele = TRUE;
2782 else if (r_ptr->level > randint1(100))
2784 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2785 note = _("には耐性がある!", " resists!");
2786 resists_tele = TRUE;
2792 if (seen) obvious = TRUE;
2793 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2805 /* No "real" damage */
2811 /* Teleport monster (Use "dam" as "power") */
2814 bool resists_tele = FALSE;
2815 if (r_ptr->flagsr & RFR_RES_TELE)
2817 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
2819 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2820 note = _("には効果がなかった。", " is unaffected.");
2821 resists_tele = TRUE;
2823 else if (r_ptr->level > randint1(100))
2825 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2826 note = _("には耐性がある!", " resists!");
2827 resists_tele = TRUE;
2833 if (seen) obvious = TRUE;
2835 /* Prepare to teleport */
2839 /* No "real" damage */
2845 /* Turn undead (Use "dam" as "power") */
2846 case GF_TURN_UNDEAD:
2848 /* Only affect undead */
2849 if (r_ptr->flags3 & (RF3_UNDEAD))
2851 if (seen) obvious = TRUE;
2853 /* Learn about type */
2854 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2856 /* Apply some fear */
2857 do_fear = damroll(3, (dam / 2)) + 1;
2859 /* Attempt a saving throw */
2860 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
2862 /* No obvious effect */
2863 note = _("には効果がなかった。", " is unaffected.");
2876 /* No "real" damage */
2882 /* Turn evil (Use "dam" as "power") */
2885 /* Only affect evil */
2886 if (r_ptr->flags3 & (RF3_EVIL))
2888 if (seen) obvious = TRUE;
2890 /* Learn about type */
2891 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2893 /* Apply some fear */
2894 do_fear = damroll(3, (dam / 2)) + 1;
2896 /* Attempt a saving throw */
2897 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
2899 /* No obvious effect */
2900 note = _("には効果がなかった。", " is unaffected.");
2913 /* No "real" damage */
2919 /* Turn monster (Use "dam" as "power") */
2922 if (seen) obvious = TRUE;
2924 /* Apply some fear */
2925 do_fear = damroll(3, (dam / 2)) + 1;
2927 /* Attempt a saving throw */
2928 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2929 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
2930 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2932 /* No obvious effect */
2933 note = _("には効果がなかった。", " is unaffected.");
2938 /* No "real" damage */
2945 case GF_DISP_UNDEAD:
2947 /* Only affect undead */
2948 if (r_ptr->flags3 & (RF3_UNDEAD))
2950 if (seen) obvious = TRUE;
2952 /* Learn about type */
2953 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2955 note = _("は身震いした。", " shudders.");
2956 note_dies = _("はドロドロに溶けた!", " dissolves!");
2976 /* Only affect evil */
2977 if (r_ptr->flags3 & (RF3_EVIL))
2979 if (seen) obvious = TRUE;
2981 /* Learn about type */
2982 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2984 note = _("は身震いした。", " shudders.");
2985 note_dies = _("はドロドロに溶けた!", " dissolves!");
3004 /* Only affect good */
3005 if (r_ptr->flags3 & (RF3_GOOD))
3007 if (seen) obvious = TRUE;
3009 /* Learn about type */
3010 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
3012 note = _("は身震いした。", " shudders.");
3013 note_dies = _("はドロドロに溶けた!", " dissolves!");
3030 case GF_DISP_LIVING:
3032 /* Only affect non-undead */
3033 if (monster_living(m_ptr->r_idx))
3035 if (seen) obvious = TRUE;
3037 note = _("は身震いした。", " shudders.");
3038 note_dies = _("はドロドロに溶けた!", " dissolves!");
3057 /* Only affect demons */
3058 if (r_ptr->flags3 & (RF3_DEMON))
3060 if (seen) obvious = TRUE;
3062 /* Learn about type */
3063 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
3065 note = _("は身震いした。", " shudders.");
3066 note_dies = _("はドロドロに溶けた!", " dissolves!");
3082 /* Dispel monster */
3085 if (seen) obvious = TRUE;
3086 note = _("は身震いした。", " shudders.");
3087 note_dies = _("はドロドロに溶けた!", " dissolves!");
3094 if (seen) obvious = TRUE;
3095 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->a_ability_flags1 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->a_ability_flags2 & ~(RF6_NOMAGIC_MASK)))
3099 /* Heal the monster */
3100 if (caster_ptr->hp < caster_ptr->maxhp)
3103 caster_ptr->hp += dam;
3104 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
3106 /* Redraw (later) if needed */
3107 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
3108 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
3110 /* Special message */
3113 monster_desc(killer, caster_ptr, 0);
3114 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), killer);
3120 msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), m_name);
3121 (void)hp_player(dam);
3126 if (see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3135 if (seen) obvious = TRUE;
3136 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3137 /* Attempt a saving throw */
3138 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3139 (r_ptr->flags3 & RF3_NO_CONF) ||
3140 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3142 /* Memorize a flag */
3143 if (r_ptr->flags3 & (RF3_NO_CONF))
3145 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3147 note = _("には効果がなかった。", " is unaffected.");
3150 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3152 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3153 note = _("には完全な耐性がある!", " is immune.");
3156 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3158 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3159 note = _("には耐性がある。", " resists.");
3164 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3165 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3167 if (who > 0) do_conf = randint0(4) + 4;
3168 else do_conf = randint0(8) + 8;
3174 case GF_BRAIN_SMASH:
3176 if (seen) obvious = TRUE;
3177 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3179 /* Attempt a saving throw */
3180 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3181 (r_ptr->flags3 & RF3_NO_CONF) ||
3182 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3184 /* Memorize a flag */
3185 if (r_ptr->flags3 & (RF3_NO_CONF))
3187 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3189 note = _("には効果がなかった。", " is unaffected.");
3192 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3194 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3195 note = _("には完全な耐性がある!", " is immune.");
3198 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3200 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3201 note = _("には耐性がある!", " resists!");
3206 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3207 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3211 do_conf = randint0(4) + 4;
3212 do_stun = randint0(4) + 4;
3216 do_conf = randint0(8) + 8;
3217 do_stun = randint0(8) + 8;
3219 (void)set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 10);
3227 if (seen) obvious = TRUE;
3228 if (!who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), m_name);
3229 /* Attempt a saving throw */
3230 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3232 note = _("には効果がなかった。", " is unaffected.");
3241 if (seen) obvious = TRUE;
3242 if (!who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), m_name);
3243 /* Attempt a saving throw */
3244 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3246 note = _("には効果がなかった。", " is unaffected.");
3255 if (seen) obvious = TRUE;
3256 if (!who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), m_name);
3257 /* Attempt a saving throw */
3258 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3260 note = _("には効果がなかった。", " is unaffected.");
3269 if (seen) obvious = TRUE;
3271 msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
3272 "You point at %s, screaming the word, 'DIE!'."), m_name);
3273 /* Attempt a saving throw */
3274 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
3276 note = _("には効果がなかった。", " is unaffected.");
3285 if (seen) obvious = TRUE;
3286 if (r_ptr->flags1 & RF1_UNIQUE)
3288 note = _("には効果がなかった。", " is unaffected.");
3293 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
3294 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
3296 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
3298 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
3302 note = _("は耐性を持っている!", "resists!");
3309 /* Capture monster */
3313 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
3314 (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)
3316 msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3321 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
3322 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(m_ptr->r_idx))
3323 nokori_hp = m_ptr->maxhp * 3 / 10;
3325 nokori_hp = m_ptr->maxhp * 3 / 20;
3327 if (m_ptr->hp >= nokori_hp)
3329 msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), m_name);
3332 else if (m_ptr->hp < randint0(nokori_hp))
3334 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(g_ptr->m_idx, FALSE, MON_CHAMELEON);
3335 msg_format(_("%sを捕えた!", "You capture %^s!"), m_name);
3336 cap_mon = m_ptr->r_idx;
3337 cap_mspeed = m_ptr->mspeed;
3339 cap_maxhp = m_ptr->max_maxhp;
3340 cap_nickname = m_ptr->nickname; /* Quark transfer */
3341 if (g_ptr->m_idx == p_ptr->riding)
3343 if (rakuba(-1, FALSE))
3345 msg_format(_("地面に落とされた。", "You have fallen from %s."), m_name);
3349 delete_monster_idx(g_ptr->m_idx);
3355 msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), m_name);
3361 /* Attack (Use "dam" as attack type) */
3364 /* Return this monster's death */
3365 return py_attack(y, x, dam);
3368 /* Sleep (Use "dam" as "power") */
3374 if (seen) obvious = TRUE;
3375 if (r_ptr->flags2 & RF2_EMPTY_MIND)
3377 note = _("には効果がなかった。", " is unaffected.");
3380 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3383 if (MON_CSLEEP(m_ptr))
3385 note = _("には効果がなかった。", " is unaffected.");
3391 if (one_in_(5)) effect = 1;
3392 else if (one_in_(4)) effect = 2;
3393 else if (one_in_(3)) effect = 3;
3398 /* Powerful monsters can resist */
3399 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3400 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3402 note = _("には効果がなかった。", " is unaffected.");
3406 /* Normal monsters slow down */
3409 if (set_monster_slow(g_ptr->m_idx, MON_SLOW(m_ptr) + 50))
3411 note = _("の動きが遅くなった。", " starts moving slower.");
3416 else if (effect == 2)
3418 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
3420 /* Attempt a saving throw */
3421 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3422 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3427 /* No obvious effect */
3428 note = _("には効果がなかった。", " is unaffected.");
3433 else if (effect == 3)
3435 /* Attempt a saving throw */
3436 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3437 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3438 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3440 /* Memorize a flag */
3441 if (r_ptr->flags3 & RF3_NO_SLEEP)
3443 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3446 /* No obvious effect */
3447 note = _("には効果がなかった。", " is unaffected.");
3452 /* Go to sleep (much) later */
3453 note = _("は眠り込んでしまった!", " falls asleep!");
3460 note = _("には効果がなかった。", " is unaffected.");
3463 /* No "real" damage */
3471 if (seen) obvious = TRUE;
3472 if (genocide_aux(g_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
3474 if (seen_msg) msg_format(_("%sは消滅した!", "%^s disappered!"), m_name);
3475 chg_virtue(V_VITALITY, -1);
3485 if (!who) msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), m_name);
3487 if (r_ptr->flags3 & (RF3_HURT_LITE))
3489 /* Obvious effect */
3490 if (seen) obvious = TRUE;
3492 /* Memorize the effects */
3493 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3495 /* Special effect */
3496 note = _("は光に身をすくめた!", " cringes from the light!");
3497 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3500 /* Normally no damage */
3507 photo = m_ptr->r_idx;
3514 case GF_BLOOD_CURSE:
3516 if (seen) obvious = TRUE;
3522 bool success = FALSE;
3523 if (seen) obvious = TRUE;
3525 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
3527 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
3528 if (dam < 1) dam = 1;
3530 /* No need to tame your pet */
3533 note = _("の動きが速くなった。", " starts moving faster.");
3534 (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100);
3538 /* Attempt a saving throw */
3539 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3540 (r_ptr->flags1 & (RF1_UNIQUE)) ||
3541 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3542 (p_ptr->cursed & TRC_AGGRAVATE) ||
3543 ((r_ptr->level+10) > randint1(dam)))
3546 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3550 note = _("を支配した。", " is tamed!");
3552 (void)set_monster_fast(g_ptr->m_idx, MON_FAST(m_ptr) + 100);
3554 /* Learn about type */
3555 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
3562 if (!(r_ptr->flags3 & RF3_NO_FEAR))
3564 do_fear = randint1(90)+10;
3566 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
3569 /* No "real" damage */
3576 if (seen) obvious = TRUE;
3577 /* Attempt a saving throw */
3578 if (randint0(100 + dam) < (r_ptr->level + 50))
3580 note = _("には効果がなかった。", " is unaffected.");
3600 /* Absolutely no effect */
3601 if (skipped) return (FALSE);
3603 /* "Unique" monsters cannot be polymorphed */
3604 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
3606 /* Quest monsters cannot be polymorphed */
3607 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
3609 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
3611 /* "Unique" and "quest" monsters can only be "killed" by the player. */
3612 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
3614 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
3619 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
3620 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
3623 /* Modify the damage */
3625 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
3626 if ((tmp > 0) && (dam == 0)) note = _("はダメージを受けていない。", " is unharmed.");
3628 /* Check for death */
3629 if (dam > m_ptr->hp)
3631 /* Extract method of death */
3636 /* Sound and Impact resisters never stun */
3638 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
3639 !(r_ptr->flags3 & RF3_NO_STUN))
3641 if (seen) obvious = TRUE;
3644 if (MON_STUNNED(m_ptr))
3646 note = _("はひどくもうろうとした。", " is more dazed.");
3647 tmp = MON_STUNNED(m_ptr) + (do_stun / 2);
3651 note = _("はもうろうとした。", " is dazed.");
3656 (void)set_monster_stunned(g_ptr->m_idx, tmp);
3662 /* Confusion and Chaos resisters (and sleepers) never confuse */
3664 !(r_ptr->flags3 & RF3_NO_CONF) &&
3665 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
3667 if (seen) obvious = TRUE;
3669 /* Already partially confused */
3670 if (MON_CONFUSED(m_ptr))
3672 note = _("はさらに混乱したようだ。", " looks more confused.");
3673 tmp = MON_CONFUSED(m_ptr) + (do_conf / 2);
3676 /* Was not confused */
3679 note = _("は混乱したようだ。", " looks confused.");
3683 /* Apply confusion */
3684 (void)set_monster_confused(g_ptr->m_idx, tmp);
3692 if (seen) obvious = TRUE;
3694 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
3698 note = _("は弱くなったようだ。", " seems weakened.");
3699 m_ptr->maxhp -= do_time;
3700 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
3705 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
3706 if (do_poly && (randint1(90) > r_ptr->level))
3708 if (polymorph_monster(y, x))
3710 if (seen) obvious = TRUE;
3712 /* Monster polymorphs */
3713 note = _("が変身した!", " changes!");
3715 /* Turn off the damage */
3721 note = _("には効果がなかった。", " is unaffected.");
3724 /* Hack -- Get new monster */
3725 m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
3727 /* Hack -- Get new race */
3728 r_ptr = &r_info[m_ptr->r_idx];
3731 /* Handle "teleport" */
3734 if (seen) obvious = TRUE;
3736 note = _("が消え去った!", " disappears!");
3738 if (!who) chg_virtue(V_VALOUR, -1);
3741 teleport_away(g_ptr->m_idx, do_dist,
3742 (!who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
3744 /* Hack -- get new location */
3748 /* Hack -- get new grid */
3749 g_ptr = ¤t_floor_ptr->grid_array[y][x];
3756 (void)set_monster_monfear(g_ptr->m_idx, MON_MONFEAR(m_ptr) + do_fear);
3763 if (typ == GF_DRAIN_MANA)
3765 /* Drain mana does nothing */
3768 /* If another monster did the damage, hurt the monster by hand */
3771 /* Redraw (later) if needed */
3772 if (p_ptr->health_who == g_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3773 if (p_ptr->riding == g_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3775 /* Wake the monster up */
3776 (void)set_monster_csleep(g_ptr->m_idx, 0);
3778 /* Hurt the monster */
3786 if (is_pet(m_ptr) && !(m_ptr->ml))
3789 /* Give detailed messages if destroyed */
3792 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
3795 msg_format("%^s%s", m_name, note);
3799 current_floor_ptr->monster_noise = TRUE;
3803 if (who > 0) monster_gain_exp(who, m_ptr->r_idx);
3805 /* Generate treasure, etc */
3806 monster_death(g_ptr->m_idx, FALSE);
3809 delete_monster_idx(g_ptr->m_idx);
3813 msg_print(_("少し悲しい気分がした。", "You feel sad for a moment."));
3817 /* Damaged monster */
3820 /* Give detailed messages if visible or destroyed */
3821 if (note && seen_msg) msg_format("%^s%s", m_name, note);
3823 /* Hack -- Pain message */
3826 message_pain(g_ptr->m_idx, dam);
3830 current_floor_ptr->monster_noise = TRUE;
3833 /* Hack -- handle sleep */
3834 if (do_sleep) (void)set_monster_csleep(g_ptr->m_idx, do_sleep);
3838 else if (heal_leper)
3840 if (seen_msg) msg_print(_("不潔な病人は病気が治った!", "The Mangy looking leper is healed!"));
3842 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
3844 char m2_name[MAX_NLEN];
3846 monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
3847 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_HEAL_LEPER, m2_name);
3850 delete_monster_idx(g_ptr->m_idx);
3853 /* If the player did it, give him experience, check fear */
3858 /* Hurt the monster, check for fear and death */
3859 if (mon_take_hit(g_ptr->m_idx, dam, &fear, note_dies))
3864 /* Damaged monster */
3867 /* HACK - anger the monster before showing the sleep message */
3868 if (do_sleep) anger_monster(m_ptr);
3870 /* Give detailed messages if visible or destroyed */
3871 if (note && seen_msg)
3872 msg_format(_("%s%s", "%^s%s"), m_name, note);
3874 /* Hack -- Pain message */
3875 else if (known && (dam || !do_fear))
3877 message_pain(g_ptr->m_idx, dam);
3880 /* Anger monsters */
3881 if (((dam > 0) || get_angry) && !do_sleep)
3882 anger_monster(m_ptr);
3884 if ((fear || do_fear) && seen)
3887 msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
3890 /* Hack -- handle sleep */
3891 if (do_sleep) (void)set_monster_csleep(g_ptr->m_idx, do_sleep);
3895 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
3897 blood_curse_to_enemy(who);
3900 if (p_ptr->inside_battle)
3902 p_ptr->health_who = g_ptr->m_idx;
3903 p_ptr->redraw |= (PR_HEALTH);
3907 /* Verify this code */
3908 if (m_ptr->r_idx) update_monster(g_ptr->m_idx, FALSE);
3910 /* Redraw the monster grid */
3913 /* Update monster recall window */
3914 if ((p_ptr->monster_race_idx == m_ptr->r_idx) && (seen || !m_ptr->r_idx))
3916 p_ptr->window |= (PW_MONSTER);
3919 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
3923 if (!(flg & PROJECT_NO_HANGEKI))
3925 set_target(m_ptr, monster_target_y, monster_target_x);
3928 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
3930 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
3934 if (p_ptr->riding && (p_ptr->riding == g_ptr->m_idx) && (dam > 0))
3936 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
3937 rakubadam_m = (dam > 200) ? 200 : dam;
3947 /* Prepare to make a Blade of Chaos */
3948 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
3950 q_ptr->pval = photo;
3952 /* Mark the item as fully known */
3953 q_ptr->ident |= (IDENT_MENTAL);
3954 (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
3962 /* Return "Anything seen?" */
3967 * @brief 汎用的なビーム/ボルト/ボール系によるプレイヤーへの効果処理 / Helper function for "project()" below.
3968 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
3969 * @param who_name 効果を起こしたモンスターの名前
3970 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
3971 * @param y 目標Y座標 / Target y location (or location to travel "towards")
3972 * @param x 目標X座標 / Target x location (or location to travel "towards")
3973 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
3974 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
3976 * @param monspell 効果元のモンスター魔法ID
3977 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
3979 * Handle a beam/bolt/ball causing damage to the player.
3980 * This routine takes a "source monster" (by index), a "distance", a default
3981 * "damage", and a "damage type". See "project_m()" above.
3982 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
3983 * is reduced (see "project_m()" above). This can happen if a monster breathes
3984 * at the player and hits a wall instead.
3985 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
3986 * to know if this is actually a ball or a bolt spell
3987 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
3988 * we just assume that the effects were obvious, for historical reasons.
3990 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)
3995 /* Hack -- assume obvious */
3996 bool obvious = TRUE;
3998 /* Player blind-ness */
3999 bool blind = (p_ptr->blind ? TRUE : FALSE);
4001 /* Player needs a "description" (he is blind) */
4004 /* Source monster */
4005 monster_type *m_ptr = NULL;
4007 /* Monster name (for attacks) */
4008 GAME_TEXT m_name[MAX_NLEN];
4010 /* Monster name (for damage) */
4013 /* Hack -- messages */
4019 /* Player is not here */
4020 if (!player_bold(y, x)) return (FALSE);
4022 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
4024 if (kawarimi(TRUE)) return FALSE;
4027 /* Player cannot hurt himself */
4028 if (!who) return (FALSE);
4029 if (who == p_ptr->riding) return (FALSE);
4031 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
4034 int max_attempts = 10;
4035 sound(SOUND_REFLECT);
4038 msg_print(_("何かが跳ね返った!", "Something bounces!"));
4039 else if (p_ptr->special_defense & KATA_FUUJIN)
4040 msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
4042 msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
4045 /* Choose 'new' target */
4050 t_y = current_floor_ptr->m_list[who].fy - 1 + randint1(3);
4051 t_x = current_floor_ptr->m_list[who].fx - 1 + randint1(3);
4054 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(p_ptr->y, p_ptr->x, t_y, t_x));
4056 if (max_attempts < 1)
4058 t_y = current_floor_ptr->m_list[who].fy;
4059 t_x = current_floor_ptr->m_list[who].fx;
4064 t_y = p_ptr->y - 1 + randint1(3);
4065 t_x = p_ptr->x - 1 + randint1(3);
4068 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
4070 disturb(TRUE, TRUE);
4074 /* Limit maximum damage */
4075 if (dam > 1600) dam = 1600;
4077 /* Reduce damage by distance */
4078 dam = (dam + r) / (r + 1);
4081 /* If the player is blind, be more descriptive */
4082 if (blind) fuzzy = TRUE;
4087 m_ptr = ¤t_floor_ptr->m_list[who];
4088 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
4089 monster_desc(m_name, m_ptr, 0);
4091 /* Get the monster's real name (gotten before polymorph!) */
4092 strcpy(killer, who_name);
4098 case PROJECT_WHO_UNCTRL_POWER:
4099 strcpy(killer, _("制御できない力の氾流", "uncontrollable power storm"));
4102 case PROJECT_WHO_GLASS_SHARDS:
4103 strcpy(killer, _("ガラスの破片", "shards of glass"));
4107 strcpy(killer, _("罠", "a trap"));
4110 strcpy(m_name, killer);
4113 /* Analyze the damage */
4116 /* Standard damage -- hurts p_ptr->inventory_list too */
4119 if (fuzzy) msg_print(_("酸で攻撃された!", "You are hit by acid!"));
4120 get_damage = acid_dam(dam, killer, monspell, FALSE);
4124 /* Standard damage -- hurts p_ptr->inventory_list too */
4127 if (fuzzy) msg_print(_("火炎で攻撃された!", "You are hit by fire!"));
4128 get_damage = fire_dam(dam, killer, monspell, FALSE);
4132 /* Standard damage -- hurts p_ptr->inventory_list too */
4135 if (fuzzy) msg_print(_("冷気で攻撃された!", "You are hit by cold!"));
4136 get_damage = cold_dam(dam, killer, monspell, FALSE);
4140 /* Standard damage -- hurts p_ptr->inventory_list too */
4143 if (fuzzy) msg_print(_("電撃で攻撃された!", "You are hit by lightning!"));
4144 get_damage = elec_dam(dam, killer, monspell, FALSE);
4148 /* Standard damage -- also poisons player */
4151 bool double_resist = IS_OPPOSE_POIS();
4152 if (fuzzy) msg_print(_("毒で攻撃された!", "You are hit by poison!"));
4154 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
4155 if (double_resist) dam = (dam + 2) / 3;
4157 if ((!(double_resist || p_ptr->resist_pois)) && one_in_(HURT_CHANCE) && !CHECK_MULTISHADOW())
4162 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4164 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4166 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4171 /* Standard damage -- also poisons / mutates player */
4174 bool double_resist = IS_OPPOSE_POIS();
4175 if (fuzzy) msg_print(_("放射能で攻撃された!", "You are hit by radiation!"));
4177 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
4178 if (double_resist) dam = (2 * dam + 2) / 5;
4179 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4180 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4182 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4184 if (one_in_(5)) /* 6 */
4186 msg_print(_("奇形的な変身を遂げた!", "You undergo a freakish metamorphosis!"));
4187 if (one_in_(4)) /* 4 */
4195 inven_damage(set_acid_destroy, 2);
4201 /* Standard damage */
4204 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4205 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4209 /* Holy Orb -- Player only takes partial damage */
4212 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4213 if (p_ptr->align > 10)
4215 else if (p_ptr->align < -10)
4217 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4223 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4224 if (p_ptr->align > 10)
4226 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4230 /* Arrow -- XXX no dodging */
4235 msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
4237 else if ((p_ptr->inventory_list[INVEN_RARM].name1 == ART_ZANTETSU) || (p_ptr->inventory_list[INVEN_LARM].name1 == ART_ZANTETSU))
4239 msg_print(_("矢を斬り捨てた!", "You cut down the arrow!"));
4242 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4246 /* Plasma -- XXX No resist */
4249 if (fuzzy) msg_print(_("何かとても熱いもので攻撃された!", "You are hit by something *HOT*!"));
4250 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4252 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4254 int plus_stun = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
4255 (void)set_stun(p_ptr->stun + plus_stun);
4258 if (!(p_ptr->resist_fire || IS_OPPOSE_FIRE() || p_ptr->immune_fire))
4260 inven_damage(set_acid_destroy, 3);
4266 /* Nether -- drain experience */
4269 if (fuzzy) msg_print(_("地獄の力で攻撃された!", "You are hit by nether forces!"));
4270 if (p_ptr->resist_neth)
4272 if (!prace_is_(RACE_SPECTRE))
4274 dam *= 6; dam /= (randint1(4) + 7);
4277 else if (!CHECK_MULTISHADOW()) drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
4279 if (prace_is_(RACE_SPECTRE) && !CHECK_MULTISHADOW())
4281 msg_print(_("気分がよくなった。", "You feel invigorated!"));
4283 learn_spell(monspell);
4287 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4293 /* Water -- stun/confuse */
4296 if (fuzzy) msg_print(_("何か湿ったもので攻撃された!", "You are hit by something wet!"));
4297 if (!CHECK_MULTISHADOW())
4299 if (!p_ptr->resist_sound && !p_ptr->resist_water)
4301 set_stun(p_ptr->stun + randint1(40));
4303 if (!p_ptr->resist_conf && !p_ptr->resist_water)
4305 set_confused(p_ptr->confused + randint1(5) + 5);
4308 if (one_in_(5) && !p_ptr->resist_water)
4310 inven_damage(set_cold_destroy, 3);
4313 if (p_ptr->resist_water) get_damage /= 4;
4316 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4320 /* Chaos -- many effects */
4323 if (fuzzy) msg_print(_("無秩序の波動で攻撃された!", "You are hit by a wave of anarchy!"));
4324 if (p_ptr->resist_chaos)
4326 dam *= 6; dam /= (randint1(4) + 7);
4329 if (!CHECK_MULTISHADOW())
4331 if (!p_ptr->resist_conf)
4333 (void)set_confused(p_ptr->confused + randint0(20) + 10);
4335 if (!p_ptr->resist_chaos)
4337 (void)set_image(p_ptr->image + randint1(10));
4340 msg_print(_("あなたの身体はカオスの力で捻じ曲げられた!", "Your body is twisted by chaos!"));
4341 (void)gain_mutation(p_ptr, 0);
4344 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
4346 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
4349 if (!p_ptr->resist_chaos || one_in_(9))
4351 inven_damage(set_elec_destroy, 2);
4352 inven_damage(set_fire_destroy, 2);
4356 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4360 /* Shards -- mostly cutting */
4363 if (fuzzy) msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
4364 if (p_ptr->resist_shard)
4366 dam *= 6; dam /= (randint1(4) + 7);
4368 else if (!CHECK_MULTISHADOW())
4370 (void)set_cut(p_ptr->cut + dam);
4373 if (!p_ptr->resist_shard || one_in_(13))
4375 inven_damage(set_cold_destroy, 2);
4378 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4382 /* Sound -- mostly stunning */
4385 if (fuzzy) msg_print(_("轟音で攻撃された!", "You are hit by a loud noise!"));
4386 if (p_ptr->resist_sound)
4388 dam *= 5; dam /= (randint1(4) + 7);
4390 else if (!CHECK_MULTISHADOW())
4392 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
4393 (void)set_stun(p_ptr->stun + plus_stun);
4396 if (!p_ptr->resist_sound || one_in_(13))
4398 inven_damage(set_cold_destroy, 2);
4401 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4405 /* Pure confusion */
4408 if (fuzzy) msg_print(_("何か混乱するもので攻撃された!", "You are hit by something puzzling!"));
4409 if (p_ptr->resist_conf)
4411 dam *= 5; dam /= (randint1(4) + 7);
4413 else if (!CHECK_MULTISHADOW())
4415 (void)set_confused(p_ptr->confused + randint1(20) + 10);
4417 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4421 /* Disenchantment -- see above */
4424 if (fuzzy) msg_print(_("何かさえないもので攻撃された!", "You are hit by something static!"));
4425 if (p_ptr->resist_disen)
4427 dam *= 6; dam /= (randint1(4) + 7);
4429 else if (!CHECK_MULTISHADOW())
4431 (void)apply_disenchant(0);
4433 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4437 /* Nexus -- see above */
4440 if (fuzzy) msg_print(_("何か奇妙なもので攻撃された!", "You are hit by something strange!"));
4441 if (p_ptr->resist_nexus)
4443 dam *= 6; dam /= (randint1(4) + 7);
4445 else if (!CHECK_MULTISHADOW())
4449 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4453 /* Force -- mostly stun */
4456 if (fuzzy) msg_print(_("運動エネルギーで攻撃された!", "You are hit by kinetic force!"));
4457 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4459 (void)set_stun(p_ptr->stun + randint1(20));
4461 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4466 /* Rocket -- stun, cut */
4469 if (fuzzy) msg_print(_("爆発があった!", "There is an explosion!"));
4470 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
4472 (void)set_stun(p_ptr->stun + randint1(20));
4475 if (p_ptr->resist_shard)
4479 else if (!CHECK_MULTISHADOW())
4481 (void)set_cut(p_ptr->cut + (dam / 2));
4484 if (!p_ptr->resist_shard || one_in_(12))
4486 inven_damage(set_cold_destroy, 3);
4489 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4493 /* Inertia -- slowness */
4496 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
4497 if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4498 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4502 /* Lite -- blinding */
4505 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4506 if (p_ptr->resist_lite)
4508 dam *= 4; dam /= (randint1(4) + 7);
4510 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
4512 (void)set_blind(p_ptr->blind + randint1(5) + 2);
4515 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
4517 if (!CHECK_MULTISHADOW()) msg_print(_("光で肉体が焦がされた!", "The light scorches your flesh!"));
4520 else if (prace_is_(RACE_S_FAIRY))
4525 if (p_ptr->wraith_form) dam *= 2;
4526 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4528 if (p_ptr->wraith_form && !CHECK_MULTISHADOW())
4530 p_ptr->wraith_form = 0;
4531 msg_print(_("閃光のため非物質的な影の存在でいられなくなった。",
4532 "The light forces you out of your incorporeal shadow form."));
4534 p_ptr->redraw |= (PR_MAP | PR_STATUS);
4535 p_ptr->update |= (PU_MONSTERS);
4536 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4542 /* Dark -- blinding */
4545 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4546 if (p_ptr->resist_dark)
4548 dam *= 4; dam /= (randint1(4) + 7);
4550 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
4552 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
4554 (void)set_blind(p_ptr->blind + randint1(5) + 2);
4556 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4560 /* Time -- bolt fewer effects XXX */
4563 if (fuzzy) msg_print(_("過去からの衝撃に攻撃された!", "You are hit by a blast from the past!"));
4564 if (p_ptr->resist_time)
4567 dam /= (randint1(4) + 7);
4568 msg_print(_("時間が通り過ぎていく気がする。", "You feel as if time is passing you by."));
4570 else if (!CHECK_MULTISHADOW())
4572 switch (randint1(10))
4574 case 1: case 2: case 3: case 4: case 5:
4576 if (p_ptr->prace == RACE_ANDROID) break;
4577 msg_print(_("人生が逆戻りした気がする。", "You feel life has clocked back."));
4578 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
4582 case 6: case 7: case 8: case 9:
4584 switch (randint1(6))
4586 case 1: k = A_STR; act = _("強く", "strong"); break;
4587 case 2: k = A_INT; act = _("聡明で", "bright"); break;
4588 case 3: k = A_WIS; act = _("賢明で", "wise"); break;
4589 case 4: k = A_DEX; act = _("器用で", "agile"); break;
4590 case 5: k = A_CON; act = _("健康で", "hale"); break;
4591 case 6: k = A_CHR; act = _("美しく", "beautiful"); break;
4594 msg_format(_("あなたは以前ほど%sなくなってしまった...。",
4595 "You're not as %s as you used to be..."), act);
4597 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
4598 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
4599 p_ptr->update |= (PU_BONUS);
4605 msg_print(_("あなたは以前ほど力強くなくなってしまった...。",
4606 "You're not as powerful as you used to be..."));
4608 for (k = 0; k < A_MAX; k++)
4610 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
4611 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
4613 p_ptr->update |= (PU_BONUS);
4619 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4623 /* Gravity -- stun plus slowness plus teleport */
4626 if (fuzzy) msg_print(_("何か重いもので攻撃された!", "You are hit by something heavy!"));
4627 msg_print(_("周辺の重力がゆがんだ。", "Gravity warps around you."));
4629 if (!CHECK_MULTISHADOW())
4631 teleport_player(5, TELEPORT_PASSIVE);
4632 if (!p_ptr->levitation)
4633 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4634 if (!(p_ptr->resist_sound || p_ptr->levitation))
4636 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
4637 (void)set_stun(p_ptr->stun + plus_stun);
4640 if (p_ptr->levitation)
4642 dam = (dam * 2) / 3;
4645 if (!p_ptr->levitation || one_in_(13))
4647 inven_damage(set_cold_destroy, 2);
4650 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4654 /* Standard damage */
4655 case GF_DISINTEGRATE:
4657 if (fuzzy) msg_print(_("純粋なエネルギーで攻撃された!", "You are hit by pure energy!"));
4659 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4665 if (fuzzy) msg_print(_("何らかの攻撃によって気分がよくなった。", "You are hit by something invigorating!"));
4667 (void)hp_player(dam);
4674 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4675 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
4682 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
4683 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4689 if (p_ptr->free_act) break;
4690 if (fuzzy) msg_print(_("眠ってしまった!", "You fall asleep!"));
4692 if (ironman_nightmare)
4694 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
4695 /* Have some nightmares */
4696 sanity_blast(NULL, FALSE);
4699 set_paralyzed(p_ptr->paralyzed + dam);
4709 if (fuzzy) msg_print(_("魔法のオーラで攻撃された!", "You are hit by an aura of magic!"));
4710 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4717 if (fuzzy) msg_print(_("エネルギーの塊で攻撃された!", "You are hit by an energy!"));
4718 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
4725 if (fuzzy) msg_print(_("何かが空からあなたの頭上に落ちてきた!", "Something falls from the sky on you!"));
4727 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4728 if (!p_ptr->resist_shard || one_in_(13))
4730 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
4731 inven_damage(set_cold_destroy, 2);
4737 /* Ice -- cold plus stun plus cuts */
4740 if (fuzzy) msg_print(_("何か鋭く冷たいもので攻撃された!", "You are hit by something sharp and cold!"));
4741 get_damage = cold_dam(dam, killer, monspell, FALSE);
4742 if (!CHECK_MULTISHADOW())
4744 if (!p_ptr->resist_shard)
4746 (void)set_cut(p_ptr->cut + damroll(5, 8));
4748 if (!p_ptr->resist_sound)
4750 (void)set_stun(p_ptr->stun + randint1(15));
4753 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
4755 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
4765 if (fuzzy) msg_print(_("何か非常に冷たいもので攻撃された!", "You are hit by something extremely cold!"));
4767 if (p_ptr->mimic_form)
4769 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
4770 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4775 switch (p_ptr->prace)
4777 /* Some races are immune */
4791 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4803 if (CHECK_MULTISHADOW())
4805 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
4807 else if (p_ptr->csp)
4811 msg_format(_("%^sに精神エネルギーを吸い取られてしまった!", "%^s draws psychic energy from you!"), m_name);
4813 msg_print(_("精神エネルギーを吸い取られてしまった!", "Your psychic energy is drawn!"));
4816 if (dam >= p_ptr->csp)
4820 p_ptr->csp_frac = 0;
4829 learn_spell(monspell);
4830 p_ptr->redraw |= (PR_MANA);
4831 p_ptr->window |= (PW_PLAYER | PW_SPELL);
4835 /* Heal the monster */
4836 if (m_ptr->hp < m_ptr->maxhp)
4840 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
4842 /* Redraw (later) if needed */
4843 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4844 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4846 /* Special message */
4849 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), m_name);
4862 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
4864 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4865 learn_spell(monspell);
4869 if (!CHECK_MULTISHADOW())
4871 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
4873 if (!p_ptr->resist_conf)
4875 (void)set_confused(p_ptr->confused + randint0(4) + 4);
4878 if (!p_ptr->resist_chaos && one_in_(3))
4880 (void)set_image(p_ptr->image + randint0(250) + 150);
4887 p_ptr->csp_frac = 0;
4889 p_ptr->redraw |= PR_MANA;
4892 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4898 case GF_BRAIN_SMASH:
4900 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
4902 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4903 learn_spell(monspell);
4907 if (!CHECK_MULTISHADOW())
4909 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
4915 p_ptr->csp_frac = 0;
4917 p_ptr->redraw |= PR_MANA;
4920 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4921 if (!CHECK_MULTISHADOW())
4923 if (!p_ptr->resist_blind)
4925 (void)set_blind(p_ptr->blind + 8 + randint0(8));
4927 if (!p_ptr->resist_conf)
4929 (void)set_confused(p_ptr->confused + randint0(4) + 4);
4931 if (!p_ptr->free_act)
4933 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
4935 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4937 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
4938 (void)do_dec_stat(A_INT);
4939 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
4940 (void)do_dec_stat(A_WIS);
4942 if (!p_ptr->resist_chaos)
4944 (void)set_image(p_ptr->image + randint0(250) + 150);
4954 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4956 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4957 learn_spell(monspell);
4961 if (!CHECK_MULTISHADOW()) curse_equipment(15, 0);
4962 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4970 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4972 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4973 learn_spell(monspell);
4977 if (!CHECK_MULTISHADOW()) curse_equipment(25, MIN(rlev / 2 - 15, 5));
4978 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4986 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
4988 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
4989 learn_spell(monspell);
4993 if (!CHECK_MULTISHADOW()) curse_equipment(33, MIN(rlev / 2 - 15, 15));
4994 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5002 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU) && !CHECK_MULTISHADOW())
5004 msg_print(_("しかし秘孔を跳ね返した!", "You resist the effects!"));
5005 learn_spell(monspell);
5009 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5010 if (!CHECK_MULTISHADOW()) (void)set_cut(p_ptr->cut + damroll(10, 10));
5018 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5020 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5021 learn_spell(monspell);
5025 if (!CHECK_MULTISHADOW())
5027 msg_print(_("あなたは命が薄まっていくように感じた!", "You feel your life fade away!"));
5028 curse_equipment(40, 20);
5031 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
5033 if (p_ptr->chp < 1) p_ptr->chp = 1;
5048 /* Hex - revenge damage stored */
5049 revenge_store(get_damage);
5051 if ((p_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
5052 && (get_damage > 0) && !p_ptr->is_dead && (who > 0))
5054 GAME_TEXT m_name_self[80];
5057 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
5059 msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), m_name, m_name_self);
5060 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
5061 if (p_ptr->tim_eyeeye) set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
5064 if (p_ptr->riding && dam > 0)
5066 rakubadam_p = (dam > 200) ? 200 : dam;
5070 disturb(TRUE, TRUE);
5073 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
5075 (void)kawarimi(FALSE);
5078 /* Return "Anything seen?" */
5084 * Find the distance from (x, y) to a line.
5086 POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
5088 /* Vector from (x, y) to (x1, y1) */
5089 POSITION py = y1 - y;
5090 POSITION px = x1 - x;
5093 POSITION ny = x2 - x1;
5094 POSITION nx = y1 - y2;
5097 POSITION pd = distance(y1, x1, y, x);
5098 POSITION nd = distance(y1, x1, y2, x2);
5100 if (pd > nd) return distance(y, x, y2, x2);
5102 /* Component of P on N */
5103 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
5105 /* Absolute value */
5106 return((nd >= 0) ? nd : 0 - nd);
5113 * Modified version of los() for calculation of disintegration balls.
5114 * Disintegration effects are stopped by permanent walls.
5116 bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
5118 POSITION dx, dy; /* Delta */
5119 POSITION ax, ay; /* Absolute */
5120 POSITION sx, sy; /* Signs */
5121 POSITION qx, qy; /* Fractions */
5122 POSITION tx, ty; /* Scanners */
5123 POSITION f1, f2; /* Scale factors */
5124 POSITION m; /* Slope, or 1/Slope, of LOS */
5126 /* Extract the offset */
5130 /* Extract the absolute offset */
5134 /* Handle adjacent (or identical) grids */
5135 if ((ax < 2) && (ay < 2)) return (TRUE);
5137 /* Paranoia -- require "safe" origin */
5138 /* if (!in_bounds(y1, x1)) return (FALSE); */
5140 /* Directly South/North */
5143 /* South -- check for walls */
5146 for (ty = y1 + 1; ty < y2; ty++)
5148 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5152 /* North -- check for walls */
5155 for (ty = y1 - 1; ty > y2; ty--)
5157 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5165 /* Directly East/West */
5168 /* East -- check for walls */
5171 for (tx = x1 + 1; tx < x2; tx++)
5173 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5177 /* West -- check for walls */
5180 for (tx = x1 - 1; tx > x2; tx--)
5182 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5190 /* Extract some signs */
5191 sx = (dx < 0) ? -1 : 1;
5192 sy = (dy < 0) ? -1 : 1;
5194 /* Vertical "knights" */
5199 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
5203 /* Horizontal "knights" */
5208 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
5212 /* Calculate scale factor div 2 */
5215 /* Calculate scale factor */
5219 /* Travel horizontally */
5222 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
5228 /* Consider the special case where slope == 1. */
5239 /* Note (below) the case (qy == f2), where */
5240 /* the LOS exactly meets the corner of a tile. */
5243 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5254 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5267 /* Travel vertically */
5270 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
5286 /* Note (below) the case (qx == f2), where */
5287 /* the LOS exactly meets the corner of a tile. */
5290 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5301 if (cave_stop_disintegration(ty, tx)) return (FALSE);
5322 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)
5327 int brev = rad * rad / dist;
5331 int mdis = distance(y1, x1, y2, x2) + rad;
5333 while (bdis <= mdis)
5337 if ((0 < dist) && (path_n < dist))
5339 POSITION ny = GRID_Y(path_g[path_n]);
5340 POSITION nx = GRID_X(path_g[path_n]);
5341 POSITION nd = distance(ny, nx, y1, x1);
5343 /* Get next base point */
5352 /* Travel from center outward */
5353 for (cdis = 0; cdis <= brad; cdis++)
5355 /* Scan the maximal blast area of radius "cdis" */
5356 for (y = by - cdis; y <= by + cdis; y++)
5358 for (x = bx - cdis; x <= bx + cdis; x++)
5360 /* Ignore "illegal" locations */
5361 if (!in_bounds(y, x)) continue;
5363 /* Enforce a circular "ripple" */
5364 if (distance(y1, x1, y, x) != bdis) continue;
5366 /* Enforce an arc */
5367 if (distance(by, bx, y, x) != cdis) continue;
5373 /* Lights are stopped by opaque terrains */
5374 if (!los(by, bx, y, x)) continue;
5376 case GF_DISINTEGRATE:
5377 /* Disintegration are stopped only by perma-walls */
5378 if (!in_disintegration_range(by, bx, y, x)) continue;
5381 /* Ball explosions are stopped by walls */
5382 if (!projectable(by, bx, y, x)) continue;
5386 /* Save this grid */
5394 /* Encode some more "radius" info */
5395 gm[bdis + 1] = *pgrids;
5397 /* Increase the size */
5398 brad = rad * (path_n + brev) / (dist + brev);
5400 /* Find the next ripple */
5404 /* Store the effect size */
5410 * @brief 汎用的なビーム/ボルト/ボール系処理のルーチン Generic "beam"/"bolt"/"ball" projection routine.
5411 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
5412 * @param rad 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
5413 * @param y 目標Y座標 / Target y location (or location to travel "towards")
5414 * @param x 目標X座標 / Target x location (or location to travel "towards")
5415 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
5416 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
5417 * @param flg 効果フラグ / Extra bit flags (see PROJECT_xxxx in "defines.h")
5418 * @param monspell 効果元のモンスター魔法ID
5419 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
5422 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
5423 * towards a given location (optionally passing over the heads of interposing
5424 * monsters), and have it do a given amount of damage to the monsters (and
5425 * optionally objects) within the given radius of the final location.
5427 * A "bolt" travels from source to target and affects only the target grid.
5428 * A "beam" travels from source to target, affecting all grids passed through.
5429 * A "ball" travels from source to the target, exploding at the target, and
5430 * affecting everything within the given radius of the target location.
5432 * Traditionally, a "bolt" does not affect anything on the ground, and does
5433 * not pass over the heads of interposing monsters, much like a traditional
5434 * missile, and will "stop" abruptly at the "target" even if no monster is
5435 * positioned there, while a "ball", on the other hand, passes over the heads
5436 * of monsters between the source and target, and affects everything except
5437 * the source monster which lies within the final radius, while a "beam"
5438 * affects every monster between the source and target, except for the casting
5439 * monster (or player), and rarely affects things on the ground.
5441 * Two special flags allow us to use this function in special ways, the
5442 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
5443 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
5444 * actually projecting from the source monster (or player).
5446 * The player will only get "experience" for monsters killed by himself
5447 * Unique monsters can only be destroyed by attacks from the player
5449 * Only 256 grids can be affected per projection, limiting the effective
5450 * "radius" of standard ball attacks to nine units (diameter nineteen).
5452 * One can project in a given "direction" by combining PROJECT_THRU with small
5453 * offsets to the initial location (see "line_spell()"), or by calculating
5454 * "virtual targets" far away from the player.
5456 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
5457 * continuing until it actually hits somethings (useful for "stone to mud").
5459 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
5461 * Balls must explode BEFORE hitting walls, or they would affect monsters
5462 * on both sides of a wall. Some bug reports indicate that this is still
5463 * happening in 2.7.8 for Windows, though it appears to be impossible.
5465 * We "pre-calculate" the blast area only in part for efficiency.
5466 * More importantly, this lets us do "explosions" from the "inside" out.
5467 * This results in a more logical distribution of "blast" treasure.
5468 * It also produces a better (in my opinion) animation of the explosion.
5469 * It could be (but is not) used to have the treasure dropped by monsters
5470 * in the middle of the explosion fall "outwards", and then be damaged by
5471 * the blast as it spreads outwards towards the treasure drop location.
5473 * Walls and doors are included in the blast area, so that they can be
5474 * "burned" or "melted" in later versions.
5476 * This algorithm is intended to maximize simplicity, not necessarily
5477 * efficiency, since this function is not a bottleneck in the code.
5479 * We apply the blast effect from ground zero outwards, in several passes,
5480 * first affecting features, then objects, then monsters, then the player.
5481 * This allows walls to be removed before checking the object or monster
5482 * in the wall, and protects objects which are dropped by monsters killed
5483 * in the blast, and allows the player to see all affects before he is
5484 * killed or teleported away. The semantics of this method are open to
5485 * various interpretations, but they seem to work well in practice.
5487 * We process the blast area from ground-zero outwards to allow for better
5488 * distribution of treasure dropped by monsters, and because it provides a
5489 * pleasing visual effect at low cost.
5491 * Note that the damage done by "ball" explosions decreases with distance.
5492 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
5494 * Notice the "napalm" effect of "beam" weapons. First they "project" to
5495 * the target, and then the damage "flows" along this beam of destruction.
5496 * The damage at every grid is the same as at the "center" of a "ball"
5497 * explosion, since the "beam" grids are treated as if they ARE at the
5498 * center of a "ball" explosion.
5500 * Currently, specifying "beam" plus "ball" means that locations which are
5501 * covered by the initial "beam", and also covered by the final "ball", except
5502 * for the final grid (the epicenter of the ball), will be "hit twice", once
5503 * by the initial beam, and once by the exploding ball. For the grid right
5504 * next to the epicenter, this results in 150% damage being done. The center
5505 * does not have this problem, for the same reason the final grid in a "beam"
5506 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
5507 * grids which are covered by the "ball" will NOT work, as then they will
5508 * receive LESS damage than they should. Do not combine "beam" with "ball".
5510 * The array "gy[],gx[]" with current size "grids" is used to hold the
5511 * collected locations of all grids in the "blast area" plus "beam path".
5513 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
5514 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
5515 * first blast grid (see above) with radius "N" from the blast center. Note
5516 * that only the first gm[1] grids in the blast area thus take full damage.
5517 * Also, note that gm[rad+1] is always equal to "grids", which is the total
5518 * number of blast grids.
5520 * Note that once the projection is complete, (y2,x2) holds the final location
5521 * of bolts/beams, and the "epicenter" of balls.
5523 * Note also that "rad" specifies the "inclusive" radius of projection blast,
5524 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
5525 * implementation of the "distance" function. Also, a bolt can be properly
5526 * viewed as a "ball" with a "rad" of "zero".
5528 * Note that if no "target" is reached before the beam/bolt/ball travels the
5529 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
5530 * may be relevant even for bolts, since they have a "1x1" mini-blast.
5532 * Note that for consistency, we "pretend" that the bolt actually takes "time"
5533 * to move from point A to point B, even if the player cannot see part of the
5534 * projection path. Note that in general, the player will *always* see part
5535 * of the path, since it either starts at the player or ends on the player.
5537 * Hack -- we assume that every "projection" is "self-illuminating".
5539 * Hack -- when only a single monster is affected, we automatically track
5540 * (and recall) that monster, unless "PROJECT_JUMP" is used.
5542 * Note that all projections now "explode" at their final destination, even
5543 * if they were being projected at a more distant destination. This means
5544 * that "ball" spells will *always* explode.
5546 * Note that we must call "handle_stuff()" after affecting terrain features
5547 * in the blast radius, in case the "illumination" of the grid was changed,
5548 * and "update_view()" and "update_monsters()" need to be called.
5551 bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
5561 POSITION y_saver, x_saver; /* For reflecting monsters */
5563 int msec = delay_factor * delay_factor * delay_factor;
5565 /* Assume the player sees nothing */
5566 bool notice = FALSE;
5568 /* Assume the player has seen nothing */
5569 bool visual = FALSE;
5571 /* Assume the player has seen no blast grids */
5574 /* Assume to be a normal ball spell */
5575 bool breath = FALSE;
5577 /* Is the player blind? */
5578 bool blind = (p_ptr->blind ? TRUE : FALSE);
5580 bool old_hide = FALSE;
5582 /* Number of grids in the "path" */
5585 /* Actual grids in the "path" */
5588 /* Number of grids in the "blast area" (including the "beam" path) */
5591 /* Coordinates of the affected grids */
5592 POSITION gx[1024], gy[1024];
5594 /* Encoded "radius" info (see above) */
5597 /* Actual radius encoded in gm[] */
5598 POSITION gm_rad = rad;
5602 /* Attacker's name (prepared before polymorph)*/
5603 GAME_TEXT who_name[MAX_NLEN];
5605 /* Can the player see the source of this effect? */
5606 bool see_s_msg = TRUE;
5608 /* Initialize by null string */
5614 /* Default target of monsterspell is player */
5615 monster_target_y = p_ptr->y;
5616 monster_target_x = p_ptr->x;
5618 /* Hack -- Jump to target */
5619 if (flg & (PROJECT_JUMP))
5624 /* Clear the flag */
5625 flg &= ~(PROJECT_JUMP);
5630 /* Start at player */
5637 /* Start at monster */
5640 x1 = current_floor_ptr->m_list[who].fx;
5641 y1 = current_floor_ptr->m_list[who].fy;
5642 monster_desc(who_name, ¤t_floor_ptr->m_list[who], MD_WRONGDOER_NAME);
5654 /* Default "destination" */
5659 /* Hack -- verify stuff */
5660 if (flg & (PROJECT_THRU))
5662 if ((x1 == x2) && (y1 == y2))
5664 flg &= ~(PROJECT_THRU);
5668 /* Handle a breath attack */
5673 if (flg & PROJECT_HIDE) old_hide = TRUE;
5674 flg |= PROJECT_HIDE;
5678 /* Hack -- Assume there will be no blast (max radius 32) */
5679 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
5687 /* Collect beam grids */
5688 if (flg & (PROJECT_BEAM))
5699 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
5701 case GF_DISINTEGRATE:
5702 flg |= (PROJECT_GRID);
5703 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
5707 /* Calculate the projection path */
5709 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
5712 /* Giga-Hack SEEKER & SUPER_RAY */
5714 if( typ == GF_SEEKER )
5724 for (i = 0; i < path_n; ++i)
5729 POSITION ny = GRID_Y(path_g[i]);
5730 POSITION nx = GRID_X(path_g[i]);
5741 /* Only do visuals if requested */
5742 if (!blind && !(flg & (PROJECT_HIDE)))
5744 /* Only do visuals if the player can "see" the bolt */
5745 if (panel_contains(y, x) && player_has_los_bold(y, x))
5752 /* Obtain the bolt pict */
5753 p = bolt_pict(oy, ox, y, x, typ);
5755 /* Extract attr/char */
5759 /* Visual effects */
5760 print_rel(c, a, y, x);
5761 move_cursor_relative(y, x);
5762 /*if (fresh_before)*/ Term_fresh();
5763 Term_xtra(TERM_XTRA_DELAY, msec);
5765 /*if (fresh_before)*/ Term_fresh();
5767 /* Display "beam" grids */
5768 if (flg & (PROJECT_BEAM))
5770 /* Obtain the explosion pict */
5771 p = bolt_pict(y, x, y, x, typ);
5773 /* Extract attr/char */
5777 /* Visual effects */
5778 print_rel(c, a, y, x);
5781 /* Hack -- Activate delay */
5785 /* Hack -- delay anyway for consistency */
5788 /* Delay for consistency */
5789 Term_xtra(TERM_XTRA_DELAY, msec);
5792 if (project_o(0, 0, y, x, dam, GF_SEEKER))notice = TRUE;
5793 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
5795 /* The target of monsterspell becomes tha mirror(broken) */
5796 monster_target_y = y;
5797 monster_target_x = x;
5799 remove_mirror(y, x);
5800 next_mirror(&oy, &ox, y, x);
5802 path_n = i + project_path(&(path_g[i + 1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
5803 for (j = last_i; j <= i; j++)
5805 y = GRID_Y(path_g[j]);
5806 x = GRID_X(path_g[j]);
5807 if (project_m(0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
5808 if (!who && (project_m_n == 1) && !jump) {
5809 if (current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0) {
5810 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5814 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5815 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5819 (void)project_f(0, 0, y, x, dam, GF_SEEKER);
5824 for(i = last_i ; i < path_n ; i++)
5827 py = GRID_Y(path_g[i]);
5828 px = GRID_X(path_g[i]);
5829 if (project_m(0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
5831 if (!who && (project_m_n == 1) && !jump) {
5832 if (current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0)
5834 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5838 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5839 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5843 (void)project_f(0, 0, py, px, dam, GF_SEEKER);
5847 else if(typ == GF_SUPER_RAY){
5849 int second_step = 0;
5856 for (i = 0; i < path_n; ++i)
5861 POSITION ny = GRID_Y(path_g[i]);
5862 POSITION nx = GRID_X(path_g[i]);
5873 /* Only do visuals if requested */
5874 if (!blind && !(flg & (PROJECT_HIDE)))
5876 /* Only do visuals if the player can "see" the bolt */
5877 if (panel_contains(y, x) && player_has_los_bold(y, x))
5884 /* Obtain the bolt pict */
5885 p = bolt_pict(oy, ox, y, x, typ);
5887 /* Extract attr/char */
5891 /* Visual effects */
5892 print_rel(c, a, y, x);
5893 move_cursor_relative(y, x);
5894 /*if (fresh_before)*/ Term_fresh();
5895 Term_xtra(TERM_XTRA_DELAY, msec);
5897 /*if (fresh_before)*/ Term_fresh();
5899 /* Display "beam" grids */
5900 if (flg & (PROJECT_BEAM))
5902 /* Obtain the explosion pict */
5903 p = bolt_pict(y, x, y, x, typ);
5905 /* Extract attr/char */
5909 /* Visual effects */
5910 print_rel(c, a, y, x);
5913 /* Hack -- Activate delay */
5917 /* Hack -- delay anyway for consistency */
5920 /* Delay for consistency */
5921 Term_xtra(TERM_XTRA_DELAY, msec);
5924 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
5925 if (!cave_have_flag_bold(y, x, FF_PROJECT))
5927 if( second_step )continue;
5930 if( is_mirror_grid(¤t_floor_ptr->grid_array[y][x]) && !second_step )
5932 /* The target of monsterspell becomes tha mirror(broken) */
5933 monster_target_y = y;
5934 monster_target_x = x;
5937 for( j = 0; j <=i ; j++ )
5939 y = GRID_Y(path_g[j]);
5940 x = GRID_X(path_g[j]);
5941 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
5945 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
5946 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
5947 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
5948 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
5949 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
5950 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
5951 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
5952 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
5955 for( i = 0; i < path_n ; i++ )
5958 py = GRID_Y(path_g[i]);
5959 px = GRID_X(path_g[i]);
5960 (void)project_m(0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
5961 if(!who && (project_m_n == 1) && !jump){
5962 if(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx >0 ){
5963 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
5967 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
5968 health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
5972 (void)project_f(0, 0, py, px, dam, GF_SUPER_RAY);
5977 /* Project along the path */
5978 for (i = 0; i < path_n; ++i)
5983 POSITION ny = GRID_Y(path_g[i]);
5984 POSITION nx = GRID_X(path_g[i]);
5986 if (flg & PROJECT_DISI)
5988 /* Hack -- Balls explode before reaching walls */
5989 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
5991 else if (flg & PROJECT_LOS)
5993 /* Hack -- Balls explode before reaching walls */
5994 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
5998 /* Hack -- Balls explode before reaching walls */
5999 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
6006 /* Collect beam grids */
6007 if (flg & (PROJECT_BEAM))
6014 /* Only do visuals if requested */
6015 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
6017 /* Only do visuals if the player can "see" the bolt */
6018 if (panel_contains(y, x) && player_has_los_bold(y, x))
6025 /* Obtain the bolt pict */
6026 p = bolt_pict(oy, ox, y, x, typ);
6028 /* Extract attr/char */
6032 /* Visual effects */
6033 print_rel(c, a, y, x);
6034 move_cursor_relative(y, x);
6035 /*if (fresh_before)*/ Term_fresh();
6036 Term_xtra(TERM_XTRA_DELAY, msec);
6038 /*if (fresh_before)*/ Term_fresh();
6040 /* Display "beam" grids */
6041 if (flg & (PROJECT_BEAM))
6043 /* Obtain the explosion pict */
6044 p = bolt_pict(y, x, y, x, typ);
6046 /* Extract attr/char */
6050 /* Visual effects */
6051 print_rel(c, a, y, x);
6054 /* Hack -- Activate delay */
6058 /* Hack -- delay anyway for consistency */
6061 /* Delay for consistency */
6062 Term_xtra(TERM_XTRA_DELAY, msec);
6069 /* Save the "blast epicenter" */
6073 if (breath && !path_n)
6079 flg &= ~(PROJECT_HIDE);
6083 /* Start the "explosion" */
6086 /* Hack -- make sure beams get to "explode" */
6094 /* If we found a "target", explode there */
6095 if (dist <= MAX_RANGE)
6097 /* Mega-Hack -- remove the final "beam" grid */
6098 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
6101 * Create a conical breath attack
6112 flg &= ~(PROJECT_HIDE);
6114 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
6118 /* Determine the blast area, work from the inside out */
6119 for (dist = 0; dist <= rad; dist++)
6121 /* Scan the maximal blast area of radius "dist" */
6122 for (y = by - dist; y <= by + dist; y++)
6124 for (x = bx - dist; x <= bx + dist; x++)
6126 /* Ignore "illegal" locations */
6127 if (!in_bounds2(y, x)) continue;
6129 /* Enforce a "circular" explosion */
6130 if (distance(by, bx, y, x) != dist) continue;
6136 /* Lights are stopped by opaque terrains */
6137 if (!los(by, bx, y, x)) continue;
6139 case GF_DISINTEGRATE:
6140 /* Disintegration are stopped only by perma-walls */
6141 if (!in_disintegration_range(by, bx, y, x)) continue;
6144 /* Ball explosions are stopped by walls */
6145 if (!projectable(by, bx, y, x)) continue;
6149 /* Save this grid */
6156 /* Encode some more "radius" info */
6162 /* Speed -- ignore "non-explosions" */
6163 if (!grids) return (FALSE);
6166 /* Display the "blast area" if requested */
6167 if (!blind && !(flg & (PROJECT_HIDE)))
6169 /* Then do the "blast", from inside out */
6170 for (t = 0; t <= gm_rad; t++)
6172 /* Dump everything with this radius */
6173 for (i = gm[t]; i < gm[t+1]; i++)
6175 /* Extract the location */
6179 /* Only do visuals if the player can "see" the blast */
6180 if (panel_contains(y, x) && player_has_los_bold(y, x))
6189 /* Obtain the explosion pict */
6190 p = bolt_pict(y, x, y, x, typ);
6192 /* Extract attr/char */
6196 /* Visual effects -- Display */
6197 print_rel(c, a, y, x);
6201 /* Hack -- center the cursor */
6202 move_cursor_relative(by, bx);
6204 /* Flush each "radius" seperately */
6205 /*if (fresh_before)*/ Term_fresh();
6207 /* Delay (efficiently) */
6208 if (visual || drawn)
6210 Term_xtra(TERM_XTRA_DELAY, msec);
6214 /* Flush the erasing */
6217 /* Erase the explosion drawn above */
6218 for (i = 0; i < grids; i++)
6220 /* Extract the location */
6224 /* Hack -- Erase if needed */
6225 if (panel_contains(y, x) && player_has_los_bold(y, x))
6231 /* Hack -- center the cursor */
6232 move_cursor_relative(by, bx);
6234 /* Flush the explosion */
6235 /*if (fresh_before)*/ Term_fresh();
6239 update_creature(p_ptr);
6241 if (flg & PROJECT_KILL)
6243 see_s_msg = (who > 0) ? is_seen(¤t_floor_ptr->m_list[who]) :
6244 (!who ? TRUE : (player_can_see_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)));
6248 /* Check features */
6249 if (flg & (PROJECT_GRID))
6251 /* Start with "dist" of zero */
6254 /* Scan for features */
6255 for (i = 0; i < grids; i++)
6257 /* Hack -- Notice new "dist" values */
6258 if (gm[dist+1] == i) dist++;
6260 /* Get the grid location */
6264 /* Find the closest point in the blast */
6267 int d = dist_to_line(y, x, y1, x1, by, bx);
6269 /* Affect the grid */
6270 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
6274 /* Affect the grid */
6275 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
6280 update_creature(p_ptr);
6283 if (flg & (PROJECT_ITEM))
6285 /* Start with "dist" of zero */
6288 /* Scan for objects */
6289 for (i = 0; i < grids; i++)
6291 /* Hack -- Notice new "dist" values */
6292 if (gm[dist+1] == i) dist++;
6294 /* Get the grid location */
6298 /* Find the closest point in the blast */
6301 int d = dist_to_line(y, x, y1, x1, by, bx);
6303 /* Affect the object in the grid */
6304 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
6308 /* Affect the object in the grid */
6309 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
6315 /* Check monsters */
6316 if (flg & (PROJECT_KILL))
6323 /* Start with "dist" of zero */
6326 /* Scan for monsters */
6327 for (i = 0; i < grids; i++)
6331 /* Hack -- Notice new "dist" values */
6332 if (gm[dist + 1] == i) dist++;
6334 /* Get the grid location */
6338 /* A single bolt may be reflected */
6341 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
6342 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
6344 if ((flg & PROJECT_REFLECTABLE) && current_floor_ptr->grid_array[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
6345 ((current_floor_ptr->grid_array[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
6346 (!who || dist_hack > 1) && !one_in_(10))
6349 int max_attempts = 10;
6351 /* Choose 'new' target */
6354 t_y = y_saver - 1 + randint1(3);
6355 t_x = x_saver - 1 + randint1(3);
6358 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
6360 if (max_attempts < 1)
6366 sound(SOUND_REFLECT);
6369 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
6370 msg_print(_("「北斗神拳奥義・二指真空把!」", "The attack bounces!"));
6371 else if (m_ptr->r_idx == MON_DIO)
6372 msg_print(_("ディオ・ブランドーは指一本で攻撃を弾き返した!", "The attack bounces!"));
6374 msg_print(_("攻撃は跳ね返った!", "The attack bounces!"));
6376 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
6378 /* Reflected bolts randomly target either one */
6379 if (player_bold(y, x) || one_in_(2)) flg &= ~(PROJECT_PLAYER);
6380 else flg |= PROJECT_PLAYER;
6382 /* The bolt is reflected */
6383 project(current_floor_ptr->grid_array[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
6385 /* Don't affect the monster any longer */
6391 /* Find the closest point in the blast */
6394 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
6398 effective_dist = dist;
6402 /* There is the riding player on this monster */
6403 if (p_ptr->riding && player_bold(y, x))
6405 /* Aimed on the player */
6406 if (flg & PROJECT_PLAYER)
6408 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
6411 * A beam or bolt is well aimed
6413 * So don't affects the mount.
6420 * The spell is not well aimed,
6421 * So partly affect the mount too.
6428 * This grid is the original target.
6429 * Or aimed on your horse.
6431 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
6433 /* Hit the mount with full damage */
6437 * Otherwise this grid is not the
6438 * original target, it means that line
6439 * of fire is obstructed by this
6443 * A beam or bolt will hit either
6444 * player or mount. Choose randomly.
6446 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
6450 /* Hit the mount with full damage */
6454 /* Hit the player later */
6455 flg |= PROJECT_PLAYER;
6457 /* Don't affect the mount */
6463 * The spell is not well aimed, so
6464 * partly affect both player and
6473 /* Affect the monster in the grid */
6474 if (project_m(who, effective_dist, y, x, dam, typ, flg, see_s_msg)) notice = TRUE;
6478 /* Player affected one monster (without "jumping") */
6479 if (!who && (project_m_n == 1) && !jump)
6484 /* Track if possible */
6485 if (current_floor_ptr->grid_array[y][x].m_idx > 0)
6487 monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
6491 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6492 health_track(current_floor_ptr->grid_array[y][x].m_idx);
6500 if (flg & (PROJECT_KILL))
6502 /* Start with "dist" of zero */
6505 /* Scan for player */
6506 for (i = 0; i < grids; i++)
6510 /* Hack -- Notice new "dist" values */
6511 if (gm[dist+1] == i) dist++;
6513 /* Get the grid location */
6517 /* Affect the player? */
6518 if (!player_bold(y, x)) continue;
6520 /* Find the closest point in the blast */
6523 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
6527 effective_dist = dist;
6530 /* Target may be your horse */
6533 /* Aimed on the player */
6534 if (flg & PROJECT_PLAYER)
6536 /* Hit the player with full damage */
6540 * Hack -- When this grid was not the
6541 * original target, a beam or bolt
6542 * would hit either player or mount,
6543 * and should be choosen randomly.
6545 * But already choosen to hit the
6546 * mount at this point.
6548 * Or aimed on your horse.
6550 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
6553 * A beam or bolt is well aimed
6555 * So don't affects the player.
6562 * The spell is not well aimed,
6563 * So partly affect the player too.
6569 /* Affect the player */
6570 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
6576 GAME_TEXT m_name[MAX_NLEN];
6578 monster_desc(m_name, ¤t_floor_ptr->m_list[p_ptr->riding], 0);
6580 if (rakubadam_m > 0)
6582 if (rakuba(rakubadam_m, FALSE))
6584 msg_format(_("%^sに振り落とされた!", "%^s has thrown you off!"), m_name);
6587 if (p_ptr->riding && rakubadam_p > 0)
6589 if(rakuba(rakubadam_p, FALSE))
6591 msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_name);
6596 /* Return "something was noticed" */
6601 * @brief 鏡魔法「封魔結界」の効果処理
6603 * @return 効果があったらTRUEを返す
6605 bool binding_field(HIT_POINT dam)
6607 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
6608 int mirror_num = 0; /* 鏡の数 */
6610 POSITION centersign;
6611 POSITION x1, x2, y1, y2;
6613 int msec = delay_factor*delay_factor*delay_factor;
6616 POSITION point_x[3];
6617 POSITION point_y[3];
6619 /* Default target of monsterspell is player */
6620 monster_target_y = p_ptr->y;
6621 monster_target_x = p_ptr->x;
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]) &&
6628 distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
6629 distance(p_ptr->y, p_ptr->x, y, x) != 0 &&
6630 player_has_los_bold(y, x) &&
6631 projectable(p_ptr->y, p_ptr->x, y, x)
6633 mirror_y[mirror_num] = y;
6634 mirror_x[mirror_num] = x;
6640 if (mirror_num < 2)return FALSE;
6642 point_x[0] = randint0(mirror_num);
6644 point_x[1] = randint0(mirror_num);
6645 } while (point_x[0] == point_x[1]);
6647 point_y[0] = mirror_y[point_x[0]];
6648 point_x[0] = mirror_x[point_x[0]];
6649 point_y[1] = mirror_y[point_x[1]];
6650 point_x[1] = mirror_x[point_x[1]];
6651 point_y[2] = p_ptr->y;
6652 point_x[2] = p_ptr->x;
6654 x = point_x[0] + point_x[1] + point_x[2];
6655 y = point_y[0] + point_y[1] + point_y[2];
6657 centersign = (point_x[0] * 3 - x)*(point_y[1] * 3 - y)
6658 - (point_y[0] * 3 - y)*(point_x[1] * 3 - x);
6659 if (centersign == 0)return FALSE;
6661 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
6662 x1 = x1 < point_x[2] ? x1 : point_x[2];
6663 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
6664 y1 = y1 < point_y[2] ? y1 : point_y[2];
6666 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
6667 x2 = x2 > point_x[2] ? x2 : point_x[2];
6668 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
6669 y2 = y2 > point_y[2] ? y2 : point_y[2];
6671 for (y = y1; y <= y2; y++) {
6672 for (x = x1; x <= x2; x++) {
6673 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6674 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6675 centersign*((point_x[1] - x)*(point_y[2] - y)
6676 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6677 centersign*((point_x[2] - x)*(point_y[0] - y)
6678 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6680 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6681 /* Visual effects */
6683 && panel_contains(y, x)) {
6684 p = bolt_pict(y, x, y, x, GF_MANA);
6685 print_rel(PICT_C(p), PICT_A(p), y, x);
6686 move_cursor_relative(y, x);
6687 /*if (fresh_before)*/ Term_fresh();
6688 Term_xtra(TERM_XTRA_DELAY, msec);
6694 for (y = y1; y <= y2; y++) {
6695 for (x = x1; x <= x2; x++) {
6696 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6697 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6698 centersign*((point_x[1] - x)*(point_y[2] - y)
6699 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6700 centersign*((point_x[2] - x)*(point_y[0] - y)
6701 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6703 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6704 (void)project_f(0, 0, y, x, dam, GF_MANA);
6709 for (y = y1; y <= y2; y++) {
6710 for (x = x1; x <= x2; x++) {
6711 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6712 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6713 centersign*((point_x[1] - x)*(point_y[2] - y)
6714 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6715 centersign*((point_x[2] - x)*(point_y[0] - y)
6716 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6718 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6719 (void)project_o(0, 0, y, x, dam, GF_MANA);
6724 for (y = y1; y <= y2; y++) {
6725 for (x = x1; x <= x2; x++) {
6726 if (centersign*((point_x[0] - x)*(point_y[1] - y)
6727 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
6728 centersign*((point_x[1] - x)*(point_y[2] - y)
6729 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
6730 centersign*((point_x[2] - x)*(point_y[0] - y)
6731 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
6733 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
6734 (void)project_m(0, 0, y, x, dam, GF_MANA,
6735 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE);
6741 msg_print(_("鏡が結界に耐えきれず、壊れてしまった。", "The field broke a mirror"));
6742 remove_mirror(point_y[0], point_x[0]);
6749 * @brief 鏡魔法「鏡の封印」の効果処理
6751 * @return 効果があったらTRUEを返す
6753 void seal_of_mirror(HIT_POINT dam)
6757 for (x = 0; x < current_floor_ptr->width; x++)
6759 for (y = 0; y < current_floor_ptr->height; y++)
6761 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
6763 if (project_m(0, 0, y, x, dam, GF_GENOCIDE,
6764 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE))
6766 if (!current_floor_ptr->grid_array[y][x].m_idx)
6768 remove_mirror(y, x);
6780 * @brief 領域魔法に応じて技能の名称を返す。
6781 * @param tval 魔法書のtval
6782 * @return 領域魔法の技能名称を保管した文字列ポインタ
6784 concptr spell_category_name(OBJECT_TYPE_VALUE tval)
6788 case TV_HISSATSU_BOOK:
6789 return _("必殺技", "art");
6791 return _("祈り", "prayer");
6793 return _("歌", "song");
6795 return _("呪文", "spell");