1 #include "object-activation/activation-resistance.h"
2 #include "core/hp-mp-processor.h"
3 #include "spell-kind/spells-launcher.h"
4 #include "spell/spell-types.h"
5 #include "status/bad-status-setter.h"
6 #include "status/buff-setter.h"
7 #include "status/element-resistance.h"
8 #include "status/temporary-resistance.h"
9 #include "sv-definition/sv-ring-types.h"
10 #include "system/object-type-definition.h"
11 #include "target/target-getter.h"
12 #include "view/display-messages.h"
14 bool activate_resistance_elements(player_type *user_ptr)
16 msg_print(_("様々な色に輝いている...", "It glows many colours..."));
17 (void)set_oppose_acid(user_ptr, randint1(40) + 40, FALSE);
18 (void)set_oppose_elec(user_ptr, randint1(40) + 40, FALSE);
19 (void)set_oppose_fire(user_ptr, randint1(40) + 40, FALSE);
20 (void)set_oppose_cold(user_ptr, randint1(40) + 40, FALSE);
21 (void)set_oppose_pois(user_ptr, randint1(40) + 40, FALSE);
26 * @brief 酸属性のボールを放ち、酸の一時耐性を得る。
27 * @param user_ptr プレーヤーへの参照ポインタ
29 * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す
31 bool activate_acid_ball_and_resistance(player_type *user_ptr, concptr name)
33 msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
36 if (!get_aim_dir(user_ptr, &dir))
39 (void)fire_ball(user_ptr, GF_ACID, dir, 100, 2);
40 (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
46 * @brief 電撃属性のボールを放ち、電撃の一時耐性を得る。
47 * @param user_ptr プレーヤーへの参照ポインタ
49 * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す
51 bool activate_elec_ball_and_resistance(player_type *user_ptr, concptr name)
53 msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
56 if (!get_aim_dir(user_ptr, &dir))
59 (void)fire_ball(user_ptr, GF_ELEC, dir, 100, 2);
60 (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
66 * @brief 火炎属性のボールを放ち、火炎の一時耐性を得る。
67 * @param user_ptr プレーヤーへの参照ポインタ
69 * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す
71 bool activate_fire_ball_and_resistance(player_type *user_ptr, concptr name)
73 msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
76 if (!get_aim_dir(user_ptr, &dir))
79 (void)fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
80 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
86 * @brief 冷気属性のボールを放ち、冷気の一時耐性を得る。
87 * @param user_ptr プレーヤーへの参照ポインタ
89 * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す
91 bool activate_cold_ball_and_resistance(player_type *user_ptr, concptr name)
93 msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
96 if (!get_aim_dir(user_ptr, &dir))
99 (void)fire_ball(user_ptr, GF_COLD, dir, 100, 2);
100 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
106 * @brief 毒属性のボールを放ち、毒の一時耐性を得る
107 * @param user_ptr プレーヤーへの参照ポインタ
109 * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す
111 bool activate_pois_ball_and_resistance(player_type *user_ptr, concptr name)
113 msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
116 if (!get_aim_dir(user_ptr, &dir))
119 (void)fire_ball(user_ptr, GF_POIS, dir, 100, 2);
120 (void)set_oppose_pois(user_ptr, randint1(20) + 20, FALSE);
127 * @param user_ptr プレーヤーへの参照ポインタ
131 bool activate_resistance_acid(player_type *user_ptr, concptr name)
133 msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
134 (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
140 * @param user_ptr プレーヤーへの参照ポインタ
144 bool activate_resistance_elec(player_type *user_ptr, concptr name)
146 msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
147 (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
153 * @param user_ptr プレーヤーへの参照ポインタ
157 bool activate_resistance_fire(player_type *user_ptr, concptr name)
159 msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
160 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
166 * @param user_ptr プレーヤーへの参照ポインタ
170 bool activate_resistance_cold(player_type *user_ptr, concptr name)
172 msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
173 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
179 * @param user_ptr プレーヤーへの参照ポインタ
183 bool activate_resistance_pois(player_type *user_ptr, concptr name)
185 msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
186 (void)set_oppose_pois(user_ptr, randint1(20) + 20, FALSE);
190 bool activate_ultimate_resistance(player_type *user_ptr)
192 TIME_EFFECT v = randint1(25) + 25;
193 (void)set_afraid(user_ptr, 0);
194 (void)set_hero(user_ptr, v, FALSE);
195 (void)hp_player(user_ptr, 10);
196 (void)set_blessed(user_ptr, v, FALSE);
197 (void)set_oppose_acid(user_ptr, v, FALSE);
198 (void)set_oppose_elec(user_ptr, v, FALSE);
199 (void)set_oppose_fire(user_ptr, v, FALSE);
200 (void)set_oppose_cold(user_ptr, v, FALSE);
201 (void)set_oppose_pois(user_ptr, v, FALSE);
202 (void)set_ultimate_res(user_ptr, v, FALSE);