From cfbd0427af53acae5e9aabae0dd6934b5dadc7ea Mon Sep 17 00:00:00 2001 From: deskull Date: Sun, 23 Jun 2019 14:55:15 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20set=5Ftim=5Fsh=5Ffire()=20?= =?utf8?q?=E3=81=AB=20player=5Ftype=20*=20=E5=BC=95=E6=95=B0=E3=82=92?= =?utf8?q?=E8=BF=BD=E5=8A=A0=EF=BC=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/core.c | 2 +- src/player-effects.c | 20 ++++++++++---------- src/player-effects.h | 2 +- src/realm-daemon.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/core.c b/src/core.c index 55f42bbe2..61d7ab453 100644 --- a/src/core.c +++ b/src/core.c @@ -1887,7 +1887,7 @@ static void process_world_aux_timeout(void) /* Timed sh_fire */ if (p_ptr->tim_sh_fire) { - (void)set_tim_sh_fire(p_ptr->tim_sh_fire - 1, TRUE); + (void)set_tim_sh_fire(p_ptr, p_ptr->tim_sh_fire - 1, TRUE); } /* Timed sh_holy */ diff --git a/src/player-effects.c b/src/player-effects.c index dfd0f5175..58bf0fbbb 100644 --- a/src/player-effects.c +++ b/src/player-effects.c @@ -316,7 +316,7 @@ void dispel_player(void) (void)set_tim_stealth(p_ptr, 0, TRUE); (void)set_tim_levitation(p_ptr, 0, TRUE); (void)set_tim_sh_touki(p_ptr, 0, TRUE); - (void)set_tim_sh_fire(0, TRUE); + (void)set_tim_sh_fire(p_ptr, 0, TRUE); (void)set_tim_sh_holy(0, TRUE); (void)set_tim_eyeeye(0, TRUE); (void)set_magicdef(p_ptr, 0, TRUE); @@ -1837,21 +1837,21 @@ bool set_tim_sh_touki(player_type *creature_ptr, TIME_EFFECT v, bool do_dec) * @param do_dec 現在の継続時間より長い値のみ上書きする * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 */ -bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec) +bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec) { bool notice = FALSE; v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; - if (p_ptr->is_dead) return FALSE; + if (creature_ptr->is_dead) return FALSE; /* Open */ if (v) { - if (p_ptr->tim_sh_fire && !do_dec) + if (creature_ptr->tim_sh_fire && !do_dec) { - if (p_ptr->tim_sh_fire > v) return FALSE; + if (creature_ptr->tim_sh_fire > v) return FALSE; } - else if (!p_ptr->tim_sh_fire) + else if (!creature_ptr->tim_sh_fire) { msg_print(_("体が炎のオーラで覆われた。", "You have enveloped by fiery aura!")); notice = TRUE; @@ -1861,7 +1861,7 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec) /* Shut */ else { - if (p_ptr->tim_sh_fire) + if (creature_ptr->tim_sh_fire) { msg_print(_("炎のオーラが消えた。", "Fiery aura disappeared.")); notice = TRUE; @@ -1869,14 +1869,14 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec) } /* Use the value */ - p_ptr->tim_sh_fire = v; - p_ptr->redraw |= (PR_STATUS); + creature_ptr->tim_sh_fire = v; + creature_ptr->redraw |= (PR_STATUS); /* Nothing to notice */ if (!notice) return (FALSE); if (disturb_state) disturb(FALSE, FALSE); - p_ptr->update |= (PU_BONUS); + creature_ptr->update |= (PU_BONUS); handle_stuff(); return (TRUE); } diff --git a/src/player-effects.h b/src/player-effects.h index abff5ea15..d4215846e 100644 --- a/src/player-effects.h +++ b/src/player-effects.h @@ -38,7 +38,7 @@ extern bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_de extern bool set_lightspeed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec); extern bool set_tim_levitation(player_type *creature_ptr, TIME_EFFECT v, bool do_dec); extern bool set_tim_sh_touki(player_type *creature_ptr, TIME_EFFECT v, bool do_dec); -extern bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec); +extern bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec); extern bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec); extern bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec); extern bool set_resist_magic(TIME_EFFECT v, bool do_dec); diff --git a/src/realm-daemon.c b/src/realm-daemon.c index fa158a869..7a8c10999 100644 --- a/src/realm-daemon.c +++ b/src/realm-daemon.c @@ -345,7 +345,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode) set_oppose_fire(dur, FALSE); set_oppose_cold(dur, FALSE); - set_tim_sh_fire(dur, FALSE); + set_tim_sh_fire(p_ptr, dur, FALSE); set_afraid(p_ptr, 0); break; } -- 2.11.0