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/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 "effect/attribute-types.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 "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時はnullptr文字列を返す。
35 concptr do_chaos_spell(player_type *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");
50 return _("弱い魔法の矢を放つ。", "Fires a weak bolt of magic.");
53 DICE_NUMBER dice = 3 + ((plev - 1) / 5);
57 return info_damage(dice, sides, 0);
60 if (!get_aim_dir(player_ptr, &dir))
63 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::MISSILE, dir, damroll(dice, sides));
70 return _("トラップ/ドア破壊", "Trap / Door Destruction");
72 return _("隣接する罠と扉を破壊する。", "Destroys all doors and traps in adjacent squares.");
78 return info_radius(rad);
81 destroy_doors_touch(player_ptr);
88 return _("閃光", "Flash of Light");
90 return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
94 DICE_SID sides = plev / 2;
95 POSITION rad = (plev / 10) + 1;
98 return info_damage(dice, sides, 0);
101 lite_area(player_ptr, damroll(dice, sides), rad);
108 return _("混乱の手", "Touch of Confusion");
110 return _("相手を混乱させる攻撃をできるようにする。", "Attempts to confuse the next monster that you hit.");
114 if (!(player_ptr->special_attack & ATTACK_CONFUSE)) {
115 msg_print(_("あなたの手は光り始めた。", "Your hands start glowing."));
116 player_ptr->special_attack |= ATTACK_CONFUSE;
117 player_ptr->redraw |= (PR_STATUS);
125 return _("魔力炸裂", "Mana Burst");
127 return _("魔法の球を放つ。", "Fires a ball of magic.");
130 DICE_NUMBER dice = 3;
132 POSITION rad = (plev < 30) ? 2 : 3;
135 if (PlayerClass(player_ptr).is_wizard())
136 base = plev + plev / 2;
138 base = plev + plev / 4;
141 return info_damage(dice, sides, base);
144 if (!get_aim_dir(player_ptr, &dir))
147 fire_ball(player_ptr, AttributeType::MISSILE, dir, damroll(dice, sides) + base, rad);
150 * Shouldn't actually use MANA, as
151 * it will destroy all items on the
160 return _("ファイア・ボルト", "Fire Bolt");
162 return _("炎のボルトもしくはビームを放つ。", "Fires a bolt or beam of fire.");
165 DICE_NUMBER dice = 8 + (plev - 5) / 4;
169 return info_damage(dice, sides, 0);
172 if (!get_aim_dir(player_ptr, &dir))
175 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::FIRE, dir, damroll(dice, sides));
182 return _("力の拳", "Fist of Force");
184 return _("ごく小さな分解の球を放つ。", "Fires a tiny ball of disintegration.");
187 DICE_NUMBER dice = 8 + ((plev - 5) / 4);
191 return info_damage(dice, sides, 0);
194 if (!get_aim_dir(player_ptr, &dir))
197 fire_ball(player_ptr, AttributeType::DISINTEGRATE, dir, damroll(dice, sides), 0);
204 return _("テレポート", "Teleport Self");
206 return _("遠距離のテレポートをする。", "Teleports you a long distance.");
209 POSITION range = plev * 5;
212 return info_range(range);
215 teleport_player(player_ptr, range, TELEPORT_SPONTANEOUS);
222 return _("ワンダー", "Wonder");
224 return _("モンスターにランダムな効果を与える。", "Fires something with random effects.");
232 if (!get_aim_dir(player_ptr, &dir))
235 cast_wonder(player_ptr, dir);
242 return _("カオス・ボルト", "Chaos Bolt");
244 return _("カオスのボルトもしくはビームを放つ。", "Fires a bolt or ball of chaos.");
247 DICE_NUMBER dice = 10 + (plev - 5) / 4;
251 return info_damage(dice, sides, 0);
254 if (!get_aim_dir(player_ptr, &dir))
257 fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::CHAOS, dir, damroll(dice, sides));
264 return _("ソニック・ブーム", "Sonic Boom");
266 return _("自分を中心とした轟音の球を発生させる。", "Generates a ball of sound centered on you.");
269 HIT_POINT dam = 60 + plev;
270 POSITION rad = plev / 10 + 2;
273 return info_damage(0, 0, dam / 2);
276 msg_print(_("ドーン!部屋が揺れた!", "BOOM! Shake the room!"));
277 project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, dam, AttributeType::SOUND, PROJECT_KILL | PROJECT_ITEM);
284 return _("破滅の矢", "Doom Bolt");
286 return _("純粋な魔力のビームを放つ。", "Fires a beam of pure mana.");
289 DICE_NUMBER dice = 11 + (plev - 5) / 4;
293 return info_damage(dice, sides, 0);
296 if (!get_aim_dir(player_ptr, &dir))
299 fire_beam(player_ptr, AttributeType::MANA, dir, damroll(dice, sides));
306 return _("ファイア・ボール", "Fire Ball");
308 return _("炎の球を放つ。", "Fires a ball of fire.");
311 HIT_POINT dam = plev + 55;
315 return info_damage(0, 0, dam);
318 if (!get_aim_dir(player_ptr, &dir))
321 fire_ball(player_ptr, AttributeType::FIRE, dir, dam, rad);
328 return _("テレポート・アウェイ", "Teleport Other");
330 return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
336 return info_power(power);
339 if (!get_aim_dir(player_ptr, &dir))
342 fire_beam(player_ptr, AttributeType::AWAY_ALL, dir, power);
349 return _("破壊の言葉", "Word of Destruction");
351 return _("周辺のアイテム、モンスター、地形を破壊する。", "Destroys everything in nearby area.");
358 destroy_area(player_ptr, player_ptr->y, player_ptr->x, base + randint1(sides), false);
365 return _("ログルス発動", "Invoke Logrus");
367 return _("巨大なカオスの球を放つ。", "Fires a huge ball of chaos.");
370 HIT_POINT dam = plev * 2 + 99;
371 POSITION rad = plev / 5;
374 return info_damage(0, 0, dam);
377 if (!get_aim_dir(player_ptr, &dir))
380 fire_ball(player_ptr, AttributeType::CHAOS, dir, dam, rad);
387 return _("他者変容", "Polymorph Other");
389 return _("モンスター1体を変身させる。抵抗されると無効。", "Attempts to polymorph a monster.");
395 return info_power(power);
398 if (!get_aim_dir(player_ptr, &dir))
401 poly_monster(player_ptr, dir, plev);
408 return _("連鎖稲妻", "Chain Lightning");
410 return _("全方向に対して電撃のビームを放つ。", "Fires lightning beams in all directions.");
413 DICE_NUMBER dice = 5 + plev / 10;
417 return info_damage(dice, sides, 0);
420 for (dir = 0; dir <= 9; dir++)
421 fire_beam(player_ptr, AttributeType::ELEC, dir, damroll(dice, sides));
428 return _("魔力封入", "Arcane Binding");
430 return _("杖/魔法棒の充填回数を増やすか、充填中のロッドの充填時間を減らす。", "Recharges staffs, wands or rods.");
436 return info_power(power);
438 if (!recharge(player_ptr, power))
446 return _("原子分解", "Disintegrate");
448 return _("巨大な分解の球を放つ。", "Fires a huge ball of disintegration.");
451 HIT_POINT dam = plev + 70;
452 POSITION rad = 3 + plev / 40;
455 return info_damage(0, 0, dam);
458 if (!get_aim_dir(player_ptr, &dir))
461 fire_ball(player_ptr, AttributeType::DISINTEGRATE, dir, dam, rad);
468 return _("現実変容", "Alter Reality");
470 return _("現在の階を再構成する。", "Recreates current dungeon level.");
477 return info_delay(base, sides);
480 reserve_alter_reality(player_ptr, randint0(sides) + base);
487 return _("マジック・ロケット", "Magic Rocket");
489 return _("ロケットを発射する。", "Fires a magic rocket.");
492 HIT_POINT dam = 120 + plev * 2;
496 return info_damage(0, 0, dam);
499 if (!get_aim_dir(player_ptr, &dir))
502 msg_print(_("ロケット発射!", "You launch a rocket!"));
503 fire_rocket(player_ptr, AttributeType::ROCKET, dir, dam, rad);
510 return _("混沌の刃", "Chaos Branding");
512 return _("武器にカオスの属性をつける。", "Makes current weapon a Chaotic weapon.");
516 brand_weapon(player_ptr, 2);
523 return _("悪魔召喚", "Summon Demon");
525 return _("悪魔を1体召喚する。", "Summons a demon.");
529 cast_summon_demon(player_ptr, (plev * 3) / 2);
536 return _("重力光線", "Beam of Gravity");
538 return _("重力のビームを放つ。", "Fires a beam of gravity.");
541 DICE_NUMBER dice = 9 + (plev - 5) / 4;
545 return info_damage(dice, sides, 0);
548 if (!get_aim_dir(player_ptr, &dir))
550 fire_beam(player_ptr, AttributeType::GRAVITY, dir, damroll(dice, sides));
557 return _("流星群", "Meteor Swarm");
559 return _("自分の周辺に隕石を落とす。", "Causes meteorites to fall down on nearby random locations.");
562 HIT_POINT dam = plev * 2;
566 return info_multi_damage(dam);
569 cast_meteor(player_ptr, dam, rad);
576 return _("焔の一撃", "Flame Strike");
578 return _("自分を中心とした超巨大な炎の球を発生させる。", "Generates a huge ball of fire centered on you.");
581 HIT_POINT dam = 300 + 3 * plev;
585 return info_damage(0, 0, dam / 2);
588 fire_ball(player_ptr, AttributeType::FIRE, 0, dam, rad);
595 return _("混沌召来", "Call Chaos");
597 return _("ランダムな属性の球やビームを発生させる。", "Generates random kinds of balls or beams.");
601 return format("%s150 / 250", KWD_DAM);
604 call_chaos(player_ptr);
611 return _("自己変容", "Polymorph Self");
613 return _("自分を変身させようとする。", "Polymorphs yourself.");
617 if (!get_check(_("変身します。よろしいですか?", "You will polymorph yourself. Are you sure? ")))
619 do_poly_self(player_ptr);
626 return _("魔力の嵐", "Mana Storm");
628 return _("非常に強力で巨大な純粋な魔力の球を放つ。", "Fires an extremely powerful huge ball of pure mana.");
631 HIT_POINT dam = 300 + plev * 4;
635 return info_damage(0, 0, dam);
638 if (!get_aim_dir(player_ptr, &dir))
640 fire_ball(player_ptr, AttributeType::MANA, dir, dam, rad);
647 return _("ログルスのブレス", "Breathe Logrus");
649 return _("非常に強力なカオスの球を放つ。", "Fires an extremely powerful ball of chaos.");
652 HIT_POINT dam = player_ptr->chp;
656 return info_damage(0, 0, dam);
659 if (!get_aim_dir(player_ptr, &dir))
662 fire_ball(player_ptr, AttributeType::CHAOS, dir, dam, rad);
669 return _("虚無召来", "Call the Void");
671 return _("自分の周囲に向かって、ロケット、純粋な魔力の球、放射性廃棄物の球を放つ。ただし、壁に隣接して使用すると広範囲を破壊する。",
672 "Fires rockets, mana balls and nuclear waste balls in all directions if you are not adjacent to any walls. Otherwise *destroys* huge area.");
675 return format("%s3 * 175", KWD_DAM);
678 call_the_void(player_ptr);