1 #include "realm/realm-trump.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "effect/spells-effect-util.h"
4 #include "game-option/input-options.h"
5 #include "io/targeting.h"
6 #include "monster-floor/place-monster-types.h"
7 #include "mutation/mutation.h"
8 #include "player/player-class.h"
9 #include "player/player-effects.h"
10 #include "spell-kind/spells-detection.h"
11 #include "spell-kind/spells-launcher.h"
12 #include "spell/spells-object.h"
13 #include "spell-kind/spells-sight.h"
14 #include "spell/spells-status.h"
15 #include "spell/spells-summon.h"
16 #include "spell-kind/spells-floor.h"
17 #include "spell-realm/spells-trump.h"
18 #include "spell-kind/spells-teleport.h"
19 #include "spell/spells-type.h"
20 #include "spell/spells3.h"
21 #include "util/util.h"
24 * @brief トランプ領域魔法の各処理を行う
25 * @param caster_ptr プレーヤーへの参照ポインタ
27 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
28 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
30 concptr do_trump_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
32 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
33 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
34 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
35 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
36 bool fail = (mode == SPELL_FAIL) ? TRUE : FALSE;
39 PLAYER_LEVEL plev = caster_ptr->lev;
44 if (name) return _("ショート・テレポート", "Phase Door");
45 if (desc) return _("近距離のテレポートをする。", "Teleports you a short distance.");
50 if (info) return info_range(range);
54 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
60 if (name) return _("蜘蛛のカード", "Trump Spiders");
61 if (desc) return _("蜘蛛を召喚する。", "Summons spiders.");
66 msg_print(_("あなたは蜘蛛のカードに集中する...", "You concentrate on the trump of an spider..."));
67 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_SPIDER, PM_ALLOW_GROUP))
71 msg_print(_("召喚された蜘蛛は怒っている!", "The summoned spiders get angry!"));
79 if (name) return _("シャッフル", "Shuffle");
80 if (desc) return _("カードの占いをする。", "Causes random effects.");
83 if (info) return KWD_RANDOM;
87 cast_shuffle(caster_ptr);
93 if (name) return _("フロア・リセット", "Reset Recall");
94 if (desc) return _("最深階を変更する。", "Resets the 'deepest' level for recall spell.");
99 if (!reset_recall(caster_ptr)) return NULL;
105 if (name) return _("テレポート", "Teleport");
106 if (desc) return _("遠距離のテレポートをする。", "Teleports you a long distance.");
109 POSITION range = plev * 4;
111 if (info) return info_range(range);
115 teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
121 if (name) return _("感知のカード", "Trump Spying");
122 if (desc) return _("一定時間、テレパシー能力を得る。", "Gives telepathy for a while.");
128 if (info) return info_duration(base, sides);
132 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
138 if (name) return _("テレポート・モンスター", "Teleport Away");
139 if (desc) return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
144 if (info) return info_power(power);
148 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
150 fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
156 if (name) return _("動物のカード", "Trump Animals");
157 if (desc) return _("1体の動物を召喚する。", "Summons an animal.");
162 int type = (!fail ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
163 msg_print(_("あなたは動物のカードに集中する...", "You concentrate on the trump of an animal..."));
164 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, type, 0L))
168 msg_print(_("召喚された動物は怒っている!", "The summoned animal gets angry!"));
176 if (name) return _("移動のカード", "Trump Reach");
177 if (desc) return _("アイテムを自分の足元へ移動させる。", "Pulls a distant item close to you.");
180 WEIGHT weight = plev * 15;
182 if (info) return info_weight(weight);
186 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
188 fetch(caster_ptr, dir, weight, FALSE);
194 if (name) return _("カミカゼのカード", "Trump Kamikaze");
195 if (desc) return _("複数の爆発するモンスターを召喚する。", "Summons monsters which explode by itself.");
205 if (!target_set(caster_ptr, TARGET_KILL)) return NULL;
211 /* Summons near player when failed */
216 if (caster_ptr->pclass == CLASS_BEASTMASTER)
217 type = SUMMON_KAMIKAZE_LIVING;
219 type = SUMMON_KAMIKAZE;
221 msg_print(_("あなたはカミカゼのカードに集中する...", "You concentrate on several trumps at once..."));
222 if (trump_summoning(caster_ptr, 2 + randint0(plev / 7), !fail, y, x, 0, type, 0L))
226 msg_print(_("召喚されたモンスターは怒っている!", "The summoned creatures get angry!"));
234 if (name) return _("幻霊召喚", "Phantasmal Servant");
235 if (desc) return _("1体の幽霊を召喚する。", "Summons a ghost.");
238 /* Phantasmal Servant is not summoned as enemy when failed */
241 int summon_lev = plev * 2 / 3 + randint1(plev / 2);
243 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, (summon_lev * 3 / 2), SUMMON_PHANTOM, 0L))
245 msg_print(_("御用でございますか、御主人様?", "'Your wish, master?'"));
252 if (name) return _("スピード・モンスター", "Haste Monster");
253 if (desc) return _("モンスター1体を加速させる。", "Hastes a monster.");
260 /* Temporary enable target_pet option */
261 bool old_target_pet = target_pet;
264 result = get_aim_dir(caster_ptr, &dir);
266 /* Restore target_pet option */
267 target_pet = old_target_pet;
269 if (!result) return NULL;
271 speed_monster(caster_ptr, dir, plev);
277 if (name) return _("テレポート・レベル", "Teleport Level");
278 if (desc) return _("瞬時に上か下の階にテレポートする。", "Instantly teleports you up or down a level.");
283 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return NULL;
284 teleport_level(caster_ptr, 0);
290 if (name) return _("次元の扉", "Dimension Door");
291 if (desc) return _("短距離内の指定した場所にテレポートする。", "Teleports you to a given location.");
294 POSITION range = plev / 2 + 10;
296 if (info) return info_range(range);
300 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
301 if (!dimension_door(caster_ptr)) return NULL;
307 if (name) return _("帰還の呪文", "Word of Recall");
308 if (desc) return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
309 "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
315 if (info) return info_delay(base, sides);
319 if (!recall_player(caster_ptr, randint0(21) + 15)) return NULL;
325 if (name) return _("怪物追放", "Banish");
326 if (desc) return _("視界内の全てのモンスターをテレポートさせる。抵抗されると無効。", "Teleports all monsters in sight away unless resisted.");
329 int power = plev * 4;
331 if (info) return info_power(power);
335 banish_monsters(caster_ptr, power);
341 if (name) return _("位置交換のカード", "Swap Position");
342 if (desc) return _("1体のモンスターと位置を交換する。", "Swap positions of you and a monster.");
349 /* HACK -- No range limit */
352 result = get_aim_dir(caster_ptr, &dir);
354 /* Restore range to default */
357 if (!result) return NULL;
359 teleport_swap(caster_ptr, dir);
365 if (name) return _("アンデッドのカード", "Trump Undead");
366 if (desc) return _("1体のアンデッドを召喚する。", "Summons an undead monster.");
371 msg_print(_("あなたはアンデッドのカードに集中する...", "You concentrate on the trump of an undead creature..."));
372 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_UNDEAD, 0L))
376 msg_print(_("召喚されたアンデッドは怒っている!", "The summoned undead creature gets angry!"));
384 if (name) return _("爬虫類のカード", "Trump Reptile");
385 if (desc) return _("1体のヒドラを召喚する。", "Summons a hydra.");
390 msg_print(_("あなたは爬虫類のカードに集中する...", "You concentrate on the trump of a reptile..."));
391 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_HYDRA, 0L))
395 msg_print(_("召喚された爬虫類は怒っている!", "The summoned reptile gets angry!"));
403 if (name) return _("モンスターのカード", "Trump Monsters");
404 if (desc) return _("複数のモンスターを召喚する。", "Summons some monsters.");
410 msg_print(_("あなたはモンスターのカードに集中する...", "You concentrate on several trumps at once..."));
411 if (caster_ptr->pclass == CLASS_BEASTMASTER)
412 type = SUMMON_LIVING;
416 if (trump_summoning(caster_ptr, (1 + (plev - 15) / 10), !fail, caster_ptr->y, caster_ptr->x, 0, type, 0L))
420 msg_print(_("召喚されたモンスターは怒っている!", "The summoned creatures get angry!"));
429 if (name) return _("ハウンドのカード", "Trump Hounds");
430 if (desc) return _("1グループのハウンドを召喚する。", "Summons a group of hounds.");
435 msg_print(_("あなたはハウンドのカードに集中する...", "You concentrate on the trump of a hound..."));
436 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_HOUND, PM_ALLOW_GROUP))
440 msg_print(_("召喚されたハウンドは怒っている!", "The summoned hounds get angry!"));
448 if (name) return _("トランプの刃", "Trump Branding");
449 if (desc) return _("武器にトランプの属性をつける。", "Makes current weapon a Trump weapon.");
454 brand_weapon(caster_ptr, 5);
460 if (name) return _("人間トランプ", "Living Trump");
461 if (desc) return _("ランダムにテレポートする突然変異か、自分の意思でテレポートする突然変異が身につく。",
462 "Gives mutation which makes you teleport randomly or makes you able to teleport at will.");
463 if (cast) become_living_trump(caster_ptr);
467 if (name) return _("サイバーデーモンのカード", "Trump Cyberdemon");
468 if (desc) return _("1体のサイバーデーモンを召喚する。", "Summons a cyber demon.");
473 msg_print(_("あなたはサイバーデーモンのカードに集中する...", "You concentrate on the trump of a Cyberdemon..."));
474 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_CYBER, 0L))
478 msg_print(_("召喚されたサイバーデーモンは怒っている!", "The summoned Cyberdemon gets angry!"));
486 if (name) return _("予見のカード", "Trump Divination");
487 if (desc) return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
488 "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
491 POSITION rad = DETECT_RAD_DEFAULT;
493 if (info) return info_radius(rad);
497 detect_all(caster_ptr, rad);
503 if (name) return _("知識のカード", "Trump Lore");
504 if (desc) return _("アイテムの持つ能力を完全に知る。", "*Identifies* an item.");
509 if (!identify_fully(caster_ptr, FALSE, 0)) return NULL;
515 if (name) return _("回復モンスター", "Heal Monster");
516 if (desc) return _("モンスター1体の体力を回復させる。", "Heals a monster.");
519 int heal = plev * 10 + 200;
521 if (info) return info_heal(0, 0, heal);
527 /* Temporary enable target_pet option */
528 bool old_target_pet = target_pet;
531 result = get_aim_dir(caster_ptr, &dir);
533 /* Restore target_pet option */
534 target_pet = old_target_pet;
536 if (!result) return NULL;
538 heal_monster(caster_ptr, dir, heal);
544 if (name) return _("ドラゴンのカード", "Trump Dragon");
545 if (desc) return _("1体のドラゴンを召喚する。", "Summons a dragon.");
550 msg_print(_("あなたはドラゴンのカードに集中する...", "You concentrate on the trump of a dragon..."));
551 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_DRAGON, 0L))
555 msg_print(_("召喚されたドラゴンは怒っている!", "The summoned dragon gets angry!"));
563 if (name) return _("隕石のカード", "Trump Meteor");
564 if (desc) return _("自分の周辺に隕石を落とす。", "Causes meteorites to fall down on nearby random locations.");
567 HIT_POINT dam = plev * 2;
570 if (info) return info_multi_damage(dam);
574 cast_meteor(caster_ptr, dam, rad);
580 if (name) return _("デーモンのカード", "Trump Demon");
581 if (desc) return _("1体の悪魔を召喚する。", "Summons a demon.");
586 msg_print(_("あなたはデーモンのカードに集中する...", "You concentrate on the trump of a demon..."));
587 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_DEMON, 0L))
591 msg_print(_("召喚されたデーモンは怒っている!", "The summoned demon gets angry!"));
599 if (name) return _("地獄のカード", "Trump Greater Undead");
600 if (desc) return _("1体の上級アンデッドを召喚する。", "Summons a greater undead.");
605 msg_print(_("あなたは強力なアンデッドのカードに集中する...", "You concentrate on the trump of a greater undead being..."));
606 /* May allow unique depend on level and dice roll */
607 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_HI_UNDEAD, PM_ALLOW_UNIQUE))
611 msg_print(_("召喚された上級アンデッドは怒っている!", "The summoned greater undead creature gets angry!"));
619 if (name) return _("古代ドラゴンのカード", "Trump Ancient Dragon");
620 if (desc) return _("1体の古代ドラゴンを召喚する。", "Summons an ancient dragon.");
627 if (caster_ptr->pclass == CLASS_BEASTMASTER)
628 type = SUMMON_HI_DRAGON_LIVING;
630 type = SUMMON_HI_DRAGON;
632 msg_print(_("あなたは古代ドラゴンのカードに集中する...", "You concentrate on the trump of an ancient dragon..."));
633 /* May allow unique depend on level and dice roll */
634 if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, type, PM_ALLOW_UNIQUE))
638 msg_print(_("召喚された古代ドラゴンは怒っている!", "The summoned ancient dragon gets angry!"));