<ClCompile Include="..\..\src\effect\spells-effect-util.c" />\r
<ClCompile Include="..\..\src\floor\pattern-walk.c" />\r
<ClCompile Include="..\..\src\inventory\inventory-curse.c" />\r
+ <ClCompile Include="..\..\src\inventory\recharge-processor.c" />\r
<ClCompile Include="..\..\src\inventory\simple-appraiser.c" />\r
<ClCompile Include="..\..\src\io\dump-remover.c" />\r
<ClCompile Include="..\..\src\io\mutations-dump.c" />\r
<ClInclude Include="..\..\src\effect\spells-effect-util.h" />\r
<ClInclude Include="..\..\src\floor\pattern-walk.h" />\r
<ClInclude Include="..\..\src\inventory\inventory-curse.h" />\r
+ <ClInclude Include="..\..\src\inventory\recharge-processor.h" />\r
<ClInclude Include="..\..\src\inventory\simple-appraiser.h" />\r
<ClInclude Include="..\..\src\io\dump-remover.h" />\r
<ClInclude Include="..\..\src\io\mutations-dump.h" />\r
<ClCompile Include="..\..\src\inventory\inventory-curse.c">
<Filter>inventory</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\inventory\recharge-processor.c">
+ <Filter>inventory</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\gamevalue.h" />
<ClInclude Include="..\..\src\inventory\inventory-curse.h">
<Filter>inventory</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\inventory\recharge-processor.h">
+ <Filter>inventory</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
\
inventory/simple-appraiser.c inventory/simple-appraiser.h \
inventory/inventory-curse.c inventory/inventory-curse.h \
+ inventory/recharge-processor.c inventory/recharge-processor.h \
\
patron.h patron.c \
\
#include "player-effects.h"
#include "cmd-spell.h"
#include "realm/realm-hex.h"
-#include "object/object-kind.h"
-#include "object-hook.h"
#include "wild.h"
#include "monster-process.h"
#include "monster-status.h"
#include "object/lite-processor.h"
#include "core/magic-effects-timeout-reducer.h"
#include "inventory/inventory-curse.h"
+#include "inventory/recharge-processor.h"
/*!
* コピーライト情報 /
int init_flags;
/*!
- * @brief
- * !!を刻んだ魔道具の時間経過による再充填を知らせる処理 /
- * If player has inscribed the object with "!!", let him know when it's recharged. -LM-
- * @param o_ptr 対象オブジェクトの構造体参照ポインタ
- * @return なし
- */
-static void recharged_notice(player_type *owner_ptr, object_type *o_ptr)
-{
- if (!o_ptr->inscription) return;
-
- concptr s = my_strchr(quark_str(o_ptr->inscription), '!');
- while (s)
- {
- if (s[1] == '!')
- {
- GAME_TEXT o_name[MAX_NLEN];
- object_desc(owner_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
-#ifdef JP
- msg_format("%sは再充填された。", o_name);
-#else
- if (o_ptr->number > 1)
- msg_format("Your %s are recharged.", o_name);
- else
- msg_format("Your %s is recharged.", o_name);
-#endif
- disturb(owner_ptr, FALSE, FALSE);
- return;
- }
-
- s = my_strchr(s + 1, '!');
- }
-}
-
-
-/*!
* @brief プレイヤーの歌に関する継続処理
* @return なし
*/
/*!
- * @brief 10ゲームターンが進行するごとに魔道具の自然充填を行う処理
- * / Handle recharging objects once every 10 game turns
- * @return なし
- */
-static void process_world_aux_recharge(player_type *creature_ptr)
-{
- int i;
- bool changed;
-
- for (changed = FALSE, i = INVEN_RARM; i < INVEN_TOTAL; i++)
- {
- object_type *o_ptr = &creature_ptr->inventory_list[i];
- if (!o_ptr->k_idx) continue;
-
- if (o_ptr->timeout > 0)
- {
- o_ptr->timeout--;
- if (!o_ptr->timeout)
- {
- recharged_notice(creature_ptr, o_ptr);
- changed = TRUE;
- }
- }
- }
-
- if (changed)
- {
- creature_ptr->window |= (PW_EQUIP);
- wild_regen = 20;
- }
-
- /*
- * Recharge rods. Rods now use timeout to control charging status,
- * and each charging rod in a stack decreases the stack's timeout by
- * one per turn. -LM-
- */
- for (changed = FALSE, i = 0; i < INVEN_PACK; i++)
- {
- object_type *o_ptr = &creature_ptr->inventory_list[i];
- object_kind *k_ptr = &k_info[o_ptr->k_idx];
- if (!o_ptr->k_idx) continue;
-
- if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
- {
- TIME_EFFECT temp = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
- if (temp > o_ptr->number) temp = (TIME_EFFECT)o_ptr->number;
-
- o_ptr->timeout -= temp;
- if (o_ptr->timeout < 0) o_ptr->timeout = 0;
-
- if (!(o_ptr->timeout))
- {
- recharged_notice(creature_ptr, o_ptr);
- changed = TRUE;
- }
- else if (o_ptr->timeout % k_ptr->pval)
- {
- changed = TRUE;
- }
- }
- }
-
- if (changed)
- {
- creature_ptr->window |= (PW_INVEN);
- wild_regen = 20;
- }
-
- for (i = 1; i < creature_ptr->current_floor_ptr->o_max; i++)
- {
- object_type *o_ptr = &creature_ptr->current_floor_ptr->o_list[i];
- if (!OBJECT_IS_VALID(o_ptr)) continue;
-
- if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
- {
- o_ptr->timeout -= (TIME_EFFECT)o_ptr->number;
- if (o_ptr->timeout < 0) o_ptr->timeout = 0;
- }
- }
-}
-
-
-/*!
* @brief 10ゲームターンが進行するごとに帰還や現実変容などの残り時間カウントダウンと発動を処理する。
* / Handle involuntary movement once every 10 game turns
* @return なし
reduce_lite_life(player_ptr);
process_world_aux_mutation(player_ptr);
process_world_aux_curse(player_ptr);
- process_world_aux_recharge(player_ptr);
+ recharge_magic_items(player_ptr);
sense_inventory1(player_ptr);
sense_inventory2(player_ptr);
process_world_aux_movement(player_ptr);
--- /dev/null
+#include "angband.h"
+#include "object-flavor.h"
+#include "player-move.h"
+#include "core/hp-mp-regenerator.h"
+#include "object/object-kind.h"
+#include "object-hook.h"
+
+/*!
+ * @brief
+ * !!を刻んだ魔道具の時間経過による再充填を知らせる処理 /
+ * If player has inscribed the object with "!!", let him know when it's recharged. -LM-
+ * @param o_ptr 対象オブジェクトの構造体参照ポインタ
+ * @return なし
+ */
+static void recharged_notice(player_type* owner_ptr, object_type* o_ptr)
+{
+ if (!o_ptr->inscription)
+ return;
+
+ concptr s = my_strchr(quark_str(o_ptr->inscription), '!');
+ while (s) {
+ if (s[1] == '!') {
+ GAME_TEXT o_name[MAX_NLEN];
+ object_desc(owner_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+#ifdef JP
+ msg_format("%sは再充填された。", o_name);
+#else
+ if (o_ptr->number > 1)
+ msg_format("Your %s are recharged.", o_name);
+ else
+ msg_format("Your %s is recharged.", o_name);
+#endif
+ disturb(owner_ptr, FALSE, FALSE);
+ return;
+ }
+
+ s = my_strchr(s + 1, '!');
+ }
+}
+
+/*!
+ * @brief 10ゲームターンが進行するごとに魔道具の自然充填を行う処理
+ * / Handle recharging objects once every 10 game turns
+ * @return なし
+ */
+void recharge_magic_items(player_type* creature_ptr)
+{
+ int i;
+ bool changed;
+
+ for (changed = FALSE, i = INVEN_RARM; i < INVEN_TOTAL; i++) {
+ object_type* o_ptr = &creature_ptr->inventory_list[i];
+ if (!o_ptr->k_idx)
+ continue;
+
+ if (o_ptr->timeout > 0) {
+ o_ptr->timeout--;
+ if (!o_ptr->timeout) {
+ recharged_notice(creature_ptr, o_ptr);
+ changed = TRUE;
+ }
+ }
+ }
+
+ if (changed) {
+ creature_ptr->window |= (PW_EQUIP);
+ wild_regen = 20;
+ }
+
+ /*
+ * Recharge rods. Rods now use timeout to control charging status,
+ * and each charging rod in a stack decreases the stack's timeout by
+ * one per turn. -LM-
+ */
+ for (changed = FALSE, i = 0; i < INVEN_PACK; i++) {
+ object_type* o_ptr = &creature_ptr->inventory_list[i];
+ object_kind* k_ptr = &k_info[o_ptr->k_idx];
+ if (!o_ptr->k_idx)
+ continue;
+
+ if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout)) {
+ TIME_EFFECT temp = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
+ if (temp > o_ptr->number)
+ temp = (TIME_EFFECT)o_ptr->number;
+
+ o_ptr->timeout -= temp;
+ if (o_ptr->timeout < 0)
+ o_ptr->timeout = 0;
+
+ if (!(o_ptr->timeout)) {
+ recharged_notice(creature_ptr, o_ptr);
+ changed = TRUE;
+ } else if (o_ptr->timeout % k_ptr->pval) {
+ changed = TRUE;
+ }
+ }
+ }
+
+ if (changed) {
+ creature_ptr->window |= (PW_INVEN);
+ wild_regen = 20;
+ }
+
+ for (i = 1; i < creature_ptr->current_floor_ptr->o_max; i++) {
+ object_type* o_ptr = &creature_ptr->current_floor_ptr->o_list[i];
+ if (!OBJECT_IS_VALID(o_ptr))
+ continue;
+
+ if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout)) {
+ o_ptr->timeout -= (TIME_EFFECT)o_ptr->number;
+ if (o_ptr->timeout < 0)
+ o_ptr->timeout = 0;
+ }
+ }
+}
--- /dev/null
+#pragma once
+
+void recharge_magic_items(player_type* creature_ptr);