1 #include "realm/realm-sorcery.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "core/asking-player.h"
4 #include "io/targeting.h"
5 #include "player/avatar.h"
6 #include "player/player-effects.h"
7 #include "player/selfinfo.h"
8 #include "spell-kind/spells-charm.h"
9 #include "spell-kind/spells-detection.h"
10 #include "spell-kind/spells-floor.h"
11 #include "spell-kind/spells-grid.h"
12 #include "spell-kind/spells-launcher.h"
13 #include "spell-kind/spells-lite.h"
14 #include "spell-kind/spells-sight.h"
15 #include "spell-kind/spells-teleport.h"
16 #include "spell/spells-status.h"
17 #include "spell/spell-types.h"
18 #include "spell/spells3.h"
19 #include "view/display-messages.h"
22 * @brief 仙術領域魔法の各処理を行う
23 * @param caster_ptr プレーヤーへの参照ポインタ
25 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
26 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
28 concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
30 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
31 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
32 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
33 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
36 PLAYER_LEVEL plev = caster_ptr->lev;
41 if (name) return _("モンスター感知", "Detect Monsters");
42 if (desc) return _("近くの全ての見えるモンスターを感知する。", "Detects all monsters in your vicinity unless invisible.");
45 POSITION rad = DETECT_RAD_DEFAULT;
47 if (info) return info_radius(rad);
51 detect_monsters_normal(caster_ptr, rad);
57 if (name) return _("ショート・テレポート", "Phase Door");
58 if (desc) return _("近距離のテレポートをする。", "Teleports you a short distance.");
63 if (info) return info_range(range);
67 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
73 if (name) return _("罠と扉感知", "Detect Doors and Traps");
74 if (desc) return _("近くの全ての扉と罠を感知する。", "Detects traps, doors, and stairs in your vicinity.");
77 POSITION rad = DETECT_RAD_DEFAULT;
79 if (info) return info_radius(rad);
83 detect_traps(caster_ptr, rad, TRUE);
84 detect_doors(caster_ptr, rad);
85 detect_stairs(caster_ptr, rad);
91 if (name) return _("ライト・エリア", "Light Area");
92 if (desc) return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
96 DICE_SID sides = plev / 2;
97 POSITION rad = plev / 10 + 1;
99 if (info) return info_damage(dice, sides, 0);
103 lite_area(caster_ptr, damroll(dice, sides), rad);
109 if (name) return _("パニック・モンスター", "Confuse Monster");
110 if (desc) return _("モンスター1体を混乱させる。抵抗されると無効。", "Attempts to confuse a monster.");
113 PLAYER_LEVEL power = (plev * 3) / 2;
115 if (info) return info_power(power);
119 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
121 confuse_monster(caster_ptr, dir, power);
127 if (name) return _("テレポート", "Teleport");
128 if (desc) return _("遠距離のテレポートをする。", "Teleports you a long distance.");
131 POSITION range = plev * 5;
133 if (info) return info_range(range);
137 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
143 if (name) return _("スリープ・モンスター", "Sleep Monster");
144 if (desc) return _("モンスター1体を眠らせる。抵抗されると無効。", "Attempts to put a monster to sleep.");
149 if (info) return info_power(power);
153 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
155 sleep_monster(caster_ptr, dir, plev);
161 if (name) return _("魔力充填", "Recharging");
162 if (desc) return _("杖/魔法棒の充填回数を増やすか、充填中のロッドの充填時間を減らす。", "Recharges staffs, wands or rods.");
165 int power = plev * 4;
167 if (info) return info_power(power);
171 if (!recharge(caster_ptr, power)) return NULL;
177 if (name) return _("魔法の地図", "Magic Mapping");
178 if (desc) return _("周辺の地形を感知する。", "Maps nearby area.");
181 POSITION rad = DETECT_RAD_MAP;
183 if (info) return info_radius(rad);
187 map_area(caster_ptr, rad);
193 if (name) return _("鑑定", "Identify");
194 if (desc) return _("アイテムを識別する。", "Identifies an item.");
199 if (!ident_spell(caster_ptr, FALSE, 0)) return NULL;
205 if (name) return _("スロウ・モンスター", "Slow Monster");
206 if (desc) return _("モンスター1体を減速さる。抵抗されると無効。", "Attempts to slow a monster.");
211 if (info) return info_power(power);
215 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
217 slow_monster(caster_ptr, dir, plev);
223 if (name) return _("周辺スリープ", "Mass Sleep");
224 if (desc) return _("視界内の全てのモンスターを眠らせる。抵抗されると無効。", "Attempts to put all monsters in sight to sleep.");
229 if (info) return info_power(power);
233 sleep_monsters(caster_ptr, plev);
239 if (name) return _("テレポート・モンスター", "Teleport Away");
240 if (desc) return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
245 if (info) return info_power(power);
249 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
251 fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
257 if (name) return _("スピード", "Haste Self");
258 if (desc) return _("一定時間、加速する。", "Hastes you for a while.");
262 DICE_SID sides = 20 + plev;
264 if (info) return info_duration(base, sides);
268 set_fast(caster_ptr, randint1(sides) + base, FALSE);
274 if (name) return _("真・感知", "Detection True");
275 if (desc) return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
276 "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
279 POSITION rad = DETECT_RAD_DEFAULT;
281 if (info) return info_radius(rad);
285 detect_all(caster_ptr, rad);
291 if (name) return _("真・鑑定", "Identify True");
292 if (desc) return _("アイテムの持つ能力を完全に知る。", "*Identifies* an item.");
297 if (!identify_fully(caster_ptr, FALSE, 0)) return NULL;
303 if (name) return _("物体と財宝感知", "Detect items and Treasure");
304 if (desc) return _("近くの全てのアイテムと財宝を感知する。", "Detects all treasures and items in your vicinity.");
307 POSITION rad = DETECT_RAD_DEFAULT;
309 if (info) return info_radius(rad);
313 detect_objects_normal(caster_ptr, rad);
314 detect_treasure(caster_ptr, rad);
315 detect_objects_gold(caster_ptr, rad);
321 if (name) return _("チャーム・モンスター", "Charm Monster");
322 if (desc) return _("モンスター1体を魅了する。抵抗されると無効。", "Attempts to charm a monster.");
327 if (info) return info_power(power);
331 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
333 charm_monster(caster_ptr, dir, plev);
339 if (name) return _("精神感知", "Sense Minds");
340 if (desc) return _("一定時間、テレパシー能力を得る。", "Gives telepathy for a while.");
346 if (info) return info_duration(base, sides);
350 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
356 if (name) return _("街移動", "Teleport to town");
357 if (desc) return _("街へ移動する。地上にいるときしか使えない。", "Instantly teleports you to a town which you choose. Can only be used outdoors.");
362 if (!tele_town(caster_ptr)) return NULL;
368 if (name) return _("自己分析", "Self Knowledge");
369 if (desc) return _("現在の自分の状態を完全に知る。",
370 "Gives you useful info regarding your current resistances, the powers of your weapon and maximum limits of your stats.");
375 self_knowledge(caster_ptr);
381 if (name) return _("テレポート・レベル", "Teleport Level");
382 if (desc) return _("瞬時に上か下の階にテレポートする。", "Instantly teleports you up or down a level.");
387 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return NULL;
388 teleport_level(caster_ptr, 0);
394 if (name) return _("帰還の呪文", "Word of Recall");
395 if (desc) return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
396 "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
402 if (info) return info_delay(base, sides);
406 if (!recall_player(caster_ptr, randint0(21) + 15)) return NULL;
412 if (name) return _("次元の扉", "Dimension Door");
413 if (desc) return _("短距離内の指定した場所にテレポートする。", "Teleports you to a given location.");
416 POSITION range = plev / 2 + 10;
418 if (info) return info_range(range);
422 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
423 if (!dimension_door(caster_ptr)) return NULL;
429 if (name) return _("調査", "Probing");
430 if (desc) return _("モンスターの属性、残り体力、最大体力、スピード、正体を知る。",
431 "Probes all monsters' alignment, HP, speed and their true character.");
442 if (name) return _("爆発のルーン", "Explosive Rune");
443 if (desc) return _("自分のいる床の上に、モンスターが通ると爆発してダメージを与えるルーンを描く。",
444 "Sets a glyph under you. The glyph will explode when a monster moves on it.");
447 DICE_NUMBER dice = 7;
451 if (info) return info_damage(dice, sides, base);
455 explosive_rune(caster_ptr, caster_ptr->y, caster_ptr->x);
461 if (name) return _("念動力", "Telekinesis");
462 if (desc) return _("アイテムを自分の足元へ移動させる。", "Pulls a distant item close to you.");
465 WEIGHT weight = plev * 15;
467 if (info) return info_weight(weight);
471 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
473 fetch(caster_ptr, dir, weight, FALSE);
479 if (name) return _("千里眼", "Clairvoyance");
480 if (desc) return _("その階全体を永久に照らし、ダンジョン内すべてのアイテムを感知する。さらに、一定時間テレパシー能力を得る。",
481 "Maps and lights whole dungeon level. Knows all objects location. And gives telepathy for a while.");
487 if (info) return info_duration(base, sides);
491 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
492 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
494 wiz_lite(caster_ptr, FALSE);
496 if (!caster_ptr->telepathy)
498 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
505 if (name) return _("魅了の視線", "Charm monsters");
506 if (desc) return _("視界内の全てのモンスターを魅了する。抵抗されると無効。", "Attempts to charm all monsters in sight.");
509 int power = plev * 2;
511 if (info) return info_power(power);
515 charm_monsters(caster_ptr, power);
521 if (name) return _("錬金術", "Alchemy");
522 if (desc) return _("アイテム1つをお金に変える。", "Turns an item into 1/3 of its value in gold.");
527 if (!alchemy(caster_ptr)) return NULL;
533 if (name) return _("怪物追放", "Banishment");
534 if (desc) return _("視界内の全てのモンスターをテレポートさせる。抵抗されると無効。", "Teleports all monsters in sight away unless resisted.");
537 int power = plev * 4;
539 if (info) return info_power(power);
543 banish_monsters(caster_ptr, power);
549 if (name) return _("無傷の球", "Globe of Invulnerability");
550 if (desc) return _("一定時間、ダメージを受けなくなるバリアを張る。切れた瞬間に少しターンを消費するので注意。",
551 "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.");
556 if (info) return info_duration(base, base);
560 set_invuln(caster_ptr, randint1(base) + base, FALSE);