1 #include "object-activation/activation-bolt-ball.h"
2 #include "effect/attribute-types.h"
3 #include "effect/effect-characteristics.h"
4 #include "effect/effect-processor.h"
5 #include "floor/cave.h"
6 #include "floor/floor-util.h"
7 #include "grid/feature-flag-types.h"
8 #include "hpmp/hp-mp-processor.h"
9 #include "spell-kind/spells-launcher.h"
10 #include "spell-kind/spells-specific-bolt.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)) {
23 (void)fire_bolt(player_ptr, AttributeType::MISSILE, dir, damroll(2, 6));
27 bool activate_missile_2(PlayerType *player_ptr)
30 msg_print(_("魔法のトゲが現れた...", "It grows magical spikes..."));
31 if (!get_aim_dir(player_ptr, &dir)) {
35 (void)fire_bolt(player_ptr, AttributeType::MISSILE, dir, 150);
39 bool activate_missile_3(PlayerType *player_ptr)
42 if (!get_aim_dir(player_ptr, &dir)) {
46 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
47 fire_breath(player_ptr, AttributeType::MISSILE, dir, 300, 4);
51 bool activate_bolt_acid_1(PlayerType *player_ptr)
54 msg_print(_("それは酸に覆われた...", "It is covered in acid..."));
55 if (!get_aim_dir(player_ptr, &dir)) {
59 (void)fire_bolt(player_ptr, AttributeType::ACID, dir, damroll(5, 8));
63 bool activate_bolt_elec_1(PlayerType *player_ptr)
66 msg_print(_("それは火花に覆われた...", "It is covered in sparks..."));
67 if (!get_aim_dir(player_ptr, &dir)) {
71 (void)fire_bolt(player_ptr, AttributeType::ELEC, dir, damroll(4, 8));
75 bool activate_bolt_fire_1(PlayerType *player_ptr)
78 msg_print(_("それは炎に覆われた...", "It is covered in fire..."));
79 if (!get_aim_dir(player_ptr, &dir)) {
83 (void)fire_bolt(player_ptr, AttributeType::FIRE, dir, damroll(9, 8));
87 bool activate_bolt_cold_1(PlayerType *player_ptr)
90 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
91 if (!get_aim_dir(player_ptr, &dir)) {
95 (void)fire_bolt(player_ptr, AttributeType::COLD, dir, damroll(6, 8));
99 bool activate_bolt_hypodynamia_1(PlayerType *player_ptr, concptr name)
102 msg_format(_("あなたは%sに敵を締め殺すよう命じた。", "You order the %s to strangle your opponent."), name);
103 if (!get_aim_dir(player_ptr, &dir)) {
107 hypodynamic_bolt(player_ptr, dir, 100);
111 bool activate_bolt_hypodynamia_2(PlayerType *player_ptr)
114 msg_print(_("黒く輝いている...", "It glows black..."));
115 if (!get_aim_dir(player_ptr, &dir)) {
119 hypodynamic_bolt(player_ptr, dir, 120);
123 bool activate_bolt_drain_1(PlayerType *player_ptr)
126 if (!get_aim_dir(player_ptr, &dir)) {
130 for (int dummy = 0; dummy < 3; dummy++) {
131 if (hypodynamic_bolt(player_ptr, dir, 50)) {
132 hp_player(player_ptr, 50);
139 bool activate_bolt_drain_2(PlayerType *player_ptr)
142 if (!get_aim_dir(player_ptr, &dir)) {
146 for (int dummy = 0; dummy < 3; dummy++) {
147 if (hypodynamic_bolt(player_ptr, dir, 100)) {
148 hp_player(player_ptr, 100);
155 bool activate_bolt_mana(PlayerType *player_ptr, concptr name)
158 msg_format(_("%sに魔法のトゲが現れた...", "The %s grows magical spikes..."), name);
159 if (!get_aim_dir(player_ptr, &dir)) {
163 (void)fire_bolt(player_ptr, AttributeType::MISSILE, dir, 150);
167 bool activate_ball_pois_1(PlayerType *player_ptr)
170 msg_print(_("それは濃緑色に脈動している...", "It throbs deep green..."));
171 if (!get_aim_dir(player_ptr, &dir)) {
175 (void)fire_ball(player_ptr, AttributeType::POIS, dir, 12, 3);
179 bool activate_ball_cold_1(PlayerType *player_ptr)
182 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
183 if (!get_aim_dir(player_ptr, &dir)) {
187 (void)fire_ball(player_ptr, AttributeType::COLD, dir, 48, 2);
191 bool activate_ball_cold_2(PlayerType *player_ptr)
194 msg_print(_("それは青く激しく輝いた...", "It glows an intense blue..."));
195 if (!get_aim_dir(player_ptr, &dir)) {
199 (void)fire_ball(player_ptr, AttributeType::COLD, dir, 100, 2);
203 bool activate_ball_cold_3(PlayerType *player_ptr)
206 msg_print(_("明るく白色に輝いている...", "It glows bright white..."));
207 if (!get_aim_dir(player_ptr, &dir)) {
211 (void)fire_ball(player_ptr, AttributeType::COLD, dir, 400, 3);
215 bool activate_ball_fire_1(PlayerType *player_ptr)
218 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
219 if (!get_aim_dir(player_ptr, &dir)) {
223 (void)fire_ball(player_ptr, AttributeType::FIRE, dir, 72, 2);
227 bool activate_ball_fire_2(PlayerType *player_ptr, concptr name)
230 msg_format(_("%sから炎が吹き出した...", "The %s rages in fire..."), name);
231 if (!get_aim_dir(player_ptr, &dir)) {
235 (void)fire_ball(player_ptr, AttributeType::FIRE, dir, 120, 3);
239 bool activate_ball_fire_3(PlayerType *player_ptr)
242 msg_print(_("深赤色に輝いている...", "It glows deep red..."));
243 if (!get_aim_dir(player_ptr, &dir)) {
247 (void)fire_ball(player_ptr, AttributeType::FIRE, dir, 300, 3);
251 bool activate_ball_fire_4(PlayerType *player_ptr)
254 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
255 if (!get_aim_dir(player_ptr, &dir)) {
259 (void)fire_ball(player_ptr, AttributeType::FIRE, dir, 100, 2);
263 bool activate_ball_elec_2(PlayerType *player_ptr)
266 msg_print(_("電気がパチパチ音を立てた...", "It crackles with electricity..."));
267 if (!get_aim_dir(player_ptr, &dir)) {
271 (void)fire_ball(player_ptr, AttributeType::ELEC, dir, 100, 3);
275 bool activate_ball_elec_3(PlayerType *player_ptr)
278 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
279 if (!get_aim_dir(player_ptr, &dir)) {
283 (void)fire_ball(player_ptr, AttributeType::ELEC, dir, 500, 3);
287 bool activate_ball_acid_1(PlayerType *player_ptr)
290 msg_print(_("それは黒く激しく輝いた...", "It glows an intense black..."));
291 if (!get_aim_dir(player_ptr, &dir)) {
295 (void)fire_ball(player_ptr, AttributeType::ACID, dir, 100, 2);
299 bool activate_ball_nuke_1(PlayerType *player_ptr)
302 msg_print(_("それは緑に激しく輝いた...", "It glows an intense green..."));
303 if (!get_aim_dir(player_ptr, &dir)) {
307 (void)fire_ball(player_ptr, AttributeType::NUKE, dir, 100, 2);
311 bool activate_rocket(PlayerType *player_ptr)
314 if (!get_aim_dir(player_ptr, &dir)) {
318 msg_print(_("ロケットを発射した!", "You launch a rocket!"));
319 (void)fire_ball(player_ptr, AttributeType::ROCKET, dir, 250 + player_ptr->lev * 3, 2);
323 bool activate_ball_water(PlayerType *player_ptr, concptr name)
326 msg_format(_("%sが深い青色に鼓動している...", "The %s throbs deep blue..."), name);
327 if (!get_aim_dir(player_ptr, &dir)) {
331 (void)fire_ball(player_ptr, AttributeType::WATER, dir, 200, 3);
335 bool activate_ball_lite(PlayerType *player_ptr, concptr name)
337 int num = damroll(5, 3);
338 POSITION y = 0, x = 0;
339 msg_format(_("%sが稲妻で覆われた...", "The %s is surrounded by lightning..."), name);
340 for (int k = 0; k < num; k++) {
343 scatter(player_ptr, &y, &x, player_ptr->y, player_ptr->x, 4, PROJECT_NONE);
344 if (!cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, TerrainCharacteristics::PROJECT)) {
348 if (!player_ptr->is_located_at({ y, x })) {
353 project(player_ptr, 0, 3, y, x, 150, AttributeType::ELEC, PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL);
359 bool activate_ball_dark(PlayerType *player_ptr, concptr name)
362 msg_format(_("%sが深い闇に覆われた...", "The %s is covered in pitch-darkness..."), name);
363 if (!get_aim_dir(player_ptr, &dir)) {
367 (void)fire_ball(player_ptr, AttributeType::DARK, dir, 250, 4);
371 bool activate_ball_mana(PlayerType *player_ptr, concptr name)
374 msg_format(_("%sが青白く光った...", "The %s becomes pale..."), name);
375 if (!get_aim_dir(player_ptr, &dir)) {
379 (void)fire_ball(player_ptr, AttributeType::MANA, dir, 250, 4);