2 * @brief プレイヤーの発動コマンド実装
7 #include "object-activation/activation-switcher.h"
8 #include "artifact/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-genocide.h"
15 #include "object-activation/activation-others.h"
16 #include "object-activation/activation-resistance.h"
17 #include "object-activation/activation-teleport.h"
18 #include "object-enchant/activation-info-table.h"
19 #include "player/digestion-processor.h"
20 #include "player/player-damage.h"
21 #include "specific-object/blade-turner.h"
22 #include "specific-object/bloody-moon.h"
23 #include "specific-object/death-crimson.h"
24 #include "specific-object/muramasa.h"
25 #include "specific-object/ring-of-power.h"
26 #include "specific-object/toragoroshi.h"
27 #include "spell-realm/spells-sorcery.h"
28 #include "spell/spells-object.h"
29 #include "spell/spells-status.h"
30 #include "spell/spells-summon.h"
31 #include "spell/summon-types.h"
32 #include "status/bad-status-setter.h"
33 #include "status/body-improvement.h"
34 #include "status/buff-setter.h"
35 #include "status/experience.h"
36 #include "status/shape-changer.h"
37 #include "status/sight-setter.h"
38 #include "system/floor-type-definition.h"
39 #include "view/display-messages.h"
41 bool switch_activation(player_type *user_ptr, object_type **o_ptr_ptr, const activation_type *const act_ptr, concptr name)
43 object_type *o_ptr = (*o_ptr_ptr);
45 switch (act_ptr->index) {
47 return activate_sunlight(user_ptr);
49 return activate_missile_1(user_ptr);
51 return activate_ball_pois_1(user_ptr);
53 return activate_bolt_elec_1(user_ptr);
55 return activate_bolt_acid_1(user_ptr);
57 return activate_bolt_cold_1(user_ptr);
59 return activate_bolt_fire_1(user_ptr);
61 return activate_ball_cold_1(user_ptr);
63 return activate_ball_cold_2(user_ptr);
65 return activate_ball_cold_2(user_ptr);
67 return activate_ball_fire_1(user_ptr);
69 return activate_ball_fire_2(user_ptr, name);
71 return activate_ball_fire_3(user_ptr);
73 return activate_ball_fire_4(user_ptr);
75 return activate_ball_elec_2(user_ptr);
77 return activate_ball_elec_3(user_ptr);
79 return activate_ball_acid_1(user_ptr);
81 return activate_ball_nuke_1(user_ptr);
82 case ACT_HYPODYNAMIA_1:
83 return activate_bolt_hypodynamia_1(user_ptr, name);
84 case ACT_HYPODYNAMIA_2:
85 return activate_bolt_hypodynamia_2(user_ptr);
87 return activate_bolt_drain_1(user_ptr);
89 return activate_missile_2(user_ptr);
91 return activate_whirlwind(user_ptr);
93 return activate_bolt_drain_2(user_ptr);
95 return activate_call_chaos(user_ptr);
97 return activate_rocket(user_ptr);
99 return activate_dispel_evil(user_ptr);
101 return activate_missile_3(user_ptr);
103 return activate_dispel_good(user_ptr);
105 return activate_bolt_mana(user_ptr, name);
107 return activate_ball_water(user_ptr, name);
109 return activate_ball_dark(user_ptr, name);
111 return activate_ball_mana(user_ptr, name);
113 return activate_pesticide(user_ptr);
114 case ACT_BLINDING_LIGHT:
115 return activate_blinding_light(user_ptr, name);
117 return activate_ring_of_power(user_ptr, name);
118 case ACT_CAST_BA_STAR:
119 return activate_ball_lite(user_ptr, name);
120 case ACT_BLADETURNER:
121 return activate_bladeturner(user_ptr);
123 return activate_breath_fire(user_ptr, o_ptr);
125 return activate_breath_cold(user_ptr, o_ptr);
127 return activate_dragon_breath(user_ptr, o_ptr);
128 case ACT_TREE_CREATION:
129 return activate_tree_creation(user_ptr, o_ptr, name);
131 return activate_animate_dead(user_ptr, o_ptr);
133 return activate_confusion(user_ptr);
135 return activate_sleep(user_ptr);
137 return activate_earthquake(user_ptr);
139 return activate_terror(user_ptr);
141 return activate_teleport_away(user_ptr);
142 case ACT_BANISH_EVIL:
143 return activate_banish_evil(user_ptr);
145 return activate_genocide(user_ptr);
147 return activate_mass_genocide(user_ptr);
149 return activate_scare(user_ptr);
151 return activate_aggravation(user_ptr, o_ptr, name);
152 case ACT_CHARM_ANIMAL:
153 return activate_charm_animal(user_ptr);
154 case ACT_CHARM_UNDEAD:
155 return activate_charm_undead(user_ptr);
156 case ACT_CHARM_OTHER:
157 return activate_charm_other(user_ptr);
158 case ACT_CHARM_ANIMALS:
159 return activate_charm_animals(user_ptr);
160 case ACT_CHARM_OTHERS:
161 return activate_charm_others(user_ptr);
162 case ACT_SUMMON_ANIMAL:
163 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->lev, SUMMON_ANIMAL_RANGER, PM_ALLOW_GROUP | PM_FORCE_PET);
165 case ACT_SUMMON_PHANTOM:
166 msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
167 (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);
169 case ACT_SUMMON_ELEMENTAL:
170 return cast_summon_elemental(user_ptr, (user_ptr->lev * 3) / 2);
171 case ACT_SUMMON_DEMON:
172 cast_summon_demon(user_ptr, (user_ptr->lev * 3) / 2);
174 case ACT_SUMMON_UNDEAD:
175 return cast_summon_undead(user_ptr, (user_ptr->lev * 3) / 2);
176 case ACT_SUMMON_HOUND:
177 return cast_summon_hound(user_ptr, (user_ptr->lev * 3) / 2);
178 case ACT_SUMMON_DAWN:
179 msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
180 (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);
182 case ACT_SUMMON_OCTOPUS:
183 return cast_summon_octopus(user_ptr);
184 case ACT_CHOIR_SINGS:
185 msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
186 (void)cure_critical_wounds(user_ptr, 777);
187 (void)set_hero(user_ptr, randint1(25) + 25, FALSE);
190 return activate_cure_lw(user_ptr);
192 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
193 (void)cure_serious_wounds(user_ptr, 4, 8);
195 case ACT_CURE_POISON:
196 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
197 (void)set_afraid(user_ptr, 0);
198 (void)set_poisoned(user_ptr, 0);
201 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
202 restore_level(user_ptr);
205 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
206 (void)restore_all_status(user_ptr);
207 (void)restore_level(user_ptr);
210 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
211 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
212 (void)cure_critical_wounds(user_ptr, 700);
215 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
216 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
217 (void)cure_critical_wounds(user_ptr, 1000);
220 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
221 true_healing(user_ptr, 0);
223 case ACT_CURE_MANA_FULL:
224 msg_format(_("%sが青白く光った...", "The %s glows palely..."), name);
225 restore_mana(user_ptr, TRUE);
228 (void)set_tim_esp(user_ptr, randint1(30) + 25, FALSE);
231 (void)berserk(user_ptr, randint1(25) + 25);
234 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
235 (void)set_protevil(user_ptr, randint1(25) + user_ptr->lev * 3, FALSE);
238 return activate_resistance_elements(user_ptr);
240 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
241 (void)set_fast(user_ptr, randint1(20) + 20, FALSE);
244 msg_print(_("明るく輝いている...", "It glows brightly..."));
245 (void)set_fast(user_ptr, randint1(75) + 75, FALSE);
248 set_wraith_form(user_ptr, randint1(user_ptr->lev / 2) + (user_ptr->lev / 2), FALSE);
251 (void)set_invuln(user_ptr, randint1(8) + 8, FALSE);
254 (void)heroism(user_ptr, 25);
257 (void)set_fast(user_ptr, randint1(50) + 50, FALSE);
258 (void)heroism(user_ptr, 50);
260 case ACT_ACID_BALL_AND_RESISTANCE:
261 return activate_acid_ball_and_resistance(user_ptr, name);
262 case ACT_FIRE_BALL_AND_RESISTANCE:
263 return activate_fire_ball_and_resistance(user_ptr, name);
264 case ACT_COLD_BALL_AND_RESISTANCE:
265 return activate_cold_ball_and_resistance(user_ptr, name);
266 case ACT_ELEC_BALL_AND_RESISTANCE:
267 return activate_elec_ball_and_resistance(user_ptr, name);
268 case ACT_POIS_BALL_AND_RESISTANCE:
269 return activate_pois_ball_and_resistance(user_ptr, name);
270 case ACT_RESIST_ACID:
271 return activate_resistance_acid(user_ptr, name);
272 case ACT_RESIST_FIRE:
273 return activate_resistance_fire(user_ptr, name);
274 case ACT_RESIST_COLD:
275 return activate_resistance_cold(user_ptr, name);
276 case ACT_RESIST_ELEC:
277 return activate_resistance_elec(user_ptr, name);
278 case ACT_RESIST_POIS:
279 return activate_resistance_pois(user_ptr, name);
281 return activate_light(user_ptr, name);
283 return activate_map_light(user_ptr);
285 return activate_all_detection(user_ptr);
286 case ACT_DETECT_XTRA:
287 return activate_extra_detection(user_ptr);
289 return activate_fully_identification(user_ptr);
291 return activate_identification(user_ptr);
293 return activate_exploding_rune(user_ptr);
295 return activate_protection_rune(user_ptr);
297 (void)set_food(user_ptr, PY_FOOD_MAX - 1);
300 return activate_door_destroy(user_ptr);
302 return activate_stone_mud(user_ptr);
304 return activate_recharge(user_ptr);
306 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
307 (void)alchemy(user_ptr);
310 return activate_dimension_door(user_ptr);
312 return activate_teleport(user_ptr);
314 return activate_recall(user_ptr);
316 return activate_judgement(user_ptr, name);
317 case ACT_TELEKINESIS:
318 return activate_telekinesis(user_ptr, name);
319 case ACT_DETECT_UNIQUE:
320 return activate_unique_detection(user_ptr);
322 return activate_escape(user_ptr);
323 case ACT_DISP_CURSE_XTRA:
324 return activate_dispel_curse(user_ptr, name);
325 case ACT_BRAND_FIRE_BOLTS:
326 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
327 brand_bolts(user_ptr);
329 case ACT_RECHARGE_XTRA:
330 return activate_recharge_extra(user_ptr, name);
332 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
333 return perilous_secrets(user_ptr);
335 return activate_shikofumi(user_ptr);
337 return activate_phase_door(user_ptr);
338 case ACT_DETECT_ALL_MONS:
339 return activate_all_monsters_detection(user_ptr);
340 case ACT_ULTIMATE_RESIST:
341 return activate_ultimate_resistance(user_ptr);
343 (void)cosmic_cast_off(user_ptr, o_ptr_ptr);
345 case ACT_FALLING_STAR:
346 return activate_toragoroshi(user_ptr);
347 case ACT_GRAND_CROSS:
348 return activate_grand_cross(user_ptr);
349 case ACT_TELEPORT_LEVEL:
350 return activate_teleport_level(user_ptr);
351 case ACT_STRAIN_HASTE:
352 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
353 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
354 (void)set_fast(user_ptr, user_ptr->fast + 25 + randint1(25), FALSE);
357 return fishing(user_ptr);
359 mitokohmon(user_ptr);
362 return activate_muramasa(user_ptr, o_ptr);
363 case ACT_BLOODY_MOON:
364 return activate_bloody_moon(user_ptr, o_ptr);
366 return activate_crimson(user_ptr, o_ptr);
368 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);