1 #include "realm/realm-arcane.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "io/targeting.h"
4 #include "monster-floor/monster-generator.h"
5 #include "monster-floor/place-monster-types.h"
6 #include "player/avatar.h"
7 #include "player/player-effects.h"
8 #include "player/player-status.h"
9 #include "spell-kind/spells-beam.h"
10 #include "spell-kind/spells-detection.h"
11 #include "spell/spells-diceroll.h"
12 #include "spell-kind/spells-floor.h"
13 #include "spell-kind/spells-launcher.h"
14 #include "spell-kind/spells-lite.h"
15 #include "spell/spells-object.h"
16 #include "spell/spells-status.h"
17 #include "spell/spells-summon.h"
18 #include "spell-kind/spells-teleport.h"
19 #include "spell/spells-type.h"
20 #include "spell/spells3.h"
21 #include "util/util.h"
24 * @brief 秘術領域魔法の各処理を行う
25 * @param caster_ptr プレーヤーへの参照ポインタ
27 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
28 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
30 concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
32 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
33 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
34 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
35 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
38 PLAYER_LEVEL plev = caster_ptr->lev;
43 if (name) return _("電撃", "Zap");
44 if (desc) return _("電撃のボルトもしくはビームを放つ。", "Fires a bolt or beam of lightning.");
47 DICE_NUMBER dice = 3 + (plev - 1) / 5;
50 if (info) return info_damage(dice, sides, 0);
54 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
56 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_ELEC, dir, damroll(dice, sides));
62 if (name) return _("魔法の施錠", "Wizard Lock");
63 if (desc) return _("扉に鍵をかける。", "Locks a door.");
68 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
70 wizard_lock(caster_ptr, dir);
76 if (name) return _("透明体感知", "Detect Invisibility");
77 if (desc) return _("近くの透明なモンスターを感知する。", "Detects all invisible monsters in your vicinity.");
80 POSITION rad = DETECT_RAD_DEFAULT;
82 if (info) return info_radius(rad);
86 detect_monsters_invis(caster_ptr, rad);
92 if (name) return _("モンスター感知", "Detect Monsters");
93 if (desc) return _("近くの全ての見えるモンスターを感知する。", "Detects all monsters in your vicinity unless invisible.");
96 POSITION rad = DETECT_RAD_DEFAULT;
98 if (info) return info_radius(rad);
102 detect_monsters_normal(caster_ptr, rad);
108 if (name) return _("ショート・テレポート", "Blink");
109 if (desc) return _("近距離のテレポートをする。", "Teleports you a short distance.");
114 if (info) return info_range(range);
118 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
124 if (name) return _("ライト・エリア", "Light Area");
125 if (desc) return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
128 DICE_NUMBER dice = 2;
129 DICE_SID sides = plev / 2;
130 POSITION rad = plev / 10 + 1;
132 if (info) return info_damage(dice, sides, 0);
136 lite_area(caster_ptr, damroll(dice, sides), rad);
142 if (name) return _("罠と扉 破壊", "Trap & Door Destruction");
143 if (desc) return _("一直線上の全ての罠と扉を破壊する。", "Fires a beam which destroy traps and doors.");
148 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
150 destroy_door(caster_ptr, dir);
156 if (name) return _("軽傷の治癒", "Cure Light Wounds");
157 if (desc) return _("怪我と体力を少し回復させる。", "Heals cuts and HP a little.");
160 DICE_NUMBER dice = 2;
163 if (info) return info_heal(dice, sides, 0);
164 if (cast) (void)cure_light_wounds(caster_ptr, dice, sides);
169 if (name) return _("罠と扉 感知", "Detect Doors & Traps");
170 if (desc) return _("近くの全ての罠と扉と階段を感知する。", "Detects traps, doors, and stairs in your vicinity.");
173 POSITION rad = DETECT_RAD_DEFAULT;
175 if (info) return info_radius(rad);
179 detect_traps(caster_ptr, rad, TRUE);
180 detect_doors(caster_ptr, rad);
181 detect_stairs(caster_ptr, rad);
187 if (name) return _("燃素", "Phlogiston");
188 if (desc) return _("光源に燃料を補給する。", "Adds more turns of light to a lantern or torch.");
193 phlogiston(caster_ptr);
199 if (name) return _("財宝感知", "Detect Treasure");
200 if (desc) return _("近くの財宝を感知する。", "Detects all treasures in your vicinity.");
203 POSITION rad = DETECT_RAD_DEFAULT;
205 if (info) return info_radius(rad);
209 detect_treasure(caster_ptr, rad);
210 detect_objects_gold(caster_ptr, rad);
216 if (name) return _("魔法 感知", "Detect Enchantment");
217 if (desc) return _("近くの魔法がかかったアイテムを感知する。", "Detects all magical items in your vicinity.");
220 POSITION rad = DETECT_RAD_DEFAULT;
222 if (info) return info_radius(rad);
226 detect_objects_magic(caster_ptr, rad);
232 if (name) return _("アイテム感知", "Detect Objects");
233 if (desc) return _("近くの全てのアイテムを感知する。", "Detects all items in your vicinity.");
236 POSITION rad = DETECT_RAD_DEFAULT;
238 if (info) return info_radius(rad);
242 detect_objects_normal(caster_ptr, rad);
248 if (name) return _("解毒", "Cure Poison");
249 if (desc) return _("毒を体内から完全に取り除く。", "Cures poison status.");
254 set_poisoned(caster_ptr, 0);
260 if (name) return _("耐冷", "Resist Cold");
261 if (desc) return _("一定時間、冷気への耐性を得る。装備による耐性に累積する。", "Gives resistance to cold. This resistance can be added to that from equipment for more powerful resistance.");
266 if (info) return info_duration(base, base);
270 set_oppose_cold(caster_ptr, randint1(base) + base, FALSE);
276 if (name) return _("耐火", "Resist Fire");
277 if (desc) return _("一定時間、炎への耐性を得る。装備による耐性に累積する。",
278 "Gives resistance to fire. This resistance can be added to that from equipment for more powerful resistance.");
283 if (info) return info_duration(base, base);
287 set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
293 if (name) return _("耐電", "Resist Lightning");
294 if (desc) return _("一定時間、電撃への耐性を得る。装備による耐性に累積する。",
295 "Gives resistance to electricity. This resistance can be added to that from equipment for more powerful resistance.");
300 if (info) return info_duration(base, base);
304 set_oppose_elec(caster_ptr, randint1(base) + base, FALSE);
310 if (name) return _("耐酸", "Resist Acid");
311 if (desc) return _("一定時間、酸への耐性を得る。装備による耐性に累積する。",
312 "Gives resistance to acid. This resistance can be added to that from equipment for more powerful resistance.");
317 if (info) return info_duration(base, base);
321 set_oppose_acid(caster_ptr, randint1(base) + base, FALSE);
327 if (name) return _("重傷の治癒", "Cure Medium Wounds");
328 if (desc) return _("怪我と体力を中程度回復させる。", "Heals cuts and HP.");
331 DICE_NUMBER dice = 4;
334 if (info) return info_heal(dice, sides, 0);
335 if (cast) (void)cure_serious_wounds(caster_ptr, 4, 8);
340 if (name) return _("テレポート", "Teleport");
341 if (desc) return _("遠距離のテレポートをする。", "Teleports you a long distance.");
344 POSITION range = plev * 5;
346 if (info) return info_range(range);
350 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
356 if (name) return _("鑑定", "Identify");
357 if (desc) return _("アイテムを識別する。", "Identifies an item.");
362 if (!ident_spell(caster_ptr, FALSE, 0)) return NULL;
368 if (name) return _("岩石溶解", "Stone to Mud");
369 if (desc) return _("壁を溶かして床にする。", "Turns one rock square to mud.");
372 DICE_NUMBER dice = 1;
376 if (info) return info_damage(dice, sides, base);
380 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
382 wall_to_mud(caster_ptr, dir, 20 + randint1(30));
388 if (name) return _("閃光", "Ray of Light");
389 if (desc) return _("光線を放つ。光りを嫌うモンスターに効果がある。", "Fires a beam of light which damages to light-sensitive monsters.");
392 DICE_NUMBER dice = 6;
395 if (info) return info_damage(dice, sides, 0);
399 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
401 msg_print(_("光線が放たれた。", "A line of light appears."));
402 lite_line(caster_ptr, dir, damroll(6, 8));
408 if (name) return _("空腹充足", "Satisfy Hunger");
409 if (desc) return _("満腹にする。", "Satisfies hunger.");
414 set_food(caster_ptr, PY_FOOD_MAX - 1);
420 if (name) return _("透明視認", "See Invisible");
421 if (desc) return _("一定時間、透明なものが見えるようになる。", "Gives see invisible for a while.");
426 if (info) return info_duration(base, base);
430 set_tim_invis(caster_ptr, randint1(base) + base, FALSE);
436 if (name) return _("エレメンタル召喚", "Conjure Elemental");
437 if (desc) return _("1体のエレメンタルを召喚する。", "Summons an elemental.");
441 if (!summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
443 msg_print(_("エレメンタルは現れなかった。", "No Elementals arrive."));
450 if (name) return _("テレポート・レベル", "Teleport Level");
451 if (desc) return _("瞬時に上か下の階にテレポートする。", "Instantly teleports you up or down a level.");
456 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return NULL;
457 teleport_level(caster_ptr, 0);
463 if (name) return _("テレポート・モンスター", "Teleport Away");
464 if (desc) return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
469 if (info) return info_power(power);
473 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
475 fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
481 if (name) return _("元素の球", "Elemental Ball");
482 if (desc) return _("炎、電撃、冷気、酸のどれかの球を放つ。", "Fires a ball of some elements.");
485 HIT_POINT dam = 75 + plev;
488 if (info) return info_damage(0, 0, dam);
494 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
498 case 1: type = GF_FIRE; break;
499 case 2: type = GF_ELEC; break;
500 case 3: type = GF_COLD; break;
501 default: type = GF_ACID; break;
504 fire_ball(caster_ptr, type, dir, dam, rad);
510 if (name) return _("全感知", "Detection");
511 if (desc) return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
512 "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
515 POSITION rad = DETECT_RAD_DEFAULT;
517 if (info) return info_radius(rad);
521 detect_all(caster_ptr, rad);
527 if (name) return _("帰還の呪文", "Word of Recall");
528 if (desc) return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
529 "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
535 if (info) return info_delay(base, sides);
539 if (!recall_player(caster_ptr, randint0(21) + 15)) return NULL;
545 if (name) return _("千里眼", "Clairvoyance");
546 if (desc) return _("その階全体を永久に照らし、ダンジョン内すべてのアイテムを感知する。さらに、一定時間テレパシー能力を得る。",
547 "Maps and lights whole dungeon level. Reveals locations of all objects. Gives telepathy for a while.");
553 if (info) return info_duration(base, sides);
557 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
558 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
560 wiz_lite(caster_ptr, FALSE);
562 if (!caster_ptr->telepathy)
564 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);