1 #include "status/sight-setter.h"
2 #include "core/disturbance.h"
3 #include "core/player-redraw-types.h"
4 #include "core/player-update-types.h"
5 #include "core/stuff-handler.h"
6 #include "game-option/disturbance-options.h"
7 #include "realm/realm-song-numbers.h"
8 #include "view/display-messages.h"
11 * @brief 時限ESPの継続時間をセットする / Set "tim_esp", notice observable changes
13 * @param do_dec 現在の継続時間より長い値のみ上書きする
14 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
16 bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
19 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
21 if (creature_ptr->is_dead)
25 if (creature_ptr->tim_esp && !do_dec) {
26 if (creature_ptr->tim_esp > v)
28 } else if (!is_time_limit_esp(creature_ptr)) {
29 msg_print(_("意識が広がった気がする!", "You feel your consciousness expand!"));
33 if (creature_ptr->tim_esp && !music_singing(creature_ptr, MUSIC_MIND)) {
34 msg_print(_("意識は元に戻った。", "Your consciousness contracts again."));
39 creature_ptr->tim_esp = v;
40 creature_ptr->redraw |= (PR_STATUS);
46 disturb(creature_ptr, FALSE, FALSE);
47 creature_ptr->update |= (PU_BONUS);
48 creature_ptr->update |= (PU_MONSTERS);
49 handle_stuff(creature_ptr);
54 * @brief 時限透明視の継続時間をセットする / Set "tim_invis", notice observable changes
56 * @param do_dec 現在の継続時間より長い値のみ上書きする
57 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
59 bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
62 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
64 if (creature_ptr->is_dead)
68 if (creature_ptr->tim_invis && !do_dec) {
69 if (creature_ptr->tim_invis > v)
71 } else if (!creature_ptr->tim_invis) {
72 msg_print(_("目が非常に敏感になった気がする!", "Your eyes feel very sensitive!"));
76 if (creature_ptr->tim_invis) {
77 msg_print(_("目の敏感さがなくなったようだ。", "Your eyes feel less sensitive."));
82 creature_ptr->tim_invis = v;
83 creature_ptr->redraw |= (PR_STATUS);
89 disturb(creature_ptr, FALSE, FALSE);
90 creature_ptr->update |= (PU_BONUS);
91 creature_ptr->update |= (PU_MONSTERS);
92 handle_stuff(creature_ptr);
97 * @brief 時限赤外線視力の継続時間をセットする / Set "tim_infra", notice observable changes
99 * @param do_dec 現在の継続時間より長い値のみ上書きする
100 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
102 bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
105 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
107 if (creature_ptr->is_dead)
111 if (creature_ptr->tim_infra && !do_dec) {
112 if (creature_ptr->tim_infra > v)
114 } else if (!creature_ptr->tim_infra) {
115 msg_print(_("目がランランと輝き始めた!", "Your eyes begin to tingle!"));
119 if (creature_ptr->tim_infra) {
120 msg_print(_("目の輝きがなくなった。", "Your eyes stop tingling."));
125 creature_ptr->tim_infra = v;
126 creature_ptr->redraw |= (PR_STATUS);
132 disturb(creature_ptr, FALSE, FALSE);
133 creature_ptr->update |= (PU_BONUS);
134 creature_ptr->update |= (PU_MONSTERS);
135 handle_stuff(creature_ptr);