1 #include "realm/realm-sorcery.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "core/asking-player.h"
4 #include "player-info/self-info.h"
5 #include "player-info/avatar.h"
6 #include "spell-kind/magic-item-recharger.h"
7 #include "spell-kind/spells-charm.h"
8 #include "spell-kind/spells-detection.h"
9 #include "spell-kind/spells-fetcher.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-perception.h"
15 #include "spell-kind/spells-sight.h"
16 #include "spell-kind/spells-teleport.h"
17 #include "spell-kind/spells-world.h"
18 #include "spell-realm/spells-sorcery.h"
19 #include "spell/spell-types.h"
20 #include "spell/spells-status.h"
21 #include "status/body-improvement.h"
22 #include "status/buff-setter.h"
23 #include "status/sight-setter.h"
24 #include "system/player-type-definition.h"
25 #include "target/target-getter.h"
26 #include "view/display-messages.h"
29 * @brief 仙術領域魔法の各処理を行う
30 * @param caster_ptr プレーヤーへの参照ポインタ
32 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
33 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
35 concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
37 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
38 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
39 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
40 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
43 PLAYER_LEVEL plev = caster_ptr->lev;
48 return _("モンスター感知", "Detect Monsters");
50 return _("近くの全ての見えるモンスターを感知する。", "Detects all monsters in your vicinity unless invisible.");
53 POSITION rad = DETECT_RAD_DEFAULT;
56 return info_radius(rad);
59 detect_monsters_normal(caster_ptr, rad);
66 return _("ショート・テレポート", "Phase Door");
68 return _("近距離のテレポートをする。", "Teleports you a short distance.");
74 return info_range(range);
77 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
84 return _("罠と扉感知", "Detect Doors and Traps");
86 return _("近くの全ての扉と罠を感知する。", "Detects traps, doors, and stairs in your vicinity.");
89 POSITION rad = DETECT_RAD_DEFAULT;
92 return info_radius(rad);
95 detect_traps(caster_ptr, rad, TRUE);
96 detect_doors(caster_ptr, rad);
97 detect_stairs(caster_ptr, rad);
104 return _("ライト・エリア", "Light Area");
106 return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
109 DICE_NUMBER dice = 2;
110 DICE_SID sides = plev / 2;
111 POSITION rad = plev / 10 + 1;
114 return info_damage(dice, sides, 0);
117 lite_area(caster_ptr, damroll(dice, sides), rad);
124 return _("パニック・モンスター", "Confuse Monster");
126 return _("モンスター1体を混乱させる。抵抗されると無効。", "Attempts to confuse a monster.");
129 PLAYER_LEVEL power = (plev * 3) / 2;
132 return info_power(power);
135 if (!get_aim_dir(caster_ptr, &dir))
138 confuse_monster(caster_ptr, dir, power);
145 return _("テレポート", "Teleport");
147 return _("遠距離のテレポートをする。", "Teleports you a long distance.");
150 POSITION range = plev * 5;
153 return info_range(range);
156 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
163 return _("スリープ・モンスター", "Sleep Monster");
165 return _("モンスター1体を眠らせる。抵抗されると無効。", "Attempts to put a monster to sleep.");
171 return info_power(power);
174 if (!get_aim_dir(caster_ptr, &dir))
177 sleep_monster(caster_ptr, dir, plev);
184 return _("魔力充填", "Recharging");
186 return _("杖/魔法棒の充填回数を増やすか、充填中のロッドの充填時間を減らす。", "Recharges staffs, wands or rods.");
189 int power = plev * 4;
192 return info_power(power);
195 if (!recharge(caster_ptr, power))
203 return _("魔法の地図", "Magic Mapping");
205 return _("周辺の地形を感知する。", "Maps nearby area.");
208 POSITION rad = DETECT_RAD_MAP;
211 return info_radius(rad);
214 map_area(caster_ptr, rad);
221 return _("鑑定", "Identify");
223 return _("アイテムを識別する。", "Identifies an item.");
227 if (!ident_spell(caster_ptr, FALSE, TV_NONE))
235 return _("スロウ・モンスター", "Slow Monster");
237 return _("モンスター1体を減速させる。抵抗されると無効。", "Attempts to slow a monster.");
243 return info_power(power);
246 if (!get_aim_dir(caster_ptr, &dir))
249 slow_monster(caster_ptr, dir, plev);
256 return _("周辺スリープ", "Mass Sleep");
258 return _("視界内の全てのモンスターを眠らせる。抵抗されると無効。", "Attempts to put all monsters in sight to sleep.");
264 return info_power(power);
267 sleep_monsters(caster_ptr, plev);
274 return _("テレポート・モンスター", "Teleport Away");
276 return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
282 return info_power(power);
285 if (!get_aim_dir(caster_ptr, &dir))
288 fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
295 return _("スピード", "Haste Self");
297 return _("一定時間、加速する。", "Hastes you for a while.");
301 DICE_SID sides = 20 + plev;
304 return info_duration(base, sides);
307 set_fast(caster_ptr, randint1(sides) + base, FALSE);
314 return _("真・感知", "Detection True");
316 return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
317 "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
320 POSITION rad = DETECT_RAD_DEFAULT;
323 return info_radius(rad);
326 detect_all(caster_ptr, rad);
333 return _("真・鑑定", "Identify True");
335 return _("アイテムの持つ能力を完全に知る。", "*Identifies* an item.");
339 if (!identify_fully(caster_ptr, FALSE, TV_NONE))
347 return _("物体と財宝感知", "Detect items and Treasure");
349 return _("近くの全てのアイテムと財宝を感知する。", "Detects all treasures and items in your vicinity.");
352 POSITION rad = DETECT_RAD_DEFAULT;
355 return info_radius(rad);
358 detect_objects_normal(caster_ptr, rad);
359 detect_treasure(caster_ptr, rad);
360 detect_objects_gold(caster_ptr, rad);
367 return _("チャーム・モンスター", "Charm Monster");
369 return _("モンスター1体を魅了する。抵抗されると無効。", "Attempts to charm a monster.");
375 return info_power(power);
378 if (!get_aim_dir(caster_ptr, &dir))
381 charm_monster(caster_ptr, dir, plev);
388 return _("精神感知", "Sense Minds");
390 return _("一定時間、テレパシー能力を得る。", "Gives telepathy for a while.");
397 return info_duration(base, sides);
400 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
407 return _("街移動", "Teleport to town");
409 return _("街へ移動する。地上にいるときしか使えない。", "Instantly teleports you to a town which you choose. Can only be used outdoors.");
413 if (!tele_town(caster_ptr))
421 return _("自己分析", "Self Knowledge");
423 return _("現在の自分の状態を完全に知る。",
424 "Gives you useful info regarding your current resistances, the powers of your weapon and maximum limits of your stats.");
428 self_knowledge(caster_ptr);
435 return _("テレポート・レベル", "Teleport Level");
437 return _("瞬時に上か下の階にテレポートする。", "Instantly teleports you up or down a level.");
441 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)")))
443 teleport_level(caster_ptr, 0);
450 return _("帰還の呪文", "Word of Recall");
452 return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
453 "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
460 return info_delay(base, sides);
463 if (!recall_player(caster_ptr, randint0(21) + 15))
471 return _("次元の扉", "Dimension Door");
473 return _("短距離内の指定した場所にテレポートする。", "Teleports you to a given location.");
476 POSITION range = plev / 2 + 10;
479 return info_range(range);
482 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
483 if (!dimension_door(caster_ptr))
491 return _("調査", "Probing");
493 return _("モンスターの属性、残り体力、最大体力、スピード、正体を知る。", "Probes all monsters' alignment, HP, speed and their true character.");
504 return _("爆発のルーン", "Explosive Rune");
506 return _("自分のいる床の上に、モンスターが通ると爆発してダメージを与えるルーンを描く。",
507 "Sets a rune under you. The rune will explode when a monster moves on it.");
510 DICE_NUMBER dice = 7;
515 return info_damage(dice, sides, base);
518 create_rune_explosion(caster_ptr, caster_ptr->y, caster_ptr->x);
525 return _("念動力", "Telekinesis");
527 return _("アイテムを自分の足元へ移動させる。", "Pulls a distant item close to you.");
530 WEIGHT weight = plev * 15;
533 return info_weight(weight);
536 if (!get_aim_dir(caster_ptr, &dir))
539 fetch_item(caster_ptr, dir, weight, FALSE);
546 return _("千里眼", "Clairvoyance");
548 return _("その階全体を永久に照らし、ダンジョン内すべてのアイテムを感知する。さらに、一定時間テレパシー能力を得る。",
549 "Maps and lights whole dungeon level. Knows all objects location. And gives telepathy for a while.");
556 return info_duration(base, sides);
559 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
560 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
562 wiz_lite(caster_ptr, FALSE);
564 if (!caster_ptr->telepathy) {
565 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
573 return _("魅了の視線", "Charm monsters");
575 return _("視界内の全てのモンスターを魅了する。抵抗されると無効。", "Attempts to charm all monsters in sight.");
578 int power = plev * 2;
581 return info_power(power);
584 charm_monsters(caster_ptr, power);
591 return _("錬金術", "Alchemy");
593 return _("アイテム1つをお金に変える。", "Turns an item into 1/3 of its value in gold.");
597 if (!alchemy(caster_ptr))
605 return _("怪物追放", "Banishment");
607 return _("視界内の全てのモンスターをテレポートさせる。抵抗されると無効。", "Teleports all monsters in sight away unless resisted.");
610 int power = plev * 4;
613 return info_power(power);
616 banish_monsters(caster_ptr, power);
623 return _("無傷の球", "Globe of Invulnerability");
625 return _("一定時間、ダメージを受けなくなるバリアを張る。切れた瞬間に少しターンを消費するので注意。",
626 "Generates a barrier which completely protects you from almost all damage. Takes a few of your turns when the barrier breaks or duration time "
633 return info_duration(base, base);
636 set_invuln(caster_ptr, randint1(base) + base, FALSE);