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 "status/bad-status-setter.h"
32 #include "status/body-improvement.h"
33 #include "status/buff-setter.h"
34 #include "status/experience.h"
35 #include "status/shape-changer.h"
36 #include "status/sight-setter.h"
37 #include "system/floor-type-definition.h"
38 #include "view/display-messages.h"
40 bool switch_activation(player_type *user_ptr, object_type *o_ptr, const activation_type *const act_ptr, concptr name)
42 switch (act_ptr->index) {
44 return activate_sunlight(user_ptr);
46 return activate_missile_1(user_ptr);
48 return activate_ball_pois_1(user_ptr);
50 return activate_bolt_elec_1(user_ptr);
52 return activate_bolt_acid_1(user_ptr);
54 return activate_bolt_cold_1(user_ptr);
56 return activate_bolt_fire_1(user_ptr);
58 return activate_ball_cold_1(user_ptr);
60 return activate_ball_cold_2(user_ptr);
62 return activate_ball_cold_2(user_ptr);
64 return activate_ball_fire_1(user_ptr);
66 return activate_ball_fire_2(user_ptr, name);
68 return activate_ball_fire_3(user_ptr);
70 return activate_ball_fire_4(user_ptr);
72 return activate_ball_elec_2(user_ptr);
74 return activate_ball_elec_3(user_ptr);
76 return activate_ball_acid_1(user_ptr);
78 return activate_ball_nuke_1(user_ptr);
79 case ACT_HYPODYNAMIA_1:
80 return activate_bolt_hypodynamia_1(user_ptr, name);
81 case ACT_HYPODYNAMIA_2:
82 return activate_bolt_hypodynamia_2(user_ptr);
84 return activate_bolt_drain_1(user_ptr);
86 return activate_missile_2(user_ptr);
88 return activate_whirlwind(user_ptr);
90 return activate_bolt_drain_2(user_ptr);
92 return activate_call_chaos(user_ptr);
94 return activate_rocket(user_ptr);
96 return activate_dispel_evil(user_ptr);
98 return activate_missile_3(user_ptr);
100 return activate_dispel_good(user_ptr);
102 return activate_bolt_mana(user_ptr, name);
104 return activate_ball_water(user_ptr, name);
106 return activate_ball_dark(user_ptr, name);
108 return activate_ball_mana(user_ptr, name);
110 return activate_pesticide(user_ptr);
111 case ACT_BLINDING_LIGHT:
112 return activate_blinding_light(user_ptr, name);
114 return activate_ring_of_power(user_ptr, name);
115 case ACT_CAST_BA_STAR:
116 return activate_ball_lite(user_ptr, name);
117 case ACT_BLADETURNER:
118 return activate_bladeturner(user_ptr);
120 return activate_breath_fire(user_ptr, o_ptr);
122 return activate_breath_cold(user_ptr, o_ptr);
124 return activate_dragon_breath(user_ptr, o_ptr);
126 return activate_confusion(user_ptr);
128 return activate_sleep(user_ptr);
130 return activate_earthquake(user_ptr);
132 return activate_terror(user_ptr);
134 return activate_teleport_away(user_ptr);
135 case ACT_BANISH_EVIL:
136 return activate_banish_evil(user_ptr);
138 return activate_genocide(user_ptr);
140 return activate_mass_genocide(user_ptr);
142 return activate_scare(user_ptr);
144 return activate_aggravation(user_ptr, o_ptr, name);
145 case ACT_CHARM_ANIMAL:
146 return activate_charm_animal(user_ptr);
147 case ACT_CHARM_UNDEAD:
148 return activate_charm_undead(user_ptr);
149 case ACT_CHARM_OTHER:
150 return activate_charm_other(user_ptr);
151 case ACT_CHARM_ANIMALS:
152 return activate_charm_animals(user_ptr);
153 case ACT_CHARM_OTHERS:
154 return activate_charm_others(user_ptr);
155 case ACT_SUMMON_ANIMAL:
156 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->lev, SUMMON_ANIMAL_RANGER, PM_ALLOW_GROUP | PM_FORCE_PET);
158 case ACT_SUMMON_PHANTOM:
159 msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
160 (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);
162 case ACT_SUMMON_ELEMENTAL:
163 return cast_summon_elemental(user_ptr, (user_ptr->lev * 3) / 2);
164 case ACT_SUMMON_DEMON:
165 cast_summon_demon(user_ptr, (user_ptr->lev * 3) / 2);
167 case ACT_SUMMON_UNDEAD:
168 return cast_summon_undead(user_ptr, (user_ptr->lev * 3) / 2);
169 case ACT_SUMMON_HOUND:
170 return cast_summon_hound(user_ptr, (user_ptr->lev * 3) / 2);
171 case ACT_SUMMON_DAWN:
172 msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
173 (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);
175 case ACT_SUMMON_OCTOPUS:
176 return cast_summon_octopus(user_ptr);
177 case ACT_CHOIR_SINGS:
178 msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
179 (void)cure_critical_wounds(user_ptr, 777);
180 (void)set_hero(user_ptr, randint1(25) + 25, FALSE);
183 return activate_cure_lw(user_ptr);
185 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
186 (void)cure_serious_wounds(user_ptr, 4, 8);
188 case ACT_CURE_POISON:
189 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
190 (void)set_afraid(user_ptr, 0);
191 (void)set_poisoned(user_ptr, 0);
194 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
195 restore_level(user_ptr);
198 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
199 (void)restore_all_status(user_ptr);
200 (void)restore_level(user_ptr);
203 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
204 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
205 (void)cure_critical_wounds(user_ptr, 700);
208 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
209 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
210 (void)cure_critical_wounds(user_ptr, 1000);
213 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
214 true_healing(user_ptr, 0);
216 case ACT_CURE_MANA_FULL:
217 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
218 restore_mana(user_ptr, TRUE);
221 (void)set_tim_esp(user_ptr, randint1(30) + 25, FALSE);
224 (void)berserk(user_ptr, randint1(25) + 25);
227 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
228 (void)set_protevil(user_ptr, randint1(25) + user_ptr->lev * 3, FALSE);
231 return activate_resistance_elements(user_ptr);
233 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
234 (void)set_fast(user_ptr, randint1(20) + 20, FALSE);
237 msg_print(_("明るく輝いている...", "It glows brightly..."));
238 (void)set_fast(user_ptr, randint1(75) + 75, FALSE);
241 set_wraith_form(user_ptr, randint1(user_ptr->lev / 2) + (user_ptr->lev / 2), FALSE);
244 (void)set_invuln(user_ptr, randint1(8) + 8, FALSE);
247 (void)heroism(user_ptr, 25);
250 (void)set_fast(user_ptr, randint1(50) + 50, FALSE);
251 (void)heroism(user_ptr, 50);
253 case ACT_RESIST_ACID:
254 return activate_resistance_acid(user_ptr, o_ptr, name);
255 case ACT_RESIST_FIRE:
256 return activate_resistance_fire(user_ptr, o_ptr, name);
257 case ACT_RESIST_COLD:
258 return activate_resistance_cold(user_ptr, o_ptr, name);
259 case ACT_RESIST_ELEC:
260 return activate_resistance_elec(user_ptr, o_ptr, name);
261 case ACT_RESIST_POIS:
262 return activate_resistance_pois(user_ptr, name);
264 return activate_light(user_ptr, name);
266 return activate_map_light(user_ptr);
268 return activate_all_detection(user_ptr);
269 case ACT_DETECT_XTRA:
270 return activate_extra_detection(user_ptr);
272 return activate_fully_identification(user_ptr);
274 return activate_identification(user_ptr);
276 return activate_exploding_rune(user_ptr);
278 return activate_protection_rune(user_ptr);
280 (void)set_food(user_ptr, PY_FOOD_MAX - 1);
283 return activate_door_destroy(user_ptr);
285 return activate_stone_mud(user_ptr);
287 return activate_recharge(user_ptr);
289 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
290 (void)alchemy(user_ptr);
293 return activate_dimension_door(user_ptr);
295 return activate_teleport(user_ptr);
297 return activate_recall(user_ptr);
299 return activate_judgement(user_ptr, name);
300 case ACT_TELEKINESIS:
301 return activate_telekinesis(user_ptr, name);
302 case ACT_DETECT_UNIQUE:
303 return activate_unique_detection(user_ptr);
305 return activate_escape(user_ptr);
306 case ACT_DISP_CURSE_XTRA:
307 return activate_dispel_curse(user_ptr, name);
308 case ACT_BRAND_FIRE_BOLTS:
309 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
310 brand_bolts(user_ptr);
312 case ACT_RECHARGE_XTRA:
313 return activate_recharge_extra(user_ptr, name);
315 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
316 return perilous_secrets(user_ptr);
318 return activate_shikofumi(user_ptr);
320 return activate_phase_door(user_ptr);
321 case ACT_DETECT_ALL_MONS:
322 return activate_all_monsters_detection(user_ptr);
323 case ACT_ULTIMATE_RESIST:
324 return activate_ultimate_resistance(user_ptr);
326 (void)cosmic_cast_off(user_ptr, o_ptr);
328 case ACT_FALLING_STAR:
329 return activate_toragoroshi(user_ptr);
330 case ACT_GRAND_CROSS:
331 return activate_grand_cross(user_ptr);
332 case ACT_TELEPORT_LEVEL:
333 return activate_teleport_level(user_ptr);
334 case ACT_STRAIN_HASTE:
335 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
336 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
337 (void)set_fast(user_ptr, user_ptr->fast + 25 + randint1(25), FALSE);
340 return fishing(user_ptr);
342 mitokohmon(user_ptr);
345 return activate_muramasa(user_ptr, o_ptr);
346 case ACT_BLOODY_MOON:
347 return activate_bloody_moon(user_ptr, o_ptr);
349 return activate_crimson(user_ptr, o_ptr);
351 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);