OSDN Git Service

Merge pull request #936 from shimitei/feature/#916_fix_sound_on_off
[hengbandforosx/hengbandosx.git] / src / player-status / player-wisdom.cpp
1 #include "player-status/player-wisdom.h"
2 #include "mutation/mutation-flag-types.h"
3 #include "object/object-flags.h"
4 #include "player/mimic-info-table.h"
5 #include "player/player-class.h"
6 #include "player/player-personality.h"
7 #include "player/race-info-table.h"
8 #include "player/special-defense-types.h"
9 #include "system/player-type-definition.h"
10 #include "util/bit-flags-calculator.h"
11
12 void PlayerWisdom::set_locals()
13 {
14     this->max_value = +99;
15     this->min_value = -99;
16     this->status_type = A_WIS;
17     this->tr_flag = TR_WIS;
18     this->tr_bad_flag = TR_WIS;
19 }
20
21 /*!
22  * @brief 賢さ補正計算 - 型
23  * @return 賢さ補正値
24  * @details
25  * * 型による賢さ修正値
26  * * 降鬼陣で加算(+5)
27  * * 玄武の構えで減算(-1)
28  * * 朱雀の構えで加算(+1)
29  */
30 s16b PlayerWisdom::battleform_value()
31 {
32     s16b result = 0;
33
34     if (any_bits(this->owner_ptr->special_defense, KATA_KOUKIJIN)) {
35         result += 5;
36     }
37
38     if (any_bits(this->owner_ptr->special_defense, KAMAE_GENBU)) {
39         result -= 1;
40     } else if (any_bits(this->owner_ptr->special_defense, KAMAE_SUZAKU)) {
41         result += 1;
42     }
43
44     return result;
45 }
46
47 /*!
48  * @brief 賢さ補正計算 - 変異
49  * @return 賢さ補正値
50  * @details
51  * * 変異による賢さ修正値
52  * * 変異MUT3_HYPER_INTで加算(+4)
53  * * 変異MUT3_MORONICで減算(-4)
54  */
55 s16b PlayerWisdom::mutation_value()
56 {
57     s16b result = 0;
58
59     if (this->owner_ptr->muta.any()) {
60         if (this->owner_ptr->muta.has(MUTA::HYPER_INT)) {
61             result += 4;
62         }
63
64         if (this->owner_ptr->muta.has(MUTA::MORONIC)) {
65             result -= 4;
66         }
67     }
68
69     return result;
70 }