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"
21 * @brief 10ゲームターンが進行するごとに魔法効果の残りターンを減らしていく処理
22 * / Handle timeout every 10 game turns
25 void reduce_magic_effects_timeout(player_type *creature_ptr)
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);
32 if (creature_ptr->image) {
33 (void)set_image(creature_ptr, creature_ptr->image - dec_count);
36 if (creature_ptr->blind) {
37 (void)set_blind(creature_ptr, creature_ptr->blind - dec_count);
40 if (creature_ptr->tim_invis) {
41 (void)set_tim_invis(creature_ptr, creature_ptr->tim_invis - 1, TRUE);
44 if (creature_ptr->suppress_multi_reward) {
45 creature_ptr->suppress_multi_reward = FALSE;
48 if (creature_ptr->tim_esp) {
49 (void)set_tim_esp(creature_ptr, creature_ptr->tim_esp - 1, TRUE);
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);
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);
64 if (creature_ptr->tim_infra) {
65 (void)set_tim_infra(creature_ptr, creature_ptr->tim_infra - 1, TRUE);
68 if (creature_ptr->tim_stealth) {
69 (void)set_tim_stealth(creature_ptr, creature_ptr->tim_stealth - 1, TRUE);
72 if (creature_ptr->tim_levitation) {
73 (void)set_tim_levitation(creature_ptr, creature_ptr->tim_levitation - 1, TRUE);
76 if (creature_ptr->tim_sh_touki) {
77 (void)set_tim_sh_force(creature_ptr, creature_ptr->tim_sh_touki - 1, TRUE);
80 if (creature_ptr->tim_sh_fire) {
81 (void)set_tim_sh_fire(creature_ptr, creature_ptr->tim_sh_fire - 1, TRUE);
84 if (creature_ptr->tim_sh_holy) {
85 (void)set_tim_sh_holy(creature_ptr, creature_ptr->tim_sh_holy - 1, TRUE);
88 if (creature_ptr->tim_eyeeye) {
89 (void)set_tim_eyeeye(creature_ptr, creature_ptr->tim_eyeeye - 1, TRUE);
92 if (creature_ptr->resist_magic) {
93 (void)set_resist_magic(creature_ptr, creature_ptr->resist_magic - 1, TRUE);
96 if (creature_ptr->tim_regen) {
97 (void)set_tim_regen(creature_ptr, creature_ptr->tim_regen - 1, TRUE);
100 if (creature_ptr->tim_res_nether) {
101 (void)set_tim_res_nether(creature_ptr, creature_ptr->tim_res_nether - 1, TRUE);
104 if (creature_ptr->tim_res_time) {
105 (void)set_tim_res_time(creature_ptr, creature_ptr->tim_res_time - 1, TRUE);
108 if (creature_ptr->tim_reflect) {
109 (void)set_tim_reflect(creature_ptr, creature_ptr->tim_reflect - 1, TRUE);
112 if (creature_ptr->multishadow) {
113 (void)set_multishadow(creature_ptr, creature_ptr->multishadow - 1, TRUE);
116 if (creature_ptr->dustrobe) {
117 (void)set_dustrobe(creature_ptr, creature_ptr->dustrobe - 1, TRUE);
120 if (creature_ptr->tim_pass_wall) {
121 (void)set_pass_wall(creature_ptr, creature_ptr->tim_pass_wall - 1, TRUE);
124 if (creature_ptr->paralyzed) {
125 (void)set_paralyzed(creature_ptr, creature_ptr->paralyzed - dec_count);
128 if (creature_ptr->confused) {
129 (void)set_confused(creature_ptr, creature_ptr->confused - dec_count);
132 if (creature_ptr->afraid) {
133 (void)set_afraid(creature_ptr, creature_ptr->afraid - dec_count);
136 if (creature_ptr->fast) {
137 (void)set_fast(creature_ptr, creature_ptr->fast - 1, TRUE);
140 if (creature_ptr->slow) {
141 (void)set_slow(creature_ptr, creature_ptr->slow - dec_count, TRUE);
144 if (creature_ptr->protevil) {
145 (void)set_protevil(creature_ptr, creature_ptr->protevil - 1, TRUE);
148 if (creature_ptr->invuln) {
149 (void)set_invuln(creature_ptr, creature_ptr->invuln - 1, TRUE);
152 if (creature_ptr->wraith_form) {
153 (void)set_wraith_form(creature_ptr, creature_ptr->wraith_form - 1, TRUE);
156 if (creature_ptr->hero) {
157 (void)set_hero(creature_ptr, creature_ptr->hero - 1, TRUE);
160 if (creature_ptr->shero) {
161 (void)set_shero(creature_ptr, creature_ptr->shero - 1, TRUE);
164 if (creature_ptr->blessed) {
165 (void)set_blessed(creature_ptr, creature_ptr->blessed - 1, TRUE);
168 if (creature_ptr->shield) {
169 (void)set_shield(creature_ptr, creature_ptr->shield - 1, TRUE);
172 if (creature_ptr->tsubureru) {
173 (void)set_leveling(creature_ptr, creature_ptr->tsubureru - 1, TRUE);
176 if (creature_ptr->magicdef) {
177 (void)set_magicdef(creature_ptr, creature_ptr->magicdef - 1, TRUE);
180 if (creature_ptr->tsuyoshi) {
181 (void)set_tsuyoshi(creature_ptr, creature_ptr->tsuyoshi - 1, TRUE);
184 if (creature_ptr->oppose_acid) {
185 (void)set_oppose_acid(creature_ptr, creature_ptr->oppose_acid - 1, TRUE);
188 if (creature_ptr->oppose_elec) {
189 (void)set_oppose_elec(creature_ptr, creature_ptr->oppose_elec - 1, TRUE);
192 if (creature_ptr->oppose_fire) {
193 (void)set_oppose_fire(creature_ptr, creature_ptr->oppose_fire - 1, TRUE);
196 if (creature_ptr->oppose_cold) {
197 (void)set_oppose_cold(creature_ptr, creature_ptr->oppose_cold - 1, TRUE);
200 if (creature_ptr->oppose_pois) {
201 (void)set_oppose_pois(creature_ptr, creature_ptr->oppose_pois - 1, TRUE);
204 if (creature_ptr->ult_res) {
205 (void)set_ultimate_res(creature_ptr, creature_ptr->ult_res - 1, TRUE);
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);
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);
218 if (creature_ptr->cut) {
219 int adjust = adj_con_fix[creature_ptr->stat_ind[A_CON]] + 1;
220 if (creature_ptr->cut > 1000)
222 (void)set_cut(creature_ptr, creature_ptr->cut - adjust);