8 #include "spells-floor.h"
9 #include "spells-object.h"
10 #include "spells-summon.h"
11 #include "spells-status.h"
12 #include "player-status.h"
13 #include "player-effects.h"
14 #include "targeting.h"
17 * @brief 秘術領域魔法の各処理を行う
19 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
20 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
22 concptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
24 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
25 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
26 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
27 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
30 PLAYER_LEVEL plev = p_ptr->lev;
35 if (name) return _("電撃", "Zap");
36 if (desc) return _("電撃のボルトもしくはビームを放つ。", "Fires a bolt or beam of lightning.");
39 DICE_NUMBER dice = 3 + (plev - 1) / 5;
42 if (info) return info_damage(dice, sides, 0);
46 if (!get_aim_dir(&dir)) return NULL;
48 fire_bolt_or_beam(beam_chance() - 10, GF_ELEC, dir, damroll(dice, sides));
54 if (name) return _("魔法の施錠", "Wizard Lock");
55 if (desc) return _("扉に鍵をかける。", "Locks a door.");
60 if (!get_aim_dir(&dir)) return NULL;
68 if (name) return _("透明体感知", "Detect Invisibility");
69 if (desc) return _("近くの透明なモンスターを感知する。", "Detects all invisible monsters in your vicinity.");
72 POSITION rad = DETECT_RAD_DEFAULT;
74 if (info) return info_radius(rad);
78 detect_monsters_invis(rad);
84 if (name) return _("モンスター感知", "Detect Monsters");
85 if (desc) return _("近くの全ての見えるモンスターを感知する。", "Detects all monsters in your vicinity unless invisible.");
88 POSITION rad = DETECT_RAD_DEFAULT;
90 if (info) return info_radius(rad);
94 detect_monsters_normal(rad);
100 if (name) return _("ショート・テレポート", "Blink");
101 if (desc) return _("近距離のテレポートをする。", "Teleport short distance.");
106 if (info) return info_range(range);
110 teleport_player(range, 0L);
116 if (name) return _("ライト・エリア", "Light Area");
117 if (desc) return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
120 DICE_NUMBER dice = 2;
121 DICE_SID sides = plev / 2;
122 POSITION rad = plev / 10 + 1;
124 if (info) return info_damage(dice, sides, 0);
128 lite_area(damroll(dice, sides), rad);
134 if (name) return _("罠と扉 破壊", "Trap & Door Destruction");
135 if (desc) return _("一直線上の全ての罠と扉を破壊する。", "Fires a beam which destroy traps and doors.");
140 if (!get_aim_dir(&dir)) return NULL;
148 if (name) return _("軽傷の治癒", "Cure Light Wounds");
149 if (desc) return _("怪我と体力を少し回復させる。", "Heals cut and HP a little.");
152 DICE_NUMBER dice = 2;
155 if (info) return info_heal(dice, sides, 0);
156 if (cast) (void)cure_light_wounds(dice, sides);
161 if (name) return _("罠と扉 感知", "Detect Doors & Traps");
162 if (desc) return _("近くの全ての罠と扉と階段を感知する。", "Detects traps, doors, and stairs in your vicinity.");
165 POSITION rad = DETECT_RAD_DEFAULT;
167 if (info) return info_radius(rad);
171 detect_traps(rad, TRUE);
179 if (name) return _("燃素", "Phlogiston");
180 if (desc) return _("光源に燃料を補給する。", "Adds more turns of light to a lantern or torch.");
191 if (name) return _("財宝感知", "Detect Treasure");
192 if (desc) return _("近くの財宝を感知する。", "Detects all treasures in your vicinity.");
195 POSITION rad = DETECT_RAD_DEFAULT;
197 if (info) return info_radius(rad);
201 detect_treasure(rad);
202 detect_objects_gold(rad);
208 if (name) return _("魔法 感知", "Detect Enchantment");
209 if (desc) return _("近くの魔法がかかったアイテムを感知する。", "Detects all magical items in your vicinity.");
212 POSITION rad = DETECT_RAD_DEFAULT;
214 if (info) return info_radius(rad);
218 detect_objects_magic(rad);
224 if (name) return _("アイテム感知", "Detect Objects");
225 if (desc) return _("近くの全てのアイテムを感知する。", "Detects all items in your vicinity.");
228 POSITION rad = DETECT_RAD_DEFAULT;
230 if (info) return info_radius(rad);
234 detect_objects_normal(rad);
240 if (name) return _("解毒", "Cure Poison");
241 if (desc) return _("毒を体内から完全に取り除く。", "Cures poison status.");
252 if (name) return _("耐冷", "Resist Cold");
253 if (desc) return _("一定時間、冷気への耐性を得る。装備による耐性に累積する。", "Gives resistance to cold. This resistance can be added to which from equipment for more powerful resistance.");
258 if (info) return info_duration(base, base);
262 set_oppose_cold(randint1(base) + base, FALSE);
268 if (name) return _("耐火", "Resist Fire");
269 if (desc) return _("一定時間、炎への耐性を得る。装備による耐性に累積する。",
270 "Gives resistance to fire. This resistance can be added to which from equipment for more powerful resistance.");
275 if (info) return info_duration(base, base);
279 set_oppose_fire(randint1(base) + base, FALSE);
285 if (name) return _("耐電", "Resist Lightning");
286 if (desc) return _("一定時間、電撃への耐性を得る。装備による耐性に累積する。",
287 "Gives resistance to electricity. This resistance can be added to which from equipment for more powerful resistance.");
292 if (info) return info_duration(base, base);
296 set_oppose_elec(randint1(base) + base, FALSE);
302 if (name) return _("耐酸", "Resist Acid");
303 if (desc) return _("一定時間、酸への耐性を得る。装備による耐性に累積する。",
304 "Gives resistance to acid. This resistance can be added to which from equipment for more powerful resistance.");
309 if (info) return info_duration(base, base);
313 set_oppose_acid(randint1(base) + base, FALSE);
319 if (name) return _("重傷の治癒", "Cure Medium Wounds");
320 if (desc) return _("怪我と体力を中程度回復させる。", "Heals cut and HP more.");
323 DICE_NUMBER dice = 4;
326 if (info) return info_heal(dice, sides, 0);
327 if (cast) (void)cure_serious_wounds(4, 8);
332 if (name) return _("テレポート", "Teleport");
333 if (desc) return _("遠距離のテレポートをする。", "Teleport long distance.");
336 POSITION range = plev * 5;
338 if (info) return info_range(range);
342 teleport_player(range, 0L);
348 if (name) return _("鑑定", "Identify");
349 if (desc) return _("アイテムを識別する。", "Identifies an item.");
354 if (!ident_spell(FALSE)) return NULL;
360 if (name) return _("岩石溶解", "Stone to Mud");
361 if (desc) return _("壁を溶かして床にする。", "Turns one rock square to mud.");
364 DICE_NUMBER dice = 1;
368 if (info) return info_damage(dice, sides, base);
372 if (!get_aim_dir(&dir)) return NULL;
374 wall_to_mud(dir, 20 + randint1(30));
380 if (name) return _("閃光", "Ray of Light");
381 if (desc) return _("光線を放つ。光りを嫌うモンスターに効果がある。", "Fires a beam of light which damages to light-sensitive monsters.");
384 DICE_NUMBER dice = 6;
387 if (info) return info_damage(dice, sides, 0);
391 if (!get_aim_dir(&dir)) return NULL;
393 msg_print(_("光線が放たれた。", "A line of light appears."));
394 lite_line(dir, damroll(6, 8));
400 if (name) return _("空腹充足", "Satisfy Hunger");
401 if (desc) return _("満腹にする。", "Satisfies hunger.");
406 set_food(PY_FOOD_MAX - 1);
412 if (name) return _("透明視認", "See Invisible");
413 if (desc) return _("一定時間、透明なものが見えるようになる。", "Gives see invisible for a while.");
418 if (info) return info_duration(base, base);
422 set_tim_invis(randint1(base) + base, FALSE);
428 if (name) return _("エレメンタル召喚", "Conjure Elemental");
429 if (desc) return _("1体のエレメンタルを召喚する。", "Summons an elemental.");
433 if (!summon_specific(-1, p_ptr->y, p_ptr->x, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
435 msg_print(_("エレメンタルは現れなかった。", "No Elementals arrive."));
442 if (name) return _("テレポート・レベル", "Teleport Level");
443 if (desc) return _("瞬時に上か下の階にテレポートする。", "Teleport to up or down stairs in a moment.");
448 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return NULL;
455 if (name) return _("テレポート・モンスター", "Teleport Away");
456 if (desc) return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
461 if (info) return info_power(power);
465 if (!get_aim_dir(&dir)) return NULL;
467 fire_beam(GF_AWAY_ALL, dir, power);
473 if (name) return _("元素の球", "Elemental Ball");
474 if (desc) return _("炎、電撃、冷気、酸のどれかの球を放つ。", "Fires a ball of some elements.");
477 HIT_POINT dam = 75 + plev;
480 if (info) return info_damage(0, 0, dam);
486 if (!get_aim_dir(&dir)) return NULL;
490 case 1: type = GF_FIRE; break;
491 case 2: type = GF_ELEC; break;
492 case 3: type = GF_COLD; break;
493 default: type = GF_ACID; break;
496 fire_ball(type, dir, dam, rad);
502 if (name) return _("全感知", "Detection");
503 if (desc) return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
504 "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
507 POSITION rad = DETECT_RAD_DEFAULT;
509 if (info) return info_radius(rad);
519 if (name) return _("帰還の呪文", "Word of Recall");
520 if (desc) return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
521 "Recalls player from dungeon to town, or from town to the deepest level of dungeon.");
527 if (info) return info_delay(base, sides);
531 if (!recall_player(p_ptr, randint0(21) + 15)) return NULL;
537 if (name) return _("千里眼", "Clairvoyance");
538 if (desc) return _("その階全体を永久に照らし、ダンジョン内すべてのアイテムを感知する。さらに、一定時間テレパシー能力を得る。",
539 "Maps and lights whole dungeon level. Knows all objects location. And gives telepathy for a while.");
545 if (info) return info_duration(base, sides);
549 chg_virtue(V_KNOWLEDGE, 1);
550 chg_virtue(V_ENLIGHTEN, 1);
554 if (!p_ptr->telepathy)
556 set_tim_esp(randint1(sides) + base, FALSE);