8 #include "spells-floor.h"
9 #include "spells-object.h"
10 #include "spells-summon.h"
11 #include "spells-status.h"
12 #include "spells-diceroll.h"
13 #include "player-status.h"
14 #include "player-effects.h"
15 #include "targeting.h"
18 * @brief 秘術領域魔法の各処理を行う
19 * @param caster_ptr プレーヤーへの参照ポインタ
21 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
22 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
24 concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
26 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
27 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
28 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
29 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
32 PLAYER_LEVEL plev = caster_ptr->lev;
37 if (name) return _("電撃", "Zap");
38 if (desc) return _("電撃のボルトもしくはビームを放つ。", "Fires a bolt or beam of lightning.");
41 DICE_NUMBER dice = 3 + (plev - 1) / 5;
44 if (info) return info_damage(dice, sides, 0);
48 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
50 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_ELEC, dir, damroll(dice, sides));
56 if (name) return _("魔法の施錠", "Wizard Lock");
57 if (desc) return _("扉に鍵をかける。", "Locks a door.");
62 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
64 wizard_lock(caster_ptr, dir);
70 if (name) return _("透明体感知", "Detect Invisibility");
71 if (desc) return _("近くの透明なモンスターを感知する。", "Detects all invisible monsters in your vicinity.");
74 POSITION rad = DETECT_RAD_DEFAULT;
76 if (info) return info_radius(rad);
80 detect_monsters_invis(caster_ptr, rad);
86 if (name) return _("モンスター感知", "Detect Monsters");
87 if (desc) return _("近くの全ての見えるモンスターを感知する。", "Detects all monsters in your vicinity unless invisible.");
90 POSITION rad = DETECT_RAD_DEFAULT;
92 if (info) return info_radius(rad);
96 detect_monsters_normal(caster_ptr, rad);
102 if (name) return _("ショート・テレポート", "Blink");
103 if (desc) return _("近距離のテレポートをする。", "Teleports you a short distance.");
108 if (info) return info_range(range);
112 teleport_player(caster_ptr, range, 0L);
118 if (name) return _("ライト・エリア", "Light Area");
119 if (desc) return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
122 DICE_NUMBER dice = 2;
123 DICE_SID sides = plev / 2;
124 POSITION rad = plev / 10 + 1;
126 if (info) return info_damage(dice, sides, 0);
130 lite_area(caster_ptr, damroll(dice, sides), rad);
136 if (name) return _("罠と扉 破壊", "Trap & Door Destruction");
137 if (desc) return _("一直線上の全ての罠と扉を破壊する。", "Fires a beam which destroy traps and doors.");
142 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
144 destroy_door(caster_ptr, dir);
150 if (name) return _("軽傷の治癒", "Cure Light Wounds");
151 if (desc) return _("怪我と体力を少し回復させる。", "Heals cuts and HP a little.");
154 DICE_NUMBER dice = 2;
157 if (info) return info_heal(dice, sides, 0);
158 if (cast) (void)cure_light_wounds(caster_ptr, dice, sides);
163 if (name) return _("罠と扉 感知", "Detect Doors & Traps");
164 if (desc) return _("近くの全ての罠と扉と階段を感知する。", "Detects traps, doors, and stairs in your vicinity.");
167 POSITION rad = DETECT_RAD_DEFAULT;
169 if (info) return info_radius(rad);
173 detect_traps(caster_ptr, rad, TRUE);
174 detect_doors(caster_ptr, rad);
175 detect_stairs(caster_ptr, rad);
181 if (name) return _("燃素", "Phlogiston");
182 if (desc) return _("光源に燃料を補給する。", "Adds more turns of light to a lantern or torch.");
187 phlogiston(caster_ptr);
193 if (name) return _("財宝感知", "Detect Treasure");
194 if (desc) return _("近くの財宝を感知する。", "Detects all treasures in your vicinity.");
197 POSITION rad = DETECT_RAD_DEFAULT;
199 if (info) return info_radius(rad);
203 detect_treasure(caster_ptr, rad);
204 detect_objects_gold(caster_ptr, rad);
210 if (name) return _("魔法 感知", "Detect Enchantment");
211 if (desc) return _("近くの魔法がかかったアイテムを感知する。", "Detects all magical items in your vicinity.");
214 POSITION rad = DETECT_RAD_DEFAULT;
216 if (info) return info_radius(rad);
220 detect_objects_magic(caster_ptr, rad);
226 if (name) return _("アイテム感知", "Detect Objects");
227 if (desc) return _("近くの全てのアイテムを感知する。", "Detects all items in your vicinity.");
230 POSITION rad = DETECT_RAD_DEFAULT;
232 if (info) return info_radius(rad);
236 detect_objects_normal(caster_ptr, rad);
242 if (name) return _("解毒", "Cure Poison");
243 if (desc) return _("毒を体内から完全に取り除く。", "Cures poison status.");
248 set_poisoned(caster_ptr, 0);
254 if (name) return _("耐冷", "Resist Cold");
255 if (desc) return _("一定時間、冷気への耐性を得る。装備による耐性に累積する。", "Gives resistance to cold. This resistance can be added to that from equipment for more powerful resistance.");
260 if (info) return info_duration(base, base);
264 set_oppose_cold(caster_ptr, randint1(base) + base, FALSE);
270 if (name) return _("耐火", "Resist Fire");
271 if (desc) return _("一定時間、炎への耐性を得る。装備による耐性に累積する。",
272 "Gives resistance to fire. This resistance can be added to that from equipment for more powerful resistance.");
277 if (info) return info_duration(base, base);
281 set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
287 if (name) return _("耐電", "Resist Lightning");
288 if (desc) return _("一定時間、電撃への耐性を得る。装備による耐性に累積する。",
289 "Gives resistance to electricity. This resistance can be added to that from equipment for more powerful resistance.");
294 if (info) return info_duration(base, base);
298 set_oppose_elec(caster_ptr, randint1(base) + base, FALSE);
304 if (name) return _("耐酸", "Resist Acid");
305 if (desc) return _("一定時間、酸への耐性を得る。装備による耐性に累積する。",
306 "Gives resistance to acid. This resistance can be added to that from equipment for more powerful resistance.");
311 if (info) return info_duration(base, base);
315 set_oppose_acid(caster_ptr, randint1(base) + base, FALSE);
321 if (name) return _("重傷の治癒", "Cure Medium Wounds");
322 if (desc) return _("怪我と体力を中程度回復させる。", "Heals cuts and HP.");
325 DICE_NUMBER dice = 4;
328 if (info) return info_heal(dice, sides, 0);
329 if (cast) (void)cure_serious_wounds(caster_ptr, 4, 8);
334 if (name) return _("テレポート", "Teleport");
335 if (desc) return _("遠距離のテレポートをする。", "Teleports you a long distance.");
338 POSITION range = plev * 5;
340 if (info) return info_range(range);
344 teleport_player(caster_ptr, range, 0L);
350 if (name) return _("鑑定", "Identify");
351 if (desc) return _("アイテムを識別する。", "Identifies an item.");
356 if (!ident_spell(caster_ptr, FALSE)) return NULL;
362 if (name) return _("岩石溶解", "Stone to Mud");
363 if (desc) return _("壁を溶かして床にする。", "Turns one rock square to mud.");
366 DICE_NUMBER dice = 1;
370 if (info) return info_damage(dice, sides, base);
374 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
376 wall_to_mud(caster_ptr, dir, 20 + randint1(30));
382 if (name) return _("閃光", "Ray of Light");
383 if (desc) return _("光線を放つ。光りを嫌うモンスターに効果がある。", "Fires a beam of light which damages to light-sensitive monsters.");
386 DICE_NUMBER dice = 6;
389 if (info) return info_damage(dice, sides, 0);
393 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
395 msg_print(_("光線が放たれた。", "A line of light appears."));
396 lite_line(caster_ptr, dir, damroll(6, 8));
402 if (name) return _("空腹充足", "Satisfy Hunger");
403 if (desc) return _("満腹にする。", "Satisfies hunger.");
408 set_food(caster_ptr, PY_FOOD_MAX - 1);
414 if (name) return _("透明視認", "See Invisible");
415 if (desc) return _("一定時間、透明なものが見えるようになる。", "Gives see invisible for a while.");
420 if (info) return info_duration(base, base);
424 set_tim_invis(caster_ptr, randint1(base) + base, FALSE);
430 if (name) return _("エレメンタル召喚", "Conjure Elemental");
431 if (desc) return _("1体のエレメンタルを召喚する。", "Summons an elemental.");
435 if (!summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
437 msg_print(_("エレメンタルは現れなかった。", "No Elementals arrive."));
444 if (name) return _("テレポート・レベル", "Teleport Level");
445 if (desc) return _("瞬時に上か下の階にテレポートする。", "Instantly teleports you up or down a level.");
450 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return NULL;
451 teleport_level(caster_ptr, 0);
457 if (name) return _("テレポート・モンスター", "Teleport Away");
458 if (desc) return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
463 if (info) return info_power(power);
467 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
469 fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
475 if (name) return _("元素の球", "Elemental Ball");
476 if (desc) return _("炎、電撃、冷気、酸のどれかの球を放つ。", "Fires a ball of some elements.");
479 HIT_POINT dam = 75 + plev;
482 if (info) return info_damage(0, 0, dam);
488 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
492 case 1: type = GF_FIRE; break;
493 case 2: type = GF_ELEC; break;
494 case 3: type = GF_COLD; break;
495 default: type = GF_ACID; break;
498 fire_ball(caster_ptr, type, dir, dam, rad);
504 if (name) return _("全感知", "Detection");
505 if (desc) return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
506 "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
509 POSITION rad = DETECT_RAD_DEFAULT;
511 if (info) return info_radius(rad);
515 detect_all(caster_ptr, rad);
521 if (name) return _("帰還の呪文", "Word of Recall");
522 if (desc) return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
523 "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
529 if (info) return info_delay(base, sides);
533 if (!recall_player(caster_ptr, randint0(21) + 15)) return NULL;
539 if (name) return _("千里眼", "Clairvoyance");
540 if (desc) return _("その階全体を永久に照らし、ダンジョン内すべてのアイテムを感知する。さらに、一定時間テレパシー能力を得る。",
541 "Maps and lights whole dungeon level. Reveals locations of all objects. Gives telepathy for a while.");
547 if (info) return info_duration(base, sides);
551 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
552 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
554 wiz_lite(caster_ptr, FALSE);
556 if (!caster_ptr->telepathy)
558 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);