1 #include "cmd-action/cmd-spell.h"
2 #include "core/hp-mp-processor.h"
3 #include "core/player-redraw-types.h"
4 #include "core/player-update-types.h"
5 #include "core/window-redrawer.h"
6 #include "effect/effect-characteristics.h"
7 #include "effect/effect-processor.h"
8 #include "player/attack-defense-types.h"
9 #include "player/player-class.h"
10 #include "realm/realm-song-numbers.h"
11 #include "spell-kind/earthquake.h"
12 #include "spell-kind/spells-detection.h"
13 #include "spell-kind/spells-floor.h"
14 #include "spell-kind/spells-grid.h"
15 #include "spell-kind/spells-launcher.h"
16 #include "spell-kind/spells-lite.h"
17 #include "spell-kind/spells-neighbor.h"
18 #include "spell-kind/spells-sight.h"
19 #include "spell-kind/spells-world.h"
20 #include "spell/spell-types.h"
21 #include "spell/spells-status.h"
22 #include "status/action-setter.h"
23 #include "status/bad-status-setter.h"
24 #include "status/experience.h"
25 #include "target/target-getter.h"
26 #include "view/display-messages.h"
29 * @brief 歌の開始を処理する / Start singing if the player is a Bard
30 * @param spell 領域魔法としてのID
34 static void start_singing(player_type *caster_ptr, SPELL_IDX spell, MAGIC_NUM1 song)
36 /* Remember the song index */
37 SINGING_SONG_EFFECT(caster_ptr) = (MAGIC_NUM1)song;
39 /* Remember the index of the spell which activated the song */
40 SINGING_SONG_ID(caster_ptr) = (MAGIC_NUM2)spell;
42 /* Now the player is singing */
43 set_action(caster_ptr, ACTION_SING);
45 caster_ptr->update |= (PU_BONUS);
46 caster_ptr->redraw |= (PR_STATUS);
51 * @param caster_ptr プレーヤーへの参照ポインタ
53 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST / SPELL_FAIL / SPELL_CONT / SPELL_STOP)
54 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST / SPELL_FAIL / SPELL_CONT / SPELL_STOP 時はNULL文字列を返す。
56 concptr do_music_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
58 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
59 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
60 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
61 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
62 bool fail = (mode == SPELL_FAIL) ? TRUE : FALSE;
63 bool cont = (mode == SPELL_CONT) ? TRUE : FALSE;
64 bool stop = (mode == SPELL_STOP) ? TRUE : FALSE;
67 PLAYER_LEVEL plev = caster_ptr->lev;
72 return _("遅鈍の歌", "Song of Holding");
74 return _("視界内の全てのモンスターを減速させる。抵抗されると無効。", "Attempts to slow all monsters in sight.");
76 /* Stop singing before start another */
78 stop_singing(caster_ptr);
81 msg_print(_("ゆっくりとしたメロディを口ずさみ始めた...", "You start humming a slow, steady melody..."));
82 start_singing(caster_ptr, spell, MUSIC_SLOW);
89 return info_power(power);
92 slow_monsters(caster_ptr, plev);
99 return _("祝福の歌", "Song of Blessing");
101 return _("命中率とACのボーナスを得る。", "Gives a bonus to hit and AC for a few turns.");
103 /* Stop singing before start another */
105 stop_singing(caster_ptr);
108 msg_print(_("厳かなメロディを奏で始めた...", "The holy power of the Music of the Ainur enters you..."));
109 start_singing(caster_ptr, spell, MUSIC_BLESS);
113 if (!caster_ptr->blessed) {
114 msg_print(_("高潔な気分が消え失せた。", "The prayer has expired."));
122 return _("崩壊の音色", "Wrecking Note");
124 return _("轟音のボルトを放つ。", "Fires a bolt of sound.");
126 /* Stop singing before start another */
128 stop_singing(caster_ptr);
131 DICE_NUMBER dice = 4 + (plev - 1) / 5;
135 return info_damage(dice, sides, 0);
138 if (!get_aim_dir(caster_ptr, &dir))
141 fire_bolt(caster_ptr, GF_SOUND, dir, damroll(dice, sides));
148 return _("朦朧の旋律", "Stun Pattern");
150 return _("視界内の全てのモンスターを朦朧させる。抵抗されると無効。", "Attempts to stun all monsters in sight.");
152 /* Stop singing before start another */
154 stop_singing(caster_ptr);
157 msg_print(_("眩惑させるメロディを奏で始めた...", "You weave a pattern of sounds to bewilder and daze..."));
158 start_singing(caster_ptr, spell, MUSIC_STUN);
162 DICE_NUMBER dice = plev / 10;
166 return info_power_dice(dice, sides);
169 stun_monsters(caster_ptr, damroll(dice, sides));
177 return _("生命の流れ", "Flow of Life");
179 return _("体力を少し回復させる。", "Heals HP a little.");
181 /* Stop singing before start another */
183 stop_singing(caster_ptr);
186 msg_print(_("歌を通して体に活気が戻ってきた...", "Life flows through you as you sing a song of healing..."));
187 start_singing(caster_ptr, spell, MUSIC_L_LIFE);
191 DICE_NUMBER dice = 2;
195 return info_heal(dice, sides, 0);
198 hp_player(caster_ptr, damroll(dice, sides));
206 return _("太陽の歌", "Song of the Sun");
208 return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
210 /* Stop singing before start another */
212 stop_singing(caster_ptr);
215 DICE_NUMBER dice = 2;
216 DICE_SID sides = plev / 2;
217 POSITION rad = plev / 10 + 1;
220 return info_damage(dice, sides, 0);
223 msg_print(_("光り輝く歌が辺りを照らした。", "Your uplifting song brings brightness to dark places..."));
224 lite_area(caster_ptr, damroll(dice, sides), rad);
231 return _("恐怖の歌", "Song of Fear");
233 return _("視界内の全てのモンスターを恐怖させる。抵抗されると無効。", "Attempts to scare all monsters in sight.");
235 /* Stop singing before start another */
237 stop_singing(caster_ptr);
240 msg_print(_("おどろおどろしいメロディを奏で始めた...", "You start weaving a fearful pattern..."));
241 start_singing(caster_ptr, spell, MUSIC_FEAR);
248 return info_power(power);
251 project_all_los(caster_ptr, GF_TURN_ALL, power);
259 return _("戦いの歌", "Heroic Ballad");
261 return _("ヒーロー気分になる。", "Removes fear. Gives a bonus to hit for a while. Heals you for 10 HP.");
263 /* Stop singing before start another */
265 stop_singing(caster_ptr);
268 msg_print(_("激しい戦いの歌を歌った...", "You start singing a song of intense fighting..."));
270 (void)hp_player(caster_ptr, 10);
271 (void)set_afraid(caster_ptr, 0);
273 /* Recalculate hitpoints */
274 caster_ptr->update |= (PU_HP);
276 start_singing(caster_ptr, spell, MUSIC_HERO);
280 if (!caster_ptr->hero) {
281 msg_print(_("ヒーローの気分が消え失せた。", "The heroism wears off."));
282 /* Recalculate hitpoints */
283 caster_ptr->update |= (PU_HP);
291 return _("霊的知覚", "Clairaudience");
294 "階段を感知する。レベル15で全てのモンスター、20で財宝とアイテムを感知できるようになる。レベル25で周辺の地形を感知し、40でその階全体を永久"
295 "に照らし、ダンジョン内のすべてのアイテムを感知する。この効果は歌い続けることで順に起こる。",
296 "Detects traps, doors and stairs in your vicinity. And detects all monsters at level 15, treasures and items at level 20. Maps nearby area at "
297 "level 25. Lights and know the whole level at level 40. These effects accumulate as the song continues.");
299 /* Stop singing before start another */
301 stop_singing(caster_ptr);
304 msg_print(_("静かな音楽が感覚を研ぎ澄まさせた...", "Your quiet music sharpens your sense of hearing..."));
305 /* Hack -- Initialize the turn count */
306 SINGING_COUNT(caster_ptr) = 0;
307 start_singing(caster_ptr, spell, MUSIC_DETECT);
311 POSITION rad = DETECT_RAD_DEFAULT;
314 return info_radius(rad);
317 int count = SINGING_COUNT(caster_ptr);
320 wiz_lite(caster_ptr, FALSE);
322 map_area(caster_ptr, rad);
323 if (plev > 39 && count < 19)
324 SINGING_COUNT(caster_ptr) = count + 1;
327 /* There are too many hidden treasure. So... */
328 /* detect_treasure(rad); */
329 detect_objects_gold(caster_ptr, rad);
330 detect_objects_normal(caster_ptr, rad);
332 if (plev > 24 && count < 11)
333 SINGING_COUNT(caster_ptr) = count + 1;
336 detect_monsters_invis(caster_ptr, rad);
337 detect_monsters_normal(caster_ptr, rad);
339 if (plev > 19 && count < A_MAX)
340 SINGING_COUNT(caster_ptr) = count + 1;
342 detect_traps(caster_ptr, rad, TRUE);
343 detect_doors(caster_ptr, rad);
344 detect_stairs(caster_ptr, rad);
346 if (plev > 14 && count < 3)
347 SINGING_COUNT(caster_ptr) = count + 1;
355 return _("魂の歌", "Soul Shriek");
357 return _("視界内の全てのモンスターに対して精神攻撃を行う。", "Damages all monsters in sight with PSI damages.");
359 /* Stop singing before start another */
361 stop_singing(caster_ptr);
364 msg_print(_("精神を捻じ曲げる歌を歌った...", "You start singing a song of soul in pain..."));
365 start_singing(caster_ptr, spell, MUSIC_PSI);
369 DICE_NUMBER dice = 1;
370 DICE_SID sides = plev * 3 / 2;
373 return info_damage(dice, sides, 0);
376 project_all_los(caster_ptr, GF_PSI, damroll(dice, sides));
384 return _("知識の歌", "Song of Lore");
386 return _("自分のいるマスと隣りのマスに落ちているアイテムを鑑定する。", "Identifies all items which are in the adjacent squares.");
388 /* Stop singing before start another */
390 stop_singing(caster_ptr);
393 msg_print(_("この世界の知識が流れ込んできた...", "You recall the rich lore of the world..."));
394 start_singing(caster_ptr, spell, MUSIC_ID);
401 return info_radius(rad);
405 * MP不足で鑑定が発動される前に歌が中断してしまうのを防止。
408 project(caster_ptr, 0, rad, caster_ptr->y, caster_ptr->x, 0, GF_IDENTIFY, PROJECT_ITEM, -1);
416 return _("隠遁の歌", "Hiding Tune");
418 return _("隠密行動能力を上昇させる。", "Gives improved stealth.");
420 /* Stop singing before start another */
422 stop_singing(caster_ptr);
425 msg_print(_("あなたの姿が景色にとけこんでいった...", "Your song carries you beyond the sight of mortal eyes..."));
426 start_singing(caster_ptr, spell, MUSIC_STEALTH);
430 if (!caster_ptr->tim_stealth) {
431 msg_print(_("姿がはっきりと見えるようになった。", "You are no longer hidden."));
439 return _("幻影の旋律", "Illusion Pattern");
441 return _("視界内の全てのモンスターを混乱させる。抵抗されると無効。", "Attempts to confuse all monsters in sight.");
443 /* Stop singing before start another */
445 stop_singing(caster_ptr);
448 msg_print(_("辺り一面に幻影が現れた...", "You weave a pattern of sounds to beguile and confuse..."));
449 start_singing(caster_ptr, spell, MUSIC_CONF);
453 POWER power = plev * 2;
456 return info_power(power);
459 confuse_monsters(caster_ptr, power);
467 return _("破滅の叫び", "Doomcall");
469 return _("視界内の全てのモンスターに対して轟音攻撃を行う。", "Damages all monsters in sight with booming sound.");
471 /* Stop singing before start another */
473 stop_singing(caster_ptr);
476 msg_print(_("轟音が響いた...", "The fury of the Downfall of Numenor lashes out..."));
477 start_singing(caster_ptr, spell, MUSIC_SOUND);
481 DICE_NUMBER dice = 10 + plev / 5;
485 return info_damage(dice, sides, 0);
488 project_all_los(caster_ptr, GF_SOUND, damroll(dice, sides));
496 return _("フィリエルの歌", "Firiel's Song");
498 return _("周囲の死体や骨を生き返す。", "Resurrects nearby corpses and skeletons. And makes them your pets.");
501 /* Stop singing before start another */
503 stop_singing(caster_ptr);
506 msg_print(_("生命と復活のテーマを奏で始めた...", "The themes of life and revival are woven into your song..."));
507 animate_dead(caster_ptr, 0, caster_ptr->y, caster_ptr->x);
514 return _("旅の仲間", "Fellowship Chant");
516 return _("視界内の全てのモンスターを魅了する。抵抗されると無効。", "Attempts to charm all monsters in sight.");
518 /* Stop singing before start another */
520 stop_singing(caster_ptr);
523 msg_print(_("安らかなメロディを奏で始めた...", "You weave a slow, soothing melody of imploration..."));
524 start_singing(caster_ptr, spell, MUSIC_CHARM);
528 DICE_NUMBER dice = 10 + plev / 15;
532 return info_power_dice(dice, sides);
535 charm_monsters(caster_ptr, damroll(dice, sides));
543 return _("分解音波", "Sound of disintegration");
545 return _("壁を掘り進む。自分の足元のアイテムは蒸発する。", "Makes you be able to burrow into walls. Objects under your feet evaporate.");
547 /* Stop singing before start another */
549 stop_singing(caster_ptr);
552 msg_print(_("粉砕するメロディを奏で始めた...", "You weave a violent pattern of sounds to break walls."));
553 start_singing(caster_ptr, spell, MUSIC_WALL);
559 * MP不足で効果が発動される前に歌が中断してしまうのを防止。
562 project(caster_ptr, 0, 0, caster_ptr->y, caster_ptr->x, 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
569 return _("元素耐性", "Finrod's Resistance");
571 return _("酸、電撃、炎、冷気、毒に対する耐性を得る。装備による耐性に累積する。",
572 "Gives resistance to fire, cold, electricity, acid and poison. These resistances can be added to those from equipment for more powerful "
575 /* Stop singing before start another */
577 stop_singing(caster_ptr);
580 msg_print(_("元素の力に対する忍耐の歌を歌った。", "You sing a song of perseverance against powers..."));
581 start_singing(caster_ptr, spell, MUSIC_RESIST);
585 if (!caster_ptr->oppose_acid) {
586 msg_print(_("酸への耐性が薄れた気がする。", "You feel less resistant to acid."));
589 if (!caster_ptr->oppose_elec) {
590 msg_print(_("電撃への耐性が薄れた気がする。", "You feel less resistant to elec."));
593 if (!caster_ptr->oppose_fire) {
594 msg_print(_("火への耐性が薄れた気がする。", "You feel less resistant to fire."));
597 if (!caster_ptr->oppose_cold) {
598 msg_print(_("冷気への耐性が薄れた気がする。", "You feel less resistant to cold."));
601 if (!caster_ptr->oppose_pois) {
602 msg_print(_("毒への耐性が薄れた気がする。", "You feel less resistant to pois."));
610 return _("ホビットのメロディ", "Hobbit Melodies");
612 return _("加速する。", "Hastes you.");
614 /* Stop singing before start another */
616 stop_singing(caster_ptr);
619 msg_print(_("軽快な歌を口ずさみ始めた...", "You start singing a joyful pop song..."));
620 start_singing(caster_ptr, spell, MUSIC_SPEED);
624 if (!caster_ptr->fast) {
625 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
633 return _("歪んだ世界", "World Contortion");
635 return _("近くのモンスターをテレポートさせる。抵抗されると無効。", "Teleports all nearby monsters away unless resisted.");
638 POSITION rad = plev / 15 + 1;
639 POWER power = plev * 3 + 1;
642 return info_radius(rad);
644 /* Stop singing before start another */
646 stop_singing(caster_ptr);
649 msg_print(_("歌が空間を歪めた...", "Reality whirls wildly as you sing a dizzying melody..."));
650 project(caster_ptr, 0, rad, caster_ptr->y, caster_ptr->x, power, GF_AWAY_ALL, PROJECT_KILL, -1);
657 return _("退散の歌", "Dispelling chant");
659 return _("視界内の全てのモンスターにダメージを与える。邪悪なモンスターに特に大きなダメージを与える。",
660 "Damages all monsters in sight. Hurts evil monsters greatly.");
662 /* Stop singing before start another */
664 stop_singing(caster_ptr);
667 msg_print(_("耐えられない不協和音が敵を責め立てた...", "You cry out in an ear-wracking voice..."));
668 start_singing(caster_ptr, spell, MUSIC_DISPEL);
672 DICE_SID m_sides = plev * 3;
673 DICE_SID e_sides = plev * 3;
676 return format("%s1d%d+1d%d", KWD_DAM, m_sides, e_sides);
679 dispel_monsters(caster_ptr, randint1(m_sides));
680 dispel_evil(caster_ptr, randint1(e_sides));
687 return _("サルマンの甘言", "The Voice of Saruman");
689 return _("視界内の全てのモンスターを減速させ、眠らせようとする。抵抗されると無効。", "Attempts to slow and put to sleep all monsters in sight.");
691 /* Stop singing before start another */
693 stop_singing(caster_ptr);
696 msg_print(_("優しく、魅力的な歌を口ずさみ始めた...", "You start humming a gentle and attractive song..."));
697 start_singing(caster_ptr, spell, MUSIC_SARUMAN);
704 return info_power(power);
707 slow_monsters(caster_ptr, plev);
708 sleep_monsters(caster_ptr, plev);
716 return _("嵐の音色", "Song of the Tempest");
718 return _("轟音のビームを放つ。", "Fires a beam of sound.");
721 DICE_NUMBER dice = 15 + (plev - 1) / 2;
725 return info_damage(dice, sides, 0);
727 /* Stop singing before start another */
729 stop_singing(caster_ptr);
732 if (!get_aim_dir(caster_ptr, &dir))
735 fire_beam(caster_ptr, GF_SOUND, dir, damroll(dice, sides));
742 return _("もう一つの世界", "Ambarkanta");
744 return _("現在の階を再構成する。", "Recreates current dungeon level.");
751 return info_delay(base, sides);
753 /* Stop singing before start another */
755 stop_singing(caster_ptr);
758 msg_print(_("周囲が変化し始めた...", "You sing of the primeval shaping of Middle-earth..."));
759 reserve_alter_reality(caster_ptr, randint0(sides) + base);
766 return _("破壊の旋律", "Wrecking Pattern");
769 "周囲のダンジョンを揺らし、壁と床をランダムに入れ変える。", "Shakes dungeon structure, and results in random swapping of floors and walls.");
771 /* Stop singing before start another */
773 stop_singing(caster_ptr);
776 msg_print(_("破壊的な歌が響きわたった...", "You weave a pattern of sounds to contort and shatter..."));
777 start_singing(caster_ptr, spell, MUSIC_QUAKE);
784 return info_radius(rad);
787 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 10, 0);
795 return _("停滞の歌", "Stationary Shriek");
797 return _("視界内の全てのモンスターを麻痺させようとする。抵抗されると無効。", "Attempts to freeze all monsters in sight.");
799 /* Stop singing before start another */
801 stop_singing(caster_ptr);
804 msg_print(_("ゆっくりとしたメロディを奏で始めた...", "You weave a very slow pattern which is almost likely to stop..."));
805 start_singing(caster_ptr, spell, MUSIC_STASIS);
809 POWER power = plev * 4;
812 return info_power(power);
815 stasis_monsters(caster_ptr, power);
823 return _("守りの歌", "Endurance");
825 return _("自分のいる床の上に、モンスターが通り抜けたり召喚されたりすることができなくなるルーンを描く。",
826 "Sets a glyph on the floor beneath you. If you are on a glyph, monsters cannot attack you but can try to break the glyph.");
829 /* Stop singing before start another */
831 stop_singing(caster_ptr);
834 msg_print(_("歌が神聖な場を作り出した...", "The holy power of the Music is creating sacred field..."));
835 warding_glyph(caster_ptr);
842 return _("英雄の詩", "The Hero's Poem");
844 return _("加速し、ヒーロー気分になり、視界内の全てのモンスターにダメージを与える。", "Hastes you. Gives heroism. Damages all monsters in sight.");
846 /* Stop singing before start another */
848 stop_singing(caster_ptr);
851 msg_print(_("英雄の歌を口ずさんだ...", "You chant a powerful, heroic call to arms..."));
852 (void)hp_player(caster_ptr, 10);
853 (void)set_afraid(caster_ptr, 0);
855 /* Recalculate hitpoints */
856 caster_ptr->update |= (PU_HP);
858 start_singing(caster_ptr, spell, MUSIC_SHERO);
862 if (!caster_ptr->hero) {
863 msg_print(_("ヒーローの気分が消え失せた。", "The heroism wears off."));
864 /* Recalculate hitpoints */
865 caster_ptr->update |= (PU_HP);
868 if (!caster_ptr->fast) {
869 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
874 DICE_NUMBER dice = 1;
875 DICE_SID sides = plev * 3;
878 return info_damage(dice, sides, 0);
881 dispel_monsters(caster_ptr, damroll(dice, sides));
888 return _("ヤヴァンナの助け", "Relief of Yavanna");
890 return _("強力な回復の歌で、負傷と朦朧状態も全快する。", "Powerful healing song. Also completely heals cuts and being stunned.");
892 /* Stop singing before start another */
894 stop_singing(caster_ptr);
897 msg_print(_("歌を通して体に活気が戻ってきた...", "Life flows through you as you sing the song..."));
898 start_singing(caster_ptr, spell, MUSIC_H_LIFE);
902 DICE_NUMBER dice = 15;
906 return info_heal(dice, sides, 0);
909 hp_player(caster_ptr, damroll(dice, sides));
910 set_stun(caster_ptr, 0);
911 set_cut(caster_ptr, 0);
919 return _("再生の歌", "Goddess's rebirth");
921 return _("すべてのステータスと経験値を回復する。", "Restores all stats and experience.");
924 /* Stop singing before start another */
926 stop_singing(caster_ptr);
930 _("暗黒の中に光と美をふりまいた。体が元の活力を取り戻した。", "You strew light and beauty in the dark as you sing. You feel refreshed."));
931 (void)restore_all_status(caster_ptr);
932 (void)restore_level(caster_ptr);
939 return _("サウロンの魔術", "Wizardry of Sauron");
941 return _("非常に強力でごく小さい轟音の球を放つ。", "Fires an extremely powerful tiny ball of sound.");
944 DICE_NUMBER dice = 50 + plev;
949 return info_damage(dice, sides, 0);
951 /* Stop singing before start another */
953 stop_singing(caster_ptr);
956 if (!get_aim_dir(caster_ptr, &dir))
959 fire_ball(caster_ptr, GF_SOUND, dir, damroll(dice, sides), rad);
966 return _("フィンゴルフィンの挑戦", "Fingolfin's Challenge");
968 return _("ダメージを受けなくなるバリアを張る。", "Generates a barrier which completely protects you from almost all damage.");
970 /* Stop singing before start another */
972 stop_singing(caster_ptr);
975 msg_print(_("フィンゴルフィンの冥王への挑戦を歌った...", "You recall the valor of Fingolfin's challenge to the Dark Lord..."));
977 caster_ptr->redraw |= (PR_MAP);
978 caster_ptr->update |= (PU_MONSTERS);
979 caster_ptr->window_flags |= (PW_OVERHEAD | PW_DUNGEON);
981 start_singing(caster_ptr, spell, MUSIC_INVULN);
985 if (!caster_ptr->invuln) {
986 msg_print(_("無敵ではなくなった。", "The invulnerability wears off."));
988 caster_ptr->redraw |= (PR_MAP);
989 caster_ptr->update |= (PU_MONSTERS);
990 caster_ptr->window_flags |= (PW_OVERHEAD | PW_DUNGEON);