• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisiond87585cc9f09f06c7995a6f585bc8cda9746764f (tree)
Time2019-06-27 23:53:46
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 set_tim_res_time() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -1923,7 +1923,7 @@ static void process_world_aux_timeout(void)
19231923 /* Timed resist time */
19241924 if (p_ptr->tim_res_time)
19251925 {
1926- (void)set_tim_res_time(p_ptr->tim_res_time - 1, TRUE);
1926+ (void)set_tim_res_time(p_ptr, p_ptr->tim_res_time - 1, TRUE);
19271927 }
19281928
19291929 /* Timed reflect */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -303,7 +303,7 @@ void dispel_player(void)
303303 (void)set_wraith_form(p_ptr, 0, TRUE);
304304 (void)set_kabenuke(p_ptr, 0, TRUE);
305305 (void)set_tim_res_nether(0, TRUE);
306- (void)set_tim_res_time(0, TRUE);
306+ (void)set_tim_res_time(p_ptr, 0, TRUE);
307307 /* by henkma */
308308 (void)set_tim_reflect(p_ptr, 0,TRUE);
309309 (void)set_multishadow(p_ptr, 0,TRUE);
@@ -4169,21 +4169,21 @@ bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
41694169 return (TRUE);
41704170 }
41714171
4172-bool set_tim_res_time(TIME_EFFECT v, bool do_dec)
4172+bool set_tim_res_time(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
41734173 {
41744174 bool notice = FALSE;
41754175 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
41764176
4177- if (p_ptr->is_dead) return FALSE;
4177+ if (creature_ptr->is_dead) return FALSE;
41784178
41794179 /* Open */
41804180 if (v)
41814181 {
4182- if (p_ptr->tim_res_time && !do_dec)
4182+ if (creature_ptr->tim_res_time && !do_dec)
41834183 {
4184- if (p_ptr->tim_res_time > v) return FALSE;
4184+ if (creature_ptr->tim_res_time > v) return FALSE;
41854185 }
4186- else if (!p_ptr->tim_res_time)
4186+ else if (!creature_ptr->tim_res_time)
41874187 {
41884188 msg_print(_("時間逆転の力に対して耐性がついた気がする!", "You feel time resistant!"));
41894189 notice = TRUE;
@@ -4193,7 +4193,7 @@ bool set_tim_res_time(TIME_EFFECT v, bool do_dec)
41934193 /* Shut */
41944194 else
41954195 {
4196- if (p_ptr->tim_res_time)
4196+ if (creature_ptr->tim_res_time)
41974197 {
41984198 msg_print(_("時間逆転の力に対する耐性が薄れた気がする。", "You feel less time resistant"));
41994199 notice = TRUE;
@@ -4201,14 +4201,14 @@ bool set_tim_res_time(TIME_EFFECT v, bool do_dec)
42014201 }
42024202
42034203 /* Use the value */
4204- p_ptr->tim_res_time = v;
4205- p_ptr->redraw |= (PR_STATUS);
4204+ creature_ptr->tim_res_time = v;
4205+ creature_ptr->redraw |= (PR_STATUS);
42064206
42074207 /* Nothing to notice */
42084208 if (!notice) return (FALSE);
42094209
42104210 if (disturb_state) disturb(FALSE, FALSE);
4211- p_ptr->update |= (PU_BONUS);
4211+ creature_ptr->update |= (PU_BONUS);
42124212 handle_stuff();
42134213 return (TRUE);
42144214 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -74,7 +74,7 @@ extern bool drain_exp(s32b drain, s32b slip, int hold_exp_prob);
7474 extern void do_poly_self(player_type *creature_ptr);
7575 extern bool set_ultimate_res(TIME_EFFECT v, bool do_dec);
7676 extern bool set_tim_res_nether(TIME_EFFECT v, bool do_dec);
77-extern bool set_tim_res_time(TIME_EFFECT v, bool do_dec);
77+extern bool set_tim_res_time(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
7878 extern bool choose_ele_attack(player_type *creature_ptr);
7979 extern bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT turn);
8080 extern bool set_wraith_form(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
--- a/src/realm-daemon.c
+++ b/src/realm-daemon.c
@@ -483,7 +483,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
483483
484484 if (cast)
485485 {
486- set_tim_res_time(randint1(base) + base, FALSE);
486+ set_tim_res_time(p_ptr, randint1(base) + base, FALSE);
487487 }
488488 }
489489 break;
Show on old repository browser