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-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);
127 return activate_confusion(user_ptr);
129 return activate_sleep(user_ptr);
131 return activate_earthquake(user_ptr);
133 return activate_terror(user_ptr);
135 return activate_teleport_away(user_ptr);
136 case ACT_BANISH_EVIL:
137 return activate_banish_evil(user_ptr);
139 return activate_genocide(user_ptr);
141 return activate_mass_genocide(user_ptr);
143 return activate_scare(user_ptr);
145 return activate_aggravation(user_ptr, o_ptr, name);
146 case ACT_CHARM_ANIMAL:
147 return activate_charm_animal(user_ptr);
148 case ACT_CHARM_UNDEAD:
149 return activate_charm_undead(user_ptr);
150 case ACT_CHARM_OTHER:
151 return activate_charm_other(user_ptr);
152 case ACT_CHARM_ANIMALS:
153 return activate_charm_animals(user_ptr);
154 case ACT_CHARM_OTHERS:
155 return activate_charm_others(user_ptr);
156 case ACT_SUMMON_ANIMAL:
157 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->lev, SUMMON_ANIMAL_RANGER, PM_ALLOW_GROUP | PM_FORCE_PET);
159 case ACT_SUMMON_PHANTOM:
160 msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
161 (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);
163 case ACT_SUMMON_ELEMENTAL:
164 return cast_summon_elemental(user_ptr, (user_ptr->lev * 3) / 2);
165 case ACT_SUMMON_DEMON:
166 cast_summon_demon(user_ptr, (user_ptr->lev * 3) / 2);
168 case ACT_SUMMON_UNDEAD:
169 return cast_summon_undead(user_ptr, (user_ptr->lev * 3) / 2);
170 case ACT_SUMMON_HOUND:
171 return cast_summon_hound(user_ptr, (user_ptr->lev * 3) / 2);
172 case ACT_SUMMON_DAWN:
173 msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
174 (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);
176 case ACT_SUMMON_OCTOPUS:
177 return cast_summon_octopus(user_ptr);
178 case ACT_CHOIR_SINGS:
179 msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
180 (void)cure_critical_wounds(user_ptr, 777);
181 (void)set_hero(user_ptr, randint1(25) + 25, FALSE);
184 return activate_cure_lw(user_ptr);
186 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
187 (void)cure_serious_wounds(user_ptr, 4, 8);
189 case ACT_CURE_POISON:
190 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
191 (void)set_afraid(user_ptr, 0);
192 (void)set_poisoned(user_ptr, 0);
195 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
196 restore_level(user_ptr);
199 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
200 (void)restore_all_status(user_ptr);
201 (void)restore_level(user_ptr);
204 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
205 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
206 (void)cure_critical_wounds(user_ptr, 700);
209 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
210 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
211 (void)cure_critical_wounds(user_ptr, 1000);
214 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
215 true_healing(user_ptr, 0);
217 case ACT_CURE_MANA_FULL:
218 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
219 restore_mana(user_ptr, TRUE);
222 (void)set_tim_esp(user_ptr, randint1(30) + 25, FALSE);
225 (void)berserk(user_ptr, randint1(25) + 25);
228 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
229 (void)set_protevil(user_ptr, randint1(25) + user_ptr->lev * 3, FALSE);
232 return activate_resistance_elements(user_ptr);
234 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
235 (void)set_fast(user_ptr, randint1(20) + 20, FALSE);
238 msg_print(_("明るく輝いている...", "It glows brightly..."));
239 (void)set_fast(user_ptr, randint1(75) + 75, FALSE);
242 set_wraith_form(user_ptr, randint1(user_ptr->lev / 2) + (user_ptr->lev / 2), FALSE);
245 (void)set_invuln(user_ptr, randint1(8) + 8, FALSE);
248 (void)heroism(user_ptr, 25);
251 (void)set_fast(user_ptr, randint1(50) + 50, FALSE);
252 (void)heroism(user_ptr, 50);
254 case ACT_RESIST_ACID:
255 return activate_resistance_acid(user_ptr, o_ptr, name);
256 case ACT_RESIST_FIRE:
257 return activate_resistance_fire(user_ptr, o_ptr, name);
258 case ACT_RESIST_COLD:
259 return activate_resistance_cold(user_ptr, o_ptr, name);
260 case ACT_RESIST_ELEC:
261 return activate_resistance_elec(user_ptr, o_ptr, name);
262 case ACT_RESIST_POIS:
263 return activate_resistance_pois(user_ptr, name);
265 return activate_light(user_ptr, name);
267 return activate_map_light(user_ptr);
269 return activate_all_detection(user_ptr);
270 case ACT_DETECT_XTRA:
271 return activate_extra_detection(user_ptr);
273 return activate_fully_identification(user_ptr);
275 return activate_identification(user_ptr);
277 return activate_exploding_rune(user_ptr);
279 return activate_protection_rune(user_ptr);
281 (void)set_food(user_ptr, PY_FOOD_MAX - 1);
284 return activate_door_destroy(user_ptr);
286 return activate_stone_mud(user_ptr);
288 return activate_recharge(user_ptr);
290 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
291 (void)alchemy(user_ptr);
294 return activate_dimension_door(user_ptr);
296 return activate_teleport(user_ptr);
298 return activate_recall(user_ptr);
300 return activate_judgement(user_ptr, name);
301 case ACT_TELEKINESIS:
302 return activate_telekinesis(user_ptr, name);
303 case ACT_DETECT_UNIQUE:
304 return activate_unique_detection(user_ptr);
306 return activate_escape(user_ptr);
307 case ACT_DISP_CURSE_XTRA:
308 return activate_dispel_curse(user_ptr, name);
309 case ACT_BRAND_FIRE_BOLTS:
310 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
311 brand_bolts(user_ptr);
313 case ACT_RECHARGE_XTRA:
314 return activate_recharge_extra(user_ptr, name);
316 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
317 return perilous_secrets(user_ptr);
319 return activate_shikofumi(user_ptr);
321 return activate_phase_door(user_ptr);
322 case ACT_DETECT_ALL_MONS:
323 return activate_all_monsters_detection(user_ptr);
324 case ACT_ULTIMATE_RESIST:
325 return activate_ultimate_resistance(user_ptr);
327 (void)cosmic_cast_off(user_ptr, o_ptr);
329 case ACT_FALLING_STAR:
330 return activate_toragoroshi(user_ptr);
331 case ACT_GRAND_CROSS:
332 return activate_grand_cross(user_ptr);
333 case ACT_TELEPORT_LEVEL:
334 return activate_teleport_level(user_ptr);
335 case ACT_STRAIN_HASTE:
336 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
337 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
338 (void)set_fast(user_ptr, user_ptr->fast + 25 + randint1(25), FALSE);
341 return fishing(user_ptr);
343 mitokohmon(user_ptr);
346 return activate_muramasa(user_ptr, o_ptr);
347 case ACT_BLOODY_MOON:
348 return activate_bloody_moon(user_ptr, o_ptr);
350 return activate_crimson(user_ptr, o_ptr);
352 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);