From b5d2058c67289191a7ae884dbef4ca3bea49ed4b Mon Sep 17 00:00:00 2001 From: Hourier Date: Mon, 6 Sep 2021 19:55:25 +0900 Subject: [PATCH] [Refactor] #1469 Moved hex_spelling() from global to RealmHex --- src/cmd-action/cmd-spell.cpp | 2 +- src/cmd-item/cmd-quaff.cpp | 2 +- src/combat/aura-counterattack.cpp | 2 +- src/combat/slaying.cpp | 2 +- src/effect/effect-player.cpp | 2 +- src/market/building-craft-weapon.cpp | 2 +- src/monster-attack/monster-attack-player.cpp | 2 +- src/object-use/quaff-execution.cpp | 2 +- src/player-ability/player-constitution.cpp | 2 +- src/player-ability/player-dexterity.cpp | 2 +- src/player-ability/player-strength.cpp | 5 +++-- src/player-attack/attack-chaos-effect.cpp | 2 +- src/player-attack/blood-sucking-processor.cpp | 4 ++-- src/player-attack/player-attack.cpp | 5 ++--- src/player-status/player-speed.cpp | 2 +- src/player/player-status-flags.cpp | 10 ++++----- src/player/player-status.cpp | 12 +++++----- src/spell-realm/spells-hex.cpp | 14 ++++++------ src/spell-realm/spells-hex.h | 2 +- src/window/main-window-stat-poster.cpp | 32 +++++++++++++-------------- 20 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/cmd-action/cmd-spell.cpp b/src/cmd-action/cmd-spell.cpp index c10bb9cf2..d7ddc6f24 100644 --- a/src/cmd-action/cmd-spell.cpp +++ b/src/cmd-action/cmd-spell.cpp @@ -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; } diff --git a/src/cmd-item/cmd-quaff.cpp b/src/cmd-item/cmd-quaff.cpp index a50d08840..2d47e177b 100644 --- a/src/cmd-item/cmd-quaff.cpp +++ b/src/cmd-item/cmd-quaff.cpp @@ -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)) diff --git a/src/combat/aura-counterattack.cpp b/src/combat/aura-counterattack.cpp index 3c55b8b06..679af7ebb 100644 --- a/src/combat/aura-counterattack.cpp +++ b/src/combat/aura-counterattack.cpp @@ -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; diff --git a/src/combat/slaying.cpp b/src/combat/slaying.cpp index 86061116d..f8894e551 100644 --- a/src/combat/slaying.cpp +++ b/src/combat/slaying.cpp @@ -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; diff --git a/src/effect/effect-player.cpp b/src/effect/effect-player.cpp index 9e7a82c79..e501e5709 100644 --- a/src/effect/effect-player.cpp +++ b/src/effect/effect-player.cpp @@ -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); diff --git a/src/market/building-craft-weapon.cpp b/src/market/building-craft-weapon.cpp index fff0161e5..d5df4862c 100644 --- a/src/market/building-craft-weapon.cpp +++ b/src/market/building-craft-weapon.cpp @@ -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; diff --git a/src/monster-attack/monster-attack-player.cpp b/src/monster-attack/monster-attack-player.cpp index b8e4af0e2..0d202a9f2 100644 --- a/src/monster-attack/monster-attack-player.cpp +++ b/src/monster-attack/monster-attack-player.cpp @@ -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 diff --git a/src/object-use/quaff-execution.cpp b/src/object-use/quaff-execution.cpp index ed7cf2416..7033d702a 100644 --- a/src/object-use/quaff-execution.cpp +++ b/src/object-use/quaff-execution.cpp @@ -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(); } diff --git a/src/player-ability/player-constitution.cpp b/src/player-ability/player-constitution.cpp index b0b3cdc19..75bea1e67 100644 --- a/src/player-ability/player-constitution.cpp +++ b/src/player-ability/player-constitution.cpp @@ -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; } } diff --git a/src/player-ability/player-dexterity.cpp b/src/player-ability/player-dexterity.cpp index 965968a81..3a10247da 100644 --- a/src/player-ability/player-dexterity.cpp +++ b/src/player-ability/player-dexterity.cpp @@ -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; } } diff --git a/src/player-ability/player-strength.cpp b/src/player-ability/player-strength.cpp index ce85eae1c..161c7048e 100644 --- a/src/player-ability/player-strength.cpp +++ b/src/player-ability/player-strength.cpp @@ -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; } } diff --git a/src/player-attack/attack-chaos-effect.cpp b/src/player-attack/attack-chaos-effect.cpp index ff199a02b..f7077b2f7 100644 --- a/src/player-attack/attack-chaos-effect.cpp +++ b/src/player-attack/attack-chaos-effect.cpp @@ -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) diff --git a/src/player-attack/blood-sucking-processor.cpp b/src/player-attack/blood-sucking-processor.cpp index 9213cbbec..bac9e59f2 100644 --- a/src/player-attack/blood-sucking-processor.cpp +++ b/src/player-attack/blood-sucking-processor.cpp @@ -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) { diff --git a/src/player-attack/player-attack.cpp b/src/player-attack/player-attack.cpp index 2689b7859..bee787dc8 100644 --- a/src/player-attack/player-attack.cpp +++ b/src/player-attack/player-attack.cpp @@ -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); diff --git a/src/player-status/player-speed.cpp b/src/player-status/player-speed.cpp index 894b1b438..78f63635d 100644 --- a/src/player-status/player-speed.cpp +++ b/src/player-status/player-speed.cpp @@ -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; } } diff --git a/src/player/player-status-flags.cpp b/src/player/player-status-flags.cpp index 46778e078..0e8d6964b 100644 --- a/src/player/player-status-flags.cpp +++ b/src/player/player-status-flags.cpp @@ -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; } diff --git a/src/player/player-status.cpp b/src/player/player-status.cpp index 1aaa0f549..1074ec644 100644 --- a/src/player/player-status.cpp +++ b/src/player/player-status.cpp @@ -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) diff --git a/src/spell-realm/spells-hex.cpp b/src/spell-realm/spells-hex.cpp index db8d60dfe..4a3a2d260 100644 --- a/src/spell-realm/spells-hex.cpp +++ b/src/spell-realm/spells-hex.cpp @@ -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))); } diff --git a/src/spell-realm/spells-hex.h b/src/spell-realm/spells-hex.h index a000d6aa6..a49e35ed4 100644 --- a/src/spell-realm/spells-hex.h +++ b/src/spell-realm/spells-hex.h @@ -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]) diff --git a/src/window/main-window-stat-poster.cpp b/src/window/main-window-stat-poster.cpp index 512e7bcff..fe2628b9d 100644 --- a/src/window/main-window-stat-poster.cpp +++ b/src/window/main-window-stat-poster.cpp @@ -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)) { -- 2.11.0