OSDN Git Service

[Refactor] #38997 add_river(), generate_hmap(), generate_fracave() にfloor_type *...
[hengband/hengband.git] / src / core.c
index 416c246..872843d 100644 (file)
@@ -201,7 +201,7 @@ static void sense_inventory_aux(INVENTORY_IDX slot, bool heavy)
        }
 
        /* Stop everything */
-       if (disturb_minor) disturb(FALSE, FALSE);
+       if (disturb_minor) disturb(p_ptr, FALSE, FALSE);
 
        /* Get an object description */
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -263,10 +263,10 @@ static void sense_inventory_aux(INVENTORY_IDX slot, bool heavy)
  *   Class 4 = Ranger  --> slow but heavy  (changed!)\n
  *   Class 5 = Paladin --> slow but heavy\n
  */
-static void sense_inventory1(void)
+static void sense_inventory1(player_type *creature_ptr)
 {
        INVENTORY_IDX i;
-       PLAYER_LEVEL plev = p_ptr->lev;
+       PLAYER_LEVEL plev = creature_ptr->lev;
        bool heavy = FALSE;
        object_type *o_ptr;
 
@@ -274,10 +274,10 @@ static void sense_inventory1(void)
        /*** Check for "sensing" ***/
 
        /* No sensing when confused */
-       if (p_ptr->confused) return;
+       if (creature_ptr->confused) return;
 
        /* Analyze the class */
-       switch (p_ptr->pclass)
+       switch (creature_ptr->pclass)
        {
                case CLASS_WARRIOR:
                case CLASS_ARCHER:
@@ -426,7 +426,7 @@ static void sense_inventory1(void)
                }
        }
 
-       if (compare_virtue(p_ptr, V_KNOWLEDGE, 100, VIRTUE_LARGE)) heavy = TRUE;
+       if (compare_virtue(creature_ptr, V_KNOWLEDGE, 100, VIRTUE_LARGE)) heavy = TRUE;
 
        /*** Sense everything ***/
 
@@ -435,7 +435,7 @@ static void sense_inventory1(void)
        {
                bool okay = FALSE;
 
-               o_ptr = &p_ptr->inventory_list[i];
+               o_ptr = &creature_ptr->inventory_list[i];
 
                /* Skip empty slots */
                if (!o_ptr->k_idx) continue;
@@ -470,11 +470,11 @@ static void sense_inventory1(void)
                /* Skip non-sense machines */
                if (!okay) continue;
 
-               /* Occasional failure on p_ptr->inventory_list items */
+               /* Occasional failure on creature_ptr->inventory_list items */
                if ((i < INVEN_RARM) && (0 != randint0(5))) continue;
 
                /* Good luck */
-               if ((p_ptr->muta3 & MUT3_GOOD_LUCK) && !randint0(13))
+               if ((creature_ptr->muta3 & MUT3_GOOD_LUCK) && !randint0(13))
                {
                        heavy = TRUE;
                }
@@ -487,20 +487,20 @@ static void sense_inventory1(void)
  * @brief 1プレイヤーターン毎に武器、防具以外の擬似鑑定が行われるかを判定する。
  * @return なし
  */
-static void sense_inventory2(void)
+static void sense_inventory2(player_type *creature_ptr)
 {
        INVENTORY_IDX i;
-       PLAYER_LEVEL plev = p_ptr->lev;
+       PLAYER_LEVEL plev = creature_ptr->lev;
        object_type *o_ptr;
 
 
        /*** Check for "sensing" ***/
 
        /* No sensing when confused */
-       if (p_ptr->confused) return;
+       if (creature_ptr->confused) return;
 
        /* Analyze the class */
-       switch (p_ptr->pclass)
+       switch (creature_ptr->pclass)
        {
                case CLASS_WARRIOR:
                case CLASS_ARCHER:
@@ -577,7 +577,7 @@ static void sense_inventory2(void)
        {
                bool okay = FALSE;
 
-               o_ptr = &p_ptr->inventory_list[i];
+               o_ptr = &creature_ptr->inventory_list[i];
 
                /* Skip empty slots */
                if (!o_ptr->k_idx) continue;
@@ -598,7 +598,7 @@ static void sense_inventory2(void)
                /* Skip non-sense machines */
                if (!okay) continue;
 
-               /* Occasional failure on p_ptr->inventory_list items */
+               /* Occasional failure on creature_ptr->inventory_list items */
                if ((i < INVEN_RARM) && (0 != randint0(5))) continue;
 
                sense_inventory_aux(i, TRUE);
@@ -609,7 +609,7 @@ static void sense_inventory2(void)
  * @brief パターン終点到達時のテレポート処理を行う
  * @return なし
  */
-static void pattern_teleport(void)
+static void pattern_teleport(player_type *creature_ptr)
 {
        DEPTH min_level = 0;
        DEPTH max_level = 99;
@@ -622,27 +622,27 @@ static void pattern_teleport(void)
 
                /* Only downward in ironman mode */
                if (ironman_downward)
-                       min_level = current_floor_ptr->dun_level;
+                       min_level = creature_ptr->current_floor_ptr->dun_level;
 
                /* Maximum level */
-               if (p_ptr->dungeon_idx == DUNGEON_ANGBAND)
+               if (creature_ptr->dungeon_idx == DUNGEON_ANGBAND)
                {
-                       if (current_floor_ptr->dun_level > 100)
+                       if (creature_ptr->current_floor_ptr->dun_level > 100)
                                max_level = MAX_DEPTH - 1;
-                       else if (current_floor_ptr->dun_level == 100)
+                       else if (creature_ptr->current_floor_ptr->dun_level == 100)
                                max_level = 100;
                }
                else
                {
-                       max_level = d_info[p_ptr->dungeon_idx].maxdepth;
-                       min_level = d_info[p_ptr->dungeon_idx].mindepth;
+                       max_level = d_info[creature_ptr->dungeon_idx].maxdepth;
+                       min_level = d_info[creature_ptr->dungeon_idx].mindepth;
                }
 
                /* Prompt */
                sprintf(ppp, _("テレポート先:(%d-%d)", "Teleport to level (%d-%d): "), (int)min_level, (int)max_level);
 
                /* Default */
-               sprintf(tmp_val, "%d", (int)current_floor_ptr->dun_level);
+               sprintf(tmp_val, "%d", (int)creature_ptr->current_floor_ptr->dun_level);
 
                /* Ask for a level */
                if (!get_string(ppp, tmp_val, 10)) return;
@@ -668,50 +668,50 @@ static void pattern_teleport(void)
        if (autosave_l) do_cmd_save_game(TRUE);
 
        /* Change level */
-       current_floor_ptr->dun_level = command_arg;
+       creature_ptr->current_floor_ptr->dun_level = command_arg;
 
        leave_quest_check();
 
-       if (record_stair) do_cmd_write_nikki(NIKKI_PAT_TELE, 0, NULL);
+       if (record_stair) exe_write_diary(creature_ptr, NIKKI_PAT_TELE, 0, NULL);
 
-       p_ptr->inside_quest = 0;
-       free_turn(p_ptr);
+       creature_ptr->inside_quest = 0;
+       free_turn(creature_ptr);
 
        /*
         * Clear all saved floors
         * and create a first saved floor
         */
        prepare_change_floor_mode(CFM_FIRST_FLOOR);
-       p_ptr->leaving = TRUE;
+       creature_ptr->leaving = TRUE;
 }
 
 /*!
  * @brief 各種パターン地形上の特別な処理 / Returns TRUE if we are on the Pattern...
  * @return 実際にパターン地形上にプレイヤーが居た場合はTRUEを返す。
  */
-static bool pattern_effect(void)
+static bool pattern_effect(player_type *creature_ptr)
 {
        int pattern_type;
 
-       if (!pattern_tile(p_ptr->y, p_ptr->x)) return FALSE;
+       if (!pattern_tile(creature_ptr->y, creature_ptr->x)) return FALSE;
 
-       if ((PRACE_IS_(p_ptr, RACE_AMBERITE)) &&
-           (p_ptr->cut > 0) && one_in_(10))
+       if ((PRACE_IS_(creature_ptr, RACE_AMBERITE)) &&
+           (creature_ptr->cut > 0) && one_in_(10))
        {
-               wreck_the_pattern(p_ptr);
+               wreck_the_pattern(creature_ptr);
        }
 
-       pattern_type = f_info[current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat].subtype;
+       pattern_type = f_info[p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat].subtype;
 
        switch (pattern_type)
        {
        case PATTERN_TILE_END:
-               (void)set_image(p_ptr, 0);
+               (void)set_image(creature_ptr, 0);
                (void)restore_all_status();
-               (void)restore_level(p_ptr);
-               (void)cure_critical_wounds(1000);
+               (void)restore_level(creature_ptr);
+               (void)cure_critical_wounds(creature_ptr, 1000);
 
-               cave_set_feat(p_ptr->y, p_ptr->x, feat_pattern_old);
+               cave_set_feat(creature_ptr->y, creature_ptr->x, feat_pattern_old);
                msg_print(_("「パターン」のこの部分は他の部分より強力でないようだ。", "This section of the Pattern looks less powerful."));
 
                /*
@@ -727,19 +727,19 @@ static bool pattern_effect(void)
                break;
 
        case PATTERN_TILE_TELEPORT:
-               pattern_teleport();
+               pattern_teleport(creature_ptr);
                break;
 
        case PATTERN_TILE_WRECKED:
                if (!IS_INVULN())
-                       take_hit(p_ptr, DAMAGE_NOESCAPE, 200, _("壊れた「パターン」を歩いたダメージ", "walking the corrupted Pattern"), -1);
+                       take_hit(creature_ptr, DAMAGE_NOESCAPE, 200, _("壊れた「パターン」を歩いたダメージ", "walking the corrupted Pattern"), -1);
                break;
 
        default:
-               if (PRACE_IS_(p_ptr, RACE_AMBERITE) && !one_in_(2))
+               if (PRACE_IS_(creature_ptr, RACE_AMBERITE) && !one_in_(2))
                        return TRUE;
                else if (!IS_INVULN())
-                       take_hit(p_ptr, DAMAGE_NOESCAPE, damroll(1, 3), _("「パターン」を歩いたダメージ", "walking the Pattern"), -1);
+                       take_hit(creature_ptr, DAMAGE_NOESCAPE, damroll(1, 3), _("「パターン」を歩いたダメージ", "walking the Pattern"), -1);
                break;
        }
 
@@ -802,32 +802,32 @@ static void regenhp(int percent)
  * @param regen_amount 回復量
  * @return なし
  */
-static void regenmana(MANA_POINT upkeep_factor, MANA_POINT regen_amount)
+static void regenmana(player_type *creature_ptr, MANA_POINT upkeep_factor, MANA_POINT regen_amount)
 {
-       MANA_POINT old_csp = p_ptr->csp;
+       MANA_POINT old_csp = creature_ptr->csp;
        s32b regen_rate = regen_amount * 100 - upkeep_factor * PY_REGEN_NORMAL;
 
        /*
         * Excess mana will decay 32 times faster than normal
         * regeneration rate.
         */
-       if (p_ptr->csp > p_ptr->msp)
+       if (creature_ptr->csp > creature_ptr->msp)
        {
                /* PY_REGEN_NORMAL is the Regen factor in unit (1/2^16) */
                s32b decay = 0;
-               u32b decay_frac = (p_ptr->msp * 32 * PY_REGEN_NORMAL + PY_REGEN_MNBASE);
+               u32b decay_frac = (creature_ptr->msp * 32 * PY_REGEN_NORMAL + PY_REGEN_MNBASE);
 
                /* Convert the unit (1/2^16) to (1/2^32) */
                s64b_LSHIFT(decay, decay_frac, 16);
 
                /* Decay */
-               s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), decay, decay_frac);
+               s64b_sub(&(creature_ptr->csp), &(creature_ptr->csp_frac), decay, decay_frac);
 
                /* Stop decaying */
-               if (p_ptr->csp < p_ptr->msp)
+               if (creature_ptr->csp < creature_ptr->msp)
                {
-                       p_ptr->csp = p_ptr->msp;
-                       p_ptr->csp_frac = 0;
+                       creature_ptr->csp = creature_ptr->msp;
+                       creature_ptr->csp_frac = 0;
                }
        }
 
@@ -836,19 +836,19 @@ static void regenmana(MANA_POINT upkeep_factor, MANA_POINT regen_amount)
        {
                /* (percent/100) is the Regen factor in unit (1/2^16) */
                MANA_POINT new_mana = 0;
-               u32b new_mana_frac = (p_ptr->msp * regen_rate / 100 + PY_REGEN_MNBASE);
+               u32b new_mana_frac = (creature_ptr->msp * regen_rate / 100 + PY_REGEN_MNBASE);
 
                /* Convert the unit (1/2^16) to (1/2^32) */
                s64b_LSHIFT(new_mana, new_mana_frac, 16);
 
                /* Regenerate */
-               s64b_add(&(p_ptr->csp), &(p_ptr->csp_frac), new_mana, new_mana_frac);
+               s64b_add(&(creature_ptr->csp), &(creature_ptr->csp_frac), new_mana, new_mana_frac);
 
                /* Must set frac to zero even if equal */
-               if (p_ptr->csp >= p_ptr->msp)
+               if (creature_ptr->csp >= creature_ptr->msp)
                {
-                       p_ptr->csp = p_ptr->msp;
-                       p_ptr->csp_frac = 0;
+                       creature_ptr->csp = creature_ptr->msp;
+                       creature_ptr->csp_frac = 0;
                }
        }
 
@@ -858,27 +858,27 @@ static void regenmana(MANA_POINT upkeep_factor, MANA_POINT regen_amount)
        {
                /* PY_REGEN_NORMAL is the Regen factor in unit (1/2^16) */
                s32b reduce_mana = 0;
-               u32b reduce_mana_frac = (p_ptr->msp * (-1) * regen_rate / 100 + PY_REGEN_MNBASE);
+               u32b reduce_mana_frac = (creature_ptr->msp * (-1) * regen_rate / 100 + PY_REGEN_MNBASE);
 
                /* Convert the unit (1/2^16) to (1/2^32) */
                s64b_LSHIFT(reduce_mana, reduce_mana_frac, 16);
 
                /* Reduce mana */
-               s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), reduce_mana, reduce_mana_frac);
+               s64b_sub(&(creature_ptr->csp), &(creature_ptr->csp_frac), reduce_mana, reduce_mana_frac);
 
                /* Check overflow */
-               if (p_ptr->csp < 0)
+               if (creature_ptr->csp < 0)
                {
-                       p_ptr->csp = 0;
-                       p_ptr->csp_frac = 0;
+                       creature_ptr->csp = 0;
+                       creature_ptr->csp_frac = 0;
                }
        }
 
-       if (old_csp != p_ptr->csp)
+       if (old_csp != creature_ptr->csp)
        {
-               p_ptr->redraw |= (PR_MANA);
-               p_ptr->window |= (PW_PLAYER);
-               p_ptr->window |= (PW_SPELL);
+               creature_ptr->redraw |= (PR_MANA);
+               creature_ptr->window |= (PW_PLAYER);
+               creature_ptr->window |= (PW_SPELL);
                wild_regen = 20;
        }
 }
@@ -888,41 +888,41 @@ static void regenmana(MANA_POINT upkeep_factor, MANA_POINT regen_amount)
  * @param regen_amount 回復量
  * @return なし
  */
-static void regenmagic(int regen_amount)
+static void regenmagic(player_type *creature_ptr, int regen_amount)
 {
        MANA_POINT new_mana;
        int i;
        int dev = 30;
-       int mult = (dev + adj_mag_mana[p_ptr->stat_ind[A_INT]]); /* x1 to x2 speed bonus for recharging */
+       int mult = (dev + adj_mag_mana[creature_ptr->stat_ind[A_INT]]); /* x1 to x2 speed bonus for recharging */
 
        for (i = 0; i < EATER_EXT*2; i++)
        {
-               if (!p_ptr->magic_num2[i]) continue;
-               if (p_ptr->magic_num1[i] == ((long)p_ptr->magic_num2[i] << 16)) continue;
+               if (!creature_ptr->magic_num2[i]) continue;
+               if (creature_ptr->magic_num1[i] == ((long)creature_ptr->magic_num2[i] << 16)) continue;
 
                /* Increase remaining charge number like float value */
-               new_mana = (regen_amount * mult * ((long)p_ptr->magic_num2[i] + 13)) / (dev * 8);
-               p_ptr->magic_num1[i] += new_mana;
+               new_mana = (regen_amount * mult * ((long)creature_ptr->magic_num2[i] + 13)) / (dev * 8);
+               creature_ptr->magic_num1[i] += new_mana;
 
                /* Check maximum charge */
-               if (p_ptr->magic_num1[i] > (p_ptr->magic_num2[i] << 16))
+               if (creature_ptr->magic_num1[i] > (creature_ptr->magic_num2[i] << 16))
                {
-                       p_ptr->magic_num1[i] = ((long)p_ptr->magic_num2[i] << 16);
+                       creature_ptr->magic_num1[i] = ((long)creature_ptr->magic_num2[i] << 16);
                }
                wild_regen = 20;
        }
        for (i = EATER_EXT*2; i < EATER_EXT*3; i++)
        {
-               if (!p_ptr->magic_num1[i]) continue;
-               if (!p_ptr->magic_num2[i]) continue;
+               if (!creature_ptr->magic_num1[i]) continue;
+               if (!creature_ptr->magic_num2[i]) continue;
 
                /* Decrease remaining period for charging */
-               new_mana = (regen_amount * mult * ((long)p_ptr->magic_num2[i] + 10) * EATER_ROD_CHARGE) 
+               new_mana = (regen_amount * mult * ((long)creature_ptr->magic_num2[i] + 10) * EATER_ROD_CHARGE) 
                                        / (dev * 16 * PY_REGEN_NORMAL); 
-               p_ptr->magic_num1[i] -= new_mana;
+               creature_ptr->magic_num1[i] -= new_mana;
 
                /* Check minimum remaining period for charging */
-               if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
+               if (creature_ptr->magic_num1[i] < 0) creature_ptr->magic_num1[i] = 0;
                wild_regen = 20;
        }
 }
@@ -939,10 +939,10 @@ static void regen_monsters(void)
 
 
        /* Regenerate everyone */
-       for (i = 1; i < current_floor_ptr->m_max; i++)
+       for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
        {
                /* Check the i'th monster */
-               monster_type *m_ptr = &current_floor_ptr->m_list[i];
+               monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                if (!monster_is_valid(m_ptr)) continue;
@@ -1032,16 +1032,16 @@ static void regen_captured_monsters(void)
  * @param o_ptr 現在光源として使っているオブジェクトの構造体参照ポインタ
  * @return なし
  */
-static void notice_lite_change(object_type *o_ptr)
+static void notice_lite_change(player_type *creature_ptr, object_type *o_ptr)
 {
        /* Hack -- notice interesting fuel steps */
        if ((o_ptr->xtra4 < 100) || (!(o_ptr->xtra4 % 100)))
        {
-               p_ptr->window |= (PW_EQUIP);
+               creature_ptr->window |= (PW_EQUIP);
        }
 
        /* Hack -- Special treatment when blind */
-       if (p_ptr->blind)
+       if (creature_ptr->blind)
        {
                /* Hack -- save some light for later */
                if (o_ptr->xtra4 == 0) o_ptr->xtra4++;
@@ -1050,14 +1050,14 @@ static void notice_lite_change(object_type *o_ptr)
        /* The light is now out */
        else if (o_ptr->xtra4 == 0)
        {
-               disturb(FALSE, TRUE);
+               disturb(creature_ptr, FALSE, TRUE);
                msg_print(_("明かりが消えてしまった!", "Your light has gone out!"));
 
                /* Recalculate torch radius */
-               p_ptr->update |= (PU_TORCH);
+               creature_ptr->update |= (PU_TORCH);
 
                /* Some ego light lose its effects without fuel */
-               p_ptr->update |= (PU_BONUS);
+               creature_ptr->update |= (PU_BONUS);
        }
 
        /* The light is getting dim */
@@ -1066,7 +1066,7 @@ static void notice_lite_change(object_type *o_ptr)
                if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5))
                    && (current_world_ptr->game_turn % (TURNS_PER_TICK*2)))
                {
-                       if (disturb_minor) disturb(FALSE, TRUE);
+                       if (disturb_minor) disturb(creature_ptr, FALSE, TRUE);
                        msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));
                }
        }
@@ -1074,7 +1074,7 @@ static void notice_lite_change(object_type *o_ptr)
        /* The light is getting dim */
        else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10)))
        {
-               if (disturb_minor) disturb(FALSE, TRUE);
+               if (disturb_minor) disturb(creature_ptr, FALSE, TRUE);
                        msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));
        }
 }
@@ -1116,7 +1116,7 @@ static void recharged_notice(object_type *o_ptr)
                                msg_format("Your %s is recharged.", o_name);
 #endif
 
-                       disturb(FALSE, FALSE);
+                       disturb(p_ptr, FALSE, FALSE);
 
                        /* Done. */
                        return;
@@ -1131,7 +1131,7 @@ static void recharged_notice(object_type *o_ptr)
  * @brief プレイヤーの歌に関する継続処理
  * @return なし
  */
-static void check_music(void)
+static void check_music(player_type *creature_ptr)
 {
        const magic_type *s_ptr;
        int spell;
@@ -1139,16 +1139,16 @@ static void check_music(void)
        u32b need_mana_frac;
 
        /* Music singed by player */
-       if (p_ptr->pclass != CLASS_BARD) return;
-       if (!SINGING_SONG_EFFECT(p_ptr) && !INTERUPTING_SONG_EFFECT(p_ptr)) return;
+       if (creature_ptr->pclass != CLASS_BARD) return;
+       if (!SINGING_SONG_EFFECT(creature_ptr) && !INTERUPTING_SONG_EFFECT(creature_ptr)) return;
 
-       if (p_ptr->anti_magic)
+       if (creature_ptr->anti_magic)
        {
-               stop_singing(p_ptr);
+               stop_singing(creature_ptr);
                return;
        }
 
-       spell = SINGING_SONG_ID(p_ptr);
+       spell = SINGING_SONG_ID(creature_ptr);
        s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC][spell];
 
        need_mana = mod_need_mana(s_ptr->smana, spell, REALM_MUSIC);
@@ -1157,38 +1157,38 @@ static void check_music(void)
        /* Divide by 2 */
        s64b_RSHIFT(need_mana, need_mana_frac, 1);
 
-       if (s64b_cmp(p_ptr->csp, p_ptr->csp_frac, need_mana, need_mana_frac) < 0)
+       if (s64b_cmp(creature_ptr->csp, creature_ptr->csp_frac, need_mana, need_mana_frac) < 0)
        {
-               stop_singing(p_ptr);
+               stop_singing(creature_ptr);
                return;
        }
        else
        {
-               s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), need_mana, need_mana_frac);
+               s64b_sub(&(creature_ptr->csp), &(creature_ptr->csp_frac), need_mana, need_mana_frac);
 
-               p_ptr->redraw |= PR_MANA;
-               if (INTERUPTING_SONG_EFFECT(p_ptr))
+               creature_ptr->redraw |= PR_MANA;
+               if (INTERUPTING_SONG_EFFECT(creature_ptr))
                {
-                       SINGING_SONG_EFFECT(p_ptr) = INTERUPTING_SONG_EFFECT(p_ptr);
-                       INTERUPTING_SONG_EFFECT(p_ptr) = MUSIC_NONE;
+                       SINGING_SONG_EFFECT(creature_ptr) = INTERUPTING_SONG_EFFECT(creature_ptr);
+                       INTERUPTING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
                        msg_print(_("歌を再開した。", "You restart singing."));
-                       p_ptr->action = ACTION_SING;
-                       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);
+                       creature_ptr->action = ACTION_SING;
+                       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);
                }
        }
-       if (p_ptr->spell_exp[spell] < SPELL_EXP_BEGINNER)
-               p_ptr->spell_exp[spell] += 5;
-       else if(p_ptr->spell_exp[spell] < SPELL_EXP_SKILLED)
-       { if (one_in_(2) && (current_floor_ptr->dun_level > 4) && ((current_floor_ptr->dun_level + 10) > p_ptr->lev)) p_ptr->spell_exp[spell] += 1; }
-       else if(p_ptr->spell_exp[spell] < SPELL_EXP_EXPERT)
-       { if (one_in_(5) && ((current_floor_ptr->dun_level + 5) > p_ptr->lev) && ((current_floor_ptr->dun_level + 5) > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
-       else if(p_ptr->spell_exp[spell] < SPELL_EXP_MASTER)
-       { if (one_in_(5) && ((current_floor_ptr->dun_level + 5) > p_ptr->lev) && (current_floor_ptr->dun_level > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
+       if (creature_ptr->spell_exp[spell] < SPELL_EXP_BEGINNER)
+               creature_ptr->spell_exp[spell] += 5;
+       else if(creature_ptr->spell_exp[spell] < SPELL_EXP_SKILLED)
+       { if (one_in_(2) && (p_ptr->current_floor_ptr->dun_level > 4) && ((p_ptr->current_floor_ptr->dun_level + 10) > creature_ptr->lev)) creature_ptr->spell_exp[spell] += 1; }
+       else if(creature_ptr->spell_exp[spell] < SPELL_EXP_EXPERT)
+       { if (one_in_(5) && ((p_ptr->current_floor_ptr->dun_level + 5) > creature_ptr->lev) && ((p_ptr->current_floor_ptr->dun_level + 5) > s_ptr->slevel)) creature_ptr->spell_exp[spell] += 1; }
+       else if(creature_ptr->spell_exp[spell] < SPELL_EXP_MASTER)
+       { if (one_in_(5) && ((p_ptr->current_floor_ptr->dun_level + 5) > creature_ptr->lev) && (p_ptr->current_floor_ptr->dun_level > s_ptr->slevel)) creature_ptr->spell_exp[spell] += 1; }
 
        /* Do any effects of continual song */
-       do_spell(REALM_MUSIC, spell, SPELL_CONT);
+       exe_spell(creature_ptr, REALM_MUSIC, spell, SPELL_CONT);
 }
 
 /*!
@@ -1264,33 +1264,33 @@ static object_type *choose_cursed_obj_name(BIT_FLAGS flag)
        return (&p_ptr->inventory_list[choices[randint0(number)]]);
 }
 
-static void process_world_aux_digestion(void)
+static void process_world_aux_digestion(player_type *creature_ptr)
 {
-       if (!p_ptr->phase_out)
+       if (!creature_ptr->phase_out)
        {
                /* Digest quickly when gorged */
-               if (p_ptr->food >= PY_FOOD_MAX)
+               if (creature_ptr->food >= PY_FOOD_MAX)
                {
                        /* Digest a lot of food */
-                       (void)set_food(p_ptr, p_ptr->food - 100);
+                       (void)set_food(creature_ptr, creature_ptr->food - 100);
                }
 
                /* Digest normally -- Every 50 game turns */
                else if (!(current_world_ptr->game_turn % (TURNS_PER_TICK * 5)))
                {
                        /* Basic digestion rate based on speed */
-                       int digestion = SPEED_TO_ENERGY(p_ptr->pspeed);
+                       int digestion = SPEED_TO_ENERGY(creature_ptr->pspeed);
 
                        /* Regeneration takes more food */
-                       if (p_ptr->regenerate)
+                       if (creature_ptr->regenerate)
                                digestion += 20;
-                       if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
+                       if (creature_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
                                digestion += 20;
-                       if (p_ptr->cursed & TRC_FAST_DIGEST)
+                       if (creature_ptr->cursed & TRC_FAST_DIGEST)
                                digestion += 30;
 
                        /* Slow digestion takes less food */
-                       if (p_ptr->slow_digest)
+                       if (creature_ptr->slow_digest)
                                digestion -= 5;
 
                        /* Minimal digestion */
@@ -1299,30 +1299,30 @@ static void process_world_aux_digestion(void)
                        if (digestion > 100) digestion = 100;
 
                        /* Digest some food */
-                       (void)set_food(p_ptr, p_ptr->food - digestion);
+                       (void)set_food(creature_ptr, creature_ptr->food - digestion);
                }
 
 
                /* Getting Faint */
-               if ((p_ptr->food < PY_FOOD_FAINT))
+               if ((creature_ptr->food < PY_FOOD_FAINT))
                {
                        /* Faint occasionally */
-                       if (!p_ptr->paralyzed && (randint0(100) < 10))
+                       if (!creature_ptr->paralyzed && (randint0(100) < 10))
                        {
                                msg_print(_("あまりにも空腹で気絶してしまった。", "You faint from the lack of food."));
-                               disturb(TRUE, TRUE);
+                               disturb(creature_ptr, TRUE, TRUE);
 
                                /* Hack -- faint (bypass free action) */
-                               (void)set_paralyzed(p_ptr, p_ptr->paralyzed + 1 + randint0(5));
+                               (void)set_paralyzed(creature_ptr, creature_ptr->paralyzed + 1 + randint0(5));
                        }
 
                        /* Starve to death (slowly) */
-                       if (p_ptr->food < PY_FOOD_STARVE)
+                       if (creature_ptr->food < PY_FOOD_STARVE)
                        {
                                /* Calculate damage */
-                               HIT_POINT dam = (PY_FOOD_STARVE - p_ptr->food) / 10;
+                               HIT_POINT dam = (PY_FOOD_STARVE - creature_ptr->food) / 10;
 
-                               if (!IS_INVULN()) take_hit(p_ptr, DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1);
+                               if (!IS_INVULN()) take_hit(creature_ptr, DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1);
                        }
                }
        }
@@ -1333,9 +1333,9 @@ static void process_world_aux_digestion(void)
  *  / Handle timed damage and regeneration every 10 game turns
  * @return なし
  */
-static void process_world_aux_hp_and_sp(void)
+static void process_world_aux_hp_and_sp(player_type *creature_ptr)
 {
-       feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat];
+       feature_type *f_ptr = &f_info[creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat];
        bool cave_no_regen = FALSE;
        int upkeep_factor = 0;
 
@@ -1346,44 +1346,44 @@ static void process_world_aux_hp_and_sp(void)
        /*** Damage over Time ***/
 
        /* Take damage from poison */
-       if (p_ptr->poisoned && !IS_INVULN())
+       if (creature_ptr->poisoned && !IS_INVULN())
        {
-               take_hit(p_ptr, DAMAGE_NOESCAPE, 1, _("毒", "poison"), -1);
+               take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, _("毒", "poison"), -1);
        }
 
        /* Take damage from cuts */
-       if (p_ptr->cut && !IS_INVULN())
+       if (creature_ptr->cut && !IS_INVULN())
        {
                HIT_POINT dam;
 
                /* Mortal wound or Deep Gash */
-               if (p_ptr->cut > 1000)
+               if (creature_ptr->cut > 1000)
                {
                        dam = 200;
                }
 
-               else if (p_ptr->cut > 200)
+               else if (creature_ptr->cut > 200)
                {
                        dam = 80;
                }
 
                /* Severe cut */
-               else if (p_ptr->cut > 100)
+               else if (creature_ptr->cut > 100)
                {
                        dam = 32;
                }
 
-               else if (p_ptr->cut > 50)
+               else if (creature_ptr->cut > 50)
                {
                        dam = 16;
                }
 
-               else if (p_ptr->cut > 25)
+               else if (creature_ptr->cut > 25)
                {
                        dam = 7;
                }
 
-               else if (p_ptr->cut > 10)
+               else if (creature_ptr->cut > 10)
                {
                        dam = 3;
                }
@@ -1394,26 +1394,26 @@ static void process_world_aux_hp_and_sp(void)
                        dam = 1;
                }
 
-               take_hit(p_ptr, DAMAGE_NOESCAPE, dam, _("致命傷", "a fatal wound"), -1);
+               take_hit(creature_ptr, DAMAGE_NOESCAPE, dam, _("致命傷", "a fatal wound"), -1);
        }
 
        /* (Vampires) Take damage from sunlight */
-       if (PRACE_IS_(p_ptr, RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
+       if (PRACE_IS_(creature_ptr, RACE_VAMPIRE) || (creature_ptr->mimic_form == MIMIC_VAMPIRE))
        {
-               if (!current_floor_ptr->dun_level && !p_ptr->resist_lite && !IS_INVULN() && is_daytime())
+               if (!creature_ptr->current_floor_ptr->dun_level && !creature_ptr->resist_lite && !IS_INVULN() && is_daytime())
                {
-                       if ((current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
+                       if ((creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
                        {
                                msg_print(_("日光があなたのアンデッドの肉体を焼き焦がした!", "The sun's rays scorch your undead flesh!"));
-                               take_hit(p_ptr, DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1);
+                               take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1);
                                cave_no_regen = TRUE;
                        }
                }
 
-               if (p_ptr->inventory_list[INVEN_LITE].tval && (p_ptr->inventory_list[INVEN_LITE].name2 != EGO_LITE_DARKNESS) &&
-                   !p_ptr->resist_lite)
+               if (creature_ptr->inventory_list[INVEN_LITE].tval && (creature_ptr->inventory_list[INVEN_LITE].name2 != EGO_LITE_DARKNESS) &&
+                   !creature_ptr->resist_lite)
                {
-                       object_type * o_ptr = &p_ptr->inventory_list[INVEN_LITE];
+                       object_type * o_ptr = &creature_ptr->inventory_list[INVEN_LITE];
                        GAME_TEXT o_name [MAX_NLEN];
                        char ouch [MAX_NLEN+40];
 
@@ -1427,11 +1427,11 @@ static void process_world_aux_hp_and_sp(void)
                        object_desc(o_name, o_ptr, OD_NAME_ONLY);
                        sprintf(ouch, _("%sを装備したダメージ", "wielding %s"), o_name);
 
-                       if (!IS_INVULN()) take_hit(p_ptr, DAMAGE_NOESCAPE, 1, ouch, -1);
+                       if (!IS_INVULN()) take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, ouch, -1);
                }
        }
 
-       if (have_flag(f_ptr->flags, FF_LAVA) && !IS_INVULN() && !p_ptr->immune_fire)
+       if (have_flag(f_ptr->flags, FF_LAVA) && !IS_INVULN() && !creature_ptr->immune_fire)
        {
                int damage = 0;
 
@@ -1439,38 +1439,38 @@ static void process_world_aux_hp_and_sp(void)
                {
                        damage = 6000 + randint0(4000);
                }
-               else if (!p_ptr->levitation)
+               else if (!creature_ptr->levitation)
                {
                        damage = 3000 + randint0(2000);
                }
 
                if (damage)
                {
-                       if(PRACE_IS_(p_ptr, RACE_ENT)) damage += damage / 3;
-                       if(p_ptr->resist_fire) damage = damage / 3;
+                       if(PRACE_IS_(creature_ptr, RACE_ENT)) damage += damage / 3;
+                       if(creature_ptr->resist_fire) damage = damage / 3;
                        if(IS_OPPOSE_FIRE()) damage = damage / 3;
-                       if(p_ptr->levitation) damage = damage / 5;
+                       if(creature_ptr->levitation) damage = damage / 5;
 
                        damage = damage / 100 + (randint0(100) < (damage % 100));
 
-                       if (p_ptr->levitation)
+                       if (creature_ptr->levitation)
                        {
                                msg_print(_("熱で火傷した!", "The heat burns you!"));
-                               take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), 
-                                                               f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1);
+                               take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), 
+                                                               f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
                        }
                        else
                        {
-                               concptr name = f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name;
+                               concptr name = f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
                                msg_format(_("%sで火傷した!", "The %s burns you!"), name);
-                               take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1);
+                               take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
                        }
 
                        cave_no_regen = TRUE;
                }
        }
 
-       if (have_flag(f_ptr->flags, FF_COLD_PUDDLE) && !IS_INVULN() && !p_ptr->immune_cold)
+       if (have_flag(f_ptr->flags, FF_COLD_PUDDLE) && !IS_INVULN() && !creature_ptr->immune_cold)
        {
                int damage = 0;
 
@@ -1478,37 +1478,37 @@ static void process_world_aux_hp_and_sp(void)
                {
                        damage = 6000 + randint0(4000);
                }
-               else if (!p_ptr->levitation)
+               else if (!creature_ptr->levitation)
                {
                        damage = 3000 + randint0(2000);
                }
 
                if (damage)
                {
-                       if (p_ptr->resist_cold) damage = damage / 3;
+                       if (creature_ptr->resist_cold) damage = damage / 3;
                        if (IS_OPPOSE_COLD()) damage = damage / 3;
-                       if (p_ptr->levitation) damage = damage / 5;
+                       if (creature_ptr->levitation) damage = damage / 5;
 
                        damage = damage / 100 + (randint0(100) < (damage % 100));
 
-                       if (p_ptr->levitation)
+                       if (creature_ptr->levitation)
                        {
                                msg_print(_("冷気に覆われた!", "The cold engulfs you!"));
-                               take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
-                                       f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1);
+                               take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
+                                       f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
                        }
                        else
                        {
-                               concptr name = f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name;
+                               concptr name = f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
                                msg_format(_("%sに凍えた!", "The %s frostbites you!"), name);
-                               take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1);
+                               take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
                        }
 
                        cave_no_regen = TRUE;
                }
        }
 
-       if (have_flag(f_ptr->flags, FF_ELEC_PUDDLE) && !IS_INVULN() && !p_ptr->immune_elec)
+       if (have_flag(f_ptr->flags, FF_ELEC_PUDDLE) && !IS_INVULN() && !creature_ptr->immune_elec)
        {
                int damage = 0;
 
@@ -1516,37 +1516,37 @@ static void process_world_aux_hp_and_sp(void)
                {
                        damage = 6000 + randint0(4000);
                }
-               else if (!p_ptr->levitation)
+               else if (!creature_ptr->levitation)
                {
                        damage = 3000 + randint0(2000);
                }
 
                if (damage)
                {
-                       if (p_ptr->resist_elec) damage = damage / 3;
+                       if (creature_ptr->resist_elec) damage = damage / 3;
                        if (IS_OPPOSE_ELEC()) damage = damage / 3;
-                       if (p_ptr->levitation) damage = damage / 5;
+                       if (creature_ptr->levitation) damage = damage / 5;
 
                        damage = damage / 100 + (randint0(100) < (damage % 100));
 
-                       if (p_ptr->levitation)
+                       if (creature_ptr->levitation)
                        {
                                msg_print(_("電撃を受けた!", "The electric shocks you!"));
-                               take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
-                                       f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1);
+                               take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
+                                       f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
                        }
                        else
                        {
-                               concptr name = f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name;
+                               concptr name = f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
                                msg_format(_("%sに感電した!", "The %s shocks you!"), name);
-                               take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1);
+                               take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
                        }
 
                        cave_no_regen = TRUE;
                }
        }
 
-       if (have_flag(f_ptr->flags, FF_ACID_PUDDLE) && !IS_INVULN() && !p_ptr->immune_acid)
+       if (have_flag(f_ptr->flags, FF_ACID_PUDDLE) && !IS_INVULN() && !creature_ptr->immune_acid)
        {
                int damage = 0;
 
@@ -1554,30 +1554,30 @@ static void process_world_aux_hp_and_sp(void)
                {
                        damage = 6000 + randint0(4000);
                }
-               else if (!p_ptr->levitation)
+               else if (!creature_ptr->levitation)
                {
                        damage = 3000 + randint0(2000);
                }
 
                if (damage)
                {
-                       if (p_ptr->resist_acid) damage = damage / 3;
+                       if (creature_ptr->resist_acid) damage = damage / 3;
                        if (IS_OPPOSE_ACID()) damage = damage / 3;
-                       if (p_ptr->levitation) damage = damage / 5;
+                       if (creature_ptr->levitation) damage = damage / 5;
 
                        damage = damage / 100 + (randint0(100) < (damage % 100));
 
-                       if (p_ptr->levitation)
+                       if (creature_ptr->levitation)
                        {
                                msg_print(_("酸が飛び散った!", "The acid melt you!"));
-                               take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
-                                       f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1);
+                               take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
+                                       f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
                        }
                        else
                        {
-                               concptr name = f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name;
+                               concptr name = f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
                                msg_format(_("%sに溶かされた!", "The %s melts you!"), name);
-                               take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1);
+                               take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
                        }
 
                        cave_no_regen = TRUE;
@@ -1592,32 +1592,32 @@ static void process_world_aux_hp_and_sp(void)
                {
                        damage = 6000 + randint0(4000);
                }
-               else if (!p_ptr->levitation)
+               else if (!creature_ptr->levitation)
                {
                        damage = 3000 + randint0(2000);
                }
 
                if (damage)
                {
-                       if (p_ptr->resist_pois) damage = damage / 3;
+                       if (creature_ptr->resist_pois) damage = damage / 3;
                        if (IS_OPPOSE_POIS()) damage = damage / 3;
-                       if (p_ptr->levitation) damage = damage / 5;
+                       if (creature_ptr->levitation) damage = damage / 5;
 
                        damage = damage / 100 + (randint0(100) < (damage % 100));
 
-                       if (p_ptr->levitation)
+                       if (creature_ptr->levitation)
                        {
                                msg_print(_("毒気を吸い込んだ!", "The gas poisons you!"));
-                               take_hit(p_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
-                                       f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name), -1);
-                               if (p_ptr->resist_pois) (void)set_poisoned(p_ptr, p_ptr->poisoned + 1);
+                               take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
+                                       f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+                               if (creature_ptr->resist_pois) (void)set_poisoned(creature_ptr, creature_ptr->poisoned + 1);
                        }
                        else
                        {
-                               concptr name = f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])].name;
+                               concptr name = f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
                                msg_format(_("%sに毒された!", "The %s poisons you!"), name);
-                               take_hit(p_ptr, DAMAGE_NOESCAPE, damage, name, -1);
-                               if (p_ptr->resist_pois) (void)set_poisoned(p_ptr, p_ptr->poisoned + 3);
+                               take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
+                               if (creature_ptr->resist_pois) (void)set_poisoned(creature_ptr, creature_ptr->poisoned + 3);
                        }
 
                        cave_no_regen = TRUE;
@@ -1625,44 +1625,44 @@ static void process_world_aux_hp_and_sp(void)
        }
 
        if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) &&
-           !p_ptr->levitation && !p_ptr->can_swim && !p_ptr->resist_water)
+           !creature_ptr->levitation && !creature_ptr->can_swim && !creature_ptr->resist_water)
        {
-               if (p_ptr->total_weight > weight_limit(p_ptr))
+               if (creature_ptr->total_weight > weight_limit(creature_ptr))
                {
                        msg_print(_("溺れている!", "You are drowning!"));
-                       take_hit(p_ptr, DAMAGE_NOESCAPE, randint1(p_ptr->lev), _("溺れ", "drowning"), -1);
+                       take_hit(creature_ptr, DAMAGE_NOESCAPE, randint1(creature_ptr->lev), _("溺れ", "drowning"), -1);
                        cave_no_regen = TRUE;
                }
        }
 
-       if (p_ptr->riding)
+       if (creature_ptr->riding)
        {
                HIT_POINT damage;
-               if ((r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !p_ptr->immune_fire)
+               if ((r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !creature_ptr->immune_fire)
                {
-                       damage = r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].level / 2;
-                       if (PRACE_IS_(p_ptr, RACE_ENT)) damage += damage / 3;
-                       if (p_ptr->resist_fire) damage = damage / 3;
+                       damage = r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
+                       if (PRACE_IS_(creature_ptr, RACE_ENT)) damage += damage / 3;
+                       if (creature_ptr->resist_fire) damage = damage / 3;
                        if (IS_OPPOSE_FIRE()) damage = damage / 3;
                        msg_print(_("熱い!", "It's hot!"));
-                       take_hit(p_ptr, DAMAGE_NOESCAPE, damage, _("炎のオーラ", "Fire aura"), -1);
+                       take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, _("炎のオーラ", "Fire aura"), -1);
                }
-               if ((r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !p_ptr->immune_elec)
+               if ((r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !creature_ptr->immune_elec)
                {
-                       damage = r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].level / 2;
-                       if (PRACE_IS_(p_ptr, RACE_ANDROID)) damage += damage / 3;
-                       if (p_ptr->resist_elec) damage = damage / 3;
+                       damage = r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
+                       if (PRACE_IS_(creature_ptr, RACE_ANDROID)) damage += damage / 3;
+                       if (creature_ptr->resist_elec) damage = damage / 3;
                        if (IS_OPPOSE_ELEC()) damage = damage / 3;
                        msg_print(_("痛い!", "It hurts!"));
-                       take_hit(p_ptr, DAMAGE_NOESCAPE, damage, _("電気のオーラ", "Elec aura"), -1);
+                       take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, _("電気のオーラ", "Elec aura"), -1);
                }
-               if ((r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !p_ptr->immune_cold)
+               if ((r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !creature_ptr->immune_cold)
                {
-                       damage = r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].level / 2;
-                       if (p_ptr->resist_cold) damage = damage / 3;
+                       damage = r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
+                       if (creature_ptr->resist_cold) damage = damage / 3;
                        if (IS_OPPOSE_COLD()) damage = damage / 3;
                        msg_print(_("冷たい!", "It's cold!"));
-                       take_hit(p_ptr, DAMAGE_NOESCAPE, damage, _("冷気のオーラ", "Cold aura"), -1);
+                       take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, _("冷気のオーラ", "Cold aura"), -1);
                }
        }
 
@@ -1675,12 +1675,12 @@ static void process_world_aux_hp_and_sp(void)
         */
        if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY))
        {
-               if (!IS_INVULN() && !p_ptr->wraith_form && !p_ptr->kabenuke && ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
+               if (!IS_INVULN() && !creature_ptr->wraith_form && !creature_ptr->kabenuke && ((creature_ptr->chp > (creature_ptr->lev / 5)) || !creature_ptr->pass_wall))
                {
                        concptr dam_desc;
                        cave_no_regen = TRUE;
 
-                       if (p_ptr->pass_wall)
+                       if (creature_ptr->pass_wall)
                        {
                                msg_print(_("体の分子が分解した気がする!", "Your molecules feel disrupted!"));
                                dam_desc = _("密度", "density");
@@ -1691,7 +1691,7 @@ static void process_world_aux_hp_and_sp(void)
                                dam_desc = _("硬い岩", "solid rock");
                        }
 
-                       take_hit(p_ptr, DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1);
+                       take_hit(creature_ptr, DAMAGE_NOESCAPE, 1 + (creature_ptr->lev / 5), dam_desc, -1);
                }
        }
 
@@ -1699,14 +1699,14 @@ static void process_world_aux_hp_and_sp(void)
        /*** handle regeneration ***/
 
        /* Getting Weak */
-       if (p_ptr->food < PY_FOOD_WEAK)
+       if (creature_ptr->food < PY_FOOD_WEAK)
        {
                /* Lower regeneration */
-               if (p_ptr->food < PY_FOOD_STARVE)
+               if (creature_ptr->food < PY_FOOD_STARVE)
                {
                        regen_amount = 0;
                }
-               else if (p_ptr->food < PY_FOOD_FAINT)
+               else if (creature_ptr->food < PY_FOOD_FAINT)
                {
                        regen_amount = PY_REGEN_FAINT;
                }
@@ -1717,22 +1717,22 @@ static void process_world_aux_hp_and_sp(void)
        }
 
        /* Are we walking the pattern? */
-       if (pattern_effect())
+       if (pattern_effect(creature_ptr))
        {
                cave_no_regen = TRUE;
        }
        else
        {
                /* Regeneration ability */
-               if (p_ptr->regenerate)
+               if (creature_ptr->regenerate)
                {
                        regen_amount = regen_amount * 2;
                }
-               if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
+               if (creature_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
                {
                        regen_amount /= 2;
                }
-               if (p_ptr->cursed & TRC_SLOW_REGEN)
+               if (creature_ptr->cursed & TRC_SLOW_REGEN)
                {
                        regen_amount /= 5;
                }
@@ -1740,40 +1740,40 @@ static void process_world_aux_hp_and_sp(void)
 
 
        /* Searching or Resting */
-       if ((p_ptr->action == ACTION_SEARCH) || (p_ptr->action == ACTION_REST))
+       if ((creature_ptr->action == ACTION_SEARCH) || (creature_ptr->action == ACTION_REST))
        {
                regen_amount = regen_amount * 2;
        }
 
-       upkeep_factor = calculate_upkeep();
+       upkeep_factor = calculate_upkeep(creature_ptr);
 
        /* No regeneration while special action */
-       if ((p_ptr->action == ACTION_LEARN) ||
-           (p_ptr->action == ACTION_HAYAGAKE) ||
-           (p_ptr->special_defense & KATA_KOUKIJIN))
+       if ((creature_ptr->action == ACTION_LEARN) ||
+           (creature_ptr->action == ACTION_HAYAGAKE) ||
+           (creature_ptr->special_defense & KATA_KOUKIJIN))
        {
                upkeep_factor += 100;
        }
 
        /* Regenerate the mana */
-       regenmana(upkeep_factor, regen_amount);
+       regenmana(creature_ptr, upkeep_factor, regen_amount);
 
 
        /* Recharge magic eater's power */
-       if (p_ptr->pclass == CLASS_MAGIC_EATER)
+       if (creature_ptr->pclass == CLASS_MAGIC_EATER)
        {
-               regenmagic(regen_amount);
+               regenmagic(creature_ptr, regen_amount);
        }
 
-       if ((p_ptr->csp == 0) && (p_ptr->csp_frac == 0))
+       if ((creature_ptr->csp == 0) && (creature_ptr->csp_frac == 0))
        {
                while (upkeep_factor > 100)
                {
                        msg_print(_("こんなに多くのペットを制御できない!", "Too many pets to control at once!"));
                        msg_print(NULL);
-                       do_cmd_pet_dismiss();
+                       do_cmd_pet_dismiss(creature_ptr);
 
-                       upkeep_factor = calculate_upkeep();
+                       upkeep_factor = calculate_upkeep(creature_ptr);
 
                        msg_format(_("維持MPは %d%%", "Upkeep: %d%% mana."), upkeep_factor);
                        msg_print(NULL);
@@ -1781,16 +1781,16 @@ static void process_world_aux_hp_and_sp(void)
        }
 
        /* Poisoned or cut yields no healing */
-       if (p_ptr->poisoned) regen_amount = 0;
-       if (p_ptr->cut) regen_amount = 0;
+       if (creature_ptr->poisoned) regen_amount = 0;
+       if (creature_ptr->cut) regen_amount = 0;
 
        /* Special floor -- Pattern, in a wall -- yields no healing */
        if (cave_no_regen) regen_amount = 0;
 
-       regen_amount = (regen_amount * p_ptr->mutant_regenerate_mod) / 100;
+       regen_amount = (regen_amount * creature_ptr->mutant_regenerate_mod) / 100;
 
        /* Regenerate Hit Points if needed */
-       if ((p_ptr->chp < p_ptr->mhp) && !cave_no_regen)
+       if ((creature_ptr->chp < creature_ptr->mhp) && !cave_no_regen)
        {
                regenhp(regen_amount);
        }
@@ -1801,310 +1801,310 @@ static void process_world_aux_hp_and_sp(void)
  * / Handle timeout every 10 game turns
  * @return なし
  */
-static void process_world_aux_timeout(void)
+static void process_world_aux_timeout(player_type *creature_ptr)
 {
        const int dec_count = (easy_band ? 2 : 1);
 
        /*** Timeout Various Things ***/
 
        /* Mimic */
-       if (p_ptr->tim_mimic)
+       if (creature_ptr->tim_mimic)
        {
-               (void)set_mimic(p_ptr, p_ptr->tim_mimic - 1, p_ptr->mimic_form, TRUE);
+               (void)set_mimic(creature_ptr, creature_ptr->tim_mimic - 1, creature_ptr->mimic_form, TRUE);
        }
 
        /* Hack -- Hallucinating */
-       if (p_ptr->image)
+       if (creature_ptr->image)
        {
-               (void)set_image(p_ptr, p_ptr->image - dec_count);
+               (void)set_image(creature_ptr, creature_ptr->image - dec_count);
        }
 
        /* Blindness */
-       if (p_ptr->blind)
+       if (creature_ptr->blind)
        {
-               (void)set_blind(p_ptr, p_ptr->blind - dec_count);
+               (void)set_blind(creature_ptr, creature_ptr->blind - dec_count);
        }
 
        /* Times see-invisible */
-       if (p_ptr->tim_invis)
+       if (creature_ptr->tim_invis)
        {
-               (void)set_tim_invis(p_ptr, p_ptr->tim_invis - 1, TRUE);
+               (void)set_tim_invis(creature_ptr, creature_ptr->tim_invis - 1, TRUE);
        }
 
-       if (p_ptr->suppress_multi_reward)
+       if (creature_ptr->suppress_multi_reward)
        {
-               p_ptr->suppress_multi_reward = FALSE;
+               creature_ptr->suppress_multi_reward = FALSE;
        }
 
        /* Timed esp */
-       if (p_ptr->tim_esp)
+       if (creature_ptr->tim_esp)
        {
-               (void)set_tim_esp(p_ptr, p_ptr->tim_esp - 1, TRUE);
+               (void)set_tim_esp(creature_ptr, creature_ptr->tim_esp - 1, TRUE);
        }
 
        /* Timed temporary elemental brands. -LM- */
-       if (p_ptr->ele_attack)
+       if (creature_ptr->ele_attack)
        {
-               p_ptr->ele_attack--;
+               creature_ptr->ele_attack--;
 
                /* Clear all temporary elemental brands. */
-               if (!p_ptr->ele_attack) set_ele_attack(p_ptr, 0, 0);
+               if (!creature_ptr->ele_attack) set_ele_attack(creature_ptr, 0, 0);
        }
 
        /* Timed temporary elemental immune. -LM- */
-       if (p_ptr->ele_immune)
+       if (creature_ptr->ele_immune)
        {
-               p_ptr->ele_immune--;
+               creature_ptr->ele_immune--;
 
                /* Clear all temporary elemental brands. */
-               if (!p_ptr->ele_immune) set_ele_immune(p_ptr, 0, 0);
+               if (!creature_ptr->ele_immune) set_ele_immune(creature_ptr, 0, 0);
        }
 
        /* Timed infra-vision */
-       if (p_ptr->tim_infra)
+       if (creature_ptr->tim_infra)
        {
-               (void)set_tim_infra(p_ptr, p_ptr->tim_infra - 1, TRUE);
+               (void)set_tim_infra(creature_ptr, creature_ptr->tim_infra - 1, TRUE);
        }
 
        /* Timed stealth */
-       if (p_ptr->tim_stealth)
+       if (creature_ptr->tim_stealth)
        {
-               (void)set_tim_stealth(p_ptr, p_ptr->tim_stealth - 1, TRUE);
+               (void)set_tim_stealth(creature_ptr, creature_ptr->tim_stealth - 1, TRUE);
        }
 
        /* Timed levitation */
-       if (p_ptr->tim_levitation)
+       if (creature_ptr->tim_levitation)
        {
-               (void)set_tim_levitation(p_ptr, p_ptr->tim_levitation - 1, TRUE);
+               (void)set_tim_levitation(creature_ptr, creature_ptr->tim_levitation - 1, TRUE);
        }
 
        /* Timed sh_touki */
-       if (p_ptr->tim_sh_touki)
+       if (creature_ptr->tim_sh_touki)
        {
-               (void)set_tim_sh_touki(p_ptr, p_ptr->tim_sh_touki - 1, TRUE);
+               (void)set_tim_sh_touki(creature_ptr, creature_ptr->tim_sh_touki - 1, TRUE);
        }
 
        /* Timed sh_fire */
-       if (p_ptr->tim_sh_fire)
+       if (creature_ptr->tim_sh_fire)
        {
-               (void)set_tim_sh_fire(p_ptr, p_ptr->tim_sh_fire - 1, TRUE);
+               (void)set_tim_sh_fire(creature_ptr, creature_ptr->tim_sh_fire - 1, TRUE);
        }
 
        /* Timed sh_holy */
-       if (p_ptr->tim_sh_holy)
+       if (creature_ptr->tim_sh_holy)
        {
-               (void)set_tim_sh_holy(p_ptr, p_ptr->tim_sh_holy - 1, TRUE);
+               (void)set_tim_sh_holy(creature_ptr, creature_ptr->tim_sh_holy - 1, TRUE);
        }
 
        /* Timed eyeeye */
-       if (p_ptr->tim_eyeeye)
+       if (creature_ptr->tim_eyeeye)
        {
-               (void)set_tim_eyeeye(p_ptr, p_ptr->tim_eyeeye - 1, TRUE);
+               (void)set_tim_eyeeye(creature_ptr, creature_ptr->tim_eyeeye - 1, TRUE);
        }
 
        /* Timed resist-magic */
-       if (p_ptr->resist_magic)
+       if (creature_ptr->resist_magic)
        {
-               (void)set_resist_magic(p_ptr, p_ptr->resist_magic - 1, TRUE);
+               (void)set_resist_magic(creature_ptr, creature_ptr->resist_magic - 1, TRUE);
        }
 
        /* Timed regeneration */
-       if (p_ptr->tim_regen)
+       if (creature_ptr->tim_regen)
        {
-               (void)set_tim_regen(p_ptr, p_ptr->tim_regen - 1, TRUE);
+               (void)set_tim_regen(creature_ptr, creature_ptr->tim_regen - 1, TRUE);
        }
 
        /* Timed resist nether */
-       if (p_ptr->tim_res_nether)
+       if (creature_ptr->tim_res_nether)
        {
-               (void)set_tim_res_nether(p_ptr, p_ptr->tim_res_nether - 1, TRUE);
+               (void)set_tim_res_nether(creature_ptr, creature_ptr->tim_res_nether - 1, TRUE);
        }
 
        /* Timed resist time */
-       if (p_ptr->tim_res_time)
+       if (creature_ptr->tim_res_time)
        {
-               (void)set_tim_res_time(p_ptr, p_ptr->tim_res_time - 1, TRUE);
+               (void)set_tim_res_time(creature_ptr, creature_ptr->tim_res_time - 1, TRUE);
        }
 
        /* Timed reflect */
-       if (p_ptr->tim_reflect)
+       if (creature_ptr->tim_reflect)
        {
-               (void)set_tim_reflect(p_ptr, p_ptr->tim_reflect - 1, TRUE);
+               (void)set_tim_reflect(creature_ptr, creature_ptr->tim_reflect - 1, TRUE);
        }
 
        /* Multi-shadow */
-       if (p_ptr->multishadow)
+       if (creature_ptr->multishadow)
        {
-               (void)set_multishadow(p_ptr, p_ptr->multishadow - 1, TRUE);
+               (void)set_multishadow(creature_ptr, creature_ptr->multishadow - 1, TRUE);
        }
 
        /* Timed Robe of dust */
-       if (p_ptr->dustrobe)
+       if (creature_ptr->dustrobe)
        {
-               (void)set_dustrobe(p_ptr, p_ptr->dustrobe - 1, TRUE);
+               (void)set_dustrobe(creature_ptr, creature_ptr->dustrobe - 1, TRUE);
        }
 
        /* Timed infra-vision */
-       if (p_ptr->kabenuke)
+       if (creature_ptr->kabenuke)
        {
-               (void)set_kabenuke(p_ptr, p_ptr->kabenuke - 1, TRUE);
+               (void)set_kabenuke(creature_ptr, creature_ptr->kabenuke - 1, TRUE);
        }
 
        /* Paralysis */
-       if (p_ptr->paralyzed)
+       if (creature_ptr->paralyzed)
        {
-               (void)set_paralyzed(p_ptr, p_ptr->paralyzed - dec_count);
+               (void)set_paralyzed(creature_ptr, creature_ptr->paralyzed - dec_count);
        }
 
        /* Confusion */
-       if (p_ptr->confused)
+       if (creature_ptr->confused)
        {
-               (void)set_confused(p_ptr, p_ptr->confused - dec_count);
+               (void)set_confused(creature_ptr, creature_ptr->confused - dec_count);
        }
 
        /* Afraid */
-       if (p_ptr->afraid)
+       if (creature_ptr->afraid)
        {
-               (void)set_afraid(p_ptr, p_ptr->afraid - dec_count);
+               (void)set_afraid(creature_ptr, creature_ptr->afraid - dec_count);
        }
 
        /* Fast */
-       if (p_ptr->fast)
+       if (creature_ptr->fast)
        {
-               (void)set_fast(p_ptr, p_ptr->fast - 1, TRUE);
+               (void)set_fast(creature_ptr, creature_ptr->fast - 1, TRUE);
        }
 
        /* Slow */
-       if (p_ptr->slow)
+       if (creature_ptr->slow)
        {
-               (void)set_slow(p_ptr, p_ptr->slow - dec_count, TRUE);
+               (void)set_slow(creature_ptr, creature_ptr->slow - dec_count, TRUE);
        }
 
        /* Protection from evil */
-       if (p_ptr->protevil)
+       if (creature_ptr->protevil)
        {
-               (void)set_protevil(p_ptr, p_ptr->protevil - 1, TRUE);
+               (void)set_protevil(creature_ptr, creature_ptr->protevil - 1, TRUE);
        }
 
        /* Invulnerability */
-       if (p_ptr->invuln)
+       if (creature_ptr->invuln)
        {
-               (void)set_invuln(p_ptr, p_ptr->invuln - 1, TRUE);
+               (void)set_invuln(creature_ptr, creature_ptr->invuln - 1, TRUE);
        }
 
        /* Wraith form */
-       if (p_ptr->wraith_form)
+       if (creature_ptr->wraith_form)
        {
-               (void)set_wraith_form(p_ptr, p_ptr->wraith_form - 1, TRUE);
+               (void)set_wraith_form(creature_ptr, creature_ptr->wraith_form - 1, TRUE);
        }
 
        /* Heroism */
-       if (p_ptr->hero)
+       if (creature_ptr->hero)
        {
-               (void)set_hero(p_ptr, p_ptr->hero - 1, TRUE);
+               (void)set_hero(creature_ptr, creature_ptr->hero - 1, TRUE);
        }
 
        /* Super Heroism */
-       if (p_ptr->shero)
+       if (creature_ptr->shero)
        {
-               (void)set_shero(p_ptr, p_ptr->shero - 1, TRUE);
+               (void)set_shero(creature_ptr, creature_ptr->shero - 1, TRUE);
        }
 
        /* Blessed */
-       if (p_ptr->blessed)
+       if (creature_ptr->blessed)
        {
-               (void)set_blessed(p_ptr, p_ptr->blessed - 1, TRUE);
+               (void)set_blessed(creature_ptr, creature_ptr->blessed - 1, TRUE);
        }
 
        /* Shield */
-       if (p_ptr->shield)
+       if (creature_ptr->shield)
        {
-               (void)set_shield(p_ptr, p_ptr->shield - 1, TRUE);
+               (void)set_shield(creature_ptr, creature_ptr->shield - 1, TRUE);
        }
 
        /* Tsubureru */
-       if (p_ptr->tsubureru)
+       if (creature_ptr->tsubureru)
        {
-               (void)set_tsubureru(p_ptr, p_ptr->tsubureru - 1, TRUE);
+               (void)set_tsubureru(creature_ptr, creature_ptr->tsubureru - 1, TRUE);
        }
 
        /* Magicdef */
-       if (p_ptr->magicdef)
+       if (creature_ptr->magicdef)
        {
-               (void)set_magicdef(p_ptr, p_ptr->magicdef - 1, TRUE);
+               (void)set_magicdef(creature_ptr, creature_ptr->magicdef - 1, TRUE);
        }
 
        /* Tsuyoshi */
-       if (p_ptr->tsuyoshi)
+       if (creature_ptr->tsuyoshi)
        {
-               (void)set_tsuyoshi(p_ptr, p_ptr->tsuyoshi - 1, TRUE);
+               (void)set_tsuyoshi(creature_ptr, creature_ptr->tsuyoshi - 1, TRUE);
        }
 
        /* Oppose Acid */
-       if (p_ptr->oppose_acid)
+       if (creature_ptr->oppose_acid)
        {
-               (void)set_oppose_acid(p_ptr, p_ptr->oppose_acid - 1, TRUE);
+               (void)set_oppose_acid(creature_ptr, creature_ptr->oppose_acid - 1, TRUE);
        }
 
        /* Oppose Lightning */
-       if (p_ptr->oppose_elec)
+       if (creature_ptr->oppose_elec)
        {
-               (void)set_oppose_elec(p_ptr, p_ptr->oppose_elec - 1, TRUE);
+               (void)set_oppose_elec(creature_ptr, creature_ptr->oppose_elec - 1, TRUE);
        }
 
        /* Oppose Fire */
-       if (p_ptr->oppose_fire)
+       if (creature_ptr->oppose_fire)
        {
-               (void)set_oppose_fire(p_ptr, p_ptr->oppose_fire - 1, TRUE);
+               (void)set_oppose_fire(creature_ptr, creature_ptr->oppose_fire - 1, TRUE);
        }
 
        /* Oppose Cold */
-       if (p_ptr->oppose_cold)
+       if (creature_ptr->oppose_cold)
        {
-               (void)set_oppose_cold(p_ptr, p_ptr->oppose_cold - 1, TRUE);
+               (void)set_oppose_cold(creature_ptr, creature_ptr->oppose_cold - 1, TRUE);
        }
 
        /* Oppose Poison */
-       if (p_ptr->oppose_pois)
+       if (creature_ptr->oppose_pois)
        {
-               (void)set_oppose_pois(p_ptr, p_ptr->oppose_pois - 1, TRUE);
+               (void)set_oppose_pois(creature_ptr, creature_ptr->oppose_pois - 1, TRUE);
        }
 
-       if (p_ptr->ult_res)
+       if (creature_ptr->ult_res)
        {
-               (void)set_ultimate_res(p_ptr, p_ptr->ult_res - 1, TRUE);
+               (void)set_ultimate_res(creature_ptr, creature_ptr->ult_res - 1, TRUE);
        }
 
        /*** Poison and Stun and Cut ***/
 
        /* Poison */
-       if (p_ptr->poisoned)
+       if (creature_ptr->poisoned)
        {
-               int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
+               int adjust = adj_con_fix[creature_ptr->stat_ind[A_CON]] + 1;
 
                /* Apply some healing */
-               (void)set_poisoned(p_ptr, p_ptr->poisoned - adjust);
+               (void)set_poisoned(creature_ptr, creature_ptr->poisoned - adjust);
        }
 
        /* Stun */
-       if (p_ptr->stun)
+       if (creature_ptr->stun)
        {
-               int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
+               int adjust = adj_con_fix[creature_ptr->stat_ind[A_CON]] + 1;
 
                /* Apply some healing */
-               (void)set_stun(p_ptr, p_ptr->stun - adjust);
+               (void)set_stun(creature_ptr, creature_ptr->stun - adjust);
        }
 
        /* Cut */
-       if (p_ptr->cut)
+       if (creature_ptr->cut)
        {
-               int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
+               int adjust = adj_con_fix[creature_ptr->stat_ind[A_CON]] + 1;
 
                /* Hack -- Truly "mortal" wound */
-               if (p_ptr->cut > 1000) adjust = 0;
+               if (creature_ptr->cut > 1000) adjust = 0;
 
                /* Apply some healing */
-               (void)set_cut(p_ptr,p_ptr->cut - adjust);
+               (void)set_cut(creature_ptr,creature_ptr->cut - adjust);
        }
 }
 
@@ -2114,10 +2114,10 @@ static void process_world_aux_timeout(void)
  * / Handle burning fuel every 10 game turns
  * @return なし
  */
-static void process_world_aux_light(void)
+static void process_world_aux_light(player_type *creature_ptr)
 {
        /* Check for light being wielded */
-       object_type *o_ptr = &p_ptr->inventory_list[INVEN_LITE];
+       object_type *o_ptr = &creature_ptr->inventory_list[INVEN_LITE];
 
        /* Burn some fuel in the current lite */
        if (o_ptr->tval == TV_LITE)
@@ -2133,7 +2133,7 @@ static void process_world_aux_light(void)
                        else o_ptr->xtra4--;
 
                        /* Notice interesting fuel steps */
-                       notice_lite_change(o_ptr);
+                       notice_lite_change(creature_ptr, o_ptr);
                }
        }
 }
@@ -2144,67 +2144,67 @@ static void process_world_aux_light(void)
  * / Handle mutation effects once every 10 game turns
  * @return なし
  */
-static void process_world_aux_mutation(void)
+static void process_world_aux_mutation(player_type *creature_ptr)
 {
        /* No mutation with effects */
-       if (!p_ptr->muta2) return;
+       if (!creature_ptr->muta2) return;
 
        /* No effect on monster arena */
-       if (p_ptr->phase_out) return;
+       if (creature_ptr->phase_out) return;
 
        /* No effect on the global map */
-       if (p_ptr->wild_mode) return;
+       if (creature_ptr->wild_mode) return;
 
-       if ((p_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000))
+       if ((creature_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000))
        {
-               disturb(FALSE, TRUE);
+               disturb(creature_ptr, FALSE, TRUE);
                msg_print(_("ウガァァア!", "RAAAAGHH!"));
                msg_print(_("激怒の発作に襲われた!", "You feel a fit of rage coming over you!"));
-               (void)set_shero(p_ptr, 10 + randint1(p_ptr->lev), FALSE);
-               (void)set_afraid(p_ptr, 0);
+               (void)set_shero(creature_ptr, 10 + randint1(creature_ptr->lev), FALSE);
+               (void)set_afraid(creature_ptr, 0);
        }
 
-       if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint1(3000) == 13))
+       if ((creature_ptr->muta2 & MUT2_COWARDICE) && (randint1(3000) == 13))
        {
-               if (!p_ptr->resist_fear)
+               if (!creature_ptr->resist_fear)
                {
-                       disturb(FALSE, TRUE);
+                       disturb(creature_ptr, FALSE, TRUE);
                        msg_print(_("とても暗い... とても恐い!", "It's so dark... so scary!"));
-                       set_afraid(p_ptr, p_ptr->afraid + 13 + randint1(26));
+                       set_afraid(creature_ptr, creature_ptr->afraid + 13 + randint1(26));
                }
        }
 
-       if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint1(5000) == 88))
+       if ((creature_ptr->muta2 & MUT2_RTELEPORT) && (randint1(5000) == 88))
        {
-               if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) && !p_ptr->anti_tele)
+               if (!creature_ptr->resist_nexus && !(creature_ptr->muta1 & MUT1_VTELEPORT) && !creature_ptr->anti_tele)
                {
-                       disturb(FALSE, TRUE);
+                       disturb(creature_ptr, FALSE, TRUE);
                        msg_print(_("あなたの位置は突然ひじょうに不確定になった...", "Your position suddenly seems very uncertain..."));
                        msg_print(NULL);
                        teleport_player(40, TELEPORT_PASSIVE);
                }
        }
 
-       if ((p_ptr->muta2 & MUT2_ALCOHOL) && (randint1(6400) == 321))
+       if ((creature_ptr->muta2 & MUT2_ALCOHOL) && (randint1(6400) == 321))
        {
-               if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
+               if (!creature_ptr->resist_conf && !creature_ptr->resist_chaos)
                {
-                       disturb(FALSE, TRUE);
-                       p_ptr->redraw |= PR_EXTRA;
+                       disturb(creature_ptr, FALSE, TRUE);
+                       creature_ptr->redraw |= PR_EXTRA;
                        msg_print(_("いひきがもーろーとひてきたきがふる...ヒック!", "You feel a SSSCHtupor cOmINg over yOu... *HIC*!"));
                }
 
-               if (!p_ptr->resist_conf)
+               if (!creature_ptr->resist_conf)
                {
-                       (void)set_confused(p_ptr, p_ptr->confused + randint0(20) + 15);
+                       (void)set_confused(creature_ptr, creature_ptr->confused + randint0(20) + 15);
                }
 
-               if (!p_ptr->resist_chaos)
+               if (!creature_ptr->resist_chaos)
                {
                        if (one_in_(20))
                        {
                                msg_print(NULL);
-                               if (one_in_(3)) lose_all_info(p_ptr);
+                               if (one_in_(3)) lose_all_info(creature_ptr);
                                else wiz_dark();
                                (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
                                wiz_dark();
@@ -2216,45 +2216,45 @@ static void process_world_aux_mutation(void)
                                if (one_in_(3))
                                {
                                        msg_print(_("き~れいなちょおちょらとんれいる~", "Thishcischs GooDSChtuff!"));
-                                       (void)set_image(p_ptr, p_ptr->image + randint0(150) + 150);
+                                       (void)set_image(creature_ptr, creature_ptr->image + randint0(150) + 150);
                                }
                        }
                }
        }
 
-       if ((p_ptr->muta2 & MUT2_HALLU) && (randint1(6400) == 42))
+       if ((creature_ptr->muta2 & MUT2_HALLU) && (randint1(6400) == 42))
        {
-               if (!p_ptr->resist_chaos)
+               if (!creature_ptr->resist_chaos)
                {
-                       disturb(FALSE, TRUE);
-                       p_ptr->redraw |= PR_EXTRA;
-                       (void)set_image(p_ptr, p_ptr->image + randint0(50) + 20);
+                       disturb(creature_ptr, FALSE, TRUE);
+                       creature_ptr->redraw |= PR_EXTRA;
+                       (void)set_image(creature_ptr, creature_ptr->image + randint0(50) + 20);
                }
        }
 
-       if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13))
+       if ((creature_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13))
        {
-               disturb(FALSE, TRUE);
+               disturb(creature_ptr, FALSE, TRUE);
                msg_print(_("ブゥーーッ!おっと。", "BRRAAAP! Oops."));
                msg_print(NULL);
-               fire_ball(GF_POIS, 0, p_ptr->lev, 3);
+               fire_ball(GF_POIS, 0, creature_ptr->lev, 3);
        }
 
-       if ((p_ptr->muta2 & MUT2_PROD_MANA) &&
-           !p_ptr->anti_magic && one_in_(9000))
+       if ((creature_ptr->muta2 & MUT2_PROD_MANA) &&
+           !creature_ptr->anti_magic && one_in_(9000))
        {
                int dire = 0;
-               disturb(FALSE, TRUE);
+               disturb(creature_ptr, FALSE, TRUE);
                msg_print(_("魔法のエネルギーが突然あなたの中に流れ込んできた!エネルギーを解放しなければならない!", 
                                                "Magical energy flows through you! You must release it!"));
 
                flush();
                msg_print(NULL);
                (void)get_hack_dir(&dire);
-               fire_ball(GF_MANA, dire, p_ptr->lev * 2, 3);
+               fire_ball(GF_MANA, dire, creature_ptr->lev * 2, 3);
        }
 
-       if ((p_ptr->muta2 & MUT2_ATT_DEMON) && !p_ptr->anti_magic && (randint1(6666) == 666))
+       if ((creature_ptr->muta2 & MUT2_ATT_DEMON) && !creature_ptr->anti_magic && (randint1(6666) == 666))
        {
                bool pet = one_in_(6);
                BIT_FLAGS mode = PM_ALLOW_GROUP;
@@ -2262,51 +2262,51 @@ static void process_world_aux_mutation(void)
                if (pet) mode |= PM_FORCE_PET;
                else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-               if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_DEMON, mode))
+               if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, mode))
                {
                        msg_print(_("あなたはデーモンを引き寄せた!", "You have attracted a demon!"));
-                       disturb(FALSE, TRUE);
+                       disturb(creature_ptr, FALSE, TRUE);
                }
        }
 
-       if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && one_in_(6000))
+       if ((creature_ptr->muta2 & MUT2_SPEED_FLUX) && one_in_(6000))
        {
-               disturb(FALSE, TRUE);
+               disturb(creature_ptr, FALSE, TRUE);
                if (one_in_(2))
                {
                        msg_print(_("精力的でなくなった気がする。", "You feel less energetic."));
 
-                       if (p_ptr->fast > 0)
+                       if (creature_ptr->fast > 0)
                        {
-                               set_fast(p_ptr, 0, TRUE);
+                               set_fast(creature_ptr, 0, TRUE);
                        }
                        else
                        {
-                               set_slow(p_ptr, randint1(30) + 10, FALSE);
+                               set_slow(creature_ptr, randint1(30) + 10, FALSE);
                        }
                }
                else
                {
                        msg_print(_("精力的になった気がする。", "You feel more energetic."));
 
-                       if (p_ptr->slow > 0)
+                       if (creature_ptr->slow > 0)
                        {
-                               set_slow(p_ptr, 0, TRUE);
+                               set_slow(creature_ptr, 0, TRUE);
                        }
                        else
                        {
-                               set_fast(p_ptr, randint1(30) + 10, FALSE);
+                               set_fast(creature_ptr, randint1(30) + 10, FALSE);
                        }
                }
                msg_print(NULL);
        }
-       if ((p_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000))
+       if ((creature_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000))
        {
-               disturb(FALSE, TRUE);
+               disturb(creature_ptr, FALSE, TRUE);
                msg_print(_("突然ほとんど孤独になった気がする。", "You suddenly feel almost lonely."));
 
                banish_monsters(100);
-               if (!current_floor_ptr->dun_level && p_ptr->town_num)
+               if (!p_ptr->current_floor_ptr->dun_level && creature_ptr->town_num)
                {
                        int n;
 
@@ -2323,7 +2323,7 @@ static void process_world_aux_mutation(void)
                msg_print(NULL);
        }
 
-       if ((p_ptr->muta2 & MUT2_EAT_LIGHT) && one_in_(3000))
+       if ((creature_ptr->muta2 & MUT2_EAT_LIGHT) && one_in_(3000))
        {
                object_type *o_ptr;
 
@@ -2331,12 +2331,12 @@ static void process_world_aux_mutation(void)
                msg_print(NULL);
 
                /* Absorb light from the current possition */
-               if ((current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
+               if ((p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
                {
-                       hp_player(p_ptr, 10);
+                       hp_player(creature_ptr, 10);
                }
 
-               o_ptr = &p_ptr->inventory_list[INVEN_LITE];
+               o_ptr = &creature_ptr->inventory_list[INVEN_LITE];
 
                /* Absorb some fuel in the current lite */
                if (o_ptr->tval == TV_LITE)
@@ -2345,14 +2345,14 @@ static void process_world_aux_mutation(void)
                        if (!object_is_fixed_artifact(o_ptr) && (o_ptr->xtra4 > 0))
                        {
                                /* Heal the player a bit */
-                               hp_player(p_ptr, o_ptr->xtra4 / 20);
+                               hp_player(creature_ptr, o_ptr->xtra4 / 20);
 
                                /* Decrease life-span of lite */
                                o_ptr->xtra4 /= 2;
                                msg_print(_("光源からエネルギーを吸収した!", "You absorb energy from your light!"));
 
                                /* Notice interesting fuel steps */
-                               notice_lite_change(o_ptr);
+                               notice_lite_change(creature_ptr, o_ptr);
                        }
                }
 
@@ -2363,7 +2363,7 @@ static void process_world_aux_mutation(void)
                unlite_area(50, 10);
        }
 
-       if ((p_ptr->muta2 & MUT2_ATT_ANIMAL) && !p_ptr->anti_magic && one_in_(7000))
+       if ((creature_ptr->muta2 & MUT2_ATT_ANIMAL) && !creature_ptr->anti_magic && one_in_(7000))
        {
                bool pet = one_in_(3);
                BIT_FLAGS mode = PM_ALLOW_GROUP;
@@ -2371,39 +2371,39 @@ static void process_world_aux_mutation(void)
                if (pet) mode |= PM_FORCE_PET;
                else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-               if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_ANIMAL, mode))
+               if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_ANIMAL, mode))
                {
                        msg_print(_("動物を引き寄せた!", "You have attracted an animal!"));
-                       disturb(FALSE, TRUE);
+                       disturb(creature_ptr, FALSE, TRUE);
                }
        }
 
-       if ((p_ptr->muta2 & MUT2_RAW_CHAOS) && !p_ptr->anti_magic && one_in_(8000))
+       if ((creature_ptr->muta2 & MUT2_RAW_CHAOS) && !creature_ptr->anti_magic && one_in_(8000))
        {
-               disturb(FALSE, TRUE);
+               disturb(creature_ptr, FALSE, TRUE);
                msg_print(_("周りの空間が歪んでいる気がする!", "You feel the world warping around you!"));
 
                msg_print(NULL);
-               fire_ball(GF_CHAOS, 0, p_ptr->lev, 8);
+               fire_ball(GF_CHAOS, 0, creature_ptr->lev, 8);
        }
-       if ((p_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000))
+       if ((creature_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000))
        {
-               if (!lose_mutation(p_ptr, 0))
+               if (!lose_mutation(creature_ptr, 0))
                        msg_print(_("奇妙なくらい普通になった気がする。", "You feel oddly normal."));
        }
-       if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000))
+       if ((creature_ptr->muta2 & MUT2_WRAITH) && !creature_ptr->anti_magic && one_in_(3000))
        {
-               disturb(FALSE, TRUE);
+               disturb(creature_ptr, FALSE, TRUE);
                msg_print(_("非物質化した!", "You feel insubstantial!"));
 
                msg_print(NULL);
-               set_wraith_form(p_ptr, randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
+               set_wraith_form(creature_ptr, randint1(creature_ptr->lev / 2) + (creature_ptr->lev / 2), FALSE);
        }
-       if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
+       if ((creature_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
        {
-               do_poly_wounds(p_ptr);
+               do_poly_wounds(creature_ptr);
        }
-       if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
+       if ((creature_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
        {
                int which_stat = randint0(A_MAX);
                int sustained = FALSE;
@@ -2411,22 +2411,22 @@ static void process_world_aux_mutation(void)
                switch (which_stat)
                {
                case A_STR:
-                       if (p_ptr->sustain_str) sustained = TRUE;
+                       if (creature_ptr->sustain_str) sustained = TRUE;
                        break;
                case A_INT:
-                       if (p_ptr->sustain_int) sustained = TRUE;
+                       if (creature_ptr->sustain_int) sustained = TRUE;
                        break;
                case A_WIS:
-                       if (p_ptr->sustain_wis) sustained = TRUE;
+                       if (creature_ptr->sustain_wis) sustained = TRUE;
                        break;
                case A_DEX:
-                       if (p_ptr->sustain_dex) sustained = TRUE;
+                       if (creature_ptr->sustain_dex) sustained = TRUE;
                        break;
                case A_CON:
-                       if (p_ptr->sustain_con) sustained = TRUE;
+                       if (creature_ptr->sustain_con) sustained = TRUE;
                        break;
                case A_CHR:
-                       if (p_ptr->sustain_chr) sustained = TRUE;
+                       if (creature_ptr->sustain_chr) sustained = TRUE;
                        break;
                default:
                        msg_print(_("不正な状態!", "Invalid stat chosen!"));
@@ -2435,13 +2435,13 @@ static void process_world_aux_mutation(void)
 
                if (!sustained)
                {
-                       disturb(FALSE, TRUE);
+                       disturb(creature_ptr, FALSE, TRUE);
                        msg_print(_("自分が衰弱していくのが分かる!", "You can feel yourself wasting away!"));
                        msg_print(NULL);
-                       (void)dec_stat(p_ptr, which_stat, randint1(6) + 6, one_in_(3));
+                       (void)dec_stat(creature_ptr, which_stat, randint1(6) + 6, one_in_(3));
                }
        }
-       if ((p_ptr->muta2 & MUT2_ATT_DRAGON) && !p_ptr->anti_magic && one_in_(3000))
+       if ((creature_ptr->muta2 & MUT2_ATT_DRAGON) && !creature_ptr->anti_magic && one_in_(3000))
        {
                bool pet = one_in_(5);
                BIT_FLAGS mode = PM_ALLOW_GROUP;
@@ -2449,54 +2449,54 @@ static void process_world_aux_mutation(void)
                if (pet) mode |= PM_FORCE_PET;
                else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-               if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_DRAGON, mode))
+               if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON, mode))
                {
                        msg_print(_("ドラゴンを引き寄せた!", "You have attracted a dragon!"));
-                       disturb(FALSE, TRUE);
+                       disturb(creature_ptr, FALSE, TRUE);
                }
        }
-       if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic && one_in_(3000))
+       if ((creature_ptr->muta2 & MUT2_WEIRD_MIND) && !creature_ptr->anti_magic && one_in_(3000))
        {
-               if (p_ptr->tim_esp > 0)
+               if (creature_ptr->tim_esp > 0)
                {
                        msg_print(_("精神にもやがかかった!", "Your mind feels cloudy!"));
-                       set_tim_esp(p_ptr, 0, TRUE);
+                       set_tim_esp(creature_ptr, 0, TRUE);
                }
                else
                {
                        msg_print(_("精神が広がった!", "Your mind expands!"));
-                       set_tim_esp(p_ptr, p_ptr->lev, FALSE);
+                       set_tim_esp(creature_ptr, creature_ptr->lev, FALSE);
                }
        }
-       if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest && one_in_(9000))
+       if ((creature_ptr->muta2 & MUT2_NAUSEA) && !creature_ptr->slow_digest && one_in_(9000))
        {
-               disturb(FALSE, TRUE);
+               disturb(creature_ptr, FALSE, TRUE);
                msg_print(_("胃が痙攣し、食事を失った!", "Your stomach roils, and you lose your lunch!"));
                msg_print(NULL);
-               set_food(p_ptr, PY_FOOD_WEAK);
-               if (music_singing_any(p_ptr)) stop_singing(p_ptr);
-               if (hex_spelling_any(p_ptr)) stop_hex_spell_all();
+               set_food(creature_ptr, PY_FOOD_WEAK);
+               if (music_singing_any(creature_ptr)) stop_singing(creature_ptr);
+               if (hex_spelling_any(creature_ptr)) stop_hex_spell_all();
        }
 
-       if ((p_ptr->muta2 & MUT2_WALK_SHAD) && !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena)
+       if ((creature_ptr->muta2 & MUT2_WALK_SHAD) && !creature_ptr->anti_magic && one_in_(12000) && !creature_ptr->inside_arena)
        {
                alter_reality();
        }
 
-       if ((p_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
+       if ((creature_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
        {
                int danger_amount = 0;
                MONSTER_IDX monster;
 
-               for (monster = 0; monster < current_floor_ptr->m_max; monster++)
+               for (monster = 0; monster < p_ptr->current_floor_ptr->m_max; monster++)
                {
-                       monster_type *m_ptr = &current_floor_ptr->m_list[monster];
+                       monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[monster];
                        monster_race *r_ptr = &r_info[m_ptr->r_idx];
                        if (!monster_is_valid(m_ptr)) continue;
 
-                       if (r_ptr->level >= p_ptr->lev)
+                       if (r_ptr->level >= creature_ptr->lev)
                        {
-                               danger_amount += r_ptr->level - p_ptr->lev + 1;
+                               danger_amount += r_ptr->level - creature_ptr->lev + 1;
                        }
                }
 
@@ -2514,68 +2514,68 @@ static void process_world_aux_mutation(void)
                        msg_print(_("寂しい気がする。", "You feel lonely."));
        }
 
-       if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic && one_in_(5000))
+       if ((creature_ptr->muta2 & MUT2_INVULN) && !creature_ptr->anti_magic && one_in_(5000))
        {
-               disturb(FALSE, TRUE);
+               disturb(creature_ptr, FALSE, TRUE);
                msg_print(_("無敵な気がする!", "You feel invincible!"));
                msg_print(NULL);
-               (void)set_invuln(p_ptr, randint1(8) + 8, FALSE);
+               (void)set_invuln(creature_ptr, randint1(8) + 8, FALSE);
        }
 
-       if ((p_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
+       if ((creature_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
        {
-               MANA_POINT wounds = (MANA_POINT)(p_ptr->mhp - p_ptr->chp);
+               MANA_POINT wounds = (MANA_POINT)(creature_ptr->mhp - creature_ptr->chp);
 
                if (wounds > 0)
                {
-                       HIT_POINT healing = p_ptr->csp;
+                       HIT_POINT healing = creature_ptr->csp;
                        if (healing > wounds) healing = wounds;
 
-                       hp_player(p_ptr, healing);
-                       p_ptr->csp -= healing;
-                       p_ptr->redraw |= (PR_HP | PR_MANA);
+                       hp_player(creature_ptr, healing);
+                       creature_ptr->csp -= healing;
+                       creature_ptr->redraw |= (PR_HP | PR_MANA);
                }
        }
 
-       if ((p_ptr->muta2 & MUT2_HP_TO_SP) && !p_ptr->anti_magic && one_in_(4000))
+       if ((creature_ptr->muta2 & MUT2_HP_TO_SP) && !creature_ptr->anti_magic && one_in_(4000))
        {
-               HIT_POINT wounds = (HIT_POINT)(p_ptr->msp - p_ptr->csp);
+               HIT_POINT wounds = (HIT_POINT)(creature_ptr->msp - creature_ptr->csp);
 
                if (wounds > 0)
                {
-                       HIT_POINT healing = p_ptr->chp;
+                       HIT_POINT healing = creature_ptr->chp;
                        if (healing > wounds) healing = wounds;
 
-                       p_ptr->csp += healing;
-                       p_ptr->redraw |= (PR_HP | PR_MANA);
-                       take_hit(p_ptr, DAMAGE_LOSELIFE, healing, _("頭に昇った血", "blood rushing to the head"), -1);
+                       creature_ptr->csp += healing;
+                       creature_ptr->redraw |= (PR_HP | PR_MANA);
+                       take_hit(creature_ptr, DAMAGE_LOSELIFE, healing, _("頭に昇った血", "blood rushing to the head"), -1);
                }
        }
 
-       if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
+       if ((creature_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
        {
                INVENTORY_IDX slot = 0;
                object_type *o_ptr = NULL;
 
-               disturb(FALSE, TRUE);
+               disturb(creature_ptr, FALSE, TRUE);
                msg_print(_("足がもつれて転んだ!", "You trip over your own feet!"));
-               take_hit(p_ptr, DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), _("転倒", "tripping"), -1);
+               take_hit(creature_ptr, DAMAGE_NOESCAPE, randint1(creature_ptr->wt / 6), _("転倒", "tripping"), -1);
 
                msg_print(NULL);
-               if (has_melee_weapon(p_ptr, INVEN_RARM))
+               if (has_melee_weapon(creature_ptr, INVEN_RARM))
                {
                        slot = INVEN_RARM;
-                       o_ptr = &p_ptr->inventory_list[INVEN_RARM];
+                       o_ptr = &creature_ptr->inventory_list[INVEN_RARM];
 
-                       if (has_melee_weapon(p_ptr, INVEN_LARM) && one_in_(2))
+                       if (has_melee_weapon(creature_ptr, INVEN_LARM) && one_in_(2))
                        {
-                               o_ptr = &p_ptr->inventory_list[INVEN_LARM];
+                               o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
                                slot = INVEN_LARM;
                        }
                }
-               else if (has_melee_weapon(p_ptr, INVEN_LARM))
+               else if (has_melee_weapon(creature_ptr, INVEN_LARM))
                {
-                       o_ptr = &p_ptr->inventory_list[INVEN_LARM];
+                       o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
                        slot = INVEN_LARM;
                }
                if (slot && !object_is_cursed(o_ptr))
@@ -2592,15 +2592,15 @@ static void process_world_aux_mutation(void)
  * / Handle curse effects once every 10 game turns
  * @return なし
  */
-static void process_world_aux_curse(void)
+static void process_world_aux_curse(player_type *creature_ptr)
 {
-       if ((p_ptr->cursed & TRC_P_FLAG_MASK) && !p_ptr->phase_out && !p_ptr->wild_mode)
+       if ((creature_ptr->cursed & TRC_P_FLAG_MASK) && !creature_ptr->phase_out && !creature_ptr->wild_mode)
        {
                /*
                 * Hack: Uncursed teleporting items (e.g. Trump Weapons)
                 * can actually be useful!
                 */
-               if ((p_ptr->cursed & TRC_TELEPORT_SELF) && one_in_(200))
+               if ((creature_ptr->cursed & TRC_TELEPORT_SELF) && one_in_(200))
                {
                        GAME_TEXT o_name[MAX_NLEN];
                        object_type *o_ptr;
@@ -2610,7 +2610,7 @@ static void process_world_aux_curse(void)
                        for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
                        {
                                BIT_FLAGS flgs[TR_FLAG_SIZE];
-                               o_ptr = &p_ptr->inventory_list[i];
+                               o_ptr = &creature_ptr->inventory_list[i];
                                if (!o_ptr->k_idx) continue;
 
                                object_flags(o_ptr, flgs);
@@ -2626,46 +2626,46 @@ static void process_world_aux_curse(void)
                                }
                        }
 
-                       o_ptr = &p_ptr->inventory_list[i_keep];
+                       o_ptr = &creature_ptr->inventory_list[i_keep];
                        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
                        msg_format(_("%sがテレポートの能力を発動させようとしている。", "Your %s is activating teleportation."), o_name);
                        if (get_check_strict(_("テレポートしますか?", "Teleport? "), CHECK_OKAY_CANCEL))
                        {
-                               disturb(FALSE, TRUE);
+                               disturb(creature_ptr, FALSE, TRUE);
                                teleport_player(50, 0L);
                        }
                        else
                        {
                                msg_format(_("%sに{.}(ピリオド)と銘を刻むと発動を抑制できます。", 
                                                         "You can inscribe {.} on your %s to disable random teleportation. "), o_name);
-                               disturb(TRUE, TRUE);
+                               disturb(creature_ptr, TRUE, TRUE);
                        }
                }
                /* Make a chainsword noise */
-               if ((p_ptr->cursed & TRC_CHAINSWORD) && one_in_(CHAINSWORD_NOISE))
+               if ((creature_ptr->cursed & TRC_CHAINSWORD) && one_in_(CHAINSWORD_NOISE))
                {
                        char noise[1024];
                        if (!get_rnd_line(_("chainswd_j.txt", "chainswd.txt"), 0, noise))
                                msg_print(noise);
-                       disturb(FALSE, FALSE);
+                       disturb(creature_ptr, FALSE, FALSE);
                }
                /* TY Curse */
-               if ((p_ptr->cursed & TRC_TY_CURSE) && one_in_(TY_CURSE_CHANCE))
+               if ((creature_ptr->cursed & TRC_TY_CURSE) && one_in_(TY_CURSE_CHANCE))
                {
                        int count = 0;
                        (void)activate_ty_curse(FALSE, &count);
                }
                /* Handle experience draining */
-               if (p_ptr->prace != RACE_ANDROID && ((p_ptr->cursed & TRC_DRAIN_EXP) && one_in_(4)))
+               if (creature_ptr->prace != RACE_ANDROID && ((creature_ptr->cursed & TRC_DRAIN_EXP) && one_in_(4)))
                {
-                       p_ptr->exp -= (p_ptr->lev + 1) / 2;
-                       if (p_ptr->exp < 0) p_ptr->exp = 0;
-                       p_ptr->max_exp -= (p_ptr->lev + 1) / 2;
-                       if (p_ptr->max_exp < 0) p_ptr->max_exp = 0;
-                       check_experience(p_ptr);
+                       creature_ptr->exp -= (creature_ptr->lev + 1) / 2;
+                       if (creature_ptr->exp < 0) creature_ptr->exp = 0;
+                       creature_ptr->max_exp -= (creature_ptr->lev + 1) / 2;
+                       if (creature_ptr->max_exp < 0) creature_ptr->max_exp = 0;
+                       check_experience(creature_ptr);
                }
                /* Add light curse (Later) */
-               if ((p_ptr->cursed & TRC_ADD_L_CURSE) && one_in_(2000))
+               if ((creature_ptr->cursed & TRC_ADD_L_CURSE) && one_in_(2000))
                {
                        BIT_FLAGS new_curse;
                        object_type *o_ptr;
@@ -2684,11 +2684,11 @@ static void process_world_aux_curse(void)
 
                                o_ptr->feeling = FEEL_NONE;
 
-                               p_ptr->update |= (PU_BONUS);
+                               creature_ptr->update |= (PU_BONUS);
                        }
                }
                /* Add heavy curse (Later) */
-               if ((p_ptr->cursed & TRC_ADD_H_CURSE) && one_in_(2000))
+               if ((creature_ptr->cursed & TRC_ADD_H_CURSE) && one_in_(2000))
                {
                        BIT_FLAGS new_curse;
                        object_type *o_ptr;
@@ -2706,106 +2706,106 @@ static void process_world_aux_curse(void)
                                msg_format(_("悪意に満ちた黒いオーラが%sをとりまいた...", "There is a malignant black aura surrounding your %s..."), o_name);
                                o_ptr->feeling = FEEL_NONE;
 
-                               p_ptr->update |= (PU_BONUS);
+                               creature_ptr->update |= (PU_BONUS);
                        }
                }
                /* Call animal */
-               if ((p_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500))
+               if ((creature_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500))
                {
-                       if (summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_ANIMAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+                       if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_ANIMAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                        {
                                GAME_TEXT o_name[MAX_NLEN];
 
                                object_desc(o_name, choose_cursed_obj_name(TRC_CALL_ANIMAL), (OD_OMIT_PREFIX | OD_NAME_ONLY));
                                msg_format(_("%sが動物を引き寄せた!", "Your %s have attracted an animal!"), o_name);
-                               disturb(FALSE, TRUE);
+                               disturb(creature_ptr, FALSE, TRUE);
                        }
                }
                /* Call demon */
-               if ((p_ptr->cursed & TRC_CALL_DEMON) && one_in_(1111))
+               if ((creature_ptr->cursed & TRC_CALL_DEMON) && one_in_(1111))
                {
-                       if (summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+                       if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                        {
                                GAME_TEXT o_name[MAX_NLEN];
 
                                object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DEMON), (OD_OMIT_PREFIX | OD_NAME_ONLY));
                                msg_format(_("%sが悪魔を引き寄せた!", "Your %s have attracted a demon!"), o_name);
-                               disturb(FALSE, TRUE);
+                               disturb(creature_ptr, FALSE, TRUE);
                        }
                }
                /* Call dragon */
-               if ((p_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800))
+               if ((creature_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800))
                {
-                       if (summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_DRAGON,
+                       if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON,
                            (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                        {
                                GAME_TEXT o_name[MAX_NLEN];
 
                                object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DRAGON), (OD_OMIT_PREFIX | OD_NAME_ONLY));
                                msg_format(_("%sがドラゴンを引き寄せた!", "Your %s have attracted an dragon!"), o_name);
-                               disturb(FALSE, TRUE);
+                               disturb(creature_ptr, FALSE, TRUE);
                        }
                }
                /* Call undead */
-               if ((p_ptr->cursed & TRC_CALL_UNDEAD) && one_in_(1111))
+               if ((creature_ptr->cursed & TRC_CALL_UNDEAD) && one_in_(1111))
                {
-                       if (summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_UNDEAD,
+                       if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD,
                            (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                        {
                                GAME_TEXT o_name[MAX_NLEN];
 
                                object_desc(o_name, choose_cursed_obj_name(TRC_CALL_UNDEAD), (OD_OMIT_PREFIX | OD_NAME_ONLY));
                                msg_format(_("%sが死霊を引き寄せた!", "Your %s have attracted an undead!"), o_name);
-                               disturb(FALSE, TRUE);
+                               disturb(creature_ptr, FALSE, TRUE);
                        }
                }
-               if ((p_ptr->cursed & TRC_COWARDICE) && one_in_(1500))
+               if ((creature_ptr->cursed & TRC_COWARDICE) && one_in_(1500))
                {
-                       if (!p_ptr->resist_fear)
+                       if (!creature_ptr->resist_fear)
                        {
-                               disturb(FALSE, TRUE);
+                               disturb(creature_ptr, FALSE, TRUE);
                                msg_print(_("とても暗い... とても恐い!", "It's so dark... so scary!"));
-                               set_afraid(p_ptr, p_ptr->afraid + 13 + randint1(26));
+                               set_afraid(creature_ptr, creature_ptr->afraid + 13 + randint1(26));
                        }
                }
                /* Teleport player */
-               if ((p_ptr->cursed & TRC_TELEPORT) && one_in_(200) && !p_ptr->anti_tele)
+               if ((creature_ptr->cursed & TRC_TELEPORT) && one_in_(200) && !creature_ptr->anti_tele)
                {
-                       disturb(FALSE, TRUE);
+                       disturb(creature_ptr, FALSE, TRUE);
 
                        /* Teleport player */
                        teleport_player(40, TELEPORT_PASSIVE);
                }
                /* Handle HP draining */
-               if ((p_ptr->cursed & TRC_DRAIN_HP) && one_in_(666))
+               if ((creature_ptr->cursed & TRC_DRAIN_HP) && one_in_(666))
                {
                        GAME_TEXT o_name[MAX_NLEN];
 
                        object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_HP), (OD_OMIT_PREFIX | OD_NAME_ONLY));
                        msg_format(_("%sはあなたの体力を吸収した!", "Your %s drains HP from you!"), o_name);
-                       take_hit(p_ptr, DAMAGE_LOSELIFE, MIN(p_ptr->lev*2, 100), o_name, -1);
+                       take_hit(creature_ptr, DAMAGE_LOSELIFE, MIN(creature_ptr->lev*2, 100), o_name, -1);
                }
                /* Handle mana draining */
-               if ((p_ptr->cursed & TRC_DRAIN_MANA) && p_ptr->csp && one_in_(666))
+               if ((creature_ptr->cursed & TRC_DRAIN_MANA) && creature_ptr->csp && one_in_(666))
                {
                        GAME_TEXT o_name[MAX_NLEN];
 
                        object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_MANA), (OD_OMIT_PREFIX | OD_NAME_ONLY));
                        msg_format(_("%sはあなたの魔力を吸収した!", "Your %s drains mana from you!"), o_name);
-                       p_ptr->csp -= MIN(p_ptr->lev, 50);
-                       if (p_ptr->csp < 0)
+                       creature_ptr->csp -= MIN(creature_ptr->lev, 50);
+                       if (creature_ptr->csp < 0)
                        {
-                               p_ptr->csp = 0;
-                               p_ptr->csp_frac = 0;
+                               creature_ptr->csp = 0;
+                               creature_ptr->csp_frac = 0;
                        }
-                       p_ptr->redraw |= PR_MANA;
+                       creature_ptr->redraw |= PR_MANA;
                }
        }
 
        /* Rarely, take damage from the Jewel of Judgement */
-       if (one_in_(999) && !p_ptr->anti_magic)
+       if (one_in_(999) && !creature_ptr->anti_magic)
        {
-               object_type *o_ptr = &p_ptr->inventory_list[INVEN_LITE];
+               object_type *o_ptr = &creature_ptr->inventory_list[INVEN_LITE];
 
                if (o_ptr->name1 == ART_JUDGE)
                {
@@ -2813,7 +2813,7 @@ static void process_world_aux_curse(void)
                                msg_print(_("『審判の宝石』はあなたの体力を吸収した!", "The Jewel of Judgement drains life from you!"));
                        else
                                msg_print(_("なにかがあなたの体力を吸収した!", "Something drains life from you!"));
-                       take_hit(p_ptr, DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), _("審判の宝石", "the Jewel of Judgement"), -1);
+                       take_hit(creature_ptr, DAMAGE_LOSELIFE, MIN(creature_ptr->lev, 50), _("審判の宝石", "the Jewel of Judgement"), -1);
                }
        }
 }
@@ -2824,7 +2824,7 @@ static void process_world_aux_curse(void)
  * / Handle recharging objects once every 10 game turns
  * @return なし
  */
-static void process_world_aux_recharge(void)
+static void process_world_aux_recharge(player_type *creature_ptr)
 {
        int i;
        bool changed;
@@ -2833,7 +2833,7 @@ static void process_world_aux_recharge(void)
        for (changed = FALSE, i = INVEN_RARM; i < INVEN_TOTAL; i++)
        {
                /* Get the object */
-               object_type *o_ptr = &p_ptr->inventory_list[i];
+               object_type *o_ptr = &creature_ptr->inventory_list[i];
                if (!o_ptr->k_idx) continue;
 
                /* Recharge activatable objects */
@@ -2854,7 +2854,7 @@ static void process_world_aux_recharge(void)
        /* Notice changes */
        if (changed)
        {
-               p_ptr->window |= (PW_EQUIP);
+               creature_ptr->window |= (PW_EQUIP);
                wild_regen = 20;
        }
 
@@ -2865,7 +2865,7 @@ static void process_world_aux_recharge(void)
         */
        for (changed = FALSE, i = 0; i < INVEN_PACK; i++)
        {
-               object_type *o_ptr = &p_ptr->inventory_list[i];
+               object_type *o_ptr = &creature_ptr->inventory_list[i];
                object_kind *k_ptr = &k_info[o_ptr->k_idx];
                if (!o_ptr->k_idx) continue;
 
@@ -2900,14 +2900,14 @@ static void process_world_aux_recharge(void)
        /* Notice changes */
        if (changed)
        {
-               p_ptr->window |= (PW_INVEN);
+               creature_ptr->window |= (PW_INVEN);
                wild_regen = 20;
        }
 
        /* Process objects on floor */
-       for (i = 1; i < current_floor_ptr->o_max; i++)
+       for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
        {
-               object_type *o_ptr = &current_floor_ptr->o_list[i];
+               object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
 
                if (!OBJECT_IS_VALID(o_ptr)) continue;
 
@@ -2929,100 +2929,101 @@ static void process_world_aux_recharge(void)
  * / Handle involuntary movement once every 10 game turns
  * @return なし
  */
-static void process_world_aux_movement(void)
+static void process_world_aux_movement(player_type *creature_ptr)
 {
+       floor_type *floor_ptr = creature_ptr->current_floor_ptr;
        /* Delayed Word-of-Recall */
-       if (p_ptr->word_recall)
+       if (creature_ptr->word_recall)
        {
                /*
                 * HACK: Autosave BEFORE resetting the recall counter (rr9)
                 * The player is yanked up/down as soon as
                 * he loads the autosaved game.
                 */
-               if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->phase_out)
+               if (autosave_l && (creature_ptr->word_recall == 1) && !creature_ptr->phase_out)
                        do_cmd_save_game(TRUE);
 
                /* Count down towards recall */
-               p_ptr->word_recall--;
+               creature_ptr->word_recall--;
 
-               p_ptr->redraw |= (PR_STATUS);
+               creature_ptr->redraw |= (PR_STATUS);
 
                /* Activate the recall */
-               if (!p_ptr->word_recall)
+               if (!creature_ptr->word_recall)
                {
                        /* Disturbing! */
-                       disturb(FALSE, TRUE);
+                       disturb(creature_ptr, FALSE, TRUE);
 
                        /* Determine the level */
-                       if (current_floor_ptr->dun_level || p_ptr->inside_quest || p_ptr->enter_dungeon)
+                       if (floor_ptr->dun_level || creature_ptr->inside_quest || creature_ptr->enter_dungeon)
                        {
                                msg_print(_("上に引っ張りあげられる感じがする!", "You feel yourself yanked upwards!"));
 
-                               if (p_ptr->dungeon_idx) p_ptr->recall_dungeon = p_ptr->dungeon_idx;
+                               if (creature_ptr->dungeon_idx) creature_ptr->recall_dungeon = creature_ptr->dungeon_idx;
                                if (record_stair)
-                                       do_cmd_write_nikki(NIKKI_RECALL, current_floor_ptr->dun_level, NULL);
+                                       exe_write_diary(creature_ptr, NIKKI_RECALL, floor_ptr->dun_level, NULL);
 
-                               current_floor_ptr->dun_level = 0;
-                               p_ptr->dungeon_idx = 0;
+                               floor_ptr->dun_level = 0;
+                               creature_ptr->dungeon_idx = 0;
 
                                leave_quest_check();
                                leave_tower_check();
 
-                               p_ptr->inside_quest = 0;
+                               creature_ptr->inside_quest = 0;
 
-                               p_ptr->leaving = TRUE;
+                               creature_ptr->leaving = TRUE;
                        }
                        else
                        {
                                msg_print(_("下に引きずり降ろされる感じがする!", "You feel yourself yanked downwards!"));
 
-                               p_ptr->dungeon_idx = p_ptr->recall_dungeon;
+                               creature_ptr->dungeon_idx = creature_ptr->recall_dungeon;
 
                                if (record_stair)
-                                       do_cmd_write_nikki(NIKKI_RECALL, current_floor_ptr->dun_level, NULL);
+                                       exe_write_diary(creature_ptr, NIKKI_RECALL, floor_ptr->dun_level, NULL);
 
                                /* New depth */
-                               current_floor_ptr->dun_level = max_dlv[p_ptr->dungeon_idx];
-                               if (current_floor_ptr->dun_level < 1) current_floor_ptr->dun_level = 1;
+                               floor_ptr->dun_level = max_dlv[creature_ptr->dungeon_idx];
+                               if (floor_ptr->dun_level < 1) floor_ptr->dun_level = 1;
 
                                /* Nightmare mode makes recall more dangerous */
-                               if (ironman_nightmare && !randint0(666) && (p_ptr->dungeon_idx == DUNGEON_ANGBAND))
+                               if (ironman_nightmare && !randint0(666) && (creature_ptr->dungeon_idx == DUNGEON_ANGBAND))
                                {
-                                       if (current_floor_ptr->dun_level < 50)
+                                       if (floor_ptr->dun_level < 50)
                                        {
-                                               current_floor_ptr->dun_level *= 2;
+                                               floor_ptr->dun_level *= 2;
                                        }
-                                       else if (current_floor_ptr->dun_level < 99)
+                                       else if (floor_ptr->dun_level < 99)
                                        {
-                                               current_floor_ptr->dun_level = (current_floor_ptr->dun_level + 99) / 2;
+                                               floor_ptr->dun_level = (floor_ptr->dun_level + 99) / 2;
                                        }
-                                       else if (current_floor_ptr->dun_level > 100)
+                                       else if (floor_ptr->dun_level > 100)
                                        {
-                                               current_floor_ptr->dun_level = d_info[p_ptr->dungeon_idx].maxdepth - 1;
+                                               floor_ptr->dun_level = d_info[creature_ptr->dungeon_idx].maxdepth - 1;
                                        }
                                }
 
-                               if (p_ptr->wild_mode)
+                               if (creature_ptr->wild_mode)
                                {
-                                       p_ptr->wilderness_y = p_ptr->y;
-                                       p_ptr->wilderness_x = p_ptr->x;
+                                       creature_ptr->wilderness_y = creature_ptr->y;
+                                       creature_ptr->wilderness_x = creature_ptr->x;
                                }
                                else
                                {
                                        /* Save player position */
-                                       p_ptr->oldpx = p_ptr->x;
-                                       p_ptr->oldpy = p_ptr->y;
+                                       creature_ptr->oldpx = creature_ptr->x;
+                                       creature_ptr->oldpy = creature_ptr->y;
                                }
-                               p_ptr->wild_mode = FALSE;
+                               creature_ptr->wild_mode = FALSE;
 
                                /*
                                 * Clear all saved floors
                                 * and create a first saved floor
                                 */
                                prepare_change_floor_mode(CFM_FIRST_FLOOR);
-                               p_ptr->leaving = TRUE;
+                               creature_ptr->leaving = TRUE;
 
-                               if (p_ptr->dungeon_idx == DUNGEON_ANGBAND)
+                               if (creature_ptr->dungeon_idx == DUNGEON_ANGBAND)
                                {
                                        int i;
 
@@ -3033,10 +3034,10 @@ static void process_world_aux_movement(void)
                                                
                                                if ((q_ptr->type == QUEST_TYPE_RANDOM) &&
                                                    (q_ptr->status == QUEST_STATUS_TAKEN) &&
-                                                   (q_ptr->level < current_floor_ptr->dun_level))
+                                                   (q_ptr->level < floor_ptr->dun_level))
                                                {
                                                        q_ptr->status = QUEST_STATUS_FAILED;
-                                                       q_ptr->complev = (byte)p_ptr->lev;
+                                                       q_ptr->complev = (byte)creature_ptr->lev;
                                                        update_playtime();
                                                        q_ptr->comptime = current_world_ptr->play_time;
                                                        r_info[q_ptr->r_idx].flags1 &= ~(RF1_QUESTOR);
@@ -3051,24 +3052,24 @@ static void process_world_aux_movement(void)
 
 
        /* Delayed Alter reality */
-       if (p_ptr->alter_reality)
+       if (creature_ptr->alter_reality)
        {
-               if (autosave_l && (p_ptr->alter_reality == 1) && !p_ptr->phase_out)
+               if (autosave_l && (creature_ptr->alter_reality == 1) && !creature_ptr->phase_out)
                        do_cmd_save_game(TRUE);
 
                /* Count down towards alter */
-               p_ptr->alter_reality--;
+               creature_ptr->alter_reality--;
 
-               p_ptr->redraw |= (PR_STATUS);
+               creature_ptr->redraw |= (PR_STATUS);
 
                /* Activate the alter reality */
-               if (!p_ptr->alter_reality)
+               if (!creature_ptr->alter_reality)
                {
                        /* Disturbing! */
-                       disturb(FALSE, TRUE);
+                       disturb(creature_ptr, FALSE, TRUE);
 
                        /* Determine the level */
-                       if (!quest_number(current_floor_ptr->dun_level) && current_floor_ptr->dun_level)
+                       if (!quest_number(floor_ptr->dun_level) && floor_ptr->dun_level)
                        {
                                msg_print(_("世界が変わった!", "The world changes!"));
 
@@ -3077,7 +3078,7 @@ static void process_world_aux_movement(void)
                                 * and create a first saved floor
                                 */
                                prepare_change_floor_mode(CFM_FIRST_FLOOR);
-                               p_ptr->leaving = TRUE;
+                               creature_ptr->leaving = TRUE;
                        }
                        else
                        {
@@ -3105,12 +3106,12 @@ static void process_world(void)
        extract_day_hour_min(&day, &hour, &min);
 
        /* Update dungeon feeling, and announce it if changed */
-       update_dungeon_feeling();
+       update_dungeon_feeling(p_ptr, p_ptr->current_floor_ptr);
 
        /* 帰還無しモード時のレベルテレポバグ対策 / Fix for level teleport bugs on ironman_downward.*/
        if (ironman_downward && (p_ptr->dungeon_idx != DUNGEON_ANGBAND && p_ptr->dungeon_idx != 0))
        {
-               current_floor_ptr->dun_level = 0;
+               p_ptr->current_floor_ptr->dun_level = 0;
                p_ptr->dungeon_idx = 0;
                prepare_change_floor_mode(CFM_FIRST_FLOOR | CFM_RAND_PLACE);
                p_ptr->inside_arena = FALSE;
@@ -3126,10 +3127,10 @@ static void process_world(void)
                int number_mon = 0;
 
                /* Count all hostile monsters */
-               for (i2 = 0; i2 < current_floor_ptr->width; ++i2)
-                       for (j2 = 0; j2 < current_floor_ptr->height; j2++)
+               for (i2 = 0; i2 < p_ptr->current_floor_ptr->width; ++i2)
+                       for (j2 = 0; j2 < p_ptr->current_floor_ptr->height; j2++)
                        {
-                               grid_type *g_ptr = &current_floor_ptr->grid_array[j2][i2];
+                               grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[j2][i2];
 
                                if ((g_ptr->m_idx > 0) && (g_ptr->m_idx != p_ptr->riding))
                                {
@@ -3150,7 +3151,7 @@ static void process_world(void)
                        GAME_TEXT m_name[MAX_NLEN];
                        monster_type *wm_ptr;
 
-                       wm_ptr = &current_floor_ptr->m_list[win_m_idx];
+                       wm_ptr = &p_ptr->current_floor_ptr->m_list[win_m_idx];
 
                        monster_desc(m_name, wm_ptr, 0);
                        msg_format(_("%sが勝利した!", "%s is winner!"), m_name);
@@ -3170,7 +3171,7 @@ static void process_world(void)
                        p_ptr->energy_need = 0;
                        update_gambling_monsters();
                }
-               else if (current_world_ptr->game_turn - current_floor_ptr->generated_turn == 150 * TURNS_PER_TICK)
+               else if (current_world_ptr->game_turn - p_ptr->current_floor_ptr->generated_turn == 150 * TURNS_PER_TICK)
                {
                        msg_print(_("申し分けありませんが、この勝負は引き分けとさせていただきます。", "This battle have ended in a draw."));
                        p_ptr->au += kakekin;
@@ -3190,7 +3191,7 @@ static void process_world(void)
                        do_cmd_save_game(TRUE);
        }
 
-       if (current_floor_ptr->monster_noise && !ignore_unview)
+       if (p_ptr->current_floor_ptr->monster_noise && !ignore_unview)
        {
                msg_print(_("何かが聞こえた。", "You hear noise."));
        }
@@ -3198,7 +3199,7 @@ static void process_world(void)
        /*** Handle the wilderness/town (sunshine) ***/
 
        /* While in town/wilderness */
-       if (!current_floor_ptr->dun_level && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)
+       if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)
        {
                /* Hack -- Daybreak/Nighfall in town */
                if (!(current_world_ptr->game_turn % ((TURNS_PER_TICK * TOWN_DAWN) / 2)))
@@ -3208,14 +3209,14 @@ static void process_world(void)
                        /* Check for dawn */
                        dawn = (!(current_world_ptr->game_turn % (TURNS_PER_TICK * TOWN_DAWN)));
 
-                       if (dawn) day_break();
-                       else night_falls();
+                       if (dawn) day_break(p_ptr->current_floor_ptr);
+                       else night_falls(p_ptr->current_floor_ptr);
 
                }
        }
 
        /* While in the dungeon (vanilla_town or lite_town mode only) */
-       else if ((vanilla_town || (lite_town && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)) && current_floor_ptr->dun_level)
+       else if ((vanilla_town || (lite_town && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)) && p_ptr->current_floor_ptr->dun_level)
        {
                /*** Shuffle the Storekeepers ***/
 
@@ -3283,7 +3284,7 @@ static void process_world(void)
                /* Hack -- Process the counters of monsters if needed */
                for (i = 0; i < MAX_MTIMED; i++)
                {
-                       if (current_floor_ptr->mproc_max[i] > 0) process_monsters_mtimed(i);
+                       if (p_ptr->current_floor_ptr->mproc_max[i] > 0) process_monsters_mtimed(i);
                }
        }
 
@@ -3293,7 +3294,7 @@ static void process_world(void)
        {
                if (min != prev_min)
                {
-                       do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
+                       exe_write_diary(p_ptr, NIKKI_HIGAWARI, 0, NULL);
                        determine_today_mon(FALSE);
                }
        }
@@ -3309,7 +3310,7 @@ static void process_world(void)
                /* Every 15 minutes after 11:00 pm */
                if ((hour == 23) && !(min % 15))
                {
-                       disturb(FALSE, TRUE);
+                       disturb(p_ptr, FALSE, TRUE);
 
                        switch (min / 15)
                        {
@@ -3335,7 +3336,7 @@ static void process_world(void)
                if (!hour && !min)
                {
 
-                       disturb(TRUE, TRUE);
+                       disturb(p_ptr, TRUE, TRUE);
                        msg_print(_("遠くで鐘が何回も鳴り、死んだような静けさの中へ消えていった。", "A distant bell tolls many times, fading into an deathly silence."));
 
                        if (p_ptr->wild_mode)
@@ -3354,16 +3355,16 @@ static void process_world(void)
                }
        }
 
-       process_world_aux_digestion();
-       process_world_aux_hp_and_sp();
-       process_world_aux_timeout();
-       process_world_aux_light();
-       process_world_aux_mutation();
-       process_world_aux_curse();
-       process_world_aux_recharge();
-       sense_inventory1();
-       sense_inventory2();
-       process_world_aux_movement();
+       process_world_aux_digestion(p_ptr);
+       process_world_aux_hp_and_sp(p_ptr);
+       process_world_aux_timeout(p_ptr);
+       process_world_aux_light(p_ptr);
+       process_world_aux_mutation(p_ptr);
+       process_world_aux_curse(p_ptr);
+       process_world_aux_recharge(p_ptr);
+       sense_inventory1(p_ptr);
+       sense_inventory2(p_ptr);
+       process_world_aux_movement(p_ptr);
 }
 
 /*!
@@ -3394,7 +3395,7 @@ static bool enter_wizard_mode(void)
                        return (FALSE);
                }
 
-               do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("ウィザードモードに突入してスコアを残せなくなった。", "give up recording score to enter wizard mode."));
+               exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, _("ウィザードモードに突入してスコアを残せなくなった。", "give up recording score to enter wizard mode."));
                /* Mark savefile */
                p_ptr->noscore |= 0x0002;
        }
@@ -3435,7 +3436,7 @@ static bool enter_debug_mode(void)
                        return (FALSE);
                }
 
-               do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("デバッグモードに突入してスコアを残せなくなった。", "give up sending score to use debug commands."));
+               exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, _("デバッグモードに突入してスコアを残せなくなった。", "give up sending score to use debug commands."));
                /* Mark savefile */
                p_ptr->noscore |= 0x0008;
        }
@@ -3447,7 +3448,7 @@ static bool enter_debug_mode(void)
 /*
  * Hack -- Declare the Debug Routines
  */
-extern void do_cmd_debug(void);
+extern void do_cmd_debug(player_type *creature_ptr);
 
 #endif /* ALLOW_WIZARD */
 
@@ -3476,7 +3477,7 @@ static bool enter_borg_mode(void)
                        return (FALSE);
                }
 
-               do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("ボーグ・コマンドを使用してスコアを残せなくなった。", "give up recording score to use borg commands."));
+               exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, _("ボーグ・コマンドを使用してスコアを残せなくなった。", "give up recording score to use borg commands."));
                /* Mark savefile */
                p_ptr->noscore |= 0x0010;
        }
@@ -3499,7 +3500,7 @@ extern void do_cmd_borg(void);
  * @todo Make some "blocks"
  * @return なし
  */
-static void process_command(void)
+static void process_command(player_type *creature_ptr)
 {
        COMMAND_CODE old_now_message = now_message;
 
@@ -3509,8 +3510,8 @@ static void process_command(void)
        now_message = 0;
 
        /* Sniper */
-       if ((p_ptr->pclass == CLASS_SNIPER) && (p_ptr->concent))
-               p_ptr->reset_concent = TRUE;
+       if ((creature_ptr->pclass == CLASS_SNIPER) && (creature_ptr->concent))
+               creature_ptr->reset_concent = TRUE;
 
        /* Parse the command */
        switch (command_cmd)
@@ -3532,18 +3533,18 @@ static void process_command(void)
                /*** Wizard Commands ***/
                case KTRL('W'):
                {
-                       if (p_ptr->wizard)
+                       if (current_world_ptr->wizard)
                        {
-                               p_ptr->wizard = FALSE;
+                               current_world_ptr->wizard = FALSE;
                                msg_print(_("ウィザードモード解除。", "Wizard mode off."));
                        }
                        else if (enter_wizard_mode())
                        {
-                               p_ptr->wizard = TRUE;
+                               current_world_ptr->wizard = TRUE;
                                msg_print(_("ウィザードモード突入。", "Wizard mode on."));
                        }
-                       p_ptr->update |= (PU_MONSTERS);
-                       p_ptr->redraw |= (PR_TITLE);
+                       creature_ptr->update |= (PU_MONSTERS);
+                       creature_ptr->redraw |= (PR_TITLE);
 
                        break;
                }
@@ -3556,7 +3557,7 @@ static void process_command(void)
                {
                        if (enter_debug_mode())
                        {
-                               do_cmd_debug();
+                               do_cmd_debug(creature_ptr);
                        }
                        break;
                }
@@ -3571,7 +3572,7 @@ static void process_command(void)
                {
                        if (enter_borg_mode())
                        {
-                               if (!p_ptr->wild_mode) do_cmd_borg();
+                               if (!creature_ptr->wild_mode) do_cmd_borg();
                        }
                        break;
                }
@@ -3585,42 +3586,42 @@ static void process_command(void)
                /* Wear/wield equipment */
                case 'w':
                {
-                       if (!p_ptr->wild_mode) do_cmd_wield();
+                       if (!creature_ptr->wild_mode) do_cmd_wield(creature_ptr);
                        break;
                }
 
                /* Take off equipment */
                case 't':
                {
-                       if (!p_ptr->wild_mode) do_cmd_takeoff();
+                       if (!creature_ptr->wild_mode) do_cmd_takeoff(creature_ptr);
                        break;
                }
 
                /* Drop an item */
                case 'd':
                {
-                       if (!p_ptr->wild_mode) do_cmd_drop();
+                       if (!creature_ptr->wild_mode) do_cmd_drop(creature_ptr);
                        break;
                }
 
                /* Destroy an item */
                case 'k':
                {
-                       do_cmd_destroy();
+                       do_cmd_destroy(creature_ptr);
                        break;
                }
 
                /* Equipment list */
                case 'e':
                {
-                       do_cmd_equip();
+                       do_cmd_equip(creature_ptr);
                        break;
                }
 
                /* Inventory list */
                case 'i':
                {
-                       do_cmd_inven();
+                       do_cmd_inven(creature_ptr);
                        break;
                }
 
@@ -3630,13 +3631,13 @@ static void process_command(void)
                /* Identify an object */
                case 'I':
                {
-                       do_cmd_observe();
+                       do_cmd_observe(creature_ptr);
                        break;
                }
 
                case KTRL('I'):
                {
-                       toggle_inven_equip(p_ptr);
+                       toggle_inven_equip(creature_ptr);
                        break;
                }
 
@@ -3646,28 +3647,28 @@ static void process_command(void)
                /* Alter a grid */
                case '+':
                {
-                       if (!p_ptr->wild_mode) do_cmd_alter();
+                       if (!creature_ptr->wild_mode) do_cmd_alter(creature_ptr);
                        break;
                }
 
                /* Dig a tunnel */
                case 'T':
                {
-                       if (!p_ptr->wild_mode) do_cmd_tunnel(p_ptr);
+                       if (!creature_ptr->wild_mode) do_cmd_tunnel(creature_ptr);
                        break;
                }
 
                /* Move (usually pick up things) */
                case ';':
                {
-                       do_cmd_walk(p_ptr, FALSE);
+                       do_cmd_walk(creature_ptr, FALSE);
                        break;
                }
 
                /* Move (usually do not pick up) */
                case '-':
                {
-                       do_cmd_walk(p_ptr, TRUE);
+                       do_cmd_walk(creature_ptr, TRUE);
                        break;
                }
 
@@ -3677,42 +3678,42 @@ static void process_command(void)
                /* Begin Running -- Arg is Max Distance */
                case '.':
                {
-                       if (!p_ptr->wild_mode) do_cmd_run(p_ptr);
+                       if (!creature_ptr->wild_mode) do_cmd_run(creature_ptr);
                        break;
                }
 
                /* Stay still (usually pick things up) */
                case ',':
                {
-                       do_cmd_stay(p_ptr, always_pickup);
+                       do_cmd_stay(creature_ptr, always_pickup);
                        break;
                }
 
                /* Stay still (usually do not pick up) */
                case 'g':
                {
-                       do_cmd_stay(p_ptr, !always_pickup);
+                       do_cmd_stay(creature_ptr, !always_pickup);
                        break;
                }
 
                /* Rest -- Arg is time */
                case 'R':
                {
-                       do_cmd_rest(p_ptr);
+                       do_cmd_rest(creature_ptr);
                        break;
                }
 
                /* Search for traps/doors */
                case 's':
                {
-                       do_cmd_search(p_ptr);
+                       do_cmd_search(creature_ptr);
                        break;
                }
 
                case 'S':
                {
-                       if (p_ptr->action == ACTION_SEARCH) set_action(p_ptr, ACTION_NONE);
-                       else set_action(p_ptr, ACTION_SEARCH);
+                       if (creature_ptr->action == ACTION_SEARCH) set_action(creature_ptr, ACTION_NONE);
+                       else set_action(creature_ptr, ACTION_SEARCH);
                        break;
                }
 
@@ -3743,17 +3744,17 @@ static void process_command(void)
                /* Go up staircase */
                case '<':
                {
-                       if (!p_ptr->wild_mode && !current_floor_ptr->dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
+                       if (!creature_ptr->wild_mode && !p_ptr->current_floor_ptr->dun_level && !creature_ptr->inside_arena && !creature_ptr->inside_quest)
                        {
                                if (vanilla_town) break;
 
-                               if (p_ptr->ambush_flag)
+                               if (creature_ptr->ambush_flag)
                                {
                                        msg_print(_("襲撃から逃げるにはマップの端まで移動しなければならない。", "To flee the ambush you have to reach the edge of the map."));
                                        break;
                                }
 
-                               if (p_ptr->food < PY_FOOD_WEAK)
+                               if (creature_ptr->food < PY_FOOD_WEAK)
                                {
                                        msg_print(_("その前に食事をとらないと。", "You must eat something here."));
                                        break;
@@ -3762,52 +3763,52 @@ static void process_command(void)
                                change_wild_mode(FALSE);
                        }
                        else
-                               do_cmd_go_up(p_ptr);
+                               do_cmd_go_up(creature_ptr);
                        break;
                }
 
                /* Go down staircase */
                case '>':
                {
-                       if (p_ptr->wild_mode)
+                       if (creature_ptr->wild_mode)
                                change_wild_mode(FALSE);
                        else
-                               do_cmd_go_down(p_ptr);
+                               do_cmd_go_down(creature_ptr);
                        break;
                }
 
                /* Open a door or chest */
                case 'o':
                {
-                       do_cmd_open(p_ptr);
+                       do_cmd_open(creature_ptr);
                        break;
                }
 
                /* Close a door */
                case 'c':
                {
-                       do_cmd_close(p_ptr);
+                       do_cmd_close(creature_ptr);
                        break;
                }
 
                /* Jam a door with spikes */
                case 'j':
                {
-                       do_cmd_spike(p_ptr);
+                       do_cmd_spike(creature_ptr);
                        break;
                }
 
                /* Bash a door */
                case 'B':
                {
-                       do_cmd_bash(p_ptr);
+                       do_cmd_bash(creature_ptr);
                        break;
                }
 
                /* Disarm a trap or chest */
                case 'D':
                {
-                       do_cmd_disarm(p_ptr);
+                       do_cmd_disarm(creature_ptr);
                        break;
                }
 
@@ -3817,32 +3818,32 @@ static void process_command(void)
                /* Gain new spells/prayers */
                case 'G':
                {
-                       if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
+                       if ((creature_ptr->pclass == CLASS_SORCERER) || (creature_ptr->pclass == CLASS_RED_MAGE))
                                msg_print(_("呪文を学習する必要はない!", "You don't have to learn spells!"));
-                       else if (p_ptr->pclass == CLASS_SAMURAI)
-                               do_cmd_gain_hissatsu();
-                       else if (p_ptr->pclass == CLASS_MAGIC_EATER)
-                               import_magic_device();
+                       else if (creature_ptr->pclass == CLASS_SAMURAI)
+                               do_cmd_gain_hissatsu(creature_ptr);
+                       else if (creature_ptr->pclass == CLASS_MAGIC_EATER)
+                               import_magic_device(creature_ptr);
                        else
-                               do_cmd_study();
+                               do_cmd_study(creature_ptr);
                        break;
                }
 
                /* Browse a book */
                case 'b':
                {
-                       if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
-                            (p_ptr->pclass == CLASS_BERSERKER) ||
-                            (p_ptr->pclass == CLASS_NINJA) ||
-                            (p_ptr->pclass == CLASS_MIRROR_MASTER) 
+                       if ( (creature_ptr->pclass == CLASS_MINDCRAFTER) ||
+                            (creature_ptr->pclass == CLASS_BERSERKER) ||
+                            (creature_ptr->pclass == CLASS_NINJA) ||
+                            (creature_ptr->pclass == CLASS_MIRROR_MASTER) 
                             ) do_cmd_mind_browse();
-                       else if (p_ptr->pclass == CLASS_SMITH)
-                               do_cmd_kaji(TRUE);
-                       else if (p_ptr->pclass == CLASS_MAGIC_EATER)
-                               do_cmd_magic_eater(TRUE, FALSE);
-                       else if (p_ptr->pclass == CLASS_SNIPER)
-                               do_cmd_snipe_browse();
-                       else do_cmd_browse();
+                       else if (creature_ptr->pclass == CLASS_SMITH)
+                               do_cmd_kaji(creature_ptr, TRUE);
+                       else if (creature_ptr->pclass == CLASS_MAGIC_EATER)
+                               do_cmd_magic_eater(creature_ptr, TRUE, FALSE);
+                       else if (creature_ptr->pclass == CLASS_SNIPER)
+                               do_cmd_snipe_browse(creature_ptr);
+                       else do_cmd_browse(creature_ptr);
                        break;
                }
 
@@ -3850,63 +3851,63 @@ static void process_command(void)
                case 'm':
                {
                        /* -KMW- */
-                       if (!p_ptr->wild_mode)
+                       if (!creature_ptr->wild_mode)
                        {
-                               if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_CAVALRY))
+                               if ((creature_ptr->pclass == CLASS_WARRIOR) || (creature_ptr->pclass == CLASS_ARCHER) || (creature_ptr->pclass == CLASS_CAVALRY))
                                {
                                        msg_print(_("呪文を唱えられない!", "You cannot cast spells!"));
                                }
-                               else if (current_floor_ptr->dun_level && (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
+                               else if (p_ptr->current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH))
                                {
                                        msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!"));
                                        msg_print(NULL);
                                }
-                               else if (p_ptr->anti_magic && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
+                               else if (creature_ptr->anti_magic && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH))
                                {
                                        concptr which_power = _("魔法", "magic");
-                                       if (p_ptr->pclass == CLASS_MINDCRAFTER)
+                                       if (creature_ptr->pclass == CLASS_MINDCRAFTER)
                                                which_power = _("超能力", "psionic powers");
-                                       else if (p_ptr->pclass == CLASS_IMITATOR)
+                                       else if (creature_ptr->pclass == CLASS_IMITATOR)
                                                which_power = _("ものまね", "imitation");
-                                       else if (p_ptr->pclass == CLASS_SAMURAI)
+                                       else if (creature_ptr->pclass == CLASS_SAMURAI)
                                                which_power = _("必殺剣", "hissatsu");
-                                       else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
+                                       else if (creature_ptr->pclass == CLASS_MIRROR_MASTER)
                                                which_power = _("鏡魔法", "mirror magic");
-                                       else if (p_ptr->pclass == CLASS_NINJA)
+                                       else if (creature_ptr->pclass == CLASS_NINJA)
                                                which_power = _("忍術", "ninjutsu");
                                        else if (mp_ptr->spell_book == TV_LIFE_BOOK)
                                                which_power = _("祈り", "prayer");
 
                                        msg_format(_("反魔法バリアが%sを邪魔した!", "An anti-magic shell disrupts your %s!"), which_power);
-                                       free_turn(p_ptr);
+                                       free_turn(creature_ptr);
                                }
-                               else if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER))
+                               else if (creature_ptr->shero && (creature_ptr->pclass != CLASS_BERSERKER))
                                {
                                        msg_format(_("狂戦士化していて頭が回らない!", "You cannot think directly!"));
-                                       free_turn(p_ptr);
+                                       free_turn(creature_ptr);
                                }
                                else
                                {
-                                       if ((p_ptr->pclass == CLASS_MINDCRAFTER) ||
-                                           (p_ptr->pclass == CLASS_BERSERKER) ||
-                                           (p_ptr->pclass == CLASS_NINJA) ||
-                                           (p_ptr->pclass == CLASS_MIRROR_MASTER)
+                                       if ((creature_ptr->pclass == CLASS_MINDCRAFTER) ||
+                                           (creature_ptr->pclass == CLASS_BERSERKER) ||
+                                           (creature_ptr->pclass == CLASS_NINJA) ||
+                                           (creature_ptr->pclass == CLASS_MIRROR_MASTER)
                                            )
                                                do_cmd_mind();
-                                       else if (p_ptr->pclass == CLASS_IMITATOR)
-                                               do_cmd_mane(FALSE);
-                                       else if (p_ptr->pclass == CLASS_MAGIC_EATER)
-                                               do_cmd_magic_eater(FALSE, FALSE);
-                                       else if (p_ptr->pclass == CLASS_SAMURAI)
-                                               do_cmd_hissatsu();
-                                       else if (p_ptr->pclass == CLASS_BLUE_MAGE)
+                                       else if (creature_ptr->pclass == CLASS_IMITATOR)
+                                               do_cmd_mane(creature_ptr, FALSE);
+                                       else if (creature_ptr->pclass == CLASS_MAGIC_EATER)
+                                               do_cmd_magic_eater(creature_ptr, FALSE, FALSE);
+                                       else if (creature_ptr->pclass == CLASS_SAMURAI)
+                                               do_cmd_hissatsu(creature_ptr);
+                                       else if (creature_ptr->pclass == CLASS_BLUE_MAGE)
                                                do_cmd_cast_learned();
-                                       else if (p_ptr->pclass == CLASS_SMITH)
-                                               do_cmd_kaji(FALSE);
-                                       else if (p_ptr->pclass == CLASS_SNIPER)
-                                               do_cmd_snipe();
+                                       else if (creature_ptr->pclass == CLASS_SMITH)
+                                               do_cmd_kaji(creature_ptr, FALSE);
+                                       else if (creature_ptr->pclass == CLASS_SNIPER)
+                                               do_cmd_snipe(creature_ptr);
                                        else
-                                               do_cmd_cast();
+                                               do_cmd_cast(creature_ptr);
                                }
                        }
                        break;
@@ -3915,7 +3916,7 @@ static void process_command(void)
                /* Issue a pet command */
                case 'p':
                {
-                       do_cmd_pet();
+                       do_cmd_pet(creature_ptr);
                        break;
                }
 
@@ -3924,56 +3925,56 @@ static void process_command(void)
                /* Inscribe an object */
                case '{':
                {
-                       do_cmd_inscribe();
+                       do_cmd_inscribe(creature_ptr);
                        break;
                }
 
                /* Uninscribe an object */
                case '}':
                {
-                       do_cmd_uninscribe();
+                       do_cmd_uninscribe(creature_ptr);
                        break;
                }
 
                /* Activate an artifact */
                case 'A':
                {
-                       do_cmd_activate(p_ptr);
+                       do_cmd_activate(creature_ptr);
                        break;
                }
 
                /* Eat some food */
                case 'E':
                {
-                       do_cmd_eat_food();
+                       do_cmd_eat_food(creature_ptr);
                        break;
                }
 
                /* Fuel your lantern/torch */
                case 'F':
                {
-                       do_cmd_refill();
+                       do_cmd_refill(creature_ptr);
                        break;
                }
 
                /* Fire an item */
                case 'f':
                {
-                       do_cmd_fire(p_ptr, SP_NONE);
+                       do_cmd_fire(creature_ptr, SP_NONE);
                        break;
                }
 
                /* Throw an item */
                case 'v':
                {
-                       do_cmd_throw(p_ptr, 1, FALSE, -1);
+                       do_cmd_throw(creature_ptr, 1, FALSE, -1);
                        break;
                }
 
                /* Aim a wand */
                case 'a':
                {
-                       do_cmd_aim_wand();
+                       do_cmd_aim_wand(creature_ptr);
                        break;
                }
 
@@ -3982,11 +3983,11 @@ static void process_command(void)
                {
                        if (use_command && rogue_like_commands)
                        {
-                               do_cmd_use();
+                               do_cmd_use(creature_ptr);
                        }
                        else
                        {
-                               do_cmd_zap_rod();
+                               do_cmd_zap_rod(creature_ptr);
                        }
                        break;
                }
@@ -3994,14 +3995,14 @@ static void process_command(void)
                /* Quaff a potion */
                case 'q':
                {
-                       do_cmd_quaff_potion();
+                       do_cmd_quaff_potion(creature_ptr);
                        break;
                }
 
                /* Read a scroll */
                case 'r':
                {
-                       do_cmd_read_scroll();
+                       do_cmd_read_scroll(creature_ptr);
                        break;
                }
 
@@ -4009,16 +4010,16 @@ static void process_command(void)
                case 'u':
                {
                        if (use_command && !rogue_like_commands)
-                               do_cmd_use();
+                               do_cmd_use(creature_ptr);
                        else
-                               do_cmd_use_staff();
+                               do_cmd_use_staff(creature_ptr);
                        break;
                }
 
                /* Use racial power */
                case 'U':
                {
-                       do_cmd_racial_power();
+                       do_cmd_racial_power(creature_ptr);
                        break;
                }
 
@@ -4035,7 +4036,7 @@ static void process_command(void)
                /* Locate player on map */
                case 'L':
                {
-                       do_cmd_locate();
+                       do_cmd_locate(creature_ptr);
                        break;
                }
 
@@ -4074,7 +4075,7 @@ static void process_command(void)
                /* Character description */
                case 'C':
                {
-                       do_cmd_player_status();
+                       do_cmd_player_status(creature_ptr);
                        break;
                }
 
@@ -4110,23 +4111,23 @@ static void process_command(void)
                /* Interact with macros */
                case '@':
                {
-                       do_cmd_macros();
+                       do_cmd_macros(creature_ptr);
                        break;
                }
 
                /* Interact with visuals */
                case '%':
                {
-                       do_cmd_visuals();
-                       do_cmd_redraw();
+                       do_cmd_visuals(creature_ptr);
+                       do_cmd_redraw(creature_ptr);
                        break;
                }
 
                /* Interact with colors */
                case '&':
                {
-                       do_cmd_colors();
-                       do_cmd_redraw();
+                       do_cmd_colors(creature_ptr);
+                       do_cmd_redraw(creature_ptr);
                        break;
                }
 
@@ -4135,7 +4136,7 @@ static void process_command(void)
                {
                        do_cmd_options();
                        (void)combine_and_reorder_home(STORE_HOME);
-                       do_cmd_redraw();
+                       do_cmd_redraw(creature_ptr);
                        break;
                }
 
@@ -4158,7 +4159,7 @@ static void process_command(void)
                /* Repeat level feeling */
                case KTRL('F'):
                {
-                       do_cmd_feeling();
+                       do_cmd_feeling(creature_ptr);
                        break;
                }
 
@@ -4187,7 +4188,7 @@ static void process_command(void)
                case KTRL('R'):
                {
                        now_message = old_now_message;
-                       do_cmd_redraw();
+                       do_cmd_redraw(creature_ptr);
                        break;
                }
 
@@ -4219,7 +4220,7 @@ static void process_command(void)
                /* Quit (commit suicide) */
                case 'Q':
                {
-                       do_cmd_suicide();
+                       do_cmd_suicide(creature_ptr);
                        break;
                }
 
@@ -4267,10 +4268,10 @@ static void process_command(void)
 #ifdef TRAVEL
                case '`':
                {
-                       if (!p_ptr->wild_mode) do_cmd_travel();
-                       if (p_ptr->special_defense & KATA_MUSOU)
+                       if (!creature_ptr->wild_mode) do_cmd_travel(creature_ptr);
+                       if (creature_ptr->special_defense & KATA_MUSOU)
                        {
-                               set_action(p_ptr, ACTION_NONE);
+                               set_action(creature_ptr, ACTION_NONE);
                        }
                        break;
                }
@@ -4295,7 +4296,7 @@ static void process_command(void)
                        break;
                }
        }
-       if (!p_ptr->energy_use && !now_message)
+       if (!creature_ptr->energy_use && !now_message)
                now_message = old_now_message;
 }
 
@@ -4317,7 +4318,7 @@ static void pack_overflow(void)
                /* Access the slot to be dropped */
                o_ptr = &p_ptr->inventory_list[INVEN_PACK];
 
-               disturb(FALSE, TRUE);
+               disturb(p_ptr, FALSE, TRUE);
 
                /* Warning */
                msg_print(_("ザックからアイテムがあふれた!", "Your pack overflows!"));
@@ -4355,7 +4356,7 @@ static void process_upkeep_with_speed(void)
        while (p_ptr->enchant_energy_need <= 0)
        {
                /* Handle the player song */
-               if (!load) check_music();
+               if (!load) check_music(p_ptr);
 
                /* Hex - Handle the hex spells */
                if (!load) check_hex();
@@ -4374,7 +4375,7 @@ static void process_fishing(void)
                MONRACE_IDX r_idx;
                bool success = FALSE;
                get_mon_num_prep(monster_is_fishing_target, NULL);
-               r_idx = get_mon_num(current_floor_ptr->dun_level ? current_floor_ptr->dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
+               r_idx = get_mon_num(p_ptr->current_floor_ptr->dun_level ? p_ptr->current_floor_ptr->dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
                msg_print(NULL);
                if (r_idx && one_in_(2))
                {
@@ -4384,7 +4385,7 @@ static void process_fishing(void)
                        if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
                        {
                                GAME_TEXT m_name[MAX_NLEN];
-                               monster_desc(m_name, &current_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx], 0);
+                               monster_desc(m_name, &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[y][x].m_idx], 0);
                                msg_format(_("%sが釣れた!", "You have a good catch!"), m_name);
                                success = TRUE;
                        }
@@ -4393,7 +4394,7 @@ static void process_fishing(void)
                {
                        msg_print(_("餌だけ食われてしまった!くっそ~!", "Damn!  The fish stole your bait!"));
                }
-               disturb(FALSE, TRUE);
+               disturb(p_ptr, FALSE, TRUE);
        }
 }
 
@@ -4405,32 +4406,32 @@ static void process_fishing(void)
  * must come first just in case somebody manages to corrupt\n
  * the savefiles by clever use of menu commands or something.\n
  */
-static void process_player(void)
+static void process_player(player_type *creature_ptr)
 {
        MONSTER_IDX m_idx;
 
        /*** Apply energy ***/
 
-       if (p_ptr->hack_mutation)
+       if (creature_ptr->hack_mutation)
        {
                msg_print(_("何か変わった気がする!", "You feel different!"));
 
-               (void)gain_mutation(p_ptr, 0);
-               p_ptr->hack_mutation = FALSE;
+               (void)gain_mutation(creature_ptr, 0);
+               creature_ptr->hack_mutation = FALSE;
        }
 
-       if (p_ptr->invoking_midnight_curse)
+       if (creature_ptr->invoking_midnight_curse)
        {
                int count = 0;
                activate_ty_curse(FALSE, &count);
-               p_ptr->invoking_midnight_curse = FALSE;
+               creature_ptr->invoking_midnight_curse = FALSE;
        }
 
-       if (p_ptr->phase_out)
+       if (creature_ptr->phase_out)
        {
-               for(m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
+               for(m_idx = 1; m_idx < creature_ptr->current_floor_ptr->m_max; m_idx++)
                {
-                       monster_type *m_ptr = &current_floor_ptr->m_list[m_idx];
+                       monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
 
                        if (!monster_is_valid(m_ptr)) continue;
 
@@ -4441,56 +4442,56 @@ static void process_player(void)
        }
 
        /* Give the player some energy */
-       else if (!(load && p_ptr->energy_need <= 0))
+       else if (!(load && creature_ptr->energy_need <= 0))
        {
-               p_ptr->energy_need -= SPEED_TO_ENERGY(p_ptr->pspeed);
+               creature_ptr->energy_need -= SPEED_TO_ENERGY(creature_ptr->pspeed);
        }
 
        /* No current_world_ptr->game_turn yet */
-       if (p_ptr->energy_need > 0) return;
+       if (creature_ptr->energy_need > 0) return;
        if (!command_rep) prt_time();
 
        /*** Check for interupts ***/
 
        /* Complete resting */
-       if (p_ptr->resting < 0)
+       if (creature_ptr->resting < 0)
        {
                /* Basic resting */
-               if (p_ptr->resting == COMMAND_ARG_REST_FULL_HEALING)
+               if (creature_ptr->resting == COMMAND_ARG_REST_FULL_HEALING)
                {
                        /* Stop resting */
-                       if ((p_ptr->chp == p_ptr->mhp) &&
-                           (p_ptr->csp >= p_ptr->msp))
+                       if ((creature_ptr->chp == creature_ptr->mhp) &&
+                           (creature_ptr->csp >= creature_ptr->msp))
                        {
-                               set_action(p_ptr, ACTION_NONE);
+                               set_action(creature_ptr, ACTION_NONE);
                        }
                }
 
                /* Complete resting */
-               else if (p_ptr->resting == COMMAND_ARG_REST_UNTIL_DONE)
+               else if (creature_ptr->resting == COMMAND_ARG_REST_UNTIL_DONE)
                {
                        /* Stop resting */
-                       if ((p_ptr->chp == p_ptr->mhp) &&
-                           (p_ptr->csp >= p_ptr->msp) &&
-                           !p_ptr->blind && !p_ptr->confused &&
-                           !p_ptr->poisoned && !p_ptr->afraid &&
-                           !p_ptr->stun && !p_ptr->cut &&
-                           !p_ptr->slow && !p_ptr->paralyzed &&
-                           !p_ptr->image && !p_ptr->word_recall &&
-                           !p_ptr->alter_reality)
+                       if ((creature_ptr->chp == creature_ptr->mhp) &&
+                           (creature_ptr->csp >= creature_ptr->msp) &&
+                           !creature_ptr->blind && !creature_ptr->confused &&
+                           !creature_ptr->poisoned && !creature_ptr->afraid &&
+                           !creature_ptr->stun && !creature_ptr->cut &&
+                           !creature_ptr->slow && !creature_ptr->paralyzed &&
+                           !creature_ptr->image && !creature_ptr->word_recall &&
+                           !creature_ptr->alter_reality)
                        {
-                               set_action(p_ptr, ACTION_NONE);
+                               set_action(creature_ptr, ACTION_NONE);
                        }
                }
        }
 
-       if (p_ptr->action == ACTION_FISH) process_fishing();
+       if (creature_ptr->action == ACTION_FISH) process_fishing();
 
        /* Handle "abort" */
        if (check_abort)
        {
                /* Check for "player abort" (semi-efficiently for resting) */
-               if (p_ptr->running || travel.run || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH))
+               if (creature_ptr->running || travel.run || command_rep || (creature_ptr->action == ACTION_REST) || (creature_ptr->action == ACTION_FISH))
                {
                        /* Do not wait */
                        inkey_scan = TRUE;
@@ -4500,7 +4501,7 @@ static void process_player(void)
                        {
                                flush(); /* Flush input */
 
-                               disturb(FALSE, TRUE);
+                               disturb(creature_ptr, FALSE, TRUE);
 
                                /* Hack -- Show a Message */
                                msg_print(_("中断しました。", "Canceled."));
@@ -4508,9 +4509,9 @@ static void process_player(void)
                }
        }
 
-       if (p_ptr->riding && !p_ptr->confused && !p_ptr->blind)
+       if (creature_ptr->riding && !creature_ptr->confused && !creature_ptr->blind)
        {
-               monster_type *m_ptr = &current_floor_ptr->m_list[p_ptr->riding];
+               monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                if (MON_CSLEEP(m_ptr))
@@ -4518,7 +4519,7 @@ static void process_player(void)
                        GAME_TEXT m_name[MAX_NLEN];
 
                        /* Recover fully */
-                       (void)set_monster_csleep(p_ptr->riding, 0);
+                       (void)set_monster_csleep(creature_ptr->riding, 0);
                        monster_desc(m_name, m_ptr, 0);
                        msg_format(_("%^sを起こした。", "You have waked %s up."), m_name);
                }
@@ -4526,8 +4527,8 @@ static void process_player(void)
                if (MON_STUNNED(m_ptr))
                {
                        /* Hack -- Recover from stun */
-                       if (set_monster_stunned(p_ptr->riding,
-                               (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_STUNNED(m_ptr) - 1)))
+                       if (set_monster_stunned(creature_ptr->riding,
+                               (randint0(r_ptr->level) < creature_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_STUNNED(m_ptr) - 1)))
                        {
                                GAME_TEXT m_name[MAX_NLEN];
                                monster_desc(m_name, m_ptr, 0);
@@ -4538,8 +4539,8 @@ static void process_player(void)
                if (MON_CONFUSED(m_ptr))
                {
                        /* Hack -- Recover from confusion */
-                       if (set_monster_confused(p_ptr->riding,
-                               (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_CONFUSED(m_ptr) - 1)))
+                       if (set_monster_confused(creature_ptr->riding,
+                               (randint0(r_ptr->level) < creature_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_CONFUSED(m_ptr) - 1)))
                        {
                                GAME_TEXT m_name[MAX_NLEN];
                                monster_desc(m_name, m_ptr, 0);
@@ -4550,8 +4551,8 @@ static void process_player(void)
                if (MON_MONFEAR(m_ptr))
                {
                        /* Hack -- Recover from fear */
-                       if(set_monster_monfear(p_ptr->riding,
-                               (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_MONFEAR(m_ptr) - 1)))
+                       if(set_monster_monfear(creature_ptr->riding,
+                               (randint0(r_ptr->level) < creature_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_MONFEAR(m_ptr) - 1)))
                        {
                                GAME_TEXT m_name[MAX_NLEN];
                                monster_desc(m_name, m_ptr, 0);
@@ -4565,51 +4566,51 @@ static void process_player(void)
        load = FALSE;
 
        /* Fast */
-       if (p_ptr->lightspeed)
+       if (creature_ptr->lightspeed)
        {
-               (void)set_lightspeed(p_ptr, p_ptr->lightspeed - 1, TRUE);
+               (void)set_lightspeed(creature_ptr, creature_ptr->lightspeed - 1, TRUE);
        }
-       if ((p_ptr->pclass == CLASS_FORCETRAINER) && P_PTR_KI)
+       if ((creature_ptr->pclass == CLASS_FORCETRAINER) && P_PTR_KI)
        {
                if(P_PTR_KI < 40) P_PTR_KI = 0;
                else P_PTR_KI -= 40;
-               p_ptr->update |= (PU_BONUS);
+               creature_ptr->update |= (PU_BONUS);
        }
-       if (p_ptr->action == ACTION_LEARN)
+       if (creature_ptr->action == ACTION_LEARN)
        {
                s32b cost = 0L;
-               u32b cost_frac = (p_ptr->msp + 30L) * 256L;
+               u32b cost_frac = (creature_ptr->msp + 30L) * 256L;
 
                /* Convert the unit (1/2^16) to (1/2^32) */
                s64b_LSHIFT(cost, cost_frac, 16);
  
-               if (s64b_cmp(p_ptr->csp, p_ptr->csp_frac, cost, cost_frac) < 0)
+               if (s64b_cmp(creature_ptr->csp, creature_ptr->csp_frac, cost, cost_frac) < 0)
                {
                        /* Mana run out */
-                       p_ptr->csp = 0;
-                       p_ptr->csp_frac = 0;
-                       set_action(p_ptr, ACTION_NONE);
+                       creature_ptr->csp = 0;
+                       creature_ptr->csp_frac = 0;
+                       set_action(creature_ptr, ACTION_NONE);
                }
                else
                {
                        /* Reduce mana */
-                       s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), cost, cost_frac);
+                       s64b_sub(&(creature_ptr->csp), &(creature_ptr->csp_frac), cost, cost_frac);
                }
-               p_ptr->redraw |= PR_MANA;
+               creature_ptr->redraw |= PR_MANA;
        }
 
-       if (p_ptr->special_defense & KATA_MASK)
+       if (creature_ptr->special_defense & KATA_MASK)
        {
-               if (p_ptr->special_defense & KATA_MUSOU)
+               if (creature_ptr->special_defense & KATA_MUSOU)
                {
-                       if (p_ptr->csp < 3)
+                       if (creature_ptr->csp < 3)
                        {
-                               set_action(p_ptr, ACTION_NONE);
+                               set_action(creature_ptr, ACTION_NONE);
                        }
                        else
                        {
-                               p_ptr->csp -= 2;
-                               p_ptr->redraw |= (PR_MANA);
+                               creature_ptr->csp -= 2;
+                               creature_ptr->redraw |= (PR_MANA);
                        }
                }
        }
@@ -4617,17 +4618,17 @@ static void process_player(void)
        /*** Handle actual user input ***/
 
        /* Repeat until out of energy */
-       while (p_ptr->energy_need <= 0)
+       while (creature_ptr->energy_need <= 0)
        {
-               p_ptr->window |= PW_PLAYER;
-               p_ptr->sutemi = FALSE;
-               p_ptr->counter = FALSE;
-               p_ptr->now_damaged = FALSE;
+               creature_ptr->window |= PW_PLAYER;
+               creature_ptr->sutemi = FALSE;
+               creature_ptr->counter = FALSE;
+               creature_ptr->now_damaged = FALSE;
 
                handle_stuff();
 
                /* Place the cursor on the player */
-               move_cursor_relative(p_ptr->y, p_ptr->x);
+               move_cursor_relative(creature_ptr->y, creature_ptr->x);
 
                /* Refresh (optional) */
                if (fresh_before) Term_fresh();
@@ -4639,49 +4640,49 @@ static void process_player(void)
                if (!command_new) command_see = FALSE;
 
                /* Assume free current_world_ptr->game_turn */
-               free_turn(p_ptr);
+               free_turn(creature_ptr);
 
-               if (p_ptr->phase_out)
+               if (creature_ptr->phase_out)
                {
                        /* Place the cursor on the player */
-                       move_cursor_relative(p_ptr->y, p_ptr->x);
+                       move_cursor_relative(creature_ptr->y, creature_ptr->x);
 
                        command_cmd = SPECIAL_KEY_BUILDING;
 
                        /* Process the command */
-                       process_command();
+                       process_command(creature_ptr);
                }
 
                /* Paralyzed or Knocked Out */
-               else if (p_ptr->paralyzed || (p_ptr->stun >= 100))
+               else if (creature_ptr->paralyzed || (creature_ptr->stun >= 100))
                {
-                       take_turn(p_ptr, 100);
+                       take_turn(creature_ptr, 100);
                }
 
                /* Resting */
-               else if (p_ptr->action == ACTION_REST)
+               else if (creature_ptr->action == ACTION_REST)
                {
                        /* Timed rest */
-                       if (p_ptr->resting > 0)
+                       if (creature_ptr->resting > 0)
                        {
                                /* Reduce rest count */
-                               p_ptr->resting--;
+                               creature_ptr->resting--;
 
-                               if (!p_ptr->resting) set_action(p_ptr, ACTION_NONE);
-                               p_ptr->redraw |= (PR_STATE);
+                               if (!creature_ptr->resting) set_action(creature_ptr, ACTION_NONE);
+                               creature_ptr->redraw |= (PR_STATE);
                        }
 
-                       take_turn(p_ptr, 100);
+                       take_turn(creature_ptr, 100);
                }
 
                /* Fishing */
-               else if (p_ptr->action == ACTION_FISH)
+               else if (creature_ptr->action == ACTION_FISH)
                {
-                       take_turn(p_ptr, 100);
+                       take_turn(creature_ptr, 100);
                }
 
                /* Running */
-               else if (p_ptr->running)
+               else if (creature_ptr->running)
                {
                        /* Take a step */
                        run_step(0);
@@ -4702,7 +4703,7 @@ static void process_player(void)
                        /* Count this execution */
                        command_rep--;
 
-                       p_ptr->redraw |= (PR_STATE);
+                       creature_ptr->redraw |= (PR_STATE);
                        handle_stuff();
 
                        /* Hack -- Assume messages were seen */
@@ -4712,14 +4713,14 @@ static void process_player(void)
                        prt("", 0, 0);
 
                        /* Process the command */
-                       process_command();
+                       process_command(creature_ptr);
                }
 
                /* Normal command */
                else
                {
                        /* Place the cursor on the player */
-                       move_cursor_relative(p_ptr->y, p_ptr->x);
+                       move_cursor_relative(creature_ptr->y, creature_ptr->x);
 
                        can_save = TRUE;
                        /* Get a command (normal) */
@@ -4727,7 +4728,7 @@ static void process_player(void)
                        can_save = FALSE;
 
                        /* Process the command */
-                       process_command();
+                       process_command(creature_ptr);
                }
 
                /* Hack -- Pack Overflow */
@@ -4736,30 +4737,30 @@ static void process_player(void)
                /*** Clean up ***/
 
                /* Significant */
-               if (p_ptr->energy_use)
+               if (creature_ptr->energy_use)
                {
                        /* Use some energy */
-                       if (p_ptr->timewalk || p_ptr->energy_use > 400)
+                       if (creature_ptr->timewalk || creature_ptr->energy_use > 400)
                        {
                                /* The Randomness is irrelevant */
-                               p_ptr->energy_need += p_ptr->energy_use * TURNS_PER_TICK / 10;
+                               creature_ptr->energy_need += creature_ptr->energy_use * TURNS_PER_TICK / 10;
                        }
                        else
                        {
                                /* There is some randomness of needed energy */
-                               p_ptr->energy_need += (s16b)((s32b)p_ptr->energy_use * ENERGY_NEED() / 100L);
+                               creature_ptr->energy_need += (s16b)((s32b)creature_ptr->energy_use * ENERGY_NEED() / 100L);
                        }
 
                        /* Hack -- constant hallucination */
-                       if (p_ptr->image) p_ptr->redraw |= (PR_MAP);
+                       if (creature_ptr->image) creature_ptr->redraw |= (PR_MAP);
 
                        /* Shimmer multi-hued monsters */
-                       for (m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
+                       for (m_idx = 1; m_idx < creature_ptr->current_floor_ptr->m_max; m_idx++)
                        {
                                monster_type *m_ptr;
                                monster_race *r_ptr;
 
-                               m_ptr = &current_floor_ptr->m_list[m_idx];
+                               m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
                                if (!monster_is_valid(m_ptr)) continue;
 
                                /* Skip unseen monsters */
@@ -4784,10 +4785,10 @@ static void process_player(void)
                                repair_monsters = FALSE;
 
                                /* Rotate detection flags */
-                               for (m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
+                               for (m_idx = 1; m_idx < creature_ptr->current_floor_ptr->m_max; m_idx++)
                                {
                                        monster_type *m_ptr;
-                                       m_ptr = &current_floor_ptr->m_list[m_idx];
+                                       m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
                                        if (!monster_is_valid(m_ptr)) continue;
 
                                        /* Nice monsters get mean */
@@ -4820,8 +4821,8 @@ static void process_player(void)
                                                        m_ptr->ml = FALSE;
                                                        update_monster(m_idx, FALSE);
 
-                                                       if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
-                                                       if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
+                                                       if (creature_ptr->health_who == m_idx) creature_ptr->redraw |= (PR_HEALTH);
+                                                       if (creature_ptr->riding == m_idx) creature_ptr->redraw |= (PR_UHEALTH);
 
                                                        /* Redraw regardless */
                                                        lite_spot(m_ptr->fy, m_ptr->fx);
@@ -4829,55 +4830,55 @@ static void process_player(void)
                                        }
                                }
                        }
-                       if (p_ptr->pclass == CLASS_IMITATOR)
+                       if (creature_ptr->pclass == CLASS_IMITATOR)
                        {
                                int j;
-                               if (p_ptr->mane_num > (p_ptr->lev > 44 ? 3 : p_ptr->lev > 29 ? 2 : 1))
+                               if (creature_ptr->mane_num > (creature_ptr->lev > 44 ? 3 : creature_ptr->lev > 29 ? 2 : 1))
                                {
-                                       p_ptr->mane_num--;
-                                       for (j = 0; j < p_ptr->mane_num; j++)
+                                       creature_ptr->mane_num--;
+                                       for (j = 0; j < creature_ptr->mane_num; j++)
                                        {
-                                               p_ptr->mane_spell[j] = p_ptr->mane_spell[j + 1];
-                                               p_ptr->mane_dam[j] = p_ptr->mane_dam[j + 1];
+                                               creature_ptr->mane_spell[j] = creature_ptr->mane_spell[j + 1];
+                                               creature_ptr->mane_dam[j] = creature_ptr->mane_dam[j + 1];
                                        }
                                }
-                               p_ptr->new_mane = FALSE;
-                               p_ptr->redraw |= (PR_IMITATION);
+                               creature_ptr->new_mane = FALSE;
+                               creature_ptr->redraw |= (PR_IMITATION);
                        }
-                       if (p_ptr->action == ACTION_LEARN)
+                       if (creature_ptr->action == ACTION_LEARN)
                        {
-                               p_ptr->new_mane = FALSE;
-                               p_ptr->redraw |= (PR_STATE);
+                               creature_ptr->new_mane = FALSE;
+                               creature_ptr->redraw |= (PR_STATE);
                        }
 
-                       if (p_ptr->timewalk && (p_ptr->energy_need > - 1000))
+                       if (creature_ptr->timewalk && (creature_ptr->energy_need > - 1000))
                        {
 
-                               p_ptr->redraw |= (PR_MAP);
-                               p_ptr->update |= (PU_MONSTERS);
-                               p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+                               creature_ptr->redraw |= (PR_MAP);
+                               creature_ptr->update |= (PU_MONSTERS);
+                               creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
                                msg_print(_("「時は動きだす…」", "You feel time flowing around you once more."));
                                msg_print(NULL);
-                               p_ptr->timewalk = FALSE;
-                               p_ptr->energy_need = ENERGY_NEED();
+                               creature_ptr->timewalk = FALSE;
+                               creature_ptr->energy_need = ENERGY_NEED();
 
                                handle_stuff();
                        }
                }
 
                /* Hack -- notice death */
-               if (!p_ptr->playing || p_ptr->is_dead)
+               if (!creature_ptr->playing || creature_ptr->is_dead)
                {
-                       p_ptr->timewalk = FALSE;
+                       creature_ptr->timewalk = FALSE;
                        break;
                }
 
                /* Sniper */
-               if (p_ptr->energy_use && p_ptr->reset_concent) reset_concentration(TRUE);
+               if (creature_ptr->energy_use && creature_ptr->reset_concent) reset_concentration(creature_ptr, TRUE);
 
                /* Handle "leaving" */
-               if (p_ptr->leaving) break;
+               if (creature_ptr->leaving) break;
        }
 
        /* Update scent trail */
@@ -4902,7 +4903,7 @@ static void dungeon(bool load_game)
        int quest_num = 0;
 
        /* Set the base level */
-       current_floor_ptr->base_level = current_floor_ptr->dun_level;
+       p_ptr->current_floor_ptr->base_level = p_ptr->current_floor_ptr->dun_level;
 
        /* Reset various flags */
        current_world_ptr->is_loading_now = FALSE;
@@ -4936,10 +4937,10 @@ static void dungeon(bool load_game)
        repair_objects = TRUE;
 
 
-       disturb(TRUE, TRUE);
+       disturb(p_ptr, TRUE, TRUE);
 
        /* Get index of current quest (if any) */
-       quest_num = quest_number(current_floor_ptr->dun_level);
+       quest_num = quest_number(p_ptr->current_floor_ptr->dun_level);
 
        /* Inside a quest? */
        if (quest_num)
@@ -4956,13 +4957,13 @@ static void dungeon(bool load_game)
 
 
        /* Track maximum dungeon level (if not in quest -KMW-) */
-       if ((max_dlv[p_ptr->dungeon_idx] < current_floor_ptr->dun_level) && !p_ptr->inside_quest)
+       if ((max_dlv[p_ptr->dungeon_idx] < p_ptr->current_floor_ptr->dun_level) && !p_ptr->inside_quest)
        {
-               max_dlv[p_ptr->dungeon_idx] = current_floor_ptr->dun_level;
-               if (record_maxdepth) do_cmd_write_nikki(NIKKI_MAXDEAPTH, current_floor_ptr->dun_level, NULL);
+               max_dlv[p_ptr->dungeon_idx] = p_ptr->current_floor_ptr->dun_level;
+               if (record_maxdepth) exe_write_diary(p_ptr, NIKKI_MAXDEAPTH, p_ptr->current_floor_ptr->dun_level, NULL);
        }
 
-       (void)calculate_upkeep();
+       (void)calculate_upkeep(p_ptr);
 
        /* Validate the panel */
        panel_bounds_center();
@@ -4992,7 +4993,7 @@ static void dungeon(bool load_game)
 
        if (quest_num && (is_fixed_quest_idx(quest_num) &&
            !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) ||
-           !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling();
+           !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling(p_ptr);
 
        if (p_ptr->phase_out)
        {
@@ -5017,10 +5018,10 @@ static void dungeon(bool load_game)
        /* Print quest message if appropriate */
        if (!p_ptr->inside_quest && (p_ptr->dungeon_idx == DUNGEON_ANGBAND))
        {
-               quest_discovery(random_quest_number(current_floor_ptr->dun_level));
-               p_ptr->inside_quest = random_quest_number(current_floor_ptr->dun_level);
+               quest_discovery(random_quest_number(p_ptr->current_floor_ptr->dun_level));
+               p_ptr->inside_quest = random_quest_number(p_ptr->current_floor_ptr->dun_level);
        }
-       if ((current_floor_ptr->dun_level == d_info[p_ptr->dungeon_idx].maxdepth) && d_info[p_ptr->dungeon_idx].final_guardian)
+       if ((p_ptr->current_floor_ptr->dun_level == d_info[p_ptr->dungeon_idx].maxdepth) && d_info[p_ptr->dungeon_idx].final_guardian)
        {
                if (r_info[d_info[p_ptr->dungeon_idx].final_guardian].max_num)
 #ifdef JP
@@ -5039,15 +5040,15 @@ static void dungeon(bool load_game)
        /*** Process this dungeon level ***/
 
        /* Reset the monster generation level */
-       current_floor_ptr->monster_level = current_floor_ptr->base_level;
+       p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level;
 
        /* Reset the object generation level */
-       current_floor_ptr->object_level = current_floor_ptr->base_level;
+       p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level;
 
        current_world_ptr->is_loading_now = TRUE;
 
        if (p_ptr->energy_need > 0 && !p_ptr->phase_out &&
-           (current_floor_ptr->dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
+           (p_ptr->current_floor_ptr->dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
                p_ptr->energy_need = 0;
 
        /* Not leaving dungeon */
@@ -5060,20 +5061,20 @@ static void dungeon(bool load_game)
        while (TRUE)
        {
                /* Hack -- Compact the monster list occasionally */
-               if ((current_floor_ptr->m_cnt + 32 > current_floor_ptr->max_m_idx) && !p_ptr->phase_out) compact_monsters(64);
+               if ((p_ptr->current_floor_ptr->m_cnt + 32 > current_world_ptr->max_m_idx) && !p_ptr->phase_out) compact_monsters(64);
 
                /* Hack -- Compress the monster list occasionally */
-               if ((current_floor_ptr->m_cnt + 32 < current_floor_ptr->m_max) && !p_ptr->phase_out) compact_monsters(0);
+               if ((p_ptr->current_floor_ptr->m_cnt + 32 < p_ptr->current_floor_ptr->m_max) && !p_ptr->phase_out) compact_monsters(0);
 
 
                /* Hack -- Compact the object list occasionally */
-               if (current_floor_ptr->o_cnt + 32 > current_floor_ptr->max_o_idx) compact_objects(64);
+               if (p_ptr->current_floor_ptr->o_cnt + 32 > current_world_ptr->max_o_idx) compact_objects(64);
 
                /* Hack -- Compress the object list occasionally */
-               if (current_floor_ptr->o_cnt + 32 < current_floor_ptr->o_max) compact_objects(0);
+               if (p_ptr->current_floor_ptr->o_cnt + 32 < p_ptr->current_floor_ptr->o_max) compact_objects(0);
 
                /* Process the player */
-               process_player();
+               process_player(p_ptr);
                process_upkeep_with_speed();
 
                handle_stuff();
@@ -5146,7 +5147,7 @@ static void dungeon(bool load_game)
                 * Maintain Unique monsters and artifact, save current
                 * floor, then prepare next floor
                 */
-               leave_floor(p_ptr->change_floor_mode);
+               leave_floor(p_ptr);
 
                /* Forget the flag */
                reinit_wilderness = FALSE;
@@ -5390,7 +5391,7 @@ void play_game(bool new_game)
                current_world_ptr->character_dungeon = FALSE;
 
                /* Start in town */
-               current_floor_ptr->dun_level = 0;
+               p_ptr->current_floor_ptr->dun_level = 0;
                p_ptr->inside_quest = 0;
                p_ptr->inside_arena = FALSE;
                p_ptr->phase_out = FALSE;
@@ -5421,7 +5422,7 @@ void play_game(bool new_game)
        {
                write_level = FALSE;
 
-               do_cmd_write_nikki(NIKKI_GAMESTART, 1, 
+               exe_write_diary(p_ptr, NIKKI_GAMESTART, 1, 
                                          _("                            ----ゲーム再開----",
                                                "                            ---- Restart Game ----"));
 
@@ -5432,9 +5433,9 @@ void play_game(bool new_game)
                if (p_ptr->riding == -1)
                {
                        p_ptr->riding = 0;
-                       for (i = current_floor_ptr->m_max; i > 0; i--)
+                       for (i = p_ptr->current_floor_ptr->m_max; i > 0; i--)
                        {
-                               if (player_bold(current_floor_ptr->m_list[i].fy, current_floor_ptr->m_list[i].fx))
+                               if (player_bold(p_ptr->current_floor_ptr->m_list[i].fy, p_ptr->current_floor_ptr->m_list[i].fx))
                                {
                                        p_ptr->riding = i;
                                        break;
@@ -5454,8 +5455,8 @@ void play_game(bool new_game)
        record_o_name[0] = '\0';
 
        /* Reset map panel */
-       panel_row_min = current_floor_ptr->height;
-       panel_col_min = current_floor_ptr->width;
+       panel_row_min = p_ptr->current_floor_ptr->height;
+       panel_col_min = p_ptr->current_floor_ptr->width;
 
        /* Sexy gal gets bonus to maximum weapon skill of whip */
        if (p_ptr->pseikaku == SEIKAKU_SEXY)
@@ -5479,7 +5480,7 @@ void play_game(bool new_game)
        {
                if (enter_wizard_mode())
                {
-                       p_ptr->wizard = TRUE;
+                       current_world_ptr->wizard = TRUE;
 
                        if (p_ptr->is_dead || !p_ptr->y || !p_ptr->x)
                        {
@@ -5500,18 +5501,18 @@ void play_game(bool new_game)
        }
 
        /* Initialize the town-buildings if necessary */
-       if (!current_floor_ptr->dun_level && !p_ptr->inside_quest)
+       if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_quest)
        {
                process_dungeon_file("w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
                init_flags = INIT_ONLY_BUILDINGS;
                process_dungeon_file("t_info.txt", 0, 0, MAX_HGT, MAX_WID);
-               select_floor_music();
+               select_floor_music(p_ptr);
        }
 
        /* Generate a dungeon level if needed */
        if (!current_world_ptr->character_dungeon)
        {
-               change_floor(p_ptr->change_floor_mode);
+               change_floor(p_ptr);
        }
        else
        {
@@ -5522,7 +5523,7 @@ void play_game(bool new_game)
                        if (!p_ptr->y || !p_ptr->x)
                        {
                                msg_print(_("プレイヤーの位置がおかしい。フロアを再生成します。", "What a strange player location.  Regenerate the dungeon floor."));
-                               change_floor(p_ptr->change_floor_mode);
+                               change_floor(p_ptr);
                        }
 
                        /* Still no player?  -- Try to locate random place */
@@ -5545,7 +5546,7 @@ void play_game(bool new_game)
        {
                char buf[80];
                sprintf(buf, _("%sに降り立った。", "You are standing in the %s."), map_name());
-               do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
+               exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, buf);
        }
 
 
@@ -5587,7 +5588,7 @@ void play_game(bool new_game)
                monster_race *r_ptr = &r_info[pet_r_idx];
                place_monster_aux(0, p_ptr->y, p_ptr->x - 1, pet_r_idx,
                                  (PM_FORCE_PET | PM_NO_KAGE));
-               m_ptr = &current_floor_ptr->m_list[hack_m_idx_ii];
+               m_ptr = &p_ptr->current_floor_ptr->m_list[hack_m_idx_ii];
                m_ptr->mspeed = r_ptr->speed;
                m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2;
                m_ptr->max_maxhp = m_ptr->maxhp;
@@ -5599,7 +5600,7 @@ void play_game(bool new_game)
        (void)combine_and_reorder_home(STORE_HOME);
        (void)combine_and_reorder_home(STORE_MUSEUM);
 
-       select_floor_music();
+       select_floor_music(p_ptr);
 
        /* Process */
        while (TRUE)
@@ -5620,14 +5621,14 @@ void play_game(bool new_game)
                /* Cancel the health bar */
                health_track(0);
 
-               forget_lite();
+               forget_lite(p_ptr->current_floor_ptr);
                forget_view();
-               clear_mon_lite();
+               clear_mon_lite(p_ptr->current_floor_ptr);
 
                /* Handle "quit and save" */
                if (!p_ptr->playing && !p_ptr->is_dead) break;
 
-               /* Erase the old current_floor_ptr->grid_array */
+               /* Erase the old p_ptr->current_floor_ptr->grid_array */
                wipe_o_list();
                if (!p_ptr->is_dead) wipe_m_list();
 
@@ -5656,12 +5657,12 @@ void play_game(bool new_game)
                                prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_RAND_CONNECT);
 
                                /* prepare next floor */
-                               leave_floor(p_ptr->change_floor_mode);
+                               leave_floor(p_ptr);
                        }
                        else
                        {
                                /* Mega-Hack -- Allow player to cheat death */
-                               if ((p_ptr->wizard || cheat_live) && !get_check(_("死にますか? ", "Die? ")))
+                               if ((current_world_ptr->wizard || cheat_live) && !get_check(_("死にますか? ", "Die? ")))
                                {
                                        cheat_death(p_ptr);
                                }
@@ -5672,7 +5673,7 @@ void play_game(bool new_game)
                if (p_ptr->is_dead) break;
 
                /* Make a new level */
-               change_floor(p_ptr->change_floor_mode);
+               change_floor(p_ptr);
        }
 
        /* Close stuff */
@@ -5719,8 +5720,8 @@ void prevent_turn_overflow(void)
 
        if (current_world_ptr->game_turn > rollback_turns) current_world_ptr->game_turn -= rollback_turns;
        else current_world_ptr->game_turn = 1;
-       if (current_floor_ptr->generated_turn > rollback_turns) current_floor_ptr->generated_turn -= rollback_turns;
-       else current_floor_ptr->generated_turn = 1;
+       if (p_ptr->current_floor_ptr->generated_turn > rollback_turns) p_ptr->current_floor_ptr->generated_turn -= rollback_turns;
+       else p_ptr->current_floor_ptr->generated_turn = 1;
        if (current_world_ptr->arena_start_turn > rollback_turns) current_world_ptr->arena_start_turn -= rollback_turns;
        else current_world_ptr->arena_start_turn = 1;
        if (p_ptr->feeling_turn > rollback_turns) p_ptr->feeling_turn -= rollback_turns;