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時はnullptr文字列を返す。
37 concptr 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");
52 return _("近くの生命のないモンスターを感知する。", "Detects all nonliving monsters in your vicinity.");
55 POSITION rad = DETECT_RAD_DEFAULT;
58 return info_radius(rad);
61 detect_monsters_nonliving(player_ptr, rad);
68 return _("呪殺弾", "Malediction");
70 return _("ごく小さな邪悪な力を持つボールを放つ。善良なモンスターには大きなダメージを与える。",
71 "Fires a tiny ball of evil power which hurts good monsters greatly.");
74 DICE_NUMBER dice = 3 + (plev - 1) / 5;
79 return info_damage(dice, sides, 0);
82 if (!get_aim_dir(player_ptr, &dir))
86 * A radius-0 ball may (1) be aimed at
87 * objects etc., and will affect them;
88 * (2) may be aimed at ANY visible
89 * monster, unlike a 'bolt' which must
90 * travel to the monster.
93 fire_ball(player_ptr, AttributeType::HELL_FIRE, dir, damroll(dice, sides), rad);
96 /* Special effect first */
97 int effect = randint1(1000);
100 fire_ball_hide(player_ptr, AttributeType::DEATH_RAY, dir, plev * 200, 0);
101 else if (effect < 500)
102 fire_ball_hide(player_ptr, AttributeType::TURN_ALL, dir, plev, 0);
103 else if (effect < 800)
104 fire_ball_hide(player_ptr, AttributeType::OLD_CONF, dir, plev, 0);
106 fire_ball_hide(player_ptr, AttributeType::STUN, dir, plev, 0);
114 return _("邪悪感知", "Detect Evil");
116 return _("近くの邪悪なモンスターを感知する。", "Detects all evil monsters in your vicinity.");
119 POSITION rad = DETECT_RAD_DEFAULT;
122 return info_radius(rad);
125 detect_monsters_evil(player_ptr, rad);
132 return _("悪臭雲", "Stinking Cloud");
134 return _("毒の球を放つ。", "Fires a ball of poison.");
137 HIT_POINT dam = 10 + plev / 2;
141 return info_damage(0, 0, dam);
144 if (!get_aim_dir(player_ptr, &dir))
147 fire_ball(player_ptr, AttributeType::POIS, dir, dam, rad);
154 return _("黒い眠り", "Black Sleep");
156 return _("1体のモンスターを眠らせる。抵抗されると無効。", "Attempts to put a monster to sleep.");
162 return info_power(power);
165 if (!get_aim_dir(player_ptr, &dir))
168 sleep_monster(player_ptr, dir, plev);
175 return _("耐毒", "Resist Poison");
177 return _("一定時間、毒への耐性を得る。装備による耐性に累積する。",
178 "Gives resistance to poison. This resistance can be added to that from equipment for more powerful resistance.");
184 return info_duration(base, base);
187 set_oppose_pois(player_ptr, randint1(base) + base, false);
194 return _("恐慌", "Horrify");
196 return _("モンスター1体を恐怖させ、朦朧させる。抵抗されると無効。", "Attempts to scare and stun a monster.");
202 return info_power(power);
205 if (!get_aim_dir(player_ptr, &dir))
208 fear_monster(player_ptr, dir, plev);
209 stun_monster(player_ptr, dir, plev);
216 return _("アンデッド従属", "Enslave Undead");
218 return _("アンデッド1体を魅了する。抵抗されると無効。", "Attempts to charm an undead monster.");
224 return info_power(power);
227 if (!get_aim_dir(player_ptr, &dir))
230 control_one_undead(player_ptr, dir, plev);
237 return _("エントロピーの球", "Orb of Entropy");
239 return _("生命のある者のHPと最大HP双方にダメージを与える効果のある球を放つ。", "Fires a ball which reduces both HP and MaxHP of living monsters.");
242 DICE_NUMBER dice = 3;
244 POSITION rad = (plev < 30) ? 2 : 3;
247 if (PlayerClass(player_ptr).is_wizard())
248 base = plev + plev / 2;
250 base = plev + plev / 4;
253 return info_damage(dice, sides, base);
256 if (!get_aim_dir(player_ptr, &dir))
259 fire_ball(player_ptr, AttributeType::HYPODYNAMIA, dir, damroll(dice, sides) + base, rad);
266 return _("地獄の矢", "Nether Bolt");
268 return _("地獄のボルトもしくはビームを放つ。", "Fires a bolt or beam of nether.");
271 DICE_NUMBER dice = 8 + (plev - 5) / 4;
275 return info_damage(dice, sides, 0);
278 if (!get_aim_dir(player_ptr, &dir))
281 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::NETHER, dir, damroll(dice, sides));
288 return _("殺戮雲", "Cloud kill");
290 return _("自分を中心とした毒の球を発生させる。", "Generates a ball of poison centered on you.");
293 HIT_POINT dam = (30 + plev) * 2;
294 POSITION rad = plev / 10 + 2;
297 return info_damage(0, 0, dam / 2);
300 project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, dam, AttributeType::POIS, PROJECT_KILL | PROJECT_ITEM);
307 return _("モンスター消滅", "Genocide One");
309 return _("モンスター1体を消し去る。経験値やアイテムは手に入らない。抵抗されると無効。", "Attempts to eradicate one monster.");
312 int power = plev + 50;
315 return info_power(power);
318 if (!get_aim_dir(player_ptr, &dir))
321 fire_ball_hide(player_ptr, AttributeType::GENOCIDE, dir, power, 0);
328 return _("毒の刃", "Poison Branding");
330 return _("武器に毒の属性をつける。", "Makes current weapon poison branded.");
334 brand_weapon(player_ptr, 3);
341 return _("吸血の矢", "Vampiric Bolt");
343 return _("ボルトによりモンスター1体から生命力を吸いとる。吸いとった生命力によって満腹度が上がる。",
344 "Fires a bolt which transfers HP from a monster to you. You will also gain nutritional sustenance from this.");
347 DICE_NUMBER dice = 1;
348 DICE_SID sides = plev * 2;
352 return info_damage(dice, sides, base);
355 HIT_POINT dam = base + damroll(dice, sides);
357 if (!get_aim_dir(player_ptr, &dir))
360 if (hypodynamic_bolt(player_ptr, dir, dam)) {
361 chg_virtue(player_ptr, V_SACRIFICE, -1);
362 chg_virtue(player_ptr, V_VITALITY, -1);
364 hp_player(player_ptr, dam);
367 * Gain nutritional sustenance:
370 * A Food ration gives 5000
371 * food points (by contrast)
372 * Don't ever get more than
373 * "Full" this way But if we
374 * ARE Gorged, it won't cure
377 dam = player_ptr->food + std::min(5000, 100 * dam);
379 /* Not gorged already */
380 if (player_ptr->food < PY_FOOD_MAX)
381 set_food(player_ptr, dam >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dam);
389 return _("反魂の術", "Animate dead");
391 return _("周囲の死体や骨を生き返す。", "Resurrects nearby corpses and skeletons. And makes them your pets.");
395 animate_dead(player_ptr, 0, player_ptr->y, player_ptr->x);
402 return _("抹殺", "Genocide");
404 return _("指定した文字のモンスターを現在の階から消し去る。抵抗されると無効。",
405 "Eliminates an entire class of monster, exhausting you. Powerful or unique monsters may resist.");
408 int power = plev + 50;
411 return info_power(power);
414 symbol_genocide(player_ptr, power, true);
421 return _("狂戦士化", "Berserk");
423 return _("狂戦士化し、恐怖を除去する。", "Gives a bonus to hit and HP, immunity to fear for a while. But decreases AC.");
429 return info_duration(base, base);
432 (void)berserk(player_ptr, base + randint1(base));
439 return _("悪霊召喚", "Invoke Spirits");
441 return _("ランダムで様々な効果が起こる。", "Causes random effects.");
448 if (!get_aim_dir(player_ptr, &dir))
451 cast_invoke_spirits(player_ptr, dir);
458 return _("暗黒の矢", "Dark Bolt");
460 return _("暗黒のボルトもしくはビームを放つ。", "Fires a bolt or beam of darkness.");
463 DICE_NUMBER dice = 4 + (plev - 5) / 4;
467 return info_damage(dice, sides, 0);
470 if (!get_aim_dir(player_ptr, &dir))
473 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::DARK, dir, damroll(dice, sides));
480 return _("狂乱戦士", "Battle Frenzy");
482 return _("狂戦士化し、恐怖を除去し、加速する。", "Gives another bonus to hit and HP, immunity to fear for a while. Hastes you. But decreases AC.");
486 int sp_base = plev / 2;
487 int sp_sides = 20 + plev / 2;
490 return info_duration(b_base, b_base);
493 (void)berserk(player_ptr, b_base + randint1(b_base));
494 set_fast(player_ptr, randint1(sp_sides) + sp_base, false);
501 return _("吸血の刃", "Vampiric Branding");
503 return _("武器に吸血の属性をつける。", "Makes current weapon Vampiric.");
507 brand_weapon(player_ptr, 4);
514 return _("吸血の連矢", "Vampiric Bolts");
516 return _("3連射のボルトによりモンスター1体から生命力を吸いとる。吸いとった生命力によって体力が回復する。",
517 "Fires 3 bolts. Each of the bolts absorbs some HP from a monster and gives them to you.");
522 return format("%s3*%d", KWD_DAM, dam);
527 if (!get_aim_dir(player_ptr, &dir))
530 chg_virtue(player_ptr, V_SACRIFICE, -1);
531 chg_virtue(player_ptr, V_VITALITY, -1);
533 for (i = 0; i < 3; i++) {
534 if (hypodynamic_bolt(player_ptr, dir, dam))
535 hp_player(player_ptr, dam);
543 return _("死の言魂", "Nether Wave");
545 return _("視界内の生命のあるモンスターにダメージを与える。", "Damages all living monsters in sight.");
548 DICE_SID sides = plev * 3;
551 return info_damage(1, sides, 0);
554 dispel_living(player_ptr, randint1(sides));
561 return _("暗黒の嵐", "Darkness Storm");
563 return _("巨大な暗黒の球を放つ。", "Fires a huge ball of darkness.");
566 HIT_POINT dam = 100 + plev * 2;
570 return info_damage(0, 0, dam);
573 if (!get_aim_dir(player_ptr, &dir))
576 fire_ball(player_ptr, AttributeType::DARK, dir, dam, rad);
583 return _("死の光線", "Death Ray");
585 return _("死の光線を放つ。", "Fires a beam of death.");
589 if (!get_aim_dir(player_ptr, &dir))
592 death_ray(player_ptr, dir, plev);
599 return _("死者召喚", "Raise the Dead");
601 return _("1体のアンデッドを召喚する。", "Summons an undead monster.");
603 cast_summon_undead(player_ptr, (plev * 3) / 2);
608 return _("死者の秘伝", "Secrets of the Dead");
610 return _("アイテムを1つ識別する。レベルが高いとアイテムの能力を完全に知ることができる。", "Identifies or, at higher levels, *identifies* an item.");
614 if (randint1(50) > plev) {
615 if (!ident_spell(player_ptr, false))
618 if (!identify_fully(player_ptr, false))
627 return _("吸血鬼変化", "Polymorph Vampire");
629 return _("一定時間、吸血鬼に変化する。変化している間は本来の種族の能力を失い、代わりに吸血鬼としての能力を得る。",
630 "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.");
633 int base = 10 + plev / 2;
636 return info_duration(base, base);
639 set_mimic(player_ptr, base + randint1(base), MIMIC_VAMPIRE, false);
646 return _("経験値復活", "Restore Life");
648 return _("失った経験値を回復する。", "Restores lost experience.");
652 restore_level(player_ptr);
659 return _("周辺抹殺", "Mass Genocide");
661 return _("自分の周囲にいるモンスターを現在の階から消し去る。抵抗されると無効。",
662 "Eliminates all nearby monsters, exhausting you. Powerful or unique monsters may be able to resist.");
665 int power = plev + 50;
668 return info_power(power);
671 mass_genocide(player_ptr, power, true);
678 return _("地獄の劫火", "Hellfire");
681 "邪悪な力を持つ宝珠を放つ。善良なモンスターには大きなダメージを与える。", "Fires a powerful ball of evil power. Hurts good monsters greatly.");
688 return info_damage(0, 0, dam);
691 if (!get_aim_dir(player_ptr, &dir))
694 fire_ball(player_ptr, AttributeType::HELL_FIRE, dir, dam, rad);
695 take_hit(player_ptr, DAMAGE_USELIFE, 20 + randint1(30), _("地獄の劫火の呪文を唱えた疲労", "the strain of casting Hellfire"));
702 return _("幽体化", "Wraithform");
704 return _("一定時間、壁を通り抜けることができ受けるダメージが軽減される幽体の状態に変身する。",
705 "Causes you to be ghost-like for a while. That reduces the damage you take and allows you to pass through walls.");
711 return info_duration(base, base);
714 set_wraith_form(player_ptr, randint1(base) + base, false);