OSDN Git Service

[Refactor] #38997 hex_spell_fully() に player_type * 引数を追加. / Add player_type * argume...
authordeskull <deskull@users.sourceforge.jp>
Sat, 14 Dec 2019 07:49:07 +0000 (16:49 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 14 Dec 2019 07:49:07 +0000 (16:49 +0900)
src/cmd/cmd-read.c
src/cmd/cmd-spell.c
src/realm-hex.c
src/realm-hex.h

index c6ccb94..4eef672 100644 (file)
@@ -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;
index 901e061..1a28496 100644 (file)
@@ -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."));
index 6381236..745aa4a 100644 (file)
@@ -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;
 }
 
index 0228447..3b98f42 100644 (file)
@@ -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);