OSDN Git Service

[Refactor] #1469 Moved hex_spelling() from global to RealmHex
authorHourier <grapefox.whitelucifer.0408@gmail.com>
Mon, 6 Sep 2021 10:55:25 +0000 (19:55 +0900)
committerHourier <grapefox.whitelucifer.0408@gmail.com>
Tue, 7 Sep 2021 09:08:52 +0000 (18:08 +0900)
20 files changed:
src/cmd-action/cmd-spell.cpp
src/cmd-item/cmd-quaff.cpp
src/combat/aura-counterattack.cpp
src/combat/slaying.cpp
src/effect/effect-player.cpp
src/market/building-craft-weapon.cpp
src/monster-attack/monster-attack-player.cpp
src/object-use/quaff-execution.cpp
src/player-ability/player-constitution.cpp
src/player-ability/player-dexterity.cpp
src/player-ability/player-strength.cpp
src/player-attack/attack-chaos-effect.cpp
src/player-attack/blood-sucking-processor.cpp
src/player-attack/player-attack.cpp
src/player-status/player-speed.cpp
src/player/player-status-flags.cpp
src/player/player-status.cpp
src/spell-realm/spells-hex.cpp
src/spell-realm/spells-hex.h
src/window/main-window-stat-poster.cpp

index c10bb9c..d7ddc6f 100644 (file)
@@ -1092,7 +1092,7 @@ bool do_cmd_cast(player_type *caster_ptr)
 
     use_realm = tval2realm(o_ptr->tval);
     if (use_realm == REALM_HEX) {
-        if (hex_spelling(caster_ptr, spell)) {
+        if (RealmHex(caster_ptr).hex_spelling(spell)) {
             msg_print(_("その呪文はすでに詠唱中だ。", "You are already casting it."));
             return false;
         }
index a50d088..2d47e17 100644 (file)
@@ -27,7 +27,7 @@ void do_cmd_quaff_potion(player_type *creature_ptr)
     if (creature_ptr->wild_mode)
         return;
 
-    if (!hex_spelling(creature_ptr, HEX_INHAIL) && cmd_limit_arena(creature_ptr))
+    if (!RealmHex(creature_ptr).hex_spelling(HEX_INHAIL) && cmd_limit_arena(creature_ptr))
         return;
 
     if (creature_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
index 3c55b8b..679af7e 100644 (file)
@@ -177,7 +177,7 @@ static void aura_force_by_monster_attack(player_type *target_ptr, monap_type *mo
 
 static void aura_shadow_by_monster_attack(player_type *target_ptr, monap_type *monap_ptr)
 {
-    if (!hex_spelling(target_ptr, HEX_SHADOW_CLOAK) || !monap_ptr->alive || target_ptr->is_dead)
+    if (!RealmHex(target_ptr).hex_spelling(HEX_SHADOW_CLOAK) || !monap_ptr->alive || target_ptr->is_dead)
         return;
 
     HIT_POINT dam = 1;
index 8606111..f8894e5 100644 (file)
@@ -166,7 +166,7 @@ HIT_POINT calc_attack_damage_with_slay(player_type *attacker_ptr, object_type *o
             flgs.set(TR_BRAND_POIS);
     }
 
-    if (hex_spelling(attacker_ptr, HEX_RUNESWORD))
+    if (RealmHex(attacker_ptr).hex_spelling(HEX_RUNESWORD))
         flgs.set(TR_SLAY_GOOD);
 
     MULTIPLY mult = 10;
index 9e7a82c..e501e57 100644 (file)
@@ -309,7 +309,7 @@ bool affect_player(MONSTER_IDX who, player_type *target_ptr, concptr who_name, i
     switch_effects_player(target_ptr, ep_ptr);
 
     RealmHex(target_ptr).revenge_store(ep_ptr->get_damage);
-    if ((target_ptr->tim_eyeeye || hex_spelling(target_ptr, HEX_EYE_FOR_EYE)) && (ep_ptr->get_damage > 0) && !target_ptr->is_dead && (ep_ptr->who > 0)) {
+    if ((target_ptr->tim_eyeeye || RealmHex(target_ptr).hex_spelling(HEX_EYE_FOR_EYE)) && (ep_ptr->get_damage > 0) && !target_ptr->is_dead && (ep_ptr->who > 0)) {
         GAME_TEXT m_name_self[MAX_MONSTER_NAME];
         monster_desc(target_ptr, m_name_self, ep_ptr->m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
         msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), ep_ptr->m_name, m_name_self);
index fff0161..d5df486 100644 (file)
@@ -141,7 +141,7 @@ static void compare_weapon_aux(player_type *owner_ptr, object_type *o_ptr, int c
     mindam = calc_expect_crit(owner_ptr, o_ptr->weight, o_ptr->to_h, mindice, owner_ptr->to_h[0], dokubari, impact);
     maxdam = calc_expect_crit(owner_ptr, o_ptr->weight, o_ptr->to_h, maxdice, owner_ptr->to_h[0], dokubari, impact);
     show_weapon_dmg(r++, col, mindam, maxdam, blow, dmg_bonus, _("会心:", "Critical:"), TERM_L_RED);
-    if ((flgs.has(TR_VORPAL) || hex_spelling(owner_ptr, HEX_RUNESWORD))) {
+    if ((flgs.has(TR_VORPAL) || RealmHex(owner_ptr).hex_spelling(HEX_RUNESWORD))) {
         if ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)) {
             vorpal_mult = 5;
             vorpal_div = 3;
index b8e4af0..0d202a9 100644 (file)
@@ -461,7 +461,7 @@ static bool process_monster_blows(player_type *target_ptr, monap_type *monap_ptr
  */
 static void eyes_on_eyes(player_type *target_ptr, monap_type *monap_ptr)
 {
-    if (((target_ptr->tim_eyeeye == 0) && !hex_spelling(target_ptr, HEX_EYE_FOR_EYE)) || (monap_ptr->get_damage == 0) || target_ptr->is_dead)
+    if (((target_ptr->tim_eyeeye == 0) && !RealmHex(target_ptr).hex_spelling(HEX_EYE_FOR_EYE)) || (monap_ptr->get_damage == 0) || target_ptr->is_dead)
         return;
 
 #ifdef JP
index ed7cf24..7033d70 100644 (file)
@@ -133,7 +133,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
     if (music_singing_any(creature_ptr))
         stop_singing(creature_ptr);
 
-    if (hex_spelling_any(creature_ptr) && !hex_spelling(creature_ptr, HEX_INHAIL)) {
+    if (hex_spelling_any(creature_ptr) && !RealmHex(creature_ptr).hex_spelling(HEX_INHAIL)) {
         (void)RealmHex(creature_ptr).stop_hex_spell_all();
     }
 
index b0b3cdc..75bea1e 100644 (file)
@@ -55,7 +55,7 @@ int16_t PlayerConstitution::time_effect_value()
     int16_t result = 0;
 
     if (this->owner_ptr->realm1 == REALM_HEX) {
-        if (hex_spelling(this->owner_ptr, HEX_BUILDING)) {
+        if (RealmHex(this->owner_ptr).hex_spelling(HEX_BUILDING)) {
             result += 4;
         }
     }
index 965968a..3a10247 100644 (file)
@@ -55,7 +55,7 @@ int16_t PlayerDexterity::time_effect_value()
     int16_t result = 0;
 
     if (this->owner_ptr->realm1 == REALM_HEX) {
-        if (hex_spelling(this->owner_ptr, HEX_BUILDING)) {
+        if (RealmHex(this->owner_ptr).hex_spelling(HEX_BUILDING)) {
             result += 4;
         }
     }
index ce85eae..161c704 100644 (file)
@@ -57,10 +57,11 @@ int16_t PlayerStrength::time_effect_value()
     int16_t result = 0;
 
     if (this->owner_ptr->realm1 == REALM_HEX) {
-        if (hex_spelling(this->owner_ptr, HEX_XTRA_MIGHT)) {
+        RealmHex realm_hex(this->owner_ptr);
+        if (realm_hex.hex_spelling(HEX_XTRA_MIGHT)) {
             result += 4;
         }
-        if (hex_spelling(this->owner_ptr, HEX_BUILDING)) {
+        if (realm_hex.hex_spelling(HEX_BUILDING)) {
             result += 4;
         }
     }
index ff199a0..f7077b2 100644 (file)
@@ -269,7 +269,7 @@ void change_monster_stat(player_type *attacker_ptr, player_attack_type *pa_ptr,
     object_type *o_ptr = &attacker_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand];
 
     if (any_bits(attacker_ptr->special_attack, ATTACK_CONFUSE) || pa_ptr->chaos_effect == CE_CONFUSION || pa_ptr->mode == HISSATSU_CONF
-        || hex_spelling(attacker_ptr, HEX_CONFUSION))
+        || RealmHex(attacker_ptr).hex_spelling(HEX_CONFUSION))
         attack_confuse(attacker_ptr, pa_ptr);
 
     if (pa_ptr->magical_effect == MagicalBrandEffect::STUN)
index 9213cbb..bac9e59 100644 (file)
@@ -30,7 +30,7 @@ void decide_blood_sucking(player_type *attacker_ptr, player_attack_type *pa_ptr)
     bool is_blood_sucker = pa_ptr->flags.has(TR_VAMPIRIC);
     is_blood_sucker |= pa_ptr->chaos_effect == CE_VAMPIRIC;
     is_blood_sucker |= pa_ptr->mode == HISSATSU_DRAIN;
-    is_blood_sucker |= hex_spelling(attacker_ptr, HEX_VAMP_BLADE);
+    is_blood_sucker |= RealmHex(attacker_ptr).hex_spelling(HEX_VAMP_BLADE);
     if (!is_blood_sucker)
         return;
 
@@ -103,7 +103,7 @@ static void drain_result(player_type *attacker_ptr, player_attack_type *pa_ptr,
 
     int drain_heal = damroll(2, pa_ptr->drain_result / 6);
 
-    if (hex_spelling(attacker_ptr, HEX_VAMP_BLADE))
+    if (RealmHex(attacker_ptr).hex_spelling(HEX_VAMP_BLADE))
         drain_heal *= 2;
 
     if (cheat_xtra) {
index 2689b78..bee787d 100644 (file)
@@ -488,9 +488,8 @@ static void apply_actual_attack(
     decide_blood_sucking(attacker_ptr, pa_ptr);
 
     // process_monk_attackの中でplayer_type->magic_num1[0] を書き換えているので、ここでhex_spelling() の判定をしないとダメ.
-    bool vorpal_cut
-        = (pa_ptr->flags.has(TR_VORPAL) || hex_spelling(attacker_ptr, HEX_RUNESWORD)) && (randint1(vorpal_chance * 3 / 2) == 1) && !is_zantetsu_nullified;
-
+    bool vorpal_cut = (pa_ptr->flags.has(TR_VORPAL) || RealmHex(attacker_ptr).hex_spelling(HEX_RUNESWORD)) && (randint1(vorpal_chance * 3 / 2) == 1)
+        && !is_zantetsu_nullified;
     calc_attack_damage(attacker_ptr, pa_ptr, do_quake, vorpal_cut, vorpal_chance);
     apply_damage_bonus(attacker_ptr, pa_ptr);
     apply_damage_negative_effect(pa_ptr, is_zantetsu_nullified, is_ej_nullified);
index 894b1b4..78f6363 100644 (file)
@@ -208,7 +208,7 @@ int16_t PlayerSpeed::time_effect_value()
     }
 
     if (this->owner_ptr->realm1 == REALM_HEX) {
-        if (hex_spelling(this->owner_ptr, HEX_SHOCK_CLOAK)) {
+        if (RealmHex(this->owner_ptr).hex_spelling(HEX_SHOCK_CLOAK)) {
             result += 3;
         }
     }
index 46778e0..0e8d696 100644 (file)
@@ -494,7 +494,7 @@ BIT_FLAGS has_esp_evil(player_type *creature_ptr)
 {
     BIT_FLAGS result = 0L;
     if (creature_ptr->realm1 == REALM_HEX) {
-        if (hex_spelling(creature_ptr, HEX_DETECT_EVIL))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_DETECT_EVIL))
             result |= FLAG_CAUSE_MAGIC_TIME_EFFECT;
     }
     result |= check_equipment_flags(creature_ptr, TR_ESP_EVIL);
@@ -801,7 +801,7 @@ BIT_FLAGS has_sh_fire(player_type *creature_ptr)
         result |= FLAG_CAUSE_BATTLE_FORM;
     }
 
-    if (hex_spelling(creature_ptr, HEX_DEMON_AURA) || creature_ptr->ult_res || creature_ptr->tim_sh_fire) {
+    if (RealmHex(creature_ptr).hex_spelling(HEX_DEMON_AURA) || creature_ptr->ult_res || creature_ptr->tim_sh_fire) {
         result |= FLAG_CAUSE_MAGIC_TIME_EFFECT;
     }
 
@@ -819,7 +819,7 @@ BIT_FLAGS has_sh_elec(player_type *creature_ptr)
     if (creature_ptr->muta.has(MUTA::ELEC_TOUC))
         result |= FLAG_CAUSE_MUTATION;
 
-    if (hex_spelling(creature_ptr, HEX_SHOCK_CLOAK) || creature_ptr->ult_res) {
+    if (RealmHex(creature_ptr).hex_spelling(HEX_SHOCK_CLOAK) || creature_ptr->ult_res) {
         result |= FLAG_CAUSE_MAGIC_TIME_EFFECT;
     }
 
@@ -842,7 +842,7 @@ BIT_FLAGS has_sh_cold(player_type *creature_ptr)
         result |= FLAG_CAUSE_BATTLE_FORM;
     }
 
-    if (creature_ptr->ult_res || hex_spelling(creature_ptr, HEX_ICE_ARMOR)) {
+    if (creature_ptr->ult_res || RealmHex(creature_ptr).hex_spelling(HEX_ICE_ARMOR)) {
         result |= FLAG_CAUSE_MAGIC_TIME_EFFECT;
     }
 
@@ -1167,7 +1167,7 @@ BIT_FLAGS has_regenerate(player_type *creature_ptr)
         result |= FLAG_CAUSE_BATTLE_FORM;
     }
 
-    if (hex_spelling(creature_ptr, HEX_DEMON_AURA) || creature_ptr->ult_res || creature_ptr->tim_regen) {
+    if (RealmHex(creature_ptr).hex_spelling(HEX_DEMON_AURA) || creature_ptr->ult_res || creature_ptr->tim_regen) {
         result |= FLAG_CAUSE_MAGIC_TIME_EFFECT;
     }
 
index 1aaa0f5..1074ec6 100644 (file)
@@ -491,9 +491,9 @@ static void update_max_hitpoints(player_type *creature_ptr)
         mhp += 30;
     if (creature_ptr->tsuyoshi)
         mhp += 50;
-    if (hex_spelling(creature_ptr, HEX_XTRA_MIGHT))
+    if (RealmHex(creature_ptr).hex_spelling(HEX_XTRA_MIGHT))
         mhp += 15;
-    if (hex_spelling(creature_ptr, HEX_BUILDING))
+    if (RealmHex(creature_ptr).hex_spelling(HEX_BUILDING))
         mhp += 60;
     if (creature_ptr->mhp == mhp)
         return;
@@ -1442,7 +1442,7 @@ static int16_t calc_num_blow(player_type *creature_ptr, int i)
                 mul = 4;
             }
 
-            if (hex_spelling(creature_ptr, HEX_XTRA_MIGHT) || hex_spelling(creature_ptr, HEX_BUILDING)) {
+            if (RealmHex(creature_ptr).hex_spelling(HEX_XTRA_MIGHT) || RealmHex(creature_ptr).hex_spelling(HEX_BUILDING)) {
                 num++;
                 wgt /= 2;
                 mul += 2;
@@ -1710,7 +1710,7 @@ static ARMOUR_CLASS calc_to_ac(player_type *creature_ptr, bool is_real_value)
     }
 
     if (creature_ptr->realm1 == REALM_HEX) {
-        if (hex_spelling(creature_ptr, HEX_ICE_ARMOR)) {
+        if (RealmHex(creature_ptr).hex_spelling(HEX_ICE_ARMOR)) {
             ac += 30;
         }
 
@@ -1995,7 +1995,7 @@ static int16_t calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, boo
     }
 
     if ((creature_ptr->realm1 == REALM_HEX) && o_ptr->is_cursed()) {
-        if (hex_spelling(creature_ptr, HEX_RUNESWORD)) {
+        if (RealmHex(creature_ptr).hex_spelling(HEX_RUNESWORD)) {
             if (o_ptr->curse_flags.has(TRC::CURSED)) {
                 damage += 5;
             }
@@ -2937,7 +2937,7 @@ long calc_score(player_type *creature_ptr)
  */
 bool is_blessed(player_type *creature_ptr)
 {
-    return creature_ptr->blessed || music_singing(creature_ptr, MUSIC_BLESS) || hex_spelling(creature_ptr, HEX_BLESS);
+    return creature_ptr->blessed || music_singing(creature_ptr, MUSIC_BLESS) || RealmHex(creature_ptr).hex_spelling(HEX_BLESS);
 }
 
 bool is_tim_esp(player_type *creature_ptr)
index db8d60d..4a3a2d2 100644 (file)
@@ -33,7 +33,7 @@ RealmHex::RealmHex(player_type *caster_ptr)
 bool RealmHex::stop_hex_spell_all()
 {
     for (auto i = 0; i < 32; i++) {
-        if (hex_spelling(this->caster_ptr, i)) {
+        if (this->hex_spelling(i)) {
             exe_spell(this->caster_ptr, REALM_HEX, i, SPELL_STOP);
         }
     }
@@ -124,7 +124,7 @@ void RealmHex::display_spells_list(int *sp)
     term_erase(x, y, 255);
     prt(_("     名前", "     Name"), y, x + 5);
     for (auto spell = 0; spell < 32; spell++) {
-        if (hex_spelling(this->caster_ptr, spell)) {
+        if (this->hex_spelling(spell)) {
             term_erase(x, y + n + 1, 255);
             put_str(format("%c)  %s", I2A(n), exe_spell(this->caster_ptr, REALM_HEX, spell, SPELL_NAME)), y + n + 1, x + 2);
             sp[n++] = spell;
@@ -157,7 +157,7 @@ void RealmHex::check_hex()
 
     /* Do any effects of continual spells */
     for (auto spell = 0; spell < 32; spell++) {
-        if (hex_spelling(this->caster_ptr, spell)) {
+        if (this->hex_spelling(spell)) {
             exe_spell(this->caster_ptr, REALM_HEX, spell, SPELL_CONT);
         }
     }
@@ -205,7 +205,7 @@ int RealmHex::calc_need_mana()
 {
     auto need_mana = 0;
     for (auto spell = 0; spell < 32; spell++) {
-        if (hex_spelling(this->caster_ptr, spell)) {
+        if (this->hex_spelling(spell)) {
             const auto *s_ptr = &technic_info[REALM_HEX - MIN_TECHNIC][spell];
             need_mana += mod_need_mana(this->caster_ptr, s_ptr->smana, spell, REALM_HEX);
         }
@@ -217,7 +217,7 @@ int RealmHex::calc_need_mana()
 void RealmHex::gain_exp_from_hex()
 {
     for (auto spell = 0; spell < 32; spell++) {
-        if (!hex_spelling(this->caster_ptr, spell)) {
+        if (!this->hex_spelling(spell)) {
             continue;
         }
 
@@ -344,10 +344,10 @@ bool RealmHex::check_hex_barrier(MONSTER_IDX m_idx, realm_hex_type type) const
 {
     const auto *m_ptr = &this->caster_ptr->current_floor_ptr->m_list[m_idx];
     const auto *r_ptr = &r_info[m_ptr->r_idx];
-    return hex_spelling(this->caster_ptr, type) && ((this->caster_ptr->lev * 3 / 2) >= randint1(r_ptr->level));
+    return this->hex_spelling(type) && ((this->caster_ptr->lev * 3 / 2) >= randint1(r_ptr->level));
 }
 
-bool hex_spelling(player_type *caster_ptr, int hex)
+bool RealmHex::hex_spelling(int hex) const
 {
     return (caster_ptr->realm1 == REALM_HEX) && (caster_ptr->magic_num1[0] & (1UL << (hex)));
 }
index a000d6a..a49e35e 100644 (file)
@@ -17,6 +17,7 @@ public:
     void revenge_spell();
     void revenge_store(HIT_POINT dam);
     bool check_hex_barrier(MONSTER_IDX m_idx, realm_hex_type type) const;
+    bool hex_spelling(int hex) const;
 
 private:
     player_type *caster_ptr;
@@ -32,7 +33,6 @@ private:
     void gain_exp_master(const int spell);
 };
 
-bool hex_spelling(player_type *caster_ptr, int hex);
 bool hex_spelling_any(player_type *caster_ptr);
 
 #define casting_hex_flags(P_PTR) ((P_PTR)->magic_num1[0])
index 512e7bc..fe2628b 100644 (file)
@@ -538,39 +538,39 @@ void print_status(player_type *creature_ptr)
         ADD_BAR_FLAG(BAR_EYEEYE);
 
     if (creature_ptr->realm1 == REALM_HEX) {
-        if (hex_spelling(creature_ptr, HEX_BLESS))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_BLESS))
             ADD_BAR_FLAG(BAR_BLESSED);
-        if (hex_spelling(creature_ptr, HEX_DEMON_AURA)) {
+        if (RealmHex(creature_ptr).hex_spelling(HEX_DEMON_AURA)) {
             ADD_BAR_FLAG(BAR_SHFIRE);
             ADD_BAR_FLAG(BAR_REGENERATION);
         }
-        if (hex_spelling(creature_ptr, HEX_XTRA_MIGHT))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_XTRA_MIGHT))
             ADD_BAR_FLAG(BAR_MIGHT);
-        if (hex_spelling(creature_ptr, HEX_DETECT_EVIL))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_DETECT_EVIL))
             ADD_BAR_FLAG(BAR_ESP_EVIL);
-        if (hex_spelling(creature_ptr, HEX_ICE_ARMOR))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_ICE_ARMOR))
             ADD_BAR_FLAG(BAR_SHCOLD);
-        if (hex_spelling(creature_ptr, HEX_RUNESWORD))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_RUNESWORD))
             ADD_BAR_FLAG(BAR_RUNESWORD);
-        if (hex_spelling(creature_ptr, HEX_BUILDING))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_BUILDING))
             ADD_BAR_FLAG(BAR_BUILD);
-        if (hex_spelling(creature_ptr, HEX_ANTI_TELE))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_ANTI_TELE))
             ADD_BAR_FLAG(BAR_ANTITELE);
-        if (hex_spelling(creature_ptr, HEX_SHOCK_CLOAK))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_SHOCK_CLOAK))
             ADD_BAR_FLAG(BAR_SHELEC);
-        if (hex_spelling(creature_ptr, HEX_SHADOW_CLOAK))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_SHADOW_CLOAK))
             ADD_BAR_FLAG(BAR_SHSHADOW);
-        if (hex_spelling(creature_ptr, HEX_CONFUSION))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_CONFUSION))
             ADD_BAR_FLAG(BAR_ATTKCONF);
-        if (hex_spelling(creature_ptr, HEX_EYE_FOR_EYE))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_EYE_FOR_EYE))
             ADD_BAR_FLAG(BAR_EYEEYE);
-        if (hex_spelling(creature_ptr, HEX_ANTI_MULTI))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_ANTI_MULTI))
             ADD_BAR_FLAG(BAR_ANTIMULTI);
-        if (hex_spelling(creature_ptr, HEX_VAMP_BLADE))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_VAMP_BLADE))
             ADD_BAR_FLAG(BAR_VAMPILIC);
-        if (hex_spelling(creature_ptr, HEX_ANTI_MAGIC))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_ANTI_MAGIC))
             ADD_BAR_FLAG(BAR_ANTIMAGIC);
-        if (hex_spelling(creature_ptr, HEX_CURE_LIGHT) || hex_spelling(creature_ptr, HEX_CURE_SERIOUS) || hex_spelling(creature_ptr, HEX_CURE_CRITICAL))
+        if (RealmHex(creature_ptr).hex_spelling(HEX_CURE_LIGHT) || RealmHex(creature_ptr).hex_spelling(HEX_CURE_SERIOUS) || RealmHex(creature_ptr).hex_spelling(HEX_CURE_CRITICAL))
             ADD_BAR_FLAG(BAR_CURE);
 
         if (hex_revenge_turn(creature_ptr)) {