1 #include "status/temporary-resistance.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 "view/display-messages.h"
10 * @brief 一時的浮遊の継続時間をセットする / Set "tim_levitation", notice observable changes
12 * @param do_dec 現在の継続時間より長い値のみ上書きする
13 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
15 bool set_tim_levitation(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
18 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
20 if (creature_ptr->is_dead)
24 if (creature_ptr->tim_levitation && !do_dec) {
25 if (creature_ptr->tim_levitation > v)
27 } else if (!creature_ptr->tim_levitation) {
28 msg_print(_("体が宙に浮き始めた。", "You begin to fly!"));
32 if (creature_ptr->tim_levitation) {
33 msg_print(_("もう宙に浮かべなくなった。", "You stop flying."));
38 creature_ptr->tim_levitation = v;
39 creature_ptr->redraw |= (PR_STATUS);
45 disturb(creature_ptr, FALSE, FALSE);
46 creature_ptr->update |= (PU_BONUS);
47 handle_stuff(creature_ptr);
51 bool set_ultimate_res(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
54 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
56 if (creature_ptr->is_dead)
60 if (creature_ptr->ult_res && !do_dec) {
61 if (creature_ptr->ult_res > v)
63 } else if (!creature_ptr->ult_res) {
64 msg_print(_("あらゆることに対して耐性がついた気がする!", "You feel resistant!"));
70 if (creature_ptr->ult_res) {
71 msg_print(_("あらゆることに対する耐性が薄れた気がする。", "You feel less resistant"));
76 creature_ptr->ult_res = v;
77 creature_ptr->redraw |= (PR_STATUS);
83 disturb(creature_ptr, FALSE, FALSE);
84 creature_ptr->update |= (PU_BONUS);
85 handle_stuff(creature_ptr);
90 bool set_tim_res_nether(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
93 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
95 if (creature_ptr->is_dead)
99 if (creature_ptr->tim_res_nether && !do_dec) {
100 if (creature_ptr->tim_res_nether > v)
102 } else if (!creature_ptr->tim_res_nether) {
103 msg_print(_("地獄の力に対して耐性がついた気がする!", "You feel nether resistant!"));
109 if (creature_ptr->tim_res_nether) {
110 msg_print(_("地獄の力に対する耐性が薄れた気がする。", "You feel less nether resistant"));
115 creature_ptr->tim_res_nether = v;
116 creature_ptr->redraw |= (PR_STATUS);
122 disturb(creature_ptr, FALSE, FALSE);
123 creature_ptr->update |= (PU_BONUS);
124 handle_stuff(creature_ptr);
128 bool set_tim_res_time(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
131 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
132 if (creature_ptr->is_dead)
136 if (creature_ptr->tim_res_time && !do_dec) {
137 if (creature_ptr->tim_res_time > v)
139 } else if (!creature_ptr->tim_res_time) {
140 msg_print(_("時間逆転の力に対して耐性がついた気がする!", "You feel time resistant!"));
144 if (creature_ptr->tim_res_time) {
145 msg_print(_("時間逆転の力に対する耐性が薄れた気がする。", "You feel less time resistant"));
150 creature_ptr->tim_res_time = v;
151 creature_ptr->redraw |= (PR_STATUS);
156 disturb(creature_ptr, FALSE, FALSE);
157 creature_ptr->update |= (PU_BONUS);
158 handle_stuff(creature_ptr);