From e4c453819c66f0448c67d7de85d1d08a7dab4b76 Mon Sep 17 00:00:00 2001 From: Deskull Date: Thu, 13 Sep 2018 20:27:07 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=E3=80=80=E3=83=88=E3=83=A9?= =?utf8?q?=E3=83=B3=E3=83=97=E9=A0=98=E5=9F=9F=E5=87=A6=E7=90=86=E3=82=92?= =?utf8?q?=20cmd-spell.c=20=E3=81=8B=E3=82=89=20realm-trump.c/h=20?= =?utf8?q?=E3=81=B8=E5=88=86=E9=9B=A2=E3=80=82=20Separate=20trump=20realm?= =?utf8?q?=20process=20from=20cmd-spell.c=20to=20realm-trump.c/h.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Hengband_vcs2015/Hengband/Hengband.vcxproj | 2 + Hengband_vcs2015/Hengband/Hengband.vcxproj.filters | 6 + src/cmd-spell.c | 646 +------------------- src/realm-trump.c | 648 +++++++++++++++++++++ src/realm-trump.h | 1 + 5 files changed, 658 insertions(+), 645 deletions(-) create mode 100644 src/realm-trump.c create mode 100644 src/realm-trump.h diff --git a/Hengband_vcs2015/Hengband/Hengband.vcxproj b/Hengband_vcs2015/Hengband/Hengband.vcxproj index eca6ce443..8509bff15 100644 --- a/Hengband_vcs2015/Hengband/Hengband.vcxproj +++ b/Hengband_vcs2015/Hengband/Hengband.vcxproj @@ -202,6 +202,7 @@ + @@ -260,6 +261,7 @@ + diff --git a/Hengband_vcs2015/Hengband/Hengband.vcxproj.filters b/Hengband_vcs2015/Hengband/Hengband.vcxproj.filters index 653ac12a4..a9585e7b1 100644 --- a/Hengband_vcs2015/Hengband/Hengband.vcxproj.filters +++ b/Hengband_vcs2015/Hengband/Hengband.vcxproj.filters @@ -274,6 +274,9 @@ Source + + Source + @@ -421,6 +424,9 @@ Header + + Header + diff --git a/src/cmd-spell.c b/src/cmd-spell.c index b2c144ee7..100be8d6c 100644 --- a/src/cmd-spell.c +++ b/src/cmd-spell.c @@ -16,6 +16,7 @@ #include "realm-life.h" #include "realm-nature.h" #include "realm-sorcery.h" +#include "realm-trump.h" /*! * @brief @@ -237,651 +238,6 @@ void stop_singing(void) -/*! - * @brief トランプ領域魔法の各処理を行う - * @param spell 魔法ID - * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST) - * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。 - */ -static cptr do_trump_spell(SPELL_IDX spell, BIT_FLAGS mode) -{ - bool name = (mode == SPELL_NAME) ? TRUE : FALSE; - bool desc = (mode == SPELL_DESC) ? TRUE : FALSE; - bool info = (mode == SPELL_INFO) ? TRUE : FALSE; - bool cast = (mode == SPELL_CAST) ? TRUE : FALSE; - bool fail = (mode == SPELL_FAIL) ? TRUE : FALSE; - static const char s_random[] = _("ランダム", "random"); - - int dir; - int plev = p_ptr->lev; - - switch (spell) - { - case 0: - if (name) return _("ショート・テレポート", "Phase Door"); - if (desc) return _("近距離のテレポートをする。", "Teleport short distance."); - - { - POSITION range = 10; - - if (info) return info_range(range); - - if (cast) - { - teleport_player(range, 0L); - } - } - break; - - case 1: - if (name) return _("蜘蛛のカード", "Trump Spiders"); - if (desc) return _("蜘蛛を召喚する。", "Summons spiders."); - - { - if (cast || fail) - { - msg_print(_("あなたは蜘蛛のカードに集中する...", "You concentrate on the trump of an spider...")); - if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_SPIDER, PM_ALLOW_GROUP)) - { - if (fail) - { - msg_print(_("召喚された蜘蛛は怒っている!", "The summoned spiders get angry!")); - } - } - } - } - break; - - case 2: - if (name) return _("シャッフル", "Shuffle"); - if (desc) return _("カードの占いをする。", "Causes random effects."); - - { - if (info) return s_random; - - if (cast) - { - cast_shuffle(); - } - } - break; - - case 3: - if (name) return _("フロア・リセット", "Reset Recall"); - if (desc) return _("最深階を変更する。", "Resets the 'deepest' level for recall spell."); - - { - if (cast) - { - if (!reset_recall()) return NULL; - } - } - break; - - case 4: - if (name) return _("テレポート", "Teleport"); - if (desc) return _("遠距離のテレポートをする。", "Teleport long distance."); - - { - POSITION range = plev * 4; - - if (info) return info_range(range); - - if (cast) - { - teleport_player(range, 0L); - } - } - break; - - case 5: - if (name) return _("感知のカード", "Trump Spying"); - if (desc) return _("一定時間、テレパシー能力を得る。", "Gives telepathy for a while."); - - { - int base = 25; - int sides = 30; - - if (info) return info_duration(base, sides); - - if (cast) - { - set_tim_esp(randint1(sides) + base, FALSE); - } - } - break; - - case 6: - if (name) return _("テレポート・モンスター", "Teleport Away"); - if (desc) return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted."); - - { - int power = plev; - - if (info) return info_power(power); - - if (cast) - { - if (!get_aim_dir(&dir)) return NULL; - - fire_beam(GF_AWAY_ALL, dir, power); - } - } - break; - - case 7: - if (name) return _("動物のカード", "Trump Animals"); - if (desc) return _("1体の動物を召喚する。", "Summons an animal."); - - { - if (cast || fail) - { - int type = (!fail ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL); - msg_print(_("あなたは動物のカードに集中する...", "You concentrate on the trump of an animal...")); - if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, type, 0L)) - { - if (fail) - { - msg_print(_("召喚された動物は怒っている!", "The summoned animal gets angry!")); - } - } - } - } - break; - - case 8: - if (name) return _("移動のカード", "Trump Reach"); - if (desc) return _("アイテムを自分の足元へ移動させる。", "Pulls a distant item close to you."); - - { - int weight = plev * 15; - - if (info) return info_weight(weight); - - if (cast) - { - if (!get_aim_dir(&dir)) return NULL; - - fetch(dir, weight, FALSE); - } - } - break; - - case 9: - if (name) return _("カミカゼのカード", "Trump Kamikaze"); - if (desc) return _("複数の爆発するモンスターを召喚する。", "Summons monsters which explode by itself."); - - { - if (cast || fail) - { - int x, y; - int type; - - if (cast) - { - if (!target_set(TARGET_KILL)) return NULL; - x = target_col; - y = target_row; - } - else - { - /* Summons near player when failed */ - x = p_ptr->x; - y = p_ptr->y; - } - - if (p_ptr->pclass == CLASS_BEASTMASTER) - type = SUMMON_KAMIKAZE_LIVING; - else - type = SUMMON_KAMIKAZE; - - msg_print(_("あなたはカミカゼのカードに集中する...", "You concentrate on several trumps at once...")); - if (trump_summoning(2 + randint0(plev / 7), !fail, y, x, 0, type, 0L)) - { - if (fail) - { - msg_print(_("召喚されたモンスターは怒っている!", "The summoned creatures get angry!")); - } - } - } - } - break; - - case 10: - if (name) return _("幻霊召喚", "Phantasmal Servant"); - if (desc) return _("1体の幽霊を召喚する。", "Summons a ghost."); - - { - /* Phantasmal Servant is not summoned as enemy when failed */ - if (cast) - { - int summon_lev = plev * 2 / 3 + randint1(plev / 2); - - if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, (summon_lev * 3 / 2), SUMMON_PHANTOM, 0L)) - { - msg_print(_("御用でございますか、御主人様?", "'Your wish, master?'")); - } - } - } - break; - - case 11: - if (name) return _("スピード・モンスター", "Haste Monster"); - if (desc) return _("モンスター1体を加速させる。", "Hastes a monster."); - - { - if (cast) - { - bool result; - - /* Temporary enable target_pet option */ - bool old_target_pet = target_pet; - target_pet = TRUE; - - result = get_aim_dir(&dir); - - /* Restore target_pet option */ - target_pet = old_target_pet; - - if (!result) return NULL; - - speed_monster(dir, plev); - } - } - break; - - case 12: - if (name) return _("テレポート・レベル", "Teleport Level"); - if (desc) return _("瞬時に上か下の階にテレポートする。", "Teleport to up or down stairs in a moment."); - - { - if (cast) - { - if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return NULL; - teleport_level(0); - } - } - break; - - case 13: - if (name) return _("次元の扉", "Dimension Door"); - if (desc) return _("短距離内の指定した場所にテレポートする。", "Teleport to given location."); - - { - POSITION range = plev / 2 + 10; - - if (info) return info_range(range); - - if (cast) - { - msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination.")); - if (!dimension_door()) return NULL; - } - } - break; - - case 14: - if (name) return _("帰還の呪文", "Word of Recall"); - if (desc) return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。", - "Recalls player from dungeon to town, or from town to the deepest level of dungeon."); - - { - int base = 15; - int sides = 20; - - if (info) return info_delay(base, sides); - - if (cast) - { - if (!word_of_recall()) return NULL; - } - } - break; - - case 15: - if (name) return _("怪物追放", "Banish"); - if (desc) return _("視界内の全てのモンスターをテレポートさせる。抵抗されると無効。", "Teleports all monsters in sight away unless resisted."); - - { - int power = plev * 4; - - if (info) return info_power(power); - - if (cast) - { - banish_monsters(power); - } - } - break; - - case 16: - if (name) return _("位置交換のカード", "Swap Position"); - if (desc) return _("1体のモンスターと位置を交換する。", "Swap positions of you and a monster."); - - { - if (cast) - { - bool result; - - /* HACK -- No range limit */ - project_length = -1; - - result = get_aim_dir(&dir); - - /* Restore range to default */ - project_length = 0; - - if (!result) return NULL; - - teleport_swap(dir); - } - } - break; - - case 17: - if (name) return _("アンデッドのカード", "Trump Undead"); - if (desc) return _("1体のアンデッドを召喚する。", "Summons an undead monster."); - - { - if (cast || fail) - { - msg_print(_("あなたはアンデッドのカードに集中する...", "You concentrate on the trump of an undead creature...")); - if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_UNDEAD, 0L)) - { - if (fail) - { - msg_print(_("召喚されたアンデッドは怒っている!", "The summoned undead creature gets angry!")); - } - } - } - } - break; - - case 18: - if (name) return _("爬虫類のカード", "Trump Reptiles"); - if (desc) return _("1体のヒドラを召喚する。", "Summons a hydra."); - - { - if (cast || fail) - { - msg_print(_("あなたは爬虫類のカードに集中する...", "You concentrate on the trump of a reptile...")); - if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_HYDRA, 0L)) - { - if (fail) - { - msg_print(_("召喚された爬虫類は怒っている!", "The summoned reptile gets angry!")); - } - } - } - } - break; - - case 19: - if (name) return _("モンスターのカード", "Trump Monsters"); - if (desc) return _("複数のモンスターを召喚する。", "Summons some monsters."); - - { - if (cast || fail) - { - int type; - msg_print(_("あなたはモンスターのカードに集中する...", "You concentrate on several trumps at once...")); - if (p_ptr->pclass == CLASS_BEASTMASTER) - type = SUMMON_LIVING; - else - type = 0; - - if (trump_summoning((1 + (plev - 15)/ 10), !fail, p_ptr->y, p_ptr->x, 0, type, 0L)) - { - if (fail) - { - msg_print(_("召喚されたモンスターは怒っている!", "The summoned creatures get angry!")); - } - } - - } - } - break; - - case 20: - if (name) return _("ハウンドのカード", "Trump Hounds"); - if (desc) return _("1グループのハウンドを召喚する。", "Summons a group of hounds."); - - { - if (cast || fail) - { - msg_print(_("あなたはハウンドのカードに集中する...", "You concentrate on the trump of a hound...")); - if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_HOUND, PM_ALLOW_GROUP)) - { - if (fail) - { - msg_print(_("召喚されたハウンドは怒っている!", "The summoned hounds get angry!")); - } - } - } - } - break; - - case 21: - if (name) return _("トランプの刃", "Trump Branding"); - if (desc) return _("武器にトランプの属性をつける。", "Makes current weapon a Trump weapon."); - - { - if (cast) - { - brand_weapon(5); - } - } - break; - - case 22: - if (name) return _("人間トランプ", "Living Trump"); - if (desc) return _("ランダムにテレポートする突然変異か、自分の意思でテレポートする突然変異が身につく。", - "Gives mutation which makes you teleport randomly or makes you able to teleport at will."); - - { - if (cast) - { - int mutation; - - if (one_in_(7)) - /* Teleport control */ - mutation = 12; - else - /* Random teleportation (uncontrolled) */ - mutation = 77; - - /* Gain the mutation */ - if (gain_random_mutation(mutation)) - { - msg_print(_("あなたは生きているカードに変わった。", "You have turned into a Living Trump.")); - } - } - } - break; - - case 23: - if (name) return _("サイバーデーモンのカード", "Trump Cyberdemon"); - if (desc) return _("1体のサイバーデーモンを召喚する。", "Summons a cyber demon."); - - { - if (cast || fail) - { - msg_print(_("あなたはサイバーデーモンのカードに集中する...", "You concentrate on the trump of a Cyberdemon...")); - if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_CYBER, 0L)) - { - if (fail) - { - msg_print(_("召喚されたサイバーデーモンは怒っている!", "The summoned Cyberdemon gets angry!")); - } - } - } - } - break; - - case 24: - if (name) return _("予見のカード", "Trump Divination"); - if (desc) return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。", - "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity."); - - { - int rad = DETECT_RAD_DEFAULT; - - if (info) return info_radius(rad); - - if (cast) - { - detect_all(rad); - } - } - break; - - case 25: - if (name) return _("知識のカード", "Trump Lore"); - if (desc) return _("アイテムの持つ能力を完全に知る。", "*Identifies* an item."); - - { - if (cast) - { - if (!identify_fully(FALSE)) return NULL; - } - } - break; - - case 26: - if (name) return _("回復モンスター", "Heal Monster"); - if (desc) return _("モンスター1体の体力を回復させる。", "Heal a monster."); - - { - int heal = plev * 10 + 200; - - if (info) return info_heal(0, 0, heal); - - if (cast) - { - bool result; - - /* Temporary enable target_pet option */ - bool old_target_pet = target_pet; - target_pet = TRUE; - - result = get_aim_dir(&dir); - - /* Restore target_pet option */ - target_pet = old_target_pet; - - if (!result) return NULL; - - heal_monster(dir, heal); - } - } - break; - - case 27: - if (name) return _("ドラゴンのカード", "Trump Dragon"); - if (desc) return _("1体のドラゴンを召喚する。", "Summons a dragon."); - - { - if (cast || fail) - { - msg_print(_("あなたはドラゴンのカードに集中する...", "You concentrate on the trump of a dragon...")); - if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_DRAGON, 0L)) - { - if (fail) - { - msg_print(_("召喚されたドラゴンは怒っている!", "The summoned dragon gets angry!")); - } - } - } - } - break; - - case 28: - if (name) return _("隕石のカード", "Trump Meteor"); - if (desc) return _("自分の周辺に隕石を落とす。", "Makes meteor balls fall down to nearby random locations."); - - { - HIT_POINT dam = plev * 2; - int rad = 2; - - if (info) return info_multi_damage(dam); - - if (cast) - { - cast_meteor(dam, rad); - } - } - break; - - case 29: - if (name) return _("デーモンのカード", "Trump Demon"); - if (desc) return _("1体の悪魔を召喚する。", "Summons a demon."); - - { - if (cast || fail) - { - msg_print(_("あなたはデーモンのカードに集中する...", "You concentrate on the trump of a demon...")); - if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_DEMON, 0L)) - { - if (fail) - { - msg_print(_("召喚されたデーモンは怒っている!", "The summoned demon gets angry!")); - } - } - } - } - break; - - case 30: - if (name) return _("地獄のカード", "Trump Greater Undead"); - if (desc) return _("1体の上級アンデッドを召喚する。", "Summons a greater undead."); - - { - if (cast || fail) - { - msg_print(_("あなたは強力なアンデッドのカードに集中する...", "You concentrate on the trump of a greater undead being...")); - /* May allow unique depend on level and dice roll */ - if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_HI_UNDEAD, PM_ALLOW_UNIQUE)) - { - if (fail) - { - msg_print(_("召喚された上級アンデッドは怒っている!", "The summoned greater undead creature gets angry!")); - } - } - } - } - break; - - case 31: - if (name) return _("古代ドラゴンのカード", "Trump Ancient Dragon"); - if (desc) return _("1体の古代ドラゴンを召喚する。", "Summons an ancient dragon."); - - { - if (cast) - { - int type; - - if (p_ptr->pclass == CLASS_BEASTMASTER) - type = SUMMON_HI_DRAGON_LIVING; - else - type = SUMMON_HI_DRAGON; - - msg_print(_("あなたは古代ドラゴンのカードに集中する...", "You concentrate on the trump of an ancient dragon...")); - /* May allow unique depend on level and dice roll */ - if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, type, PM_ALLOW_UNIQUE)) - { - if (fail) - { - msg_print(_("召喚された古代ドラゴンは怒っている!", "The summoned ancient dragon gets angry!")); - } - } - } - } - break; - } - - return ""; -} - /*! * @brief 匠領域魔法の各処理を行う diff --git a/src/realm-trump.c b/src/realm-trump.c new file mode 100644 index 000000000..8046b4bfa --- /dev/null +++ b/src/realm-trump.c @@ -0,0 +1,648 @@ +#include "angband.h" +#include "cmd-spell.h" + + +/*! +* @brief ƒgƒ‰ƒ“ƒv—̈斂–@‚ÌŠeˆ—‚ðs‚¤ +* @param spell –‚–@ID +* @param mode ˆ—“à—e (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST) +* @return SPELL_NAME / SPELL_DESC / SPELL_INFO Žž‚É‚Í•¶Žš—ñƒ|ƒCƒ“ƒ^‚ð•Ô‚·BSPELL_CASTŽž‚ÍNULL•¶Žš—ñ‚ð•Ô‚·B +*/ +cptr do_trump_spell(SPELL_IDX spell, BIT_FLAGS mode) +{ + bool name = (mode == SPELL_NAME) ? TRUE : FALSE; + bool desc = (mode == SPELL_DESC) ? TRUE : FALSE; + bool info = (mode == SPELL_INFO) ? TRUE : FALSE; + bool cast = (mode == SPELL_CAST) ? TRUE : FALSE; + bool fail = (mode == SPELL_FAIL) ? TRUE : FALSE; + static const char s_random[] = _("ƒ‰ƒ“ƒ_ƒ€", "random"); + + int dir; + int plev = p_ptr->lev; + + switch (spell) + { + case 0: + if (name) return _("ƒVƒ‡[ƒgEƒeƒŒƒ|[ƒg", "Phase Door"); + if (desc) return _("‹ß‹——£‚̃eƒŒƒ|[ƒg‚ð‚·‚éB", "Teleport short distance."); + + { + POSITION range = 10; + + if (info) return info_range(range); + + if (cast) + { + teleport_player(range, 0L); + } + } + break; + + case 1: + if (name) return _("’w偂̃J[ƒh", "Trump Spiders"); + if (desc) return _("’wå‚ð¢Š«‚·‚éB", "Summons spiders."); + + { + if (cast || fail) + { + msg_print(_("‚ ‚È‚½‚Í’w偂̃J[ƒh‚ɏW’†‚·‚é...", "You concentrate on the trump of an spider...")); + if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_SPIDER, PM_ALLOW_GROUP)) + { + if (fail) + { + msg_print(_("¢Š«‚³‚ꂽ’w偂͓{‚Á‚Ä‚¢‚éI", "The summoned spiders get angry!")); + } + } + } + } + break; + + case 2: + if (name) return _("ƒVƒƒƒbƒtƒ‹", "Shuffle"); + if (desc) return _("ƒJ[ƒh‚̐肢‚ð‚·‚éB", "Causes random effects."); + + { + if (info) return s_random; + + if (cast) + { + cast_shuffle(); + } + } + break; + + case 3: + if (name) return _("ƒtƒƒAEƒŠƒZƒbƒg", "Reset Recall"); + if (desc) return _("Å[ŠK‚ð•ÏX‚·‚éB", "Resets the 'deepest' level for recall spell."); + + { + if (cast) + { + if (!reset_recall()) return NULL; + } + } + break; + + case 4: + if (name) return _("ƒeƒŒƒ|[ƒg", "Teleport"); + if (desc) return _("‰“‹——£‚̃eƒŒƒ|[ƒg‚ð‚·‚éB", "Teleport long distance."); + + { + POSITION range = plev * 4; + + if (info) return info_range(range); + + if (cast) + { + teleport_player(range, 0L); + } + } + break; + + case 5: + if (name) return _("Š´’m‚̃J[ƒh", "Trump Spying"); + if (desc) return _("ˆê’莞ŠÔAƒeƒŒƒpƒV[”\—͂𓾂éB", "Gives telepathy for a while."); + + { + int base = 25; + int sides = 30; + + if (info) return info_duration(base, sides); + + if (cast) + { + set_tim_esp(randint1(sides) + base, FALSE); + } + } + break; + + case 6: + if (name) return _("ƒeƒŒƒ|[ƒgEƒ‚ƒ“ƒXƒ^[", "Teleport Away"); + if (desc) return _("ƒ‚ƒ“ƒXƒ^[‚ðƒeƒŒƒ|[ƒg‚³‚¹‚éƒr[ƒ€‚ð•ú‚B’ïR‚³‚ê‚é‚Æ–³ŒøB", "Teleports all monsters on the line away unless resisted."); + + { + int power = plev; + + if (info) return info_power(power); + + if (cast) + { + if (!get_aim_dir(&dir)) return NULL; + + fire_beam(GF_AWAY_ALL, dir, power); + } + } + break; + + case 7: + if (name) return _("“®•¨‚̃J[ƒh", "Trump Animals"); + if (desc) return _("1‘Ì‚Ì“®•¨‚ð¢Š«‚·‚éB", "Summons an animal."); + + { + if (cast || fail) + { + int type = (!fail ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL); + msg_print(_("‚ ‚È‚½‚Í“®•¨‚̃J[ƒh‚ɏW’†‚·‚é...", "You concentrate on the trump of an animal...")); + if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, type, 0L)) + { + if (fail) + { + msg_print(_("¢Š«‚³‚ꂽ“®•¨‚Í“{‚Á‚Ä‚¢‚éI", "The summoned animal gets angry!")); + } + } + } + } + break; + + case 8: + if (name) return _("ˆÚ“®‚̃J[ƒh", "Trump Reach"); + if (desc) return _("ƒAƒCƒeƒ€‚ðŽ©•ª‚Ì‘«Œ³‚ÖˆÚ“®‚³‚¹‚éB", "Pulls a distant item close to you."); + + { + int weight = plev * 15; + + if (info) return info_weight(weight); + + if (cast) + { + if (!get_aim_dir(&dir)) return NULL; + + fetch(dir, weight, FALSE); + } + } + break; + + case 9: + if (name) return _("ƒJƒ~ƒJƒ[‚̃J[ƒh", "Trump Kamikaze"); + if (desc) return _("•¡”‚Ì”š”­‚·‚郂ƒ“ƒXƒ^[‚ð¢Š«‚·‚éB", "Summons monsters which explode by itself."); + + { + if (cast || fail) + { + int x, y; + int type; + + if (cast) + { + if (!target_set(TARGET_KILL)) return NULL; + x = target_col; + y = target_row; + } + else + { + /* Summons near player when failed */ + x = p_ptr->x; + y = p_ptr->y; + } + + if (p_ptr->pclass == CLASS_BEASTMASTER) + type = SUMMON_KAMIKAZE_LIVING; + else + type = SUMMON_KAMIKAZE; + + msg_print(_("‚ ‚È‚½‚̓Jƒ~ƒJƒ[‚̃J[ƒh‚ɏW’†‚·‚é...", "You concentrate on several trumps at once...")); + if (trump_summoning(2 + randint0(plev / 7), !fail, y, x, 0, type, 0L)) + { + if (fail) + { + msg_print(_("¢Š«‚³‚ꂽƒ‚ƒ“ƒXƒ^[‚Í“{‚Á‚Ä‚¢‚éI", "The summoned creatures get angry!")); + } + } + } + } + break; + + case 10: + if (name) return _("Œ¶—쏢Š«", "Phantasmal Servant"); + if (desc) return _("1‘Ì‚Ì—H—ì‚ð¢Š«‚·‚éB", "Summons a ghost."); + + { + /* Phantasmal Servant is not summoned as enemy when failed */ + if (cast) + { + int summon_lev = plev * 2 / 3 + randint1(plev / 2); + + if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, (summon_lev * 3 / 2), SUMMON_PHANTOM, 0L)) + { + msg_print(_("Œä—p‚Å‚²‚´‚¢‚Ü‚·‚©AŒäŽål—lH", "'Your wish, master?'")); + } + } + } + break; + + case 11: + if (name) return _("ƒXƒs[ƒhEƒ‚ƒ“ƒXƒ^[", "Haste Monster"); + if (desc) return _("ƒ‚ƒ“ƒXƒ^[1‘Ì‚ð‰Á‘¬‚³‚¹‚éB", "Hastes a monster."); + + { + if (cast) + { + bool result; + + /* Temporary enable target_pet option */ + bool old_target_pet = target_pet; + target_pet = TRUE; + + result = get_aim_dir(&dir); + + /* Restore target_pet option */ + target_pet = old_target_pet; + + if (!result) return NULL; + + speed_monster(dir, plev); + } + } + break; + + case 12: + if (name) return _("ƒeƒŒƒ|[ƒgEƒŒƒxƒ‹", "Teleport Level"); + if (desc) return _("uŽž‚ɏォ‰º‚ÌŠK‚ɃeƒŒƒ|[ƒg‚·‚éB", "Teleport to up or down stairs in a moment."); + + { + if (cast) + { + if (!get_check(_("–{“–‚É‘¼‚ÌŠK‚ɃeƒŒƒ|[ƒg‚µ‚Ü‚·‚©H", "Are you sure? (Teleport Level)"))) return NULL; + teleport_level(0); + } + } + break; + + case 13: + if (name) return _("ŽŸŒ³‚Ì”à", "Dimension Door"); + if (desc) return _("’Z‹——£“à‚ÌŽw’肵‚½êŠ‚ɃeƒŒƒ|[ƒg‚·‚éB", "Teleport to given location."); + + { + POSITION range = plev / 2 + 10; + + if (info) return info_range(range); + + if (cast) + { + msg_print(_("ŽŸŒ³‚Ì”à‚ªŠJ‚¢‚½B–Ú“I’n‚ð‘I‚ñ‚ʼnº‚³‚¢B", "You open a dimensional gate. Choose a destination.")); + if (!dimension_door()) return NULL; + } + } + break; + + case 14: + if (name) return _("‹AŠÒ‚ÌŽô•¶", "Word of Recall"); + if (desc) return _("’nã‚É‚¢‚é‚Æ‚«‚̓_ƒ“ƒWƒ‡ƒ“‚̍Ő[ŠK‚ցAƒ_ƒ“ƒWƒ‡ƒ“‚É‚¢‚é‚Æ‚«‚Í’nã‚ւƈړ®‚·‚éB", + "Recalls player from dungeon to town, or from town to the deepest level of dungeon."); + + { + int base = 15; + int sides = 20; + + if (info) return info_delay(base, sides); + + if (cast) + { + if (!word_of_recall()) return NULL; + } + } + break; + + case 15: + if (name) return _("‰ö•¨’Ç•ú", "Banish"); + if (desc) return _("Ž‹ŠE“à‚Ì‘S‚Ẵ‚ƒ“ƒXƒ^[‚ðƒeƒŒƒ|[ƒg‚³‚¹‚éB’ïR‚³‚ê‚é‚Æ–³ŒøB", "Teleports all monsters in sight away unless resisted."); + + { + int power = plev * 4; + + if (info) return info_power(power); + + if (cast) + { + banish_monsters(power); + } + } + break; + + case 16: + if (name) return _("ˆÊ’uŒðŠ·‚̃J[ƒh", "Swap Position"); + if (desc) return _("1‘̂̃‚ƒ“ƒXƒ^[‚ƈʒu‚ðŒðŠ·‚·‚éB", "Swap positions of you and a monster."); + + { + if (cast) + { + bool result; + + /* HACK -- No range limit */ + project_length = -1; + + result = get_aim_dir(&dir); + + /* Restore range to default */ + project_length = 0; + + if (!result) return NULL; + + teleport_swap(dir); + } + } + break; + + case 17: + if (name) return _("ƒAƒ“ƒfƒbƒh‚̃J[ƒh", "Trump Undead"); + if (desc) return _("1‘̂̃Aƒ“ƒfƒbƒh‚ð¢Š«‚·‚éB", "Summons an undead monster."); + + { + if (cast || fail) + { + msg_print(_("‚ ‚È‚½‚̓Aƒ“ƒfƒbƒh‚̃J[ƒh‚ɏW’†‚·‚é...", "You concentrate on the trump of an undead creature...")); + if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_UNDEAD, 0L)) + { + if (fail) + { + msg_print(_("¢Š«‚³‚ꂽƒAƒ“ƒfƒbƒh‚Í“{‚Á‚Ä‚¢‚éI", "The summoned undead creature gets angry!")); + } + } + } + } + break; + + case 18: + if (name) return _("঒Ž—ނ̃J[ƒh", "Trump Reptiles"); + if (desc) return _("1‘̂̃qƒhƒ‰‚ð¢Š«‚·‚éB", "Summons a hydra."); + + { + if (cast || fail) + { + msg_print(_("‚ ‚È‚½‚Í঒Ž—ނ̃J[ƒh‚ɏW’†‚·‚é...", "You concentrate on the trump of a reptile...")); + if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_HYDRA, 0L)) + { + if (fail) + { + msg_print(_("¢Š«‚³‚ꂽ঒Ž—Þ‚Í“{‚Á‚Ä‚¢‚éI", "The summoned reptile gets angry!")); + } + } + } + } + break; + + case 19: + if (name) return _("ƒ‚ƒ“ƒXƒ^[‚̃J[ƒh", "Trump Monsters"); + if (desc) return _("•¡”‚̃‚ƒ“ƒXƒ^[‚ð¢Š«‚·‚éB", "Summons some monsters."); + + { + if (cast || fail) + { + int type; + msg_print(_("‚ ‚È‚½‚̓‚ƒ“ƒXƒ^[‚̃J[ƒh‚ɏW’†‚·‚é...", "You concentrate on several trumps at once...")); + if (p_ptr->pclass == CLASS_BEASTMASTER) + type = SUMMON_LIVING; + else + type = 0; + + if (trump_summoning((1 + (plev - 15) / 10), !fail, p_ptr->y, p_ptr->x, 0, type, 0L)) + { + if (fail) + { + msg_print(_("¢Š«‚³‚ꂽƒ‚ƒ“ƒXƒ^[‚Í“{‚Á‚Ä‚¢‚éI", "The summoned creatures get angry!")); + } + } + + } + } + break; + + case 20: + if (name) return _("ƒnƒEƒ“ƒh‚̃J[ƒh", "Trump Hounds"); + if (desc) return _("1ƒOƒ‹[ƒv‚̃nƒEƒ“ƒh‚ð¢Š«‚·‚éB", "Summons a group of hounds."); + + { + if (cast || fail) + { + msg_print(_("‚ ‚È‚½‚̓nƒEƒ“ƒh‚̃J[ƒh‚ɏW’†‚·‚é...", "You concentrate on the trump of a hound...")); + if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_HOUND, PM_ALLOW_GROUP)) + { + if (fail) + { + msg_print(_("¢Š«‚³‚ꂽƒnƒEƒ“ƒh‚Í“{‚Á‚Ä‚¢‚éI", "The summoned hounds get angry!")); + } + } + } + } + break; + + case 21: + if (name) return _("ƒgƒ‰ƒ“ƒv‚̐n", "Trump Branding"); + if (desc) return _("•Ší‚Ƀgƒ‰ƒ“ƒv‚Ì‘®«‚ð‚‚¯‚éB", "Makes current weapon a Trump weapon."); + + { + if (cast) + { + brand_weapon(5); + } + } + break; + + case 22: + if (name) return _("lŠÔƒgƒ‰ƒ“ƒv", "Living Trump"); + if (desc) return _("ƒ‰ƒ“ƒ_ƒ€‚ɃeƒŒƒ|[ƒg‚·‚é“Ë‘R•ÏˆÙ‚©AŽ©•ª‚̈ӎv‚ŃeƒŒƒ|[ƒg‚·‚é“Ë‘R•ÏˆÙ‚ªg‚ɂ‚­B", + "Gives mutation which makes you teleport randomly or makes you able to teleport at will."); + + { + if (cast) + { + int mutation; + + if (one_in_(7)) + /* Teleport control */ + mutation = 12; + else + /* Random teleportation (uncontrolled) */ + mutation = 77; + + /* Gain the mutation */ + if (gain_random_mutation(mutation)) + { + msg_print(_("‚ ‚È‚½‚͐¶‚«‚Ä‚¢‚éƒJ[ƒh‚É•Ï‚í‚Á‚½B", "You have turned into a Living Trump.")); + } + } + } + break; + + case 23: + if (name) return _("ƒTƒCƒo[ƒf[ƒ‚ƒ“‚̃J[ƒh", "Trump Cyberdemon"); + if (desc) return _("1‘̂̃TƒCƒo[ƒf[ƒ‚ƒ“‚ð¢Š«‚·‚éB", "Summons a cyber demon."); + + { + if (cast || fail) + { + msg_print(_("‚ ‚È‚½‚̓TƒCƒo[ƒf[ƒ‚ƒ“‚̃J[ƒh‚ɏW’†‚·‚é...", "You concentrate on the trump of a Cyberdemon...")); + if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_CYBER, 0L)) + { + if (fail) + { + msg_print(_("¢Š«‚³‚ꂽƒTƒCƒo[ƒf[ƒ‚ƒ“‚Í“{‚Á‚Ä‚¢‚éI", "The summoned Cyberdemon gets angry!")); + } + } + } + } + break; + + case 24: + if (name) return _("—\Œ©‚̃J[ƒh", "Trump Divination"); + if (desc) return _("‹ß‚­‚Ì‘S‚Ẵ‚ƒ“ƒXƒ^[A㩁A”àAŠK’iAà•óA‚»‚µ‚ăAƒCƒeƒ€‚ðŠ´’m‚·‚éB", + "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity."); + + { + int rad = DETECT_RAD_DEFAULT; + + if (info) return info_radius(rad); + + if (cast) + { + detect_all(rad); + } + } + break; + + case 25: + if (name) return _("’mŽ¯‚̃J[ƒh", "Trump Lore"); + if (desc) return _("ƒAƒCƒeƒ€‚ÌŽ‚”\—Í‚ðŠ®‘S‚É’m‚éB", "*Identifies* an item."); + + { + if (cast) + { + if (!identify_fully(FALSE)) return NULL; + } + } + break; + + case 26: + if (name) return _("‰ñ•œƒ‚ƒ“ƒXƒ^[", "Heal Monster"); + if (desc) return _("ƒ‚ƒ“ƒXƒ^[1‘Ì‚Ì‘Ì—Í‚ð‰ñ•œ‚³‚¹‚éB", "Heal a monster."); + + { + int heal = plev * 10 + 200; + + if (info) return info_heal(0, 0, heal); + + if (cast) + { + bool result; + + /* Temporary enable target_pet option */ + bool old_target_pet = target_pet; + target_pet = TRUE; + + result = get_aim_dir(&dir); + + /* Restore target_pet option */ + target_pet = old_target_pet; + + if (!result) return NULL; + + heal_monster(dir, heal); + } + } + break; + + case 27: + if (name) return _("ƒhƒ‰ƒSƒ“‚̃J[ƒh", "Trump Dragon"); + if (desc) return _("1‘̂̃hƒ‰ƒSƒ“‚ð¢Š«‚·‚éB", "Summons a dragon."); + + { + if (cast || fail) + { + msg_print(_("‚ ‚È‚½‚̓hƒ‰ƒSƒ“‚̃J[ƒh‚ɏW’†‚·‚é...", "You concentrate on the trump of a dragon...")); + if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_DRAGON, 0L)) + { + if (fail) + { + msg_print(_("¢Š«‚³‚ꂽƒhƒ‰ƒSƒ“‚Í“{‚Á‚Ä‚¢‚éI", "The summoned dragon gets angry!")); + } + } + } + } + break; + + case 28: + if (name) return _("覐΂̃J[ƒh", "Trump Meteor"); + if (desc) return _("Ž©•ª‚ÌŽü•Ó‚É覐΂𗎂Ƃ·B", "Makes meteor balls fall down to nearby random locations."); + + { + HIT_POINT dam = plev * 2; + int rad = 2; + + if (info) return info_multi_damage(dam); + + if (cast) + { + cast_meteor(dam, rad); + } + } + break; + + case 29: + if (name) return _("ƒf[ƒ‚ƒ“‚̃J[ƒh", "Trump Demon"); + if (desc) return _("1‘̂̈«–‚‚ð¢Š«‚·‚éB", "Summons a demon."); + + { + if (cast || fail) + { + msg_print(_("‚ ‚È‚½‚̓f[ƒ‚ƒ“‚̃J[ƒh‚ɏW’†‚·‚é...", "You concentrate on the trump of a demon...")); + if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_DEMON, 0L)) + { + if (fail) + { + msg_print(_("¢Š«‚³‚ꂽƒf[ƒ‚ƒ“‚Í“{‚Á‚Ä‚¢‚éI", "The summoned demon gets angry!")); + } + } + } + } + break; + + case 30: + if (name) return _("’n–‚̃J[ƒh", "Trump Greater Undead"); + if (desc) return _("1‘̂̏㋉ƒAƒ“ƒfƒbƒh‚ð¢Š«‚·‚éB", "Summons a greater undead."); + + { + if (cast || fail) + { + msg_print(_("‚ ‚È‚½‚Í‹­—͂ȃAƒ“ƒfƒbƒh‚̃J[ƒh‚ɏW’†‚·‚é...", "You concentrate on the trump of a greater undead being...")); + /* May allow unique depend on level and dice roll */ + if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_HI_UNDEAD, PM_ALLOW_UNIQUE)) + { + if (fail) + { + msg_print(_("¢Š«‚³‚ꂽã‹‰ƒAƒ“ƒfƒbƒh‚Í“{‚Á‚Ä‚¢‚éI", "The summoned greater undead creature gets angry!")); + } + } + } + } + break; + + case 31: + if (name) return _("ŒÃ‘ãƒhƒ‰ƒSƒ“‚̃J[ƒh", "Trump Ancient Dragon"); + if (desc) return _("1‘̂̌Ñãƒhƒ‰ƒSƒ“‚ð¢Š«‚·‚éB", "Summons an ancient dragon."); + + { + if (cast) + { + int type; + + if (p_ptr->pclass == CLASS_BEASTMASTER) + type = SUMMON_HI_DRAGON_LIVING; + else + type = SUMMON_HI_DRAGON; + + msg_print(_("‚ ‚È‚½‚͌Ñãƒhƒ‰ƒSƒ“‚̃J[ƒh‚ɏW’†‚·‚é...", "You concentrate on the trump of an ancient dragon...")); + /* May allow unique depend on level and dice roll */ + if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, type, PM_ALLOW_UNIQUE)) + { + if (fail) + { + msg_print(_("¢Š«‚³‚ꂽŒÃ‘ãƒhƒ‰ƒSƒ“‚Í“{‚Á‚Ä‚¢‚éI", "The summoned ancient dragon gets angry!")); + } + } + } + } + break; + } + + return ""; +} diff --git a/src/realm-trump.h b/src/realm-trump.h new file mode 100644 index 000000000..7d9e31ac1 --- /dev/null +++ b/src/realm-trump.h @@ -0,0 +1 @@ +extern cptr do_trump_spell(SPELL_IDX spell, BIT_FLAGS mode); -- 2.11.0