OSDN Git Service

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