1 #include "realm/realm-death.h"
2 #include "avatar/avatar.h"
3 #include "cmd-action/cmd-spell.h"
4 #include "effect/effect-characteristics.h"
5 #include "effect/effect-processor.h"
6 #include "hpmp/hp-mp-processor.h"
7 #include "player-base/player-class.h"
8 #include "player-info/race-info.h"
9 #include "player/digestion-processor.h"
10 #include "player/player-damage.h"
11 #include "spell-kind/spells-charm.h"
12 #include "spell-kind/spells-detection.h"
13 #include "spell-kind/spells-genocide.h"
14 #include "spell-kind/spells-launcher.h"
15 #include "spell-kind/spells-neighbor.h"
16 #include "spell-kind/spells-perception.h"
17 #include "spell-kind/spells-sight.h"
18 #include "spell-kind/spells-specific-bolt.h"
19 #include "spell/spells-diceroll.h"
20 #include "spell/spells-object.h"
21 #include "spell/spells-status.h"
22 #include "spell/spells-summon.h"
23 #include "status/buff-setter.h"
24 #include "status/element-resistance.h"
25 #include "status/experience.h"
26 #include "status/shape-changer.h"
27 #include "system/player-type-definition.h"
28 #include "target/target-getter.h"
31 * @brief 暗黒領域魔法の各処理を行う
32 * @param player_ptr プレイヤーへの参照ポインタ
34 * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST)
35 * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列を返す。SpellProcessType::CAST時は std::nullopt を返す。
37 std::optional<std::string> do_death_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode)
39 bool name = mode == SpellProcessType::NAME;
40 bool desc = mode == SpellProcessType::DESCRIPTION;
41 bool info = mode == SpellProcessType::INFO;
42 bool cast = mode == SpellProcessType::CAST;
45 PLAYER_LEVEL plev = player_ptr->lev;
50 return _("無生命感知", "Detect Unlife");
53 return _("近くの生命のないモンスターを感知する。", "Detects all nonliving monsters in your vicinity.");
57 POSITION rad = DETECT_RAD_DEFAULT;
60 return info_radius(rad);
64 detect_monsters_nonliving(player_ptr, rad);
71 return _("呪殺弾", "Malediction");
74 return _("ごく小さな邪悪な力を持つボールを放つ。善良なモンスターには大きなダメージを与える。",
75 "Fires a tiny ball of evil power which hurts good monsters greatly.");
79 DICE_NUMBER dice = 3 + (plev - 1) / 5;
84 return info_damage(dice, sides, 0);
88 if (!get_aim_dir(player_ptr, &dir)) {
93 * A radius-0 ball may (1) be aimed at
94 * objects etc., and will affect them;
95 * (2) may be aimed at ANY visible
96 * monster, unlike a 'bolt' which must
97 * travel to the monster.
100 fire_ball(player_ptr, AttributeType::HELL_FIRE, dir, damroll(dice, sides), rad);
103 /* Special effect first */
104 int effect = randint1(1000);
107 fire_ball_hide(player_ptr, AttributeType::DEATH_RAY, dir, plev * 200, 0);
108 } else if (effect < 500) {
109 fire_ball_hide(player_ptr, AttributeType::TURN_ALL, dir, plev, 0);
110 } else if (effect < 800) {
111 fire_ball_hide(player_ptr, AttributeType::OLD_CONF, dir, plev, 0);
113 fire_ball_hide(player_ptr, AttributeType::STUN, dir, plev, 0);
122 return _("邪悪感知", "Detect Evil");
125 return _("近くの邪悪なモンスターを感知する。", "Detects all evil monsters in your vicinity.");
129 POSITION rad = DETECT_RAD_DEFAULT;
132 return info_radius(rad);
136 detect_monsters_evil(player_ptr, rad);
143 return _("悪臭雲", "Stinking Cloud");
146 return _("毒の球を放つ。", "Fires a ball of poison.");
150 int dam = 10 + plev / 2;
154 return info_damage(0, 0, dam);
158 if (!get_aim_dir(player_ptr, &dir)) {
162 fire_ball(player_ptr, AttributeType::POIS, dir, dam, rad);
169 return _("黒い眠り", "Black Sleep");
172 return _("1体のモンスターを眠らせる。抵抗されると無効。", "Attempts to put a monster to sleep.");
179 return info_power(power);
183 if (!get_aim_dir(player_ptr, &dir)) {
187 sleep_monster(player_ptr, dir, plev);
194 return _("耐毒", "Resist Poison");
197 return _("一定時間、毒への耐性を得る。装備による耐性に累積する。",
198 "Gives resistance to poison. This resistance can be added to that from equipment for more powerful resistance.");
205 return info_duration(base, base);
209 set_oppose_pois(player_ptr, randint1(base) + base, false);
216 return _("恐慌", "Horrify");
219 return _("モンスター1体を恐怖させ、朦朧させる。抵抗されると無効。", "Attempts to scare and stun a monster.");
226 return info_power(power);
230 if (!get_aim_dir(player_ptr, &dir)) {
234 fear_monster(player_ptr, dir, plev);
235 stun_monster(player_ptr, dir, plev);
242 return _("アンデッド従属", "Enslave Undead");
245 return _("アンデッド1体を魅了する。抵抗されると無効。", "Attempts to charm an undead monster.");
252 return info_power(power);
256 if (!get_aim_dir(player_ptr, &dir)) {
260 control_one_undead(player_ptr, dir, plev);
267 return _("エントロピーの球", "Orb of Entropy");
270 return _("生命のある者のHPと最大HP双方にダメージを与える効果のある球を放つ。", "Fires a ball which reduces both HP and MaxHP of living monsters.");
274 DICE_NUMBER dice = 3;
276 POSITION rad = (plev < 30) ? 2 : 3;
279 if (PlayerClass(player_ptr).is_wizard()) {
280 base = plev + plev / 2;
282 base = plev + plev / 4;
286 return info_damage(dice, sides, base);
290 if (!get_aim_dir(player_ptr, &dir)) {
294 fire_ball(player_ptr, AttributeType::HYPODYNAMIA, dir, damroll(dice, sides) + base, rad);
301 return _("地獄の矢", "Nether Bolt");
304 return _("地獄のボルトもしくはビームを放つ。", "Fires a bolt or beam of nether.");
308 DICE_NUMBER dice = 8 + (plev - 5) / 4;
312 return info_damage(dice, sides, 0);
316 if (!get_aim_dir(player_ptr, &dir)) {
320 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::NETHER, dir, damroll(dice, sides));
327 return _("殺戮雲", "Cloud kill");
330 return _("自分を中心とした毒の球を発生させる。", "Generates a ball of poison centered on you.");
334 int dam = (30 + plev) * 2;
335 POSITION rad = plev / 10 + 2;
338 return info_damage(0, 0, dam / 2);
342 project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, dam, AttributeType::POIS, PROJECT_KILL | PROJECT_ITEM);
349 return _("モンスター消滅", "Genocide One");
352 return _("モンスター1体を消し去る。経験値やアイテムは手に入らない。抵抗されると無効。", "Attempts to eradicate one monster.");
356 int power = plev + 50;
359 return info_power(power);
363 if (!get_aim_dir(player_ptr, &dir)) {
367 fire_ball_hide(player_ptr, AttributeType::GENOCIDE, dir, power, 0);
374 return _("毒の刃", "Poison Branding");
377 return _("武器に毒の属性をつける。", "Makes current weapon poison branded.");
382 brand_weapon(player_ptr, 3);
389 return _("吸血の矢", "Vampiric Bolt");
392 return _("ボルトによりモンスター1体から生命力を吸いとる。吸いとった生命力によって満腹度が上がる。",
393 "Fires a bolt which transfers HP from a monster to you. You will also gain nutritional sustenance from this.");
397 DICE_NUMBER dice = 1;
398 DICE_SID sides = plev * 2;
402 return info_damage(dice, sides, base);
406 int dam = base + damroll(dice, sides);
408 if (!get_aim_dir(player_ptr, &dir)) {
412 if (hypodynamic_bolt(player_ptr, dir, dam)) {
413 chg_virtue(player_ptr, Virtue::SACRIFICE, -1);
414 chg_virtue(player_ptr, Virtue::VITALITY, -1);
416 hp_player(player_ptr, dam);
419 * Gain nutritional sustenance:
422 * A Food ration gives 5000
423 * food points (by contrast)
424 * Don't ever get more than
425 * "Full" this way But if we
426 * ARE Gorged, it won't cure
429 dam = player_ptr->food + std::min(5000, 100 * dam);
431 /* Not gorged already */
432 if (player_ptr->food < PY_FOOD_MAX) {
433 set_food(player_ptr, dam >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dam);
442 return _("反魂の術", "Animate dead");
445 return _("周囲の死体や骨を生き返す。", "Resurrects nearby corpses and skeletons. And makes them your pets.");
450 animate_dead(player_ptr, 0, player_ptr->y, player_ptr->x);
457 return _("抹殺", "Genocide");
460 return _("指定した文字のモンスターを現在の階から消し去る。抵抗されると無効。",
461 "Eliminates an entire class of monster, exhausting you. Powerful or unique monsters may resist.");
465 int power = plev + 50;
468 return info_power(power);
472 symbol_genocide(player_ptr, power, true);
479 return _("狂戦士化", "Berserk");
482 return _("狂戦士化し、恐怖を除去する。", "Gives a bonus to hit and HP, immunity to fear for a while. But decreases AC.");
489 return info_duration(base, base);
493 (void)berserk(player_ptr, base + randint1(base));
500 return _("悪霊召喚", "Invoke Spirits");
503 return _("ランダムで様々な効果が起こる。", "Causes random effects.");
512 if (!get_aim_dir(player_ptr, &dir)) {
516 cast_invoke_spirits(player_ptr, dir);
523 return _("暗黒の矢", "Dark Bolt");
526 return _("暗黒のボルトもしくはビームを放つ。", "Fires a bolt or beam of darkness.");
530 DICE_NUMBER dice = 4 + (plev - 5) / 4;
534 return info_damage(dice, sides, 0);
538 if (!get_aim_dir(player_ptr, &dir)) {
542 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::DARK, dir, damroll(dice, sides));
549 return _("狂乱戦士", "Battle Frenzy");
552 return _("狂戦士化し、恐怖を除去し、加速する。", "Gives another bonus to hit and HP, immunity to fear for a while. Hastes you. But decreases AC.");
557 int sp_base = plev / 2;
558 int sp_sides = 20 + plev / 2;
561 return info_duration(b_base, b_base);
565 (void)berserk(player_ptr, b_base + randint1(b_base));
566 set_acceleration(player_ptr, randint1(sp_sides) + sp_base, false);
573 return _("吸血の刃", "Vampiric Branding");
576 return _("武器に吸血の属性をつける。", "Makes current weapon Vampiric.");
581 brand_weapon(player_ptr, 4);
588 return _("吸血の連矢", "Vampiric Bolts");
591 return _("3連射のボルトによりモンスター1体から生命力を吸いとる。吸いとった生命力によって体力が回復する。",
592 "Fires 3 bolts. Each of the bolts absorbs some HP from a monster and gives them to you.");
598 return format("%s3*%d", KWD_DAM, dam);
604 if (!get_aim_dir(player_ptr, &dir)) {
608 chg_virtue(player_ptr, Virtue::SACRIFICE, -1);
609 chg_virtue(player_ptr, Virtue::VITALITY, -1);
611 for (i = 0; i < 3; i++) {
612 if (hypodynamic_bolt(player_ptr, dir, dam)) {
613 hp_player(player_ptr, dam);
622 return _("死の言魂", "Nether Wave");
625 return _("視界内の生命のあるモンスターにダメージを与える。", "Damages all living monsters in sight.");
629 DICE_SID sides = plev * 3;
632 return info_damage(1, sides, 0);
636 dispel_living(player_ptr, randint1(sides));
643 return _("暗黒の嵐", "Darkness Storm");
646 return _("巨大な暗黒の球を放つ。", "Fires a huge ball of darkness.");
650 int dam = 100 + plev * 2;
654 return info_damage(0, 0, dam);
658 if (!get_aim_dir(player_ptr, &dir)) {
662 fire_ball(player_ptr, AttributeType::DARK, dir, dam, rad);
669 return _("死の光線", "Death Ray");
672 return _("死の光線を放つ。", "Fires a beam of death.");
677 if (!get_aim_dir(player_ptr, &dir)) {
681 death_ray(player_ptr, dir, plev);
688 return _("死者召喚", "Raise the Dead");
691 return _("1体のアンデッドを召喚する。", "Summons an undead monster.");
694 cast_summon_undead(player_ptr, (plev * 3) / 2);
700 return _("死者の秘伝", "Secrets of the Dead");
703 return _("アイテムを1つ識別する。レベルが高いとアイテムの能力を完全に知ることができる。", "Identifies or, at higher levels, *identifies* an item.");
708 if (randint1(50) > plev) {
709 if (!ident_spell(player_ptr, false)) {
713 if (!identify_fully(player_ptr, false)) {
723 return _("吸血鬼変化", "Polymorph Vampire");
726 return _("一定時間、吸血鬼に変化する。変化している間は本来の種族の能力を失い、代わりに吸血鬼としての能力を得る。",
727 "Causes you to mimic a vampire for a while. You lose the abilities of your original race and get the abilities of a vampire for that time.");
731 int base = 10 + plev / 2;
734 return info_duration(base, base);
738 set_mimic(player_ptr, base + randint1(base), MimicKindType::VAMPIRE, false);
745 return _("経験値復活", "Restore Life");
748 return _("失った経験値を回復する。", "Restores lost experience.");
753 restore_level(player_ptr);
760 return _("周辺抹殺", "Mass Genocide");
763 return _("自分の周囲にいるモンスターを現在の階から消し去る。抵抗されると無効。",
764 "Eliminates all nearby monsters, exhausting you. Powerful or unique monsters may be able to resist.");
768 int power = plev + 50;
771 return info_power(power);
775 mass_genocide(player_ptr, power, true);
782 return _("地獄の劫火", "Hellfire");
786 "邪悪な力を持つ宝珠を放つ。善良なモンスターには大きなダメージを与える。", "Fires a powerful ball of evil power. Hurts good monsters greatly.");
794 return info_damage(0, 0, dam);
798 if (!get_aim_dir(player_ptr, &dir)) {
802 fire_ball(player_ptr, AttributeType::HELL_FIRE, dir, dam, rad);
803 take_hit(player_ptr, DAMAGE_USELIFE, 20 + randint1(30), _("地獄の劫火の呪文を唱えた疲労", "the strain of casting Hellfire"));
810 return _("幽体化", "Wraithform");
813 return _("一定時間、壁を通り抜けることができ受けるダメージが軽減される幽体の状態に変身する。",
814 "Causes you to be ghost-like for a while. That reduces the damage you take and allows you to pass through walls.");
821 return info_duration(base, base);
825 set_wraith_form(player_ptr, randint1(base) + base, false);