1 #include "realm/realm-arcane.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "io/targeting.h"
4 #include "player/avatar.h"
5 #include "player/player-effects.h"
6 #include "player/player-status.h"
7 #include "spell/spells-detection.h"
8 #include "spell/spells-diceroll.h"
9 #include "spell/spells-floor.h"
10 #include "spell/spells-launcher.h"
11 #include "spell/spells-object.h"
12 #include "spell/spells-status.h"
13 #include "spell/spells-summon.h"
14 #include "spell/spells-teleport.h"
15 #include "spell/spells-type.h"
16 #include "spell/spells2.h"
17 #include "spell/spells3.h"
18 #include "util/util.h"
21 * @brief 秘術領域魔法の各処理を行う
22 * @param caster_ptr プレーヤーへの参照ポインタ
24 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
25 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
27 concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
29 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
30 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
31 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
32 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
35 PLAYER_LEVEL plev = caster_ptr->lev;
40 if (name) return _("電撃", "Zap");
41 if (desc) return _("電撃のボルトもしくはビームを放つ。", "Fires a bolt or beam of lightning.");
44 DICE_NUMBER dice = 3 + (plev - 1) / 5;
47 if (info) return info_damage(dice, sides, 0);
51 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
53 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_ELEC, dir, damroll(dice, sides));
59 if (name) return _("魔法の施錠", "Wizard Lock");
60 if (desc) return _("扉に鍵をかける。", "Locks a door.");
65 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
67 wizard_lock(caster_ptr, dir);
73 if (name) return _("透明体感知", "Detect Invisibility");
74 if (desc) return _("近くの透明なモンスターを感知する。", "Detects all invisible monsters in your vicinity.");
77 POSITION rad = DETECT_RAD_DEFAULT;
79 if (info) return info_radius(rad);
83 detect_monsters_invis(caster_ptr, rad);
89 if (name) return _("モンスター感知", "Detect Monsters");
90 if (desc) return _("近くの全ての見えるモンスターを感知する。", "Detects all monsters in your vicinity unless invisible.");
93 POSITION rad = DETECT_RAD_DEFAULT;
95 if (info) return info_radius(rad);
99 detect_monsters_normal(caster_ptr, rad);
105 if (name) return _("ショート・テレポート", "Blink");
106 if (desc) return _("近距離のテレポートをする。", "Teleports you a short distance.");
111 if (info) return info_range(range);
115 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
121 if (name) return _("ライト・エリア", "Light Area");
122 if (desc) return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
125 DICE_NUMBER dice = 2;
126 DICE_SID sides = plev / 2;
127 POSITION rad = plev / 10 + 1;
129 if (info) return info_damage(dice, sides, 0);
133 lite_area(caster_ptr, damroll(dice, sides), rad);
139 if (name) return _("罠と扉 破壊", "Trap & Door Destruction");
140 if (desc) return _("一直線上の全ての罠と扉を破壊する。", "Fires a beam which destroy traps and doors.");
145 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
147 destroy_door(caster_ptr, dir);
153 if (name) return _("軽傷の治癒", "Cure Light Wounds");
154 if (desc) return _("怪我と体力を少し回復させる。", "Heals cuts and HP a little.");
157 DICE_NUMBER dice = 2;
160 if (info) return info_heal(dice, sides, 0);
161 if (cast) (void)cure_light_wounds(caster_ptr, dice, sides);
166 if (name) return _("罠と扉 感知", "Detect Doors & Traps");
167 if (desc) return _("近くの全ての罠と扉と階段を感知する。", "Detects traps, doors, and stairs in your vicinity.");
170 POSITION rad = DETECT_RAD_DEFAULT;
172 if (info) return info_radius(rad);
176 detect_traps(caster_ptr, rad, TRUE);
177 detect_doors(caster_ptr, rad);
178 detect_stairs(caster_ptr, rad);
184 if (name) return _("燃素", "Phlogiston");
185 if (desc) return _("光源に燃料を補給する。", "Adds more turns of light to a lantern or torch.");
190 phlogiston(caster_ptr);
196 if (name) return _("財宝感知", "Detect Treasure");
197 if (desc) return _("近くの財宝を感知する。", "Detects all treasures in your vicinity.");
200 POSITION rad = DETECT_RAD_DEFAULT;
202 if (info) return info_radius(rad);
206 detect_treasure(caster_ptr, rad);
207 detect_objects_gold(caster_ptr, rad);
213 if (name) return _("魔法 感知", "Detect Enchantment");
214 if (desc) return _("近くの魔法がかかったアイテムを感知する。", "Detects all magical items in your vicinity.");
217 POSITION rad = DETECT_RAD_DEFAULT;
219 if (info) return info_radius(rad);
223 detect_objects_magic(caster_ptr, rad);
229 if (name) return _("アイテム感知", "Detect Objects");
230 if (desc) return _("近くの全てのアイテムを感知する。", "Detects all items in your vicinity.");
233 POSITION rad = DETECT_RAD_DEFAULT;
235 if (info) return info_radius(rad);
239 detect_objects_normal(caster_ptr, rad);
245 if (name) return _("解毒", "Cure Poison");
246 if (desc) return _("毒を体内から完全に取り除く。", "Cures poison status.");
251 set_poisoned(caster_ptr, 0);
257 if (name) return _("耐冷", "Resist Cold");
258 if (desc) return _("一定時間、冷気への耐性を得る。装備による耐性に累積する。", "Gives resistance to cold. This resistance can be added to that from equipment for more powerful resistance.");
263 if (info) return info_duration(base, base);
267 set_oppose_cold(caster_ptr, randint1(base) + base, FALSE);
273 if (name) return _("耐火", "Resist Fire");
274 if (desc) return _("一定時間、炎への耐性を得る。装備による耐性に累積する。",
275 "Gives resistance to fire. This resistance can be added to that from equipment for more powerful resistance.");
280 if (info) return info_duration(base, base);
284 set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
290 if (name) return _("耐電", "Resist Lightning");
291 if (desc) return _("一定時間、電撃への耐性を得る。装備による耐性に累積する。",
292 "Gives resistance to electricity. This resistance can be added to that from equipment for more powerful resistance.");
297 if (info) return info_duration(base, base);
301 set_oppose_elec(caster_ptr, randint1(base) + base, FALSE);
307 if (name) return _("耐酸", "Resist Acid");
308 if (desc) return _("一定時間、酸への耐性を得る。装備による耐性に累積する。",
309 "Gives resistance to acid. This resistance can be added to that from equipment for more powerful resistance.");
314 if (info) return info_duration(base, base);
318 set_oppose_acid(caster_ptr, randint1(base) + base, FALSE);
324 if (name) return _("重傷の治癒", "Cure Medium Wounds");
325 if (desc) return _("怪我と体力を中程度回復させる。", "Heals cuts and HP.");
328 DICE_NUMBER dice = 4;
331 if (info) return info_heal(dice, sides, 0);
332 if (cast) (void)cure_serious_wounds(caster_ptr, 4, 8);
337 if (name) return _("テレポート", "Teleport");
338 if (desc) return _("遠距離のテレポートをする。", "Teleports you a long distance.");
341 POSITION range = plev * 5;
343 if (info) return info_range(range);
347 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
353 if (name) return _("鑑定", "Identify");
354 if (desc) return _("アイテムを識別する。", "Identifies an item.");
359 if (!ident_spell(caster_ptr, FALSE, 0)) return NULL;
365 if (name) return _("岩石溶解", "Stone to Mud");
366 if (desc) return _("壁を溶かして床にする。", "Turns one rock square to mud.");
369 DICE_NUMBER dice = 1;
373 if (info) return info_damage(dice, sides, base);
377 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
379 wall_to_mud(caster_ptr, dir, 20 + randint1(30));
385 if (name) return _("閃光", "Ray of Light");
386 if (desc) return _("光線を放つ。光りを嫌うモンスターに効果がある。", "Fires a beam of light which damages to light-sensitive monsters.");
389 DICE_NUMBER dice = 6;
392 if (info) return info_damage(dice, sides, 0);
396 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
398 msg_print(_("光線が放たれた。", "A line of light appears."));
399 lite_line(caster_ptr, dir, damroll(6, 8));
405 if (name) return _("空腹充足", "Satisfy Hunger");
406 if (desc) return _("満腹にする。", "Satisfies hunger.");
411 set_food(caster_ptr, PY_FOOD_MAX - 1);
417 if (name) return _("透明視認", "See Invisible");
418 if (desc) return _("一定時間、透明なものが見えるようになる。", "Gives see invisible for a while.");
423 if (info) return info_duration(base, base);
427 set_tim_invis(caster_ptr, randint1(base) + base, FALSE);
433 if (name) return _("エレメンタル召喚", "Conjure Elemental");
434 if (desc) return _("1体のエレメンタルを召喚する。", "Summons an elemental.");
438 if (!summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
440 msg_print(_("エレメンタルは現れなかった。", "No Elementals arrive."));
447 if (name) return _("テレポート・レベル", "Teleport Level");
448 if (desc) return _("瞬時に上か下の階にテレポートする。", "Instantly teleports you up or down a level.");
453 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return NULL;
454 teleport_level(caster_ptr, 0);
460 if (name) return _("テレポート・モンスター", "Teleport Away");
461 if (desc) return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
466 if (info) return info_power(power);
470 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
472 fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
478 if (name) return _("元素の球", "Elemental Ball");
479 if (desc) return _("炎、電撃、冷気、酸のどれかの球を放つ。", "Fires a ball of some elements.");
482 HIT_POINT dam = 75 + plev;
485 if (info) return info_damage(0, 0, dam);
491 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
495 case 1: type = GF_FIRE; break;
496 case 2: type = GF_ELEC; break;
497 case 3: type = GF_COLD; break;
498 default: type = GF_ACID; break;
501 fire_ball(caster_ptr, type, dir, dam, rad);
507 if (name) return _("全感知", "Detection");
508 if (desc) return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
509 "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
512 POSITION rad = DETECT_RAD_DEFAULT;
514 if (info) return info_radius(rad);
518 detect_all(caster_ptr, rad);
524 if (name) return _("帰還の呪文", "Word of Recall");
525 if (desc) return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
526 "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
532 if (info) return info_delay(base, sides);
536 if (!recall_player(caster_ptr, randint0(21) + 15)) return NULL;
542 if (name) return _("千里眼", "Clairvoyance");
543 if (desc) return _("その階全体を永久に照らし、ダンジョン内すべてのアイテムを感知する。さらに、一定時間テレパシー能力を得る。",
544 "Maps and lights whole dungeon level. Reveals locations of all objects. Gives telepathy for a while.");
550 if (info) return info_duration(base, sides);
554 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
555 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
557 wiz_lite(caster_ptr, FALSE);
559 if (!caster_ptr->telepathy)
561 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);