1 #include "realm/realm-demon.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "effect/attribute-types.h"
4 #include "monster-floor/monster-summon.h"
5 #include "monster-floor/place-monster-types.h"
6 #include "player-base/player-class.h"
7 #include "player-info/race-info.h"
8 #include "player/player-damage.h"
9 #include "spell-kind/spells-charm.h"
10 #include "spell-kind/spells-detection.h"
11 #include "spell-kind/spells-floor.h"
12 #include "spell-kind/spells-launcher.h"
13 #include "spell-kind/spells-pet.h"
14 #include "spell-kind/spells-sight.h"
15 #include "spell-realm/spells-demon.h"
16 #include "spell/spells-diceroll.h"
17 #include "spell/spells-object.h"
18 #include "spell/spells-status.h"
19 #include "spell/spells-summon.h"
20 #include "spell/summon-types.h"
21 #include "status/bad-status-setter.h"
22 #include "status/buff-setter.h"
23 #include "status/element-resistance.h"
24 #include "status/shape-changer.h"
25 #include "status/sight-setter.h"
26 #include "status/temporary-resistance.h"
27 #include "system/player-type-definition.h"
28 #include "target/target-getter.h"
29 #include "view/display-messages.h"
32 * @brief 悪魔領域魔法の各処理を行う
33 * @param player_ptr プレイヤーへの参照ポインタ
35 * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST)
36 * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列を返す。SpellProcessType::CAST時は std::nullopt を返す。
38 std::optional<std::string> do_daemon_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode)
40 bool name = mode == SpellProcessType::NAME;
41 bool desc = mode == SpellProcessType::DESCRIPTION;
42 bool info = mode == SpellProcessType::INFO;
43 bool cast = mode == SpellProcessType::CAST;
46 PLAYER_LEVEL plev = player_ptr->lev;
51 return _("マジック・ミサイル", "Magic Missile");
54 return _("弱い魔法の矢を放つ。", "Fires a weak bolt of magic.");
58 DICE_NUMBER dice = 3 + (plev - 1) / 5;
62 return info_damage(dice, sides, 0);
66 if (!get_aim_dir(player_ptr, &dir)) {
70 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::MISSILE, dir, damroll(dice, sides));
77 return _("無生命感知", "Detect Unlife");
80 return _("近くの生命のないモンスターを感知する。", "Detects all nonliving monsters in your vicinity.");
84 POSITION rad = DETECT_RAD_DEFAULT;
87 return info_radius(rad);
91 detect_monsters_nonliving(player_ptr, rad);
98 return _("邪なる祝福", "Evil Bless");
101 return _("一定時間、命中率とACにボーナスを得る。", "Gives a bonus to hit and AC for a few turns.");
108 return info_duration(base, base);
112 set_blessed(player_ptr, randint1(base) + base, false);
119 return _("耐火炎", "Resist Fire");
122 return _("一定時間、炎への耐性を得る。装備による耐性に累積する。",
123 "Gives resistance to fire, cold and electricity for a while. These resistances can be added to those from equipment for more powerful "
131 return info_duration(base, base);
135 set_oppose_fire(player_ptr, randint1(base) + base, false);
142 return _("恐慌", "Horrify");
145 return _("モンスター1体を恐怖させ、朦朧させる。抵抗されると無効。", "Attempts to scare and stun a monster.");
149 PLAYER_LEVEL power = plev;
152 return info_power(power);
156 if (!get_aim_dir(player_ptr, &dir)) {
160 fear_monster(player_ptr, dir, power);
161 stun_monster(player_ptr, dir, power);
168 return _("地獄の矢", "Nether Bolt");
171 return _("地獄のボルトもしくはビームを放つ。", "Fires a bolt or beam of nether.");
175 DICE_NUMBER dice = 6 + (plev - 5) / 4;
179 return info_damage(dice, sides, 0);
183 if (!get_aim_dir(player_ptr, &dir)) {
187 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::NETHER, dir, damroll(dice, sides));
194 return _("古代の死霊召喚", "Summon Manes");
197 return _("古代の死霊を召喚する。", "Summons one or more Manes.");
202 if (!summon_specific(player_ptr, -1, player_ptr->y, player_ptr->x, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET))) {
203 msg_print(_("古代の死霊は現れなかった。", "No Manes arrive."));
211 return _("地獄の焔", "Hellish Flame");
214 return _("邪悪な力を持つボールを放つ。善良なモンスターには大きなダメージを与える。", "Fires a ball of evil power. Hurts good monsters greatly.");
218 DICE_NUMBER dice = 3;
220 POSITION rad = (plev < 30) ? 2 : 3;
223 if (PlayerClass(player_ptr).is_wizard()) {
224 base = plev + plev / 2;
226 base = plev + plev / 4;
230 return info_damage(dice, sides, base);
234 if (!get_aim_dir(player_ptr, &dir)) {
238 fire_ball(player_ptr, AttributeType::HELL_FIRE, dir, damroll(dice, sides) + base, rad);
245 return _("デーモン支配", "Dominate Demon");
248 return _("悪魔1体を魅了する。抵抗されると無効", "Attempts to charm a demon.");
255 return info_power(power);
259 if (!get_aim_dir(player_ptr, &dir)) {
263 control_one_demon(player_ptr, dir, plev);
270 return _("ビジョン", "Vision");
273 return _("周辺の地形を感知する。", "Maps nearby area.");
277 POSITION rad = DETECT_RAD_MAP;
280 return info_radius(rad);
284 map_area(player_ptr, rad);
291 return _("耐地獄", "Resist Nether");
294 return _("一定時間、地獄への耐性を得る。", "Gives resistance to nether for a while.");
301 return info_duration(base, base);
305 set_tim_res_nether(player_ptr, randint1(base) + base, false);
312 return _("プラズマ・ボルト", "Plasma bolt");
315 return _("プラズマのボルトもしくはビームを放つ。", "Fires a bolt or beam of plasma.");
319 DICE_NUMBER dice = 11 + (plev - 5) / 4;
323 return info_damage(dice, sides, 0);
327 if (!get_aim_dir(player_ptr, &dir)) {
331 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::PLASMA, dir, damroll(dice, sides));
338 return _("ファイア・ボール", "Fire Ball");
341 return _("炎の球を放つ。", "Fires a ball of fire.");
349 return info_damage(0, 0, dam);
353 if (!get_aim_dir(player_ptr, &dir)) {
357 fire_ball(player_ptr, AttributeType::FIRE, dir, dam, rad);
364 return _("炎の刃", "Fire Branding");
367 return _("武器に炎の属性をつける。", "Makes current weapon fire branded.");
372 brand_weapon(player_ptr, 1);
379 return _("地獄球", "Nether Ball");
382 return _("大きな地獄の球を放つ。", "Fires a huge ball of nether.");
386 int dam = plev * 3 / 2 + 100;
387 POSITION rad = plev / 20 + 2;
390 return info_damage(0, 0, dam);
394 if (!get_aim_dir(player_ptr, &dir)) {
398 fire_ball(player_ptr, AttributeType::NETHER, dir, dam, rad);
405 return _("デーモン召喚", "Summon Demon");
408 return _("悪魔1体を召喚する。", "Summons a demon.");
413 cast_summon_demon(player_ptr, plev * 2 / 3 + randint1(plev / 2));
420 return _("悪魔の目", "Devilish Eye");
423 return _("一定時間、テレパシー能力を得る。", "Gives telepathy for a while.");
431 return info_duration(base, sides);
435 set_tim_esp(player_ptr, randint1(sides) + base, false);
442 return _("悪魔のクローク", "Devil Cloak");
446 return _("恐怖を取り除き、一定時間、炎と冷気の耐性、炎のオーラを得る。耐性は装備による耐性に累積する。",
447 "Removes fear. Gives resistance to fire and cold, and aura of fire. These resistances can be added to those from equipment for more powerful "
451 TIME_EFFECT base = 20;
453 return info_duration(base, base);
457 TIME_EFFECT dur = randint1(base) + base;
458 set_oppose_fire(player_ptr, dur, false);
459 set_oppose_cold(player_ptr, dur, false);
460 set_tim_sh_fire(player_ptr, dur, false);
461 (void)BadStatusSetter(player_ptr).set_fear(0);
469 return _("溶岩流", "Lava Flow");
472 return _("自分を中心とした炎の球を作り出し、床を溶岩に変える。", "Generates a ball of fire centered on you which transforms floors to magma.");
476 int dam = (55 + plev) * 2;
480 return info_damage(0, 0, dam / 2);
484 fire_ball(player_ptr, AttributeType::FIRE, 0, dam, rad);
485 fire_ball_hide(player_ptr, AttributeType::LAVA_FLOW, 0, 2 + randint1(2), rad);
492 return _("プラズマ球", "Plasma Ball");
495 return _("プラズマの球を放つ。", "Fires a ball of plasma.");
499 int dam = plev * 3 / 2 + 80;
500 POSITION rad = 2 + plev / 40;
503 return info_damage(0, 0, dam);
507 if (!get_aim_dir(player_ptr, &dir)) {
511 fire_ball(player_ptr, AttributeType::PLASMA, dir, dam, rad);
518 return _("悪魔変化", "Polymorph Demon");
521 return _("一定時間、悪魔に変化する。変化している間は本来の種族の能力を失い、代わりに悪魔としての能力を得る。",
522 "Causes you to mimic a demon for a while. You lose the abilities of your original race and get the abilities of a demon for that time.");
526 int base = 10 + plev / 2;
529 return info_duration(base, base);
533 set_mimic(player_ptr, base + randint1(base), MimicKindType::DEMON, false);
540 return _("地獄の波動", "Nether Wave");
543 return _("視界内の全てのモンスターにダメージを与える。善良なモンスターに特に大きなダメージを与える。",
544 "Damages all monsters in sight. Hurts good monsters greatly.");
548 int sides1 = plev * 2;
549 int sides2 = plev * 2;
552 return format("%sd%d+d%d", KWD_DAM, sides1, sides2);
556 dispel_monsters(player_ptr, randint1(sides1));
557 dispel_good(player_ptr, randint1(sides2));
564 return _("サキュバスの接吻", "Succubus's Kiss");
567 return _("因果混乱の球を放つ。", "Fires a ball of nexus.");
571 int dam = 100 + plev * 2;
575 return info_damage(0, 0, dam);
579 if (!get_aim_dir(player_ptr, &dir)) {
582 fire_ball(player_ptr, AttributeType::NEXUS, dir, dam, rad);
589 return _("破滅の手", "Doom Hand");
592 return _("破滅の手を放つ。食らったモンスターはそのときのHPの半分前後のダメージを受ける。", "Attempts to cut a monster's HP roughly in half.");
597 if (!get_aim_dir(player_ptr, &dir)) {
600 msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!"));
603 fire_ball_hide(player_ptr, AttributeType::HAND_DOOM, dir, plev * 2, 0);
610 return _("士気高揚", "Raise the Morale");
613 return _("一定時間、ヒーロー気分になる。", "Removes fear. Gives a bonus to hit for a while. Heals you for 10 HP.");
619 return info_duration(base, base);
622 heroism(player_ptr, base);
629 return _("不滅の肉体", "Immortal Body");
632 return _("一定時間、時間逆転への耐性を得る。", "Gives resistance to time for a while.");
639 return info_duration(base, base);
643 set_tim_res_time(player_ptr, randint1(base) + base, false);
650 return _("狂気の円環", "Insanity Circle");
653 return _("自分を中心としたカオスの球、混乱の球を発生させ、近くのモンスターを魅了する。",
654 "Generates balls of chaos, confusion and charm centered on you.");
659 int power = 20 + plev;
660 POSITION rad = 3 + plev / 20;
663 return format("%s%d+%d", KWD_DAM, dam / 2, dam / 2);
667 fire_ball(player_ptr, AttributeType::CHAOS, 0, dam, rad);
668 fire_ball(player_ptr, AttributeType::CONFUSION, 0, dam, rad);
669 fire_ball(player_ptr, AttributeType::CHARM, 0, power, rad);
676 return _("ペット爆破", "Explode Pets");
679 return _("全てのペットを強制的に爆破させる。", "Makes all pets explode.");
684 discharge_minion(player_ptr);
691 return _("グレーターデーモン召喚", "Summon Greater Demon");
694 return _("上級デーモンを召喚する。召喚するには人間('p','h','t'で表されるモンスター)の死体を捧げなければならない。",
695 "Summons greater demon. Requires the sacrifice of a human corpse ('p', 'h' or 't').");
700 if (!cast_summon_greater_demon(player_ptr)) {
709 return _("地獄嵐", "Nether Storm");
712 return _("超巨大な地獄の球を放つ。", "Generates a huge ball of nether.");
717 POSITION rad = plev / 5;
720 return info_damage(0, 0, dam);
724 if (!get_aim_dir(player_ptr, &dir)) {
728 fire_ball(player_ptr, AttributeType::NETHER, dir, dam, rad);
735 return _("血の呪い", "Bloody Curse");
738 return _("自分がダメージを受けることによって対象に呪いをかけ、ダメージを与え様々な効果を引き起こす。",
739 "Puts blood curse, which damages and causes various effects, on a monster. You also take damage.");
747 return info_damage(0, 0, dam);
751 if (!get_aim_dir(player_ptr, &dir)) {
755 fire_ball_hide(player_ptr, AttributeType::BLOOD_CURSE, dir, dam, rad);
756 take_hit(player_ptr, DAMAGE_USELIFE, 20 + randint1(30), _("血の呪い", "Blood curse"));
763 return _("魔王変化", "Polymorph Demonlord");
766 return _("悪魔の王に変化する。変化している間は本来の種族の能力を失い、代わりに悪魔の王としての能力を得、壁を破壊しながら歩く。",
767 "Causes you to mimic a demon lord for a while. You lose the abilities of your original race and get the great abilities of a demon lord for "
768 "that time. Even hard walls can't stop your walking.");
775 return info_duration(base, base);
779 set_mimic(player_ptr, base + randint1(base), MimicKindType::DEMON_LORD, false);