OSDN Git Service

Merge remote-tracking branch 'remotes/origin/feature/Fix-Steal-And-Run' into develop...
[hengband/hengband.git] / src / core / magic-effects-timeout-reducer.c
1 #include "core/magic-effects-timeout-reducer.h"
2 #include "game-option/birth-options.h"
3 #include "mind/mind-force-trainer.h"
4 #include "mind/mind-magic-resistance.h"
5 #include "mind/mind-mirror-master.h"
6 #include "racial/racial-kutar.h"
7 #include "player/player-status-table.h"
8 #include "spell-realm/spells-craft.h"
9 #include "spell-realm/spells-crusade.h"
10 #include "spell-realm/spells-demon.h"
11 #include "spell-realm/spells-song.h"
12 #include "status/bad-status-setter.h"
13 #include "status/body-improvement.h"
14 #include "status/buff-setter.h"
15 #include "status/element-resistance.h"
16 #include "status/shape-changer.h"
17 #include "status/sight-setter.h"
18 #include "status/temporary-resistance.h"
19
20 /*!
21  * @brief 10ゲームターンが進行するごとに魔法効果の残りターンを減らしていく処理
22  * / Handle timeout every 10 game turns
23  * @return なし
24  */
25 void reduce_magic_effects_timeout(player_type *creature_ptr)
26 {
27     const int dec_count = (easy_band ? 2 : 1);
28     if (creature_ptr->tim_mimic) {
29         (void)set_mimic(creature_ptr, creature_ptr->tim_mimic - 1, creature_ptr->mimic_form, TRUE);
30     }
31
32     if (creature_ptr->image) {
33         (void)set_image(creature_ptr, creature_ptr->image - dec_count);
34     }
35
36     if (creature_ptr->blind) {
37         (void)set_blind(creature_ptr, creature_ptr->blind - dec_count);
38     }
39
40     if (creature_ptr->tim_invis) {
41         (void)set_tim_invis(creature_ptr, creature_ptr->tim_invis - 1, TRUE);
42     }
43
44     if (creature_ptr->suppress_multi_reward) {
45         creature_ptr->suppress_multi_reward = FALSE;
46     }
47
48     if (creature_ptr->tim_esp) {
49         (void)set_tim_esp(creature_ptr, creature_ptr->tim_esp - 1, TRUE);
50     }
51
52     if (creature_ptr->ele_attack) {
53         creature_ptr->ele_attack--;
54         if (!creature_ptr->ele_attack)
55             set_ele_attack(creature_ptr, 0, 0);
56     }
57
58     if (creature_ptr->ele_immune) {
59         creature_ptr->ele_immune--;
60         if (!creature_ptr->ele_immune)
61             set_ele_immune(creature_ptr, 0, 0);
62     }
63
64     if (creature_ptr->tim_infra) {
65         (void)set_tim_infra(creature_ptr, creature_ptr->tim_infra - 1, TRUE);
66     }
67
68     if (creature_ptr->tim_stealth) {
69         (void)set_tim_stealth(creature_ptr, creature_ptr->tim_stealth - 1, TRUE);
70     }
71
72     if (creature_ptr->tim_levitation) {
73         (void)set_tim_levitation(creature_ptr, creature_ptr->tim_levitation - 1, TRUE);
74     }
75
76     if (creature_ptr->tim_sh_touki) {
77         (void)set_tim_sh_force(creature_ptr, creature_ptr->tim_sh_touki - 1, TRUE);
78     }
79
80     if (creature_ptr->tim_sh_fire) {
81         (void)set_tim_sh_fire(creature_ptr, creature_ptr->tim_sh_fire - 1, TRUE);
82     }
83
84     if (creature_ptr->tim_sh_holy) {
85         (void)set_tim_sh_holy(creature_ptr, creature_ptr->tim_sh_holy - 1, TRUE);
86     }
87
88     if (creature_ptr->tim_eyeeye) {
89         (void)set_tim_eyeeye(creature_ptr, creature_ptr->tim_eyeeye - 1, TRUE);
90     }
91
92     if (creature_ptr->resist_magic) {
93         (void)set_resist_magic(creature_ptr, creature_ptr->resist_magic - 1, TRUE);
94     }
95
96     if (creature_ptr->tim_regen) {
97         (void)set_tim_regen(creature_ptr, creature_ptr->tim_regen - 1, TRUE);
98     }
99
100     if (creature_ptr->tim_res_nether) {
101         (void)set_tim_res_nether(creature_ptr, creature_ptr->tim_res_nether - 1, TRUE);
102     }
103
104     if (creature_ptr->tim_res_time) {
105         (void)set_tim_res_time(creature_ptr, creature_ptr->tim_res_time - 1, TRUE);
106     }
107
108     if (creature_ptr->tim_reflect) {
109         (void)set_tim_reflect(creature_ptr, creature_ptr->tim_reflect - 1, TRUE);
110     }
111
112     if (creature_ptr->multishadow) {
113         (void)set_multishadow(creature_ptr, creature_ptr->multishadow - 1, TRUE);
114     }
115
116     if (creature_ptr->dustrobe) {
117         (void)set_dustrobe(creature_ptr, creature_ptr->dustrobe - 1, TRUE);
118     }
119
120     if (creature_ptr->tim_pass_wall) {
121         (void)set_pass_wall(creature_ptr, creature_ptr->tim_pass_wall - 1, TRUE);
122     }
123
124     if (creature_ptr->paralyzed) {
125         (void)set_paralyzed(creature_ptr, creature_ptr->paralyzed - dec_count);
126     }
127
128     if (creature_ptr->confused) {
129         (void)set_confused(creature_ptr, creature_ptr->confused - dec_count);
130     }
131
132     if (creature_ptr->afraid) {
133         (void)set_afraid(creature_ptr, creature_ptr->afraid - dec_count);
134     }
135
136     if (creature_ptr->fast) {
137         (void)set_fast(creature_ptr, creature_ptr->fast - 1, TRUE);
138     }
139
140     if (creature_ptr->slow) {
141         (void)set_slow(creature_ptr, creature_ptr->slow - dec_count, TRUE);
142     }
143
144     if (creature_ptr->protevil) {
145         (void)set_protevil(creature_ptr, creature_ptr->protevil - 1, TRUE);
146     }
147
148     if (creature_ptr->invuln) {
149         (void)set_invuln(creature_ptr, creature_ptr->invuln - 1, TRUE);
150     }
151
152     if (creature_ptr->wraith_form) {
153         (void)set_wraith_form(creature_ptr, creature_ptr->wraith_form - 1, TRUE);
154     }
155
156     if (creature_ptr->hero) {
157         (void)set_hero(creature_ptr, creature_ptr->hero - 1, TRUE);
158     }
159
160     if (creature_ptr->shero) {
161         (void)set_shero(creature_ptr, creature_ptr->shero - 1, TRUE);
162     }
163
164     if (creature_ptr->blessed) {
165         (void)set_blessed(creature_ptr, creature_ptr->blessed - 1, TRUE);
166     }
167
168     if (creature_ptr->shield) {
169         (void)set_shield(creature_ptr, creature_ptr->shield - 1, TRUE);
170     }
171
172     if (creature_ptr->tsubureru) {
173         (void)set_leveling(creature_ptr, creature_ptr->tsubureru - 1, TRUE);
174     }
175
176     if (creature_ptr->magicdef) {
177         (void)set_magicdef(creature_ptr, creature_ptr->magicdef - 1, TRUE);
178     }
179
180     if (creature_ptr->tsuyoshi) {
181         (void)set_tsuyoshi(creature_ptr, creature_ptr->tsuyoshi - 1, TRUE);
182     }
183
184     if (creature_ptr->oppose_acid) {
185         (void)set_oppose_acid(creature_ptr, creature_ptr->oppose_acid - 1, TRUE);
186     }
187
188     if (creature_ptr->oppose_elec) {
189         (void)set_oppose_elec(creature_ptr, creature_ptr->oppose_elec - 1, TRUE);
190     }
191
192     if (creature_ptr->oppose_fire) {
193         (void)set_oppose_fire(creature_ptr, creature_ptr->oppose_fire - 1, TRUE);
194     }
195
196     if (creature_ptr->oppose_cold) {
197         (void)set_oppose_cold(creature_ptr, creature_ptr->oppose_cold - 1, TRUE);
198     }
199
200     if (creature_ptr->oppose_pois) {
201         (void)set_oppose_pois(creature_ptr, creature_ptr->oppose_pois - 1, TRUE);
202     }
203
204     if (creature_ptr->ult_res) {
205         (void)set_ultimate_res(creature_ptr, creature_ptr->ult_res - 1, TRUE);
206     }
207
208     if (creature_ptr->poisoned) {
209         int adjust = adj_con_fix[creature_ptr->stat_ind[A_CON]] + 1;
210         (void)set_poisoned(creature_ptr, creature_ptr->poisoned - adjust);
211     }
212
213     if (creature_ptr->stun) {
214         int adjust = adj_con_fix[creature_ptr->stat_ind[A_CON]] + 1;
215         (void)set_stun(creature_ptr, creature_ptr->stun - adjust);
216     }
217
218     if (creature_ptr->cut) {
219         int adjust = adj_con_fix[creature_ptr->stat_ind[A_CON]] + 1;
220         if (creature_ptr->cut > 1000)
221             adjust = 0;
222         (void)set_cut(creature_ptr, creature_ptr->cut - adjust);
223     }
224 }