OSDN Git Service

[Refactor] #1489 Moved player-class.* and player-class-types.h to player-info/
[hengbandforosx/hengbandosx.git] / src / player-ability / player-intelligence.cpp
1 #include "player-ability/player-intelligence.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"
13
14 void PlayerIntelligence::set_locals()
15 {
16     this->max_value = +99;
17     this->min_value = -99;
18     this->ability_type = A_INT;
19     this->tr_flag = TR_INT;
20     this->tr_bad_flag = TR_INT;
21 }
22
23 /*!
24  * @brief 知力補正計算 - 型
25  * @return 知力補正値
26  * @details
27  * * 型による知力修正値
28  * * 降鬼陣で加算(+5)
29  * * 玄武の構えで減算(-1)
30  * * 朱雀の構えで加算(+1)
31  */
32 int16_t PlayerIntelligence::battleform_value()
33 {
34     int16_t result = 0;
35
36     if (any_bits(this->owner_ptr->special_defense, KATA_KOUKIJIN)) {
37         result += 5;
38     }
39
40     if (any_bits(this->owner_ptr->special_defense, KAMAE_GENBU)) {
41         result -= 1;
42     } else if (any_bits(this->owner_ptr->special_defense, KAMAE_SUZAKU)) {
43         result += 1;
44     }
45
46     return result;
47 }
48
49 /*!
50  * @brief 知力補正計算 - 変異
51  * @return 知力補正値
52  * @details
53  * * 変異による知力修正値
54  * * 変異MUT3_HYPER_INTで加算(+4)
55  * * 変異MUT3_MORONICで減算(-4)
56  */
57 int16_t PlayerIntelligence::mutation_value()
58 {
59     int16_t result = 0;
60     if (this->owner_ptr->muta.any()) {
61         if (this->owner_ptr->muta.has(MUTA::HYPER_INT)) {
62             result += 4;
63         }
64
65         if (this->owner_ptr->muta.has(MUTA::MORONIC)) {
66             result -= 4;
67         }
68     }
69     return result;
70 }