<ClCompile Include="..\..\src\object-hook\hook-quest.c" />\r
<ClCompile Include="..\..\src\object-hook\hook-weapon.c" />\r
<ClCompile Include="..\..\src\object-hook\hook-armor.c" />\r
+ <ClCompile Include="..\..\src\spell-realm\spells-craft.c" />\r
<ClCompile Include="..\..\src\status\bad-status-setter.c" />\r
<ClCompile Include="..\..\src\status\buff-setter.c" />\r
<ClCompile Include="..\..\src\player\player-realm.c" />\r
<ClInclude Include="..\..\src\object-hook\hook-perception.h" />\r
<ClInclude Include="..\..\src\object-hook\hook-quest.h" />\r
<ClInclude Include="..\..\src\object-hook\hook-weapon.h" />\r
+ <ClInclude Include="..\..\src\spell-realm\spells-craft.h" />\r
<ClInclude Include="..\..\src\status\bad-status-setter.h" />\r
<ClInclude Include="..\..\src\status\buff-setter.h" />\r
<ClInclude Include="..\..\src\player\player-realm.h" />\r
<ClCompile Include="..\..\src\wizard\wizard-messages.c">
<Filter>wizard</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\spell-realm\spells-craft.c">
+ <Filter>spell-realm</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\cmd\cmd-basic.h">
<ClInclude Include="..\..\src\wizard\wizard-messages.h">
<Filter>wizard</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\spell-realm\spells-craft.h">
+ <Filter>spell-realm</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
spell-kind/spells-teleport.c spell-kind/spells-teleport.h \
\
spell-realm/spells-chaos.c spell-realm/spells-chaos.h \
+ spell-realm/spells-craft.c spell-realm/spells-craft.h \
spell-realm/spells-crusade.c spell-realm/spells-crusade.h \
spell-realm/spells-hex.c spell-realm/spells-hex.h \
spell-realm/spells-song.c spell-realm/spells-song.h \
#include "game-option/birth-options.h"
#include "mind/mind-mirror-master.h"
#include "mind/racial-kutar.h"
+#include "player/player-effects.h"
+#include "spell-realm/spells-craft.h"
#include "status/bad-status-setter.h"
#include "status/buff-setter.h"
-#include "player/player-effects.h"
#include "status/sight-setter.h"
/*!
#include "object/object-stack.h"
#include "object/object-value.h"
#include "object/object-info.h"
-#include "player/player-effects.h" // 暫定、相互参照している.
+#include "spell-realm/spells-craft.h"
#include "util/object-sort.h"
#include "view/display-messages.h"
#include "view/object-describer.h"
#include "io/report.h"
#include "io/save.h"
#include "locale/vowel-checker.h"
-#include "mind/stances-table.h"
#include "mind/mind-force-trainer.h"
#include "mind/mind-mirror-master.h"
#include "mind/mind-sniper.h"
+#include "mind/stances-table.h"
#include "monster/monster-status.h"
#include "mutation/mutation.h"
#include "object-enchant/artifact.h"
#include "object/object-value.h"
#include "perception/object-perception.h"
#include "player/avatar.h"
-#include "status/bad-status-setter.h"
-#include "status/buff-setter.h"
#include "player/player-class.h"
#include "player/player-damage.h"
#include "player/player-move.h"
#include "player/race-info-table.h"
#include "realm/realm-song-numbers.h"
#include "spell-kind/spells-floor.h"
+#include "spell-realm/spells-craft.h"
#include "spell-realm/spells-hex.h"
#include "spell/spells-status.h"
+#include "status/bad-status-setter.h"
+#include "status/buff-setter.h"
#include "status/sight-setter.h"
#include "sv-definition/sv-armor-types.h"
#include "sv-definition/sv-protector-types.h"
}
/*!
- * @brief 一時的元素スレイの継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
- * @param attack_type スレイのタイプID
- * @param v 継続時間
- * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
- */
-bool set_ele_attack(player_type *creature_ptr, u32b attack_type, TIME_EFFECT v)
-{
- v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
-
- if ((creature_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID)) {
- creature_ptr->special_attack &= ~(ATTACK_ACID);
- msg_print(_("酸で攻撃できなくなった。", "Your temporary acidic brand fades away."));
- }
-
- if ((creature_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC)) {
- creature_ptr->special_attack &= ~(ATTACK_ELEC);
- msg_print(_("電撃で攻撃できなくなった。", "Your temporary electrical brand fades away."));
- }
-
- if ((creature_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE)) {
- creature_ptr->special_attack &= ~(ATTACK_FIRE);
- msg_print(_("火炎で攻撃できなくなった。", "Your temporary fiery brand fades away."));
- }
-
- if ((creature_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD)) {
- creature_ptr->special_attack &= ~(ATTACK_COLD);
- msg_print(_("冷気で攻撃できなくなった。", "Your temporary frost brand fades away."));
- }
-
- if ((creature_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS)) {
- creature_ptr->special_attack &= ~(ATTACK_POIS);
- msg_print(_("毒で攻撃できなくなった。", "Your temporary poison brand fades away."));
- }
-
- if ((v) && (attack_type)) {
- creature_ptr->special_attack |= (attack_type);
- creature_ptr->ele_attack = v;
-#ifdef JP
- msg_format("%sで攻撃できるようになった!",
- ((attack_type == ATTACK_ACID)
- ? "酸"
- : ((attack_type == ATTACK_ELEC)
- ? "電撃"
- : ((attack_type == ATTACK_FIRE) ? "火炎"
- : ((attack_type == ATTACK_COLD) ? "冷気" : ((attack_type == ATTACK_POIS) ? "毒" : "(なし)"))))));
-#else
- msg_format("For a while, the blows you deal will %s",
- ((attack_type == ATTACK_ACID)
- ? "melt with acid!"
- : ((attack_type == ATTACK_ELEC)
- ? "shock your foes!"
- : ((attack_type == ATTACK_FIRE)
- ? "burn with fire!"
- : ((attack_type == ATTACK_COLD) ? "chill to the bone!"
- : ((attack_type == ATTACK_POIS) ? "poison your enemies!" : "do nothing special."))))));
-#endif
- }
-
- if (disturb_state)
- disturb(creature_ptr, FALSE, FALSE);
- creature_ptr->redraw |= (PR_STATUS);
- creature_ptr->update |= (PU_BONUS);
- handle_stuff(creature_ptr);
-
- return TRUE;
-}
-
-/*!
- * @brief 一時的元素免疫の継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
- * @param immune_type 免疫のタイプID
- * @param v 継続時間
- * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
- */
-bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v)
-{
- v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
-
- if ((creature_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID)) {
- creature_ptr->special_defense &= ~(DEFENSE_ACID);
- msg_print(_("酸の攻撃で傷つけられるようになった。。", "You are no longer immune to acid."));
- }
-
- if ((creature_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC)) {
- creature_ptr->special_defense &= ~(DEFENSE_ELEC);
- msg_print(_("電撃の攻撃で傷つけられるようになった。。", "You are no longer immune to electricity."));
- }
-
- if ((creature_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE)) {
- creature_ptr->special_defense &= ~(DEFENSE_FIRE);
- msg_print(_("火炎の攻撃で傷つけられるようになった。。", "You are no longer immune to fire."));
- }
-
- if ((creature_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD)) {
- creature_ptr->special_defense &= ~(DEFENSE_COLD);
- msg_print(_("冷気の攻撃で傷つけられるようになった。。", "You are no longer immune to cold."));
- }
-
- if ((creature_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS)) {
- creature_ptr->special_defense &= ~(DEFENSE_POIS);
- msg_print(_("毒の攻撃で傷つけられるようになった。。", "You are no longer immune to poison."));
- }
-
- if ((v) && (immune_type)) {
- creature_ptr->special_defense |= (immune_type);
- creature_ptr->ele_immune = v;
- msg_format(_("%sの攻撃を受けつけなくなった!", "For a while, You are immune to %s"),
- ((immune_type == DEFENSE_ACID)
- ? _("酸", "acid!")
- : ((immune_type == DEFENSE_ELEC)
- ? _("電撃", "electricity!")
- : ((immune_type == DEFENSE_FIRE)
- ? _("火炎", "fire!")
- : ((immune_type == DEFENSE_COLD)
- ? _("冷気", "cold!")
- : ((immune_type == DEFENSE_POIS) ? _("毒", "poison!") : _("(なし)", "do nothing special.")))))));
- }
-
- if (disturb_state)
- disturb(creature_ptr, FALSE, FALSE);
- creature_ptr->redraw |= (PR_STATUS);
- creature_ptr->update |= (PU_BONUS);
- handle_stuff(creature_ptr);
-
- return TRUE;
-}
-
-/*!
* @brief 一時的酸耐性の継続時間をセットする / Set "oppose_acid", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
handle_stuff(creature_ptr);
return TRUE;
}
-
-/*
- * Choose a warrior-mage elemental attack. -LM-
- */
-bool choose_ele_attack(player_type *creature_ptr)
-{
- if (!has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM)) {
- msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
- return FALSE;
- }
-
- screen_save();
- int num = (creature_ptr->lev - 20) / 5;
- c_prt(TERM_RED, _(" a) 焼棄", " a) Fire Brand"), 2, 14);
-
- if (num >= 2)
- c_prt(TERM_L_WHITE, _(" b) 凍結", " b) Cold Brand"), 3, 14);
- else
- prt("", 3, 14);
-
- if (num >= 3)
- c_prt(TERM_GREEN, _(" c) 毒殺", " c) Poison Brand"), 4, 14);
- else
- prt("", 4, 14);
-
- if (num >= 4)
- c_prt(TERM_L_DARK, _(" d) 溶解", " d) Acid Brand"), 5, 14);
- else
- prt("", 5, 14);
-
- if (num >= 5)
- c_prt(TERM_BLUE, _(" e) 電撃", " e) Elec Brand"), 6, 14);
- else
- prt("", 6, 14);
-
- prt("", 7, 14);
- prt("", 8, 14);
- prt("", 9, 14);
-
- prt("", 1, 0);
- prt(_(" どの元素攻撃をしますか?", " Choose a temporary elemental brand "), 1, 14);
-
- char choice = inkey();
-
- if ((choice == 'a') || (choice == 'A'))
- set_ele_attack(creature_ptr, ATTACK_FIRE, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
- else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
- set_ele_attack(creature_ptr, ATTACK_COLD, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
- else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
- set_ele_attack(creature_ptr, ATTACK_POIS, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
- else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
- set_ele_attack(creature_ptr, ATTACK_ACID, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
- else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
- set_ele_attack(creature_ptr, ATTACK_ELEC, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
- else {
- msg_print(_("魔法剣を使うのをやめた。", "You cancel the temporary branding."));
- screen_load();
- return FALSE;
- }
-
- screen_load();
- return TRUE;
-}
-
-/*
- * Choose a elemental immune. -LM-
- */
-bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT immune_turn)
-{
- screen_save();
-
- c_prt(TERM_RED, _(" a) 火炎", " a) Immunity to fire"), 2, 14);
- c_prt(TERM_L_WHITE, _(" b) 冷気", " b) Immunity to cold"), 3, 14);
- c_prt(TERM_L_DARK, _(" c) 酸", " c) Immunity to acid"), 4, 14);
- c_prt(TERM_BLUE, _(" d) 電撃", " d) Immunity to elec"), 5, 14);
-
- prt("", 6, 14);
- prt("", 7, 14);
- prt("", 8, 14);
- prt("", 9, 14);
-
- prt("", 1, 0);
- prt(_(" どの元素の免疫をつけますか?", " Choose a temporary elemental immunity "), 1, 14);
-
- char choice = inkey();
-
- if ((choice == 'a') || (choice == 'A'))
- set_ele_immune(creature_ptr, DEFENSE_FIRE, immune_turn);
- else if ((choice == 'b') || (choice == 'B'))
- set_ele_immune(creature_ptr, DEFENSE_COLD, immune_turn);
- else if ((choice == 'c') || (choice == 'C'))
- set_ele_immune(creature_ptr, DEFENSE_ACID, immune_turn);
- else if ((choice == 'd') || (choice == 'D'))
- set_ele_immune(creature_ptr, DEFENSE_ELEC, immune_turn);
- else {
- msg_print(_("免疫を付けるのをやめた。", "You cancel the temporary immunity."));
- screen_load();
- return FALSE;
- }
-
- screen_load();
- return TRUE;
-}
bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
bool set_kabenuke(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
bool set_tsuyoshi(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
-bool set_ele_attack(player_type *creature_ptr, u32b attack_type, TIME_EFFECT v);
-bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v);
bool set_oppose_acid(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
bool set_oppose_elec(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
bool set_oppose_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
bool set_ultimate_res(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
bool set_tim_res_nether(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
bool set_tim_res_time(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
-bool choose_ele_attack(player_type *creature_ptr);
-bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT turn);
bool set_wraith_form(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
void do_poly_wounds(player_type *creature_ptr);
void change_race(player_type *creature_ptr, player_race_type new_race, concptr effect_msg);
#include "player/selfinfo.h"
#include "spell-kind/spells-curse-removal.h"
#include "spell-kind/spells-perception.h"
+#include "spell-realm/spells-craft.h"
#include "spell/range-calc.h"
#include "spell/spells-object.h"
#include "spell/spells-status.h"
--- /dev/null
+#include "spell-realm/spells-craft.h"
+#include "core/stuff-handler.h"
+#include "game-option/disturbance-options.h"
+#include "io/input-key-acceptor.h"
+#include "player/player-move.h"
+#include "player/special-defense-types.h"
+#include "term/screen-processor.h"
+#include "term/term-color-types.h"
+#include "view/display-messages.h"
+
+/*!
+ * @brief 一時的元素スレイの継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
+ * @param attack_type スレイのタイプID
+ * @param v 継続時間
+ * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
+ */
+bool set_ele_attack(player_type *creature_ptr, u32b attack_type, TIME_EFFECT v)
+{
+ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
+
+ if ((creature_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID)) {
+ creature_ptr->special_attack &= ~(ATTACK_ACID);
+ msg_print(_("酸で攻撃できなくなった。", "Your temporary acidic brand fades away."));
+ }
+
+ if ((creature_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC)) {
+ creature_ptr->special_attack &= ~(ATTACK_ELEC);
+ msg_print(_("電撃で攻撃できなくなった。", "Your temporary electrical brand fades away."));
+ }
+
+ if ((creature_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE)) {
+ creature_ptr->special_attack &= ~(ATTACK_FIRE);
+ msg_print(_("火炎で攻撃できなくなった。", "Your temporary fiery brand fades away."));
+ }
+
+ if ((creature_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD)) {
+ creature_ptr->special_attack &= ~(ATTACK_COLD);
+ msg_print(_("冷気で攻撃できなくなった。", "Your temporary frost brand fades away."));
+ }
+
+ if ((creature_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS)) {
+ creature_ptr->special_attack &= ~(ATTACK_POIS);
+ msg_print(_("毒で攻撃できなくなった。", "Your temporary poison brand fades away."));
+ }
+
+ if ((v) && (attack_type)) {
+ creature_ptr->special_attack |= (attack_type);
+ creature_ptr->ele_attack = v;
+#ifdef JP
+ msg_format("%sで攻撃できるようになった!",
+ ((attack_type == ATTACK_ACID)
+ ? "酸"
+ : ((attack_type == ATTACK_ELEC)
+ ? "電撃"
+ : ((attack_type == ATTACK_FIRE) ? "火炎"
+ : ((attack_type == ATTACK_COLD) ? "冷気" : ((attack_type == ATTACK_POIS) ? "毒" : "(なし)"))))));
+#else
+ msg_format("For a while, the blows you deal will %s",
+ ((attack_type == ATTACK_ACID)
+ ? "melt with acid!"
+ : ((attack_type == ATTACK_ELEC)
+ ? "shock your foes!"
+ : ((attack_type == ATTACK_FIRE)
+ ? "burn with fire!"
+ : ((attack_type == ATTACK_COLD) ? "chill to the bone!"
+ : ((attack_type == ATTACK_POIS) ? "poison your enemies!" : "do nothing special."))))));
+#endif
+ }
+
+ if (disturb_state)
+ disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->redraw |= (PR_STATUS);
+ creature_ptr->update |= (PU_BONUS);
+ handle_stuff(creature_ptr);
+
+ return TRUE;
+}
+
+/*!
+ * @brief 一時的元素免疫の継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
+ * @param immune_type 免疫のタイプID
+ * @param v 継続時間
+ * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
+ */
+bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v)
+{
+ v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
+
+ if ((creature_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID)) {
+ creature_ptr->special_defense &= ~(DEFENSE_ACID);
+ msg_print(_("酸の攻撃で傷つけられるようになった。。", "You are no longer immune to acid."));
+ }
+
+ if ((creature_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC)) {
+ creature_ptr->special_defense &= ~(DEFENSE_ELEC);
+ msg_print(_("電撃の攻撃で傷つけられるようになった。。", "You are no longer immune to electricity."));
+ }
+
+ if ((creature_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE)) {
+ creature_ptr->special_defense &= ~(DEFENSE_FIRE);
+ msg_print(_("火炎の攻撃で傷つけられるようになった。。", "You are no longer immune to fire."));
+ }
+
+ if ((creature_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD)) {
+ creature_ptr->special_defense &= ~(DEFENSE_COLD);
+ msg_print(_("冷気の攻撃で傷つけられるようになった。。", "You are no longer immune to cold."));
+ }
+
+ if ((creature_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS)) {
+ creature_ptr->special_defense &= ~(DEFENSE_POIS);
+ msg_print(_("毒の攻撃で傷つけられるようになった。。", "You are no longer immune to poison."));
+ }
+
+ if ((v) && (immune_type)) {
+ creature_ptr->special_defense |= (immune_type);
+ creature_ptr->ele_immune = v;
+ msg_format(_("%sの攻撃を受けつけなくなった!", "For a while, You are immune to %s"),
+ ((immune_type == DEFENSE_ACID)
+ ? _("酸", "acid!")
+ : ((immune_type == DEFENSE_ELEC)
+ ? _("電撃", "electricity!")
+ : ((immune_type == DEFENSE_FIRE)
+ ? _("火炎", "fire!")
+ : ((immune_type == DEFENSE_COLD)
+ ? _("冷気", "cold!")
+ : ((immune_type == DEFENSE_POIS) ? _("毒", "poison!") : _("(なし)", "do nothing special.")))))));
+ }
+
+ if (disturb_state)
+ disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->redraw |= (PR_STATUS);
+ creature_ptr->update |= (PU_BONUS);
+ handle_stuff(creature_ptr);
+
+ return TRUE;
+}
+
+/*
+ * Choose a warrior-mage elemental attack. -LM-
+ */
+bool choose_ele_attack(player_type *creature_ptr)
+{
+ if (!has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM)) {
+ msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
+ return FALSE;
+ }
+
+ screen_save();
+ int num = (creature_ptr->lev - 20) / 5;
+ c_prt(TERM_RED, _(" a) 焼棄", " a) Fire Brand"), 2, 14);
+
+ if (num >= 2)
+ c_prt(TERM_L_WHITE, _(" b) 凍結", " b) Cold Brand"), 3, 14);
+ else
+ prt("", 3, 14);
+
+ if (num >= 3)
+ c_prt(TERM_GREEN, _(" c) 毒殺", " c) Poison Brand"), 4, 14);
+ else
+ prt("", 4, 14);
+
+ if (num >= 4)
+ c_prt(TERM_L_DARK, _(" d) 溶解", " d) Acid Brand"), 5, 14);
+ else
+ prt("", 5, 14);
+
+ if (num >= 5)
+ c_prt(TERM_BLUE, _(" e) 電撃", " e) Elec Brand"), 6, 14);
+ else
+ prt("", 6, 14);
+
+ prt("", 7, 14);
+ prt("", 8, 14);
+ prt("", 9, 14);
+
+ prt("", 1, 0);
+ prt(_(" どの元素攻撃をしますか?", " Choose a temporary elemental brand "), 1, 14);
+
+ char choice = inkey();
+
+ if ((choice == 'a') || (choice == 'A'))
+ set_ele_attack(creature_ptr, ATTACK_FIRE, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
+ else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
+ set_ele_attack(creature_ptr, ATTACK_COLD, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
+ else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
+ set_ele_attack(creature_ptr, ATTACK_POIS, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
+ else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
+ set_ele_attack(creature_ptr, ATTACK_ACID, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
+ else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
+ set_ele_attack(creature_ptr, ATTACK_ELEC, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
+ else {
+ msg_print(_("魔法剣を使うのをやめた。", "You cancel the temporary branding."));
+ screen_load();
+ return FALSE;
+ }
+
+ screen_load();
+ return TRUE;
+}
+/*
+ * Choose a elemental immune. -LM-
+ */
+bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT immune_turn)
+{
+ screen_save();
+
+ c_prt(TERM_RED, _(" a) 火炎", " a) Immunity to fire"), 2, 14);
+ c_prt(TERM_L_WHITE, _(" b) 冷気", " b) Immunity to cold"), 3, 14);
+ c_prt(TERM_L_DARK, _(" c) 酸", " c) Immunity to acid"), 4, 14);
+ c_prt(TERM_BLUE, _(" d) 電撃", " d) Immunity to elec"), 5, 14);
+
+ prt("", 6, 14);
+ prt("", 7, 14);
+ prt("", 8, 14);
+ prt("", 9, 14);
+
+ prt("", 1, 0);
+ prt(_(" どの元素の免疫をつけますか?", " Choose a temporary elemental immunity "), 1, 14);
+
+ char choice = inkey();
+
+ if ((choice == 'a') || (choice == 'A'))
+ set_ele_immune(creature_ptr, DEFENSE_FIRE, immune_turn);
+ else if ((choice == 'b') || (choice == 'B'))
+ set_ele_immune(creature_ptr, DEFENSE_COLD, immune_turn);
+ else if ((choice == 'c') || (choice == 'C'))
+ set_ele_immune(creature_ptr, DEFENSE_ACID, immune_turn);
+ else if ((choice == 'd') || (choice == 'D'))
+ set_ele_immune(creature_ptr, DEFENSE_ELEC, immune_turn);
+ else {
+ msg_print(_("免疫を付けるのをやめた。", "You cancel the temporary immunity."));
+ screen_load();
+ return FALSE;
+ }
+
+ screen_load();
+ return TRUE;
+}
--- /dev/null
+#pragma once
+
+#include "system/angband.h"
+
+bool set_ele_attack(player_type *creature_ptr, u32b attack_type, TIME_EFFECT v);
+bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v);
+bool choose_ele_attack(player_type *creature_ptr);
+bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT turn);