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 "object-hook/hook-enchant.h"
9 #include "sv-definition/sv-lite-types.h"
10 #include "view/display-messages.h"
11 #include "world/world.h"
14 * @brief 10ゲームターンが進行する毎に光源の寿命を減らす処理
15 * / Handle burning fuel every 10 game turns
18 void reduce_lite_life(player_type* creature_ptr)
20 object_type* o_ptr = &creature_ptr->inventory_list[INVEN_LITE];
21 if (o_ptr->tval != TV_LITE)
24 if (object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR) || (o_ptr->xtra4 <= 0))
27 if (o_ptr->name2 == EGO_LITE_LONG) {
28 if (current_world_ptr->game_turn % (TURNS_PER_TICK * 2))
33 notice_lite_change(creature_ptr, o_ptr);
37 * @brief 寿命つき光源の警告メッセージ処理
38 * @param creature_ptr プレーヤーへの参照ポインタ
39 * @param o_ptr 現在光源として使っているオブジェクトの構造体参照ポインタ
42 void notice_lite_change(player_type* creature_ptr, object_type* o_ptr)
44 if ((o_ptr->xtra4 < 100) || (!(o_ptr->xtra4 % 100))) {
45 creature_ptr->window |= (PW_EQUIP);
48 if (creature_ptr->blind) {
49 if (o_ptr->xtra4 == 0)
51 } else if (o_ptr->xtra4 == 0) {
52 disturb(creature_ptr, FALSE, TRUE);
53 msg_print(_("明かりが消えてしまった!", "Your light has gone out!"));
54 creature_ptr->update |= (PU_TORCH);
55 creature_ptr->update |= (PU_BONUS);
56 } else if (o_ptr->name2 == EGO_LITE_LONG) {
57 if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5))
58 && (current_world_ptr->game_turn % (TURNS_PER_TICK * 2))) {
60 disturb(creature_ptr, FALSE, TRUE);
61 msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));
63 } else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10))) {
65 disturb(creature_ptr, FALSE, TRUE);
66 msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));