1 #include "realm/realm-arcane.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "core/asking-player.h"
4 #include "monster-floor/monster-summon.h"
5 #include "monster-floor/place-monster-types.h"
6 #include "player-info/avatar.h"
7 #include "player/digestion-processor.h"
8 #include "spell-kind/spells-beam.h"
9 #include "spell-kind/spells-detection.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-perception.h"
14 #include "spell-kind/spells-teleport.h"
15 #include "spell-kind/spells-world.h"
16 #include "spell-realm/spells-arcane.h"
17 #include "spell/spell-types.h"
18 #include "spell/spells-diceroll.h"
19 #include "spell/spells-status.h"
20 #include "spell/summon-types.h"
21 #include "status/bad-status-setter.h"
22 #include "status/element-resistance.h"
23 #include "status/sight-setter.h"
24 #include "target/target-getter.h"
25 #include "view/display-messages.h"
28 * @brief 秘術領域魔法の各処理を行う
29 * @param caster_ptr プレーヤーへの参照ポインタ
31 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
32 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
34 concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
36 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
37 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
38 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
39 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
42 PLAYER_LEVEL plev = caster_ptr->lev;
47 return _("電撃", "Zap");
49 return _("電撃のボルトもしくはビームを放つ。", "Fires a bolt or beam of lightning.");
52 DICE_NUMBER dice = 3 + (plev - 1) / 5;
56 return info_damage(dice, sides, 0);
59 if (!get_aim_dir(caster_ptr, &dir))
62 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_ELEC, dir, damroll(dice, sides));
69 return _("魔法の施錠", "Wizard Lock");
71 return _("扉に鍵をかける。", "Locks a door.");
75 if (!get_aim_dir(caster_ptr, &dir))
78 wizard_lock(caster_ptr, dir);
85 return _("透明体感知", "Detect Invisibility");
87 return _("近くの透明なモンスターを感知する。", "Detects all invisible monsters in your vicinity.");
90 POSITION rad = DETECT_RAD_DEFAULT;
93 return info_radius(rad);
96 detect_monsters_invis(caster_ptr, rad);
103 return _("モンスター感知", "Detect Monsters");
105 return _("近くの全ての見えるモンスターを感知する。", "Detects all monsters in your vicinity unless invisible.");
108 POSITION rad = DETECT_RAD_DEFAULT;
111 return info_radius(rad);
114 detect_monsters_normal(caster_ptr, rad);
121 return _("ショート・テレポート", "Blink");
123 return _("近距離のテレポートをする。", "Teleports you a short distance.");
129 return info_range(range);
132 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
139 return _("ライト・エリア", "Light Area");
141 return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
144 DICE_NUMBER dice = 2;
145 DICE_SID sides = plev / 2;
146 POSITION rad = plev / 10 + 1;
149 return info_damage(dice, sides, 0);
152 lite_area(caster_ptr, damroll(dice, sides), rad);
159 return _("罠と扉 破壊", "Trap & Door Destruction");
161 return _("一直線上の全ての罠と扉を破壊する。", "Fires a beam which destroy traps and doors.");
165 if (!get_aim_dir(caster_ptr, &dir))
168 destroy_door(caster_ptr, dir);
175 return _("軽傷の治癒", "Cure Light Wounds");
177 return _("怪我と体力を少し回復させる。", "Heals cuts and HP a little.");
180 DICE_NUMBER dice = 2;
184 return info_heal(dice, sides, 0);
186 (void)cure_light_wounds(caster_ptr, dice, sides);
192 return _("罠と扉 感知", "Detect Doors & Traps");
194 return _("近くの全ての罠と扉と階段を感知する。", "Detects traps, doors, and stairs in your vicinity.");
197 POSITION rad = DETECT_RAD_DEFAULT;
200 return info_radius(rad);
203 detect_traps(caster_ptr, rad, TRUE);
204 detect_doors(caster_ptr, rad);
205 detect_stairs(caster_ptr, rad);
212 return _("燃素", "Phlogiston");
214 return _("光源に燃料を補給する。", "Adds more turns of light to a lantern or torch.");
218 phlogiston(caster_ptr);
225 return _("財宝感知", "Detect Treasure");
227 return _("近くの財宝を感知する。", "Detects all treasures in your vicinity.");
230 POSITION rad = DETECT_RAD_DEFAULT;
233 return info_radius(rad);
236 detect_treasure(caster_ptr, rad);
237 detect_objects_gold(caster_ptr, rad);
244 return _("魔法 感知", "Detect Enchantment");
246 return _("近くの魔法がかかったアイテムを感知する。", "Detects all magical items in your vicinity.");
249 POSITION rad = DETECT_RAD_DEFAULT;
252 return info_radius(rad);
255 detect_objects_magic(caster_ptr, rad);
262 return _("アイテム感知", "Detect Objects");
264 return _("近くの全てのアイテムを感知する。", "Detects all items in your vicinity.");
267 POSITION rad = DETECT_RAD_DEFAULT;
270 return info_radius(rad);
273 detect_objects_normal(caster_ptr, rad);
280 return _("解毒", "Cure Poison");
282 return _("毒を体内から完全に取り除く。", "Cures poison status.");
286 set_poisoned(caster_ptr, 0);
293 return _("耐冷", "Resist Cold");
295 return _("一定時間、冷気への耐性を得る。装備による耐性に累積する。",
296 "Gives resistance to cold. This resistance can be added to that from equipment for more powerful resistance.");
302 return info_duration(base, base);
305 set_oppose_cold(caster_ptr, randint1(base) + base, FALSE);
312 return _("耐火", "Resist Fire");
314 return _("一定時間、炎への耐性を得る。装備による耐性に累積する。",
315 "Gives resistance to fire. This resistance can be added to that from equipment for more powerful resistance.");
321 return info_duration(base, base);
324 set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
331 return _("耐電", "Resist Lightning");
333 return _("一定時間、電撃への耐性を得る。装備による耐性に累積する。",
334 "Gives resistance to electricity. This resistance can be added to that from equipment for more powerful resistance.");
340 return info_duration(base, base);
343 set_oppose_elec(caster_ptr, randint1(base) + base, FALSE);
350 return _("耐酸", "Resist Acid");
352 return _("一定時間、酸への耐性を得る。装備による耐性に累積する。",
353 "Gives resistance to acid. This resistance can be added to that from equipment for more powerful resistance.");
359 return info_duration(base, base);
362 set_oppose_acid(caster_ptr, randint1(base) + base, FALSE);
369 return _("重傷の治癒", "Cure Medium Wounds");
371 return _("怪我と体力を中程度回復させる。", "Heals cuts and HP.");
374 DICE_NUMBER dice = 4;
378 return info_heal(dice, sides, 0);
380 (void)cure_serious_wounds(caster_ptr, 4, 8);
386 return _("テレポート", "Teleport");
388 return _("遠距離のテレポートをする。", "Teleports you a long distance.");
391 POSITION range = plev * 5;
394 return info_range(range);
397 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
404 return _("鑑定", "Identify");
406 return _("アイテムを識別する。", "Identifies an item.");
410 if (!ident_spell(caster_ptr, FALSE, 0))
418 return _("岩石溶解", "Stone to Mud");
420 return _("壁を溶かして床にする。", "Turns one rock square to mud.");
423 DICE_NUMBER dice = 1;
428 return info_damage(dice, sides, base);
431 if (!get_aim_dir(caster_ptr, &dir))
434 wall_to_mud(caster_ptr, dir, 20 + randint1(30));
441 return _("閃光", "Ray of Light");
443 return _("光線を放つ。光りを嫌うモンスターに効果がある。", "Fires a beam of light which damages to light-sensitive monsters.");
446 DICE_NUMBER dice = 6;
450 return info_damage(dice, sides, 0);
453 if (!get_aim_dir(caster_ptr, &dir))
456 msg_print(_("光線が放たれた。", "A line of light appears."));
457 lite_line(caster_ptr, dir, damroll(6, 8));
464 return _("空腹充足", "Satisfy Hunger");
466 return _("満腹にする。", "Satisfies hunger.");
470 set_food(caster_ptr, PY_FOOD_MAX - 1);
477 return _("透明視認", "See Invisible");
479 return _("一定時間、透明なものが見えるようになる。", "Gives see invisible for a while.");
485 return info_duration(base, base);
488 set_tim_invis(caster_ptr, randint1(base) + base, FALSE);
495 return _("エレメンタル召喚", "Conjure Elemental");
497 return _("1体のエレメンタルを召喚する。", "Summons an elemental.");
500 if (!summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET))) {
501 msg_print(_("エレメンタルは現れなかった。", "No Elementals arrive."));
509 return _("テレポート・レベル", "Teleport Level");
511 return _("瞬時に上か下の階にテレポートする。", "Instantly teleports you up or down a level.");
515 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)")))
517 teleport_level(caster_ptr, 0);
524 return _("テレポート・モンスター", "Teleport Away");
526 return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
532 return info_power(power);
535 if (!get_aim_dir(caster_ptr, &dir))
538 fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
545 return _("元素の球", "Elemental Ball");
547 return _("炎、電撃、冷気、酸のどれかの球を放つ。", "Fires a ball of some elements.");
550 HIT_POINT dam = 75 + plev;
554 return info_damage(0, 0, dam);
559 if (!get_aim_dir(caster_ptr, &dir))
562 switch (randint1(4)) {
577 fire_ball(caster_ptr, type, dir, dam, rad);
584 return _("全感知", "Detection");
586 return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
587 "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
590 POSITION rad = DETECT_RAD_DEFAULT;
593 return info_radius(rad);
596 detect_all(caster_ptr, rad);
603 return _("帰還の呪文", "Word of Recall");
605 return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
606 "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
613 return info_delay(base, sides);
616 if (!recall_player(caster_ptr, randint0(21) + 15))
624 return _("千里眼", "Clairvoyance");
626 return _("その階全体を永久に照らし、ダンジョン内すべてのアイテムを感知する。さらに、一定時間テレパシー能力を得る。",
627 "Maps and lights whole dungeon level. Reveals locations of all objects. Gives telepathy for a while.");
634 return info_duration(base, sides);
637 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
638 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
640 wiz_lite(caster_ptr, FALSE);
642 if (!caster_ptr->telepathy) {
643 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);