From ecbe0acea1e7bcb268685f70c31f5906ed9004a1 Mon Sep 17 00:00:00 2001 From: Deskull Date: Thu, 13 Sep 2018 20:36:34 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=E3=80=80=E5=8C=A0=E9=A0=98?= =?utf8?q?=E5=9F=9F=E5=87=A6=E7=90=86=E3=82=92=20cmd-spell.c=20=E3=81=8B?= =?utf8?q?=E3=82=89=20realm-craft.c/h=20=E3=81=B8=E5=88=86=E9=9B=A2?= =?utf8?q?=E3=80=82=20Separate=20craft=20realm=20process=20from=20cmd-spel?= =?utf8?q?l.c=20to=20realm-craft.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 | 537 +------------------- src/realm-craft.c | 538 +++++++++++++++++++++ src/realm-craft.h | 1 + 5 files changed, 548 insertions(+), 536 deletions(-) create mode 100644 src/realm-craft.c create mode 100644 src/realm-craft.h diff --git a/Hengband_vcs2015/Hengband/Hengband.vcxproj b/Hengband_vcs2015/Hengband/Hengband.vcxproj index 8509bff15..f21c3006b 100644 --- a/Hengband_vcs2015/Hengband/Hengband.vcxproj +++ b/Hengband_vcs2015/Hengband/Hengband.vcxproj @@ -144,6 +144,7 @@ + @@ -257,6 +258,7 @@ + diff --git a/Hengband_vcs2015/Hengband/Hengband.vcxproj.filters b/Hengband_vcs2015/Hengband/Hengband.vcxproj.filters index a9585e7b1..ddba36451 100644 --- a/Hengband_vcs2015/Hengband/Hengband.vcxproj.filters +++ b/Hengband_vcs2015/Hengband/Hengband.vcxproj.filters @@ -277,6 +277,9 @@ Source + + Source + @@ -427,6 +430,9 @@ Header + + Header + diff --git a/src/cmd-spell.c b/src/cmd-spell.c index 100be8d6c..0fd8d75ce 100644 --- a/src/cmd-spell.c +++ b/src/cmd-spell.c @@ -12,6 +12,7 @@ #include "spells-summon.h" #include "realm-arcane.h" #include "realm-chaos.h" +#include "realm-craft.h" #include "realm-death.h" #include "realm-life.h" #include "realm-nature.h" @@ -236,542 +237,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_craft_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; - - int plev = p_ptr->lev; - - switch (spell) - { - case 0: - if (name) return _("赤外線視力", "Infravision"); - if (desc) return _("一定時間、赤外線視力が増強される。", "Gives infravision for a while."); - - { - int base = 100; - - if (info) return info_duration(base, base); - - if (cast) - { - set_tim_infra(base + randint1(base), FALSE); - } - } - break; - - case 1: - if (name) return _("回復力強化", "Regeneration"); - if (desc) return _("一定時間、回復力が増強される。", "Gives regeneration ability for a while."); - - { - int base = 80; - - if (info) return info_duration(base, base); - - if (cast) - { - set_tim_regen(base + randint1(base), FALSE); - } - } - break; - - case 2: - if (name) return _("空腹充足", "Satisfy Hunger"); - if (desc) return _("満腹になる。", "Satisfies hunger."); - - { - if (cast) - { - set_food(PY_FOOD_MAX - 1); - } - } - break; - - case 3: - if (name) return _("耐冷気", "Resist Cold"); - if (desc) return _("一定時間、冷気への耐性を得る。装備による耐性に累積する。", - "Gives resistance to cold. This resistance can be added to which from equipment for more powerful resistance."); - - { - int base = 20; - - if (info) return info_duration(base, base); - - if (cast) - { - set_oppose_cold(randint1(base) + base, FALSE); - } - } - break; - - case 4: - if (name) return _("耐火炎", "Resist Fire"); - if (desc) return _("一定時間、炎への耐性を得る。装備による耐性に累積する。", - "Gives resistance to fire. This resistance can be added to which from equipment for more powerful resistance."); - - { - int base = 20; - - if (info) return info_duration(base, base); - - if (cast) - { - set_oppose_fire(randint1(base) + base, FALSE); - } - } - break; - - case 5: - if (name) return _("士気高揚", "Heroism"); - if (desc) return _("一定時間、ヒーロー気分になる。", "Removes fear, and gives bonus to hit and 10 more HP for a while."); - - { - int base = 25; - - if (info) return info_duration(base, base); - - if (cast) - { - set_hero(randint1(base) + base, FALSE); - hp_player(10); - set_afraid(0); - } - } - break; - - case 6: - if (name) return _("耐電撃", "Resist Lightning"); - if (desc) return _("一定時間、電撃への耐性を得る。装備による耐性に累積する。", - "Gives resistance to electricity. This resistance can be added to which from equipment for more powerful resistance."); - - { - int base = 20; - - if (info) return info_duration(base, base); - - if (cast) - { - set_oppose_elec(randint1(base) + base, FALSE); - } - } - break; - - case 7: - if (name) return _("耐酸", "Resist Acid"); - if (desc) return _("一定時間、酸への耐性を得る。装備による耐性に累積する。", - "Gives resistance to acid. This resistance can be added to which from equipment for more powerful resistance."); - - { - int base = 20; - - if (info) return info_duration(base, base); - - if (cast) - { - set_oppose_acid(randint1(base) + base, FALSE); - } - } - break; - - case 8: - if (name) return _("透明視認", "See Invisibility"); - if (desc) return _("一定時間、透明なものが見えるようになる。", "Gives see invisible for a while."); - - { - int base = 24; - - if (info) return info_duration(base, base); - - if (cast) - { - set_tim_invis(randint1(base) + base, FALSE); - } - } - break; - - case 9: - if (name) return _("解呪", "Remove Curse"); - if (desc) return _("アイテムにかかった弱い呪いを解除する。", "Removes normal curses from equipped items."); - - { - if (cast) - { - if (remove_curse()) - { - msg_print(_("誰かに見守られているような気がする。", "You feel as if someone is watching over you.")); - } - } - } - break; - - case 10: - if (name) return _("耐毒", "Resist Poison"); - if (desc) return _("一定時間、毒への耐性を得る。装備による耐性に累積する。", - "Gives resistance to poison. This resistance can be added to which from equipment for more powerful resistance."); - - { - int base = 20; - - if (info) return info_duration(base, base); - - if (cast) - { - set_oppose_pois(randint1(base) + base, FALSE); - } - } - break; - - case 11: - if (name) return _("狂戦士化", "Berserk"); - if (desc) return _("狂戦士化し、恐怖を除去する。", "Gives bonus to hit and HP, immunity to fear for a while. But decreases AC."); - - { - int base = 25; - - if (info) return info_duration(base, base); - - if (cast) - { - set_shero(randint1(base) + base, FALSE); - hp_player(30); - set_afraid(0); - } - } - break; - - case 12: - if (name) return _("自己分析", "Self Knowledge"); - if (desc) return _("現在の自分の状態を完全に知る。", - "Gives you useful info regarding your current resistances, the powers of your weapon and maximum limits of your stats."); - - { - if (cast) - { - self_knowledge(); - } - } - break; - - case 13: - if (name) return _("対邪悪結界", "Protection from Evil"); - if (desc) return _("邪悪なモンスターの攻撃を防ぐバリアを張る。", "Gives aura which protect you from evil monster's physical attack."); - - { - int base = 3 * plev; - int sides = 25; - - if (info) return info_duration(base, sides); - - if (cast) - { - set_protevil(randint1(sides) + base, FALSE); - } - } - break; - - case 14: - if (name) return _("癒し", "Cure"); - if (desc) return _("毒、朦朧状態、負傷を全快させ、幻覚を直す。", "Heals poison, stun, cut and hallucination completely."); - - { - if (cast) - { - set_poisoned(0); - set_stun(0); - set_cut(0); - set_image(0); - } - } - break; - - case 15: - if (name) return _("魔法剣", "Mana Branding"); - if (desc) return _("一定時間、武器に冷気、炎、電撃、酸、毒のいずれかの属性をつける。武器を持たないと使えない。", - "Makes current weapon some elemental branded. You must wield weapons."); - - { - int base = plev / 2; - - if (info) return info_duration(base, base); - - if (cast) - { - if (!choose_ele_attack()) return NULL; - } - } - break; - - case 16: - if (name) return _("テレパシー", "Telepathy"); - 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 17: - if (name) return _("肌石化", "Stone Skin"); - if (desc) return _("一定時間、ACを上昇させる。", "Gives bonus to AC for a while."); - - { - int base = 30; - int sides = 20; - - if (info) return info_duration(base, sides); - - if (cast) - { - set_shield(randint1(sides) + base, FALSE); - } - } - break; - - case 18: - if (name) return _("全耐性", "Resistance"); - if (desc) return _("一定時間、酸、電撃、炎、冷気、毒に対する耐性を得る。装備による耐性に累積する。", - "Gives resistance to fire, cold, electricity, acid and poison for a while. These resistances can be added to which from equipment for more powerful resistances."); - - { - int base = 20; - - if (info) return info_duration(base, base); - - if (cast) - { - set_oppose_acid(randint1(base) + base, FALSE); - set_oppose_elec(randint1(base) + base, FALSE); - set_oppose_fire(randint1(base) + base, FALSE); - set_oppose_cold(randint1(base) + base, FALSE); - set_oppose_pois(randint1(base) + base, FALSE); - } - } - break; - - case 19: - if (name) return _("スピード", "Haste Self"); - if (desc) return _("一定時間、加速する。", "Hastes you for a while."); - - { - int base = plev; - int sides = 20 + plev; - - if (info) return info_duration(base, sides); - - if (cast) - { - set_fast(randint1(sides) + base, FALSE); - } - } - break; - - case 20: - if (name) return _("壁抜け", "Walk through Wall"); - if (desc) return _("一定時間、半物質化し壁を通り抜けられるようになる。", "Gives ability to pass walls for a while."); - - { - int base = plev / 2; - - if (info) return info_duration(base, base); - - if (cast) - { - set_kabenuke(randint1(base) + base, FALSE); - } - } - break; - - case 21: - if (name) return _("盾磨き", "Polish Shield"); - if (desc) return _("盾に反射の属性をつける。", "Makes a shield a shield of reflection."); - - { - if (cast) - { - pulish_shield(); - } - } - break; - - case 22: - if (name) return _("ゴーレム製造", "Create Golem"); - if (desc) return _("1体のゴーレムを製造する。", "Creates a golem."); - - { - if (cast) - { - if (summon_specific(-1, p_ptr->y, p_ptr->x, plev, SUMMON_GOLEM, PM_FORCE_PET)) - { - msg_print(_("ゴーレムを作った。", "You make a golem.")); - } - else - { - msg_print(_("うまくゴーレムを作れなかった。", "No Golems arrive.")); - } - } - } - break; - - case 23: - if (name) return _("魔法の鎧", "Magical armor"); - if (desc) return _("一定時間、魔法防御力とACが上がり、混乱と盲目の耐性、反射能力、麻痺知らず、浮遊を得る。", - "Gives resistance to magic, bonus to AC, resistance to confusion, blindness, reflection, free action and levitation for a while."); - - { - int base = 20; - - if (info) return info_duration(base, base); - - if (cast) - { - set_magicdef(randint1(base) + base, FALSE); - } - } - break; - - case 24: - if (name) return _("装備無力化", "Remove Enchantment"); - if (desc) return _("武器・防具にかけられたあらゆる魔力を完全に解除する。", "Removes all magics completely from any weapon or armor."); - - { - if (cast) - { - if (!mundane_spell(TRUE)) return NULL; - } - } - break; - - case 25: - if (name) return _("呪い粉砕", "Remove All Curse"); - if (desc) return _("アイテムにかかった強力な呪いを解除する。", "Removes normal and heavy curse from equipped items."); - - { - if (cast) - { - if (remove_all_curse()) - { - msg_print(_("誰かに見守られているような気がする。", "You feel as if someone is watching over you.")); - } - } - } - break; - - case 26: - if (name) return _("完全なる知識", "Knowledge True"); - if (desc) return _("アイテムの持つ能力を完全に知る。", "*Identifies* an item."); - - { - if (cast) - { - if (!identify_fully(FALSE)) return NULL; - } - } - break; - - case 27: - if (name) return _("武器強化", "Enchant Weapon"); - if (desc) return _("武器の命中率修正とダメージ修正を強化する。", "Attempts to increase +to-hit, +to-dam of a weapon."); - - { - if (cast) - { - if (!enchant_spell(randint0(4) + 1, randint0(4) + 1, 0)) return NULL; - } - } - break; - - case 28: - if (name) return _("防具強化", "Enchant Armor"); - if (desc) return _("鎧の防御修正を強化する。", "Attempts to increase +AC of an armor."); - - { - if (cast) - { - if (!enchant_spell(0, 0, randint0(3) + 2)) return NULL; - } - } - break; - - case 29: - if (name) return _("武器属性付与", "Brand Weapon"); - if (desc) return _("武器にランダムに属性をつける。", "Makes current weapon a random ego weapon."); - - { - if (cast) - { - brand_weapon(randint0(18)); - } - } - break; - - case 30: - 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 31: - if (name) return _("属性への免疫", "Immunity"); - if (desc) return _("一定時間、冷気、炎、電撃、酸のいずれかに対する免疫を得る。", - "Gives an immunity to fire, cold, electricity or acid for a while."); - - { - int base = 13; - - if (info) return info_duration(base, base); - - if (cast) - { - if (!choose_ele_immune(base + randint1(base))) return NULL; - } - } - break; - } - - return ""; -} - /*! * @brief 悪魔領域魔法の各処理を行う * @param spell 魔法ID diff --git a/src/realm-craft.c b/src/realm-craft.c new file mode 100644 index 000000000..f2450a0fe --- /dev/null +++ b/src/realm-craft.c @@ -0,0 +1,538 @@ +#include "angband.h" +#include "cmd-spell.h" +#include "selfinfo.h" + + + +/*! +* @brief  —̈斂–@‚ÌŠ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_craft_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; + + int plev = p_ptr->lev; + + switch (spell) + { + case 0: + if (name) return _("ÔŠOüŽ‹—Í", "Infravision"); + if (desc) return _("ˆê’莞ŠÔAÔŠOüŽ‹—Í‚ª‘‹­‚³‚ê‚éB", "Gives infravision for a while."); + + { + int base = 100; + + if (info) return info_duration(base, base); + + if (cast) + { + set_tim_infra(base + randint1(base), FALSE); + } + } + break; + + case 1: + if (name) return _("‰ñ•œ—Í‹­‰»", "Regeneration"); + if (desc) return _("ˆê’莞ŠÔA‰ñ•œ—Í‚ª‘‹­‚³‚ê‚éB", "Gives regeneration ability for a while."); + + { + int base = 80; + + if (info) return info_duration(base, base); + + if (cast) + { + set_tim_regen(base + randint1(base), FALSE); + } + } + break; + + case 2: + if (name) return _("‹ó• [‘«", "Satisfy Hunger"); + if (desc) return _("–ž• ‚É‚È‚éB", "Satisfies hunger."); + + { + if (cast) + { + set_food(PY_FOOD_MAX - 1); + } + } + break; + + case 3: + if (name) return _("‘Ï—â‹C", "Resist Cold"); + if (desc) return _("ˆê’莞ŠÔA—â‹C‚ւ̑ϐ«‚𓾂éB‘•”õ‚É‚æ‚é‘ϐ«‚ɗݐς·‚éB", + "Gives resistance to cold. This resistance can be added to which from equipment for more powerful resistance."); + + { + int base = 20; + + if (info) return info_duration(base, base); + + if (cast) + { + set_oppose_cold(randint1(base) + base, FALSE); + } + } + break; + + case 4: + if (name) return _("‘ωΉŠ", "Resist Fire"); + if (desc) return _("ˆê’莞ŠÔA‰Š‚ւ̑ϐ«‚𓾂éB‘•”õ‚É‚æ‚é‘ϐ«‚ɗݐς·‚éB", + "Gives resistance to fire. This resistance can be added to which from equipment for more powerful resistance."); + + { + int base = 20; + + if (info) return info_duration(base, base); + + if (cast) + { + set_oppose_fire(randint1(base) + base, FALSE); + } + } + break; + + case 5: + if (name) return _("Žm‹C‚—g", "Heroism"); + if (desc) return _("ˆê’莞ŠÔAƒq[ƒ[‹C•ª‚É‚È‚éB", "Removes fear, and gives bonus to hit and 10 more HP for a while."); + + { + int base = 25; + + if (info) return info_duration(base, base); + + if (cast) + { + set_hero(randint1(base) + base, FALSE); + hp_player(10); + set_afraid(0); + } + } + break; + + case 6: + if (name) return _("‘Ï“dŒ‚", "Resist Lightning"); + if (desc) return _("ˆê’莞ŠÔA“dŒ‚‚ւ̑ϐ«‚𓾂éB‘•”õ‚É‚æ‚é‘ϐ«‚ɗݐς·‚éB", + "Gives resistance to electricity. This resistance can be added to which from equipment for more powerful resistance."); + + { + int base = 20; + + if (info) return info_duration(base, base); + + if (cast) + { + set_oppose_elec(randint1(base) + base, FALSE); + } + } + break; + + case 7: + if (name) return _("‘ÏŽ_", "Resist Acid"); + if (desc) return _("ˆê’莞ŠÔAŽ_‚ւ̑ϐ«‚𓾂éB‘•”õ‚É‚æ‚é‘ϐ«‚ɗݐς·‚éB", + "Gives resistance to acid. This resistance can be added to which from equipment for more powerful resistance."); + + { + int base = 20; + + if (info) return info_duration(base, base); + + if (cast) + { + set_oppose_acid(randint1(base) + base, FALSE); + } + } + break; + + case 8: + if (name) return _("“§–¾Ž‹”F", "See Invisibility"); + if (desc) return _("ˆê’莞ŠÔA“§–¾‚È‚à‚Ì‚ªŒ©‚¦‚é‚悤‚É‚È‚éB", "Gives see invisible for a while."); + + { + int base = 24; + + if (info) return info_duration(base, base); + + if (cast) + { + set_tim_invis(randint1(base) + base, FALSE); + } + } + break; + + case 9: + if (name) return _("‰ðŽô", "Remove Curse"); + if (desc) return _("ƒAƒCƒeƒ€‚É‚©‚©‚Á‚½Žã‚¢Žô‚¢‚ð‰ðœ‚·‚éB", "Removes normal curses from equipped items."); + + { + if (cast) + { + if (remove_curse()) + { + msg_print(_("’N‚©‚ÉŒ©Žç‚ç‚ê‚Ä‚¢‚é‚悤‚È‹C‚ª‚·‚éB", "You feel as if someone is watching over you.")); + } + } + } + break; + + case 10: + if (name) return _("‘Ï“Å", "Resist Poison"); + if (desc) return _("ˆê’莞ŠÔA“łւ̑ϐ«‚𓾂éB‘•”õ‚É‚æ‚é‘ϐ«‚ɗݐς·‚éB", + "Gives resistance to poison. This resistance can be added to which from equipment for more powerful resistance."); + + { + int base = 20; + + if (info) return info_duration(base, base); + + if (cast) + { + set_oppose_pois(randint1(base) + base, FALSE); + } + } + break; + + case 11: + if (name) return _("‹¶íŽm‰»", "Berserk"); + if (desc) return _("‹¶íŽm‰»‚µA‹°•|‚ðœ‹Ž‚·‚éB", "Gives bonus to hit and HP, immunity to fear for a while. But decreases AC."); + + { + int base = 25; + + if (info) return info_duration(base, base); + + if (cast) + { + set_shero(randint1(base) + base, FALSE); + hp_player(30); + set_afraid(0); + } + } + break; + + case 12: + if (name) return _("Ž©ŒÈ•ªÍ", "Self Knowledge"); + if (desc) return _("Œ»Ý‚ÌŽ©•ª‚̏ó‘Ô‚ðŠ®‘S‚É’m‚éB", + "Gives you useful info regarding your current resistances, the powers of your weapon and maximum limits of your stats."); + + { + if (cast) + { + self_knowledge(); + } + } + break; + + case 13: + if (name) return _("‘Ύ׈«Œ‹ŠE", "Protection from Evil"); + if (desc) return _("Ž×ˆ«‚ȃ‚ƒ“ƒXƒ^[‚̍UŒ‚‚ð–h‚®ƒoƒŠƒA‚𒣂éB", "Gives aura which protect you from evil monster's physical attack."); + + { + int base = 3 * plev; + int sides = 25; + + if (info) return info_duration(base, sides); + + if (cast) + { + set_protevil(randint1(sides) + base, FALSE); + } + } + break; + + case 14: + if (name) return _("–ü‚µ", "Cure"); + if (desc) return _("“ŁAžNžOó‘ԁA•‰‚ð‘S‰õ‚³‚¹AŒ¶Šo‚𒼂·B", "Heals poison, stun, cut and hallucination completely."); + + { + if (cast) + { + set_poisoned(0); + set_stun(0); + set_cut(0); + set_image(0); + } + } + break; + + case 15: + if (name) return _("–‚–@Œ•", "Mana Branding"); + if (desc) return _("ˆê’莞ŠÔA•Ší‚É—â‹CA‰ŠA“dŒ‚AŽ_A“Å‚Ì‚¢‚¸‚ê‚©‚Ì‘®«‚ð‚‚¯‚éB•Ší‚ðŽ‚½‚È‚¢‚ÆŽg‚¦‚È‚¢B", + "Makes current weapon some elemental branded. You must wield weapons."); + + { + int base = plev / 2; + + if (info) return info_duration(base, base); + + if (cast) + { + if (!choose_ele_attack()) return NULL; + } + } + break; + + case 16: + if (name) return _("ƒeƒŒƒpƒV[", "Telepathy"); + 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 17: + if (name) return _("”§Î‰»", "Stone Skin"); + if (desc) return _("ˆê’莞ŠÔAAC‚ðã¸‚³‚¹‚éB", "Gives bonus to AC for a while."); + + { + int base = 30; + int sides = 20; + + if (info) return info_duration(base, sides); + + if (cast) + { + set_shield(randint1(sides) + base, FALSE); + } + } + break; + + case 18: + if (name) return _("‘S‘ϐ«", "Resistance"); + if (desc) return _("ˆê’莞ŠÔAŽ_A“dŒ‚A‰ŠA—â‹CA“łɑ΂·‚é‘ϐ«‚𓾂éB‘•”õ‚É‚æ‚é‘ϐ«‚ɗݐς·‚éB", + "Gives resistance to fire, cold, electricity, acid and poison for a while. These resistances can be added to which from equipment for more powerful resistances."); + + { + int base = 20; + + if (info) return info_duration(base, base); + + if (cast) + { + set_oppose_acid(randint1(base) + base, FALSE); + set_oppose_elec(randint1(base) + base, FALSE); + set_oppose_fire(randint1(base) + base, FALSE); + set_oppose_cold(randint1(base) + base, FALSE); + set_oppose_pois(randint1(base) + base, FALSE); + } + } + break; + + case 19: + if (name) return _("ƒXƒs[ƒh", "Haste Self"); + if (desc) return _("ˆê’莞ŠÔA‰Á‘¬‚·‚éB", "Hastes you for a while."); + + { + int base = plev; + int sides = 20 + plev; + + if (info) return info_duration(base, sides); + + if (cast) + { + set_fast(randint1(sides) + base, FALSE); + } + } + break; + + case 20: + if (name) return _("•Ç”²‚¯", "Walk through Wall"); + if (desc) return _("ˆê’莞ŠÔA”¼•¨Ž¿‰»‚µ•Ç‚ð’ʂ蔲‚¯‚ç‚ê‚é‚悤‚É‚È‚éB", "Gives ability to pass walls for a while."); + + { + int base = plev / 2; + + if (info) return info_duration(base, base); + + if (cast) + { + set_kabenuke(randint1(base) + base, FALSE); + } + } + break; + + case 21: + if (name) return _("‚–‚«", "Polish Shield"); + if (desc) return _("‚‚É”½ŽË‚Ì‘®«‚ð‚‚¯‚éB", "Makes a shield a shield of reflection."); + + { + if (cast) + { + pulish_shield(); + } + } + break; + + case 22: + if (name) return _("ƒS[ƒŒƒ€»‘¢", "Create Golem"); + if (desc) return _("1‘̂̃S[ƒŒƒ€‚𐻑¢‚·‚éB", "Creates a golem."); + + { + if (cast) + { + if (summon_specific(-1, p_ptr->y, p_ptr->x, plev, SUMMON_GOLEM, PM_FORCE_PET)) + { + msg_print(_("ƒS[ƒŒƒ€‚ðì‚Á‚½B", "You make a golem.")); + } + else + { + msg_print(_("‚¤‚Ü‚­ƒS[ƒŒƒ€‚ðì‚ê‚È‚©‚Á‚½B", "No Golems arrive.")); + } + } + } + break; + + case 23: + if (name) return _("–‚–@‚ÌŠZ", "Magical armor"); + if (desc) return _("ˆê’莞ŠÔA–‚–@–hŒä—Í‚ÆAC‚ªã‚ª‚èA¬—‚ƖӖڂ̑ϐ«A”½ŽË”\—́A–ƒáƒ’m‚炸A•‚—V‚𓾂éB", + "Gives resistance to magic, bonus to AC, resistance to confusion, blindness, reflection, free action and levitation for a while."); + + { + int base = 20; + + if (info) return info_duration(base, base); + + if (cast) + { + set_magicdef(randint1(base) + base, FALSE); + } + } + break; + + case 24: + if (name) return _("‘•”õ–³—͉»", "Remove Enchantment"); + if (desc) return _("•ŠíE–h‹ï‚É‚©‚¯‚ç‚ꂽ‚ ‚ç‚ä‚é–‚—Í‚ðŠ®‘S‚É‰ðœ‚·‚éB", "Removes all magics completely from any weapon or armor."); + + { + if (cast) + { + if (!mundane_spell(TRUE)) return NULL; + } + } + break; + + case 25: + if (name) return _("Žô‚¢•²Ó", "Remove All Curse"); + if (desc) return _("ƒAƒCƒeƒ€‚É‚©‚©‚Á‚½‹­—Í‚ÈŽô‚¢‚ð‰ðœ‚·‚éB", "Removes normal and heavy curse from equipped items."); + + { + if (cast) + { + if (remove_all_curse()) + { + msg_print(_("’N‚©‚ÉŒ©Žç‚ç‚ê‚Ä‚¢‚é‚悤‚È‹C‚ª‚·‚éB", "You feel as if someone is watching over you.")); + } + } + } + break; + + case 26: + if (name) return _("Š®‘S‚È‚é’mŽ¯", "Knowledge True"); + if (desc) return _("ƒAƒCƒeƒ€‚ÌŽ‚”\—Í‚ðŠ®‘S‚É’m‚éB", "*Identifies* an item."); + + { + if (cast) + { + if (!identify_fully(FALSE)) return NULL; + } + } + break; + + case 27: + if (name) return _("•Ší‹­‰»", "Enchant Weapon"); + if (desc) return _("•Ší‚Ì–½’†—¦C³‚ƃ_ƒ[ƒWC³‚ð‹­‰»‚·‚éB", "Attempts to increase +to-hit, +to-dam of a weapon."); + + { + if (cast) + { + if (!enchant_spell(randint0(4) + 1, randint0(4) + 1, 0)) return NULL; + } + } + break; + + case 28: + if (name) return _("–h‹ï‹­‰»", "Enchant Armor"); + if (desc) return _("ŠZ‚Ì–hŒäC³‚ð‹­‰»‚·‚éB", "Attempts to increase +AC of an armor."); + + { + if (cast) + { + if (!enchant_spell(0, 0, randint0(3) + 2)) return NULL; + } + } + break; + + case 29: + if (name) return _("•Ší‘®«•t—^", "Brand Weapon"); + if (desc) return _("•Ší‚Ƀ‰ƒ“ƒ_ƒ€‚É‘®«‚ð‚‚¯‚éB", "Makes current weapon a random ego weapon."); + + { + if (cast) + { + brand_weapon(randint0(18)); + } + } + break; + + case 30: + 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 31: + if (name) return _("‘®«‚ւ̖Ɖu", "Immunity"); + if (desc) return _("ˆê’莞ŠÔA—â‹CA‰ŠA“dŒ‚AŽ_‚Ì‚¢‚¸‚ê‚©‚ɑ΂·‚é–Ɖu‚𓾂éB", + "Gives an immunity to fire, cold, electricity or acid for a while."); + + { + int base = 13; + + if (info) return info_duration(base, base); + + if (cast) + { + if (!choose_ele_immune(base + randint1(base))) return NULL; + } + } + break; + } + + return ""; +} diff --git a/src/realm-craft.h b/src/realm-craft.h new file mode 100644 index 000000000..6ca14beda --- /dev/null +++ b/src/realm-craft.h @@ -0,0 +1 @@ +cptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode); -- 2.11.0