1 #include "realm/realm-chaos.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "core/asking-player.h"
4 #include "effect/attribute-types.h"
5 #include "effect/effect-characteristics.h"
6 #include "effect/effect-processor.h"
7 #include "player-base/player-class.h"
8 #include "player/attack-defense-types.h"
9 #include "spell-kind/magic-item-recharger.h"
10 #include "spell-kind/spells-floor.h"
11 #include "spell-kind/spells-launcher.h"
12 #include "spell-kind/spells-lite.h"
13 #include "spell-kind/spells-neighbor.h"
14 #include "spell-kind/spells-random.h"
15 #include "spell-kind/spells-teleport.h"
16 #include "spell-kind/spells-world.h"
17 #include "spell-realm/spells-chaos.h"
18 #include "spell/spells-diceroll.h"
19 #include "spell/spells-object.h"
20 #include "spell/spells-status.h"
21 #include "spell/spells-summon.h"
22 #include "status/shape-changer.h"
23 #include "system/player-type-definition.h"
24 #include "system/redrawing-flags-updater.h"
25 #include "target/target-getter.h"
26 #include "view/display-messages.h"
29 * @brief カオス領域魔法の各処理を行う
30 * @param player_ptr プレイヤーへの参照ポインタ
32 * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST)
33 * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列を返す。SpellProcessType::CAST時は std::nullopt を返す。
35 std::optional<std::string> do_chaos_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode)
37 bool name = mode == SpellProcessType::NAME;
38 bool desc = mode == SpellProcessType::DESCRIPTION;
39 bool info = mode == SpellProcessType::INFO;
40 bool cast = mode == SpellProcessType::CAST;
43 PLAYER_LEVEL plev = player_ptr->lev;
48 return _("マジック・ミサイル", "Magic Missile");
51 return _("弱い魔法の矢を放つ。", "Fires a weak bolt of magic.");
55 DICE_NUMBER dice = 3 + ((plev - 1) / 5);
59 return info_damage(dice, sides, 0);
63 if (!get_aim_dir(player_ptr, &dir)) {
67 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::MISSILE, dir, damroll(dice, sides));
74 return _("トラップ/ドア破壊", "Trap / Door Destruction");
77 return _("隣接する罠と扉を破壊する。", "Destroys all doors and traps in adjacent squares.");
84 return info_radius(rad);
88 destroy_doors_touch(player_ptr);
95 return _("閃光", "Flash of Light");
98 return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
102 DICE_NUMBER dice = 2;
103 DICE_SID sides = plev / 2;
104 POSITION rad = (plev / 10) + 1;
107 return info_damage(dice, sides, 0);
111 lite_area(player_ptr, damroll(dice, sides), rad);
118 return _("混乱の手", "Touch of Confusion");
121 return _("相手を混乱させる攻撃をできるようにする。", "Attempts to confuse the next monster that you hit.");
126 if (!(player_ptr->special_attack & ATTACK_CONFUSE)) {
127 msg_print(_("あなたの手は光り始めた。", "Your hands start glowing."));
128 player_ptr->special_attack |= ATTACK_CONFUSE;
129 RedrawingFlagsUpdater::get_instance().set_flag(MainWindowRedrawingFlag::TIMED_EFFECT);
137 return _("魔力炸裂", "Mana Burst");
140 return _("魔法の球を放つ。", "Fires a ball of magic.");
144 DICE_NUMBER dice = 3;
146 POSITION rad = (plev < 30) ? 2 : 3;
149 if (PlayerClass(player_ptr).is_wizard()) {
150 base = plev + plev / 2;
152 base = plev + plev / 4;
156 return info_damage(dice, sides, base);
160 if (!get_aim_dir(player_ptr, &dir)) {
164 fire_ball(player_ptr, AttributeType::MISSILE, dir, damroll(dice, sides) + base, rad);
167 * Shouldn't actually use MANA, as
168 * it will destroy all items on the
177 return _("ファイア・ボルト", "Fire Bolt");
180 return _("炎のボルトもしくはビームを放つ。", "Fires a bolt or beam of fire.");
184 DICE_NUMBER dice = 8 + (plev - 5) / 4;
188 return info_damage(dice, sides, 0);
192 if (!get_aim_dir(player_ptr, &dir)) {
196 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::FIRE, dir, damroll(dice, sides));
203 return _("力の拳", "Fist of Force");
206 return _("ごく小さな分解の球を放つ。", "Fires a tiny ball of disintegration.");
210 DICE_NUMBER dice = 8 + ((plev - 5) / 4);
214 return info_damage(dice, sides, 0);
218 if (!get_aim_dir(player_ptr, &dir)) {
222 fire_ball(player_ptr, AttributeType::DISINTEGRATE, dir, damroll(dice, sides), 0);
229 return _("テレポート", "Teleport Self");
232 return _("遠距離のテレポートをする。", "Teleports you a long distance.");
236 POSITION range = plev * 5;
239 return info_range(range);
243 teleport_player(player_ptr, range, TELEPORT_SPONTANEOUS);
250 return _("ワンダー", "Wonder");
253 return _("モンスターにランダムな効果を与える。", "Fires something with random effects.");
263 if (!get_aim_dir(player_ptr, &dir)) {
267 cast_wonder(player_ptr, dir);
274 return _("カオス・ボルト", "Chaos Bolt");
277 return _("カオスのボルトもしくはビームを放つ。", "Fires a bolt or ball of chaos.");
281 DICE_NUMBER dice = 10 + (plev - 5) / 4;
285 return info_damage(dice, sides, 0);
289 if (!get_aim_dir(player_ptr, &dir)) {
293 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::CHAOS, dir, damroll(dice, sides));
300 return _("ソニック・ブーム", "Sonic Boom");
303 return _("自分を中心とした轟音の球を発生させる。", "Generates a ball of sound centered on you.");
308 POSITION rad = plev / 10 + 2;
311 return info_damage(0, 0, dam / 2);
315 msg_print(_("ドーン!部屋が揺れた!", "BOOM! Shake the room!"));
316 project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, dam, AttributeType::SOUND, PROJECT_KILL | PROJECT_ITEM);
323 return _("破滅の矢", "Doom Bolt");
326 return _("純粋な魔力のビームを放つ。", "Fires a beam of pure mana.");
330 DICE_NUMBER dice = 11 + (plev - 5) / 4;
334 return info_damage(dice, sides, 0);
338 if (!get_aim_dir(player_ptr, &dir)) {
342 fire_beam(player_ptr, AttributeType::MANA, dir, damroll(dice, sides));
349 return _("ファイア・ボール", "Fire Ball");
352 return _("炎の球を放つ。", "Fires a ball of fire.");
360 return info_damage(0, 0, dam);
364 if (!get_aim_dir(player_ptr, &dir)) {
368 fire_ball(player_ptr, AttributeType::FIRE, dir, dam, rad);
375 return _("テレポート・アウェイ", "Teleport Other");
378 return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
385 return info_power(power);
389 if (!get_aim_dir(player_ptr, &dir)) {
393 fire_beam(player_ptr, AttributeType::AWAY_ALL, dir, power);
400 return _("破壊の言葉", "Word of Destruction");
403 return _("周辺のアイテム、モンスター、地形を破壊する。", "Destroys everything in nearby area.");
411 destroy_area(player_ptr, player_ptr->y, player_ptr->x, base + randint1(sides), false);
418 return _("ログルス発動", "Invoke Logrus");
421 return _("巨大なカオスの球を放つ。", "Fires a huge ball of chaos.");
425 int dam = plev * 2 + 99;
426 POSITION rad = plev / 5;
429 return info_damage(0, 0, dam);
433 if (!get_aim_dir(player_ptr, &dir)) {
437 fire_ball(player_ptr, AttributeType::CHAOS, dir, dam, rad);
444 return _("他者変容", "Polymorph Other");
447 return _("モンスター1体を変身させる。抵抗されると無効。", "Attempts to polymorph a monster.");
454 return info_power(power);
458 if (!get_aim_dir(player_ptr, &dir)) {
462 poly_monster(player_ptr, dir, plev);
469 return _("連鎖稲妻", "Chain Lightning");
472 return _("全方向に対して電撃のビームを放つ。", "Fires lightning beams in all directions.");
476 DICE_NUMBER dice = 5 + plev / 10;
480 return info_damage(dice, sides, 0);
484 for (dir = 0; dir <= 9; dir++) {
485 fire_beam(player_ptr, AttributeType::ELEC, dir, damroll(dice, sides));
493 return _("魔力封入", "Arcane Binding");
496 return _("杖/魔法棒の充填回数を増やすか、充填中のロッドの充填時間を減らす。", "Recharges staffs, wands or rods.");
503 return info_power(power);
506 if (!recharge(player_ptr, power)) {
515 return _("原子分解", "Disintegrate");
518 return _("巨大な分解の球を放つ。", "Fires a huge ball of disintegration.");
523 POSITION rad = 3 + plev / 40;
526 return info_damage(0, 0, dam);
530 if (!get_aim_dir(player_ptr, &dir)) {
534 fire_ball(player_ptr, AttributeType::DISINTEGRATE, dir, dam, rad);
541 return _("現実変容", "Alter Reality");
544 return _("現在の階を再構成する。", "Recreates current dungeon level.");
552 return info_delay(base, sides);
556 reserve_alter_reality(player_ptr, randint0(sides) + base);
563 return _("マジック・ロケット", "Magic Rocket");
566 return _("ロケットを発射する。", "Fires a magic rocket.");
570 int dam = 120 + plev * 2;
574 return info_damage(0, 0, dam);
578 if (!get_aim_dir(player_ptr, &dir)) {
582 msg_print(_("ロケット発射!", "You launch a rocket!"));
583 fire_rocket(player_ptr, AttributeType::ROCKET, dir, dam, rad);
590 return _("混沌の刃", "Chaos Branding");
593 return _("武器にカオスの属性をつける。", "Makes current weapon a Chaotic weapon.");
598 brand_weapon(player_ptr, 2);
605 return _("悪魔召喚", "Summon Demon");
608 return _("悪魔を1体召喚する。", "Summons a demon.");
613 cast_summon_demon(player_ptr, (plev * 3) / 2);
620 return _("重力光線", "Beam of Gravity");
623 return _("重力のビームを放つ。", "Fires a beam of gravity.");
627 DICE_NUMBER dice = 9 + (plev - 5) / 4;
631 return info_damage(dice, sides, 0);
635 if (!get_aim_dir(player_ptr, &dir)) {
638 fire_beam(player_ptr, AttributeType::GRAVITY, dir, damroll(dice, sides));
645 return _("流星群", "Meteor Swarm");
648 return _("自分の周辺に隕石を落とす。", "Causes meteorites to fall down on nearby random locations.");
656 return info_multi_damage(dam);
660 cast_meteor(player_ptr, dam, rad);
667 return _("焔の一撃", "Flame Strike");
670 return _("自分を中心とした超巨大な炎の球を発生させる。", "Generates a huge ball of fire centered on you.");
674 int dam = 300 + 3 * plev;
678 return info_damage(0, 0, dam / 2);
682 fire_ball(player_ptr, AttributeType::FIRE, 0, dam, rad);
689 return _("混沌召来", "Call Chaos");
692 return _("ランダムな属性の球やビームを発生させる。", "Generates random kinds of balls or beams.");
697 return format("%s150 / 250", KWD_DAM);
701 call_chaos(player_ptr);
708 return _("自己変容", "Polymorph Self");
711 return _("自分を変身させようとする。", "Polymorphs yourself.");
716 if (!get_check(_("変身します。よろしいですか?", "You will polymorph yourself. Are you sure? "))) {
719 do_poly_self(player_ptr);
726 return _("魔力の嵐", "Mana Storm");
729 return _("非常に強力で巨大な純粋な魔力の球を放つ。", "Fires an extremely powerful huge ball of pure mana.");
733 int dam = 300 + plev * 4;
737 return info_damage(0, 0, dam);
741 if (!get_aim_dir(player_ptr, &dir)) {
744 fire_ball(player_ptr, AttributeType::MANA, dir, dam, rad);
751 return _("ログルスのブレス", "Breathe Logrus");
754 return _("非常に強力なカオスの球を放つ。", "Fires an extremely powerful ball of chaos.");
758 int dam = player_ptr->chp;
762 return info_damage(0, 0, dam);
766 if (!get_aim_dir(player_ptr, &dir)) {
770 fire_ball(player_ptr, AttributeType::CHAOS, dir, dam, rad);
777 return _("虚無召来", "Call the Void");
780 return _("自分の周囲に向かって、ロケット、純粋な魔力の球、放射性廃棄物の球を放つ。ただし、壁に隣接して使用すると広範囲を破壊する。",
781 "Fires rockets, mana balls and nuclear waste balls in all directions if you are not adjacent to any walls. Otherwise *destroys* huge area.");
785 return format("%s3 * 175", KWD_DAM);
789 call_the_void(player_ptr);