2 * @brief プレイヤーの発動コマンド実装
7 #include "object-activation/activation-switcher.h"
8 #include "action/action-limited.h"
9 #include "action/activation-execution.h"
10 #include "art-definition/art-bow-types.h"
11 #include "art-definition/art-sword-types.h"
12 #include "art-definition/art-weapon-types.h"
13 #include "art-definition/random-art-effects.h"
14 #include "artifact/artifact-info.h"
15 #include "cmd-io/cmd-save.h"
16 #include "core/asking-player.h"
17 #include "core/hp-mp-processor.h"
18 #include "core/player-update-types.h"
19 #include "core/window-redrawer.h"
20 #include "effect/effect-characteristics.h"
21 #include "effect/spells-effect-util.h"
22 #include "floor/cave.h"
23 #include "floor/floor-object.h"
24 #include "floor/floor.h"
25 #include "game-option/disturbance-options.h"
26 #include "game-option/input-options.h"
27 #include "game-option/special-options.h"
28 #include "grid/feature-flag-types.h"
29 #include "grid/grid.h"
30 #include "main/sound-definitions-table.h"
31 #include "main/sound-of-music.h"
32 #include "monster-floor/monster-generator.h"
33 #include "monster-floor/monster-summon.h"
34 #include "monster-floor/place-monster-types.h"
35 #include "monster-race/monster-race.h"
36 #include "monster-race/race-flags1.h"
37 #include "monster/monster-info.h"
38 #include "monster/monster-status.h"
39 #include "monster/monster-util.h"
40 #include "monster/smart-learn-types.h"
41 #include "object-activation/activation-bolt-ball.h"
42 #include "object-activation/activation-breath.h"
43 #include "object-enchant/activation-info-table.h"
44 #include "object-enchant/dragon-breaths-table.h"
45 #include "object-enchant/object-ego.h"
46 #include "object-hook/hook-enchant.h"
47 #include "object-hook/hook-magic.h"
48 #include "object/item-tester-hooker.h"
49 #include "object/item-use-flags.h"
50 #include "object/object-flags.h"
51 #include "object/object-info.h"
52 #include "object/object-kind.h"
53 #include "player-attack/player-attack.h"
54 #include "player/attack-defense-types.h"
55 #include "player/avatar.h"
56 #include "player/digestion-processor.h"
57 #include "player/player-damage.h"
58 #include "player/player-race-types.h"
59 #include "player/special-defense-types.h"
60 #include "racial/racial-android.h"
61 #include "specific-object/death-crimson.h"
62 #include "spell-kind/earthquake.h"
63 #include "spell-kind/magic-item-recharger.h"
64 #include "spell-kind/spells-beam.h"
65 #include "spell-kind/spells-charm.h"
66 #include "spell-kind/spells-curse-removal.h"
67 #include "spell-kind/spells-detection.h"
68 #include "spell-kind/spells-fetcher.h"
69 #include "spell-kind/spells-floor.h"
70 #include "spell-kind/spells-genocide.h"
71 #include "spell-kind/spells-grid.h"
72 #include "spell-kind/spells-launcher.h"
73 #include "spell-kind/spells-lite.h"
74 #include "spell-kind/spells-neighbor.h"
75 #include "spell-kind/spells-perception.h"
76 #include "spell-kind/spells-random.h"
77 #include "spell-kind/spells-sight.h"
78 #include "spell-kind/spells-specific-bolt.h"
79 #include "spell-kind/spells-teleport.h"
80 #include "spell-kind/spells-world.h"
81 #include "spell-realm/spells-hex.h"
82 #include "spell-realm/spells-sorcery.h"
83 #include "spell/process-effect.h"
84 #include "spell/spell-types.h"
85 #include "spell/spells-object.h"
86 #include "spell/spells-status.h"
87 #include "spell/spells-summon.h"
88 #include "status/action-setter.h"
89 #include "status/bad-status-setter.h"
90 #include "status/base-status.h"
91 #include "status/body-improvement.h"
92 #include "status/buff-setter.h"
93 #include "status/element-resistance.h"
94 #include "status/experience.h"
95 #include "status/shape-changer.h"
96 #include "status/sight-setter.h"
97 #include "status/temporary-resistance.h"
98 #include "sv-definition/sv-lite-types.h"
99 #include "sv-definition/sv-ring-types.h"
100 #include "system/artifact-type-definition.h"
101 #include "system/floor-type-definition.h"
102 #include "target/target-getter.h"
103 #include "term/screen-processor.h"
104 #include "util/bit-flags-calculator.h"
105 #include "util/quarks.h"
106 #include "util/sort.h"
107 #include "view/display-messages.h"
108 #include "world/world.h"
110 bool activate_sunlight(player_type *user_ptr)
113 if (!get_aim_dir(user_ptr, &dir))
116 msg_print(_("太陽光線が放たれた。", "A line of sunlight appears."));
117 (void)lite_line(user_ptr, dir, damroll(6, 8));
121 bool activate_ring_of_power(player_type *user_ptr, concptr name)
124 msg_format(_("%sは漆黒に輝いた...", "The %s glows intensely black..."), name);
125 if (!get_aim_dir(user_ptr, &dir))
128 ring_of_power(user_ptr, dir);
132 bool activate_bladeturner(player_type *user_ptr)
135 if (!get_aim_dir(user_ptr, &dir))
138 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
139 fire_breath(user_ptr, GF_MISSILE, dir, 300, 4);
140 msg_print(_("鎧が様々な色に輝いた...", "Your armor glows many colours..."));
141 (void)set_afraid(user_ptr, 0);
142 (void)set_hero(user_ptr, randint1(50) + 50, FALSE);
143 (void)hp_player(user_ptr, 10);
144 (void)set_blessed(user_ptr, randint1(50) + 50, FALSE);
145 (void)set_oppose_acid(user_ptr, randint1(50) + 50, FALSE);
146 (void)set_oppose_elec(user_ptr, randint1(50) + 50, FALSE);
147 (void)set_oppose_fire(user_ptr, randint1(50) + 50, FALSE);
148 (void)set_oppose_cold(user_ptr, randint1(50) + 50, FALSE);
149 (void)set_oppose_pois(user_ptr, randint1(50) + 50, FALSE);
153 bool activate_confusion(player_type *user_ptr)
156 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
157 if (!get_aim_dir(user_ptr, &dir))
160 confuse_monster(user_ptr, dir, 20);
164 bool activate_teleport_away(player_type *user_ptr)
167 if (!get_aim_dir(user_ptr, &dir))
170 (void)fire_beam(user_ptr, GF_AWAY_ALL, dir, user_ptr->lev);
174 bool activate_banish_evil(player_type *user_ptr)
176 if (banish_evil(user_ptr, 100))
177 msg_print(_("アーティファクトの力が邪悪を打ち払った!", "The power of the artifact banishes evil!"));
182 bool activate_scare(player_type *user_ptr)
184 if (music_singing_any(user_ptr))
185 stop_singing(user_ptr);
187 if (hex_spelling_any(user_ptr))
188 stop_hex_spell_all(user_ptr);
190 msg_print(_("あなたは力強い突風を吹き鳴らした。周囲の敵が震え上っている!", "You wind a mighty blast; your enemies tremble!"));
191 (void)turn_monsters(user_ptr, (3 * user_ptr->lev / 2) + 10);
195 bool activate_aggravation(player_type *user_ptr, object_type *o_ptr, concptr name)
197 if (o_ptr->name1 == ART_HYOUSIGI)
198 msg_print(_("拍子木を打った。", "You beat your wooden clappers."));
200 msg_format(_("%sは不快な物音を立てた。", "The %s sounds an unpleasant noise."), name);
202 aggravate_monsters(user_ptr, 0);
206 bool switch_activation(player_type *user_ptr, object_type *o_ptr, const activation_type *const act_ptr, concptr name)
209 switch (act_ptr->index) {
211 return activate_sunlight(user_ptr);
213 return activate_missile_1(user_ptr);
215 return activate_ball_pois_1(user_ptr);
217 return activate_bolt_elec_1(user_ptr);
219 return activate_bolt_acid_1(user_ptr);
221 return activate_bolt_cold_1(user_ptr);
223 return activate_bolt_fire_1(user_ptr);
225 return activate_ball_cold_1(user_ptr);
227 return activate_ball_cold_2(user_ptr);
229 return activate_ball_cold_2(user_ptr);
231 return activate_ball_fire_1(user_ptr);
233 return activate_ball_fire_2(user_ptr, name);
235 return activate_ball_fire_3(user_ptr);
237 return activate_ball_fire_4(user_ptr);
239 return activate_ball_elec_2(user_ptr);
241 return activate_ball_elec_3(user_ptr);
243 return activate_ball_acid_1(user_ptr);
245 return activate_ball_nuke_1(user_ptr);
246 case ACT_HYPODYNAMIA_1:
247 return activate_bolt_hypodynamia_1(user_ptr, name);
248 case ACT_HYPODYNAMIA_2:
249 return activate_bolt_hypodynamia_2(user_ptr);
251 return activate_bolt_drain_1(user_ptr);
253 return activate_missile_2(user_ptr);
258 return activate_bolt_drain_2(user_ptr);
260 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
261 call_chaos(user_ptr);
264 return activate_rocket(user_ptr);
266 msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness..."));
267 dispel_evil(user_ptr, user_ptr->lev * 5);
270 return activate_missile_3(user_ptr);
272 msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil..."));
273 dispel_good(user_ptr, user_ptr->lev * 5);
276 return activate_bolt_mana(user_ptr, name);
278 return activate_ball_water(user_ptr, name);
280 return activate_ball_dark(user_ptr, name);
282 return activate_ball_mana(user_ptr, name);
284 msg_print(_("あなたは害虫を一掃した。", "You exterminate small life."));
285 (void)dispel_monsters(user_ptr, 4);
287 case ACT_BLINDING_LIGHT:
288 msg_format(_("%sが眩しい光で輝いた...", "The %s gleams with blinding light..."), name);
289 (void)fire_ball(user_ptr, GF_LITE, 0, 300, 6);
290 confuse_monsters(user_ptr, 3 * user_ptr->lev / 2);
293 return activate_ring_of_power(user_ptr, name);
294 case ACT_CAST_BA_STAR:
295 return activate_ball_lite(user_ptr, name);
296 case ACT_BLADETURNER:
297 return activate_bladeturner(user_ptr);
299 return activate_breath_fire(user_ptr, o_ptr);
301 return activate_breath_cold(user_ptr, o_ptr);
303 return activate_dragon_breath(user_ptr, o_ptr);
305 return activate_confusion(user_ptr);
307 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
308 sleep_monsters_touch(user_ptr);
311 earthquake(user_ptr, user_ptr->y, user_ptr->x, 5, 0);
314 turn_monsters(user_ptr, 40 + user_ptr->lev);
317 return activate_teleport_away(user_ptr);
318 case ACT_BANISH_EVIL:
319 return activate_banish_evil(user_ptr);
321 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
322 (void)symbol_genocide(user_ptr, 200, TRUE);
325 msg_print(_("ひどく鋭い音が流れ出た...", "It lets out a long, shrill note..."));
326 (void)mass_genocide(user_ptr, 200, TRUE);
329 return activate_scare(user_ptr);
331 return activate_aggravation(user_ptr, o_ptr, name);
332 case ACT_CHARM_ANIMAL:
333 if (!get_aim_dir(user_ptr, &dir))
336 (void)charm_animal(user_ptr, dir, user_ptr->lev);
338 case ACT_CHARM_UNDEAD:
339 if (!get_aim_dir(user_ptr, &dir))
342 (void)control_one_undead(user_ptr, dir, user_ptr->lev);
344 case ACT_CHARM_OTHER:
345 if (!get_aim_dir(user_ptr, &dir))
348 (void)charm_monster(user_ptr, dir, user_ptr->lev * 2);
350 case ACT_CHARM_ANIMALS:
351 (void)charm_animals(user_ptr, user_ptr->lev * 2);
353 case ACT_CHARM_OTHERS:
354 (void)charm_monsters(user_ptr, user_ptr->lev * 2);
356 case ACT_SUMMON_ANIMAL:
357 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->lev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET));
359 case ACT_SUMMON_PHANTOM:
360 msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
361 (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));
363 case ACT_SUMMON_ELEMENTAL:
364 return cast_summon_elemental(user_ptr, (user_ptr->lev * 3) / 2);
365 case ACT_SUMMON_DEMON:
366 cast_summon_demon(user_ptr, (user_ptr->lev * 3) / 2);
368 case ACT_SUMMON_UNDEAD:
369 return cast_summon_undead(user_ptr, (user_ptr->lev * 3) / 2);
370 case ACT_SUMMON_HOUND:
371 return cast_summon_hound(user_ptr, (user_ptr->lev * 3) / 2);
372 case ACT_SUMMON_DAWN:
373 msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
374 (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));
376 case ACT_SUMMON_OCTOPUS:
377 return cast_summon_octopus(user_ptr);
378 case ACT_CHOIR_SINGS:
379 msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
380 (void)cure_critical_wounds(user_ptr, 777);
381 (void)set_hero(user_ptr, randint1(25) + 25, FALSE);
384 (void)set_afraid(user_ptr, 0);
385 (void)hp_player(user_ptr, 30);
388 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
389 (void)cure_serious_wounds(user_ptr, 4, 8);
391 case ACT_CURE_POISON:
392 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
393 (void)set_afraid(user_ptr, 0);
394 (void)set_poisoned(user_ptr, 0);
397 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
398 restore_level(user_ptr);
401 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
402 (void)restore_all_status(user_ptr);
403 (void)restore_level(user_ptr);
406 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
407 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
408 (void)cure_critical_wounds(user_ptr, 700);
411 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
412 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
413 (void)cure_critical_wounds(user_ptr, 1000);
416 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
417 true_healing(user_ptr, 0);
419 case ACT_CURE_MANA_FULL:
420 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
421 restore_mana(user_ptr, TRUE);
424 (void)set_tim_esp(user_ptr, randint1(30) + 25, FALSE);
427 (void)berserk(user_ptr, randint1(25) + 25);
430 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
431 (void)set_protevil(user_ptr, randint1(25) + user_ptr->lev * 3, FALSE);
434 msg_print(_("様々な色に輝いている...", "It glows many colours..."));
435 (void)set_oppose_acid(user_ptr, randint1(40) + 40, FALSE);
436 (void)set_oppose_elec(user_ptr, randint1(40) + 40, FALSE);
437 (void)set_oppose_fire(user_ptr, randint1(40) + 40, FALSE);
438 (void)set_oppose_cold(user_ptr, randint1(40) + 40, FALSE);
439 (void)set_oppose_pois(user_ptr, randint1(40) + 40, FALSE);
442 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
443 (void)set_fast(user_ptr, randint1(20) + 20, FALSE);
446 msg_print(_("明るく輝いている...", "It glows brightly..."));
447 (void)set_fast(user_ptr, randint1(75) + 75, FALSE);
450 set_wraith_form(user_ptr, randint1(user_ptr->lev / 2) + (user_ptr->lev / 2), FALSE);
453 (void)set_invuln(user_ptr, randint1(8) + 8, FALSE);
456 (void)heroism(user_ptr, 25);
459 (void)set_fast(user_ptr, randint1(50) + 50, FALSE);
460 (void)heroism(user_ptr, 50);
462 case ACT_RESIST_ACID:
463 msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
464 if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_ACID))
467 if (!get_aim_dir(user_ptr, &dir))
470 (void)fire_ball(user_ptr, GF_ACID, dir, 100, 2);
471 (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
473 case ACT_RESIST_FIRE:
474 msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
475 if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_FLAMES))
478 if (!get_aim_dir(user_ptr, &dir))
481 (void)fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
482 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
484 case ACT_RESIST_COLD:
485 msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
486 if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_ICE))
489 if (!get_aim_dir(user_ptr, &dir))
492 (void)fire_ball(user_ptr, GF_COLD, dir, 100, 2);
493 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
495 case ACT_RESIST_ELEC:
496 msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
497 if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_ELEC))
500 if (!get_aim_dir(user_ptr, &dir))
503 (void)fire_ball(user_ptr, GF_ELEC, dir, 100, 2);
504 (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
506 case ACT_RESIST_POIS:
507 msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
508 (void)set_oppose_pois(user_ptr, randint1(20) + 20, FALSE);
511 msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
512 lite_area(user_ptr, damroll(2, 15), 3);
515 msg_print(_("眩しく輝いた...", "It shines brightly..."));
516 map_area(user_ptr, DETECT_RAD_MAP);
517 lite_area(user_ptr, damroll(2, 15), 3);
520 msg_print(_("白く明るく輝いている...", "It glows bright white..."));
521 msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind..."));
522 detect_all(user_ptr, DETECT_RAD_DEFAULT);
524 case ACT_DETECT_XTRA:
525 msg_print(_("明るく輝いている...", "It glows brightly..."));
526 detect_all(user_ptr, DETECT_RAD_DEFAULT);
528 identify_fully(user_ptr, FALSE, 0);
531 msg_print(_("黄色く輝いている...", "It glows yellow..."));
532 identify_fully(user_ptr, FALSE, 0);
535 return ident_spell(user_ptr, FALSE, 0);
537 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
538 explosive_rune(user_ptr, user_ptr->y, user_ptr->x);
541 msg_print(_("ブルーに明るく輝いている...", "It glows light blue..."));
542 warding_glyph(user_ptr);
545 (void)set_food(user_ptr, PY_FOOD_MAX - 1);
548 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
549 destroy_doors_touch(user_ptr);
552 msg_print(_("鼓動している...", "It pulsates..."));
553 if (!get_aim_dir(user_ptr, &dir))
556 wall_to_mud(user_ptr, dir, 20 + randint1(30));
559 recharge(user_ptr, 130);
562 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
563 (void)alchemy(user_ptr);
566 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
567 return dimension_door(user_ptr);
569 msg_print(_("周りの空間が歪んでいる...", "It twists space around you..."));
570 teleport_player(user_ptr, 100, TELEPORT_SPONTANEOUS);
573 msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
574 return recall_player(user_ptr, randint0(21) + 15);
576 msg_format(_("%sは赤く明るく光った!", "The %s flashes bright red!"), name);
577 chg_virtue(user_ptr, V_KNOWLEDGE, 1);
578 chg_virtue(user_ptr, V_ENLIGHTEN, 1);
579 wiz_lite(user_ptr, FALSE);
581 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
582 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("審判の宝石", "the Jewel of Judgement"), -1);
584 (void)detect_traps(user_ptr, DETECT_RAD_DEFAULT, TRUE);
585 (void)detect_doors(user_ptr, DETECT_RAD_DEFAULT);
586 (void)detect_stairs(user_ptr, DETECT_RAD_DEFAULT);
588 if (get_check(_("帰還の力を使いますか?", "Activate recall? ")))
589 (void)recall_player(user_ptr, randint0(21) + 15);
592 case ACT_TELEKINESIS:
593 if (!get_aim_dir(user_ptr, &dir))
596 msg_format(_("%sを伸ばした。", "You stretched your %s."), name);
597 fetch_item(user_ptr, dir, 500, TRUE);
599 case ACT_DETECT_UNIQUE: {
602 msg_print(_("奇妙な場所が頭の中に浮かんだ...", "Some strange places show up in your mind. And you see ..."));
603 for (int i = user_ptr->current_floor_ptr->m_max - 1; i >= 1; i--) {
604 m_ptr = &user_ptr->current_floor_ptr->m_list[i];
605 if (!monster_is_valid(m_ptr))
608 r_ptr = &r_info[m_ptr->r_idx];
609 if (r_ptr->flags1 & RF1_UNIQUE)
610 msg_format(_("%s. ", "%s. "), r_name + r_ptr->name);
616 switch (randint1(13)) {
622 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
629 teleport_player(user_ptr, 222, TELEPORT_SPONTANEOUS);
633 (void)stair_creation(user_ptr);
636 if (!get_check(_("この階を去りますか?", "Leave this level? ")))
640 do_cmd_save_game(user_ptr, TRUE);
642 user_ptr->leaving = TRUE;
645 case ACT_DISP_CURSE_XTRA:
646 msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
647 (void)remove_all_curse(user_ptr);
648 (void)probing(user_ptr);
650 case ACT_BRAND_FIRE_BOLTS:
651 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
652 brand_bolts(user_ptr);
654 case ACT_RECHARGE_XTRA:
655 msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name);
656 return recharge(user_ptr, 1000);
658 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
659 return perilous_secrets(user_ptr);
661 msg_print(_("力強く四股を踏んだ。", "You stamp. (as if you are in a ring.)"));
662 (void)set_afraid(user_ptr, 0);
663 (void)set_hero(user_ptr, randint1(20) + 20, FALSE);
664 (void)dispel_evil(user_ptr, user_ptr->lev * 3);
667 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
669 case ACT_DETECT_ALL_MONS:
670 (void)detect_monsters_invis(user_ptr, 255);
671 (void)detect_monsters_normal(user_ptr, 255);
673 case ACT_ULTIMATE_RESIST: {
674 TIME_EFFECT v = randint1(25) + 25;
675 (void)set_afraid(user_ptr, 0);
676 (void)set_hero(user_ptr, v, FALSE);
677 (void)hp_player(user_ptr, 10);
678 (void)set_blessed(user_ptr, v, FALSE);
679 (void)set_oppose_acid(user_ptr, v, FALSE);
680 (void)set_oppose_elec(user_ptr, v, FALSE);
681 (void)set_oppose_fire(user_ptr, v, FALSE);
682 (void)set_oppose_cold(user_ptr, v, FALSE);
683 (void)set_oppose_pois(user_ptr, v, FALSE);
684 (void)set_ultimate_res(user_ptr, v, FALSE);
688 cosmic_cast_off(user_ptr, o_ptr);
690 case ACT_FALLING_STAR:
691 msg_print(_("あなたは妖刀に魅入られた…", "You are enchanted by cursed blade..."));
692 msg_print(_("「狂ほしく 血のごとき 月はのぼれり 秘めおきし 魔剣 いずこぞや」", "'Behold the blade arts.'"));
695 case ACT_GRAND_CROSS:
696 msg_print(_("「闇に還れ!」", "You say, 'Return to darkness!'"));
697 project(user_ptr, 0, 8, user_ptr->y, user_ptr->x, (randint1(100) + 200) * 2, GF_HOLY_FIRE, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
699 case ACT_TELEPORT_LEVEL:
700 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)")))
703 teleport_level(user_ptr, 0);
705 case ACT_STRAIN_HASTE:
706 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
707 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
708 (void)set_fast(user_ptr, user_ptr->fast + 25 + randint1(25), FALSE);
711 return fishing(user_ptr);
713 mitokohmon(user_ptr);
716 if (o_ptr->name1 != ART_MURAMASA)
719 if (!get_check(_("本当に使いますか?", "Are you sure?!")))
722 msg_print(_("村正が震えた...", "The Muramasa pulsates..."));
723 do_inc_stat(user_ptr, A_STR);
725 msg_print(_("村正は壊れた!", "The Muramasa is destroyed!"));
726 curse_weapon_object(user_ptr, TRUE, o_ptr);
730 case ACT_BLOODY_MOON:
731 if (o_ptr->name1 != ART_BLOOD)
734 msg_print(_("鎌が明るく輝いた...", "Your scythe glows brightly!"));
735 get_bloody_moon_flags(o_ptr);
736 if (user_ptr->prace == RACE_ANDROID)
737 calc_android_exp(user_ptr);
739 user_ptr->update |= (PU_BONUS | PU_HP);
742 if (o_ptr->name1 != ART_CRIMSON)
745 msg_print(_("せっかくだから『クリムゾン』をぶっぱなすぜ!", "I'll fire CRIMSON! SEKKAKUDAKARA!"));
746 return fire_crimson(user_ptr);
748 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);
754 * @brief アイテムの発動効果を処理する。
755 * @param user_ptr プレーヤーへの参照ポインタ
756 * @param o_ptr 対象のオブジェクト構造体ポインタ
757 * @return 発動実行の是非を返す。
759 bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
761 concptr name = k_name + k_info[o_ptr->k_idx].name;
762 const activation_type *const act_ptr = find_activation_info(user_ptr, o_ptr);
764 msg_print("Activation information is not found.");
768 if (!switch_activation(user_ptr, o_ptr, act_ptr, name))
771 if (act_ptr->timeout.constant >= 0) {
772 o_ptr->timeout = (s16b)act_ptr->timeout.constant;
773 if (act_ptr->timeout.dice > 0)
774 o_ptr->timeout += randint1(act_ptr->timeout.dice);
779 switch (act_ptr->index) {
781 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250;
784 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250;
787 o_ptr->timeout = 3 * (user_ptr->lev + 10);
792 msg_format("Special timeout is not implemented: %d.", act_ptr->index);