return false;
}
- PlayerClass player_class(this->player_ptr);
- if (PlayerRace(this->player_ptr).equals(player_race_type::GOLEM) || player_class.can_resist_stun()) {
+ if (PlayerRace(this->player_ptr).equals(player_race_type::GOLEM) || PlayerClass(this->player_ptr).can_resist_stun()) {
v = 0;
}
auto old_aux = player_stun->get_rank();
auto new_aux = PlayerStun::get_rank(v);
if (new_aux > old_aux) {
- auto stun_mes = PlayerStun::get_stun_mes(new_aux);
- msg_print(stun_mes.data());
- this->decrease_int_wis(v);
- if (player_class.lose_balance()) {
- msg_print(_("型が崩れた。", "You lose your stance."));
- }
-
- if (this->player_ptr->concent) {
- reset_concentration(this->player_ptr, true);
- }
-
- SpellHex spell_hex(this->player_ptr);
- if (spell_hex.is_spelling_any()) {
- (void)spell_hex.stop_all_spells();
- }
-
+ this->process_stun_status(new_aux, v);
notice = true;
} else if (new_aux < old_aux) {
if (new_aux == PlayerStunRank::NONE) {
return true;
}
+void BadStatusSetter::process_stun_status(const PlayerStunRank new_aux, const short v)
+{
+ auto stun_mes = PlayerStun::get_stun_mes(new_aux);
+ msg_print(stun_mes.data());
+ this->decrease_int_wis(v);
+ if (PlayerClass(this->player_ptr).lose_balance()) {
+ msg_print(_("型が崩れた。", "You lose your stance."));
+ }
+
+ if (this->player_ptr->concent) {
+ reset_concentration(this->player_ptr, true);
+ }
+
+ SpellHex spell_hex(this->player_ptr);
+ if (spell_hex.is_spelling_any()) {
+ (void)spell_hex.stop_all_spells();
+ }
+}
+
/*!
* @todo 後で知能と賢さが両方減る確率を減らす.
*/
* @todo TIME_EFFECT型の引数はplayer_typeの時限ステータスをTimedEffectsクラスへ入れる時にshortへ差し替えること.
*/
enum class PlayerCutRank;
+enum class PlayerStunRank;
struct player_type;
class BadStatusSetter {
public:
private:
player_type *player_ptr;
+ void process_stun_status(const PlayerStunRank new_aux, const short v);
void decrease_int_wis(const short v);
bool process_cut_effect(const short v);
void decrease_charisma(const PlayerCutRank new_aux, const short v);