From a71c68e5e2da462ac1ef8f25dd6b1349ef9418f5 Mon Sep 17 00:00:00 2001 From: deskull Date: Sat, 14 Dec 2019 16:49:07 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20hex=5Fspell=5Ffully()=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=20/=20Add=20player=5Ftype=20*=20argu?= =?utf8?q?ment=20to=20hex=5Fspell=5Ffully().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cmd/cmd-read.c | 2 +- src/cmd/cmd-spell.c | 2 +- src/realm-hex.c | 6 +++--- src/realm-hex.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cmd/cmd-read.c b/src/cmd/cmd-read.c index c6ccb9497..4eef672ca 100644 --- a/src/cmd/cmd-read.c +++ b/src/cmd/cmd-read.c @@ -64,7 +64,7 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known) } if (music_singing_any(creature_ptr)) stop_singing(creature_ptr); - if (hex_spelling_any(creature_ptr) && ((creature_ptr->lev < 35) || hex_spell_fully())) stop_hex_spell_all(creature_ptr); + if (hex_spelling_any(creature_ptr) && ((creature_ptr->lev < 35) || hex_spell_fully(creature_ptr))) stop_hex_spell_all(creature_ptr); /* Not identified yet */ ident = FALSE; diff --git a/src/cmd/cmd-spell.c b/src/cmd/cmd-spell.c index 901e06177..1a2849640 100644 --- a/src/cmd/cmd-spell.c +++ b/src/cmd/cmd-spell.c @@ -1070,7 +1070,7 @@ void do_cmd_cast(player_type *caster_ptr) if (cmd_limit_confused(caster_ptr)) return; if (caster_ptr->realm1 == REALM_HEX) { - if (hex_spell_fully()) + if (hex_spell_fully(caster_ptr)) { bool flag = FALSE; msg_print(_("これ以上新しい呪文を詠唱することはできない。", "Can not spell new spells more.")); diff --git a/src/realm-hex.c b/src/realm-hex.c index 6381236dd..745aa4a81 100644 --- a/src/realm-hex.c +++ b/src/realm-hex.c @@ -247,12 +247,12 @@ void check_hex(player_type *caster_ptr) * @brief プレイヤーの呪術詠唱枠がすでに最大かどうかを返す * @return すでに全枠を利用しているならTRUEを返す */ -bool hex_spell_fully(void) +bool hex_spell_fully(player_type *caster_ptr) { int k_max = 0; - k_max = (p_ptr->lev / 15) + 1; + k_max = (caster_ptr->lev / 15) + 1; k_max = MIN(k_max, MAX_KEEP); - if (CASTING_HEX_NUM(p_ptr) < k_max) return FALSE; + if (CASTING_HEX_NUM(caster_ptr) < k_max) return FALSE; return TRUE; } diff --git a/src/realm-hex.h b/src/realm-hex.h index 022844718..3b98f4274 100644 --- a/src/realm-hex.h +++ b/src/realm-hex.h @@ -52,7 +52,7 @@ extern bool stop_hex_spell_all(player_type *caster_ptr); extern bool stop_hex_spell(void); extern void check_hex(player_type *caster_ptr); -extern bool hex_spell_fully(void); +extern bool hex_spell_fully(player_type *caster_ptr); extern void revenge_spell(player_type *caster_ptr); extern void revenge_store(HIT_POINT dam); extern bool teleport_barrier(MONSTER_IDX m_idx); -- 2.11.0