OSDN Git Service

[Refactor] #38997 set_tim_eyeeye() に player_type * 引数を追加.
[hengband/hengband.git] / src / player-effects.c
index 3665315..070b899 100644 (file)
@@ -290,16 +290,16 @@ void reset_tim_flags(void)
  */
 void dispel_player(void)
 {
-       (void)set_fast(0, TRUE);
-       (void)set_lightspeed(0, TRUE);
-       (void)set_slow(0, TRUE);
-       (void)set_shield(0, TRUE);
-       (void)set_blessed(0, TRUE);
+       (void)set_fast(p_ptr, 0, TRUE);
+       (void)set_lightspeed(p_ptr, 0, TRUE);
+       (void)set_slow(p_ptr, 0, TRUE);
+       (void)set_shield(p_ptr, 0, TRUE);
+       (void)set_blessed(p_ptr, 0, TRUE);
        (void)set_tsuyoshi(0, TRUE);
-       (void)set_hero(0, TRUE);
-       (void)set_shero(0, TRUE);
-       (void)set_protevil(0, TRUE);
-       (void)set_invuln(0, TRUE);
+       (void)set_hero(p_ptr, 0, TRUE);
+       (void)set_shero(p_ptr, 0, TRUE);
+       (void)set_protevil(p_ptr, 0, TRUE);
+       (void)set_invuln(p_ptr, 0, TRUE);
        (void)set_wraith_form(0, TRUE);
        (void)set_kabenuke(0, TRUE);
        (void)set_tim_res_nether(0, TRUE);
@@ -309,17 +309,17 @@ void dispel_player(void)
        (void)set_multishadow(0,TRUE);
        (void)set_dustrobe(0,TRUE);
 
-       (void)set_tim_invis(0, TRUE);
-       (void)set_tim_infra(0, TRUE);
+       (void)set_tim_invis(p_ptr, 0, TRUE);
+       (void)set_tim_infra(p_ptr, 0, TRUE);
        (void)set_tim_esp(0, TRUE);
-       (void)set_tim_regen(0, TRUE);
-       (void)set_tim_stealth(0, TRUE);
-       (void)set_tim_levitation(0, TRUE);
-       (void)set_tim_sh_touki(0, TRUE);
-       (void)set_tim_sh_fire(0, TRUE);
-       (void)set_tim_sh_holy(0, TRUE);
-       (void)set_tim_eyeeye(0, TRUE);
-       (void)set_magicdef(0, TRUE);
+       (void)set_tim_regen(p_ptr, 0, TRUE);
+       (void)set_tim_stealth(p_ptr, 0, TRUE);
+       (void)set_tim_levitation(p_ptr, 0, TRUE);
+       (void)set_tim_sh_touki(p_ptr, 0, TRUE);
+       (void)set_tim_sh_fire(p_ptr, 0, TRUE);
+       (void)set_tim_sh_holy(p_ptr, 0, TRUE);
+       (void)set_tim_eyeeye(p_ptr, 0, TRUE);
+       (void)set_magicdef(p_ptr, 0, TRUE);
        (void)set_resist_magic(0, TRUE);
        (void)set_oppose_acid(0, TRUE);
        (void)set_oppose_elec(0, TRUE);
@@ -781,21 +781,21 @@ bool set_image(player_type *creature_ptr, TIME_EFFECT v)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_fast(TIME_EFFECT v, bool do_dec)
+bool set_fast(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->fast && !do_dec)
+               if (creature_ptr->fast && !do_dec)
                {
-                       if (p_ptr->fast > v) return FALSE;
+                       if (creature_ptr->fast > v) return FALSE;
                }
-               else if (!IS_FAST() && !p_ptr->lightspeed)
+               else if (!IS_FAST() && !creature_ptr->lightspeed)
                {
                        msg_print(_("素早く動けるようになった!", "You feel yourself moving much faster!"));
                        notice = TRUE;
@@ -807,7 +807,7 @@ bool set_fast(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->fast && !p_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
+               if (creature_ptr->fast && !creature_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
                {
                        msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
                        notice = TRUE;
@@ -815,13 +815,13 @@ bool set_fast(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->fast = v;
+       creature_ptr->fast = v;
 
        /* 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);
 }
@@ -832,23 +832,23 @@ bool set_fast(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_lightspeed(TIME_EFFECT v, bool do_dec)
+bool set_lightspeed(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;
 
-       if (p_ptr->wild_mode) v = 0;
+       if (creature_ptr->wild_mode) v = 0;
 
        /* Open */
        if (v)
        {
-               if (p_ptr->lightspeed && !do_dec)
+               if (creature_ptr->lightspeed && !do_dec)
                {
-                       if (p_ptr->lightspeed > v) return FALSE;
+                       if (creature_ptr->lightspeed > v) return FALSE;
                }
-               else if (!p_ptr->lightspeed)
+               else if (!creature_ptr->lightspeed)
                {
                        msg_print(_("非常に素早く動けるようになった!", "You feel yourself moving extremely faster!"));
                        notice = TRUE;
@@ -860,7 +860,7 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->lightspeed)
+               if (creature_ptr->lightspeed)
                {
                        msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
                        notice = TRUE;
@@ -868,13 +868,13 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->lightspeed = v;
+       creature_ptr->lightspeed = v;
 
        /* 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);
 }
@@ -885,21 +885,21 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_slow(TIME_EFFECT v, bool do_dec)
+bool set_slow(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->slow && !do_dec)
+               if (creature_ptr->slow && !do_dec)
                {
-                       if (p_ptr->slow > v) return FALSE;
+                       if (creature_ptr->slow > v) return FALSE;
                }
-               else if (!p_ptr->slow)
+               else if (!creature_ptr->slow)
                {
                        msg_print(_("体の動きが遅くなってしまった!", "You feel yourself moving slower!"));
                        notice = TRUE;
@@ -909,7 +909,7 @@ bool set_slow(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->slow)
+               if (creature_ptr->slow)
                {
                        msg_print(_("動きの遅さがなくなったようだ。", "You feel yourself speed up."));
                        notice = TRUE;
@@ -917,13 +917,13 @@ bool set_slow(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->slow = v;
+       creature_ptr->slow = v;
 
        /* 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);
 }
@@ -935,21 +935,21 @@ bool set_slow(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_shield(TIME_EFFECT v, bool do_dec)
+bool set_shield(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->shield && !do_dec)
+               if (creature_ptr->shield && !do_dec)
                {
-                       if (p_ptr->shield > v) return FALSE;
+                       if (creature_ptr->shield > v) return FALSE;
                }
-               else if (!p_ptr->shield)
+               else if (!creature_ptr->shield)
                {
                        msg_print(_("肌が石になった。", "Your skin turns to stone."));
                        notice = TRUE;
@@ -959,7 +959,7 @@ bool set_shield(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->shield)
+               if (creature_ptr->shield)
                {
                        msg_print(_("肌が元に戻った。", "Your skin returns to normal."));
                        notice = TRUE;
@@ -967,14 +967,14 @@ bool set_shield(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->shield = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->shield = 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);
 }
@@ -986,21 +986,21 @@ bool set_shield(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tsubureru(TIME_EFFECT v, bool do_dec)
+bool set_tsubureru(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->tsubureru && !do_dec)
+               if (creature_ptr->tsubureru && !do_dec)
                {
-                       if (p_ptr->tsubureru > v) return FALSE;
+                       if (creature_ptr->tsubureru > v) return FALSE;
                }
-               else if (!p_ptr->tsubureru)
+               else if (!creature_ptr->tsubureru)
                {
                        msg_print(_("横に伸びた。", "Your body expands horizontally."));
                        notice = TRUE;
@@ -1010,7 +1010,7 @@ bool set_tsubureru(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->tsubureru)
+               if (creature_ptr->tsubureru)
                {
                        msg_print(_("もう横に伸びていない。", "Your body returns to normal."));
                        notice = TRUE;
@@ -1018,14 +1018,14 @@ bool set_tsubureru(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->tsubureru = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->tsubureru = 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);
 }
@@ -1037,21 +1037,21 @@ bool set_tsubureru(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_magicdef(TIME_EFFECT v, bool do_dec)
+bool set_magicdef(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->magicdef && !do_dec)
+               if (creature_ptr->magicdef && !do_dec)
                {
-                       if (p_ptr->magicdef > v) return FALSE;
+                       if (creature_ptr->magicdef > v) return FALSE;
                }
-               else if (!p_ptr->magicdef)
+               else if (!creature_ptr->magicdef)
                {
                        msg_print(_("魔法の防御力が増したような気がする。", "You feel more resistant to magic."));
                        notice = TRUE;
@@ -1061,7 +1061,7 @@ bool set_magicdef(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->magicdef)
+               if (creature_ptr->magicdef)
                {
                        msg_print(_("魔法の防御力が元に戻った。", "You feel less resistant to magic."));
                        notice = TRUE;
@@ -1069,14 +1069,14 @@ bool set_magicdef(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->magicdef = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->magicdef = 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);
 }
@@ -1087,19 +1087,19 @@ bool set_magicdef(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_blessed(TIME_EFFECT v, bool do_dec)
+bool set_blessed(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->blessed && !do_dec)
+               if (creature_ptr->blessed && !do_dec)
                {
-                       if (p_ptr->blessed > v) return FALSE;
+                       if (creature_ptr->blessed > v) return FALSE;
                }
                else if (!IS_BLESSED())
                {
@@ -1111,7 +1111,7 @@ bool set_blessed(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->blessed && !music_singing(MUSIC_BLESS))
+               if (creature_ptr->blessed && !music_singing(MUSIC_BLESS))
                {
                        msg_print(_("高潔な気分が消え失せた。", "The prayer has expired."));
                        notice = TRUE;
@@ -1119,14 +1119,14 @@ bool set_blessed(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->blessed = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->blessed = 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);
 }
@@ -1138,19 +1138,19 @@ bool set_blessed(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_hero(TIME_EFFECT v, bool do_dec)
+bool set_hero(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->hero && !do_dec)
+               if (creature_ptr->hero && !do_dec)
                {
-                       if (p_ptr->hero > v) return FALSE;
+                       if (creature_ptr->hero > v) return FALSE;
                }
                else if (!IS_HERO())
                {
@@ -1162,7 +1162,7 @@ bool set_hero(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->hero && !music_singing(MUSIC_HERO) && !music_singing(MUSIC_SHERO))
+               if (creature_ptr->hero && !music_singing(MUSIC_HERO) && !music_singing(MUSIC_SHERO))
                {
                        msg_print(_("ヒーローの気分が消え失せた。", "The heroism wears off."));
                        notice = TRUE;
@@ -1170,17 +1170,17 @@ bool set_hero(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->hero = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->hero = 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);
 
        /* Recalculate hitpoints */
-       p_ptr->update |= (PU_HP);
+       creature_ptr->update |= (PU_HP);
        handle_stuff();
        return (TRUE);
 }
@@ -1191,22 +1191,22 @@ bool set_hero(TIME_EFFECT v, bool do_dec)
  * @param do_dec FALSEの場合現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_shero(TIME_EFFECT v, bool do_dec)
+bool set_shero(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;
 
-       if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
+       if (creature_ptr->pclass == CLASS_BERSERKER) v = 1;
        /* Open */
        if (v)
        {
-               if (p_ptr->shero && !do_dec)
+               if (creature_ptr->shero && !do_dec)
                {
-                       if (p_ptr->shero > v) return FALSE;
+                       if (creature_ptr->shero > v) return FALSE;
                }
-               else if (!p_ptr->shero)
+               else if (!creature_ptr->shero)
                {
                        msg_print(_("殺戮マシーンになった気がする!", "You feel like a killing machine!"));
                        notice = TRUE;
@@ -1216,7 +1216,7 @@ bool set_shero(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->shero)
+               if (creature_ptr->shero)
                {
                        msg_print(_("野蛮な気持ちが消え失せた。", "You feel less Berserk."));
                        notice = TRUE;
@@ -1224,17 +1224,17 @@ bool set_shero(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->shero = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->shero = 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);
 
        /* Recalculate hitpoints */
-       p_ptr->update |= (PU_HP);
+       creature_ptr->update |= (PU_HP);
        handle_stuff();
        return (TRUE);
 }
@@ -1245,21 +1245,21 @@ bool set_shero(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_protevil(TIME_EFFECT v, bool do_dec)
+bool set_protevil(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->protevil && !do_dec)
+               if (creature_ptr->protevil && !do_dec)
                {
-                       if (p_ptr->protevil > v) return FALSE;
+                       if (creature_ptr->protevil > v) return FALSE;
                }
-               else if (!p_ptr->protevil)
+               else if (!creature_ptr->protevil)
                {
                        msg_print(_("邪悪なる存在から守られているような感じがする!", "You feel safe from evil!"));
                        notice = TRUE;
@@ -1269,7 +1269,7 @@ bool set_protevil(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->protevil)
+               if (creature_ptr->protevil)
                {
                        msg_print(_("邪悪なる存在から守られている感じがなくなった。", "You no longer feel safe from evil."));
                        notice = TRUE;
@@ -1277,8 +1277,8 @@ bool set_protevil(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->protevil = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->protevil = v;
+       creature_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
@@ -1359,19 +1359,19 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_invuln(TIME_EFFECT v, bool do_dec)
+bool set_invuln(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->invuln && !do_dec)
+               if (creature_ptr->invuln && !do_dec)
                {
-                       if (p_ptr->invuln > v) return FALSE;
+                       if (creature_ptr->invuln > v) return FALSE;
                }
                else if (!IS_INVULN())
                {
@@ -1383,39 +1383,39 @@ bool set_invuln(TIME_EFFECT v, bool do_dec)
                        chg_virtue(V_SACRIFICE, -3);
                        chg_virtue(V_VALOUR, -5);
 
-                       p_ptr->redraw |= (PR_MAP);
-                       p_ptr->update |= (PU_MONSTERS);
+                       creature_ptr->redraw |= (PR_MAP);
+                       creature_ptr->update |= (PU_MONSTERS);
 
-                       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+                       creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
 
        /* Shut */
        else
        {
-               if (p_ptr->invuln && !music_singing(MUSIC_INVULN))
+               if (creature_ptr->invuln && !music_singing(MUSIC_INVULN))
                {
                        msg_print(_("無敵ではなくなった。", "The invulnerability wears off."));
                        notice = TRUE;
 
-                       p_ptr->redraw |= (PR_MAP);
-                       p_ptr->update |= (PU_MONSTERS);
+                       creature_ptr->redraw |= (PR_MAP);
+                       creature_ptr->update |= (PU_MONSTERS);
 
-                       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+                       creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
-                       p_ptr->energy_need += ENERGY_NEED();
+                       creature_ptr->energy_need += ENERGY_NEED();
                }
        }
 
        /* Use the value */
-       p_ptr->invuln = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->invuln = 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);
 }
@@ -1477,21 +1477,21 @@ bool set_tim_esp(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_invis(TIME_EFFECT v, bool do_dec)
+bool set_tim_invis(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_invis && !do_dec)
+               if (creature_ptr->tim_invis && !do_dec)
                {
-                       if (p_ptr->tim_invis > v) return FALSE;
+                       if (creature_ptr->tim_invis > v) return FALSE;
                }
-               else if (!p_ptr->tim_invis)
+               else if (!creature_ptr->tim_invis)
                {
                        msg_print(_("目が非常に敏感になった気がする!", "Your eyes feel very sensitive!"));
                        notice = TRUE;
@@ -1501,7 +1501,7 @@ bool set_tim_invis(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->tim_invis)
+               if (creature_ptr->tim_invis)
                {
                        msg_print(_("目の敏感さがなくなったようだ。", "Your eyes feel less sensitive."));
                        notice = TRUE;
@@ -1509,17 +1509,17 @@ bool set_tim_invis(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->tim_invis = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->tim_invis = 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);
 
        /* Update the monsters */
-       p_ptr->update |= (PU_MONSTERS);
+       creature_ptr->update |= (PU_MONSTERS);
        handle_stuff();
        return (TRUE);
 }
@@ -1530,21 +1530,21 @@ bool set_tim_invis(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_infra(TIME_EFFECT v, bool do_dec)
+bool set_tim_infra(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_infra && !do_dec)
+               if (creature_ptr->tim_infra && !do_dec)
                {
-                       if (p_ptr->tim_infra > v) return FALSE;
+                       if (creature_ptr->tim_infra > v) return FALSE;
                }
-               else if (!p_ptr->tim_infra)
+               else if (!creature_ptr->tim_infra)
                {
                        msg_print(_("目がランランと輝き始めた!", "Your eyes begin to tingle!"));
                        notice = TRUE;
@@ -1554,7 +1554,7 @@ bool set_tim_infra(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->tim_infra)
+               if (creature_ptr->tim_infra)
                {
                        msg_print(_("目の輝きがなくなった。", "Your eyes stop tingling."));
                        notice = TRUE;
@@ -1562,17 +1562,17 @@ bool set_tim_infra(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->tim_infra = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->tim_infra = 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);
 
        /* Update the monsters */
-       p_ptr->update |= (PU_MONSTERS);
+       creature_ptr->update |= (PU_MONSTERS);
        handle_stuff();
        return (TRUE);
 }
@@ -1583,21 +1583,21 @@ bool set_tim_infra(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_regen(TIME_EFFECT v, bool do_dec)
+bool set_tim_regen(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_regen && !do_dec)
+               if (creature_ptr->tim_regen && !do_dec)
                {
-                       if (p_ptr->tim_regen > v) return FALSE;
+                       if (creature_ptr->tim_regen > v) return FALSE;
                }
-               else if (!p_ptr->tim_regen)
+               else if (!creature_ptr->tim_regen)
                {
                        msg_print(_("回復力が上がった!", "You feel yourself regenerating quickly!"));
                        notice = TRUE;
@@ -1607,7 +1607,7 @@ bool set_tim_regen(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->tim_regen)
+               if (creature_ptr->tim_regen)
                {
                        msg_print(_("素早く回復する感じがなくなった。", "You feel yourself regenerating slowly."));
                        notice = TRUE;
@@ -1615,14 +1615,14 @@ bool set_tim_regen(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->tim_regen = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->tim_regen = 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);
 }
@@ -1633,19 +1633,19 @@ bool set_tim_regen(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
+bool set_tim_stealth(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_stealth && !do_dec)
+               if (creature_ptr->tim_stealth && !do_dec)
                {
-                       if (p_ptr->tim_stealth > v) return FALSE;
+                       if (creature_ptr->tim_stealth > v) return FALSE;
                }
                else if (!IS_TIM_STEALTH())
                {
@@ -1657,7 +1657,7 @@ bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
+               if (creature_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
                {
                        msg_print(_("足音が大きくなった。", "You no longer walk silently."));
                        notice = TRUE;
@@ -1665,14 +1665,14 @@ bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->tim_stealth = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->tim_stealth = 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);
 }
@@ -1738,21 +1738,21 @@ bool set_superstealth(bool set)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
+bool set_tim_levitation(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_levitation && !do_dec)
+               if (creature_ptr->tim_levitation && !do_dec)
                {
-                       if (p_ptr->tim_levitation > v) return FALSE;
+                       if (creature_ptr->tim_levitation > v) return FALSE;
                }
-               else if (!p_ptr->tim_levitation)
+               else if (!creature_ptr->tim_levitation)
                {
                        msg_print(_("体が宙に浮き始めた。", "You begin to fly!"));
                        notice = TRUE;
@@ -1762,7 +1762,7 @@ bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->tim_levitation)
+               if (creature_ptr->tim_levitation)
                {
                        msg_print(_("もう宙に浮かべなくなった。", "You stop flying."));
                        notice = TRUE;
@@ -1770,14 +1770,14 @@ bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->tim_levitation = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->tim_levitation = 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);
 }
@@ -1788,21 +1788,21 @@ bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
+bool set_tim_sh_touki(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_sh_touki && !do_dec)
+               if (creature_ptr->tim_sh_touki && !do_dec)
                {
-                       if (p_ptr->tim_sh_touki > v) return FALSE;
+                       if (creature_ptr->tim_sh_touki > v) return FALSE;
                }
-               else if (!p_ptr->tim_sh_touki)
+               else if (!creature_ptr->tim_sh_touki)
                {
                        msg_print(_("体が闘気のオーラで覆われた。", "You have enveloped by the aura of the Force!"));
                        notice = TRUE;
@@ -1812,7 +1812,7 @@ bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->tim_sh_touki)
+               if (creature_ptr->tim_sh_touki)
                {
                        msg_print(_("闘気が消えた。", "Aura of the Force disappeared."));
                        notice = TRUE;
@@ -1820,8 +1820,8 @@ bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->tim_sh_touki = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->tim_sh_touki = v;
+       creature_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
@@ -1837,21 +1837,21 @@ bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
+bool set_tim_sh_fire(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_sh_fire && !do_dec)
+               if (creature_ptr->tim_sh_fire && !do_dec)
                {
-                       if (p_ptr->tim_sh_fire > v) return FALSE;
+                       if (creature_ptr->tim_sh_fire > v) return FALSE;
                }
-               else if (!p_ptr->tim_sh_fire)
+               else if (!creature_ptr->tim_sh_fire)
                {
                        msg_print(_("体が炎のオーラで覆われた。", "You have enveloped by fiery aura!"));
                        notice = TRUE;
@@ -1861,7 +1861,7 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->tim_sh_fire)
+               if (creature_ptr->tim_sh_fire)
                {
                        msg_print(_("炎のオーラが消えた。", "Fiery aura disappeared."));
                        notice = TRUE;
@@ -1869,14 +1869,14 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->tim_sh_fire = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->tim_sh_fire = 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);
 }
@@ -1887,21 +1887,21 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
+bool set_tim_sh_holy(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_sh_holy && !do_dec)
+               if (creature_ptr->tim_sh_holy && !do_dec)
                {
-                       if (p_ptr->tim_sh_holy > v) return FALSE;
+                       if (creature_ptr->tim_sh_holy > v) return FALSE;
                }
-               else if (!p_ptr->tim_sh_holy)
+               else if (!creature_ptr->tim_sh_holy)
                {
                        msg_print(_("体が聖なるオーラで覆われた。", "You have enveloped by holy aura!"));
                        notice = TRUE;
@@ -1911,7 +1911,7 @@ bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->tim_sh_holy)
+               if (creature_ptr->tim_sh_holy)
                {
                        msg_print(_("聖なるオーラが消えた。", "Holy aura disappeared."));
                        notice = TRUE;
@@ -1919,14 +1919,14 @@ bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->tim_sh_holy = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->tim_sh_holy = 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);
 }
@@ -1937,21 +1937,21 @@ bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec)
+bool set_tim_eyeeye(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_eyeeye && !do_dec)
+               if (creature_ptr->tim_eyeeye && !do_dec)
                {
-                       if (p_ptr->tim_eyeeye > v) return FALSE;
+                       if (creature_ptr->tim_eyeeye > v) return FALSE;
                }
-               else if (!p_ptr->tim_eyeeye)
+               else if (!creature_ptr->tim_eyeeye)
                {
                        msg_print(_("法の守り手になった気がした!", "You feel like a keeper of commandments!"));
                        notice = TRUE;
@@ -1961,7 +1961,7 @@ bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->tim_eyeeye)
+               if (creature_ptr->tim_eyeeye)
                {
                        msg_print(_("懲罰を執行することができなくなった。", "You no longer feel like a keeper."));
                        notice = TRUE;
@@ -1969,14 +1969,14 @@ bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->tim_eyeeye = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->tim_eyeeye = 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);
 }