/*!
+ * todo どうしても「その他」に分類せざるを得ない魔法種別が残った
+ * 本ファイル内の行数はまともなレベルに落ち着いているので、一旦ここに留め置くこととする
* @brief 魔法種別による各種処理切り替え
* @date 2020/04/29
* @author Hourier
*/
-#include "angband.h"
-#include "effect-monster-util.h"
#include "effect/effect-monster-switcher.h"
-#include "player-damage.h"
-#include "avatar.h"
-#include "quest.h"
-#include "monster-status.h"
-#include "effect/spells-effect-util.h"
-#include "player-effects.h"
-#include "monsterrace-hook.h"
-#include "combat/melee.h"
-#include "cmd/cmd-pet.h" // 暫定、後で消すかも.
-#include "spell/spells-type.h"
-#include "effect/effect-monster-resist-hurt.h"
-#include "effect/effect-monster-psi.h"
-#include "effect/effect-monster-domination.h"
-#include "effect/effect-monster-oldies.h"
+#include "cmd-action/cmd-attack.h"
#include "effect/effect-monster-charm.h"
-#include "effect/effect-monster-lite-dark.h"
+#include "effect/effect-monster-curse.h"
#include "effect/effect-monster-evil.h"
+#include "effect/effect-monster-lite-dark.h"
+#include "effect/effect-monster-oldies.h"
+#include "effect/effect-monster-psi.h"
+#include "effect/effect-monster-resist-hurt.h"
#include "effect/effect-monster-spirit.h"
-
-gf_switch_result effect_monster_hypodynamia(player_type *caster_ptr, effect_monster_type *em_ptr)
+#include "effect/effect-monster-util.h"
+#include "monster-race/monster-race.h"
+#include "monster-race/race-flags1.h"
+#include "monster-race/race-flags2.h"
+#include "monster-race/race-flags3.h"
+#include "monster-race/monster-race-hook.h"
+#include "monster-floor/monster-death.h"
+#include "monster/monster-status-setter.h"
+#include "monster/monster-status.h"
+#include "monster/monster-info.h"
+#include "player-info/avatar.h"
+#include "player/player-damage.h"
+#include "spell-kind/spells-genocide.h"
+#include "spell/spell-types.h"
+#include "view/display-messages.h"
+
+process_result effect_monster_hypodynamia(player_type *caster_ptr, effect_monster_type *em_ptr)
{
if (em_ptr->seen) em_ptr->obvious = TRUE;
+
if (monster_living(em_ptr->m_ptr->r_idx))
{
em_ptr->do_time = (em_ptr->dam + 7) / 8;
- return GF_SWITCH_CONTINUE;
+ return PROCESS_CONTINUE;
}
if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
em_ptr->note = _("には効果がなかった。", " is unaffected.");
em_ptr->obvious = FALSE;
em_ptr->dam = 0;
- return GF_SWITCH_CONTINUE;
+ return PROCESS_CONTINUE;
}
// todo リファクタリング前のコード時点で、単に耐性があるだけでもダメージ0だった.
-gf_switch_result effect_monster_death_ray(player_type *caster_ptr, effect_monster_type *em_ptr)
+process_result effect_monster_death_ray(player_type *caster_ptr, effect_monster_type *em_ptr)
{
if (em_ptr->seen) em_ptr->obvious = TRUE;
em_ptr->note = _("には完全な耐性がある!", " is immune.");
em_ptr->obvious = FALSE;
em_ptr->dam = 0;
- return GF_SWITCH_CONTINUE;
+ return PROCESS_CONTINUE;
}
if (((em_ptr->r_ptr->flags1 & RF1_UNIQUE) &&
em_ptr->dam = 0;
}
- return GF_SWITCH_CONTINUE;
-}
-
-
-gf_switch_result effect_monster_stasis(effect_monster_type *em_ptr, bool to_evil)
-{
- if (em_ptr->seen) em_ptr->obvious = TRUE;
-
- int stasis_damage = (em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10);
- bool has_resistance = (em_ptr->r_ptr->flags1 & RF1_UNIQUE) != 0;
- has_resistance |= em_ptr->r_ptr->level > randint1(stasis_damage) + 10;
- if (to_evil) has_resistance |= (em_ptr->r_ptr->flags3 & RF3_EVIL) == 0;
-
- if (has_resistance)
- {
- em_ptr->note = _("には効果がなかった。", " is unaffected.");
- em_ptr->obvious = FALSE;
- }
- else
- {
- em_ptr->note = _("は動けなくなった!", " is suspended!");
- em_ptr->do_sleep = 500;
- }
-
- em_ptr->dam = 0;
- return GF_SWITCH_CONTINUE;
-}
-
-
-gf_switch_result effect_monster_stun(effect_monster_type *em_ptr)
-{
- if (em_ptr->seen) em_ptr->obvious = TRUE;
-
- em_ptr->do_stun = damroll((em_ptr->caster_lev / 20) + 3, (em_ptr->dam)) + 1;
- if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
- (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
- {
- em_ptr->do_stun = 0;
- em_ptr->note = _("には効果がなかった。", " is unaffected.");
- em_ptr->obvious = FALSE;
- }
-
- em_ptr->dam = 0;
- return GF_SWITCH_CONTINUE;
+ return PROCESS_CONTINUE;
}
-gf_switch_result effect_monster_kill_wall(player_type *caster_ptr, effect_monster_type *em_ptr)
+process_result effect_monster_kill_wall(player_type *caster_ptr, effect_monster_type *em_ptr)
{
if ((em_ptr->r_ptr->flags3 & (RF3_HURT_ROCK)) == 0)
{
em_ptr->dam = 0;
- return GF_SWITCH_CONTINUE;
+ return PROCESS_CONTINUE;
}
if (em_ptr->seen) em_ptr->obvious = TRUE;
em_ptr->note = _("の皮膚がただれた!", " loses some skin!");
em_ptr->note_dies = _("はドロドロに溶けた!", " dissolves!");
- return GF_SWITCH_CONTINUE;
+ return PROCESS_CONTINUE;
}
-gf_switch_result effect_monster_curse_1(effect_monster_type *em_ptr)
+process_result effect_monster_hand_doom(effect_monster_type *em_ptr)
{
if (em_ptr->seen) em_ptr->obvious = TRUE;
- if (!em_ptr->who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), em_ptr->m_name);
- if (randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35))
+
+ if (em_ptr->r_ptr->flags1 & RF1_UNIQUE)
{
em_ptr->note = _("には効果がなかった。", " is unaffected.");
em_ptr->dam = 0;
+ return PROCESS_CONTINUE;
}
- return GF_SWITCH_CONTINUE;
+ if ((em_ptr->who > 0) ? ((em_ptr->caster_lev + randint1(em_ptr->dam)) > (em_ptr->r_ptr->level + 10 + randint1(20))) :
+ (((em_ptr->caster_lev / 2) + randint1(em_ptr->dam)) > (em_ptr->r_ptr->level + randint1(200))))
+ {
+ em_ptr->dam = ((40 + randint1(20)) * em_ptr->m_ptr->hp) / 100;
+ if (em_ptr->m_ptr->hp < em_ptr->dam)
+ em_ptr->dam = em_ptr->m_ptr->hp - 1;
+ }
+ else
+ {
+ em_ptr->note = _("は破滅の手に耐え切った!", "resists!");
+ em_ptr->dam = 0;
+ }
+
+ return PROCESS_CONTINUE;
}
-gf_switch_result effect_monster_curse_2(effect_monster_type *em_ptr)
+process_result effect_monster_engetsu(player_type *caster_ptr, effect_monster_type *em_ptr)
{
+ int effect = 0;
+ bool done = TRUE;
+
if (em_ptr->seen) em_ptr->obvious = TRUE;
- if (!em_ptr->who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), em_ptr->m_name);
+ if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
+ {
+ em_ptr->note = _("には効果がなかった。", " is unaffected.");
+ em_ptr->dam = 0;
+ em_ptr->skipped = TRUE;
+ if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
+ return PROCESS_CONTINUE;
+ }
- if (randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35))
+ if (monster_csleep_remaining(em_ptr->m_ptr))
{
em_ptr->note = _("には効果がなかった。", " is unaffected.");
em_ptr->dam = 0;
+ em_ptr->skipped = TRUE;
+ return PROCESS_CONTINUE;
}
- return GF_SWITCH_CONTINUE;
-}
+ if (one_in_(5)) effect = 1;
+ else if (one_in_(4)) effect = 2;
+ else if (one_in_(3)) effect = 3;
+ else done = FALSE;
+ if (effect == 1)
+ {
+ if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
+ (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
+ {
+ em_ptr->note = _("には効果がなかった。", " is unaffected.");
+ em_ptr->obvious = FALSE;
+ }
+ else
+ {
+ if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50))
+ {
+ em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
+ }
+ }
+ }
+ else if (effect == 2)
+ {
+ em_ptr->do_stun = damroll((caster_ptr->lev / 10) + 3, (em_ptr->dam)) + 1;
+ if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
+ (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
+ {
+ em_ptr->do_stun = 0;
+ em_ptr->note = _("には効果がなかった。", " is unaffected.");
+ em_ptr->obvious = FALSE;
+ }
+ }
+ else if (effect == 3)
+ {
+ if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
+ (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP) ||
+ (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
+ {
+ if (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP)
+ {
+ if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_SLEEP);
+ }
-gf_switch_result effect_monster_curse_3(effect_monster_type *em_ptr)
-{
- if (em_ptr->seen) em_ptr->obvious = TRUE;
- if (!em_ptr->who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), em_ptr->m_name);
+ em_ptr->note = _("には効果がなかった。", " is unaffected.");
+ em_ptr->obvious = FALSE;
+ }
+ else
+ {
+ /* Go to sleep (much) later */
+ em_ptr->note = _("は眠り込んでしまった!", " falls asleep!");
+ em_ptr->do_sleep = 500;
+ }
+ }
- if (randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35))
+ if (!done)
{
em_ptr->note = _("には効果がなかった。", " is unaffected.");
- em_ptr->dam = 0;
}
- return GF_SWITCH_CONTINUE;
+ em_ptr->dam = 0;
+ return PROCESS_CONTINUE;
}
-gf_switch_result effect_monster_curse_4(effect_monster_type *em_ptr)
+process_result effect_monster_genocide(player_type *caster_ptr, effect_monster_type *em_ptr)
{
if (em_ptr->seen) em_ptr->obvious = TRUE;
- if (!em_ptr->who)
- msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
- "You point at %s, screaming the word, 'DIE!'."), em_ptr->m_name);
-
- if ((randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35)) && ((em_ptr->who <= 0) || (em_ptr->m_caster_ptr->r_idx != MON_KENSHIROU)))
+ if (genocide_aux(caster_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam, !em_ptr->who, (em_ptr->r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
{
- em_ptr->note = _("には効果がなかった。", " is unaffected.");
- em_ptr->dam = 0;
+ if (em_ptr->seen_msg) msg_format(_("%sは消滅した!", "%^s disappeared!"), em_ptr->m_name);
+ chg_virtue(caster_ptr, V_VITALITY, -1);
+ return PROCESS_TRUE;
}
- return GF_SWITCH_CONTINUE;
+ em_ptr->skipped = TRUE;
+ return PROCESS_CONTINUE;
}
-gf_switch_result effect_monster_hand_doom(effect_monster_type *em_ptr)
+process_result effect_monster_photo(player_type *caster_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen) em_ptr->obvious = TRUE;
+ if (!em_ptr->who)
+ msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), em_ptr->m_name);
- if (em_ptr->r_ptr->flags1 & RF1_UNIQUE)
+ if (em_ptr->r_ptr->flags3 & (RF3_HURT_LITE))
{
- em_ptr->note = _("には効果がなかった。", " is unaffected.");
- em_ptr->dam = 0;
- return GF_SWITCH_CONTINUE;
- }
+ if (em_ptr->seen) em_ptr->obvious = TRUE;
- if ((em_ptr->who > 0) ? ((em_ptr->caster_lev + randint1(em_ptr->dam)) > (em_ptr->r_ptr->level + 10 + randint1(20))) :
- (((em_ptr->caster_lev / 2) + randint1(em_ptr->dam)) > (em_ptr->r_ptr->level + randint1(200))))
- {
- em_ptr->dam = ((40 + randint1(20)) * em_ptr->m_ptr->hp) / 100;
- if (em_ptr->m_ptr->hp < em_ptr->dam)
- em_ptr->dam = em_ptr->m_ptr->hp - 1;
+ if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_LITE);
+
+ em_ptr->note = _("は光に身をすくめた!", " cringes from the light!");
+ em_ptr->note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
}
else
{
- em_ptr->note = _("は破滅の手に耐え切った!", "resists!");
em_ptr->dam = 0;
}
- return GF_SWITCH_CONTINUE;
+ em_ptr->photo = em_ptr->m_ptr->r_idx;
+ return PROCESS_CONTINUE;
}
-static bool effect_monster_check_capturability(player_type *caster_ptr, effect_monster_type *em_ptr, int capturable_hp)
+process_result effect_monster_wounds(effect_monster_type *em_ptr)
{
- if (em_ptr->m_ptr->hp >= randint0(capturable_hp)) return FALSE;
-
- if (em_ptr->m_ptr->mflag2 & MFLAG2_CHAMELEON)
- choose_new_monster(caster_ptr, em_ptr->g_ptr->m_idx, FALSE, MON_CHAMELEON);
-
- msg_format(_("%sを捕えた!", "You capture %^s!"), em_ptr->m_name);
- cap_mon = em_ptr->m_ptr->r_idx;
- cap_mspeed = em_ptr->m_ptr->mspeed;
- cap_hp = em_ptr->m_ptr->hp;
- cap_maxhp = em_ptr->m_ptr->max_maxhp;
- cap_nickname = em_ptr->m_ptr->nickname;
- if ((em_ptr->g_ptr->m_idx == caster_ptr->riding) && rakuba(caster_ptr, -1, FALSE))
- msg_format(_("地面に落とされた。", "You have fallen from %s."), em_ptr->m_name);
-
- delete_monster_idx(caster_ptr, em_ptr->g_ptr->m_idx);
- return TRUE;
-}
-
-
-gf_switch_result effect_monster_capture(player_type *caster_ptr, effect_monster_type *em_ptr)
-{
- floor_type *floor_ptr = caster_ptr->current_floor_ptr;
- int capturable_hp;
- if ((floor_ptr->inside_quest && (quest[floor_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(em_ptr->m_ptr)) ||
- (em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->flags7 & (RF7_NAZGUL)) || (em_ptr->r_ptr->flags7 & (RF7_UNIQUE2)) || (em_ptr->r_ptr->flags1 & RF1_QUESTOR) || em_ptr->m_ptr->parent_m_idx)
- {
- msg_format(_("%sには効果がなかった。", "%s is unaffected."), em_ptr->m_name);
- em_ptr->skipped = TRUE;
- return GF_SWITCH_CONTINUE;
- }
-
- if (is_pet(em_ptr->m_ptr)) capturable_hp = em_ptr->m_ptr->maxhp * 4L;
- else if ((caster_ptr->pclass == CLASS_BEASTMASTER) && monster_living(em_ptr->m_ptr->r_idx))
- capturable_hp = em_ptr->m_ptr->maxhp * 3 / 10;
- else
- capturable_hp = em_ptr->m_ptr->maxhp * 3 / 20;
+ if (em_ptr->seen) em_ptr->obvious = TRUE;
- if (em_ptr->m_ptr->hp >= capturable_hp)
+ if (randint0(100 + em_ptr->dam) < (em_ptr->r_ptr->level + 50))
{
- msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), em_ptr->m_name);
- em_ptr->skipped = TRUE;
- return GF_SWITCH_CONTINUE;
+ em_ptr->note = _("には効果がなかった。", " is unaffected.");
+ em_ptr->dam = 0;
}
-
- if (effect_monster_check_capturability(caster_ptr, em_ptr, capturable_hp))
- return GF_SWITCH_TRUE;
- msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), em_ptr->m_name);
- em_ptr->skipped = TRUE;
- return GF_SWITCH_CONTINUE;
+ return PROCESS_CONTINUE;
}
* @param em_ptr モンスター効果構造体への参照ポインタ
* @return ここのスイッチングで終るならTRUEかFALSE、後続処理を実行するならCONTINUE
*/
-gf_switch_result switch_effects_monster(player_type *caster_ptr, effect_monster_type *em_ptr)
+process_result switch_effects_monster(player_type *caster_ptr, effect_monster_type *em_ptr)
{
- floor_type *floor_ptr = caster_ptr->current_floor_ptr;
switch (em_ptr->effect_type)
{
case GF_PSY_SPEAR:
case GF_OLD_CLONE:
return effect_monster_old_clone(caster_ptr, em_ptr);
case GF_STAR_HEAL:
- if (effect_monster_old_clone(caster_ptr, em_ptr) == GF_SWITCH_TRUE)
- return GF_SWITCH_CONTINUE;
+ if (effect_monster_old_clone(caster_ptr, em_ptr) == PROCESS_TRUE)
+ return PROCESS_CONTINUE;
/* Fall through */
case GF_OLD_HEAL:
return effect_monster_old_heal(caster_ptr, em_ptr);
case GF_CAPTURE:
return effect_monster_capture(caster_ptr, em_ptr);
case GF_ATTACK:
- return (gf_switch_result)py_attack(caster_ptr, em_ptr->y, em_ptr->x, em_ptr->dam);
+ return (process_result)do_cmd_attack(caster_ptr, em_ptr->y, em_ptr->x, em_ptr->dam);
case GF_ENGETSU:
- {
- int effect = 0;
- bool done = TRUE;
-
- if (em_ptr->seen) em_ptr->obvious = TRUE;
- if (em_ptr->r_ptr->flags2 & RF2_EMPTY_MIND)
- {
- em_ptr->note = _("には効果がなかった。", " is unaffected.");
- em_ptr->dam = 0;
- em_ptr->skipped = TRUE;
- if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
- break;
- }
- if (MON_CSLEEP(em_ptr->m_ptr))
- {
- em_ptr->note = _("には効果がなかった。", " is unaffected.");
- em_ptr->dam = 0;
- em_ptr->skipped = TRUE;
- break;
- }
-
- if (one_in_(5)) effect = 1;
- else if (one_in_(4)) effect = 2;
- else if (one_in_(3)) effect = 3;
- else done = FALSE;
-
- if (effect == 1)
- {
- if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
- (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
- {
- em_ptr->note = _("には効果がなかった。", " is unaffected.");
- em_ptr->obvious = FALSE;
- }
- else
- {
- if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 50))
- {
- em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
- }
- }
- }
- else if (effect == 2)
- {
- em_ptr->do_stun = damroll((caster_ptr->lev / 10) + 3, (em_ptr->dam)) + 1;
- if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
- (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
- {
- em_ptr->do_stun = 0;
- em_ptr->note = _("には効果がなかった。", " is unaffected.");
- em_ptr->obvious = FALSE;
- }
- }
- else if (effect == 3)
- {
- if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) ||
- (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP) ||
- (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
- {
- if (em_ptr->r_ptr->flags3 & RF3_NO_SLEEP)
- {
- if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_NO_SLEEP);
- }
-
- em_ptr->note = _("には効果がなかった。", " is unaffected.");
- em_ptr->obvious = FALSE;
- }
- else
- {
- /* Go to sleep (much) later */
- em_ptr->note = _("は眠り込んでしまった!", " falls asleep!");
- em_ptr->do_sleep = 500;
- }
- }
-
- if (!done)
- {
- em_ptr->note = _("には効果がなかった。", " is unaffected.");
- }
-
- em_ptr->dam = 0;
- break;
- }
+ return effect_monster_engetsu(caster_ptr, em_ptr);
case GF_GENOCIDE:
- {
- if (em_ptr->seen) em_ptr->obvious = TRUE;
- if (genocide_aux(caster_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam, !em_ptr->who, (em_ptr->r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
- {
- if (em_ptr->seen_msg) msg_format(_("%sは消滅した!", "%^s disappeared!"), em_ptr->m_name);
- chg_virtue(caster_ptr, V_VITALITY, -1);
- return GF_SWITCH_TRUE;
- }
-
- em_ptr->skipped = TRUE;
- break;
- }
+ return effect_monster_genocide(caster_ptr, em_ptr);
case GF_PHOTO:
- {
- if (!em_ptr->who)
- msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), em_ptr->m_name);
-
- if (em_ptr->r_ptr->flags3 & (RF3_HURT_LITE))
- {
- if (em_ptr->seen) em_ptr->obvious = TRUE;
-
- if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_HURT_LITE);
-
- em_ptr->note = _("は光に身をすくめた!", " cringes from the light!");
- em_ptr->note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
- }
- else
- {
- em_ptr->dam = 0;
- }
-
- em_ptr->photo = em_ptr->m_ptr->r_idx;
- break;
- }
+ return effect_monster_photo(caster_ptr, em_ptr);
case GF_CRUSADE:
- {
- bool success = FALSE;
- if (em_ptr->seen) em_ptr->obvious = TRUE;
-
- if ((em_ptr->r_ptr->flags3 & (RF3_GOOD)) && !floor_ptr->inside_arena)
- {
- if (em_ptr->r_ptr->flags3 & (RF3_NO_CONF)) em_ptr->dam -= 50;
- if (em_ptr->dam < 1) em_ptr->dam = 1;
-
- if (is_pet(em_ptr->m_ptr))
- {
- em_ptr->note = _("の動きが速くなった。", " starts moving faster.");
- (void)set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, MON_FAST(em_ptr->m_ptr) + 100);
- success = TRUE;
- }
- else if ((em_ptr->r_ptr->flags1 & (RF1_QUESTOR)) ||
- (em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) ||
- (em_ptr->m_ptr->mflag2 & MFLAG2_NOPET) ||
- (caster_ptr->cursed & TRC_AGGRAVATE) ||
- ((em_ptr->r_ptr->level + 10) > randint1(em_ptr->dam)))
- {
- if (one_in_(4)) em_ptr->m_ptr->mflag2 |= MFLAG2_NOPET;
- }
- else
- {
- em_ptr->note = _("を支配した。", " is tamed!");
- set_pet(caster_ptr, em_ptr->m_ptr);
- (void)set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, MON_FAST(em_ptr->m_ptr) + 100);
-
- if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flags3 |= (RF3_GOOD);
- success = TRUE;
- }
- }
-
- if (!success)
- {
- if (!(em_ptr->r_ptr->flags3 & RF3_NO_FEAR))
- {
- em_ptr->do_fear = randint1(90) + 10;
- }
- else if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
- em_ptr->r_ptr->r_flags3 |= (RF3_NO_FEAR);
- }
-
- em_ptr->dam = 0;
- break;
- }
+ return effect_monster_crusade(caster_ptr, em_ptr);
case GF_WOUNDS:
- {
- if (em_ptr->seen) em_ptr->obvious = TRUE;
-
- if (randint0(100 + em_ptr->dam) < (em_ptr->r_ptr->level + 50))
- {
- em_ptr->note = _("には効果がなかった。", " is unaffected.");
- em_ptr->dam = 0;
- }
- break;
- }
+ return effect_monster_wounds(em_ptr);
default:
{
em_ptr->skipped = TRUE;
em_ptr->dam = 0;
- break;
+ return PROCESS_CONTINUE;
}
}
-
- return GF_SWITCH_CONTINUE;
}