1 #include "system/player-type-definition.h"
2 #include "market/arena-info-table.h"
3 #include "timed-effect/player-confusion.h"
4 #include "timed-effect/player-cut.h"
5 #include "timed-effect/player-deceleration.h"
6 #include "timed-effect/player-fear.h"
7 #include "timed-effect/player-hallucination.h"
8 #include "timed-effect/player-paralysis.h"
9 #include "timed-effect/player-poison.h"
10 #include "timed-effect/player-stun.h"
11 #include "timed-effect/timed-effects.h"
12 #include "world/world.h"
15 * @brief プレイヤー構造体実体 / Static player info record
20 * @brief プレイヤー構造体へのグローバル参照ポインタ / Pointer to the player info
22 PlayerType *p_ptr = &p_body;
24 PlayerType::PlayerType()
25 : timed_effects(std::make_shared<TimedEffects>())
29 bool PlayerType::is_true_winner() const
31 return (w_ptr->total_winner > 0) && (this->arena_number > MAX_ARENA_MONS + 2);
34 std::shared_ptr<TimedEffects> PlayerType::effects() const
36 return this->timed_effects;
40 * @brief 自身の状態が全快で、かつフロアに影響を与えないかを検証する
42 * @todo 時限効果系に分類されるものはいずれTimedEffectsクラスのメソッドとして繰り込みたい
44 bool PlayerType::is_fully_healthy() const
46 auto effects = this->effects();
47 auto is_fully_healthy = this->chp == this->mhp;
48 is_fully_healthy &= this->csp >= this->msp;
49 is_fully_healthy &= !this->blind;
50 is_fully_healthy &= !effects->confusion()->is_confused();
51 is_fully_healthy &= !effects->poison()->is_poisoned();
52 is_fully_healthy &= !effects->fear()->is_fearful();
53 is_fully_healthy &= !effects->stun()->is_stunned();
54 is_fully_healthy &= !effects->cut()->is_cut();
55 is_fully_healthy &= !effects->deceleration()->is_slow();
56 is_fully_healthy &= !effects->paralysis()->is_paralyzed();
57 is_fully_healthy &= !effects->hallucination()->is_hallucinated();
58 is_fully_healthy &= !this->word_recall;
59 is_fully_healthy &= !this->alter_reality;
60 return is_fully_healthy;