1 #include "realm/realm-crusade.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "effect/effect-characteristics.h"
4 #include "effect/effect-processor.h"
5 #include "floor/cave.h"
6 #include "floor/floor-util.h"
7 #include "hpmp/hp-mp-processor.h"
8 #include "monster-floor/monster-summon.h"
9 #include "monster-floor/place-monster-types.h"
10 #include "player-info/class-info.h"
11 #include "spell-kind/spells-beam.h"
12 #include "spell-kind/spells-curse-removal.h"
13 #include "spell-kind/spells-detection.h"
14 #include "spell-kind/spells-floor.h"
15 #include "spell-kind/spells-launcher.h"
16 #include "spell-kind/spells-neighbor.h"
17 #include "spell-kind/spells-sight.h"
18 #include "spell-kind/spells-teleport.h"
19 #include "spell-realm/spells-crusade.h"
20 #include "effect/attribute-types.h"
21 #include "spell/spells-diceroll.h"
22 #include "spell/spells-object.h"
23 #include "spell/spells-status.h"
24 #include "spell/summon-types.h"
25 #include "status/bad-status-setter.h"
26 #include "status/body-improvement.h"
27 #include "status/buff-setter.h"
28 #include "status/sight-setter.h"
29 #include "system/player-type-definition.h"
30 #include "target/target-getter.h"
31 #include "view/display-messages.h"
32 #include "world/world.h"
35 * @brief 破邪領域魔法の各処理を行う
36 * @param player_ptr プレイヤーへの参照ポインタ
38 * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST)
39 * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST時はnullptr文字列を返す。
41 concptr do_crusade_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType mode)
43 bool name = mode == SpellProcessType::NAME;
44 bool desc = mode == SpellProcessType::DESCRIPTION;
45 bool info = mode == SpellProcessType::INFO;
46 bool cast = mode == SpellProcessType::CAST;
49 PLAYER_LEVEL plev = player_ptr->lev;
54 return _("懲罰", "Punishment");
56 return _("電撃のボルトもしくはビームを放つ。", "Fires a bolt or beam of lightning.");
58 DICE_NUMBER dice = 3 + (plev - 1) / 5;
61 return info_damage(dice, sides, 0);
63 if (!get_aim_dir(player_ptr, &dir))
65 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::ELEC, dir, damroll(dice, sides));
72 return _("邪悪存在感知", "Detect Evil");
74 return _("近くの邪悪なモンスターを感知する。", "Detects all evil monsters in your vicinity.");
76 POSITION rad = DETECT_RAD_DEFAULT;
78 return info_radius(rad);
80 detect_monsters_evil(player_ptr, rad);
87 return _("恐怖除去", "Remove Fear");
91 return _("恐怖を取り除く。", "Removes fear.");
95 (void)BadStatusSetter(player_ptr).afraidness(0);
101 return _("威圧", "Scare Monster");
103 return _("モンスター1体を恐怖させる。抵抗されると無効。", "Attempts to scare a monster.");
106 PLAYER_LEVEL power = plev;
108 return info_power(power);
110 if (!get_aim_dir(player_ptr, &dir))
112 fear_monster(player_ptr, dir, power);
119 return _("聖域", "Sanctuary");
121 return _("隣接した全てのモンスターを眠らせる。抵抗されると無効。", "Attempts to put to sleep monsters in the adjacent squares.");
123 PLAYER_LEVEL power = plev;
125 return info_power(power);
127 sleep_monsters_touch(player_ptr);
133 return _("入口", "Portal");
135 return _("中距離のテレポートをする。", "Teleports you a medium distance.");
138 POSITION range = 25 + plev / 2;
140 return info_range(range);
142 teleport_player(player_ptr, range, TELEPORT_SPONTANEOUS);
148 return _("スターダスト", "Star Dust");
150 return _("ターゲット付近に閃光のボルトを連射する。", "Fires many bolts of light near the target.");
153 DICE_NUMBER dice = 3 + (plev - 1) / 9;
156 return info_multi_damage_dice(dice, sides);
158 if (!get_aim_dir(player_ptr, &dir))
160 fire_blast(player_ptr, AttributeType::LITE, dir, dice, sides, 10, 3);
167 return _("身体浄化", "Purify");
171 return _("傷、毒、朦朧から全快する。", "Heals all cuts, poisons and being stunned.");
175 BadStatusSetter bss(player_ptr);
185 return _("邪悪飛ばし", "Scatter Evil");
187 return _("邪悪なモンスター1体をテレポートさせる。抵抗されると無効。", "Attempts to teleport an evil monster away.");
190 int power = MAX_SIGHT * 5;
192 return info_power(power);
194 if (!get_aim_dir(player_ptr, &dir))
196 fire_ball(player_ptr, AttributeType::AWAY_EVIL, dir, power, 0);
203 return _("聖なる光球", "Holy Orb");
205 return _("聖なる力をもつ宝珠を放つ。邪悪なモンスターに対して大きなダメージを与えるが、善良なモンスターには効果がない。",
206 "Fires a ball with holy power. Hurts evil monsters greatly but doesn't affect good monsters.");
209 DICE_NUMBER dice = 3;
211 POSITION rad = (plev < 30) ? 2 : 3;
213 if (player_ptr->pclass == PlayerClassType::PRIEST || player_ptr->pclass == PlayerClassType::HIGH_MAGE || player_ptr->pclass == PlayerClassType::SORCERER)
214 base = plev + plev / 2;
216 base = plev + plev / 4;
219 return info_damage(dice, sides, base);
222 if (!get_aim_dir(player_ptr, &dir))
225 fire_ball(player_ptr, AttributeType::HOLY_FIRE, dir, damroll(dice, sides) + base, rad);
232 return _("悪魔払い", "Exorcism");
234 return _("視界内の全てのアンデッド及び悪魔にダメージを与え、邪悪なモンスターを恐怖させる。",
235 "Damages all undead and demons in sight, and scares all evil monsters in sight.");
237 DICE_SID sides = plev;
240 return info_damage(1, sides, 0);
242 dispel_undead(player_ptr, randint1(sides));
243 dispel_demons(player_ptr, randint1(sides));
244 turn_evil(player_ptr, power);
251 return _("解呪", "Remove Curse");
253 return _("アイテムにかかった弱い呪いを解除する。", "Removes normal curses from equipped items.");
256 (void)remove_curse(player_ptr);
262 return _("透明視認", "Sense Unseen");
264 return _("一定時間、透明なものが見えるようになる。", "Gives see invisible for a while.");
270 return info_duration(base, base);
273 set_tim_invis(player_ptr, randint1(base) + base, false);
280 return _("対邪悪結界", "Protection from Evil");
282 return _("邪悪なモンスターの攻撃を防ぐバリアを張る。", "Gives aura which protects you from evil monster's physical attack.");
286 DICE_SID sides = 3 * plev;
289 return info_duration(base, sides);
292 set_protevil(player_ptr, randint1(sides) + base, false);
299 return _("裁きの雷", "Judgment Thunder");
301 return _("強力な電撃のボルトを放つ。", "Fires a powerful bolt of lightning.");
304 HIT_POINT dam = plev * 5;
307 return info_damage(0, 0, dam);
310 if (!get_aim_dir(player_ptr, &dir))
312 fire_bolt(player_ptr, AttributeType::ELEC, dir, dam);
319 return _("聖なる御言葉", "Holy Word");
323 return _("視界内の邪悪な存在に大きなダメージを与え、体力を回復し、毒、恐怖、朦朧状態、負傷から全快する。",
324 "Damages all evil monsters in sight, heals HP somewhat and completely cures fear, poisons, cuts and being stunned.");
327 auto dam_sides = plev * 6;
330 return format(_("損:1d%d/回%d", "dam:d%d/h%d"), dam_sides, heal);
334 BadStatusSetter bss(player_ptr);
335 dispel_evil(player_ptr, randint1(dam_sides));
336 hp_player(player_ptr, heal);
337 (void)bss.afraidness(0);
347 return _("開かれた道", "Unbarring Ways");
349 return _("一直線上の全ての罠と扉を破壊する。", "Fires a beam which destroy traps and doors.");
353 if (!get_aim_dir(player_ptr, &dir))
356 destroy_door(player_ptr, dir);
363 return _("封魔", "Arrest");
365 return _("邪悪なモンスターの動きを止める。", "Attempts to paralyze an evil monster.");
368 int power = plev * 2;
371 return info_power(power);
374 if (!get_aim_dir(player_ptr, &dir))
376 stasis_evil(player_ptr, dir);
383 return _("聖なるオーラ", "Holy Aura");
385 return _("一定時間、邪悪なモンスターを傷つける聖なるオーラを得る。",
386 "Gives a temporary aura of holy power that injures evil monsters which attack you.");
392 return info_duration(base, base);
395 set_tim_sh_holy(player_ptr, randint1(base) + base, false);
402 return _("アンデッド&悪魔退散", "Dispel Undead & Demons");
404 return _("視界内の全てのアンデッド及び悪魔にダメージを与える。", "Damages all undead and demons in sight.");
407 DICE_SID sides = plev * 4;
410 return info_damage(1, sides, 0);
413 dispel_undead(player_ptr, randint1(sides));
414 dispel_demons(player_ptr, randint1(sides));
421 return _("邪悪退散", "Dispel Evil");
423 return _("視界内の全ての邪悪なモンスターにダメージを与える。", "Damages all evil monsters in sight.");
426 DICE_SID sides = plev * 4;
429 return info_damage(1, sides, 0);
432 dispel_evil(player_ptr, randint1(sides));
439 return _("聖なる刃", "Holy Blade");
441 return _("通常の武器に滅邪の属性をつける。", "Makes current weapon especially deadly against evil monsters.");
445 brand_weapon(player_ptr, 13);
452 return _("スターバースト", "Star Burst");
454 return _("巨大な閃光の球を放つ。", "Fires a huge ball of powerful light.");
457 HIT_POINT dam = 100 + plev * 2;
461 return info_damage(0, 0, dam);
464 if (!get_aim_dir(player_ptr, &dir))
467 fire_ball(player_ptr, AttributeType::LITE, dir, dam, rad);
474 return _("天使召喚", "Summon Angel");
476 return _("天使を1体召喚する。", "Summons an angel.");
480 bool pet = !one_in_(3);
487 if (!(pet && (plev < 50)))
488 flg |= PM_ALLOW_GROUP;
490 if (summon_specific(player_ptr, (pet ? -1 : 0), player_ptr->y, player_ptr->x, (plev * 3) / 2, SUMMON_ANGEL, flg)) {
492 msg_print(_("「ご用でございますか、ご主人様」", "'What is thy bidding... Master?'"));
494 msg_print(_("「我は汝の下僕にあらず! 悪行者よ、悔い改めよ!」", "Mortal! Repent of thy impiousness."));
503 return _("士気高揚", "Heroism");
505 return _("一定時間、ヒーロー気分になる。", "Removes fear. Gives a bonus to hit for a while. Heals you for 10 HP.");
511 return info_duration(base, base);
514 (void)heroism(player_ptr, base);
521 return _("呪い退散", "Dispel Curse");
523 return _("アイテムにかかった強力な呪いを解除する。", "Removes normal and heavy curses from equipped items.");
527 (void)remove_all_curse(player_ptr);
533 return _("邪悪追放", "Banish Evil");
535 return _("視界内の全ての邪悪なモンスターをテレポートさせる。抵抗されると無効。", "Teleports all evil monsters in sight away unless resisted.");
541 return info_power(power);
544 if (banish_evil(player_ptr, power)) {
545 msg_print(_("神聖な力が邪悪を打ち払った!", "The holy power banishes evil!"));
553 return _("ハルマゲドン", "Armageddon");
555 return _("周辺のアイテム、モンスター、地形を破壊する。", "Destroys everything in nearby area.");
562 destroy_area(player_ptr, player_ptr->y, player_ptr->x, base + randint1(sides), false);
569 return _("目には目を", "An Eye for an Eye");
571 return _("一定時間、自分がダメージを受けたときに攻撃を行ったモンスターに対して同等のダメージを与える。",
572 "Gives special aura for a while. When you are attacked by a monster, the monster is injured with same amount of damage as you took.");
578 return info_duration(base, base);
581 set_tim_eyeeye(player_ptr, randint1(base) + base, false);
588 return _("神の怒り", "Wrath of the God");
590 return _("ターゲットの周囲に分解の球を多数落とす。", "Drops many balls of disintegration near the target.");
593 HIT_POINT dam = plev * 3 + 25;
597 return info_multi_damage(dam);
600 if (!cast_wrath_of_the_god(player_ptr, dam, rad))
608 return _("神威", "Divine Intervention");
610 return _("隣接するモンスターに聖なるダメージを与え、視界内のモンスターにダメージ、減速、朦朧、混乱、恐怖、眠りを与える。さらに体力を回復する。",
611 "Damages all adjacent monsters with holy power. Damages and attempt to slow, stun, confuse, scare and freeze all monsters in sight. And heals "
615 int b_dam = plev * 11;
616 int d_dam = plev * 4;
618 int power = plev * 4;
621 return format(_("回%d/損%d+%d", "h%d/dm%d+%d"), heal, d_dam, b_dam / 2);
623 project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, b_dam, AttributeType::HOLY_FIRE, PROJECT_KILL);
624 dispel_monsters(player_ptr, d_dam);
625 slow_monsters(player_ptr, plev);
626 stun_monsters(player_ptr, power);
627 confuse_monsters(player_ptr, power);
628 turn_monsters(player_ptr, power);
629 stasis_monsters(player_ptr, power);
630 hp_player(player_ptr, heal);
637 return _("聖戦", "Crusade");
641 return _("視界内の善良なモンスターをペットにしようとし、ならなかった場合及び善良でないモンスターを恐怖させる。さらに多数の加速された騎士を召喚し、"
642 "ヒーロー、祝福、加速、対邪悪結界を得る。",
643 "Attempts to charm all good monsters in sight and scares all non-charmed monsters. Summons a great number of knights. Gives heroism, bless, "
644 "speed and protection from evil to the caster.");
649 auto sp_sides = 20 + plev;
652 for (auto i = 0; i < 12; i++) {
654 POSITION my = 0, mx = 0;
656 scatter(player_ptr, &my, &mx, player_ptr->y, player_ptr->x, 4, PROJECT_NONE);
657 if (is_cave_empty_bold2(player_ptr, my, mx)) {
666 summon_specific(player_ptr, -1, my, mx, plev, SUMMON_KNIGHTS, PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE);
669 set_hero(player_ptr, randint1(base) + base, false);
670 set_blessed(player_ptr, randint1(base) + base, false);
671 set_fast(player_ptr, randint1(sp_sides) + sp_base, false);
672 set_protevil(player_ptr, randint1(base) + base, false);
673 (void)BadStatusSetter(player_ptr).afraidness(0);