OSDN Git Service

[Refactor] #38997 set_tim_reflect() に player_type * 引数を追加.
authordeskull <deskull@users.sourceforge.jp>
Mon, 24 Jun 2019 13:51:09 +0000 (22:51 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 24 Jun 2019 13:51:09 +0000 (22:51 +0900)
src/core.c
src/mind.c
src/player-effects.c
src/player-effects.h

index 4a17d0d..c9a561d 100644 (file)
@@ -1929,7 +1929,7 @@ static void process_world_aux_timeout(void)
        /* Timed reflect */
        if (p_ptr->tim_reflect)
        {
-               (void)set_tim_reflect(p_ptr->tim_reflect - 1, TRUE);
+               (void)set_tim_reflect(p_ptr, p_ptr->tim_reflect - 1, TRUE);
        }
 
        /* Multi-shadow */
index a2e0dab..f671376 100644 (file)
@@ -1404,7 +1404,7 @@ static bool cast_mirror_spell(int spell)
        case 12:
                t = 20 + randint1(20);
                set_shield(p_ptr, t, FALSE);
-               if (plev > 31)set_tim_reflect(t, FALSE);
+               if (plev > 31)set_tim_reflect(p_ptr, t, FALSE);
                if (plev > 39)set_resist_magic(p_ptr, t, FALSE);
                break;
                /* super ray */
index 86c5ddb..5569859 100644 (file)
@@ -305,7 +305,7 @@ void dispel_player(void)
        (void)set_tim_res_nether(0, TRUE);
        (void)set_tim_res_time(0, TRUE);
        /* by henkma */
-       (void)set_tim_reflect(0,TRUE);
+       (void)set_tim_reflect(p_ptr, 0,TRUE);
        (void)set_multishadow(0,TRUE);
        (void)set_dustrobe(0,TRUE);
 
@@ -2038,21 +2038,21 @@ bool set_resist_magic(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
+bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (p_ptr->is_dead) return FALSE;
+       if (creature_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
        {
-               if (p_ptr->tim_reflect && !do_dec)
+               if (creature_ptr->tim_reflect && !do_dec)
                {
-                       if (p_ptr->tim_reflect > v) return FALSE;
+                       if (creature_ptr->tim_reflect > v) return FALSE;
                }
-               else if (!p_ptr->tim_reflect)
+               else if (!creature_ptr->tim_reflect)
                {
                        msg_print(_("体の表面が滑かになった気がする。", "Your body becames smooth."));
                        notice = TRUE;
@@ -2062,7 +2062,7 @@ bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->tim_reflect)
+               if (creature_ptr->tim_reflect)
                {
                        msg_print(_("体の表面が滑かでなくなった。", "Your body is no longer smooth."));
                        notice = TRUE;
@@ -2070,14 +2070,14 @@ bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->tim_reflect = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->tim_reflect = v;
+       creature_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-       p_ptr->update |= (PU_BONUS);
+       creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
index b88508d..e8dab66 100644 (file)
@@ -42,7 +42,7 @@ extern bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_de
 extern bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 extern bool set_tim_eyeeye(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 extern bool set_resist_magic(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
-extern bool set_tim_reflect(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 extern bool set_multishadow(TIME_EFFECT v, bool do_dec);
 extern bool set_dustrobe(TIME_EFFECT v, bool do_dec);
 extern bool set_kabenuke(TIME_EFFECT v, bool do_dec);