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;
}
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))
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;
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;
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);
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;
*/
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
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();
}
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;
}
}
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;
}
}
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;
}
}
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)
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;
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) {
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);
}
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;
}
}
{
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);
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;
}
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;
}
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;
}
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;
}
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;
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;
}
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;
}
}
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;
}
*/
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)
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);
}
}
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;
/* 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);
}
}
{
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);
}
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;
}
{
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)));
}
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;
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])
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)) {