2 #include "core/magic-effects-timeout-reducer.h"
3 #include "player-effects.h"
6 * @brief 10ゲームターンが進行するごとに魔法効果の残りターンを減らしていく処理
7 * / Handle timeout every 10 game turns
10 void reduce_magic_effects_timeout(player_type* creature_ptr)
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);
17 if (creature_ptr->image) {
18 (void)set_image(creature_ptr, creature_ptr->image - dec_count);
21 if (creature_ptr->blind) {
22 (void)set_blind(creature_ptr, creature_ptr->blind - dec_count);
25 if (creature_ptr->tim_invis) {
26 (void)set_tim_invis(creature_ptr, creature_ptr->tim_invis - 1, TRUE);
29 if (creature_ptr->suppress_multi_reward) {
30 creature_ptr->suppress_multi_reward = FALSE;
33 if (creature_ptr->tim_esp) {
34 (void)set_tim_esp(creature_ptr, creature_ptr->tim_esp - 1, TRUE);
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);
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);
49 if (creature_ptr->tim_infra) {
50 (void)set_tim_infra(creature_ptr, creature_ptr->tim_infra - 1, TRUE);
53 if (creature_ptr->tim_stealth) {
54 (void)set_tim_stealth(creature_ptr, creature_ptr->tim_stealth - 1, TRUE);
57 if (creature_ptr->tim_levitation) {
58 (void)set_tim_levitation(creature_ptr, creature_ptr->tim_levitation - 1, TRUE);
61 if (creature_ptr->tim_sh_touki) {
62 (void)set_tim_sh_touki(creature_ptr, creature_ptr->tim_sh_touki - 1, TRUE);
65 if (creature_ptr->tim_sh_fire) {
66 (void)set_tim_sh_fire(creature_ptr, creature_ptr->tim_sh_fire - 1, TRUE);
69 if (creature_ptr->tim_sh_holy) {
70 (void)set_tim_sh_holy(creature_ptr, creature_ptr->tim_sh_holy - 1, TRUE);
73 if (creature_ptr->tim_eyeeye) {
74 (void)set_tim_eyeeye(creature_ptr, creature_ptr->tim_eyeeye - 1, TRUE);
77 if (creature_ptr->resist_magic) {
78 (void)set_resist_magic(creature_ptr, creature_ptr->resist_magic - 1, TRUE);
81 if (creature_ptr->tim_regen) {
82 (void)set_tim_regen(creature_ptr, creature_ptr->tim_regen - 1, TRUE);
85 if (creature_ptr->tim_res_nether) {
86 (void)set_tim_res_nether(creature_ptr, creature_ptr->tim_res_nether - 1, TRUE);
89 if (creature_ptr->tim_res_time) {
90 (void)set_tim_res_time(creature_ptr, creature_ptr->tim_res_time - 1, TRUE);
93 if (creature_ptr->tim_reflect) {
94 (void)set_tim_reflect(creature_ptr, creature_ptr->tim_reflect - 1, TRUE);
97 if (creature_ptr->multishadow) {
98 (void)set_multishadow(creature_ptr, creature_ptr->multishadow - 1, TRUE);
101 if (creature_ptr->dustrobe) {
102 (void)set_dustrobe(creature_ptr, creature_ptr->dustrobe - 1, TRUE);
105 if (creature_ptr->kabenuke) {
106 (void)set_kabenuke(creature_ptr, creature_ptr->kabenuke - 1, TRUE);
109 if (creature_ptr->paralyzed) {
110 (void)set_paralyzed(creature_ptr, creature_ptr->paralyzed - dec_count);
113 if (creature_ptr->confused) {
114 (void)set_confused(creature_ptr, creature_ptr->confused - dec_count);
117 if (creature_ptr->afraid) {
118 (void)set_afraid(creature_ptr, creature_ptr->afraid - dec_count);
121 if (creature_ptr->fast) {
122 (void)set_fast(creature_ptr, creature_ptr->fast - 1, TRUE);
125 if (creature_ptr->slow) {
126 (void)set_slow(creature_ptr, creature_ptr->slow - dec_count, TRUE);
129 if (creature_ptr->protevil) {
130 (void)set_protevil(creature_ptr, creature_ptr->protevil - 1, TRUE);
133 if (creature_ptr->invuln) {
134 (void)set_invuln(creature_ptr, creature_ptr->invuln - 1, TRUE);
137 if (creature_ptr->wraith_form) {
138 (void)set_wraith_form(creature_ptr, creature_ptr->wraith_form - 1, TRUE);
141 if (creature_ptr->hero) {
142 (void)set_hero(creature_ptr, creature_ptr->hero - 1, TRUE);
145 if (creature_ptr->shero) {
146 (void)set_shero(creature_ptr, creature_ptr->shero - 1, TRUE);
149 if (creature_ptr->blessed) {
150 (void)set_blessed(creature_ptr, creature_ptr->blessed - 1, TRUE);
153 if (creature_ptr->shield) {
154 (void)set_shield(creature_ptr, creature_ptr->shield - 1, TRUE);
157 if (creature_ptr->tsubureru) {
158 (void)set_tsubureru(creature_ptr, creature_ptr->tsubureru - 1, TRUE);
161 if (creature_ptr->magicdef) {
162 (void)set_magicdef(creature_ptr, creature_ptr->magicdef - 1, TRUE);
165 if (creature_ptr->tsuyoshi) {
166 (void)set_tsuyoshi(creature_ptr, creature_ptr->tsuyoshi - 1, TRUE);
169 if (creature_ptr->oppose_acid) {
170 (void)set_oppose_acid(creature_ptr, creature_ptr->oppose_acid - 1, TRUE);
173 if (creature_ptr->oppose_elec) {
174 (void)set_oppose_elec(creature_ptr, creature_ptr->oppose_elec - 1, TRUE);
177 if (creature_ptr->oppose_fire) {
178 (void)set_oppose_fire(creature_ptr, creature_ptr->oppose_fire - 1, TRUE);
181 if (creature_ptr->oppose_cold) {
182 (void)set_oppose_cold(creature_ptr, creature_ptr->oppose_cold - 1, TRUE);
185 if (creature_ptr->oppose_pois) {
186 (void)set_oppose_pois(creature_ptr, creature_ptr->oppose_pois - 1, TRUE);
189 if (creature_ptr->ult_res) {
190 (void)set_ultimate_res(creature_ptr, creature_ptr->ult_res - 1, TRUE);
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);
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);
203 if (creature_ptr->cut) {
204 int adjust = adj_con_fix[creature_ptr->stat_ind[A_CON]] + 1;
205 if (creature_ptr->cut > 1000)
207 (void)set_cut(creature_ptr, creature_ptr->cut - adjust);