{
int16_t result = 0;
if (this->player_ptr->realm1 == REALM_HEX) {
- if (SpellHex(this->player_ptr).is_spelling_any())
- result -= (1 + casting_hex_num(this->player_ptr));
+ SpellHex spell_hex(this->player_ptr);
+ if (spell_hex.is_spelling_any()) {
+ result -= spell_hex.get_casting_num() + 1;
+ }
}
+
if (is_shero(this->player_ptr)) {
result -= 7;
}
- if (is_time_limit_stealth(this->player_ptr))
+
+ if (is_time_limit_stealth(this->player_ptr)) {
result += 999;
+ }
return result;
}
if (!flag) {
msg_format(_("%sの呪文の詠唱をやめた。", "Finish casting '%^s'."), exe_spell(player_ptr, REALM_HEX, HEX_RESTORE, SPELL_NAME));
- SpellHex(player_ptr).reset_casting_flag(HEX_RESTORE);
- if (cont)
+ SpellHex spell_hex(player_ptr);
+ spell_hex.reset_casting_flag(HEX_RESTORE);
+ if (cont) {
casting_hex_num(player_ptr)--;
- if (casting_hex_num(player_ptr))
+ }
+
+ if (spell_hex.get_casting_num() > 0) {
player_ptr->action = ACTION_NONE;
+ }
player_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
player_ptr->redraw |= (PR_EXTRA);
reset_bits(value, 1U << type);
this->player_ptr->magic_num1[0] = value;
}
+
+int32_t SpellHex::get_casting_num() const
+{
+ return this->player_ptr->magic_num2[0];
+}
void thief_teleport();
void set_casting_flag(spell_hex_type type);
void reset_casting_flag(spell_hex_type type);
+ int32_t get_casting_num() const;
private:
player_type *player_ptr;