1 #include "object/lite-processor.h"
2 #include "core/disturbance.h"
3 #include "core/player-update-types.h"
4 #include "core/window-redrawer.h"
5 #include "game-option/disturbance-options.h"
6 #include "inventory/inventory-slot-types.h"
7 #include "object-enchant/object-ego.h"
8 #include "sv-definition/sv-lite-types.h"
9 #include "system/object-type-definition.h"
10 #include "system/player-type-definition.h"
11 #include "view/display-messages.h"
12 #include "world/world.h"
15 * @brief 10ゲームターンが進行する毎に光源の寿命を減らす処理
16 * / Handle burning fuel every 10 game turns
18 void reduce_lite_life(PlayerType* player_ptr)
20 ObjectType* o_ptr = &player_ptr->inventory_list[INVEN_LITE];
21 if (o_ptr->tval != ItemKindType::LITE)
24 if (o_ptr->is_fixed_artifact() || (o_ptr->sval == SV_LITE_FEANOR) || (o_ptr->xtra4 <= 0))
27 if (o_ptr->name2 == EGO_LITE_LONG) {
28 if (w_ptr->game_turn % (TURNS_PER_TICK * 2))
33 notice_lite_change(player_ptr, o_ptr);
37 * @brief 寿命つき光源の警告メッセージ処理
38 * @param player_ptr プレイヤーへの参照ポインタ
39 * @param o_ptr 現在光源として使っているオブジェクトの構造体参照ポインタ
41 void notice_lite_change(PlayerType* player_ptr, ObjectType* o_ptr)
43 if ((o_ptr->xtra4 < 100) || (!(o_ptr->xtra4 % 100))) {
44 player_ptr->window_flags |= (PW_EQUIP);
47 if (player_ptr->blind) {
48 if (o_ptr->xtra4 == 0)
50 } else if (o_ptr->xtra4 == 0) {
51 disturb(player_ptr, false, true);
52 msg_print(_("明かりが消えてしまった!", "Your light has gone out!"));
53 player_ptr->update |= (PU_TORCH);
54 player_ptr->update |= (PU_BONUS);
55 } else if (o_ptr->name2 == EGO_LITE_LONG) {
56 if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5))
57 && (w_ptr->game_turn % (TURNS_PER_TICK * 2))) {
59 disturb(player_ptr, false, true);
60 msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));
62 } else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10))) {
64 disturb(player_ptr, false, true);
65 msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));