1 #include "player-ability/player-charisma.h"
2 #include "mutation/mutation-flag-types.h"
3 #include "object/object-flags.h"
4 #include "player-info/class-info.h"
5 #include "player-info/mimic-info-table.h"
6 #include "player/player-personality.h"
7 #include "player/race-info-table.h"
8 #include "player/special-defense-types.h"
9 #include "realm/realm-hex-numbers.h"
10 #include "spell-realm/spells-hex.h"
11 #include "system/player-type-definition.h"
12 #include "util/bit-flags-calculator.h"
14 void PlayerCharisma::set_locals()
16 this->max_value = +99;
17 this->min_value = -99;
18 this->ability_type = A_CHR;
19 this->tr_flag = TR_CHR;
20 this->tr_bad_flag = TR_CHR;
30 int16_t PlayerCharisma::battleform_value()
34 if (any_bits(this->owner_ptr->special_defense, KATA_KOUKIJIN)) {
46 * * 変異MUT3_FLESH_ROTで減算(-1)
47 * * 変異MUT3_SILLY_VOIで減算(-4)
48 * * 変異MUT3_BLANK_FACで減算(-1)
49 * * 変異MUT3_WART_SKINで減算(-2)
50 * * 変異MUT3_SCALESで減算(-1)
52 int16_t PlayerCharisma::mutation_value()
56 if (this->owner_ptr->muta.any()) {
57 if (this->owner_ptr->muta.has(MUTA::FLESH_ROT)) {
60 if (this->owner_ptr->muta.has(MUTA::SILLY_VOI)) {
63 if (this->owner_ptr->muta.has(MUTA::BLANK_FAC)) {
66 if (this->owner_ptr->muta.has(MUTA::WART_SKIN)) {
69 if (this->owner_ptr->muta.has(MUTA::SCALES)) {
77 int16_t PlayerCharisma::set_exception_value(int16_t value)
79 int16_t result = value;
81 if (this->owner_ptr->muta.has(MUTA::ILL_NORM)) {
88 BIT_FLAGS PlayerCharisma::get_all_flags()
90 BIT_FLAGS flags = PlayerStatusBase::get_all_flags();
92 if (this->owner_ptr->muta.has(MUTA::ILL_NORM)) {
93 set_bits(flags, FLAG_CAUSE_MUTATION);
99 BIT_FLAGS PlayerCharisma::get_bad_flags()
101 BIT_FLAGS flags = PlayerStatusBase::get_bad_flags();
103 if (this->owner_ptr->muta.has(MUTA::ILL_NORM)) {
104 set_bits(flags, FLAG_CAUSE_MUTATION);
111 * @brief ステータス現在値更新の例外処理
112 * @param 通常処理されたステータスの値
113 * @returns 例外処理されたステータスの値
115 * * MUT3_ILL_NORMを保持しているときの例外処理。
116 * * 魅力現在値をレベル依存の値に修正する。
118 int16_t PlayerCharisma::set_exception_use_status(int16_t value)
120 if (this->owner_ptr->muta.has(MUTA::ILL_NORM)) {
121 /* 10 to 18/90 charisma, guaranteed, based on level */
122 if (value < 8 + 2 * this->owner_ptr->lev) {
123 value = 8 + 2 * this->owner_ptr->lev;