6 #include "spells-summon.h"
7 #include "spells-status.h"
8 #include "spells-object.h"
9 #include "player-effects.h"
10 #include "player-class.h"
11 #include "targeting.h"
12 #include "effect/spells-effect-util.h"
13 #include "realm/realm-trump.h"
14 #include "spell/spells-type.h"
15 #include "spell/spells2.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_trump_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type 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;
30 bool fail = (mode == SPELL_FAIL) ? TRUE : FALSE;
33 PLAYER_LEVEL plev = caster_ptr->lev;
38 if (name) return _("ショート・テレポート", "Phase Door");
39 if (desc) return _("近距離のテレポートをする。", "Teleports you a short distance.");
44 if (info) return info_range(range);
48 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
54 if (name) return _("蜘蛛のカード", "Trump Spiders");
55 if (desc) return _("蜘蛛を召喚する。", "Summons spiders.");
60 msg_print(_("あなたは蜘蛛のカードに集中する...", "You concentrate on the trump of an spider..."));
61 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_SPIDER, PM_ALLOW_GROUP))
65 msg_print(_("召喚された蜘蛛は怒っている!", "The summoned spiders get angry!"));
73 if (name) return _("シャッフル", "Shuffle");
74 if (desc) return _("カードの占いをする。", "Causes random effects.");
77 if (info) return KWD_RANDOM;
81 cast_shuffle(caster_ptr);
87 if (name) return _("フロア・リセット", "Reset Recall");
88 if (desc) return _("最深階を変更する。", "Resets the 'deepest' level for recall spell.");
93 if (!reset_recall(caster_ptr)) return NULL;
99 if (name) return _("テレポート", "Teleport");
100 if (desc) return _("遠距離のテレポートをする。", "Teleports you a long distance.");
103 POSITION range = plev * 4;
105 if (info) return info_range(range);
109 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
115 if (name) return _("感知のカード", "Trump Spying");
116 if (desc) return _("一定時間、テレパシー能力を得る。", "Gives telepathy for a while.");
122 if (info) return info_duration(base, sides);
126 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
132 if (name) return _("テレポート・モンスター", "Teleport Away");
133 if (desc) return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
138 if (info) return info_power(power);
142 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
144 fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
150 if (name) return _("動物のカード", "Trump Animals");
151 if (desc) return _("1体の動物を召喚する。", "Summons an animal.");
156 int type = (!fail ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
157 msg_print(_("あなたは動物のカードに集中する...", "You concentrate on the trump of an animal..."));
158 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, type, 0L))
162 msg_print(_("召喚された動物は怒っている!", "The summoned animal gets angry!"));
170 if (name) return _("移動のカード", "Trump Reach");
171 if (desc) return _("アイテムを自分の足元へ移動させる。", "Pulls a distant item close to you.");
174 WEIGHT weight = plev * 15;
176 if (info) return info_weight(weight);
180 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
182 fetch(caster_ptr, dir, weight, FALSE);
188 if (name) return _("カミカゼのカード", "Trump Kamikaze");
189 if (desc) return _("複数の爆発するモンスターを召喚する。", "Summons monsters which explode by itself.");
199 if (!target_set(caster_ptr, TARGET_KILL)) return NULL;
205 /* Summons near player when failed */
210 if (caster_ptr->pclass == CLASS_BEASTMASTER)
211 type = SUMMON_KAMIKAZE_LIVING;
213 type = SUMMON_KAMIKAZE;
215 msg_print(_("あなたはカミカゼのカードに集中する...", "You concentrate on several trumps at once..."));
216 if (trump_summoning(caster_ptr, 2 + randint0(plev / 7), !fail, y, x, 0, type, 0L))
220 msg_print(_("召喚されたモンスターは怒っている!", "The summoned creatures get angry!"));
228 if (name) return _("幻霊召喚", "Phantasmal Servant");
229 if (desc) return _("1体の幽霊を召喚する。", "Summons a ghost.");
232 /* Phantasmal Servant is not summoned as enemy when failed */
235 int summon_lev = plev * 2 / 3 + randint1(plev / 2);
237 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, (summon_lev * 3 / 2), SUMMON_PHANTOM, 0L))
239 msg_print(_("御用でございますか、御主人様?", "'Your wish, master?'"));
246 if (name) return _("スピード・モンスター", "Haste Monster");
247 if (desc) return _("モンスター1体を加速させる。", "Hastes a monster.");
254 /* Temporary enable target_pet option */
255 bool old_target_pet = target_pet;
258 result = get_aim_dir(caster_ptr, &dir);
260 /* Restore target_pet option */
261 target_pet = old_target_pet;
263 if (!result) return NULL;
265 speed_monster(caster_ptr, dir, plev);
271 if (name) return _("テレポート・レベル", "Teleport Level");
272 if (desc) return _("瞬時に上か下の階にテレポートする。", "Instantly teleports you up or down a level.");
277 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return NULL;
278 teleport_level(caster_ptr, 0);
284 if (name) return _("次元の扉", "Dimension Door");
285 if (desc) return _("短距離内の指定した場所にテレポートする。", "Teleports you to a given location.");
288 POSITION range = plev / 2 + 10;
290 if (info) return info_range(range);
294 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
295 if (!dimension_door(caster_ptr)) return NULL;
301 if (name) return _("帰還の呪文", "Word of Recall");
302 if (desc) return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
303 "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
309 if (info) return info_delay(base, sides);
313 if (!recall_player(caster_ptr, randint0(21) + 15)) return NULL;
319 if (name) return _("怪物追放", "Banish");
320 if (desc) return _("視界内の全てのモンスターをテレポートさせる。抵抗されると無効。", "Teleports all monsters in sight away unless resisted.");
323 int power = plev * 4;
325 if (info) return info_power(power);
329 banish_monsters(caster_ptr, power);
335 if (name) return _("位置交換のカード", "Swap Position");
336 if (desc) return _("1体のモンスターと位置を交換する。", "Swap positions of you and a monster.");
343 /* HACK -- No range limit */
346 result = get_aim_dir(caster_ptr, &dir);
348 /* Restore range to default */
351 if (!result) return NULL;
353 teleport_swap(caster_ptr, dir);
359 if (name) return _("アンデッドのカード", "Trump Undead");
360 if (desc) return _("1体のアンデッドを召喚する。", "Summons an undead monster.");
365 msg_print(_("あなたはアンデッドのカードに集中する...", "You concentrate on the trump of an undead creature..."));
366 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_UNDEAD, 0L))
370 msg_print(_("召喚されたアンデッドは怒っている!", "The summoned undead creature gets angry!"));
378 if (name) return _("爬虫類のカード", "Trump Reptile");
379 if (desc) return _("1体のヒドラを召喚する。", "Summons a hydra.");
384 msg_print(_("あなたは爬虫類のカードに集中する...", "You concentrate on the trump of a reptile..."));
385 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_HYDRA, 0L))
389 msg_print(_("召喚された爬虫類は怒っている!", "The summoned reptile gets angry!"));
397 if (name) return _("モンスターのカード", "Trump Monsters");
398 if (desc) return _("複数のモンスターを召喚する。", "Summons some monsters.");
404 msg_print(_("あなたはモンスターのカードに集中する...", "You concentrate on several trumps at once..."));
405 if (caster_ptr->pclass == CLASS_BEASTMASTER)
406 type = SUMMON_LIVING;
410 if (trump_summoning(caster_ptr, (1 + (plev - 15) / 10), !fail, caster_ptr->y, caster_ptr->x, 0, type, 0L))
414 msg_print(_("召喚されたモンスターは怒っている!", "The summoned creatures get angry!"));
423 if (name) return _("ハウンドのカード", "Trump Hounds");
424 if (desc) return _("1グループのハウンドを召喚する。", "Summons a group of hounds.");
429 msg_print(_("あなたはハウンドのカードに集中する...", "You concentrate on the trump of a hound..."));
430 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_HOUND, PM_ALLOW_GROUP))
434 msg_print(_("召喚されたハウンドは怒っている!", "The summoned hounds get angry!"));
442 if (name) return _("トランプの刃", "Trump Branding");
443 if (desc) return _("武器にトランプの属性をつける。", "Makes current weapon a Trump weapon.");
448 brand_weapon(caster_ptr, 5);
454 if (name) return _("人間トランプ", "Living Trump");
455 if (desc) return _("ランダムにテレポートする突然変異か、自分の意思でテレポートする突然変異が身につく。",
456 "Gives mutation which makes you teleport randomly or makes you able to teleport at will.");
457 if (cast) become_living_trump(caster_ptr);
461 if (name) return _("サイバーデーモンのカード", "Trump Cyberdemon");
462 if (desc) return _("1体のサイバーデーモンを召喚する。", "Summons a cyber demon.");
467 msg_print(_("あなたはサイバーデーモンのカードに集中する...", "You concentrate on the trump of a Cyberdemon..."));
468 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_CYBER, 0L))
472 msg_print(_("召喚されたサイバーデーモンは怒っている!", "The summoned Cyberdemon gets angry!"));
480 if (name) return _("予見のカード", "Trump Divination");
481 if (desc) return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
482 "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
485 POSITION rad = DETECT_RAD_DEFAULT;
487 if (info) return info_radius(rad);
491 detect_all(caster_ptr, rad);
497 if (name) return _("知識のカード", "Trump Lore");
498 if (desc) return _("アイテムの持つ能力を完全に知る。", "*Identifies* an item.");
503 if (!identify_fully(caster_ptr, FALSE, 0)) return NULL;
509 if (name) return _("回復モンスター", "Heal Monster");
510 if (desc) return _("モンスター1体の体力を回復させる。", "Heals a monster.");
513 int heal = plev * 10 + 200;
515 if (info) return info_heal(0, 0, heal);
521 /* Temporary enable target_pet option */
522 bool old_target_pet = target_pet;
525 result = get_aim_dir(caster_ptr, &dir);
527 /* Restore target_pet option */
528 target_pet = old_target_pet;
530 if (!result) return NULL;
532 heal_monster(caster_ptr, dir, heal);
538 if (name) return _("ドラゴンのカード", "Trump Dragon");
539 if (desc) return _("1体のドラゴンを召喚する。", "Summons a dragon.");
544 msg_print(_("あなたはドラゴンのカードに集中する...", "You concentrate on the trump of a dragon..."));
545 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_DRAGON, 0L))
549 msg_print(_("召喚されたドラゴンは怒っている!", "The summoned dragon gets angry!"));
557 if (name) return _("隕石のカード", "Trump Meteor");
558 if (desc) return _("自分の周辺に隕石を落とす。", "Causes meteorites to fall down on nearby random locations.");
561 HIT_POINT dam = plev * 2;
564 if (info) return info_multi_damage(dam);
568 cast_meteor(caster_ptr, dam, rad);
574 if (name) return _("デーモンのカード", "Trump Demon");
575 if (desc) return _("1体の悪魔を召喚する。", "Summons a demon.");
580 msg_print(_("あなたはデーモンのカードに集中する...", "You concentrate on the trump of a demon..."));
581 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_DEMON, 0L))
585 msg_print(_("召喚されたデーモンは怒っている!", "The summoned demon gets angry!"));
593 if (name) return _("地獄のカード", "Trump Greater Undead");
594 if (desc) return _("1体の上級アンデッドを召喚する。", "Summons a greater undead.");
599 msg_print(_("あなたは強力なアンデッドのカードに集中する...", "You concentrate on the trump of a greater undead being..."));
600 /* May allow unique depend on level and dice roll */
601 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_HI_UNDEAD, PM_ALLOW_UNIQUE))
605 msg_print(_("召喚された上級アンデッドは怒っている!", "The summoned greater undead creature gets angry!"));
613 if (name) return _("古代ドラゴンのカード", "Trump Ancient Dragon");
614 if (desc) return _("1体の古代ドラゴンを召喚する。", "Summons an ancient dragon.");
621 if (caster_ptr->pclass == CLASS_BEASTMASTER)
622 type = SUMMON_HI_DRAGON_LIVING;
624 type = SUMMON_HI_DRAGON;
626 msg_print(_("あなたは古代ドラゴンのカードに集中する...", "You concentrate on the trump of an ancient dragon..."));
627 /* May allow unique depend on level and dice roll */
628 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, type, PM_ALLOW_UNIQUE))
632 msg_print(_("召喚された古代ドラゴンは怒っている!", "The summoned ancient dragon gets angry!"));