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-breath.h"
42 #include "object-enchant/activation-info-table.h"
43 #include "object-enchant/dragon-breaths-table.h"
44 #include "object-enchant/object-ego.h"
45 #include "object-hook/hook-enchant.h"
46 #include "object-hook/hook-magic.h"
47 #include "object/item-tester-hooker.h"
48 #include "object/item-use-flags.h"
49 #include "object/object-flags.h"
50 #include "object/object-info.h"
51 #include "object/object-kind.h"
52 #include "player-attack/player-attack.h"
53 #include "player/attack-defense-types.h"
54 #include "player/avatar.h"
55 #include "player/digestion-processor.h"
56 #include "player/player-damage.h"
57 #include "player/player-race-types.h"
58 #include "player/special-defense-types.h"
59 #include "racial/racial-android.h"
60 #include "specific-object/death-crimson.h"
61 #include "spell-kind/earthquake.h"
62 #include "spell-kind/magic-item-recharger.h"
63 #include "spell-kind/spells-beam.h"
64 #include "spell-kind/spells-charm.h"
65 #include "spell-kind/spells-curse-removal.h"
66 #include "spell-kind/spells-detection.h"
67 #include "spell-kind/spells-fetcher.h"
68 #include "spell-kind/spells-floor.h"
69 #include "spell-kind/spells-genocide.h"
70 #include "spell-kind/spells-grid.h"
71 #include "spell-kind/spells-launcher.h"
72 #include "spell-kind/spells-lite.h"
73 #include "spell-kind/spells-neighbor.h"
74 #include "spell-kind/spells-perception.h"
75 #include "spell-kind/spells-random.h"
76 #include "spell-kind/spells-sight.h"
77 #include "spell-kind/spells-specific-bolt.h"
78 #include "spell-kind/spells-teleport.h"
79 #include "spell-kind/spells-world.h"
80 #include "spell-realm/spells-hex.h"
81 #include "spell-realm/spells-sorcery.h"
82 #include "spell/process-effect.h"
83 #include "spell/spell-types.h"
84 #include "spell/spells-object.h"
85 #include "spell/spells-status.h"
86 #include "spell/spells-summon.h"
87 #include "status/action-setter.h"
88 #include "status/bad-status-setter.h"
89 #include "status/base-status.h"
90 #include "status/body-improvement.h"
91 #include "status/buff-setter.h"
92 #include "status/element-resistance.h"
93 #include "status/experience.h"
94 #include "status/shape-changer.h"
95 #include "status/sight-setter.h"
96 #include "status/temporary-resistance.h"
97 #include "sv-definition/sv-lite-types.h"
98 #include "sv-definition/sv-ring-types.h"
99 #include "system/artifact-type-definition.h"
100 #include "system/floor-type-definition.h"
101 #include "target/target-getter.h"
102 #include "term/screen-processor.h"
103 #include "util/bit-flags-calculator.h"
104 #include "util/quarks.h"
105 #include "util/sort.h"
106 #include "view/display-messages.h"
107 #include "world/world.h"
109 bool activate_sunlight(player_type *user_ptr)
112 if (!get_aim_dir(user_ptr, &dir))
115 msg_print(_("太陽光線が放たれた。", "A line of sunlight appears."));
116 (void)lite_line(user_ptr, dir, damroll(6, 8));
120 bool activate_missile_1(player_type *user_ptr)
123 msg_print(_("それは眩しいくらいに明るく輝いている...", "It glows extremely brightly..."));
124 if (!get_aim_dir(user_ptr, &dir))
127 (void)fire_bolt(user_ptr, GF_MISSILE, dir, damroll(2, 6));
131 bool activate_ball_pois_1(player_type *user_ptr)
134 msg_print(_("それは濃緑色に脈動している...", "It throbs deep green..."));
135 if (!get_aim_dir(user_ptr, &dir))
138 (void)fire_ball(user_ptr, GF_POIS, dir, 12, 3);
142 bool activate_bolt_elec_1(player_type *user_ptr)
145 msg_print(_("それは火花に覆われた...", "It is covered in sparks..."));
146 if (!get_aim_dir(user_ptr, &dir))
149 (void)fire_bolt(user_ptr, GF_ELEC, dir, damroll(4, 8));
153 bool activate_bolt_acid_1(player_type *user_ptr)
156 msg_print(_("それは酸に覆われた...", "It is covered in acid..."));
157 if (!get_aim_dir(user_ptr, &dir))
160 (void)fire_bolt(user_ptr, GF_ACID, dir, damroll(5, 8));
164 bool activate_bolt_cold_1(player_type *user_ptr)
167 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
168 if (!get_aim_dir(user_ptr, &dir))
171 (void)fire_bolt(user_ptr, GF_COLD, dir, damroll(6, 8));
175 bool activate_bolt_fire_1(player_type *user_ptr)
178 msg_print(_("それは炎に覆われた...", "It is covered in fire..."));
179 if (!get_aim_dir(user_ptr, &dir))
182 (void)fire_bolt(user_ptr, GF_FIRE, dir, damroll(9, 8));
186 bool activate_ball_cold_1(player_type *user_ptr)
189 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
190 if (!get_aim_dir(user_ptr, &dir))
193 (void)fire_ball(user_ptr, GF_COLD, dir, 48, 2);
197 bool activate_ball_cold_2(player_type *user_ptr)
200 msg_print(_("それは青く激しく輝いた...", "It glows an intense blue..."));
201 if (!get_aim_dir(user_ptr, &dir))
204 (void)fire_ball(user_ptr, GF_COLD, dir, 100, 2);
208 bool activate_ball_cold_3(player_type *user_ptr)
211 msg_print(_("明るく白色に輝いている...", "It glows bright white..."));
212 if (!get_aim_dir(user_ptr, &dir))
215 (void)fire_ball(user_ptr, GF_COLD, dir, 400, 3);
219 bool activate_ball_fire_1(player_type *user_ptr)
222 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
223 if (!get_aim_dir(user_ptr, &dir))
226 (void)fire_ball(user_ptr, GF_FIRE, dir, 72, 2);
230 bool activate_ball_fire_2(player_type *user_ptr, concptr name)
233 msg_format(_("%sから炎が吹き出した...", "The %s rages in fire..."), name);
234 if (!get_aim_dir(user_ptr, &dir))
237 (void)fire_ball(user_ptr, GF_FIRE, dir, 120, 3);
241 bool activate_ball_fire_3(player_type *user_ptr)
244 msg_print(_("深赤色に輝いている...", "It glows deep red..."));
245 if (!get_aim_dir(user_ptr, &dir))
248 (void)fire_ball(user_ptr, GF_FIRE, dir, 300, 3);
252 bool activate_ball_fire_4(player_type *user_ptr)
255 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
256 if (!get_aim_dir(user_ptr, &dir))
259 (void)fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
263 bool activate_ball_elec_2(player_type *user_ptr)
266 msg_print(_("電気がパチパチ音を立てた...", "It crackles with electricity..."));
267 if (!get_aim_dir(user_ptr, &dir))
270 (void)fire_ball(user_ptr, GF_ELEC, dir, 100, 3);
274 bool activate_ball_elec_3(player_type *user_ptr)
277 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
278 if (!get_aim_dir(user_ptr, &dir))
281 (void)fire_ball(user_ptr, GF_ELEC, dir, 500, 3);
285 bool activate_ball_acid_1(player_type *user_ptr)
288 msg_print(_("それは黒く激しく輝いた...", "It glows an intense black..."));
289 if (!get_aim_dir(user_ptr, &dir))
292 (void)fire_ball(user_ptr, GF_ACID, dir, 100, 2);
296 bool activate_ball_nuke_1(player_type *user_ptr)
299 msg_print(_("それは緑に激しく輝いた...", "It glows an intense green..."));
300 if (!get_aim_dir(user_ptr, &dir))
303 (void)fire_ball(user_ptr, GF_NUKE, dir, 100, 2);
307 bool activate_bolt_hypodynamia_1(player_type *user_ptr, concptr name)
310 msg_format(_("あなたは%sに敵を締め殺すよう命じた。", "You order the %s to strangle your opponent."), name);
311 if (!get_aim_dir(user_ptr, &dir))
314 hypodynamic_bolt(user_ptr, dir, 100);
318 bool activate_bolt_hypodynamia_2(player_type *user_ptr)
321 msg_print(_("黒く輝いている...", "It glows black..."));
322 if (!get_aim_dir(user_ptr, &dir))
325 hypodynamic_bolt(user_ptr, dir, 120);
329 bool activate_bolt_drain_1(player_type *user_ptr)
332 if (!get_aim_dir(user_ptr, &dir))
335 for (int dummy = 0; dummy < 3; dummy++)
336 if (hypodynamic_bolt(user_ptr, dir, 50))
337 hp_player(user_ptr, 50);
342 bool activate_missile_2(player_type *user_ptr)
345 msg_print(_("魔法のトゲが現れた...", "It grows magical spikes..."));
346 if (!get_aim_dir(user_ptr, &dir))
349 (void)fire_bolt(user_ptr, GF_ARROW, dir, 150);
353 bool activate_bolt_drain_2(player_type *user_ptr)
356 if (!get_aim_dir(user_ptr, &dir))
359 for (int dummy = 0; dummy < 3; dummy++)
360 if (hypodynamic_bolt(user_ptr, dir, 100))
361 hp_player(user_ptr, 100);
366 bool activate_rocket(player_type *user_ptr)
369 if (!get_aim_dir(user_ptr, &dir))
372 msg_print(_("ロケットを発射した!", "You launch a rocket!"));
373 (void)fire_ball(user_ptr, GF_ROCKET, dir, 250 + user_ptr->lev * 3, 2);
377 bool activate_missile_3(player_type *user_ptr)
380 if (!get_aim_dir(user_ptr, &dir))
383 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
384 fire_breath(user_ptr, GF_MISSILE, dir, 300, 4);
388 bool activate_bolt_mana(player_type *user_ptr, concptr name)
391 msg_format(_("%sに魔法のトゲが現れた...", "The %s grows magical spikes..."), name);
392 if (!get_aim_dir(user_ptr, &dir))
395 (void)fire_bolt(user_ptr, GF_ARROW, dir, 150);
399 bool activate_ball_water(player_type *user_ptr, concptr name)
402 msg_format(_("%sが深い青色に鼓動している...", "The %s throbs deep blue..."), name);
403 if (!get_aim_dir(user_ptr, &dir))
406 (void)fire_ball(user_ptr, GF_WATER, dir, 200, 3);
410 bool activate_ball_dark(player_type *user_ptr, concptr name)
413 msg_format(_("%sが深い闇に覆われた...", "The %s is coverd in pitch-darkness..."), name);
414 if (!get_aim_dir(user_ptr, &dir))
417 (void)fire_ball(user_ptr, GF_DARK, dir, 250, 4);
421 bool activate_ball_mana(player_type *user_ptr, concptr name)
424 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
425 if (!get_aim_dir(user_ptr, &dir))
428 (void)fire_ball(user_ptr, GF_MANA, dir, 250, 4);
432 bool activate_ring_of_power(player_type *user_ptr, concptr name)
435 msg_format(_("%sは漆黒に輝いた...", "The %s glows intensely black..."), name);
436 if (!get_aim_dir(user_ptr, &dir))
439 ring_of_power(user_ptr, dir);
443 bool activate_ball_lite(player_type *user_ptr, concptr name)
445 HIT_POINT num = damroll(5, 3);
446 POSITION y = 0, x = 0;
447 msg_format(_("%sが稲妻で覆われた...", "The %s is surrounded by lightning..."), name);
448 for (int k = 0; k < num; k++) {
451 scatter(user_ptr, &y, &x, user_ptr->y, user_ptr->x, 4, 0);
452 if (!cave_have_flag_bold(user_ptr->current_floor_ptr, y, x, FF_PROJECT))
455 if (!player_bold(user_ptr, y, x))
459 project(user_ptr, 0, 3, y, x, 150, GF_ELEC, (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
465 bool activate_bladeturner(player_type *user_ptr)
468 if (!get_aim_dir(user_ptr, &dir))
471 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
472 fire_breath(user_ptr, GF_MISSILE, dir, 300, 4);
473 msg_print(_("鎧が様々な色に輝いた...", "Your armor glows many colours..."));
474 (void)set_afraid(user_ptr, 0);
475 (void)set_hero(user_ptr, randint1(50) + 50, FALSE);
476 (void)hp_player(user_ptr, 10);
477 (void)set_blessed(user_ptr, randint1(50) + 50, FALSE);
478 (void)set_oppose_acid(user_ptr, randint1(50) + 50, FALSE);
479 (void)set_oppose_elec(user_ptr, randint1(50) + 50, FALSE);
480 (void)set_oppose_fire(user_ptr, randint1(50) + 50, FALSE);
481 (void)set_oppose_cold(user_ptr, randint1(50) + 50, FALSE);
482 (void)set_oppose_pois(user_ptr, randint1(50) + 50, FALSE);
486 bool switch_activation(player_type *user_ptr, object_type *o_ptr, const activation_type *const act_ptr, concptr name)
489 switch (act_ptr->index) {
491 return activate_sunlight(user_ptr);
493 return activate_missile_1(user_ptr);
495 return activate_ball_pois_1(user_ptr);
497 return activate_bolt_elec_1(user_ptr);
499 return activate_bolt_acid_1(user_ptr);
501 return activate_bolt_cold_1(user_ptr);
503 return activate_bolt_fire_1(user_ptr);
505 return activate_ball_cold_1(user_ptr);
507 return activate_ball_cold_2(user_ptr);
509 return activate_ball_cold_2(user_ptr);
511 return activate_ball_fire_1(user_ptr);
513 return activate_ball_fire_2(user_ptr, name);
515 return activate_ball_fire_3(user_ptr);
517 return activate_ball_fire_4(user_ptr);
519 return activate_ball_elec_2(user_ptr);
521 return activate_ball_elec_3(user_ptr);
523 return activate_ball_acid_1(user_ptr);
525 return activate_ball_nuke_1(user_ptr);
526 case ACT_HYPODYNAMIA_1:
527 return activate_bolt_hypodynamia_1(user_ptr, name);
528 case ACT_HYPODYNAMIA_2:
529 return activate_bolt_hypodynamia_2(user_ptr);
531 return activate_bolt_drain_1(user_ptr);
533 return activate_missile_2(user_ptr);
538 return activate_bolt_drain_2(user_ptr);
540 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
541 call_chaos(user_ptr);
544 return activate_rocket(user_ptr);
546 msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness..."));
547 dispel_evil(user_ptr, user_ptr->lev * 5);
550 return activate_missile_3(user_ptr);
552 msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil..."));
553 dispel_good(user_ptr, user_ptr->lev * 5);
556 return activate_bolt_mana(user_ptr, name);
558 return activate_ball_water(user_ptr, name);
560 return activate_ball_dark(user_ptr, name);
562 return activate_ball_mana(user_ptr, name);
564 msg_print(_("あなたは害虫を一掃した。", "You exterminate small life."));
565 (void)dispel_monsters(user_ptr, 4);
567 case ACT_BLINDING_LIGHT:
568 msg_format(_("%sが眩しい光で輝いた...", "The %s gleams with blinding light..."), name);
569 (void)fire_ball(user_ptr, GF_LITE, 0, 300, 6);
570 confuse_monsters(user_ptr, 3 * user_ptr->lev / 2);
573 return activate_ring_of_power(user_ptr, name);
574 case ACT_CAST_BA_STAR:
575 return activate_ball_lite(user_ptr, name);
576 case ACT_BLADETURNER:
577 return activate_bladeturner(user_ptr);
579 if (!get_aim_dir(user_ptr, &dir))
582 fire_breath(user_ptr, GF_FIRE, dir, 200, 2);
583 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
584 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
588 if (!get_aim_dir(user_ptr, &dir))
591 fire_breath(user_ptr, GF_COLD, dir, 200, 2);
592 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
593 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
597 if (!activate_dragon_breath(user_ptr, o_ptr))
602 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
603 if (!get_aim_dir(user_ptr, &dir))
606 confuse_monster(user_ptr, dir, 20);
609 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
610 sleep_monsters_touch(user_ptr);
613 earthquake(user_ptr, user_ptr->y, user_ptr->x, 5, 0);
616 turn_monsters(user_ptr, 40 + user_ptr->lev);
619 if (!get_aim_dir(user_ptr, &dir))
622 (void)fire_beam(user_ptr, GF_AWAY_ALL, dir, user_ptr->lev);
624 case ACT_BANISH_EVIL:
625 if (banish_evil(user_ptr, 100))
626 msg_print(_("アーティファクトの力が邪悪を打ち払った!", "The power of the artifact banishes evil!"));
630 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
631 (void)symbol_genocide(user_ptr, 200, TRUE);
634 msg_print(_("ひどく鋭い音が流れ出た...", "It lets out a long, shrill note..."));
635 (void)mass_genocide(user_ptr, 200, TRUE);
638 if (music_singing_any(user_ptr))
639 stop_singing(user_ptr);
641 if (hex_spelling_any(user_ptr))
642 stop_hex_spell_all(user_ptr);
644 msg_print(_("あなたは力強い突風を吹き鳴らした。周囲の敵が震え上っている!", "You wind a mighty blast; your enemies tremble!"));
645 (void)turn_monsters(user_ptr, (3 * user_ptr->lev / 2) + 10);
648 if (o_ptr->name1 == ART_HYOUSIGI)
649 msg_print(_("拍子木を打った。", "You beat your wooden clappers."));
651 msg_format(_("%sは不快な物音を立てた。", "The %s sounds an unpleasant noise."), name);
653 aggravate_monsters(user_ptr, 0);
655 case ACT_CHARM_ANIMAL:
656 if (!get_aim_dir(user_ptr, &dir))
659 (void)charm_animal(user_ptr, dir, user_ptr->lev);
661 case ACT_CHARM_UNDEAD:
662 if (!get_aim_dir(user_ptr, &dir))
665 (void)control_one_undead(user_ptr, dir, user_ptr->lev);
667 case ACT_CHARM_OTHER:
668 if (!get_aim_dir(user_ptr, &dir))
671 (void)charm_monster(user_ptr, dir, user_ptr->lev * 2);
673 case ACT_CHARM_ANIMALS:
674 (void)charm_animals(user_ptr, user_ptr->lev * 2);
676 case ACT_CHARM_OTHERS:
677 (void)charm_monsters(user_ptr, user_ptr->lev * 2);
679 case ACT_SUMMON_ANIMAL:
680 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->lev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET));
682 case ACT_SUMMON_PHANTOM:
683 msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
684 (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));
686 case ACT_SUMMON_ELEMENTAL:
687 return cast_summon_elemental(user_ptr, (user_ptr->lev * 3) / 2);
688 case ACT_SUMMON_DEMON:
689 cast_summon_demon(user_ptr, (user_ptr->lev * 3) / 2);
691 case ACT_SUMMON_UNDEAD:
692 return cast_summon_undead(user_ptr, (user_ptr->lev * 3) / 2);
693 case ACT_SUMMON_HOUND:
694 return cast_summon_hound(user_ptr, (user_ptr->lev * 3) / 2);
695 case ACT_SUMMON_DAWN:
696 msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
697 (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));
699 case ACT_SUMMON_OCTOPUS:
700 return cast_summon_octopus(user_ptr);
701 case ACT_CHOIR_SINGS:
702 msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
703 (void)cure_critical_wounds(user_ptr, 777);
704 (void)set_hero(user_ptr, randint1(25) + 25, FALSE);
707 (void)set_afraid(user_ptr, 0);
708 (void)hp_player(user_ptr, 30);
711 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
712 (void)cure_serious_wounds(user_ptr, 4, 8);
714 case ACT_CURE_POISON:
715 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
716 (void)set_afraid(user_ptr, 0);
717 (void)set_poisoned(user_ptr, 0);
720 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
721 restore_level(user_ptr);
724 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
725 (void)restore_all_status(user_ptr);
726 (void)restore_level(user_ptr);
729 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
730 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
731 (void)cure_critical_wounds(user_ptr, 700);
734 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
735 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
736 (void)cure_critical_wounds(user_ptr, 1000);
739 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
740 true_healing(user_ptr, 0);
742 case ACT_CURE_MANA_FULL:
743 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
744 restore_mana(user_ptr, TRUE);
747 (void)set_tim_esp(user_ptr, randint1(30) + 25, FALSE);
750 (void)berserk(user_ptr, randint1(25) + 25);
753 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
754 (void)set_protevil(user_ptr, randint1(25) + user_ptr->lev * 3, FALSE);
757 msg_print(_("様々な色に輝いている...", "It glows many colours..."));
758 (void)set_oppose_acid(user_ptr, randint1(40) + 40, FALSE);
759 (void)set_oppose_elec(user_ptr, randint1(40) + 40, FALSE);
760 (void)set_oppose_fire(user_ptr, randint1(40) + 40, FALSE);
761 (void)set_oppose_cold(user_ptr, randint1(40) + 40, FALSE);
762 (void)set_oppose_pois(user_ptr, randint1(40) + 40, FALSE);
765 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
766 (void)set_fast(user_ptr, randint1(20) + 20, FALSE);
769 msg_print(_("明るく輝いている...", "It glows brightly..."));
770 (void)set_fast(user_ptr, randint1(75) + 75, FALSE);
773 set_wraith_form(user_ptr, randint1(user_ptr->lev / 2) + (user_ptr->lev / 2), FALSE);
776 (void)set_invuln(user_ptr, randint1(8) + 8, FALSE);
779 (void)heroism(user_ptr, 25);
782 (void)set_fast(user_ptr, randint1(50) + 50, FALSE);
783 (void)heroism(user_ptr, 50);
785 case ACT_RESIST_ACID:
786 msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
787 if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_ACID))
790 if (!get_aim_dir(user_ptr, &dir))
793 (void)fire_ball(user_ptr, GF_ACID, dir, 100, 2);
794 (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
796 case ACT_RESIST_FIRE:
797 msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
798 if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_FLAMES))
801 if (!get_aim_dir(user_ptr, &dir))
804 (void)fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
805 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
807 case ACT_RESIST_COLD:
808 msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
809 if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_ICE))
812 if (!get_aim_dir(user_ptr, &dir))
815 (void)fire_ball(user_ptr, GF_COLD, dir, 100, 2);
816 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
818 case ACT_RESIST_ELEC:
819 msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
820 if ((o_ptr->tval != TV_RING) || (o_ptr->sval != SV_RING_ELEC))
823 if (!get_aim_dir(user_ptr, &dir))
826 (void)fire_ball(user_ptr, GF_ELEC, dir, 100, 2);
827 (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
829 case ACT_RESIST_POIS:
830 msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
831 (void)set_oppose_pois(user_ptr, randint1(20) + 20, FALSE);
834 msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
835 lite_area(user_ptr, damroll(2, 15), 3);
838 msg_print(_("眩しく輝いた...", "It shines brightly..."));
839 map_area(user_ptr, DETECT_RAD_MAP);
840 lite_area(user_ptr, damroll(2, 15), 3);
843 msg_print(_("白く明るく輝いている...", "It glows bright white..."));
844 msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind..."));
845 detect_all(user_ptr, DETECT_RAD_DEFAULT);
847 case ACT_DETECT_XTRA:
848 msg_print(_("明るく輝いている...", "It glows brightly..."));
849 detect_all(user_ptr, DETECT_RAD_DEFAULT);
851 identify_fully(user_ptr, FALSE, 0);
854 msg_print(_("黄色く輝いている...", "It glows yellow..."));
855 identify_fully(user_ptr, FALSE, 0);
858 return ident_spell(user_ptr, FALSE, 0);
860 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
861 explosive_rune(user_ptr, user_ptr->y, user_ptr->x);
864 msg_print(_("ブルーに明るく輝いている...", "It glows light blue..."));
865 warding_glyph(user_ptr);
868 (void)set_food(user_ptr, PY_FOOD_MAX - 1);
871 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
872 destroy_doors_touch(user_ptr);
875 msg_print(_("鼓動している...", "It pulsates..."));
876 if (!get_aim_dir(user_ptr, &dir))
879 wall_to_mud(user_ptr, dir, 20 + randint1(30));
882 recharge(user_ptr, 130);
885 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
886 (void)alchemy(user_ptr);
889 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
890 return dimension_door(user_ptr);
892 msg_print(_("周りの空間が歪んでいる...", "It twists space around you..."));
893 teleport_player(user_ptr, 100, TELEPORT_SPONTANEOUS);
896 msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
897 return recall_player(user_ptr, randint0(21) + 15);
899 msg_format(_("%sは赤く明るく光った!", "The %s flashes bright red!"), name);
900 chg_virtue(user_ptr, V_KNOWLEDGE, 1);
901 chg_virtue(user_ptr, V_ENLIGHTEN, 1);
902 wiz_lite(user_ptr, FALSE);
904 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
905 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("審判の宝石", "the Jewel of Judgement"), -1);
907 (void)detect_traps(user_ptr, DETECT_RAD_DEFAULT, TRUE);
908 (void)detect_doors(user_ptr, DETECT_RAD_DEFAULT);
909 (void)detect_stairs(user_ptr, DETECT_RAD_DEFAULT);
911 if (get_check(_("帰還の力を使いますか?", "Activate recall? ")))
912 (void)recall_player(user_ptr, randint0(21) + 15);
915 case ACT_TELEKINESIS:
916 if (!get_aim_dir(user_ptr, &dir))
919 msg_format(_("%sを伸ばした。", "You stretched your %s."), name);
920 fetch_item(user_ptr, dir, 500, TRUE);
922 case ACT_DETECT_UNIQUE: {
925 msg_print(_("奇妙な場所が頭の中に浮かんだ...", "Some strange places show up in your mind. And you see ..."));
926 for (int i = user_ptr->current_floor_ptr->m_max - 1; i >= 1; i--) {
927 m_ptr = &user_ptr->current_floor_ptr->m_list[i];
928 if (!monster_is_valid(m_ptr))
931 r_ptr = &r_info[m_ptr->r_idx];
932 if (r_ptr->flags1 & RF1_UNIQUE)
933 msg_format(_("%s. ", "%s. "), r_name + r_ptr->name);
939 switch (randint1(13)) {
945 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
952 teleport_player(user_ptr, 222, TELEPORT_SPONTANEOUS);
956 (void)stair_creation(user_ptr);
959 if (!get_check(_("この階を去りますか?", "Leave this level? ")))
963 do_cmd_save_game(user_ptr, TRUE);
965 user_ptr->leaving = TRUE;
968 case ACT_DISP_CURSE_XTRA:
969 msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
970 (void)remove_all_curse(user_ptr);
971 (void)probing(user_ptr);
973 case ACT_BRAND_FIRE_BOLTS:
974 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
975 brand_bolts(user_ptr);
977 case ACT_RECHARGE_XTRA:
978 msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name);
979 return recharge(user_ptr, 1000);
981 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
982 return perilous_secrets(user_ptr);
984 msg_print(_("力強く四股を踏んだ。", "You stamp. (as if you are in a ring.)"));
985 (void)set_afraid(user_ptr, 0);
986 (void)set_hero(user_ptr, randint1(20) + 20, FALSE);
987 (void)dispel_evil(user_ptr, user_ptr->lev * 3);
990 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
992 case ACT_DETECT_ALL_MONS:
993 (void)detect_monsters_invis(user_ptr, 255);
994 (void)detect_monsters_normal(user_ptr, 255);
996 case ACT_ULTIMATE_RESIST: {
997 TIME_EFFECT v = randint1(25) + 25;
998 (void)set_afraid(user_ptr, 0);
999 (void)set_hero(user_ptr, v, FALSE);
1000 (void)hp_player(user_ptr, 10);
1001 (void)set_blessed(user_ptr, v, FALSE);
1002 (void)set_oppose_acid(user_ptr, v, FALSE);
1003 (void)set_oppose_elec(user_ptr, v, FALSE);
1004 (void)set_oppose_fire(user_ptr, v, FALSE);
1005 (void)set_oppose_cold(user_ptr, v, FALSE);
1006 (void)set_oppose_pois(user_ptr, v, FALSE);
1007 (void)set_ultimate_res(user_ptr, v, FALSE);
1011 cosmic_cast_off(user_ptr, o_ptr);
1013 case ACT_FALLING_STAR:
1014 msg_print(_("あなたは妖刀に魅入られた…", "You are enchanted by cursed blade..."));
1015 msg_print(_("「狂ほしく 血のごとき 月はのぼれり 秘めおきし 魔剣 いずこぞや」", "'Behold the blade arts.'"));
1018 case ACT_GRAND_CROSS:
1019 msg_print(_("「闇に還れ!」", "You say, 'Return to darkness!'"));
1020 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);
1022 case ACT_TELEPORT_LEVEL:
1023 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)")))
1026 teleport_level(user_ptr, 0);
1028 case ACT_STRAIN_HASTE:
1029 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1030 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
1031 (void)set_fast(user_ptr, user_ptr->fast + 25 + randint1(25), FALSE);
1034 return fishing(user_ptr);
1036 mitokohmon(user_ptr);
1039 if (o_ptr->name1 != ART_MURAMASA)
1042 if (!get_check(_("本当に使いますか?", "Are you sure?!")))
1045 msg_print(_("村正が震えた...", "The Muramasa pulsates..."));
1046 do_inc_stat(user_ptr, A_STR);
1048 msg_print(_("村正は壊れた!", "The Muramasa is destroyed!"));
1049 curse_weapon_object(user_ptr, TRUE, o_ptr);
1053 case ACT_BLOODY_MOON:
1054 if (o_ptr->name1 != ART_BLOOD)
1057 msg_print(_("鎌が明るく輝いた...", "Your scythe glows brightly!"));
1058 get_bloody_moon_flags(o_ptr);
1059 if (user_ptr->prace == RACE_ANDROID)
1060 calc_android_exp(user_ptr);
1062 user_ptr->update |= (PU_BONUS | PU_HP);
1065 if (o_ptr->name1 != ART_CRIMSON)
1068 msg_print(_("せっかくだから『クリムゾン』をぶっぱなすぜ!", "I'll fire CRIMSON! SEKKAKUDAKARA!"));
1069 return fire_crimson(user_ptr);
1071 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);
1077 * @brief アイテムの発動効果を処理する。
1078 * @param user_ptr プレーヤーへの参照ポインタ
1079 * @param o_ptr 対象のオブジェクト構造体ポインタ
1080 * @return 発動実行の是非を返す。
1082 bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
1084 concptr name = k_name + k_info[o_ptr->k_idx].name;
1085 const activation_type *const act_ptr = find_activation_info(user_ptr, o_ptr);
1087 msg_print("Activation information is not found.");
1091 if (!switch_activation(user_ptr, o_ptr, act_ptr, name))
1094 if (act_ptr->timeout.constant >= 0) {
1095 o_ptr->timeout = (s16b)act_ptr->timeout.constant;
1096 if (act_ptr->timeout.dice > 0)
1097 o_ptr->timeout += randint1(act_ptr->timeout.dice);
1102 switch (act_ptr->index) {
1104 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250;
1107 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250;
1110 o_ptr->timeout = 3 * (user_ptr->lev + 10);
1115 msg_format("Special timeout is not implemented: %d.", act_ptr->index);