OSDN Git Service

ad71deeacd23ebf5f5b2d95ab7a372bd9edb034b
[hengbandforosx/hengbandosx.git] / src / player-ability / player-wisdom.cpp
1 #include "player-ability/player-wisdom.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/monk-data-type.h"
8 #include "player-info/samurai-data-type.h"
9 #include "player/player-personality.h"
10 #include "player/race-info-table.h"
11 #include "player/special-defense-types.h"
12 #include "system/player-type-definition.h"
13 #include "util/bit-flags-calculator.h"
14
15 PlayerWisdom::PlayerWisdom(player_type *player_ptr)
16     : PlayerBasicStatistics(player_ptr)
17 {
18 }
19
20 void PlayerWisdom::set_locals()
21 {
22     this->max_value = +99;
23     this->min_value = -99;
24     this->ability_type = A_WIS;
25     this->tr_flag = TR_WIS;
26     this->tr_bad_flag = TR_WIS;
27 }
28
29 /*!
30  * @brief 賢さ補正計算 - 型
31  * @return 賢さ補正値
32  * @details
33  * * 型による賢さ修正値
34  * * 降鬼陣で加算(+5)
35  * * 玄武の構えで減算(-1)
36  * * 朱雀の構えで加算(+1)
37  */
38 int16_t PlayerWisdom::stance_value()
39 {
40     int16_t result = 0;
41
42     PlayerClass pc(player_ptr);
43     if (pc.samurai_stance_is(SamuraiStanceType::KOUKIJIN)) {
44         result += 5;
45     }
46
47     if (pc.monk_stance_is(MonkStanceType::GENBU)) {
48         result -= 1;
49     } else if (pc.monk_stance_is(MonkStanceType::SUZAKU)) {
50         result += 1;
51     }
52
53     return result;
54 }
55
56 /*!
57  * @brief 賢さ補正計算 - 変異
58  * @return 賢さ補正値
59  * @details
60  * * 変異による賢さ修正値
61  * * 変異MUT3_HYPER_INTで加算(+4)
62  * * 変異MUT3_MORONICで減算(-4)
63  */
64 int16_t PlayerWisdom::mutation_value()
65 {
66     int16_t result = 0;
67
68     if (this->player_ptr->muta.any()) {
69         if (this->player_ptr->muta.has(PlayerMutationType::HYPER_INT)) {
70             result += 4;
71         }
72
73         if (this->player_ptr->muta.has(PlayerMutationType::MORONIC)) {
74             result -= 4;
75         }
76     }
77
78     return result;
79 }