2 * @brief プレイヤーの発動コマンド実装
7 #include "object-activation/activation-switcher.h"
8 #include "art-definition/random-art-effects.h"
9 #include "monster-floor/monster-summon.h"
10 #include "monster-floor/place-monster-types.h"
11 #include "object-activation/activation-bolt-ball.h"
12 #include "object-activation/activation-breath.h"
13 #include "object-activation/activation-charm.h"
14 #include "object-activation/activation-others.h"
15 #include "object-activation/activation-resistance.h"
16 #include "object-enchant/activation-info-table.h"
17 #include "player-attack/player-attack.h"
18 #include "player/digestion-processor.h"
19 #include "player/player-damage.h"
20 #include "specific-object/blade-turner.h"
21 #include "specific-object/bloody-moon.h"
22 #include "specific-object/death-crimson.h"
23 #include "specific-object/muramasa.h"
24 #include "specific-object/ring-of-power.h"
25 #include "spell-kind/earthquake.h"
26 #include "spell-kind/magic-item-recharger.h"
27 #include "spell-kind/spells-detection.h"
28 #include "spell-kind/spells-floor.h"
29 #include "spell-kind/spells-genocide.h"
30 #include "spell-kind/spells-grid.h"
31 #include "spell-kind/spells-launcher.h"
32 #include "spell-kind/spells-lite.h"
33 #include "spell-kind/spells-neighbor.h"
34 #include "spell-kind/spells-perception.h"
35 #include "spell-kind/spells-random.h"
36 #include "spell-kind/spells-sight.h"
37 #include "spell-kind/spells-teleport.h"
38 #include "spell-kind/spells-world.h"
39 #include "spell-realm/spells-sorcery.h"
40 #include "spell/spell-types.h"
41 #include "spell/spells-object.h"
42 #include "spell/spells-status.h"
43 #include "spell/spells-summon.h"
44 #include "status/bad-status-setter.h"
45 #include "status/body-improvement.h"
46 #include "status/buff-setter.h"
47 #include "status/experience.h"
48 #include "status/shape-changer.h"
49 #include "status/sight-setter.h"
50 #include "system/floor-type-definition.h"
51 #include "view/display-messages.h"
53 bool switch_activation(player_type *user_ptr, object_type *o_ptr, const activation_type *const act_ptr, concptr name)
55 switch (act_ptr->index) {
57 return activate_sunlight(user_ptr);
59 return activate_missile_1(user_ptr);
61 return activate_ball_pois_1(user_ptr);
63 return activate_bolt_elec_1(user_ptr);
65 return activate_bolt_acid_1(user_ptr);
67 return activate_bolt_cold_1(user_ptr);
69 return activate_bolt_fire_1(user_ptr);
71 return activate_ball_cold_1(user_ptr);
73 return activate_ball_cold_2(user_ptr);
75 return activate_ball_cold_2(user_ptr);
77 return activate_ball_fire_1(user_ptr);
79 return activate_ball_fire_2(user_ptr, name);
81 return activate_ball_fire_3(user_ptr);
83 return activate_ball_fire_4(user_ptr);
85 return activate_ball_elec_2(user_ptr);
87 return activate_ball_elec_3(user_ptr);
89 return activate_ball_acid_1(user_ptr);
91 return activate_ball_nuke_1(user_ptr);
92 case ACT_HYPODYNAMIA_1:
93 return activate_bolt_hypodynamia_1(user_ptr, name);
94 case ACT_HYPODYNAMIA_2:
95 return activate_bolt_hypodynamia_2(user_ptr);
97 return activate_bolt_drain_1(user_ptr);
99 return activate_missile_2(user_ptr);
104 return activate_bolt_drain_2(user_ptr);
106 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
107 call_chaos(user_ptr);
110 return activate_rocket(user_ptr);
112 msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness..."));
113 dispel_evil(user_ptr, user_ptr->lev * 5);
116 return activate_missile_3(user_ptr);
118 msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil..."));
119 dispel_good(user_ptr, user_ptr->lev * 5);
122 return activate_bolt_mana(user_ptr, name);
124 return activate_ball_water(user_ptr, name);
126 return activate_ball_dark(user_ptr, name);
128 return activate_ball_mana(user_ptr, name);
130 msg_print(_("あなたは害虫を一掃した。", "You exterminate small life."));
131 (void)dispel_monsters(user_ptr, 4);
133 case ACT_BLINDING_LIGHT:
134 msg_format(_("%sが眩しい光で輝いた...", "The %s gleams with blinding light..."), name);
135 (void)fire_ball(user_ptr, GF_LITE, 0, 300, 6);
136 confuse_monsters(user_ptr, 3 * user_ptr->lev / 2);
139 return activate_ring_of_power(user_ptr, name);
140 case ACT_CAST_BA_STAR:
141 return activate_ball_lite(user_ptr, name);
142 case ACT_BLADETURNER:
143 return activate_bladeturner(user_ptr);
145 return activate_breath_fire(user_ptr, o_ptr);
147 return activate_breath_cold(user_ptr, o_ptr);
149 return activate_dragon_breath(user_ptr, o_ptr);
151 return activate_confusion(user_ptr);
153 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
154 sleep_monsters_touch(user_ptr);
157 earthquake(user_ptr, user_ptr->y, user_ptr->x, 5, 0);
160 turn_monsters(user_ptr, 40 + user_ptr->lev);
163 return activate_teleport_away(user_ptr);
164 case ACT_BANISH_EVIL:
165 return activate_banish_evil(user_ptr);
167 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
168 (void)symbol_genocide(user_ptr, 200, TRUE);
171 msg_print(_("ひどく鋭い音が流れ出た...", "It lets out a long, shrill note..."));
172 (void)mass_genocide(user_ptr, 200, TRUE);
175 return activate_scare(user_ptr);
177 return activate_aggravation(user_ptr, o_ptr, name);
178 case ACT_CHARM_ANIMAL:
179 return activate_charm_animal(user_ptr);
180 case ACT_CHARM_UNDEAD:
181 return activate_charm_undead(user_ptr);
182 case ACT_CHARM_OTHER:
183 return activate_charm_other(user_ptr);
184 case ACT_CHARM_ANIMALS:
185 return activate_charm_animals(user_ptr);
186 case ACT_CHARM_OTHERS:
187 return activate_charm_others(user_ptr);
188 case ACT_SUMMON_ANIMAL:
189 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->lev, SUMMON_ANIMAL_RANGER, PM_ALLOW_GROUP | PM_FORCE_PET);
191 case ACT_SUMMON_PHANTOM:
192 msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
193 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->current_floor_ptr->dun_level, SUMMON_PHANTOM, PM_ALLOW_GROUP | PM_FORCE_PET);
195 case ACT_SUMMON_ELEMENTAL:
196 return cast_summon_elemental(user_ptr, (user_ptr->lev * 3) / 2);
197 case ACT_SUMMON_DEMON:
198 cast_summon_demon(user_ptr, (user_ptr->lev * 3) / 2);
200 case ACT_SUMMON_UNDEAD:
201 return cast_summon_undead(user_ptr, (user_ptr->lev * 3) / 2);
202 case ACT_SUMMON_HOUND:
203 return cast_summon_hound(user_ptr, (user_ptr->lev * 3) / 2);
204 case ACT_SUMMON_DAWN:
205 msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
206 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->current_floor_ptr->dun_level, SUMMON_DAWN, PM_ALLOW_GROUP | PM_FORCE_PET);
208 case ACT_SUMMON_OCTOPUS:
209 return cast_summon_octopus(user_ptr);
210 case ACT_CHOIR_SINGS:
211 msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
212 (void)cure_critical_wounds(user_ptr, 777);
213 (void)set_hero(user_ptr, randint1(25) + 25, FALSE);
216 return activate_cure_lw(user_ptr);
218 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
219 (void)cure_serious_wounds(user_ptr, 4, 8);
221 case ACT_CURE_POISON:
222 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
223 (void)set_afraid(user_ptr, 0);
224 (void)set_poisoned(user_ptr, 0);
227 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
228 restore_level(user_ptr);
231 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
232 (void)restore_all_status(user_ptr);
233 (void)restore_level(user_ptr);
236 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
237 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
238 (void)cure_critical_wounds(user_ptr, 700);
241 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
242 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
243 (void)cure_critical_wounds(user_ptr, 1000);
246 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
247 true_healing(user_ptr, 0);
249 case ACT_CURE_MANA_FULL:
250 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
251 restore_mana(user_ptr, TRUE);
254 (void)set_tim_esp(user_ptr, randint1(30) + 25, FALSE);
257 (void)berserk(user_ptr, randint1(25) + 25);
260 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
261 (void)set_protevil(user_ptr, randint1(25) + user_ptr->lev * 3, FALSE);
264 return activate_resistance_elements(user_ptr);
266 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
267 (void)set_fast(user_ptr, randint1(20) + 20, FALSE);
270 msg_print(_("明るく輝いている...", "It glows brightly..."));
271 (void)set_fast(user_ptr, randint1(75) + 75, FALSE);
274 set_wraith_form(user_ptr, randint1(user_ptr->lev / 2) + (user_ptr->lev / 2), FALSE);
277 (void)set_invuln(user_ptr, randint1(8) + 8, FALSE);
280 (void)heroism(user_ptr, 25);
283 (void)set_fast(user_ptr, randint1(50) + 50, FALSE);
284 (void)heroism(user_ptr, 50);
286 case ACT_RESIST_ACID:
287 return activate_resistance_acid(user_ptr, o_ptr, name);
288 case ACT_RESIST_FIRE:
289 return activate_resistance_fire(user_ptr, o_ptr, name);
290 case ACT_RESIST_COLD:
291 return activate_resistance_cold(user_ptr, o_ptr, name);
292 case ACT_RESIST_ELEC:
293 return activate_resistance_elec(user_ptr, o_ptr, name);
294 case ACT_RESIST_POIS:
295 return activate_resistance_pois(user_ptr, name);
297 msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
298 lite_area(user_ptr, damroll(2, 15), 3);
301 msg_print(_("眩しく輝いた...", "It shines brightly..."));
302 map_area(user_ptr, DETECT_RAD_MAP);
303 lite_area(user_ptr, damroll(2, 15), 3);
306 msg_print(_("白く明るく輝いている...", "It glows bright white..."));
307 msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind..."));
308 detect_all(user_ptr, DETECT_RAD_DEFAULT);
310 case ACT_DETECT_XTRA:
311 msg_print(_("明るく輝いている...", "It glows brightly..."));
312 detect_all(user_ptr, DETECT_RAD_DEFAULT);
314 identify_fully(user_ptr, FALSE, 0);
317 msg_print(_("黄色く輝いている...", "It glows yellow..."));
318 identify_fully(user_ptr, FALSE, 0);
321 return ident_spell(user_ptr, FALSE, 0);
323 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
324 explosive_rune(user_ptr, user_ptr->y, user_ptr->x);
327 msg_print(_("ブルーに明るく輝いている...", "It glows light blue..."));
328 warding_glyph(user_ptr);
331 (void)set_food(user_ptr, PY_FOOD_MAX - 1);
334 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
335 destroy_doors_touch(user_ptr);
338 return activate_stone_mud(user_ptr);
340 recharge(user_ptr, 130);
343 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
344 (void)alchemy(user_ptr);
347 return activate_dimension_door(user_ptr);
349 return activate_teleport(user_ptr);
351 msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
352 return recall_player(user_ptr, randint0(21) + 15);
354 return activate_judgement(user_ptr, name);
355 case ACT_TELEKINESIS:
356 return activate_telekinesis(user_ptr, name);
357 case ACT_DETECT_UNIQUE:
358 return activate_unique_detection(user_ptr);
360 return activate_escape(user_ptr);
361 case ACT_DISP_CURSE_XTRA:
362 return activate_dispel_curse(user_ptr, name);
363 case ACT_BRAND_FIRE_BOLTS:
364 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
365 brand_bolts(user_ptr);
367 case ACT_RECHARGE_XTRA:
368 msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name);
369 return recharge(user_ptr, 1000);
371 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
372 return perilous_secrets(user_ptr);
374 msg_print(_("力強く四股を踏んだ。", "You stamp. (as if you are in a ring.)"));
375 (void)set_afraid(user_ptr, 0);
376 (void)set_hero(user_ptr, randint1(20) + 20, FALSE);
377 (void)dispel_evil(user_ptr, user_ptr->lev * 3);
380 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
382 case ACT_DETECT_ALL_MONS:
383 (void)detect_monsters_invis(user_ptr, 255);
384 (void)detect_monsters_normal(user_ptr, 255);
386 case ACT_ULTIMATE_RESIST:
387 return activate_ultimate_resistance(user_ptr);
389 (void)cosmic_cast_off(user_ptr, o_ptr);
391 case ACT_FALLING_STAR:
392 msg_print(_("あなたは妖刀に魅入られた…", "You are enchanted by cursed blade..."));
393 msg_print(_("「狂ほしく 血のごとき 月はのぼれり 秘めおきし 魔剣 いずこぞや」", "'Behold the blade arts.'"));
396 case ACT_GRAND_CROSS:
397 return activate_grand_cross(user_ptr);
398 case ACT_TELEPORT_LEVEL:
399 return activate_teleport_level(user_ptr);
400 case ACT_STRAIN_HASTE:
401 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
402 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
403 (void)set_fast(user_ptr, user_ptr->fast + 25 + randint1(25), FALSE);
406 return fishing(user_ptr);
408 mitokohmon(user_ptr);
411 return activate_muramasa(user_ptr, o_ptr);
412 case ACT_BLOODY_MOON:
413 return activate_bloody_moon(user_ptr, o_ptr);
415 return activate_crimson(user_ptr, o_ptr);
417 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);