2 #include "object/lite-processor.h"
3 #include "object-ego.h"
4 #include "object-hook.h"
5 #include "player-move.h"
6 #include "world/world.h"
9 * @brief 10ゲームターンが進行する毎に光源の寿命を減らす処理
10 * / Handle burning fuel every 10 game turns
13 void reduce_lite_life(player_type* creature_ptr)
15 object_type* o_ptr = &creature_ptr->inventory_list[INVEN_LITE];
16 if (o_ptr->tval != TV_LITE)
19 if (object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR) || (o_ptr->xtra4 <= 0))
22 if (o_ptr->name2 == EGO_LITE_LONG) {
23 if (current_world_ptr->game_turn % (TURNS_PER_TICK * 2))
28 notice_lite_change(creature_ptr, o_ptr);
32 * @brief 寿命つき光源の警告メッセージ処理
33 * @param creature_ptr プレーヤーへの参照ポインタ
34 * @param o_ptr 現在光源として使っているオブジェクトの構造体参照ポインタ
37 void notice_lite_change(player_type* creature_ptr, object_type* o_ptr)
39 if ((o_ptr->xtra4 < 100) || (!(o_ptr->xtra4 % 100))) {
40 creature_ptr->window |= (PW_EQUIP);
43 if (creature_ptr->blind) {
44 if (o_ptr->xtra4 == 0)
46 } else if (o_ptr->xtra4 == 0) {
47 disturb(creature_ptr, FALSE, TRUE);
48 msg_print(_("明かりが消えてしまった!", "Your light has gone out!"));
49 creature_ptr->update |= (PU_TORCH);
50 creature_ptr->update |= (PU_BONUS);
51 } else if (o_ptr->name2 == EGO_LITE_LONG) {
52 if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5))
53 && (current_world_ptr->game_turn % (TURNS_PER_TICK * 2))) {
55 disturb(creature_ptr, FALSE, TRUE);
56 msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));
58 } else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10))) {
60 disturb(creature_ptr, FALSE, TRUE);
61 msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));