1 #include "player-ability/player-charisma.h"
2 #include "mutation/mutation-flag-types.h"
3 #include "object/object-flags.h"
4 #include "player-base/player-class.h"
5 #include "player-info/class-info.h"
6 #include "player-info/mimic-info-table.h"
7 #include "player-info/samurai-data-type.h"
8 #include "player/player-personality.h"
9 #include "player/race-info-table.h"
10 #include "player/special-defense-types.h"
11 #include "realm/realm-hex-numbers.h"
12 #include "spell-realm/spells-hex.h"
13 #include "system/player-type-definition.h"
14 #include "util/bit-flags-calculator.h"
16 PlayerCharisma::PlayerCharisma(player_type *player_ptr)
17 : PlayerBasicStatistics(player_ptr)
21 void PlayerCharisma::set_locals()
23 this->max_value = +99;
24 this->min_value = -99;
25 this->ability_type = A_CHR;
26 this->tr_flag = TR_CHR;
27 this->tr_bad_flag = TR_CHR;
37 int16_t PlayerCharisma::battleform_value()
41 if (PlayerClass(player_ptr).samurai_stance_is(SamuraiStance::KOUKIJIN)) {
53 * * 変異MUT3_FLESH_ROTで減算(-1)
54 * * 変異MUT3_SILLY_VOIで減算(-4)
55 * * 変異MUT3_BLANK_FACで減算(-1)
56 * * 変異MUT3_WART_SKINで減算(-2)
57 * * 変異MUT3_SCALESで減算(-1)
59 int16_t PlayerCharisma::mutation_value()
63 if (this->player_ptr->muta.any()) {
64 if (this->player_ptr->muta.has(MUTA::FLESH_ROT)) {
67 if (this->player_ptr->muta.has(MUTA::SILLY_VOI)) {
70 if (this->player_ptr->muta.has(MUTA::BLANK_FAC)) {
73 if (this->player_ptr->muta.has(MUTA::WART_SKIN)) {
76 if (this->player_ptr->muta.has(MUTA::SCALES)) {
84 int16_t PlayerCharisma::set_exception_value(int16_t value)
86 int16_t result = value;
88 if (this->player_ptr->muta.has(MUTA::ILL_NORM)) {
95 BIT_FLAGS PlayerCharisma::get_all_flags()
97 BIT_FLAGS flags = PlayerStatusBase::get_all_flags();
99 if (this->player_ptr->muta.has(MUTA::ILL_NORM)) {
100 set_bits(flags, FLAG_CAUSE_MUTATION);
106 BIT_FLAGS PlayerCharisma::get_bad_flags()
108 BIT_FLAGS flags = PlayerStatusBase::get_bad_flags();
110 if (this->player_ptr->muta.has(MUTA::ILL_NORM)) {
111 set_bits(flags, FLAG_CAUSE_MUTATION);
118 * @brief ステータス現在値更新の例外処理
119 * @param 通常処理されたステータスの値
120 * @returns 例外処理されたステータスの値
122 * * MUT3_ILL_NORMを保持しているときの例外処理。
123 * * 魅力現在値をレベル依存の値に修正する。
125 int16_t PlayerCharisma::set_exception_use_status(int16_t value)
127 if (this->player_ptr->muta.has(MUTA::ILL_NORM)) {
128 /* 10 to 18/90 charisma, guaranteed, based on level */
129 if (value < 8 + 2 * this->player_ptr->lev) {
130 value = 8 + 2 * this->player_ptr->lev;