<ClCompile Include="..\..\src\market\building-craft-armor.c" />\r
<ClCompile Include="..\..\src\market\building-craft-fix.c" />\r
<ClCompile Include="..\..\src\market\building-craft-weapon.c" />\r
+ <ClCompile Include="..\..\src\market\building-enchanter.c" />\r
<ClCompile Include="..\..\src\market\building-monster.c" />\r
<ClCompile Include="..\..\src\market\building-quest.c" />\r
<ClCompile Include="..\..\src\market\building-recharger.c" />\r
<ClInclude Include="..\..\src\market\building-craft-armor.h" />\r
<ClInclude Include="..\..\src\market\building-craft-fix.h" />\r
<ClInclude Include="..\..\src\market\building-craft-weapon.h" />\r
+ <ClInclude Include="..\..\src\market\building-enchanter.h" />\r
<ClInclude Include="..\..\src\market\building-monster.h" />\r
<ClInclude Include="..\..\src\market\building-quest.h" />\r
<ClInclude Include="..\..\src\market\building-recharger.h" />\r
<ClCompile Include="..\..\src\market\building-monster.c">
<Filter>market</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\market\building-enchanter.c">
+ <Filter>market</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\cmd\cmd-activate.h">
<ClInclude Include="..\..\src\market\building-monster.h">
<Filter>market</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\market\building-enchanter.h">
+ <Filter>market</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
market/building-craft-armor.c market/building-craft-armor.h \
market/building-craft-fix.c market/building-craft-fix.h \
market/building-monster.c market/building-monster.h \
+ market/building-enchanter.c market/building-enchanter.h \
\
view/display-characteristic.c view/display-characteristic.h \
view/display-fruit.c view/display-fruit.h \
--- /dev/null
+#include "system/angband.h"
+#include "market/building-enchanter.h"
+#include "object/object-flavor.h"
+#include "spell/spells-object.h"
+#include "market/building-util.h"
+#include "inventory/player-inventory.h"
+#include "player/player-effects.h"
+
+/*!
+ * @brief アイテムの強化を行う。 / Enchant item
+ * @param player_ptr プレーヤーへの参照ポインタ
+ * @param cost 1回毎の費用
+ * @param to_hit 命中をアップさせる量
+ * @param to_dam ダメージをアップさせる量
+ * @param to_ac ACをアップさせる量
+ * @return 実際に行ったらTRUE
+ */
+bool enchant_item(player_type *player_ptr, PRICE cost, HIT_PROB to_hit, HIT_POINT to_dam, ARMOUR_CLASS to_ac, OBJECT_TYPE_VALUE item_tester_tval)
+{
+ clear_bldg(4, 18);
+ int maxenchant = (player_ptr->lev / 5);
+ prt(format(_("現在のあなたの技量だと、+%d まで改良できます。", " Based on your skill, we can improve up to +%d."), maxenchant), 5, 0);
+ prt(format(_(" 改良の料金は一個につき$%d です。", " The price for the service is %d gold per item."), cost), 7, 0);
+
+ concptr q = _("どのアイテムを改良しますか?", "Improve which item? ");
+ concptr s = _("改良できるものがありません。", "You have nothing to improve.");
+
+ OBJECT_IDX item;
+ object_type *o_ptr;
+ o_ptr = choose_object(player_ptr, &item, q, s, (USE_INVEN | USE_EQUIP | IGNORE_BOTHHAND_SLOT), item_tester_tval);
+ if (!o_ptr)
+ return FALSE;
+
+ char tmp_str[MAX_NLEN];
+ if (player_ptr->au < (cost * o_ptr->number)) {
+ object_desc(player_ptr, tmp_str, o_ptr, OD_NAME_ONLY);
+ msg_format(_("%sを改良するだけのゴールドがありません!", "You do not have the gold to improve %s!"), tmp_str);
+ return FALSE;
+ }
+
+ bool okay = FALSE;
+ for (int i = 0; i < to_hit; i++) {
+ if ((o_ptr->to_h < maxenchant) && enchant(player_ptr, o_ptr, 1, (ENCH_TOHIT | ENCH_FORCE))) {
+ okay = TRUE;
+ break;
+ }
+ }
+
+ for (int i = 0; i < to_dam; i++) {
+ if ((o_ptr->to_d < maxenchant) && enchant(player_ptr, o_ptr, 1, (ENCH_TODAM | ENCH_FORCE))) {
+ okay = TRUE;
+ break;
+ }
+ }
+
+ for (int i = 0; i < to_ac; i++) {
+ if ((o_ptr->to_a < maxenchant) && enchant(player_ptr, o_ptr, 1, (ENCH_TOAC | ENCH_FORCE))) {
+ okay = TRUE;
+ break;
+ }
+ }
+
+ if (!okay) {
+ if (flush_failure)
+ flush();
+ msg_print(_("改良に失敗した。", "The improvement failed."));
+ return FALSE;
+ }
+
+ object_desc(player_ptr, tmp_str, o_ptr, OD_NAME_AND_ENCHANT);
+#ifdef JP
+ msg_format("$%dで%sに改良しました。", cost * o_ptr->number, tmp_str);
+#else
+ msg_format("Improved into %s for %d gold.", tmp_str, cost * o_ptr->number);
+#endif
+
+ player_ptr->au -= (cost * o_ptr->number);
+ if (item >= INVEN_RARM)
+ calc_android_exp(player_ptr);
+ return TRUE;
+}
--- /dev/null
+#pragma once
+
+bool enchant_item(player_type *player_ptr, PRICE cost, HIT_PROB to_hit, HIT_POINT to_dam, ARMOUR_CLASS to_ac, OBJECT_TYPE_VALUE item_tester_tval);
/*!
- * @file building.c
* @brief 町の施設処理 / Building commands
* @date 2013/12/23
* @author
#include "mutation/mutation.h"
#include "cmd-spell.h"
#include "spell/spells3.h"
-#include "spell/spells-object.h"
#include "spell/spells-status.h"
#include "io/files-util.h"
#include "player/player-status.h"
-#include "player/player-effects.h"
#include "player/player-personalities-table.h"
-#include "inventory/player-inventory.h"
#include "core/scores.h"
#include "monster/monster-race.h"
#include "market/poker.h"
#include "market/building-util.h"
#include "market/play-gamble.h"
-#include "view/display-fruit.h"
#include "market/arena.h"
#include "market/bounty.h"
#include "market/building-recharger.h"
#include "market/building-craft-armor.h"
#include "market/building-craft-fix.h"
#include "market/building-monster.h"
+#include "market/building-enchanter.h"
building_type building[MAX_BLDG];
screen_load();
}
-
-/*!
- * @brief アイテムの強化を行う。 / Enchant item
- * @param player_ptr プレーヤーへの参照ポインタ
- * @param cost 1回毎の費用
- * @param to_hit 命中をアップさせる量
- * @param to_dam ダメージをアップさせる量
- * @param to_ac ACをアップさせる量
- * @return 実際に行ったらTRUE
- */
-static bool enchant_item(player_type *player_ptr, PRICE cost, HIT_PROB to_hit, HIT_POINT to_dam, ARMOUR_CLASS to_ac, OBJECT_TYPE_VALUE item_tester_tval)
-{
- clear_bldg(4, 18);
- int maxenchant = (player_ptr->lev / 5);
- prt(format(_("現在のあなたの技量だと、+%d まで改良できます。", " Based on your skill, we can improve up to +%d."), maxenchant), 5, 0);
- prt(format(_(" 改良の料金は一個につき$%d です。", " The price for the service is %d gold per item."), cost), 7, 0);
-
- concptr q = _("どのアイテムを改良しますか?", "Improve which item? ");
- concptr s = _("改良できるものがありません。", "You have nothing to improve.");
-
- OBJECT_IDX item;
- object_type *o_ptr;
- o_ptr = choose_object(player_ptr, &item, q, s, (USE_INVEN | USE_EQUIP | IGNORE_BOTHHAND_SLOT), item_tester_tval);
- if (!o_ptr) return FALSE;
-
- char tmp_str[MAX_NLEN];
- if (player_ptr->au < (cost * o_ptr->number))
- {
- object_desc(player_ptr, tmp_str, o_ptr, OD_NAME_ONLY);
- msg_format(_("%sを改良するだけのゴールドがありません!", "You do not have the gold to improve %s!"), tmp_str);
- return FALSE;
- }
-
- bool okay = FALSE;
- for (int i = 0; i < to_hit; i++)
- {
- if ((o_ptr->to_h < maxenchant) && enchant(player_ptr, o_ptr, 1, (ENCH_TOHIT | ENCH_FORCE)))
- {
- okay = TRUE;
- break;
- }
- }
-
- for (int i = 0; i < to_dam; i++)
- {
- if ((o_ptr->to_d < maxenchant) && enchant(player_ptr, o_ptr, 1, (ENCH_TODAM | ENCH_FORCE)))
- {
- okay = TRUE;
- break;
- }
- }
-
- for (int i = 0; i < to_ac; i++)
- {
- if ((o_ptr->to_a < maxenchant) && enchant(player_ptr, o_ptr, 1, (ENCH_TOAC | ENCH_FORCE)))
- {
- okay = TRUE;
- break;
- }
- }
-
- if (!okay)
- {
- if (flush_failure) flush();
- msg_print(_("改良に失敗した。", "The improvement failed."));
- return FALSE;
- }
-
- object_desc(player_ptr, tmp_str, o_ptr, OD_NAME_AND_ENCHANT);
-#ifdef JP
- msg_format("$%dで%sに改良しました。", cost * o_ptr->number, tmp_str);
-#else
- msg_format("Improved into %s for %d gold.", tmp_str, cost * o_ptr->number);
-#endif
-
- player_ptr->au -= (cost * o_ptr->number);
- if (item >= INVEN_RARM) calc_android_exp(player_ptr);
- return TRUE;
-}
-
/*!
* @brief 施設の処理実行メインルーチン / Execute a building command
* @param player_ptr プレーヤーへの参照ポインタ