1 #include "realm/realm-sorcery.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/selfinfo.h"
7 #include "spell/spells-detection.h"
8 #include "spell/spells-floor.h"
9 #include "spell/spells-launcher.h"
10 #include "spell/spells-sight.h"
11 #include "spell/spells-status.h"
12 #include "spell/spells-teleport.h"
13 #include "spell/spells-type.h"
14 #include "spell/spells2.h"
15 #include "spell/spells3.h"
16 #include "util/util.h"
19 * @brief 仙術領域魔法の各処理を行う
20 * @param caster_ptr プレーヤーへの参照ポインタ
22 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
23 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
25 concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
27 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
28 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
29 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
30 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
33 PLAYER_LEVEL plev = caster_ptr->lev;
38 if (name) return _("モンスター感知", "Detect Monsters");
39 if (desc) return _("近くの全ての見えるモンスターを感知する。", "Detects all monsters in your vicinity unless invisible.");
42 POSITION rad = DETECT_RAD_DEFAULT;
44 if (info) return info_radius(rad);
48 detect_monsters_normal(caster_ptr, rad);
54 if (name) return _("ショート・テレポート", "Phase Door");
55 if (desc) return _("近距離のテレポートをする。", "Teleports you a short distance.");
60 if (info) return info_range(range);
64 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
70 if (name) return _("罠と扉感知", "Detect Doors and Traps");
71 if (desc) return _("近くの全ての扉と罠を感知する。", "Detects traps, doors, and stairs in your vicinity.");
74 POSITION rad = DETECT_RAD_DEFAULT;
76 if (info) return info_radius(rad);
80 detect_traps(caster_ptr, rad, TRUE);
81 detect_doors(caster_ptr, rad);
82 detect_stairs(caster_ptr, rad);
88 if (name) return _("ライト・エリア", "Light Area");
89 if (desc) return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
93 DICE_SID sides = plev / 2;
94 POSITION rad = plev / 10 + 1;
96 if (info) return info_damage(dice, sides, 0);
100 lite_area(caster_ptr, damroll(dice, sides), rad);
106 if (name) return _("パニック・モンスター", "Confuse Monster");
107 if (desc) return _("モンスター1体を混乱させる。抵抗されると無効。", "Attempts to confuse a monster.");
110 PLAYER_LEVEL power = (plev * 3) / 2;
112 if (info) return info_power(power);
116 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
118 confuse_monster(caster_ptr, dir, power);
124 if (name) return _("テレポート", "Teleport");
125 if (desc) return _("遠距離のテレポートをする。", "Teleports you a long distance.");
128 POSITION range = plev * 5;
130 if (info) return info_range(range);
134 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
140 if (name) return _("スリープ・モンスター", "Sleep Monster");
141 if (desc) return _("モンスター1体を眠らせる。抵抗されると無効。", "Attempts to put a monster to sleep.");
146 if (info) return info_power(power);
150 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
152 sleep_monster(caster_ptr, dir, plev);
158 if (name) return _("魔力充填", "Recharging");
159 if (desc) return _("杖/魔法棒の充填回数を増やすか、充填中のロッドの充填時間を減らす。", "Recharges staffs, wands or rods.");
162 int power = plev * 4;
164 if (info) return info_power(power);
168 if (!recharge(caster_ptr, power)) return NULL;
174 if (name) return _("魔法の地図", "Magic Mapping");
175 if (desc) return _("周辺の地形を感知する。", "Maps nearby area.");
178 POSITION rad = DETECT_RAD_MAP;
180 if (info) return info_radius(rad);
184 map_area(caster_ptr, rad);
190 if (name) return _("鑑定", "Identify");
191 if (desc) return _("アイテムを識別する。", "Identifies an item.");
196 if (!ident_spell(caster_ptr, FALSE, 0)) return NULL;
202 if (name) return _("スロウ・モンスター", "Slow Monster");
203 if (desc) return _("モンスター1体を減速さる。抵抗されると無効。", "Attempts to slow a monster.");
208 if (info) return info_power(power);
212 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
214 slow_monster(caster_ptr, dir, plev);
220 if (name) return _("周辺スリープ", "Mass Sleep");
221 if (desc) return _("視界内の全てのモンスターを眠らせる。抵抗されると無効。", "Attempts to put all monsters in sight to sleep.");
226 if (info) return info_power(power);
230 sleep_monsters(caster_ptr, plev);
236 if (name) return _("テレポート・モンスター", "Teleport Away");
237 if (desc) return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
242 if (info) return info_power(power);
246 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
248 fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
254 if (name) return _("スピード", "Haste Self");
255 if (desc) return _("一定時間、加速する。", "Hastes you for a while.");
259 DICE_SID sides = 20 + plev;
261 if (info) return info_duration(base, sides);
265 set_fast(caster_ptr, randint1(sides) + base, FALSE);
271 if (name) return _("真・感知", "Detection True");
272 if (desc) return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
273 "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
276 POSITION rad = DETECT_RAD_DEFAULT;
278 if (info) return info_radius(rad);
282 detect_all(caster_ptr, rad);
288 if (name) return _("真・鑑定", "Identify True");
289 if (desc) return _("アイテムの持つ能力を完全に知る。", "*Identifies* an item.");
294 if (!identify_fully(caster_ptr, FALSE, 0)) return NULL;
300 if (name) return _("物体と財宝感知", "Detect items and Treasure");
301 if (desc) return _("近くの全てのアイテムと財宝を感知する。", "Detects all treasures and items in your vicinity.");
304 POSITION rad = DETECT_RAD_DEFAULT;
306 if (info) return info_radius(rad);
310 detect_objects_normal(caster_ptr, rad);
311 detect_treasure(caster_ptr, rad);
312 detect_objects_gold(caster_ptr, rad);
318 if (name) return _("チャーム・モンスター", "Charm Monster");
319 if (desc) return _("モンスター1体を魅了する。抵抗されると無効。", "Attempts to charm a monster.");
324 if (info) return info_power(power);
328 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
330 charm_monster(caster_ptr, dir, plev);
336 if (name) return _("精神感知", "Sense Minds");
337 if (desc) return _("一定時間、テレパシー能力を得る。", "Gives telepathy for a while.");
343 if (info) return info_duration(base, sides);
347 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
353 if (name) return _("街移動", "Teleport to town");
354 if (desc) return _("街へ移動する。地上にいるときしか使えない。", "Instantly teleports you to a town which you choose. Can only be used outdoors.");
359 if (!tele_town(caster_ptr)) return NULL;
365 if (name) return _("自己分析", "Self Knowledge");
366 if (desc) return _("現在の自分の状態を完全に知る。",
367 "Gives you useful info regarding your current resistances, the powers of your weapon and maximum limits of your stats.");
372 self_knowledge(caster_ptr);
378 if (name) return _("テレポート・レベル", "Teleport Level");
379 if (desc) return _("瞬時に上か下の階にテレポートする。", "Instantly teleports you up or down a level.");
384 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return NULL;
385 teleport_level(caster_ptr, 0);
391 if (name) return _("帰還の呪文", "Word of Recall");
392 if (desc) return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
393 "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
399 if (info) return info_delay(base, sides);
403 if (!recall_player(caster_ptr, randint0(21) + 15)) return NULL;
409 if (name) return _("次元の扉", "Dimension Door");
410 if (desc) return _("短距離内の指定した場所にテレポートする。", "Teleports you to a given location.");
413 POSITION range = plev / 2 + 10;
415 if (info) return info_range(range);
419 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
420 if (!dimension_door(caster_ptr)) return NULL;
426 if (name) return _("調査", "Probing");
427 if (desc) return _("モンスターの属性、残り体力、最大体力、スピード、正体を知る。",
428 "Probes all monsters' alignment, HP, speed and their true character.");
439 if (name) return _("爆発のルーン", "Explosive Rune");
440 if (desc) return _("自分のいる床の上に、モンスターが通ると爆発してダメージを与えるルーンを描く。",
441 "Sets a glyph under you. The glyph will explode when a monster moves on it.");
444 DICE_NUMBER dice = 7;
448 if (info) return info_damage(dice, sides, base);
452 explosive_rune(caster_ptr, caster_ptr->y, caster_ptr->x);
458 if (name) return _("念動力", "Telekinesis");
459 if (desc) return _("アイテムを自分の足元へ移動させる。", "Pulls a distant item close to you.");
462 WEIGHT weight = plev * 15;
464 if (info) return info_weight(weight);
468 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
470 fetch(caster_ptr, dir, weight, FALSE);
476 if (name) return _("千里眼", "Clairvoyance");
477 if (desc) return _("その階全体を永久に照らし、ダンジョン内すべてのアイテムを感知する。さらに、一定時間テレパシー能力を得る。",
478 "Maps and lights whole dungeon level. Knows all objects location. And gives telepathy for a while.");
484 if (info) return info_duration(base, sides);
488 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
489 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
491 wiz_lite(caster_ptr, FALSE);
493 if (!caster_ptr->telepathy)
495 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
502 if (name) return _("魅了の視線", "Charm monsters");
503 if (desc) return _("視界内の全てのモンスターを魅了する。抵抗されると無効。", "Attempts to charm all monsters in sight.");
506 int power = plev * 2;
508 if (info) return info_power(power);
512 charm_monsters(caster_ptr, power);
518 if (name) return _("錬金術", "Alchemy");
519 if (desc) return _("アイテム1つをお金に変える。", "Turns an item into 1/3 of its value in gold.");
524 if (!alchemy(caster_ptr)) return NULL;
530 if (name) return _("怪物追放", "Banishment");
531 if (desc) return _("視界内の全てのモンスターをテレポートさせる。抵抗されると無効。", "Teleports all monsters in sight away unless resisted.");
534 int power = plev * 4;
536 if (info) return info_power(power);
540 banish_monsters(caster_ptr, power);
546 if (name) return _("無傷の球", "Globe of Invulnerability");
547 if (desc) return _("一定時間、ダメージを受けなくなるバリアを張る。切れた瞬間に少しターンを消費するので注意。",
548 "Generates a barrier which completely protects you from almost all damage. Takes a few of your turns when the barrier breaks or duration time is exceeded.");
553 if (info) return info_duration(base, base);
557 set_invuln(caster_ptr, randint1(base) + base, FALSE);