1 #include "realm/realm-arcane.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "core/asking-player.h"
4 #include "io/targeting.h"
5 #include "monster-floor/monster-summon.h"
6 #include "monster-floor/place-monster-types.h"
7 #include "player/avatar.h"
8 #include "player/digestion-processor.h"
9 #include "spell-kind/spells-beam.h"
10 #include "spell-kind/spells-detection.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-perception.h"
15 #include "spell-kind/spells-recall.h"
16 #include "spell-kind/spells-teleport.h"
17 #include "spell/spell-types.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/bad-status-setter.h"
23 #include "status/element-resistance.h"
24 #include "status/sight-setter.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 if (name) return _("電撃", "Zap");
48 if (desc) return _("電撃のボルトもしくはビームを放つ。", "Fires a bolt or beam of lightning.");
51 DICE_NUMBER dice = 3 + (plev - 1) / 5;
54 if (info) return info_damage(dice, sides, 0);
58 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
60 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_ELEC, dir, damroll(dice, sides));
66 if (name) return _("魔法の施錠", "Wizard Lock");
67 if (desc) return _("扉に鍵をかける。", "Locks a door.");
72 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
74 wizard_lock(caster_ptr, dir);
80 if (name) return _("透明体感知", "Detect Invisibility");
81 if (desc) return _("近くの透明なモンスターを感知する。", "Detects all invisible monsters in your vicinity.");
84 POSITION rad = DETECT_RAD_DEFAULT;
86 if (info) return info_radius(rad);
90 detect_monsters_invis(caster_ptr, rad);
96 if (name) return _("モンスター感知", "Detect Monsters");
97 if (desc) return _("近くの全ての見えるモンスターを感知する。", "Detects all monsters in your vicinity unless invisible.");
100 POSITION rad = DETECT_RAD_DEFAULT;
102 if (info) return info_radius(rad);
106 detect_monsters_normal(caster_ptr, rad);
112 if (name) return _("ショート・テレポート", "Blink");
113 if (desc) return _("近距離のテレポートをする。", "Teleports you a short distance.");
118 if (info) return info_range(range);
122 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
128 if (name) return _("ライト・エリア", "Light Area");
129 if (desc) return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
132 DICE_NUMBER dice = 2;
133 DICE_SID sides = plev / 2;
134 POSITION rad = plev / 10 + 1;
136 if (info) return info_damage(dice, sides, 0);
140 lite_area(caster_ptr, damroll(dice, sides), rad);
146 if (name) return _("罠と扉 破壊", "Trap & Door Destruction");
147 if (desc) return _("一直線上の全ての罠と扉を破壊する。", "Fires a beam which destroy traps and doors.");
152 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
154 destroy_door(caster_ptr, dir);
160 if (name) return _("軽傷の治癒", "Cure Light Wounds");
161 if (desc) return _("怪我と体力を少し回復させる。", "Heals cuts and HP a little.");
164 DICE_NUMBER dice = 2;
167 if (info) return info_heal(dice, sides, 0);
168 if (cast) (void)cure_light_wounds(caster_ptr, dice, sides);
173 if (name) return _("罠と扉 感知", "Detect Doors & Traps");
174 if (desc) return _("近くの全ての罠と扉と階段を感知する。", "Detects traps, doors, and stairs in your vicinity.");
177 POSITION rad = DETECT_RAD_DEFAULT;
179 if (info) return info_radius(rad);
183 detect_traps(caster_ptr, rad, TRUE);
184 detect_doors(caster_ptr, rad);
185 detect_stairs(caster_ptr, rad);
191 if (name) return _("燃素", "Phlogiston");
192 if (desc) return _("光源に燃料を補給する。", "Adds more turns of light to a lantern or torch.");
197 phlogiston(caster_ptr);
203 if (name) return _("財宝感知", "Detect Treasure");
204 if (desc) return _("近くの財宝を感知する。", "Detects all treasures in your vicinity.");
207 POSITION rad = DETECT_RAD_DEFAULT;
209 if (info) return info_radius(rad);
213 detect_treasure(caster_ptr, rad);
214 detect_objects_gold(caster_ptr, rad);
220 if (name) return _("魔法 感知", "Detect Enchantment");
221 if (desc) return _("近くの魔法がかかったアイテムを感知する。", "Detects all magical items in your vicinity.");
224 POSITION rad = DETECT_RAD_DEFAULT;
226 if (info) return info_radius(rad);
230 detect_objects_magic(caster_ptr, rad);
236 if (name) return _("アイテム感知", "Detect Objects");
237 if (desc) return _("近くの全てのアイテムを感知する。", "Detects all items in your vicinity.");
240 POSITION rad = DETECT_RAD_DEFAULT;
242 if (info) return info_radius(rad);
246 detect_objects_normal(caster_ptr, rad);
252 if (name) return _("解毒", "Cure Poison");
253 if (desc) return _("毒を体内から完全に取り除く。", "Cures poison status.");
258 set_poisoned(caster_ptr, 0);
264 if (name) return _("耐冷", "Resist Cold");
265 if (desc) return _("一定時間、冷気への耐性を得る。装備による耐性に累積する。", "Gives resistance to cold. This resistance can be added to that from equipment for more powerful resistance.");
270 if (info) return info_duration(base, base);
274 set_oppose_cold(caster_ptr, randint1(base) + base, FALSE);
280 if (name) return _("耐火", "Resist Fire");
281 if (desc) return _("一定時間、炎への耐性を得る。装備による耐性に累積する。",
282 "Gives resistance to fire. This resistance can be added to that from equipment for more powerful resistance.");
287 if (info) return info_duration(base, base);
291 set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
297 if (name) return _("耐電", "Resist Lightning");
298 if (desc) return _("一定時間、電撃への耐性を得る。装備による耐性に累積する。",
299 "Gives resistance to electricity. This resistance can be added to that from equipment for more powerful resistance.");
304 if (info) return info_duration(base, base);
308 set_oppose_elec(caster_ptr, randint1(base) + base, FALSE);
314 if (name) return _("耐酸", "Resist Acid");
315 if (desc) return _("一定時間、酸への耐性を得る。装備による耐性に累積する。",
316 "Gives resistance to acid. This resistance can be added to that from equipment for more powerful resistance.");
321 if (info) return info_duration(base, base);
325 set_oppose_acid(caster_ptr, randint1(base) + base, FALSE);
331 if (name) return _("重傷の治癒", "Cure Medium Wounds");
332 if (desc) return _("怪我と体力を中程度回復させる。", "Heals cuts and HP.");
335 DICE_NUMBER dice = 4;
338 if (info) return info_heal(dice, sides, 0);
339 if (cast) (void)cure_serious_wounds(caster_ptr, 4, 8);
344 if (name) return _("テレポート", "Teleport");
345 if (desc) return _("遠距離のテレポートをする。", "Teleports you a long distance.");
348 POSITION range = plev * 5;
350 if (info) return info_range(range);
354 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
360 if (name) return _("鑑定", "Identify");
361 if (desc) return _("アイテムを識別する。", "Identifies an item.");
366 if (!ident_spell(caster_ptr, FALSE, 0)) return NULL;
372 if (name) return _("岩石溶解", "Stone to Mud");
373 if (desc) return _("壁を溶かして床にする。", "Turns one rock square to mud.");
376 DICE_NUMBER dice = 1;
380 if (info) return info_damage(dice, sides, base);
384 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
386 wall_to_mud(caster_ptr, dir, 20 + randint1(30));
392 if (name) return _("閃光", "Ray of Light");
393 if (desc) return _("光線を放つ。光りを嫌うモンスターに効果がある。", "Fires a beam of light which damages to light-sensitive monsters.");
396 DICE_NUMBER dice = 6;
399 if (info) return info_damage(dice, sides, 0);
403 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
405 msg_print(_("光線が放たれた。", "A line of light appears."));
406 lite_line(caster_ptr, dir, damroll(6, 8));
412 if (name) return _("空腹充足", "Satisfy Hunger");
413 if (desc) return _("満腹にする。", "Satisfies hunger.");
418 set_food(caster_ptr, PY_FOOD_MAX - 1);
424 if (name) return _("透明視認", "See Invisible");
425 if (desc) return _("一定時間、透明なものが見えるようになる。", "Gives see invisible for a while.");
430 if (info) return info_duration(base, base);
434 set_tim_invis(caster_ptr, randint1(base) + base, FALSE);
440 if (name) return _("エレメンタル召喚", "Conjure Elemental");
441 if (desc) return _("1体のエレメンタルを召喚する。", "Summons an elemental.");
445 if (!summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
447 msg_print(_("エレメンタルは現れなかった。", "No Elementals arrive."));
454 if (name) return _("テレポート・レベル", "Teleport Level");
455 if (desc) return _("瞬時に上か下の階にテレポートする。", "Instantly teleports you up or down a level.");
460 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return NULL;
461 teleport_level(caster_ptr, 0);
467 if (name) return _("テレポート・モンスター", "Teleport Away");
468 if (desc) return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
473 if (info) return info_power(power);
477 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
479 fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
485 if (name) return _("元素の球", "Elemental Ball");
486 if (desc) return _("炎、電撃、冷気、酸のどれかの球を放つ。", "Fires a ball of some elements.");
489 HIT_POINT dam = 75 + plev;
492 if (info) return info_damage(0, 0, dam);
498 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
502 case 1: type = GF_FIRE; break;
503 case 2: type = GF_ELEC; break;
504 case 3: type = GF_COLD; break;
505 default: type = GF_ACID; break;
508 fire_ball(caster_ptr, type, dir, dam, rad);
514 if (name) return _("全感知", "Detection");
515 if (desc) return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
516 "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
519 POSITION rad = DETECT_RAD_DEFAULT;
521 if (info) return info_radius(rad);
525 detect_all(caster_ptr, rad);
531 if (name) return _("帰還の呪文", "Word of Recall");
532 if (desc) return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
533 "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
539 if (info) return info_delay(base, sides);
543 if (!recall_player(caster_ptr, randint0(21) + 15)) return NULL;
549 if (name) return _("千里眼", "Clairvoyance");
550 if (desc) return _("その階全体を永久に照らし、ダンジョン内すべてのアイテムを感知する。さらに、一定時間テレパシー能力を得る。",
551 "Maps and lights whole dungeon level. Reveals locations of all objects. Gives telepathy for a while.");
557 if (info) return info_duration(base, sides);
561 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
562 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
564 wiz_lite(caster_ptr, FALSE);
566 if (!caster_ptr->telepathy)
568 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);