msg_print(_("手の輝きがなくなった。", "Your hands stop glowing."));
}
- if (music_singing_any(player_ptr) || SpellHex(player_ptr).is_spelling_any()) {
- concptr str = (music_singing_any(player_ptr)) ? _("歌", "singing") : _("呪文", "casting");
- set_interrupting_song_effect(player_ptr, get_singing_song_effect(player_ptr));
- set_singing_song_effect(player_ptr, MUSIC_NONE);
- msg_format(_("%sが途切れた。", "Your %s is interrupted."), str);
+ auto song_interruption = music_singing_any(player_ptr);
+ auto spellhex_interruption = SpellHex(player_ptr).is_spelling_any();
+
+ if (song_interruption || spellhex_interruption) {
+ if (song_interruption) {
+ set_interrupting_song_effect(player_ptr, get_singing_song_effect(player_ptr));
+ set_singing_song_effect(player_ptr, MUSIC_NONE);
+ msg_print(_("歌が途切れた。", "Your singing is interrupted."));
+ }
+ if (spellhex_interruption) {
+ SpellHex(player_ptr).interrupt_spelling();
+ msg_print(_("呪文が途切れた。", "Your casting is interrupted."));
+ }
player_ptr->action = ACTION_NONE;
player_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
struct spell_hex_data_type {
HexSpellFlagGroup casting_spells;
+ HexSpellFlagGroup interrupting_spells;
SpellHexRevengeType revenge_type;
int32_t revenge_power;
byte revenge_turn;
return;
}
- if (!this->is_spelling_any() && !this->player_ptr->magic_num1[1]) {
+ if (this->spell_hex_data->casting_spells.none() && this->spell_hex_data->interrupting_spells.none()) {
return;
}
bool SpellHex::check_restart()
{
- return false;
-
- //! @todo 現状呪術で magic_num1[1] が 0 以外になる事が無いように思える。
- // spell_hex_data->casting_spells にかかわるのでそのまま残しておくことができないので
- // プリプロで無効にしておき、常にfalse を返すようにしておく
- // どういう意図だったのか作成者に確認の必要あり?
-#if 0
- if (this->player_ptr->magic_num1[1] == 0) {
+ if (this->spell_hex_data->interrupting_spells.none()) {
return false;
}
- this->spell_hex_data->casting_spells = this->player_ptr->magic_num1[1];
- this->player_ptr->magic_num1[1] = 0;
+ this->spell_hex_data->casting_spells = this->spell_hex_data->interrupting_spells;
+ this->spell_hex_data->interrupting_spells.clear();
return true;
-#endif
}
int SpellHex::calc_need_mana()
return this->spell_hex_data && (this->get_casting_num() > 0);
}
+void SpellHex::interrupt_spelling()
+{
+ this->spell_hex_data->interrupting_spells = this->spell_hex_data->casting_spells;
+ this->spell_hex_data->casting_spells.clear();
+}
+
/*!
* @brief 呪術「目には目を」の効果処理
* @param this->player_ptr プレイヤーへの参照ポインタ
bool check_hex_barrier(MONSTER_IDX m_idx, spell_hex_type type) const;
bool is_spelling_specific(int hex) const;
bool is_spelling_any() const;
+ void interrupt_spelling();
void eyes_on_eyes();
void thief_teleport();
void set_casting_flag(spell_hex_type type);