1 #include "realm/realm-chaos.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "core/asking-player.h"
4 #include "core/player-redraw-types.h"
5 #include "effect/attribute-types.h"
6 #include "effect/effect-characteristics.h"
7 #include "effect/effect-processor.h"
8 #include "player-base/player-class.h"
9 #include "player/attack-defense-types.h"
10 #include "spell-kind/magic-item-recharger.h"
11 #include "spell-kind/spells-floor.h"
12 #include "spell-kind/spells-launcher.h"
13 #include "spell-kind/spells-lite.h"
14 #include "spell-kind/spells-neighbor.h"
15 #include "spell-kind/spells-random.h"
16 #include "spell-kind/spells-teleport.h"
17 #include "spell-kind/spells-world.h"
18 #include "spell-realm/spells-chaos.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/shape-changer.h"
24 #include "system/player-type-definition.h"
25 #include "system/redrawing-flags-updater.h"
26 #include "target/target-getter.h"
27 #include "view/display-messages.h"
30 * @brief カオス領域魔法の各処理を行う
31 * @param player_ptr プレイヤーへの参照ポインタ
33 * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST)
34 * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列を返す。SpellProcessType::CAST時は std::nullopt を返す。
36 std::optional<std::string> do_chaos_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode)
38 bool name = mode == SpellProcessType::NAME;
39 bool desc = mode == SpellProcessType::DESCRIPTION;
40 bool info = mode == SpellProcessType::INFO;
41 bool cast = mode == SpellProcessType::CAST;
44 PLAYER_LEVEL plev = player_ptr->lev;
49 return _("マジック・ミサイル", "Magic Missile");
52 return _("弱い魔法の矢を放つ。", "Fires a weak bolt of magic.");
56 DICE_NUMBER dice = 3 + ((plev - 1) / 5);
60 return info_damage(dice, sides, 0);
64 if (!get_aim_dir(player_ptr, &dir)) {
68 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::MISSILE, dir, damroll(dice, sides));
75 return _("トラップ/ドア破壊", "Trap / Door Destruction");
78 return _("隣接する罠と扉を破壊する。", "Destroys all doors and traps in adjacent squares.");
85 return info_radius(rad);
89 destroy_doors_touch(player_ptr);
96 return _("閃光", "Flash of Light");
99 return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
103 DICE_NUMBER dice = 2;
104 DICE_SID sides = plev / 2;
105 POSITION rad = (plev / 10) + 1;
108 return info_damage(dice, sides, 0);
112 lite_area(player_ptr, damroll(dice, sides), rad);
119 return _("混乱の手", "Touch of Confusion");
122 return _("相手を混乱させる攻撃をできるようにする。", "Attempts to confuse the next monster that you hit.");
127 if (!(player_ptr->special_attack & ATTACK_CONFUSE)) {
128 msg_print(_("あなたの手は光り始めた。", "Your hands start glowing."));
129 player_ptr->special_attack |= ATTACK_CONFUSE;
130 RedrawingFlagsUpdater::get_instance().set_flag(MainWindowRedrawingFlag::TIMED_EFFECT);
138 return _("魔力炸裂", "Mana Burst");
141 return _("魔法の球を放つ。", "Fires a ball of magic.");
145 DICE_NUMBER dice = 3;
147 POSITION rad = (plev < 30) ? 2 : 3;
150 if (PlayerClass(player_ptr).is_wizard()) {
151 base = plev + plev / 2;
153 base = plev + plev / 4;
157 return info_damage(dice, sides, base);
161 if (!get_aim_dir(player_ptr, &dir)) {
165 fire_ball(player_ptr, AttributeType::MISSILE, dir, damroll(dice, sides) + base, rad);
168 * Shouldn't actually use MANA, as
169 * it will destroy all items on the
178 return _("ファイア・ボルト", "Fire Bolt");
181 return _("炎のボルトもしくはビームを放つ。", "Fires a bolt or beam of fire.");
185 DICE_NUMBER dice = 8 + (plev - 5) / 4;
189 return info_damage(dice, sides, 0);
193 if (!get_aim_dir(player_ptr, &dir)) {
197 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::FIRE, dir, damroll(dice, sides));
204 return _("力の拳", "Fist of Force");
207 return _("ごく小さな分解の球を放つ。", "Fires a tiny ball of disintegration.");
211 DICE_NUMBER dice = 8 + ((plev - 5) / 4);
215 return info_damage(dice, sides, 0);
219 if (!get_aim_dir(player_ptr, &dir)) {
223 fire_ball(player_ptr, AttributeType::DISINTEGRATE, dir, damroll(dice, sides), 0);
230 return _("テレポート", "Teleport Self");
233 return _("遠距離のテレポートをする。", "Teleports you a long distance.");
237 POSITION range = plev * 5;
240 return info_range(range);
244 teleport_player(player_ptr, range, TELEPORT_SPONTANEOUS);
251 return _("ワンダー", "Wonder");
254 return _("モンスターにランダムな効果を与える。", "Fires something with random effects.");
264 if (!get_aim_dir(player_ptr, &dir)) {
268 cast_wonder(player_ptr, dir);
275 return _("カオス・ボルト", "Chaos Bolt");
278 return _("カオスのボルトもしくはビームを放つ。", "Fires a bolt or ball of chaos.");
282 DICE_NUMBER dice = 10 + (plev - 5) / 4;
286 return info_damage(dice, sides, 0);
290 if (!get_aim_dir(player_ptr, &dir)) {
294 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::CHAOS, dir, damroll(dice, sides));
301 return _("ソニック・ブーム", "Sonic Boom");
304 return _("自分を中心とした轟音の球を発生させる。", "Generates a ball of sound centered on you.");
309 POSITION rad = plev / 10 + 2;
312 return info_damage(0, 0, dam / 2);
316 msg_print(_("ドーン!部屋が揺れた!", "BOOM! Shake the room!"));
317 project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, dam, AttributeType::SOUND, PROJECT_KILL | PROJECT_ITEM);
324 return _("破滅の矢", "Doom Bolt");
327 return _("純粋な魔力のビームを放つ。", "Fires a beam of pure mana.");
331 DICE_NUMBER dice = 11 + (plev - 5) / 4;
335 return info_damage(dice, sides, 0);
339 if (!get_aim_dir(player_ptr, &dir)) {
343 fire_beam(player_ptr, AttributeType::MANA, dir, damroll(dice, sides));
350 return _("ファイア・ボール", "Fire Ball");
353 return _("炎の球を放つ。", "Fires a ball of fire.");
361 return info_damage(0, 0, dam);
365 if (!get_aim_dir(player_ptr, &dir)) {
369 fire_ball(player_ptr, AttributeType::FIRE, dir, dam, rad);
376 return _("テレポート・アウェイ", "Teleport Other");
379 return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
386 return info_power(power);
390 if (!get_aim_dir(player_ptr, &dir)) {
394 fire_beam(player_ptr, AttributeType::AWAY_ALL, dir, power);
401 return _("破壊の言葉", "Word of Destruction");
404 return _("周辺のアイテム、モンスター、地形を破壊する。", "Destroys everything in nearby area.");
412 destroy_area(player_ptr, player_ptr->y, player_ptr->x, base + randint1(sides), false);
419 return _("ログルス発動", "Invoke Logrus");
422 return _("巨大なカオスの球を放つ。", "Fires a huge ball of chaos.");
426 int dam = plev * 2 + 99;
427 POSITION rad = plev / 5;
430 return info_damage(0, 0, dam);
434 if (!get_aim_dir(player_ptr, &dir)) {
438 fire_ball(player_ptr, AttributeType::CHAOS, dir, dam, rad);
445 return _("他者変容", "Polymorph Other");
448 return _("モンスター1体を変身させる。抵抗されると無効。", "Attempts to polymorph a monster.");
455 return info_power(power);
459 if (!get_aim_dir(player_ptr, &dir)) {
463 poly_monster(player_ptr, dir, plev);
470 return _("連鎖稲妻", "Chain Lightning");
473 return _("全方向に対して電撃のビームを放つ。", "Fires lightning beams in all directions.");
477 DICE_NUMBER dice = 5 + plev / 10;
481 return info_damage(dice, sides, 0);
485 for (dir = 0; dir <= 9; dir++) {
486 fire_beam(player_ptr, AttributeType::ELEC, dir, damroll(dice, sides));
494 return _("魔力封入", "Arcane Binding");
497 return _("杖/魔法棒の充填回数を増やすか、充填中のロッドの充填時間を減らす。", "Recharges staffs, wands or rods.");
504 return info_power(power);
507 if (!recharge(player_ptr, power)) {
516 return _("原子分解", "Disintegrate");
519 return _("巨大な分解の球を放つ。", "Fires a huge ball of disintegration.");
524 POSITION rad = 3 + plev / 40;
527 return info_damage(0, 0, dam);
531 if (!get_aim_dir(player_ptr, &dir)) {
535 fire_ball(player_ptr, AttributeType::DISINTEGRATE, dir, dam, rad);
542 return _("現実変容", "Alter Reality");
545 return _("現在の階を再構成する。", "Recreates current dungeon level.");
553 return info_delay(base, sides);
557 reserve_alter_reality(player_ptr, randint0(sides) + base);
564 return _("マジック・ロケット", "Magic Rocket");
567 return _("ロケットを発射する。", "Fires a magic rocket.");
571 int dam = 120 + plev * 2;
575 return info_damage(0, 0, dam);
579 if (!get_aim_dir(player_ptr, &dir)) {
583 msg_print(_("ロケット発射!", "You launch a rocket!"));
584 fire_rocket(player_ptr, AttributeType::ROCKET, dir, dam, rad);
591 return _("混沌の刃", "Chaos Branding");
594 return _("武器にカオスの属性をつける。", "Makes current weapon a Chaotic weapon.");
599 brand_weapon(player_ptr, 2);
606 return _("悪魔召喚", "Summon Demon");
609 return _("悪魔を1体召喚する。", "Summons a demon.");
614 cast_summon_demon(player_ptr, (plev * 3) / 2);
621 return _("重力光線", "Beam of Gravity");
624 return _("重力のビームを放つ。", "Fires a beam of gravity.");
628 DICE_NUMBER dice = 9 + (plev - 5) / 4;
632 return info_damage(dice, sides, 0);
636 if (!get_aim_dir(player_ptr, &dir)) {
639 fire_beam(player_ptr, AttributeType::GRAVITY, dir, damroll(dice, sides));
646 return _("流星群", "Meteor Swarm");
649 return _("自分の周辺に隕石を落とす。", "Causes meteorites to fall down on nearby random locations.");
657 return info_multi_damage(dam);
661 cast_meteor(player_ptr, dam, rad);
668 return _("焔の一撃", "Flame Strike");
671 return _("自分を中心とした超巨大な炎の球を発生させる。", "Generates a huge ball of fire centered on you.");
675 int dam = 300 + 3 * plev;
679 return info_damage(0, 0, dam / 2);
683 fire_ball(player_ptr, AttributeType::FIRE, 0, dam, rad);
690 return _("混沌召来", "Call Chaos");
693 return _("ランダムな属性の球やビームを発生させる。", "Generates random kinds of balls or beams.");
698 return format("%s150 / 250", KWD_DAM);
702 call_chaos(player_ptr);
709 return _("自己変容", "Polymorph Self");
712 return _("自分を変身させようとする。", "Polymorphs yourself.");
717 if (!get_check(_("変身します。よろしいですか?", "You will polymorph yourself. Are you sure? "))) {
720 do_poly_self(player_ptr);
727 return _("魔力の嵐", "Mana Storm");
730 return _("非常に強力で巨大な純粋な魔力の球を放つ。", "Fires an extremely powerful huge ball of pure mana.");
734 int dam = 300 + plev * 4;
738 return info_damage(0, 0, dam);
742 if (!get_aim_dir(player_ptr, &dir)) {
745 fire_ball(player_ptr, AttributeType::MANA, dir, dam, rad);
752 return _("ログルスのブレス", "Breathe Logrus");
755 return _("非常に強力なカオスの球を放つ。", "Fires an extremely powerful ball of chaos.");
759 int dam = player_ptr->chp;
763 return info_damage(0, 0, dam);
767 if (!get_aim_dir(player_ptr, &dir)) {
771 fire_ball(player_ptr, AttributeType::CHAOS, dir, dam, rad);
778 return _("虚無召来", "Call the Void");
781 return _("自分の周囲に向かって、ロケット、純粋な魔力の球、放射性廃棄物の球を放つ。ただし、壁に隣接して使用すると広範囲を破壊する。",
782 "Fires rockets, mana balls and nuclear waste balls in all directions if you are not adjacent to any walls. Otherwise *destroys* huge area.");
786 return format("%s3 * 175", KWD_DAM);
790 call_the_void(player_ptr);