1 #include "object-activation/activation-bolt-ball.h"
2 #include "effect/effect-characteristics.h"
3 #include "effect/effect-processor.h"
4 #include "floor/cave.h"
5 #include "floor/floor-util.h"
6 #include "grid/feature-flag-types.h"
7 #include "hpmp/hp-mp-processor.h"
8 #include "spell-kind/spells-launcher.h"
9 #include "spell-kind/spells-specific-bolt.h"
10 #include "effect/attribute-types.h"
11 #include "system/player-type-definition.h"
12 #include "target/target-getter.h"
13 #include "view/display-messages.h"
15 bool activate_missile_1(PlayerType *player_ptr)
18 msg_print(_("それは眩しいくらいに明るく輝いている...", "It glows extremely brightly..."));
19 if (!get_aim_dir(player_ptr, &dir))
22 (void)fire_bolt(player_ptr, AttributeType::MISSILE, dir, damroll(2, 6));
26 bool activate_missile_2(PlayerType *player_ptr)
29 msg_print(_("魔法のトゲが現れた...", "It grows magical spikes..."));
30 if (!get_aim_dir(player_ptr, &dir))
33 (void)fire_bolt(player_ptr, AttributeType::MISSILE, dir, 150);
37 bool activate_missile_3(PlayerType *player_ptr)
40 if (!get_aim_dir(player_ptr, &dir))
43 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
44 fire_breath(player_ptr, AttributeType::MISSILE, dir, 300, 4);
48 bool activate_bolt_acid_1(PlayerType *player_ptr)
51 msg_print(_("それは酸に覆われた...", "It is covered in acid..."));
52 if (!get_aim_dir(player_ptr, &dir))
55 (void)fire_bolt(player_ptr, AttributeType::ACID, dir, damroll(5, 8));
59 bool activate_bolt_elec_1(PlayerType *player_ptr)
62 msg_print(_("それは火花に覆われた...", "It is covered in sparks..."));
63 if (!get_aim_dir(player_ptr, &dir))
66 (void)fire_bolt(player_ptr, AttributeType::ELEC, dir, damroll(4, 8));
70 bool activate_bolt_fire_1(PlayerType *player_ptr)
73 msg_print(_("それは炎に覆われた...", "It is covered in fire..."));
74 if (!get_aim_dir(player_ptr, &dir))
77 (void)fire_bolt(player_ptr, AttributeType::FIRE, dir, damroll(9, 8));
81 bool activate_bolt_cold_1(PlayerType *player_ptr)
84 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
85 if (!get_aim_dir(player_ptr, &dir))
88 (void)fire_bolt(player_ptr, AttributeType::COLD, dir, damroll(6, 8));
92 bool activate_bolt_hypodynamia_1(PlayerType *player_ptr, concptr name)
95 msg_format(_("あなたは%sに敵を締め殺すよう命じた。", "You order the %s to strangle your opponent."), name);
96 if (!get_aim_dir(player_ptr, &dir))
99 hypodynamic_bolt(player_ptr, dir, 100);
103 bool activate_bolt_hypodynamia_2(PlayerType *player_ptr)
106 msg_print(_("黒く輝いている...", "It glows black..."));
107 if (!get_aim_dir(player_ptr, &dir))
110 hypodynamic_bolt(player_ptr, dir, 120);
114 bool activate_bolt_drain_1(PlayerType *player_ptr)
117 if (!get_aim_dir(player_ptr, &dir))
120 for (int dummy = 0; dummy < 3; dummy++)
121 if (hypodynamic_bolt(player_ptr, dir, 50))
122 hp_player(player_ptr, 50);
127 bool activate_bolt_drain_2(PlayerType *player_ptr)
130 if (!get_aim_dir(player_ptr, &dir))
133 for (int dummy = 0; dummy < 3; dummy++)
134 if (hypodynamic_bolt(player_ptr, dir, 100))
135 hp_player(player_ptr, 100);
140 bool activate_bolt_mana(PlayerType *player_ptr, concptr name)
143 msg_format(_("%sに魔法のトゲが現れた...", "The %s grows magical spikes..."), name);
144 if (!get_aim_dir(player_ptr, &dir))
147 (void)fire_bolt(player_ptr, AttributeType::MISSILE, dir, 150);
151 bool activate_ball_pois_1(PlayerType *player_ptr)
154 msg_print(_("それは濃緑色に脈動している...", "It throbs deep green..."));
155 if (!get_aim_dir(player_ptr, &dir))
158 (void)fire_ball(player_ptr, AttributeType::POIS, dir, 12, 3);
162 bool activate_ball_cold_1(PlayerType *player_ptr)
165 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
166 if (!get_aim_dir(player_ptr, &dir))
169 (void)fire_ball(player_ptr, AttributeType::COLD, dir, 48, 2);
173 bool activate_ball_cold_2(PlayerType *player_ptr)
176 msg_print(_("それは青く激しく輝いた...", "It glows an intense blue..."));
177 if (!get_aim_dir(player_ptr, &dir))
180 (void)fire_ball(player_ptr, AttributeType::COLD, dir, 100, 2);
184 bool activate_ball_cold_3(PlayerType *player_ptr)
187 msg_print(_("明るく白色に輝いている...", "It glows bright white..."));
188 if (!get_aim_dir(player_ptr, &dir))
191 (void)fire_ball(player_ptr, AttributeType::COLD, dir, 400, 3);
195 bool activate_ball_fire_1(PlayerType *player_ptr)
198 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
199 if (!get_aim_dir(player_ptr, &dir))
202 (void)fire_ball(player_ptr, AttributeType::FIRE, dir, 72, 2);
206 bool activate_ball_fire_2(PlayerType *player_ptr, concptr name)
209 msg_format(_("%sから炎が吹き出した...", "The %s rages in fire..."), name);
210 if (!get_aim_dir(player_ptr, &dir))
213 (void)fire_ball(player_ptr, AttributeType::FIRE, dir, 120, 3);
217 bool activate_ball_fire_3(PlayerType *player_ptr)
220 msg_print(_("深赤色に輝いている...", "It glows deep red..."));
221 if (!get_aim_dir(player_ptr, &dir))
224 (void)fire_ball(player_ptr, AttributeType::FIRE, dir, 300, 3);
228 bool activate_ball_fire_4(PlayerType *player_ptr)
231 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
232 if (!get_aim_dir(player_ptr, &dir))
235 (void)fire_ball(player_ptr, AttributeType::FIRE, dir, 100, 2);
239 bool activate_ball_elec_2(PlayerType *player_ptr)
242 msg_print(_("電気がパチパチ音を立てた...", "It crackles with electricity..."));
243 if (!get_aim_dir(player_ptr, &dir))
246 (void)fire_ball(player_ptr, AttributeType::ELEC, dir, 100, 3);
250 bool activate_ball_elec_3(PlayerType *player_ptr)
253 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
254 if (!get_aim_dir(player_ptr, &dir))
257 (void)fire_ball(player_ptr, AttributeType::ELEC, dir, 500, 3);
261 bool activate_ball_acid_1(PlayerType *player_ptr)
264 msg_print(_("それは黒く激しく輝いた...", "It glows an intense black..."));
265 if (!get_aim_dir(player_ptr, &dir))
268 (void)fire_ball(player_ptr, AttributeType::ACID, dir, 100, 2);
272 bool activate_ball_nuke_1(PlayerType *player_ptr)
275 msg_print(_("それは緑に激しく輝いた...", "It glows an intense green..."));
276 if (!get_aim_dir(player_ptr, &dir))
279 (void)fire_ball(player_ptr, AttributeType::NUKE, dir, 100, 2);
283 bool activate_rocket(PlayerType *player_ptr)
286 if (!get_aim_dir(player_ptr, &dir))
289 msg_print(_("ロケットを発射した!", "You launch a rocket!"));
290 (void)fire_ball(player_ptr, AttributeType::ROCKET, dir, 250 + player_ptr->lev * 3, 2);
294 bool activate_ball_water(PlayerType *player_ptr, concptr name)
297 msg_format(_("%sが深い青色に鼓動している...", "The %s throbs deep blue..."), name);
298 if (!get_aim_dir(player_ptr, &dir))
301 (void)fire_ball(player_ptr, AttributeType::WATER, dir, 200, 3);
305 bool activate_ball_lite(PlayerType *player_ptr, concptr name)
307 HIT_POINT num = damroll(5, 3);
308 POSITION y = 0, x = 0;
309 msg_format(_("%sが稲妻で覆われた...", "The %s is surrounded by lightning..."), name);
310 for (int k = 0; k < num; k++) {
313 scatter(player_ptr, &y, &x, player_ptr->y, player_ptr->x, 4, PROJECT_NONE);
314 if (!cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, FloorFeatureType::PROJECT))
317 if (!player_bold(player_ptr, y, x))
321 project(player_ptr, 0, 3, y, x, 150, AttributeType::ELEC, PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL);
327 bool activate_ball_dark(PlayerType *player_ptr, concptr name)
330 msg_format(_("%sが深い闇に覆われた...", "The %s is covered in pitch-darkness..."), name);
331 if (!get_aim_dir(player_ptr, &dir))
334 (void)fire_ball(player_ptr, AttributeType::DARK, dir, 250, 4);
338 bool activate_ball_mana(PlayerType *player_ptr, concptr name)
341 msg_format(_("%sが青白く光った...", "The %s becomes pale..."), name);
342 if (!get_aim_dir(player_ptr, &dir))
345 (void)fire_ball(player_ptr, AttributeType::MANA, dir, 250, 4);