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, const activation_type *const act_ptr, concptr name)
43 switch (act_ptr->index) {
45 return activate_sunlight(user_ptr);
47 return activate_missile_1(user_ptr);
49 return activate_ball_pois_1(user_ptr);
51 return activate_bolt_elec_1(user_ptr);
53 return activate_bolt_acid_1(user_ptr);
55 return activate_bolt_cold_1(user_ptr);
57 return activate_bolt_fire_1(user_ptr);
59 return activate_ball_cold_1(user_ptr);
61 return activate_ball_cold_2(user_ptr);
63 return activate_ball_cold_2(user_ptr);
65 return activate_ball_fire_1(user_ptr);
67 return activate_ball_fire_2(user_ptr, name);
69 return activate_ball_fire_3(user_ptr);
71 return activate_ball_fire_4(user_ptr);
73 return activate_ball_elec_2(user_ptr);
75 return activate_ball_elec_3(user_ptr);
77 return activate_ball_acid_1(user_ptr);
79 return activate_ball_nuke_1(user_ptr);
80 case ACT_HYPODYNAMIA_1:
81 return activate_bolt_hypodynamia_1(user_ptr, name);
82 case ACT_HYPODYNAMIA_2:
83 return activate_bolt_hypodynamia_2(user_ptr);
85 return activate_bolt_drain_1(user_ptr);
87 return activate_missile_2(user_ptr);
89 return activate_whirlwind(user_ptr);
91 return activate_bolt_drain_2(user_ptr);
93 return activate_call_chaos(user_ptr);
95 return activate_rocket(user_ptr);
97 return activate_dispel_evil(user_ptr);
99 return activate_missile_3(user_ptr);
101 return activate_dispel_good(user_ptr);
103 return activate_bolt_mana(user_ptr, name);
105 return activate_ball_water(user_ptr, name);
107 return activate_ball_dark(user_ptr, name);
109 return activate_ball_mana(user_ptr, name);
111 return activate_pesticide(user_ptr);
112 case ACT_BLINDING_LIGHT:
113 return activate_blinding_light(user_ptr, name);
115 return activate_ring_of_power(user_ptr, name);
116 case ACT_CAST_BA_STAR:
117 return activate_ball_lite(user_ptr, name);
118 case ACT_BLADETURNER:
119 return activate_bladeturner(user_ptr);
121 return activate_breath_fire(user_ptr, o_ptr);
123 return activate_breath_cold(user_ptr, o_ptr);
125 return activate_dragon_breath(user_ptr, o_ptr);
126 case ACT_TREE_CREATION:
127 return activate_tree_creation(user_ptr, o_ptr, name);
129 return activate_animate_dead(user_ptr, o_ptr);
131 return activate_confusion(user_ptr);
133 return activate_sleep(user_ptr);
135 return activate_earthquake(user_ptr);
137 return activate_terror(user_ptr);
139 return activate_teleport_away(user_ptr);
140 case ACT_BANISH_EVIL:
141 return activate_banish_evil(user_ptr);
143 return activate_genocide(user_ptr);
145 return activate_mass_genocide(user_ptr);
147 return activate_scare(user_ptr);
149 return activate_aggravation(user_ptr, o_ptr, name);
150 case ACT_CHARM_ANIMAL:
151 return activate_charm_animal(user_ptr);
152 case ACT_CHARM_UNDEAD:
153 return activate_charm_undead(user_ptr);
154 case ACT_CHARM_OTHER:
155 return activate_charm_other(user_ptr);
156 case ACT_CHARM_ANIMALS:
157 return activate_charm_animals(user_ptr);
158 case ACT_CHARM_OTHERS:
159 return activate_charm_others(user_ptr);
160 case ACT_SUMMON_ANIMAL:
161 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->lev, SUMMON_ANIMAL_RANGER, PM_ALLOW_GROUP | PM_FORCE_PET);
163 case ACT_SUMMON_PHANTOM:
164 msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
165 (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);
167 case ACT_SUMMON_ELEMENTAL:
168 return cast_summon_elemental(user_ptr, (user_ptr->lev * 3) / 2);
169 case ACT_SUMMON_DEMON:
170 cast_summon_demon(user_ptr, (user_ptr->lev * 3) / 2);
172 case ACT_SUMMON_UNDEAD:
173 return cast_summon_undead(user_ptr, (user_ptr->lev * 3) / 2);
174 case ACT_SUMMON_HOUND:
175 return cast_summon_hound(user_ptr, (user_ptr->lev * 3) / 2);
176 case ACT_SUMMON_DAWN:
177 msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
178 (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);
180 case ACT_SUMMON_OCTOPUS:
181 return cast_summon_octopus(user_ptr);
182 case ACT_CHOIR_SINGS:
183 msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
184 (void)cure_critical_wounds(user_ptr, 777);
185 (void)set_hero(user_ptr, randint1(25) + 25, FALSE);
188 return activate_cure_lw(user_ptr);
190 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
191 (void)cure_serious_wounds(user_ptr, 4, 8);
193 case ACT_CURE_POISON:
194 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
195 (void)set_afraid(user_ptr, 0);
196 (void)set_poisoned(user_ptr, 0);
199 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
200 restore_level(user_ptr);
203 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
204 (void)restore_all_status(user_ptr);
205 (void)restore_level(user_ptr);
208 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
209 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
210 (void)cure_critical_wounds(user_ptr, 700);
213 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
214 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
215 (void)cure_critical_wounds(user_ptr, 1000);
218 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
219 true_healing(user_ptr, 0);
221 case ACT_CURE_MANA_FULL:
222 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
223 restore_mana(user_ptr, TRUE);
226 (void)set_tim_esp(user_ptr, randint1(30) + 25, FALSE);
229 (void)berserk(user_ptr, randint1(25) + 25);
232 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
233 (void)set_protevil(user_ptr, randint1(25) + user_ptr->lev * 3, FALSE);
236 return activate_resistance_elements(user_ptr);
238 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
239 (void)set_fast(user_ptr, randint1(20) + 20, FALSE);
242 msg_print(_("明るく輝いている...", "It glows brightly..."));
243 (void)set_fast(user_ptr, randint1(75) + 75, FALSE);
246 set_wraith_form(user_ptr, randint1(user_ptr->lev / 2) + (user_ptr->lev / 2), FALSE);
249 (void)set_invuln(user_ptr, randint1(8) + 8, FALSE);
252 (void)heroism(user_ptr, 25);
255 (void)set_fast(user_ptr, randint1(50) + 50, FALSE);
256 (void)heroism(user_ptr, 50);
258 case ACT_ACID_BALL_AND_RESISTANCE:
259 return activate_acid_ball_and_resistance(user_ptr, name);
260 case ACT_FIRE_BALL_AND_RESISTANCE:
261 return activate_fire_ball_and_resistance(user_ptr, name);
262 case ACT_COLD_BALL_AND_RESISTANCE:
263 return activate_cold_ball_and_resistance(user_ptr, name);
264 case ACT_ELEC_BALL_AND_RESISTANCE:
265 return activate_elec_ball_and_resistance(user_ptr, name);
266 case ACT_POIS_BALL_AND_RESISTANCE:
267 return activate_pois_ball_and_resistance(user_ptr, name);
268 case ACT_RESIST_ACID:
269 return activate_resistance_acid(user_ptr, name);
270 case ACT_RESIST_FIRE:
271 return activate_resistance_fire(user_ptr, name);
272 case ACT_RESIST_COLD:
273 return activate_resistance_cold(user_ptr, name);
274 case ACT_RESIST_ELEC:
275 return activate_resistance_elec(user_ptr, name);
276 case ACT_RESIST_POIS:
277 return activate_resistance_pois(user_ptr, name);
279 return activate_light(user_ptr, name);
281 return activate_map_light(user_ptr);
283 return activate_all_detection(user_ptr);
284 case ACT_DETECT_XTRA:
285 return activate_extra_detection(user_ptr);
287 return activate_fully_identification(user_ptr);
289 return activate_identification(user_ptr);
291 return activate_exploding_rune(user_ptr);
293 return activate_protection_rune(user_ptr);
295 (void)set_food(user_ptr, PY_FOOD_MAX - 1);
298 return activate_door_destroy(user_ptr);
300 return activate_stone_mud(user_ptr);
302 return activate_recharge(user_ptr);
304 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
305 (void)alchemy(user_ptr);
308 return activate_dimension_door(user_ptr);
310 return activate_teleport(user_ptr);
312 return activate_recall(user_ptr);
314 return activate_judgement(user_ptr, name);
315 case ACT_TELEKINESIS:
316 return activate_telekinesis(user_ptr, name);
317 case ACT_DETECT_UNIQUE:
318 return activate_unique_detection(user_ptr);
320 return activate_escape(user_ptr);
321 case ACT_DISP_CURSE_XTRA:
322 return activate_dispel_curse(user_ptr, name);
323 case ACT_BRAND_FIRE_BOLTS:
324 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
325 brand_bolts(user_ptr);
327 case ACT_RECHARGE_XTRA:
328 return activate_recharge_extra(user_ptr, name);
330 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
331 return perilous_secrets(user_ptr);
333 return activate_shikofumi(user_ptr);
335 return activate_phase_door(user_ptr);
336 case ACT_DETECT_ALL_MONS:
337 return activate_all_monsters_detection(user_ptr);
338 case ACT_ULTIMATE_RESIST:
339 return activate_ultimate_resistance(user_ptr);
341 (void)cosmic_cast_off(user_ptr, o_ptr);
343 case ACT_FALLING_STAR:
344 return activate_toragoroshi(user_ptr);
345 case ACT_GRAND_CROSS:
346 return activate_grand_cross(user_ptr);
347 case ACT_TELEPORT_LEVEL:
348 return activate_teleport_level(user_ptr);
349 case ACT_STRAIN_HASTE:
350 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
351 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
352 (void)set_fast(user_ptr, user_ptr->fast + 25 + randint1(25), FALSE);
355 return fishing(user_ptr);
357 mitokohmon(user_ptr);
360 return activate_muramasa(user_ptr, o_ptr);
361 case ACT_BLOODY_MOON:
362 return activate_bloody_moon(user_ptr, o_ptr);
364 return activate_crimson(user_ptr, o_ptr);
366 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);