OSDN Git Service

Inserted space between word and parenthesis in an English message.
[hengband/hengband.git] / src / object-activation / activation-resistance.c
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"
13
14 bool activate_resistance_elements(player_type *user_ptr)
15 {
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);
22     return TRUE;
23 }
24
25 /*!
26  * @brief 酸属性のボールを放ち、酸の一時耐性を得る。
27  * @param user_ptr プレーヤーへの参照ポインタ
28  * @param name アイテム名
29  * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す
30  */
31 bool activate_acid_ball_and_resistance(player_type *user_ptr, concptr name)
32 {
33     msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
34
35     DIRECTION dir;
36     if (!get_aim_dir(user_ptr, &dir))
37         return FALSE;
38
39     (void)fire_ball(user_ptr, GF_ACID, dir, 100, 2);
40     (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
41
42     return TRUE;
43 }
44
45 /*!
46  * @brief 電撃属性のボールを放ち、電撃の一時耐性を得る。
47  * @param user_ptr プレーヤーへの参照ポインタ
48  * @param name アイテム名
49  * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す
50  */
51 bool activate_elec_ball_and_resistance(player_type *user_ptr, concptr name)
52 {
53     msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
54
55     DIRECTION dir;
56     if (!get_aim_dir(user_ptr, &dir))
57         return FALSE;
58
59     (void)fire_ball(user_ptr, GF_ELEC, dir, 100, 2);
60     (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
61
62     return TRUE;
63 }
64
65 /*!
66  * @brief 火炎属性のボールを放ち、火炎の一時耐性を得る。
67  * @param user_ptr プレーヤーへの参照ポインタ
68  * @param name アイテム名
69  * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す
70  */
71 bool activate_fire_ball_and_resistance(player_type *user_ptr, concptr name)
72 {
73     msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
74
75     DIRECTION dir;
76     if (!get_aim_dir(user_ptr, &dir))
77         return FALSE;
78
79     (void)fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
80     (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
81
82     return TRUE;
83 }
84
85 /*!
86  * @brief 冷気属性のボールを放ち、冷気の一時耐性を得る。
87  * @param user_ptr プレーヤーへの参照ポインタ
88  * @param name アイテム名
89  * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す
90  */
91 bool activate_cold_ball_and_resistance(player_type *user_ptr, concptr name)
92 {
93     msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
94
95     DIRECTION dir;
96     if (!get_aim_dir(user_ptr, &dir))
97         return FALSE;
98
99     (void)fire_ball(user_ptr, GF_COLD, dir, 100, 2);
100     (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
101
102     return TRUE;
103 }
104
105 /*!
106  * @brief 毒属性のボールを放ち、毒の一時耐性を得る
107  * @param user_ptr プレーヤーへの参照ポインタ
108  * @param name アイテム名
109  * @return 発動をキャンセルした場合FALSE、それ以外はTRUEを返す
110  */
111 bool activate_pois_ball_and_resistance(player_type *user_ptr, concptr name)
112 {
113     msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
114
115     DIRECTION dir;
116     if (!get_aim_dir(user_ptr, &dir))
117         return FALSE;
118
119     (void)fire_ball(user_ptr, GF_POIS, dir, 100, 2);
120     (void)set_oppose_pois(user_ptr, randint1(20) + 20, FALSE);
121
122     return TRUE;
123 }
124
125 /*!
126  * @brief 酸の一時耐性を得る。
127  * @param user_ptr プレーヤーへの参照ポインタ
128  * @param name アイテム名
129  * @return 常にTRUE
130  */
131 bool activate_resistance_acid(player_type *user_ptr, concptr name)
132 {
133     msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
134     (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
135     return TRUE;
136 }
137
138 /*!
139  * @brief 電撃の一時耐性を得る。
140  * @param user_ptr プレーヤーへの参照ポインタ
141  * @param name アイテム名
142  * @return 常にTRUE
143  */
144 bool activate_resistance_elec(player_type *user_ptr, concptr name)
145 {
146     msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
147     (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
148     return TRUE;
149 }
150
151 /*!
152  * @brief 火炎の一時耐性を得る。
153  * @param user_ptr プレーヤーへの参照ポインタ
154  * @param name アイテム名
155  * @return 常にTRUE
156  */
157 bool activate_resistance_fire(player_type *user_ptr, concptr name)
158 {
159     msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
160     (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
161     return TRUE;
162 }
163
164 /*!
165  * @brief 冷気の一時耐性を得る。
166  * @param user_ptr プレーヤーへの参照ポインタ
167  * @param name アイテム名
168  * @return 常にTRUE
169  */
170 bool activate_resistance_cold(player_type *user_ptr, concptr name)
171 {
172     msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
173     (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
174     return TRUE;
175 }
176
177 /*!
178  * @brief 毒の一時耐性を得る
179  * @param user_ptr プレーヤーへの参照ポインタ
180  * @param name アイテム名
181  * @return 常にTRUE
182  */
183 bool activate_resistance_pois(player_type *user_ptr, concptr name)
184 {
185     msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
186     (void)set_oppose_pois(user_ptr, randint1(20) + 20, FALSE);
187     return TRUE;
188 }
189
190 bool activate_ultimate_resistance(player_type *user_ptr)
191 {
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);
203     return TRUE;
204 }