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/player-effects.h"
9 #include "player/player-status.h"
10 #include "spell-kind/spells-beam.h"
11 #include "spell-kind/spells-detection.h"
12 #include "spell/spells-diceroll.h"
13 #include "spell-kind/spells-floor.h"
14 #include "spell-kind/spells-launcher.h"
15 #include "spell-kind/spells-lite.h"
16 #include "spell/spells-object.h"
17 #include "spell/spells-status.h"
18 #include "spell/spells-summon.h"
19 #include "spell-kind/spells-teleport.h"
20 #include "spell/spell-types.h"
21 #include "spell/spells3.h"
22 #include "view/display-messages.h"
25 * @brief 秘術領域魔法の各処理を行う
26 * @param caster_ptr プレーヤーへの参照ポインタ
28 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
29 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
31 concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
33 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
34 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
35 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
36 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
39 PLAYER_LEVEL plev = caster_ptr->lev;
44 if (name) return _("電撃", "Zap");
45 if (desc) return _("電撃のボルトもしくはビームを放つ。", "Fires a bolt or beam of lightning.");
48 DICE_NUMBER dice = 3 + (plev - 1) / 5;
51 if (info) return info_damage(dice, sides, 0);
55 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
57 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_ELEC, dir, damroll(dice, sides));
63 if (name) return _("魔法の施錠", "Wizard Lock");
64 if (desc) return _("扉に鍵をかける。", "Locks a door.");
69 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
71 wizard_lock(caster_ptr, dir);
77 if (name) return _("透明体感知", "Detect Invisibility");
78 if (desc) return _("近くの透明なモンスターを感知する。", "Detects all invisible monsters in your vicinity.");
81 POSITION rad = DETECT_RAD_DEFAULT;
83 if (info) return info_radius(rad);
87 detect_monsters_invis(caster_ptr, rad);
93 if (name) return _("モンスター感知", "Detect Monsters");
94 if (desc) return _("近くの全ての見えるモンスターを感知する。", "Detects all monsters in your vicinity unless invisible.");
97 POSITION rad = DETECT_RAD_DEFAULT;
99 if (info) return info_radius(rad);
103 detect_monsters_normal(caster_ptr, rad);
109 if (name) return _("ショート・テレポート", "Blink");
110 if (desc) return _("近距離のテレポートをする。", "Teleports you a short distance.");
115 if (info) return info_range(range);
119 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
125 if (name) return _("ライト・エリア", "Light Area");
126 if (desc) return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
129 DICE_NUMBER dice = 2;
130 DICE_SID sides = plev / 2;
131 POSITION rad = plev / 10 + 1;
133 if (info) return info_damage(dice, sides, 0);
137 lite_area(caster_ptr, damroll(dice, sides), rad);
143 if (name) return _("罠と扉 破壊", "Trap & Door Destruction");
144 if (desc) return _("一直線上の全ての罠と扉を破壊する。", "Fires a beam which destroy traps and doors.");
149 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
151 destroy_door(caster_ptr, dir);
157 if (name) return _("軽傷の治癒", "Cure Light Wounds");
158 if (desc) return _("怪我と体力を少し回復させる。", "Heals cuts and HP a little.");
161 DICE_NUMBER dice = 2;
164 if (info) return info_heal(dice, sides, 0);
165 if (cast) (void)cure_light_wounds(caster_ptr, dice, sides);
170 if (name) return _("罠と扉 感知", "Detect Doors & Traps");
171 if (desc) return _("近くの全ての罠と扉と階段を感知する。", "Detects traps, doors, and stairs in your vicinity.");
174 POSITION rad = DETECT_RAD_DEFAULT;
176 if (info) return info_radius(rad);
180 detect_traps(caster_ptr, rad, TRUE);
181 detect_doors(caster_ptr, rad);
182 detect_stairs(caster_ptr, rad);
188 if (name) return _("燃素", "Phlogiston");
189 if (desc) return _("光源に燃料を補給する。", "Adds more turns of light to a lantern or torch.");
194 phlogiston(caster_ptr);
200 if (name) return _("財宝感知", "Detect Treasure");
201 if (desc) return _("近くの財宝を感知する。", "Detects all treasures in your vicinity.");
204 POSITION rad = DETECT_RAD_DEFAULT;
206 if (info) return info_radius(rad);
210 detect_treasure(caster_ptr, rad);
211 detect_objects_gold(caster_ptr, rad);
217 if (name) return _("魔法 感知", "Detect Enchantment");
218 if (desc) return _("近くの魔法がかかったアイテムを感知する。", "Detects all magical items in your vicinity.");
221 POSITION rad = DETECT_RAD_DEFAULT;
223 if (info) return info_radius(rad);
227 detect_objects_magic(caster_ptr, rad);
233 if (name) return _("アイテム感知", "Detect Objects");
234 if (desc) return _("近くの全てのアイテムを感知する。", "Detects all items in your vicinity.");
237 POSITION rad = DETECT_RAD_DEFAULT;
239 if (info) return info_radius(rad);
243 detect_objects_normal(caster_ptr, rad);
249 if (name) return _("解毒", "Cure Poison");
250 if (desc) return _("毒を体内から完全に取り除く。", "Cures poison status.");
255 set_poisoned(caster_ptr, 0);
261 if (name) return _("耐冷", "Resist Cold");
262 if (desc) return _("一定時間、冷気への耐性を得る。装備による耐性に累積する。", "Gives resistance to cold. This resistance can be added to that from equipment for more powerful resistance.");
267 if (info) return info_duration(base, base);
271 set_oppose_cold(caster_ptr, randint1(base) + base, FALSE);
277 if (name) return _("耐火", "Resist Fire");
278 if (desc) return _("一定時間、炎への耐性を得る。装備による耐性に累積する。",
279 "Gives resistance to fire. This resistance can be added to that from equipment for more powerful resistance.");
284 if (info) return info_duration(base, base);
288 set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
294 if (name) return _("耐電", "Resist Lightning");
295 if (desc) return _("一定時間、電撃への耐性を得る。装備による耐性に累積する。",
296 "Gives resistance to electricity. This resistance can be added to that from equipment for more powerful resistance.");
301 if (info) return info_duration(base, base);
305 set_oppose_elec(caster_ptr, randint1(base) + base, FALSE);
311 if (name) return _("耐酸", "Resist Acid");
312 if (desc) return _("一定時間、酸への耐性を得る。装備による耐性に累積する。",
313 "Gives resistance to acid. This resistance can be added to that from equipment for more powerful resistance.");
318 if (info) return info_duration(base, base);
322 set_oppose_acid(caster_ptr, randint1(base) + base, FALSE);
328 if (name) return _("重傷の治癒", "Cure Medium Wounds");
329 if (desc) return _("怪我と体力を中程度回復させる。", "Heals cuts and HP.");
332 DICE_NUMBER dice = 4;
335 if (info) return info_heal(dice, sides, 0);
336 if (cast) (void)cure_serious_wounds(caster_ptr, 4, 8);
341 if (name) return _("テレポート", "Teleport");
342 if (desc) return _("遠距離のテレポートをする。", "Teleports you a long distance.");
345 POSITION range = plev * 5;
347 if (info) return info_range(range);
351 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
357 if (name) return _("鑑定", "Identify");
358 if (desc) return _("アイテムを識別する。", "Identifies an item.");
363 if (!ident_spell(caster_ptr, FALSE, 0)) return NULL;
369 if (name) return _("岩石溶解", "Stone to Mud");
370 if (desc) return _("壁を溶かして床にする。", "Turns one rock square to mud.");
373 DICE_NUMBER dice = 1;
377 if (info) return info_damage(dice, sides, base);
381 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
383 wall_to_mud(caster_ptr, dir, 20 + randint1(30));
389 if (name) return _("閃光", "Ray of Light");
390 if (desc) return _("光線を放つ。光りを嫌うモンスターに効果がある。", "Fires a beam of light which damages to light-sensitive monsters.");
393 DICE_NUMBER dice = 6;
396 if (info) return info_damage(dice, sides, 0);
400 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
402 msg_print(_("光線が放たれた。", "A line of light appears."));
403 lite_line(caster_ptr, dir, damroll(6, 8));
409 if (name) return _("空腹充足", "Satisfy Hunger");
410 if (desc) return _("満腹にする。", "Satisfies hunger.");
415 set_food(caster_ptr, PY_FOOD_MAX - 1);
421 if (name) return _("透明視認", "See Invisible");
422 if (desc) return _("一定時間、透明なものが見えるようになる。", "Gives see invisible for a while.");
427 if (info) return info_duration(base, base);
431 set_tim_invis(caster_ptr, randint1(base) + base, FALSE);
437 if (name) return _("エレメンタル召喚", "Conjure Elemental");
438 if (desc) return _("1体のエレメンタルを召喚する。", "Summons an elemental.");
442 if (!summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
444 msg_print(_("エレメンタルは現れなかった。", "No Elementals arrive."));
451 if (name) return _("テレポート・レベル", "Teleport Level");
452 if (desc) return _("瞬時に上か下の階にテレポートする。", "Instantly teleports you up or down a level.");
457 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return NULL;
458 teleport_level(caster_ptr, 0);
464 if (name) return _("テレポート・モンスター", "Teleport Away");
465 if (desc) return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
470 if (info) return info_power(power);
474 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
476 fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
482 if (name) return _("元素の球", "Elemental Ball");
483 if (desc) return _("炎、電撃、冷気、酸のどれかの球を放つ。", "Fires a ball of some elements.");
486 HIT_POINT dam = 75 + plev;
489 if (info) return info_damage(0, 0, dam);
495 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
499 case 1: type = GF_FIRE; break;
500 case 2: type = GF_ELEC; break;
501 case 3: type = GF_COLD; break;
502 default: type = GF_ACID; break;
505 fire_ball(caster_ptr, type, dir, dam, rad);
511 if (name) return _("全感知", "Detection");
512 if (desc) return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
513 "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
516 POSITION rad = DETECT_RAD_DEFAULT;
518 if (info) return info_radius(rad);
522 detect_all(caster_ptr, rad);
528 if (name) return _("帰還の呪文", "Word of Recall");
529 if (desc) return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
530 "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
536 if (info) return info_delay(base, sides);
540 if (!recall_player(caster_ptr, randint0(21) + 15)) return NULL;
546 if (name) return _("千里眼", "Clairvoyance");
547 if (desc) return _("その階全体を永久に照らし、ダンジョン内すべてのアイテムを感知する。さらに、一定時間テレパシー能力を得る。",
548 "Maps and lights whole dungeon level. Reveals locations of all objects. Gives telepathy for a while.");
554 if (info) return info_duration(base, sides);
558 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
559 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
561 wiz_lite(caster_ptr, FALSE);
563 if (!caster_ptr->telepathy)
565 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);