OSDN Git Service

[Refactor] #38997 IS_FAST() に player_type * 引数を追加. / Add player_type * argument to...
[hengband/hengband.git] / src / player-effects.c
index c72aa9e..5b2e8fe 100644 (file)
@@ -99,9 +99,9 @@ const kamae kata_shurui[MAX_KATA] =
  * #ACTION_NONE / #ACTION_SEARCH / #ACTION_REST / #ACTION_LEARN / #ACTION_FISH / #ACTION_KAMAE / #ACTION_KATA / #ACTION_SING / #ACTION_HAYAGAKE / #ACTION_SPELL から選択。
  * @return なし
  */
-void set_action(ACTION_IDX typ)
+void set_action(player_type *creature_ptr, ACTION_IDX typ)
 {
-       int prev_typ = p_ptr->action;
+       int prev_typ = creature_ptr->action;
 
        if (typ == prev_typ)
        {
@@ -114,32 +114,32 @@ void set_action(ACTION_IDX typ)
                        case ACTION_SEARCH:
                        {
                                msg_print(_("探索をやめた。", "You no longer walk carefully."));
-                               p_ptr->redraw |= (PR_SPEED);
+                               creature_ptr->redraw |= (PR_SPEED);
                                break;
                        }
                        case ACTION_REST:
                        {
-                               p_ptr->resting = 0;
+                               creature_ptr->resting = 0;
                                break;
                        }
                        case ACTION_LEARN:
                        {
                                msg_print(_("学習をやめた。", "You stop Learning"));
-                               p_ptr->new_mane = FALSE;
+                               creature_ptr->new_mane = FALSE;
                                break;
                        }
                        case ACTION_KAMAE:
                        {
                                msg_print(_("構えをといた。", "You stop assuming the posture."));
-                               p_ptr->special_defense &= ~(KAMAE_MASK);
+                               creature_ptr->special_defense &= ~(KAMAE_MASK);
                                break;
                        }
                        case ACTION_KATA:
                        {
                                msg_print(_("型を崩した。", "You stop assuming the posture."));
-                               p_ptr->special_defense &= ~(KATA_MASK);
-                               p_ptr->update |= (PU_MONSTERS);
-                               p_ptr->redraw |= (PR_STATUS);
+                               creature_ptr->special_defense &= ~(KATA_MASK);
+                               creature_ptr->update |= (PU_MONSTERS);
+                               creature_ptr->redraw |= (PR_STATUS);
                                break;
                        }
                        case ACTION_SING:
@@ -150,7 +150,7 @@ void set_action(ACTION_IDX typ)
                        case ACTION_HAYAGAKE:
                        {
                                msg_print(_("足が重くなった。", "You are no longer walking extremely fast."));
-                               take_turn(p_ptr, 100);
+                               take_turn(creature_ptr, 100);
                                break;
                        }
                        case ACTION_SPELL:
@@ -161,18 +161,18 @@ void set_action(ACTION_IDX typ)
                }
        }
 
-       p_ptr->action = typ;
+       creature_ptr->action = typ;
 
        /* If we are requested other action, stop singing */
-       if (prev_typ == ACTION_SING) stop_singing(p_ptr);
-       if (prev_typ == ACTION_SPELL) stop_hex_spell();
+       if (prev_typ == ACTION_SING) stop_singing(creature_ptr);
+       if (prev_typ == ACTION_SPELL) stop_hex_spell(creature_ptr);
 
-       switch (p_ptr->action)
+       switch (creature_ptr->action)
        {
                case ACTION_SEARCH:
                {
                        msg_print(_("注意深く歩き始めた。", "You begin to walk carefully."));
-                       p_ptr->redraw |= (PR_SPEED);
+                       creature_ptr->redraw |= (PR_SPEED);
                        break;
                }
                case ACTION_LEARN:
@@ -195,92 +195,92 @@ void set_action(ACTION_IDX typ)
                        break;
                }
        }
-       p_ptr->update |= (PU_BONUS);
-       p_ptr->redraw |= (PR_STATE);
+       creature_ptr->update |= (PU_BONUS);
+       creature_ptr->redraw |= (PR_STATE);
 }
 
 /*!
  * @brief プレイヤーの全ての時限効果をリセットする。 / reset timed flags
  * @return なし
  */
-void reset_tim_flags(void)
+void reset_tim_flags(player_type *creature_ptr)
 {
-       p_ptr->fast = 0;            /* Timed -- Fast */
-       p_ptr->lightspeed = 0;
-       p_ptr->slow = 0;            /* Timed -- Slow */
-       p_ptr->blind = 0;           /* Timed -- Blindness */
-       p_ptr->paralyzed = 0;       /* Timed -- Paralysis */
-       p_ptr->confused = 0;        /* Timed -- Confusion */
-       p_ptr->afraid = 0;          /* Timed -- Fear */
-       p_ptr->image = 0;           /* Timed -- Hallucination */
-       p_ptr->poisoned = 0;        /* Timed -- Poisoned */
-       p_ptr->cut = 0;             /* Timed -- Cut */
-       p_ptr->stun = 0;            /* Timed -- Stun */
-
-       p_ptr->protevil = 0;        /* Timed -- Protection */
-       p_ptr->invuln = 0;          /* Timed -- Invulnerable */
-       p_ptr->ult_res = 0;
-       p_ptr->hero = 0;            /* Timed -- Heroism */
-       p_ptr->shero = 0;           /* Timed -- Super Heroism */
-       p_ptr->shield = 0;          /* Timed -- Shield Spell */
-       p_ptr->blessed = 0;         /* Timed -- Blessed */
-       p_ptr->tim_invis = 0;       /* Timed -- Invisibility */
-       p_ptr->tim_infra = 0;       /* Timed -- Infra Vision */
-       p_ptr->tim_regen = 0;       /* Timed -- Regeneration */
-       p_ptr->tim_stealth = 0;     /* Timed -- Stealth */
-       p_ptr->tim_esp = 0;
-       p_ptr->wraith_form = 0;     /* Timed -- Wraith Form */
-       p_ptr->tim_levitation = 0;
-       p_ptr->tim_sh_touki = 0;
-       p_ptr->tim_sh_fire = 0;
-       p_ptr->tim_sh_holy = 0;
-       p_ptr->tim_eyeeye = 0;
-       p_ptr->magicdef = 0;
-       p_ptr->resist_magic = 0;
-       p_ptr->tsuyoshi = 0;
-       p_ptr->kabenuke = 0;
-       p_ptr->tim_res_nether = 0;
-       p_ptr->tim_res_time = 0;
-       p_ptr->tim_mimic = 0;
-       p_ptr->mimic_form = 0;
-       p_ptr->tim_reflect = 0;
-       p_ptr->multishadow = 0;
-       p_ptr->dustrobe = 0;
-       p_ptr->action = ACTION_NONE;
-
-       p_ptr->oppose_acid = 0;     /* Timed -- oppose acid */
-       p_ptr->oppose_elec = 0;     /* Timed -- oppose lightning */
-       p_ptr->oppose_fire = 0;     /* Timed -- oppose heat */
-       p_ptr->oppose_cold = 0;     /* Timed -- oppose cold */
-       p_ptr->oppose_pois = 0;     /* Timed -- oppose poison */
-
-       p_ptr->word_recall = 0;
-       p_ptr->alter_reality = 0;
-       p_ptr->sutemi = FALSE;
-       p_ptr->counter = FALSE;
-       p_ptr->ele_attack = 0;
-       p_ptr->ele_immune = 0;
-       p_ptr->special_attack = 0L;
-       p_ptr->special_defense = 0L;
-
-       while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
-       p_ptr->timewalk = FALSE;
-
-       if (PRACE_IS_(p_ptr, RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
-       if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
-       if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
-
-       if (p_ptr->riding)
-       {
-               (void)set_monster_fast(p_ptr->riding, 0);
-               (void)set_monster_slow(p_ptr->riding, 0);
-               (void)set_monster_invulner(p_ptr->riding, 0, FALSE);
-       }
-
-       if (p_ptr->pclass == CLASS_BARD)
-       {
-               SINGING_SONG_EFFECT(p_ptr) = 0;
-               SINGING_SONG_ID(p_ptr) = 0;
+       creature_ptr->fast = 0;            /* Timed -- Fast */
+       creature_ptr->lightspeed = 0;
+       creature_ptr->slow = 0;            /* Timed -- Slow */
+       creature_ptr->blind = 0;           /* Timed -- Blindness */
+       creature_ptr->paralyzed = 0;       /* Timed -- Paralysis */
+       creature_ptr->confused = 0;        /* Timed -- Confusion */
+       creature_ptr->afraid = 0;          /* Timed -- Fear */
+       creature_ptr->image = 0;           /* Timed -- Hallucination */
+       creature_ptr->poisoned = 0;        /* Timed -- Poisoned */
+       creature_ptr->cut = 0;             /* Timed -- Cut */
+       creature_ptr->stun = 0;            /* Timed -- Stun */
+
+       creature_ptr->protevil = 0;        /* Timed -- Protection */
+       creature_ptr->invuln = 0;          /* Timed -- Invulnerable */
+       creature_ptr->ult_res = 0;
+       creature_ptr->hero = 0;            /* Timed -- Heroism */
+       creature_ptr->shero = 0;           /* Timed -- Super Heroism */
+       creature_ptr->shield = 0;          /* Timed -- Shield Spell */
+       creature_ptr->blessed = 0;         /* Timed -- Blessed */
+       creature_ptr->tim_invis = 0;       /* Timed -- Invisibility */
+       creature_ptr->tim_infra = 0;       /* Timed -- Infra Vision */
+       creature_ptr->tim_regen = 0;       /* Timed -- Regeneration */
+       creature_ptr->tim_stealth = 0;     /* Timed -- Stealth */
+       creature_ptr->tim_esp = 0;
+       creature_ptr->wraith_form = 0;     /* Timed -- Wraith Form */
+       creature_ptr->tim_levitation = 0;
+       creature_ptr->tim_sh_touki = 0;
+       creature_ptr->tim_sh_fire = 0;
+       creature_ptr->tim_sh_holy = 0;
+       creature_ptr->tim_eyeeye = 0;
+       creature_ptr->magicdef = 0;
+       creature_ptr->resist_magic = 0;
+       creature_ptr->tsuyoshi = 0;
+       creature_ptr->kabenuke = 0;
+       creature_ptr->tim_res_nether = 0;
+       creature_ptr->tim_res_time = 0;
+       creature_ptr->tim_mimic = 0;
+       creature_ptr->mimic_form = 0;
+       creature_ptr->tim_reflect = 0;
+       creature_ptr->multishadow = 0;
+       creature_ptr->dustrobe = 0;
+       creature_ptr->action = ACTION_NONE;
+
+       creature_ptr->oppose_acid = 0;     /* Timed -- oppose acid */
+       creature_ptr->oppose_elec = 0;     /* Timed -- oppose lightning */
+       creature_ptr->oppose_fire = 0;     /* Timed -- oppose heat */
+       creature_ptr->oppose_cold = 0;     /* Timed -- oppose cold */
+       creature_ptr->oppose_pois = 0;     /* Timed -- oppose poison */
+
+       creature_ptr->word_recall = 0;
+       creature_ptr->alter_reality = 0;
+       creature_ptr->sutemi = FALSE;
+       creature_ptr->counter = FALSE;
+       creature_ptr->ele_attack = 0;
+       creature_ptr->ele_immune = 0;
+       creature_ptr->special_attack = 0L;
+       creature_ptr->special_defense = 0L;
+
+       while(creature_ptr->energy_need < 0) creature_ptr->energy_need += ENERGY_NEED();
+       creature_ptr->timewalk = FALSE;
+
+       if (PRACE_IS_(creature_ptr, RACE_DEMON) && (creature_ptr->lev > 44)) creature_ptr->oppose_fire = 1;
+       if ((creature_ptr->pclass == CLASS_NINJA) && (creature_ptr->lev > 44)) creature_ptr->oppose_pois = 1;
+       if (creature_ptr->pclass == CLASS_BERSERKER) creature_ptr->shero = 1;
+
+       if (creature_ptr->riding)
+       {
+               (void)set_monster_fast(creature_ptr->riding, 0);
+               (void)set_monster_slow(creature_ptr->riding, 0);
+               (void)set_monster_invulner(creature_ptr->riding, 0, FALSE);
+       }
+
+       if (creature_ptr->pclass == CLASS_BARD)
+       {
+               SINGING_SONG_EFFECT(creature_ptr) = 0;
+               SINGING_SONG_ID(creature_ptr) = 0;
        }
 }
 
@@ -288,87 +288,86 @@ void reset_tim_flags(void)
  * @brief プレイヤーに魔力消去効果を与える。
  * @return なし
  */
-void dispel_player(void)
+void dispel_player(player_type *creature_ptr)
 {
-       (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(p_ptr, 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(p_ptr, 0, TRUE);
-       (void)set_kabenuke(p_ptr, 0, TRUE);
-       (void)set_tim_res_nether(p_ptr, 0, TRUE);
-       (void)set_tim_res_time(p_ptr, 0, TRUE);
+       (void)set_fast(creature_ptr, 0, TRUE);
+       (void)set_lightspeed(creature_ptr, 0, TRUE);
+       (void)set_slow(creature_ptr, 0, TRUE);
+       (void)set_shield(creature_ptr, 0, TRUE);
+       (void)set_blessed(creature_ptr, 0, TRUE);
+       (void)set_tsuyoshi(creature_ptr, 0, TRUE);
+       (void)set_hero(creature_ptr, 0, TRUE);
+       (void)set_shero(creature_ptr, 0, TRUE);
+       (void)set_protevil(creature_ptr, 0, TRUE);
+       (void)set_invuln(creature_ptr, 0, TRUE);
+       (void)set_wraith_form(creature_ptr, 0, TRUE);
+       (void)set_kabenuke(creature_ptr, 0, TRUE);
+       (void)set_tim_res_nether(creature_ptr, 0, TRUE);
+       (void)set_tim_res_time(creature_ptr, 0, TRUE);
        /* by henkma */
-       (void)set_tim_reflect(p_ptr, 0,TRUE);
-       (void)set_multishadow(p_ptr, 0,TRUE);
-       (void)set_dustrobe(p_ptr, 0,TRUE);
-
-       (void)set_tim_invis(p_ptr, 0, TRUE);
-       (void)set_tim_infra(p_ptr, 0, TRUE);
-       (void)set_tim_esp(p_ptr, 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(p_ptr, 0, TRUE);
-       (void)set_oppose_acid(p_ptr, 0, TRUE);
-       (void)set_oppose_elec(p_ptr, 0, TRUE);
-       (void)set_oppose_fire(p_ptr, 0, TRUE);
-       (void)set_oppose_cold(p_ptr, 0, TRUE);
-       (void)set_oppose_pois(p_ptr, 0, TRUE);
-       (void)set_ultimate_res(0, TRUE);
-       (void)set_mimic(p_ptr, 0, 0, TRUE);
-       (void)set_ele_attack(p_ptr, 0, 0);
-       (void)set_ele_immune(p_ptr, 0, 0);
+       (void)set_tim_reflect(creature_ptr, 0,TRUE);
+       (void)set_multishadow(creature_ptr, 0,TRUE);
+       (void)set_dustrobe(creature_ptr, 0,TRUE);
+
+       (void)set_tim_invis(creature_ptr, 0, TRUE);
+       (void)set_tim_infra(creature_ptr, 0, TRUE);
+       (void)set_tim_esp(creature_ptr, 0, TRUE);
+       (void)set_tim_regen(creature_ptr, 0, TRUE);
+       (void)set_tim_stealth(creature_ptr, 0, TRUE);
+       (void)set_tim_levitation(creature_ptr, 0, TRUE);
+       (void)set_tim_sh_touki(creature_ptr, 0, TRUE);
+       (void)set_tim_sh_fire(creature_ptr, 0, TRUE);
+       (void)set_tim_sh_holy(creature_ptr, 0, TRUE);
+       (void)set_tim_eyeeye(creature_ptr, 0, TRUE);
+       (void)set_magicdef(creature_ptr, 0, TRUE);
+       (void)set_resist_magic(creature_ptr, 0, TRUE);
+       (void)set_oppose_acid(creature_ptr, 0, TRUE);
+       (void)set_oppose_elec(creature_ptr, 0, TRUE);
+       (void)set_oppose_fire(creature_ptr, 0, TRUE);
+       (void)set_oppose_cold(creature_ptr, 0, TRUE);
+       (void)set_oppose_pois(creature_ptr, 0, TRUE);
+       (void)set_ultimate_res(creature_ptr, 0, TRUE);
+       (void)set_mimic(creature_ptr, 0, 0, TRUE);
+       (void)set_ele_attack(creature_ptr, 0, 0);
+       (void)set_ele_immune(creature_ptr, 0, 0);
 
        /* Cancel glowing hands */
-       if (p_ptr->special_attack & ATTACK_CONFUSE)
+       if (creature_ptr->special_attack & ATTACK_CONFUSE)
        {
-               p_ptr->special_attack &= ~(ATTACK_CONFUSE);
+               creature_ptr->special_attack &= ~(ATTACK_CONFUSE);
                msg_print(_("手の輝きがなくなった。", "Your hands stop glowing."));
        }
 
-       if (music_singing_any() || hex_spelling_any())
+       if (music_singing_any(creature_ptr) || hex_spelling_any(creature_ptr))
        {
-               concptr str = (music_singing_any()) ? _("歌", "singing") : _("呪文", "spelling");
-               INTERUPTING_SONG_EFFECT(p_ptr) = SINGING_SONG_EFFECT(p_ptr);
-               SINGING_SONG_EFFECT(p_ptr) = MUSIC_NONE;
+               concptr str = (music_singing_any(creature_ptr)) ? _("歌", "singing") : _("呪文", "spelling");
+               INTERUPTING_SONG_EFFECT(creature_ptr) = SINGING_SONG_EFFECT(creature_ptr);
+               SINGING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
                msg_format(_("%sが途切れた。", "Your %s is interrupted."), str);
 
-               p_ptr->action = ACTION_NONE;
-               p_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
-               p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
-               p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
-               p_ptr->energy_need += ENERGY_NEED();
+               creature_ptr->action = ACTION_NONE;
+               creature_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
+               creature_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
+               creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+               creature_ptr->energy_need += ENERGY_NEED();
        }
 }
 
 
 /*!
- * @brief 変身効果の継続時間と変身先をセットする / Set "p_ptr->tim_mimic", and "p_ptr->mimic_form", notice observable changes
+ * @brief 変身効果の継続時間と変身先をセットする / Set "tim_mimic", and "mimic_form", notice observable changes
  * @param v 継続時間
  * @param p 変身内容
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_dec)
+bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, MIMIC_RACE_IDX p, bool do_dec)
 {
        bool notice = FALSE;
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tim_mimic && (creature_ptr->mimic_form == p) && !do_dec)
@@ -383,13 +382,12 @@ bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->tim_mimic)
                {
                        msg_print(_("変身が解けた。", "You are no longer transformed."));
-                       if (creature_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(p_ptr, 0, TRUE);
+                       if (creature_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(creature_ptr, 0, TRUE);
                        creature_ptr->mimic_form=0;
                        notice = TRUE;
                        p = 0;
@@ -402,7 +400,7 @@ bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, TRUE);
+       if (disturb_state) disturb(creature_ptr, FALSE, TRUE);
 
        creature_ptr->redraw |= (PR_BASIC | PR_STATUS);
        creature_ptr->update |= (PU_BONUS | PU_HP);
@@ -412,7 +410,7 @@ bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_dec)
 }
 
 /*!
- * @brief 盲目の継続時間をセットする / Set "p_ptr->blind", notice observable changes
+ * @brief 盲目の継続時間をセットする / Set "blind", notice observable changes
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  * @details
@@ -428,7 +426,6 @@ bool set_blind(player_type *creature_ptr, TIME_EFFECT v)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (!creature_ptr->blind)
@@ -443,11 +440,10 @@ bool set_blind(player_type *creature_ptr, TIME_EFFECT v)
                        }
 
                        notice = TRUE;
-                       chg_virtue(V_ENLIGHTEN, -1);
+                       chg_virtue(creature_ptr, V_ENLIGHTEN, -1);
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->blind)
@@ -471,7 +467,7 @@ bool set_blind(player_type *creature_ptr, TIME_EFFECT v)
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
 
        /* Fully update the visuals */
        creature_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
@@ -483,7 +479,7 @@ bool set_blind(player_type *creature_ptr, TIME_EFFECT v)
 
 
 /*!
- * @brief 混乱の継続時間をセットする / Set "p_ptr->confused", notice observable changes
+ * @brief 混乱の継続時間をセットする / Set "confused", notice observable changes
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
@@ -494,7 +490,6 @@ bool set_confused(player_type *creature_ptr, TIME_EFFECT v)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (!creature_ptr->confused)
@@ -529,18 +524,16 @@ bool set_confused(player_type *creature_ptr, TIME_EFFECT v)
                        }
 
                        /* Sniper */
-                       if (creature_ptr->concent) reset_concentration(TRUE);
+                       if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
 
-                       /* Hex */
-                       if (hex_spelling_any()) stop_hex_spell_all();
+                       if (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
 
                        notice = TRUE;
                        creature_ptr->counter = FALSE;
-                       chg_virtue(V_HARMONY, -1);
+                       chg_virtue(creature_ptr, V_HARMONY, -1);
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->confused)
@@ -558,14 +551,14 @@ bool set_confused(player_type *creature_ptr, TIME_EFFECT v)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        handle_stuff();
        return (TRUE);
 }
 
 
 /*!
- * @brief 毒の継続時間をセットする / Set "p_ptr->poisoned", notice observable changes
+ * @brief 毒の継続時間をセットする / Set "poisoned", notice observable changes
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
@@ -576,7 +569,6 @@ bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (!creature_ptr->poisoned)
@@ -586,7 +578,6 @@ bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->poisoned)
@@ -603,14 +594,14 @@ bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        handle_stuff();
        return (TRUE);
 }
 
 
 /*!
- * @brief 恐怖の継続時間をセットする / Set "p_ptr->afraid", notice observable changes
+ * @brief 恐怖の継続時間をセットする / Set "afraid", notice observable changes
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
@@ -621,7 +612,6 @@ bool set_afraid(player_type *creature_ptr, TIME_EFFECT v)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (!creature_ptr->afraid)
@@ -641,11 +631,10 @@ bool set_afraid(player_type *creature_ptr, TIME_EFFECT v)
 
                        notice = TRUE;
                        creature_ptr->counter = FALSE;
-                       chg_virtue(V_VALOUR, -1);
+                       chg_virtue(creature_ptr, V_VALOUR, -1);
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->afraid)
@@ -662,7 +651,7 @@ bool set_afraid(player_type *creature_ptr, TIME_EFFECT v)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        handle_stuff();
        return (TRUE);
 }
@@ -679,24 +668,19 @@ bool set_paralyzed(player_type *creature_ptr, TIME_EFFECT v)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (!creature_ptr->paralyzed)
                {
                        msg_print(_("体が麻痺してしまった!", "You are paralyzed!"));
-                       /* Sniper */
-                       if (creature_ptr->concent) reset_concentration(TRUE);
-
-                       /* Hex */
-                       if (hex_spelling_any()) stop_hex_spell_all();
+                       if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
+                       if (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
 
                        creature_ptr->counter = FALSE;
                        notice = TRUE;
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->paralyzed)
@@ -713,14 +697,14 @@ bool set_paralyzed(player_type *creature_ptr, TIME_EFFECT v)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->redraw |= (PR_STATE);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 幻覚の継続時間をセットする / Set "p_ptr->image", notice observable changes
+ * @brief 幻覚の継続時間をセットする / Set "image", notice observable changes
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  * @details Note that we must redraw the map when hallucination changes.
@@ -733,23 +717,21 @@ bool set_image(player_type *creature_ptr, TIME_EFFECT v)
        if (creature_ptr->is_dead) return FALSE;
        if (creature_ptr->pseikaku == SEIKAKU_CHARGEMAN) v = 0;
 
-       /* Open */
        if (v)
        {
-               set_tsuyoshi(p_ptr, 0, TRUE);
+               set_tsuyoshi(creature_ptr, 0, TRUE);
                if (!creature_ptr->image)
                {
                        msg_print(_("ワーオ!何もかも虹色に見える!", "Oh, wow! Everything looks so cosmic now!"));
 
                        /* Sniper */
-                       if (creature_ptr->concent) reset_concentration(TRUE);
+                       if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
 
                        creature_ptr->counter = FALSE;
                        notice = TRUE;
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->image)
@@ -766,7 +748,7 @@ bool set_image(player_type *creature_ptr, TIME_EFFECT v)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, TRUE);
+       if (disturb_state) disturb(creature_ptr, FALSE, TRUE);
 
        creature_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH);
        creature_ptr->update |= (PU_MONSTERS);
@@ -776,7 +758,7 @@ bool set_image(player_type *creature_ptr, TIME_EFFECT v)
 }
 
 /*!
- * @brief 加速の継続時間をセットする / Set "p_ptr->fast", notice observable changes
+ * @brief 加速の継続時間をセットする / Set "fast", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -788,26 +770,24 @@ bool set_fast(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->fast && !do_dec)
                {
                        if (creature_ptr->fast > v) return FALSE;
                }
-               else if (!IS_FAST() && !creature_ptr->lightspeed)
+               else if (!IS_FAST(creature_ptr) && !creature_ptr->lightspeed)
                {
                        msg_print(_("素早く動けるようになった!", "You feel yourself moving much faster!"));
                        notice = TRUE;
-                       chg_virtue(V_PATIENCE, -1);
-                       chg_virtue(V_DILIGENCE, 1);
+                       chg_virtue(creature_ptr, V_PATIENCE, -1);
+                       chg_virtue(creature_ptr, V_DILIGENCE, 1);
                }
        }
 
-       /* Shut */
        else
        {
-               if (creature_ptr->fast && !creature_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
+               if (creature_ptr->fast && !creature_ptr->lightspeed && !music_singing(creature_ptr, MUSIC_SPEED) && !music_singing(creature_ptr, MUSIC_SHERO))
                {
                        msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
                        notice = TRUE;
@@ -820,14 +800,14 @@ bool set_fast(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 光速移動の継続時間をセットする / Set "p_ptr->lightspeed", notice observable changes
+ * @brief 光速移動の継続時間をセットする / Set "lightspeed", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -841,7 +821,6 @@ bool set_lightspeed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->wild_mode) v = 0;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->lightspeed && !do_dec)
@@ -852,12 +831,11 @@ bool set_lightspeed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                {
                        msg_print(_("非常に素早く動けるようになった!", "You feel yourself moving extremely faster!"));
                        notice = TRUE;
-                       chg_virtue(V_PATIENCE, -1);
-                       chg_virtue(V_DILIGENCE, 1);
+                       chg_virtue(creature_ptr, V_PATIENCE, -1);
+                       chg_virtue(creature_ptr, V_DILIGENCE, 1);
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->lightspeed)
@@ -873,14 +851,14 @@ bool set_lightspeed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 減速の継続時間をセットする / Set "p_ptr->slow", notice observable changes
+ * @brief 減速の継続時間をセットする / Set "slow", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -892,7 +870,6 @@ bool set_slow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->slow && !do_dec)
@@ -906,7 +883,6 @@ bool set_slow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->slow)
@@ -922,7 +898,7 @@ bool set_slow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -930,7 +906,7 @@ bool set_slow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
 
 /*!
- * @brief 肌石化の継続時間をセットする / Set "p_ptr->shield", notice observable changes
+ * @brief 肌石化の継続時間をセットする / Set "shield", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -942,7 +918,6 @@ bool set_shield(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->shield && !do_dec)
@@ -956,7 +931,6 @@ bool set_shield(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->shield)
@@ -973,7 +947,7 @@ bool set_shield(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -981,7 +955,7 @@ bool set_shield(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
 
 /*!
- * @brief つぶれるの継続時間をセットする / Set "p_ptr->tsubureru", notice observable changes
+ * @brief つぶれるの継続時間をセットする / Set "tsubureru", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -993,7 +967,6 @@ bool set_tsubureru(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tsubureru && !do_dec)
@@ -1007,7 +980,6 @@ bool set_tsubureru(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->tsubureru)
@@ -1024,7 +996,7 @@ bool set_tsubureru(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -1032,7 +1004,7 @@ bool set_tsubureru(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
 
 /*!
- * @brief 魔法の鎧の継続時間をセットする / Set "p_ptr->magicdef", notice observable changes
+ * @brief 魔法の鎧の継続時間をセットする / Set "magicdef", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1044,7 +1016,6 @@ bool set_magicdef(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->magicdef && !do_dec)
@@ -1058,7 +1029,6 @@ bool set_magicdef(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->magicdef)
@@ -1075,14 +1045,14 @@ bool set_magicdef(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 祝福の継続時間をセットする / Set "p_ptr->blessed", notice observable changes
+ * @brief 祝福の継続時間をセットする / Set "blessed", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1094,7 +1064,6 @@ bool set_blessed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->blessed && !do_dec)
@@ -1108,10 +1077,9 @@ bool set_blessed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
-               if (creature_ptr->blessed && !music_singing(MUSIC_BLESS))
+               if (creature_ptr->blessed && !music_singing(creature_ptr, MUSIC_BLESS))
                {
                        msg_print(_("高潔な気分が消え失せた。", "The prayer has expired."));
                        notice = TRUE;
@@ -1125,7 +1093,7 @@ bool set_blessed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -1133,7 +1101,7 @@ bool set_blessed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
 
 /*!
- * @brief 士気高揚の継続時間をセットする / Set "p_ptr->hero", notice observable changes
+ * @brief 士気高揚の継続時間をセットする / Set "hero", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1145,7 +1113,6 @@ bool set_hero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->hero && !do_dec)
@@ -1159,10 +1126,9 @@ bool set_hero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
-               if (creature_ptr->hero && !music_singing(MUSIC_HERO) && !music_singing(MUSIC_SHERO))
+               if (creature_ptr->hero && !music_singing(creature_ptr, MUSIC_HERO) && !music_singing(creature_ptr, MUSIC_SHERO))
                {
                        msg_print(_("ヒーローの気分が消え失せた。", "The heroism wears off."));
                        notice = TRUE;
@@ -1176,7 +1142,7 @@ bool set_hero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
 
        /* Recalculate hitpoints */
@@ -1186,7 +1152,7 @@ bool set_hero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 }
 
 /*!
- * @brief 狂戦士化の継続時間をセットする / Set "p_ptr->shero", notice observable changes
+ * @brief 狂戦士化の継続時間をセットする / Set "shero", notice observable changes
  * @param v 継続時間/ 0ならば無条件にリセット
  * @param do_dec FALSEの場合現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1199,7 +1165,6 @@ bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        if (creature_ptr->is_dead) return FALSE;
 
        if (creature_ptr->pclass == CLASS_BERSERKER) v = 1;
-       /* Open */
        if (v)
        {
                if (creature_ptr->shero && !do_dec)
@@ -1213,7 +1178,6 @@ bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->shero)
@@ -1230,7 +1194,7 @@ bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
 
        /* Recalculate hitpoints */
@@ -1240,7 +1204,7 @@ bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 }
 
 /*!
- * @brief 対邪悪結界の継続時間をセットする / Set "p_ptr->protevil", notice observable changes
+ * @brief 対邪悪結界の継続時間をセットする / Set "protevil", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1252,7 +1216,6 @@ bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->protevil && !do_dec)
@@ -1266,7 +1229,6 @@ bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->protevil)
@@ -1283,13 +1245,13 @@ bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 幽体化の継続時間をセットする / Set "p_ptr->wraith_form", notice observable changes
+ * @brief 幽体化の継続時間をセットする / Set "wraith_form", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1301,7 +1263,6 @@ bool set_wraith_form(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->wraith_form && !do_dec)
@@ -1312,10 +1273,10 @@ bool set_wraith_form(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                {
                        msg_print(_("物質界を離れて幽鬼のような存在になった!", "You leave the physical world and current_world_ptr->game_turn into a wraith-being!"));
                        notice = TRUE;
-                       chg_virtue(V_UNLIFE, 3);
-                       chg_virtue(V_HONOUR, -2);
-                       chg_virtue(V_SACRIFICE, -2);
-                       chg_virtue(V_VALOUR, -5);
+                       chg_virtue(creature_ptr, V_UNLIFE, 3);
+                       chg_virtue(creature_ptr, V_HONOUR, -2);
+                       chg_virtue(creature_ptr, V_SACRIFICE, -2);
+                       chg_virtue(creature_ptr, V_VALOUR, -5);
 
                        creature_ptr->redraw |= (PR_MAP);
                        creature_ptr->update |= (PU_MONSTERS);
@@ -1324,7 +1285,6 @@ bool set_wraith_form(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->wraith_form)
@@ -1346,7 +1306,7 @@ bool set_wraith_form(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -1354,7 +1314,7 @@ bool set_wraith_form(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 }
 
 /*!
- * @brief 無傷球の継続時間をセットする / Set "p_ptr->invuln", notice observable changes
+ * @brief 無傷球の継続時間をセットする / Set "invuln", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1366,7 +1326,6 @@ bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->invuln && !do_dec)
@@ -1378,10 +1337,10 @@ bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                        msg_print(_("無敵だ!", "Invulnerability!"));
                        notice = TRUE;
 
-                       chg_virtue(V_UNLIFE, -2);
-                       chg_virtue(V_HONOUR, -2);
-                       chg_virtue(V_SACRIFICE, -3);
-                       chg_virtue(V_VALOUR, -5);
+                       chg_virtue(creature_ptr, V_UNLIFE, -2);
+                       chg_virtue(creature_ptr, V_HONOUR, -2);
+                       chg_virtue(creature_ptr, V_SACRIFICE, -3);
+                       chg_virtue(creature_ptr, V_VALOUR, -5);
 
                        creature_ptr->redraw |= (PR_MAP);
                        creature_ptr->update |= (PU_MONSTERS);
@@ -1390,10 +1349,9 @@ bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
-               if (creature_ptr->invuln && !music_singing(MUSIC_INVULN))
+               if (creature_ptr->invuln && !music_singing(creature_ptr, MUSIC_INVULN))
                {
                        msg_print(_("無敵ではなくなった。", "The invulnerability wears off."));
                        notice = TRUE;
@@ -1414,14 +1372,14 @@ bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 時限ESPの継続時間をセットする / Set "p_ptr->tim_esp", notice observable changes
+ * @brief 時限ESPの継続時間をセットする / Set "tim_esp", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1433,7 +1391,6 @@ bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tim_esp && !do_dec)
@@ -1447,10 +1404,9 @@ bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
-               if (creature_ptr->tim_esp && !music_singing(MUSIC_MIND))
+               if (creature_ptr->tim_esp && !music_singing(creature_ptr, MUSIC_MIND))
                {
                        msg_print(_("意識は元に戻った。", "Your consciousness contracts again."));
                        notice = TRUE;
@@ -1464,7 +1420,7 @@ bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        creature_ptr->update |= (PU_MONSTERS);
        handle_stuff();
@@ -1472,7 +1428,7 @@ bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 }
 
 /*!
- * @brief 時限透明視の継続時間をセットする / Set "p_ptr->tim_invis", notice observable changes
+ * @brief 時限透明視の継続時間をセットする / Set "tim_invis", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1484,7 +1440,6 @@ bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tim_invis && !do_dec)
@@ -1498,7 +1453,6 @@ bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->tim_invis)
@@ -1515,7 +1469,7 @@ bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
 
        /* Update the monsters */
@@ -1525,7 +1479,7 @@ bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 }
 
 /*!
- * @brief 時限赤外線視力の継続時間をセットする / Set "p_ptr->tim_infra", notice observable changes
+ * @brief 時限赤外線視力の継続時間をセットする / Set "tim_infra", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1537,7 +1491,6 @@ bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tim_infra && !do_dec)
@@ -1551,7 +1504,6 @@ bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->tim_infra)
@@ -1568,7 +1520,7 @@ bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
 
        /* Update the monsters */
@@ -1578,7 +1530,7 @@ bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 }
 
 /*!
- * @brief 時限急回復の継続時間をセットする / Set "p_ptr->tim_regen", notice observable changes
+ * @brief 時限急回復の継続時間をセットする / Set "tim_regen", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1590,7 +1542,6 @@ bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tim_regen && !do_dec)
@@ -1604,7 +1555,6 @@ bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->tim_regen)
@@ -1621,14 +1571,14 @@ bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 隠密の歌の継続時間をセットする / Set "p_ptr->tim_stealth", notice observable changes
+ * @brief 隠密の歌の継続時間をセットする / Set "tim_stealth", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1640,7 +1590,6 @@ bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tim_stealth && !do_dec)
@@ -1654,10 +1603,9 @@ bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
-               if (creature_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
+               if (creature_ptr->tim_stealth && !music_singing(creature_ptr, MUSIC_STEALTH))
                {
                        msg_print(_("足音が大きくなった。", "You no longer walk silently."));
                        notice = TRUE;
@@ -1671,7 +1619,7 @@ bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -1688,12 +1636,11 @@ bool set_superstealth(player_type *creature_ptr, bool set)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (set)
        {
                if (!(creature_ptr->special_defense & NINJA_S_STEALTH))
                {
-                       if (current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & CAVE_MNLT)
+                       if (p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & CAVE_MNLT)
                        {
                                msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
                                creature_ptr->monlite = creature_ptr->old_monlite = TRUE;
@@ -1711,7 +1658,6 @@ bool set_superstealth(player_type *creature_ptr, bool set)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->special_defense & NINJA_S_STEALTH)
@@ -1728,12 +1674,12 @@ bool set_superstealth(player_type *creature_ptr, bool set)
        if (!notice) return (FALSE);
        creature_ptr->redraw |= (PR_STATUS);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        return (TRUE);
 }
 
 /*!
- * @brief 一時的浮遊の継続時間をセットする / Set "p_ptr->tim_levitation", notice observable changes
+ * @brief 一時的浮遊の継続時間をセットする / Set "tim_levitation", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1745,7 +1691,6 @@ bool set_tim_levitation(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tim_levitation && !do_dec)
@@ -1759,7 +1704,6 @@ bool set_tim_levitation(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->tim_levitation)
@@ -1776,14 +1720,14 @@ bool set_tim_levitation(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 一時的闘気のオーラの継続時間をセットする / Set "p_ptr->tim_sh_touki", notice observable changes
+ * @brief 一時的闘気のオーラの継続時間をセットする / Set "tim_sh_touki", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1795,7 +1739,6 @@ bool set_tim_sh_touki(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tim_sh_touki && !do_dec)
@@ -1809,7 +1752,6 @@ bool set_tim_sh_touki(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->tim_sh_touki)
@@ -1826,13 +1768,13 @@ bool set_tim_sh_touki(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 一時的火炎のオーラの継続時間をセットする / Set "p_ptr->tim_sh_fire", notice observable changes
+ * @brief 一時的火炎のオーラの継続時間をセットする / Set "tim_sh_fire", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1844,7 +1786,6 @@ bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tim_sh_fire && !do_dec)
@@ -1858,7 +1799,6 @@ bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->tim_sh_fire)
@@ -1875,14 +1815,14 @@ bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 一時的聖なるのオーラの継続時間をセットする / Set "p_ptr->tim_sh_holy", notice observable changes
+ * @brief 一時的聖なるのオーラの継続時間をセットする / Set "tim_sh_holy", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1894,7 +1834,6 @@ bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tim_sh_holy && !do_dec)
@@ -1908,7 +1847,6 @@ bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->tim_sh_holy)
@@ -1925,14 +1863,14 @@ bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 目には目をの残り時間をセットする / Set "p_ptr->tim_eyeeye", notice observable changes
+ * @brief 目には目をの残り時間をセットする / Set "tim_eyeeye", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1944,7 +1882,6 @@ bool set_tim_eyeeye(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tim_eyeeye && !do_dec)
@@ -1958,7 +1895,6 @@ bool set_tim_eyeeye(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->tim_eyeeye)
@@ -1975,7 +1911,7 @@ bool set_tim_eyeeye(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -1983,7 +1919,7 @@ bool set_tim_eyeeye(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
 
 /*!
- * @brief 一時的魔法防御の継続時間をセットする / Set "p_ptr->resist_magic", notice observable changes
+ * @brief 一時的魔法防御の継続時間をセットする / Set "resist_magic", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -1995,7 +1931,6 @@ bool set_resist_magic(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->resist_magic && !do_dec)
@@ -2009,7 +1944,6 @@ bool set_resist_magic(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->resist_magic)
@@ -2026,14 +1960,14 @@ bool set_resist_magic(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 一時的反射の継続時間をセットする / Set "p_ptr->tim_reflect", notice observable changes
+ * @brief 一時的反射の継続時間をセットする / Set "tim_reflect", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -2045,7 +1979,6 @@ bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tim_reflect && !do_dec)
@@ -2059,7 +1992,6 @@ bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->tim_reflect)
@@ -2076,7 +2008,7 @@ bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -2084,7 +2016,7 @@ bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
 
 /*
- * Set "p_ptr->multishadow", notice observable changes
+ * Set "multishadow", notice observable changes
  */
 bool set_multishadow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 {
@@ -2093,7 +2025,6 @@ bool set_multishadow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->multishadow && !do_dec)
@@ -2107,7 +2038,6 @@ bool set_multishadow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->multishadow)
@@ -2124,14 +2054,14 @@ bool set_multishadow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 一時的破片のオーラの継続時間をセットする / Set "p_ptr->dustrobe", notice observable changes
+ * @brief 一時的破片のオーラの継続時間をセットする / Set "dustrobe", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -2143,7 +2073,6 @@ bool set_dustrobe(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->dustrobe && !do_dec)
@@ -2157,7 +2086,6 @@ bool set_dustrobe(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->dustrobe)
@@ -2174,14 +2102,14 @@ bool set_dustrobe(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 一時的壁抜けの継続時間をセットする / Set "p_ptr->kabenuke", notice observable changes
+ * @brief 一時的壁抜けの継続時間をセットする / Set "kabenuke", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -2193,7 +2121,6 @@ bool set_kabenuke(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->kabenuke && !do_dec)
@@ -2207,7 +2134,6 @@ bool set_kabenuke(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->kabenuke)
@@ -2224,14 +2150,14 @@ bool set_kabenuke(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief オクレ兄さんの継続時間をセットする / Set "p_ptr->tsuyoshi", notice observable changes
+ * @brief オクレ兄さんの継続時間をセットする / Set "tsuyoshi", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -2243,7 +2169,6 @@ bool set_tsuyoshi(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tsuyoshi && !do_dec)
@@ -2254,11 +2179,10 @@ bool set_tsuyoshi(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                {
                        msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
                        notice = TRUE;
-                       chg_virtue(V_VITALITY, 2);
+                       chg_virtue(creature_ptr, V_VITALITY, 2);
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->tsuyoshi)
@@ -2269,7 +2193,7 @@ bool set_tsuyoshi(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                        (void)dec_stat(creature_ptr, A_STR, 20, TRUE);
 
                        notice = TRUE;
-                       chg_virtue(V_VITALITY, -3);
+                       chg_virtue(creature_ptr, V_VITALITY, -3);
                }
        }
 
@@ -2280,7 +2204,7 @@ bool set_tsuyoshi(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
 
        /* Recalculate hitpoints */
@@ -2353,7 +2277,7 @@ bool set_ele_attack(player_type *creature_ptr, u32b attack_type, TIME_EFFECT v)
 #endif
        }
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->redraw |= (PR_STATUS);
 
        creature_ptr->update |= (PU_BONUS);
@@ -2416,7 +2340,7 @@ bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v)
                                        _("(なし)", "do nothing special.")))))));
        }
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->redraw |= (PR_STATUS);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
@@ -2425,7 +2349,7 @@ bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v)
 }
 
 /*!
- * @brief 一時的酸耐性の継続時間をセットする / Set "p_ptr->oppose_acid", notice observable changes
+ * @brief 一時的酸耐性の継続時間をセットする / Set "oppose_acid", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -2437,7 +2361,6 @@ bool set_oppose_acid(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->oppose_acid && !do_dec)
@@ -2451,10 +2374,9 @@ bool set_oppose_acid(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
-               if (creature_ptr->oppose_acid && !music_singing(MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
+               if (creature_ptr->oppose_acid && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
                {
                        msg_print(_("酸への耐性が薄れた気がする。", "You feel less resistant to acid."));
                        notice = TRUE;
@@ -2468,13 +2390,13 @@ bool set_oppose_acid(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
        creature_ptr->redraw |= (PR_STATUS);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 一時的電撃耐性の継続時間をセットする / Set "p_ptr->oppose_elec", notice observable changes
+ * @brief 一時的電撃耐性の継続時間をセットする / Set "oppose_elec", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -2486,7 +2408,6 @@ bool set_oppose_elec(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->oppose_elec && !do_dec)
@@ -2500,10 +2421,9 @@ bool set_oppose_elec(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
-               if (creature_ptr->oppose_elec && !music_singing(MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
+               if (creature_ptr->oppose_elec && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
                {
                        msg_print(_("電撃への耐性が薄れた気がする。", "You feel less resistant to electricity."));
                        notice = TRUE;
@@ -2517,13 +2437,13 @@ bool set_oppose_elec(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
        creature_ptr->redraw |= (PR_STATUS);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 一時的火炎耐性の継続時間をセットする / Set "p_ptr->oppose_fire", notice observable changes
+ * @brief 一時的火炎耐性の継続時間をセットする / Set "oppose_fire", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -2536,7 +2456,6 @@ bool set_oppose_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        if (creature_ptr->is_dead) return FALSE;
 
        if ((PRACE_IS_(creature_ptr, RACE_DEMON) && (creature_ptr->lev > 44)) || (creature_ptr->mimic_form == MIMIC_DEMON)) v = 1;
-       /* Open */
        if (v)
        {
                if (creature_ptr->oppose_fire && !do_dec)
@@ -2550,10 +2469,9 @@ bool set_oppose_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
-               if (creature_ptr->oppose_fire && !music_singing(MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
+               if (creature_ptr->oppose_fire && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
                {
                        msg_print(_("火への耐性が薄れた気がする。", "You feel less resistant to fire."));
                        notice = TRUE;
@@ -2567,13 +2485,13 @@ bool set_oppose_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
        creature_ptr->redraw |= (PR_STATUS);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 一時的冷気耐性の継続時間をセットする / Set "p_ptr->oppose_cold", notice observable changes
+ * @brief 一時的冷気耐性の継続時間をセットする / Set "oppose_cold", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -2585,7 +2503,6 @@ bool set_oppose_cold(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->oppose_cold && !do_dec)
@@ -2599,10 +2516,9 @@ bool set_oppose_cold(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
-               if (creature_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
+               if (creature_ptr->oppose_cold && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
                {
                        msg_print(_("冷気への耐性が薄れた気がする。", "You feel less resistant to cold."));
                        notice = TRUE;
@@ -2616,13 +2532,13 @@ bool set_oppose_cold(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
        creature_ptr->redraw |= (PR_STATUS);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 一時的毒耐性の継続時間をセットする / Set "p_ptr->oppose_pois", notice observable changes
+ * @brief 一時的毒耐性の継続時間をセットする / Set "oppose_pois", notice observable changes
  * @param v 継続時間
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
@@ -2635,7 +2551,6 @@ bool set_oppose_pois(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        if ((creature_ptr->pclass == CLASS_NINJA) && (creature_ptr->lev > 44)) v = 1;
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->oppose_pois && !do_dec)
@@ -2649,10 +2564,9 @@ bool set_oppose_pois(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
-               if (creature_ptr->oppose_pois && !music_singing(MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
+               if (creature_ptr->oppose_pois && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
                {
                        msg_print(_("毒への耐性が薄れた気がする。", "You feel less resistant to poison."));
                        notice = TRUE;
@@ -2666,13 +2580,13 @@ bool set_oppose_pois(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
        creature_ptr->redraw |= (PR_STATUS);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        handle_stuff();
        return (TRUE);
 }
 
 /*!
- * @brief 朦朧の継続時間をセットする / Set "p_ptr->stun", notice observable changes
+ * @brief 朦朧の継続時間をセットする / Set "stun", notice observable changes
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  * @details
@@ -2781,10 +2695,8 @@ bool set_stun(player_type *creature_ptr, TIME_EFFECT v)
                }
 
                /* Sniper */
-               if (creature_ptr->concent) reset_concentration(TRUE);
-
-               /* Hex */
-               if (hex_spelling_any()) stop_hex_spell_all();
+               if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
+               if (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
 
                notice = TRUE;
        }
@@ -2799,7 +2711,7 @@ bool set_stun(player_type *creature_ptr, TIME_EFFECT v)
                case 0:
                        msg_print(_("やっと朦朧状態から回復した。", "You are no longer stunned."));
 
-                       if (disturb_state) disturb(FALSE, FALSE);
+                       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
                        break;
                }
 
@@ -2812,7 +2724,7 @@ bool set_stun(player_type *creature_ptr, TIME_EFFECT v)
        /* No change */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
 
        /* Redraw the "stun" */
@@ -2823,7 +2735,7 @@ bool set_stun(player_type *creature_ptr, TIME_EFFECT v)
 
 
 /*!
- * @brief 出血の継続時間をセットする / Set "p_ptr->cut", notice observable changes
+ * @brief 出血の継続時間をセットする / Set "cut", notice observable changes
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  * @details
@@ -2990,7 +2902,7 @@ bool set_cut(player_type *creature_ptr, TIME_EFFECT v)
                        case 0:
                        msg_format(_("やっと%s。", "You are no longer bleeding."), creature_ptr->prace == RACE_ANDROID ? "怪我が直った" : "出血が止まった");
 
-                       if (disturb_state) disturb(FALSE, FALSE);
+                       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
                        break;
                }
 
@@ -3003,7 +2915,7 @@ bool set_cut(player_type *creature_ptr, TIME_EFFECT v)
        /* No change */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
 
        /* Redraw the "cut" */
@@ -3013,13 +2925,13 @@ bool set_cut(player_type *creature_ptr, TIME_EFFECT v)
 }
 
 /*!
- * @brief 空腹状態をセットする / Set "p_ptr->food", notice observable changes
+ * @brief 空腹状態をセットする / Set "food", notice observable changes
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  * @details
  * Set "", notice observable changes\n
  *\n
- * The "p_ptr->food" variable can get as large as 20000, allowing the
+ * The "food" variable can get as large as 20000, allowing the
  * addition of the most "filling" item, Elvish Waybread, which adds
  * 7500 food units, without overflowing the 32767 maximum limit.\n
  *\n
@@ -3118,13 +3030,13 @@ bool set_food(player_type *creature_ptr, TIME_EFFECT v)
        }
 
        if (old_aux < 1 && new_aux > 0)
-               chg_virtue(V_PATIENCE, 2);
+               chg_virtue(creature_ptr, V_PATIENCE, 2);
        else if (old_aux < 3 && (old_aux != new_aux))
-               chg_virtue(V_PATIENCE, 1);
+               chg_virtue(creature_ptr, V_PATIENCE, 1);
        if (old_aux == 2)
-               chg_virtue(V_TEMPERANCE, 1);
+               chg_virtue(creature_ptr, V_TEMPERANCE, 1);
        if (old_aux == 0)
-               chg_virtue(V_TEMPERANCE, -1);
+               chg_virtue(creature_ptr, V_TEMPERANCE, -1);
 
        /* Food increase */
        if (new_aux > old_aux)
@@ -3147,9 +3059,9 @@ bool set_food(player_type *creature_ptr, TIME_EFFECT v)
                        /* Bloated */
                        case 5:
                        msg_print(_("食べ過ぎだ!", "You have gorged yourself!"));
-                       chg_virtue(V_HARMONY, -1);
-                       chg_virtue(V_PATIENCE, -1);
-                       chg_virtue(V_TEMPERANCE, -2);
+                       chg_virtue(creature_ptr, V_HARMONY, -1);
+                       chg_virtue(creature_ptr, V_PATIENCE, -1);
+                       chg_virtue(creature_ptr, V_TEMPERANCE, -2);
 
                        break;
                }
@@ -3182,7 +3094,7 @@ bool set_food(player_type *creature_ptr, TIME_EFFECT v)
 
                if (creature_ptr->wild_mode && (new_aux < 2))
                {
-                       change_wild_mode(FALSE);
+                       change_wild_mode(creature_ptr, FALSE);
                }
 
                /* Change */
@@ -3195,7 +3107,7 @@ bool set_food(player_type *creature_ptr, TIME_EFFECT v)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
 
        /* Redraw hunger */
@@ -3341,9 +3253,9 @@ bool dec_stat(player_type *creature_ptr, int stat, int amount, int permanent)
        /* Damage "max" value */
        if (permanent && (max > 3))
        {
-               chg_virtue(V_SACRIFICE, 1);
+               chg_virtue(creature_ptr, V_SACRIFICE, 1);
                if (stat == A_WIS || stat == A_INT)
-                       chg_virtue(V_ENLIGHTEN, -2);
+                       chg_virtue(creature_ptr, V_ENLIGHTEN, -2);
 
                /* Handle "low" values */
                if (max <= 18)
@@ -3421,7 +3333,7 @@ bool res_stat(player_type *creature_ptr, int stat)
 bool hp_player(player_type *creature_ptr, int num)
 {
        int vir;
-       vir = virtue_number(V_VITALITY);
+       vir = virtue_number(creature_ptr, V_VITALITY);
 
        if(num <= 0) return (FALSE);
 
@@ -3433,7 +3345,7 @@ bool hp_player(player_type *creature_ptr, int num)
        if (creature_ptr->chp < creature_ptr->mhp)
        {
                if ((num > 0) && (creature_ptr->chp < (creature_ptr->mhp/3)))
-                       chg_virtue(V_TEMPERANCE, 1);
+                       chg_virtue(creature_ptr, V_TEMPERANCE, 1);
                /* Gain hitpoints */
                creature_ptr->chp += num;
 
@@ -3537,7 +3449,7 @@ bool do_dec_stat(player_type *creature_ptr, int stat)
        }
 
        /* Attempt to reduce the stat */
-       if (dec_stat(p_ptr, stat, 10, (ironman_nightmare && !randint0(13))))
+       if (dec_stat(creature_ptr, stat, 10, (ironman_nightmare && !randint0(13))))
        {
                msg_format(_("ひどく%sなった気がする。", "You feel very %s."), desc_stat_neg[stat]);
 
@@ -3558,7 +3470,7 @@ bool do_res_stat(player_type *creature_ptr, int stat)
        /* Attempt to increase */
        if (res_stat(creature_ptr, stat))
        {
-               msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
+               msg_format(_("元通りに%sなった気がする。", "You feel more %s."), desc_stat_pos[stat]);
                return (TRUE);
        }
 
@@ -3582,16 +3494,16 @@ bool do_inc_stat(player_type *creature_ptr, int stat)
        {
                if (stat == A_WIS)
                {
-                       chg_virtue(V_ENLIGHTEN, 1);
-                       chg_virtue(V_FAITH, 1);
+                       chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
+                       chg_virtue(creature_ptr, V_FAITH, 1);
                }
                else if (stat == A_INT)
                {
-                       chg_virtue(V_KNOWLEDGE, 1);
-                       chg_virtue(V_ENLIGHTEN, 1);
+                       chg_virtue(creature_ptr, V_KNOWLEDGE, 1);
+                       chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
                }
                else if (stat == A_CON)
-                       chg_virtue(V_VITALITY, 1);
+                       chg_virtue(creature_ptr, V_VITALITY, 1);
 
                msg_format(_("ワーオ!とても%sなった!", "Wow!  You feel very %s!"), desc_stat_pos[stat]);
 
@@ -3601,7 +3513,7 @@ bool do_inc_stat(player_type *creature_ptr, int stat)
        /* Restoration worked */
        if (res)
        {
-               msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
+               msg_format(_("元通りに%sなった気がする。", "You feel more %s."), desc_stat_pos[stat]);
 
                return (TRUE);
        }
@@ -3625,7 +3537,7 @@ bool restore_level(player_type *creature_ptr)
                creature_ptr->exp = creature_ptr->max_exp;
 
                /* Check the experience */
-               check_experience();
+               check_experience(creature_ptr);
 
                /* Did something */
                return (TRUE);
@@ -3642,8 +3554,8 @@ bool lose_all_info(player_type *creature_ptr)
 {
        int i;
 
-       chg_virtue(V_KNOWLEDGE, -5);
-       chg_virtue(V_ENLIGHTEN, -5);
+       chg_virtue(creature_ptr, V_KNOWLEDGE, -5);
+       chg_virtue(creature_ptr, V_ENLIGHTEN, -5);
 
        /* Forget info about objects */
        for (i = 0; i < INVEN_TOTAL; i++)
@@ -3672,7 +3584,7 @@ bool lose_all_info(player_type *creature_ptr)
        creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 
        /* Mega-Hack -- Forget the map */
-       wiz_dark();
+       wiz_dark(creature_ptr);
 
        /* It worked */
        return (TRUE);
@@ -3694,7 +3606,7 @@ void do_poly_wounds(player_type *creature_ptr)
        if (Nasty_effect)
        {
                msg_print(_("新たな傷ができた!", "A new wound was created!"));
-               take_hit(DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
+               take_hit(creature_ptr, DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
                set_cut(creature_ptr,change);
        }
        else
@@ -3718,7 +3630,7 @@ void change_race(player_type *creature_ptr, CHARACTER_IDX new_race, concptr effe
        msg_format("You current_world_ptr->game_turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
 #endif
 
-       chg_virtue(V_CHANCE, 2);
+       chg_virtue(creature_ptr, V_CHANCE, 2);
 
        if (creature_ptr->prace < 32)
        {
@@ -3742,7 +3654,7 @@ void change_race(player_type *creature_ptr, CHARACTER_IDX new_race, concptr effe
                creature_ptr->expfact -= 15;
 
        /* Get character's height and weight */
-       get_height_weight();
+       get_height_weight(creature_ptr);
 
        /* Hitdice */
        if (creature_ptr->pclass == CLASS_SORCERER)
@@ -3753,7 +3665,7 @@ void change_race(player_type *creature_ptr, CHARACTER_IDX new_race, concptr effe
        roll_hitdice(creature_ptr, 0L);
 
        /* The experience level may be modified */
-       check_experience();
+       check_experience(creature_ptr);
 
        creature_ptr->redraw |= (PR_BASIC);
 
@@ -3774,7 +3686,7 @@ void do_poly_self(player_type *creature_ptr)
        int power = creature_ptr->lev;
 
        msg_print(_("あなたは変化の訪れを感じた...", "You feel a change coming over you..."));
-       chg_virtue(V_CHANCE, 1);
+       chg_virtue(creature_ptr, V_CHANCE, 1);
 
        if ((power > randint0(20)) && one_in_(3) && (creature_ptr->prace != RACE_ANDROID))
        {
@@ -3840,7 +3752,7 @@ void do_poly_self(player_type *creature_ptr)
                        /* Polymorph into a less mutated form */
                        power -= 10;
 
-                       if (!lose_mutation(0))
+                       if (!lose_mutation(creature_ptr, 0))
                        msg_print(_("奇妙なくらい普通になった気がする。", "You feel oddly normal."));
                }
 
@@ -3850,7 +3762,7 @@ void do_poly_self(player_type *creature_ptr)
                }
                while ((new_race == creature_ptr->prace) || (new_race == RACE_ANDROID));
 
-               change_race(p_ptr, new_race, effect_msg);
+               change_race(creature_ptr, new_race, effect_msg);
        }
 
        if ((power > randint0(30)) && one_in_(6))
@@ -3869,7 +3781,7 @@ void do_poly_self(player_type *creature_ptr)
                if (one_in_(6))
                {
                        msg_print(_("現在の姿で生きていくのは困難なようだ!", "You find living difficult in your present form!"));
-                       take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), creature_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
+                       take_hit(creature_ptr, DAMAGE_LOSELIFE, damroll(randint1(10), creature_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
 
                        power -= 10;
                }
@@ -3879,7 +3791,7 @@ void do_poly_self(player_type *creature_ptr)
        {
                power -= 10;
 
-               get_max_stats();
+               get_max_stats(creature_ptr);
                roll_hitdice(creature_ptr, 0L);
        }
 
@@ -3892,13 +3804,13 @@ void do_poly_self(player_type *creature_ptr)
        if (power > randint0(5))
        {
                power -= 5;
-               do_poly_wounds(p_ptr);
+               do_poly_wounds(creature_ptr);
        }
 
        /* Note: earlier deductions may have left power < 0 already. */
        while (power > 0)
        {
-               status_shuffle();
+               status_shuffle(creature_ptr);
                power--;
        }
 }
@@ -3906,33 +3818,32 @@ void do_poly_self(player_type *creature_ptr)
 /*
  * Gain experience
  */
-void gain_exp_64(s32b amount, u32b amount_frac)
+void gain_exp_64(player_type *creature_ptr, s32b amount, u32b amount_frac)
 {
-       if (p_ptr->is_dead) return;
+       if (creature_ptr->is_dead) return;
 
-       if (p_ptr->prace == RACE_ANDROID) return;
+       if (creature_ptr->prace == RACE_ANDROID) return;
 
        /* Gain some experience */
-       s64b_add(&(p_ptr->exp), &(p_ptr->exp_frac), amount, amount_frac);
+       s64b_add(&(creature_ptr->exp), &(creature_ptr->exp_frac), amount, amount_frac);
 
        /* Slowly recover from experience drainage */
-       if (p_ptr->exp < p_ptr->max_exp)
+       if (creature_ptr->exp < creature_ptr->max_exp)
        {
                /* Gain max experience (20%) (was 10%) */
-               p_ptr->max_exp += amount / 5;
+               creature_ptr->max_exp += amount / 5;
        }
 
-       /* Check Experience */
-       check_experience();
+       check_experience(creature_ptr);
 }
 
 
 /*
  * Gain experience
  */
-void gain_exp(s32b amount)
+void gain_exp(player_type *creature_ptr, s32b amount)
 {
-       gain_exp_64(amount, 0L);
+       gain_exp_64(creature_ptr, amount, 0L);
 }
 
 
@@ -4020,32 +3931,26 @@ void calc_android_exp(player_type *creature_ptr)
                        if (value > 100000L)
                                exp += (value - 100000L) / 4  * level;
                }
-               if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
+               if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(creature_ptr, i))) || (i == INVEN_BOW)) total_exp += exp / 48;
                else total_exp += exp / 16;
                if (i == INVEN_BODY) total_exp += exp / 32;
        }
        creature_ptr->exp = creature_ptr->max_exp = total_exp;
-
-       /* Check Experience */
-       check_experience();
+       check_experience(creature_ptr);
 }
 
 
 /*
  * Lose experience
  */
-void lose_exp(s32b amount)
+void lose_exp(player_type *creature_ptr, s32b amount)
 {
-       if (p_ptr->prace == RACE_ANDROID) return;
+       if (creature_ptr->prace == RACE_ANDROID) return;
+       if (amount > creature_ptr->exp) amount = creature_ptr->exp;
 
-       /* Never drop below zero experience */
-       if (amount > p_ptr->exp) amount = p_ptr->exp;
+       creature_ptr->exp -= amount;
 
-       /* Lose some experience */
-       p_ptr->exp -= amount;
-
-       /* Check Experience */
-       check_experience();
+       check_experience(creature_ptr);
 }
 
 
@@ -4053,12 +3958,12 @@ void lose_exp(s32b amount)
  * Drain experience
  * If resisted to draining, return FALSE
  */
-bool drain_exp(s32b drain, s32b slip, int hold_exp_prob)
+bool drain_exp(player_type *creature_ptr, s32b drain, s32b slip, int hold_exp_prob)
 {
        /* Androids and their mimics are never drained */
-       if (p_ptr->prace == RACE_ANDROID) return FALSE;
+       if (creature_ptr->prace == RACE_ANDROID) return FALSE;
 
-       if (p_ptr->hold_exp && (randint0(100) < hold_exp_prob))
+       if (creature_ptr->hold_exp && (randint0(100) < hold_exp_prob))
        {
                /* Hold experience */
                msg_print(_("しかし自己の経験値を守りきった!", "You keep hold of your experience!"));
@@ -4066,46 +3971,44 @@ bool drain_exp(s32b drain, s32b slip, int hold_exp_prob)
        }
 
        /* Hold experience failed */
-       if (p_ptr->hold_exp)
+       if (creature_ptr->hold_exp)
        {
                msg_print(_("経験値を少し吸い取られた気がする!", "You feel your experience slipping away!"));
-               lose_exp(slip);
+               lose_exp(creature_ptr, slip);
        }
        else
        {
                msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away!"));
-               lose_exp(drain);
+               lose_exp(creature_ptr, drain);
        }
 
        return TRUE;
 }
 
 
-bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
+bool set_ultimate_res(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->ult_res && !do_dec)
+               if (creature_ptr->ult_res && !do_dec)
                {
-                       if (p_ptr->ult_res > v) return FALSE;
+                       if (creature_ptr->ult_res > v) return FALSE;
                }
-               else if (!p_ptr->ult_res)
+               else if (!creature_ptr->ult_res)
                {
                        msg_print(_("あらゆることに対して耐性がついた気がする!", "You feel resistant!"));
                        notice = TRUE;
                }
        }
 
-       /* Shut */
        else
        {
-               if (p_ptr->ult_res)
+               if (creature_ptr->ult_res)
                {
                        msg_print(_("あらゆることに対する耐性が薄れた気がする。", "You feel less resistant"));
                        notice = TRUE;
@@ -4113,14 +4016,14 @@ bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->ult_res = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->ult_res = v;
+       creature_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
-       p_ptr->update |= (PU_BONUS);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+       creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
@@ -4132,7 +4035,6 @@ bool set_tim_res_nether(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tim_res_nether && !do_dec)
@@ -4146,7 +4048,6 @@ bool set_tim_res_nether(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->tim_res_nether)
@@ -4163,7 +4064,7 @@ bool set_tim_res_nether(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -4176,7 +4077,6 @@ bool set_tim_res_time(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 
        if (creature_ptr->is_dead) return FALSE;
 
-       /* Open */
        if (v)
        {
                if (creature_ptr->tim_res_time && !do_dec)
@@ -4190,7 +4090,6 @@ bool set_tim_res_time(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                }
        }
 
-       /* Shut */
        else
        {
                if (creature_ptr->tim_res_time)
@@ -4207,7 +4106,7 @@ bool set_tim_res_time(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       if (disturb_state) disturb(FALSE, FALSE);
+       if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
        creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -4223,7 +4122,7 @@ bool choose_ele_attack(player_type *creature_ptr)
 
        char choice;
 
-       if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
+       if (!has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM))
        {
                msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
                return FALSE;