2 * @brief プレイヤーの職業クラスに基づく耐性・能力の判定処理等を行うクラス
5 * @details 本クラス作成時点で責務に対する余裕はかなりあるので、適宜ここへ移してくること.
7 #include "player-base/player-class.h"
8 #include "core/player-redraw-types.h"
9 #include "core/player-update-types.h"
10 #include "player/attack-defense-types.h"
11 #include "player/special-defense-types.h"
12 #include "system/player-type-definition.h"
13 #include "util/bit-flags-calculator.h"
15 PlayerClass::PlayerClass(player_type* player_ptr)
16 : player_ptr(player_ptr)
20 bool PlayerClass::can_resist_stun() const
22 return (this->player_ptr->pclass == CLASS_BERSERKER) && (this->player_ptr->lev > 34);
25 bool PlayerClass::is_wizard() const
27 auto is_wizard = this->player_ptr->pclass == CLASS_MAGE;
28 is_wizard |= this->player_ptr->pclass == CLASS_HIGH_MAGE;
29 is_wizard |= this->player_ptr->pclass == CLASS_SORCERER;
30 is_wizard |= this->player_ptr->pclass == CLASS_MAGIC_EATER;
31 is_wizard |= this->player_ptr->pclass == CLASS_BLUE_MAGE;
32 is_wizard |= this->player_ptr->pclass == CLASS_ELEMENTALIST;
36 bool PlayerClass::lose_balance()
38 if (this->player_ptr->pclass != CLASS_SAMURAI) {
42 if (none_bits(this->player_ptr->special_defense, KATA_MASK)) {
46 reset_bits(this->player_ptr->special_defense, KATA_MASK);
47 this->player_ptr->update |= PU_BONUS;
48 this->player_ptr->update |= PU_MONSTERS;
49 this->player_ptr->redraw |= PR_STATE;
50 this->player_ptr->redraw |= PR_STATUS;
51 this->player_ptr->action = ACTION_NONE;