/* Vorpal Hit*/
- if ((have_flag(flgs, TR_VORPAL) || hex_spelling(HEX_RUNESWORD)))
+ if ((have_flag(flgs, TR_VORPAL) || hex_spelling(owner_ptr, HEX_RUNESWORD)))
{
if ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD))
{
if (music_singing_any(creature_ptr)) stop_singing(creature_ptr);
if (hex_spelling_any(creature_ptr))
{
- if (!hex_spelling(HEX_INHAIL)) stop_hex_spell_all(creature_ptr);
+ if (!hex_spelling(creature_ptr, HEX_INHAIL)) stop_hex_spell_all(creature_ptr);
}
o_ptr = REF_ITEM(creature_ptr, creature_ptr->current_floor_ptr, item);
use_realm = tval2realm(o_ptr->tval);
if (use_realm == REALM_HEX)
{
- if (hex_spelling(spell))
+ if (hex_spelling(caster_ptr, spell))
{
msg_print(_("その呪文はすでに詠唱中だ。", "You are already casting it."));
return;
if (attacker_ptr->special_attack & (ATTACK_POIS)) add_flag(flgs, TR_BRAND_POIS);
}
- if (hex_spelling(HEX_RUNESWORD)) add_flag(flgs, TR_SLAY_GOOD);
+ if (hex_spelling(attacker_ptr, HEX_RUNESWORD)) add_flag(flgs, TR_SLAY_GOOD);
MULTIPLY mult = 10;
switch (o_ptr->tval)
}
/* Vampiric drain */
- if ((have_flag(flgs, TR_VAMPIRIC)) || (chaos_effect == 1) || (mode == HISSATSU_DRAIN) || hex_spelling(HEX_VAMP_BLADE))
+ if ((have_flag(flgs, TR_VAMPIRIC)) || (chaos_effect == 1) || (mode == HISSATSU_DRAIN) || hex_spelling(attacker_ptr, HEX_VAMP_BLADE))
{
/* Only drain "living" monsters */
if (monster_living(m_ptr->r_idx))
can_drain = FALSE;
}
- if ((have_flag(flgs, TR_VORPAL) || hex_spelling(HEX_RUNESWORD)) && (randint1(vorpal_chance * 3 / 2) == 1) && !zantetsu_mukou)
+ if ((have_flag(flgs, TR_VORPAL) || hex_spelling(attacker_ptr, HEX_RUNESWORD)) && (randint1(vorpal_chance * 3 / 2) == 1) && !zantetsu_mukou)
vorpal_cut = TRUE;
else vorpal_cut = FALSE;
{
drain_heal = damroll(2, drain_result / 6);
- if (hex_spelling(HEX_VAMP_BLADE)) drain_heal *= 2;
+ if (hex_spelling(attacker_ptr, HEX_VAMP_BLADE)) drain_heal *= 2;
if (cheat_xtra)
{
drain_result = 0;
/* Confusion attack */
- if ((attacker_ptr->special_attack & ATTACK_CONFUSE) || (chaos_effect == 3) || (mode == HISSATSU_CONF) || hex_spelling(HEX_CONFUSION))
+ if ((attacker_ptr->special_attack & ATTACK_CONFUSE) || (chaos_effect == 3) || (mode == HISSATSU_CONF) || hex_spelling(attacker_ptr, HEX_CONFUSION))
{
/* Cancel glowing hands */
if (attacker_ptr->special_attack & ATTACK_CONFUSE)
}
}
- if (hex_spelling(HEX_SHADOW_CLOAK) && alive && !target_ptr->is_dead)
+ if (hex_spelling(target_ptr, HEX_SHADOW_CLOAK) && alive && !target_ptr->is_dead)
{
HIT_POINT dam = 1;
object_type *o_armed_ptr = &target_ptr->inventory_list[INVEN_RARM];
/* Hex - revenge damage stored */
revenge_store(target_ptr, get_damage);
- if ((target_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
+ if ((target_ptr->tim_eyeeye || hex_spelling(target_ptr, HEX_EYE_FOR_EYE))
&& get_damage > 0 && !target_ptr->is_dead)
{
#ifdef JP
if (creature_ptr->realm1 != REALM_HEX) return;
- if (hex_spelling(HEX_DEMON_AURA))
+ if (hex_spelling(creature_ptr, HEX_DEMON_AURA))
{
add_flag(flgs, TR_SH_FIRE);
add_flag(flgs, TR_REGEN);
}
- if (hex_spelling(HEX_ICE_ARMOR)) add_flag(flgs, TR_SH_COLD);
- if (hex_spelling(HEX_SHOCK_CLOAK)) add_flag(flgs, TR_SH_ELEC);
+ if (hex_spelling(creature_ptr, HEX_ICE_ARMOR)) add_flag(flgs, TR_SH_COLD);
+ if (hex_spelling(creature_ptr, HEX_SHOCK_CLOAK)) add_flag(flgs, TR_SH_ELEC);
}
if (creature_ptr->realm1 == REALM_HEX)
{
if (hex_spelling_any(creature_ptr)) creature_ptr->skill_stl -= (1 + CASTING_HEX_NUM(creature_ptr));
- if (hex_spelling(HEX_DETECT_EVIL)) creature_ptr->esp_evil = TRUE;
- if (hex_spelling(HEX_XTRA_MIGHT)) creature_ptr->stat_add[A_STR] += 4;
- if (hex_spelling(HEX_BUILDING))
+ if (hex_spelling(creature_ptr, HEX_DETECT_EVIL)) creature_ptr->esp_evil = TRUE;
+ if (hex_spelling(creature_ptr, HEX_XTRA_MIGHT)) creature_ptr->stat_add[A_STR] += 4;
+ if (hex_spelling(creature_ptr, HEX_BUILDING))
{
creature_ptr->stat_add[A_STR] += 4;
creature_ptr->stat_add[A_DEX] += 4;
creature_ptr->stat_add[A_CON] += 4;
}
- if (hex_spelling(HEX_DEMON_AURA))
+ if (hex_spelling(creature_ptr, HEX_DEMON_AURA))
{
creature_ptr->sh_fire = TRUE;
creature_ptr->regenerate = TRUE;
}
- if (hex_spelling(HEX_ICE_ARMOR))
+ if (hex_spelling(creature_ptr, HEX_ICE_ARMOR))
{
creature_ptr->sh_cold = TRUE;
creature_ptr->to_a += 30;
creature_ptr->dis_to_a += 30;
}
- if (hex_spelling(HEX_SHOCK_CLOAK))
+ if (hex_spelling(creature_ptr, HEX_SHOCK_CLOAK))
{
creature_ptr->sh_elec = TRUE;
new_speed += 3;
}
/* Hex - extra mights gives +1 bonus to max blows */
- if (hex_spelling(HEX_XTRA_MIGHT) || hex_spelling(HEX_BUILDING)) { num++; wgt /= 2; mul += 2; }
+ if (hex_spelling(creature_ptr, HEX_XTRA_MIGHT) || hex_spelling(creature_ptr, HEX_BUILDING)) { num++; wgt /= 2; mul += 2; }
/* Enforce a minimum "weight" (tenth pounds) */
div = ((o_ptr->weight < wgt) ? wgt : o_ptr->weight);
if (o_ptr->curse_flags & (TRC_HEAVY_CURSE)) { creature_ptr->to_h[i] += 7; creature_ptr->dis_to_h[i] += 7; }
if (o_ptr->curse_flags & (TRC_PERMA_CURSE)) { creature_ptr->to_h[i] += 13; creature_ptr->dis_to_h[i] += 13; }
if (o_ptr->curse_flags & (TRC_TY_CURSE)) { creature_ptr->to_h[i] += 5; creature_ptr->dis_to_h[i] += 5; }
- if (hex_spelling(HEX_RUNESWORD))
+ if (hex_spelling(creature_ptr, HEX_RUNESWORD))
{
if (o_ptr->curse_flags & (TRC_CURSED)) { creature_ptr->to_d[i] += 5; creature_ptr->dis_to_d[i] += 5; }
if (o_ptr->curse_flags & (TRC_HEAVY_CURSE)) { creature_ptr->to_d[i] += 7; creature_ptr->dis_to_d[i] += 7; }
if (creature_ptr->tsuyoshi) mhp += 50;
/* Factor in the hex spell settings */
- if (hex_spelling(HEX_XTRA_MIGHT)) mhp += 15;
- if (hex_spelling(HEX_BUILDING)) mhp += 60;
+ if (hex_spelling(creature_ptr, HEX_XTRA_MIGHT)) mhp += 15;
+ if (hex_spelling(creature_ptr, HEX_BUILDING)) mhp += 60;
/* New maximum hitpoints */
if (creature_ptr->mhp != mhp)
*/
bool is_blessed(player_type *creature_ptr)
{
- return creature_ptr->blessed || music_singing(creature_ptr, MUSIC_BLESS) || hex_spelling(HEX_BLESS);
+ return creature_ptr->blessed || music_singing(creature_ptr, MUSIC_BLESS) || hex_spelling(creature_ptr, HEX_BLESS);
}
for (i = 0; i < 32; i++)
{
- if (hex_spelling(i)) exe_spell(caster_ptr, REALM_HEX, i, SPELL_STOP);
+ if (hex_spelling(caster_ptr, i)) exe_spell(caster_ptr, REALM_HEX, i, SPELL_STOP);
}
CASTING_HEX_FLAGS(caster_ptr) = 0;
prt(_(" 名前", " Name"), y, x + 5);
for (spell = 0; spell < 32; spell++)
{
- if (hex_spelling(spell))
+ if (hex_spelling(caster_ptr, spell))
{
Term_erase(x, y + n + 1, 255);
put_str(format("%c) %s", I2A(n), exe_spell(caster_ptr, REALM_HEX, spell, SPELL_NAME)), y + n + 1, x + 2);
need_mana = 0;
for (spell = 0; spell < 32; spell++)
{
- if (hex_spelling(spell))
+ if (hex_spelling(caster_ptr, spell))
{
const magic_type *s_ptr;
s_ptr = &technic_info[REALM_HEX - MIN_TECHNIC][spell];
{
const magic_type *s_ptr;
- if (!hex_spelling(spell)) continue;
+ if (!hex_spelling(caster_ptr, spell)) continue;
s_ptr = &technic_info[REALM_HEX - MIN_TECHNIC][spell];
/* Do any effects of continual spells */
for (spell = 0; spell < 32; spell++)
{
- if (hex_spelling(spell))
+ if (hex_spelling(caster_ptr, spell))
{
exe_spell(caster_ptr, REALM_HEX, spell, SPELL_CONT);
}
monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (!hex_spelling(HEX_ANTI_TELE)) return FALSE;
+ if (!hex_spelling(caster_ptr, HEX_ANTI_TELE)) return FALSE;
if ((caster_ptr->lev * 3 / 2) < randint1(r_ptr->level)) return FALSE;
return TRUE;
monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (!hex_spelling(HEX_ANTI_MAGIC)) return FALSE;
+ if (!hex_spelling(target_ptr, HEX_ANTI_MAGIC)) return FALSE;
if ((target_ptr->lev * 3 / 2) < randint1(r_ptr->level)) return FALSE;
return TRUE;
monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (!hex_spelling(HEX_ANTI_MULTI)) return FALSE;
+ if (!hex_spelling(caster_ptr, HEX_ANTI_MULTI)) return FALSE;
if ((caster_ptr->lev * 3 / 2) < randint1(r_ptr->level)) return FALSE;
return TRUE;
return "";
}
+
+bool hex_spelling(player_type *caster_ptr, int hex)
+{
+ return (caster_ptr->realm1 == REALM_HEX) && (caster_ptr->magic_num1[0] & (1L << (hex)));
+}
#define hex_spelling_any(CREATURE_PTR) \
(((CREATURE_PTR)->realm1 == REALM_HEX) && ((CREATURE_PTR)->magic_num1[0]))
-#define hex_spelling(X) \
- ((p_ptr->realm1 == REALM_HEX) && (p_ptr->magic_num1[0] & (1L << (X))))
#define CASTING_HEX_FLAGS(P_PTR) ((P_PTR)->magic_num1[0])
#define CASTING_HEX_NUM(P_PTR) ((P_PTR)->magic_num2[0])
#define HEX_REVENGE_POWER(P_PTR) ((P_PTR)->magic_num1[2])
extern bool magic_barrier(player_type *target_ptr, MONSTER_IDX m_idx);
extern bool multiply_barrier(player_type *caster_ptr, MONSTER_IDX m_idx);
extern concptr do_hex_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode);
-
+extern bool hex_spelling(player_type *caster_type, int hex);
/* Hex - revenge damage stored */
revenge_store(target_ptr, get_damage);
- if ((target_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
+ if ((target_ptr->tim_eyeeye || hex_spelling(target_ptr, HEX_EYE_FOR_EYE))
&& (get_damage > 0) && !target_ptr->is_dead && (who > 0))
{
GAME_TEXT m_name_self[80];
/* Hex spells */
if (creature_ptr->realm1 == REALM_HEX)
{
- if (hex_spelling(HEX_BLESS)) ADD_FLG(BAR_BLESSED);
- if (hex_spelling(HEX_DEMON_AURA)) { ADD_FLG(BAR_SHFIRE); ADD_FLG(BAR_REGENERATION); }
- if (hex_spelling(HEX_XTRA_MIGHT)) ADD_FLG(BAR_MIGHT);
- if (hex_spelling(HEX_DETECT_EVIL)) ADD_FLG(BAR_ESP_EVIL);
- if (hex_spelling(HEX_ICE_ARMOR)) ADD_FLG(BAR_SHCOLD);
- if (hex_spelling(HEX_RUNESWORD)) ADD_FLG(BAR_RUNESWORD);
- if (hex_spelling(HEX_BUILDING)) ADD_FLG(BAR_BUILD);
- if (hex_spelling(HEX_ANTI_TELE)) ADD_FLG(BAR_ANTITELE);
- if (hex_spelling(HEX_SHOCK_CLOAK)) ADD_FLG(BAR_SHELEC);
- if (hex_spelling(HEX_SHADOW_CLOAK)) ADD_FLG(BAR_SHSHADOW);
- if (hex_spelling(HEX_CONFUSION)) ADD_FLG(BAR_ATTKCONF);
- if (hex_spelling(HEX_EYE_FOR_EYE)) ADD_FLG(BAR_EYEEYE);
- if (hex_spelling(HEX_ANTI_MULTI)) ADD_FLG(BAR_ANTIMULTI);
- if (hex_spelling(HEX_VAMP_BLADE)) ADD_FLG(BAR_VAMPILIC);
- if (hex_spelling(HEX_ANTI_MAGIC)) ADD_FLG(BAR_ANTIMAGIC);
- if (hex_spelling(HEX_CURE_LIGHT) ||
- hex_spelling(HEX_CURE_SERIOUS) ||
- hex_spelling(HEX_CURE_CRITICAL)) ADD_FLG(BAR_CURE);
+ if (hex_spelling(creature_ptr, HEX_BLESS)) ADD_FLG(BAR_BLESSED);
+ if (hex_spelling(creature_ptr, HEX_DEMON_AURA)) { ADD_FLG(BAR_SHFIRE); ADD_FLG(BAR_REGENERATION); }
+ if (hex_spelling(creature_ptr, HEX_XTRA_MIGHT)) ADD_FLG(BAR_MIGHT);
+ if (hex_spelling(creature_ptr, HEX_DETECT_EVIL)) ADD_FLG(BAR_ESP_EVIL);
+ if (hex_spelling(creature_ptr, HEX_ICE_ARMOR)) ADD_FLG(BAR_SHCOLD);
+ if (hex_spelling(creature_ptr, HEX_RUNESWORD)) ADD_FLG(BAR_RUNESWORD);
+ if (hex_spelling(creature_ptr, HEX_BUILDING)) ADD_FLG(BAR_BUILD);
+ if (hex_spelling(creature_ptr, HEX_ANTI_TELE)) ADD_FLG(BAR_ANTITELE);
+ if (hex_spelling(creature_ptr, HEX_SHOCK_CLOAK)) ADD_FLG(BAR_SHELEC);
+ if (hex_spelling(creature_ptr, HEX_SHADOW_CLOAK)) ADD_FLG(BAR_SHSHADOW);
+ if (hex_spelling(creature_ptr, HEX_CONFUSION)) ADD_FLG(BAR_ATTKCONF);
+ if (hex_spelling(creature_ptr, HEX_EYE_FOR_EYE)) ADD_FLG(BAR_EYEEYE);
+ if (hex_spelling(creature_ptr, HEX_ANTI_MULTI)) ADD_FLG(BAR_ANTIMULTI);
+ if (hex_spelling(creature_ptr, HEX_VAMP_BLADE)) ADD_FLG(BAR_VAMPILIC);
+ if (hex_spelling(creature_ptr, HEX_ANTI_MAGIC)) ADD_FLG(BAR_ANTIMAGIC);
+ if (hex_spelling(creature_ptr, HEX_CURE_LIGHT) ||
+ hex_spelling(creature_ptr, HEX_CURE_SERIOUS) ||
+ hex_spelling(creature_ptr, HEX_CURE_CRITICAL)) ADD_FLG(BAR_CURE);
if (HEX_REVENGE_TURN(creature_ptr))
{