• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisiona4d29a4b9286b18c7d5a466626ade2033380aebb (tree)
Time2019-06-24 22:51:09
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -1929,7 +1929,7 @@ static void process_world_aux_timeout(void)
19291929 /* Timed reflect */
19301930 if (p_ptr->tim_reflect)
19311931 {
1932- (void)set_tim_reflect(p_ptr->tim_reflect - 1, TRUE);
1932+ (void)set_tim_reflect(p_ptr, p_ptr->tim_reflect - 1, TRUE);
19331933 }
19341934
19351935 /* Multi-shadow */
--- a/src/mind.c
+++ b/src/mind.c
@@ -1404,7 +1404,7 @@ static bool cast_mirror_spell(int spell)
14041404 case 12:
14051405 t = 20 + randint1(20);
14061406 set_shield(p_ptr, t, FALSE);
1407- if (plev > 31)set_tim_reflect(t, FALSE);
1407+ if (plev > 31)set_tim_reflect(p_ptr, t, FALSE);
14081408 if (plev > 39)set_resist_magic(p_ptr, t, FALSE);
14091409 break;
14101410 /* super ray */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -305,7 +305,7 @@ void dispel_player(void)
305305 (void)set_tim_res_nether(0, TRUE);
306306 (void)set_tim_res_time(0, TRUE);
307307 /* by henkma */
308- (void)set_tim_reflect(0,TRUE);
308+ (void)set_tim_reflect(p_ptr, 0,TRUE);
309309 (void)set_multishadow(0,TRUE);
310310 (void)set_dustrobe(0,TRUE);
311311
@@ -2038,21 +2038,21 @@ bool set_resist_magic(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
20382038 * @param do_dec 現在の継続時間より長い値のみ上書きする
20392039 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
20402040 */
2041-bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
2041+bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
20422042 {
20432043 bool notice = FALSE;
20442044 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
20452045
2046- if (p_ptr->is_dead) return FALSE;
2046+ if (creature_ptr->is_dead) return FALSE;
20472047
20482048 /* Open */
20492049 if (v)
20502050 {
2051- if (p_ptr->tim_reflect && !do_dec)
2051+ if (creature_ptr->tim_reflect && !do_dec)
20522052 {
2053- if (p_ptr->tim_reflect > v) return FALSE;
2053+ if (creature_ptr->tim_reflect > v) return FALSE;
20542054 }
2055- else if (!p_ptr->tim_reflect)
2055+ else if (!creature_ptr->tim_reflect)
20562056 {
20572057 msg_print(_("体の表面が滑かになった気がする。", "Your body becames smooth."));
20582058 notice = TRUE;
@@ -2062,7 +2062,7 @@ bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
20622062 /* Shut */
20632063 else
20642064 {
2065- if (p_ptr->tim_reflect)
2065+ if (creature_ptr->tim_reflect)
20662066 {
20672067 msg_print(_("体の表面が滑かでなくなった。", "Your body is no longer smooth."));
20682068 notice = TRUE;
@@ -2070,14 +2070,14 @@ bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
20702070 }
20712071
20722072 /* Use the value */
2073- p_ptr->tim_reflect = v;
2074- p_ptr->redraw |= (PR_STATUS);
2073+ creature_ptr->tim_reflect = v;
2074+ creature_ptr->redraw |= (PR_STATUS);
20752075
20762076 /* Nothing to notice */
20772077 if (!notice) return (FALSE);
20782078
20792079 if (disturb_state) disturb(FALSE, FALSE);
2080- p_ptr->update |= (PU_BONUS);
2080+ creature_ptr->update |= (PU_BONUS);
20812081 handle_stuff();
20822082 return (TRUE);
20832083 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -42,7 +42,7 @@ extern bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_de
4242 extern bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4343 extern bool set_tim_eyeeye(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4444 extern bool set_resist_magic(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
45-extern bool set_tim_reflect(TIME_EFFECT v, bool do_dec);
45+extern bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4646 extern bool set_multishadow(TIME_EFFECT v, bool do_dec);
4747 extern bool set_dustrobe(TIME_EFFECT v, bool do_dec);
4848 extern bool set_kabenuke(TIME_EFFECT v, bool do_dec);
Show on old repository browser