OSDN Git Service

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

index c9a561d..6250ed7 100644 (file)
@@ -1935,7 +1935,7 @@ static void process_world_aux_timeout(void)
        /* Multi-shadow */
        if (p_ptr->multishadow)
        {
-               (void)set_multishadow(p_ptr->multishadow - 1, TRUE);
+               (void)set_multishadow(p_ptr, p_ptr->multishadow - 1, TRUE);
        }
 
        /* Timed Robe of dust */
index f671376..80726bd 100644 (file)
@@ -1440,7 +1440,7 @@ static bool cast_mirror_spell(int spell)
                return recall_player(p_ptr, randint0(21) + 15);
                /* multi-shadow */
        case 18:
-               set_multishadow(6 + randint1(6), FALSE);
+               set_multishadow(p_ptr, 6 + randint1(6), FALSE);
                break;
                /* binding field */
        case 19:
@@ -1749,7 +1749,7 @@ static bool cast_ninja_spell(int spell)
                break;
        }
        case 19:
-               set_multishadow(6+randint1(6), FALSE);
+               set_multishadow(p_ptr, 6+randint1(6), FALSE);
                break;
        default:
                msg_print(_("なに?", "Zap?"));
index 5569859..5c0d6f6 100644 (file)
@@ -306,7 +306,7 @@ void dispel_player(void)
        (void)set_tim_res_time(0, TRUE);
        /* by henkma */
        (void)set_tim_reflect(p_ptr, 0,TRUE);
-       (void)set_multishadow(0,TRUE);
+       (void)set_multishadow(p_ptr, 0,TRUE);
        (void)set_dustrobe(0,TRUE);
 
        (void)set_tim_invis(p_ptr, 0, TRUE);
@@ -2086,21 +2086,21 @@ bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 /*
  * Set "p_ptr->multishadow", notice observable changes
  */
-bool set_multishadow(TIME_EFFECT v, bool do_dec)
+bool set_multishadow(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->multishadow && !do_dec)
+               if (creature_ptr->multishadow && !do_dec)
                {
-                       if (p_ptr->multishadow > v) return FALSE;
+                       if (creature_ptr->multishadow > v) return FALSE;
                }
-               else if (!p_ptr->multishadow)
+               else if (!creature_ptr->multishadow)
                {
                        msg_print(_("あなたの周りに幻影が生まれた。", "Your Shadow enveloped you."));
                        notice = TRUE;
@@ -2110,7 +2110,7 @@ bool set_multishadow(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->multishadow)
+               if (creature_ptr->multishadow)
                {
                        msg_print(_("幻影が消えた。", "Your Shadow disappears."));
                        notice = TRUE;
@@ -2118,14 +2118,14 @@ bool set_multishadow(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->multishadow = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->multishadow = 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 e8dab66..80f981c 100644 (file)
@@ -43,7 +43,7 @@ extern bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_de
 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(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
-extern bool set_multishadow(TIME_EFFECT v, bool do_dec);
+extern bool set_multishadow(player_type *creature_ptr, 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);
 extern bool set_tsuyoshi(TIME_EFFECT v, bool do_dec);