OSDN Git Service

[Fix] #39587 英文校正("temporal" → "temporary") / Proofreading English "temporal" to...
[hengband/hengband.git] / src / core.c
index cf86d4b..475240d 100644 (file)
@@ -220,8 +220,6 @@ static void sense_inventory_aux(INVENTORY_IDX slot, bool heavy)
 #endif
 
        }
-
-       /* Message (p_ptr->inventory_list) */
        else
        {
 #ifdef JP
@@ -254,7 +252,7 @@ static void sense_inventory_aux(INVENTORY_IDX slot, bool heavy)
  * @brief 1プレイヤーターン毎に武器、防具の擬似鑑定が行われるかを判定する。
  * @return なし
  * @details
- * Sense the p_ptr->inventory_list\n
+ * Sense the inventory\n
  *\n
  *   Class 0 = Warrior --> fast and heavy\n
  *   Class 1 = Mage    --> slow and light\n
@@ -263,10 +261,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 +272,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 +424,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 +433,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 +468,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 +485,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 +575,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,18 +596,20 @@ 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);
        }
 }
 
+
 /*!
  * @brief パターン終点到達時のテレポート処理を行う
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @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;
@@ -652,7 +652,7 @@ static void pattern_teleport(void)
        }
        else if (get_check(_("通常テレポート?", "Normal teleport? ")))
        {
-               teleport_player(200, 0L);
+               teleport_player(creature_ptr, 200, 0L);
                return;
        }
        else
@@ -665,53 +665,54 @@ static void pattern_teleport(void)
        /* Accept request */
        msg_format(_("%d 階にテレポートしました。", "You teleport to dungeon level %d."), command_arg);
 
-       if (autosave_l) do_cmd_save_game(TRUE);
+       if (autosave_l) do_cmd_save_game(creature_ptr, TRUE);
 
        /* Change level */
-       current_floor_ptr->dun_level = command_arg;
+       creature_ptr->current_floor_ptr->dun_level = command_arg;
 
-       leave_quest_check();
+       leave_quest_check(creature_ptr);
 
-       if (record_stair) exe_write_diary(p_ptr, 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->current_floor_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;
+       prepare_change_floor_mode(creature_ptr, CFM_FIRST_FLOOR);
+       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;
+       floor_type *floor_ptr = creature_ptr->current_floor_ptr;
+       pattern_type = f_info[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)restore_all_status();
-               (void)restore_level(p_ptr);
-               (void)cure_critical_wounds(p_ptr, 1000);
+               (void)set_image(creature_ptr, 0);
+               (void)restore_all_status(creature_ptr);
+               (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(floor_ptr, creature_ptr->y, creature_ptr->x, feat_pattern_old);
                msg_print(_("「パターン」のこの部分は他の部分より強力でないようだ。", "This section of the Pattern looks less powerful."));
 
                /*
@@ -727,19 +728,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);
+               if (!IS_INVULN(creature_ptr))
+                       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);
+               else if (!IS_INVULN(creature_ptr))
+                       take_hit(creature_ptr, DAMAGE_NOESCAPE, damroll(1, 3), _("「パターン」を歩いたダメージ", "walking the Pattern"), -1);
                break;
        }
 
@@ -752,17 +753,17 @@ static bool pattern_effect(void)
  * @param percent 回復比率
  * @return なし
  */
-static void regenhp(int percent)
+static void regenhp(player_type *creature_ptr, int percent)
 {
        HIT_POINT new_chp;
        u32b new_chp_frac;
        HIT_POINT old_chp;
 
-       if (p_ptr->special_defense & KATA_KOUKIJIN) return;
-       if (p_ptr->action == ACTION_HAYAGAKE) return;
+       if (creature_ptr->special_defense & KATA_KOUKIJIN) return;
+       if (creature_ptr->action == ACTION_HAYAGAKE) return;
 
        /* Save the old hitpoints */
-       old_chp = p_ptr->chp;
+       old_chp = creature_ptr->chp;
 
        /*
         * Extract the new hitpoints
@@ -770,27 +771,27 @@ static void regenhp(int percent)
         * 'percent' is the Regen factor in unit (1/2^16)
         */
        new_chp = 0;
-       new_chp_frac = (p_ptr->mhp * percent + PY_REGEN_HPBASE);
+       new_chp_frac = (creature_ptr->mhp * percent + PY_REGEN_HPBASE);
 
        /* Convert the unit (1/2^16) to (1/2^32) */
        s64b_LSHIFT(new_chp, new_chp_frac, 16);
 
        /* Regenerating */
-       s64b_add(&(p_ptr->chp), &(p_ptr->chp_frac), new_chp, new_chp_frac);
+       s64b_add(&(creature_ptr->chp), &(creature_ptr->chp_frac), new_chp, new_chp_frac);
 
 
        /* Fully healed */
-       if (0 < s64b_cmp(p_ptr->chp, p_ptr->chp_frac, p_ptr->mhp, 0))
+       if (0 < s64b_cmp(creature_ptr->chp, creature_ptr->chp_frac, creature_ptr->mhp, 0))
        {
-               p_ptr->chp = p_ptr->mhp;
-               p_ptr->chp_frac = 0;
+               creature_ptr->chp = creature_ptr->mhp;
+               creature_ptr->chp_frac = 0;
        }
 
        /* Notice changes */
-       if (old_chp != p_ptr->chp)
+       if (old_chp != creature_ptr->chp)
        {
-               p_ptr->redraw |= (PR_HP);
-               p_ptr->window |= (PW_PLAYER);
+               creature_ptr->redraw |= (PR_HP);
+               creature_ptr->window |= (PW_PLAYER);
                wild_regen = 20;
        }
 }
@@ -939,10 +940,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;
@@ -1131,7 +1132,7 @@ static void recharged_notice(object_type *o_ptr)
  * @brief プレイヤーの歌に関する継続処理
  * @return なし
  */
-static void check_music(player_type *creature_ptr)
+static void check_music(player_type *caster_ptr)
 {
        const magic_type *s_ptr;
        int spell;
@@ -1139,56 +1140,56 @@ static void check_music(player_type *creature_ptr)
        u32b need_mana_frac;
 
        /* Music singed by player */
-       if (creature_ptr->pclass != CLASS_BARD) return;
-       if (!SINGING_SONG_EFFECT(creature_ptr) && !INTERUPTING_SONG_EFFECT(creature_ptr)) return;
+       if (caster_ptr->pclass != CLASS_BARD) return;
+       if (!SINGING_SONG_EFFECT(caster_ptr) && !INTERUPTING_SONG_EFFECT(caster_ptr)) return;
 
-       if (creature_ptr->anti_magic)
+       if (caster_ptr->anti_magic)
        {
-               stop_singing(creature_ptr);
+               stop_singing(caster_ptr);
                return;
        }
 
-       spell = SINGING_SONG_ID(creature_ptr);
+       spell = SINGING_SONG_ID(caster_ptr);
        s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC][spell];
 
-       need_mana = mod_need_mana(s_ptr->smana, spell, REALM_MUSIC);
+       need_mana = mod_need_mana(caster_ptr, s_ptr->smana, spell, REALM_MUSIC);
        need_mana_frac = 0;
 
        /* Divide by 2 */
        s64b_RSHIFT(need_mana, need_mana_frac, 1);
 
-       if (s64b_cmp(creature_ptr->csp, creature_ptr->csp_frac, need_mana, need_mana_frac) < 0)
+       if (s64b_cmp(caster_ptr->csp, caster_ptr->csp_frac, need_mana, need_mana_frac) < 0)
        {
-               stop_singing(creature_ptr);
+               stop_singing(caster_ptr);
                return;
        }
        else
        {
-               s64b_sub(&(creature_ptr->csp), &(creature_ptr->csp_frac), need_mana, need_mana_frac);
+               s64b_sub(&(caster_ptr->csp), &(caster_ptr->csp_frac), need_mana, need_mana_frac);
 
-               creature_ptr->redraw |= PR_MANA;
-               if (INTERUPTING_SONG_EFFECT(creature_ptr))
+               caster_ptr->redraw |= PR_MANA;
+               if (INTERUPTING_SONG_EFFECT(caster_ptr))
                {
-                       SINGING_SONG_EFFECT(creature_ptr) = INTERUPTING_SONG_EFFECT(creature_ptr);
-                       INTERUPTING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
+                       SINGING_SONG_EFFECT(caster_ptr) = INTERUPTING_SONG_EFFECT(caster_ptr);
+                       INTERUPTING_SONG_EFFECT(caster_ptr) = MUSIC_NONE;
                        msg_print(_("歌を再開した。", "You restart singing."));
-                       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);
+                       caster_ptr->action = ACTION_SING;
+                       caster_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
+                       caster_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
+                       caster_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
-       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) && (current_floor_ptr->dun_level > 4) && ((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) && ((current_floor_ptr->dun_level + 5) > creature_ptr->lev) && ((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) && ((current_floor_ptr->dun_level + 5) > creature_ptr->lev) && (current_floor_ptr->dun_level > s_ptr->slevel)) creature_ptr->spell_exp[spell] += 1; }
+       if (caster_ptr->spell_exp[spell] < SPELL_EXP_BEGINNER)
+               caster_ptr->spell_exp[spell] += 5;
+       else if(caster_ptr->spell_exp[spell] < SPELL_EXP_SKILLED)
+       { if (one_in_(2) && (caster_ptr->current_floor_ptr->dun_level > 4) && ((caster_ptr->current_floor_ptr->dun_level + 10) > caster_ptr->lev)) caster_ptr->spell_exp[spell] += 1; }
+       else if(caster_ptr->spell_exp[spell] < SPELL_EXP_EXPERT)
+       { if (one_in_(5) && ((caster_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) && ((caster_ptr->current_floor_ptr->dun_level + 5) > s_ptr->slevel)) caster_ptr->spell_exp[spell] += 1; }
+       else if(caster_ptr->spell_exp[spell] < SPELL_EXP_MASTER)
+       { if (one_in_(5) && ((caster_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) && (caster_ptr->current_floor_ptr->dun_level > s_ptr->slevel)) caster_ptr->spell_exp[spell] += 1; }
 
        /* Do any effects of continual song */
-       exe_spell(creature_ptr, REALM_MUSIC, spell, SPELL_CONT);
+       exe_spell(caster_ptr, REALM_MUSIC, spell, SPELL_CONT);
 }
 
 /*!
@@ -1264,6 +1265,7 @@ static object_type *choose_cursed_obj_name(BIT_FLAGS flag)
        return (&p_ptr->inventory_list[choices[randint0(number)]]);
 }
 
+
 static void process_world_aux_digestion(player_type *creature_ptr)
 {
        if (!creature_ptr->phase_out)
@@ -1322,7 +1324,7 @@ static void process_world_aux_digestion(player_type *creature_ptr)
                                /* Calculate damage */
                                HIT_POINT dam = (PY_FOOD_STARVE - creature_ptr->food) / 10;
 
-                               if (!IS_INVULN()) take_hit(creature_ptr, DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1);
+                               if (!IS_INVULN(creature_ptr)) take_hit(creature_ptr, DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1);
                        }
                }
        }
@@ -1335,7 +1337,7 @@ static void process_world_aux_digestion(player_type *creature_ptr)
  */
 static void process_world_aux_hp_and_sp(player_type *creature_ptr)
 {
-       feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[creature_ptr->y][creature_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,13 +1348,13 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
        /*** Damage over Time ***/
 
        /* Take damage from poison */
-       if (creature_ptr->poisoned && !IS_INVULN())
+       if (creature_ptr->poisoned && !IS_INVULN(creature_ptr))
        {
                take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, _("毒", "poison"), -1);
        }
 
        /* Take damage from cuts */
-       if (creature_ptr->cut && !IS_INVULN())
+       if (creature_ptr->cut && !IS_INVULN(creature_ptr))
        {
                HIT_POINT dam;
 
@@ -1400,9 +1402,9 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
        /* (Vampires) Take damage from sunlight */
        if (PRACE_IS_(creature_ptr, RACE_VAMPIRE) || (creature_ptr->mimic_form == MIMIC_VAMPIRE))
        {
-               if (!current_floor_ptr->dun_level && !creature_ptr->resist_lite && !IS_INVULN() && is_daytime())
+               if (!creature_ptr->current_floor_ptr->dun_level && !creature_ptr->resist_lite && !IS_INVULN(creature_ptr) && is_daytime())
                {
-                       if ((current_floor_ptr->grid_array[creature_ptr->y][creature_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(creature_ptr, DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1);
@@ -1427,11 +1429,11 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
                        object_desc(o_name, o_ptr, OD_NAME_ONLY);
                        sprintf(ouch, _("%sを装備したダメージ", "wielding %s"), o_name);
 
-                       if (!IS_INVULN()) take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, ouch, -1);
+                       if (!IS_INVULN(creature_ptr)) take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, ouch, -1);
                }
        }
 
-       if (have_flag(f_ptr->flags, FF_LAVA) && !IS_INVULN() && !creature_ptr->immune_fire)
+       if (have_flag(f_ptr->flags, FF_LAVA) && !IS_INVULN(creature_ptr) && !creature_ptr->immune_fire)
        {
                int damage = 0;
 
@@ -1457,11 +1459,11 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
                        {
                                msg_print(_("熱で火傷した!", "The heat burns you!"));
                                take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"), 
-                                                               f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+                                                               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[creature_ptr->y][creature_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(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
                        }
@@ -1470,7 +1472,7 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
                }
        }
 
-       if (have_flag(f_ptr->flags, FF_COLD_PUDDLE) && !IS_INVULN() && !creature_ptr->immune_cold)
+       if (have_flag(f_ptr->flags, FF_COLD_PUDDLE) && !IS_INVULN(creature_ptr) && !creature_ptr->immune_cold)
        {
                int damage = 0;
 
@@ -1495,11 +1497,11 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
                        {
                                msg_print(_("冷気に覆われた!", "The cold engulfs you!"));
                                take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
-                                       f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+                                       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[creature_ptr->y][creature_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(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
                        }
@@ -1508,7 +1510,7 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
                }
        }
 
-       if (have_flag(f_ptr->flags, FF_ELEC_PUDDLE) && !IS_INVULN() && !creature_ptr->immune_elec)
+       if (have_flag(f_ptr->flags, FF_ELEC_PUDDLE) && !IS_INVULN(creature_ptr) && !creature_ptr->immune_elec)
        {
                int damage = 0;
 
@@ -1533,11 +1535,11 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
                        {
                                msg_print(_("電撃を受けた!", "The electric shocks you!"));
                                take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
-                                       f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+                                       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[creature_ptr->y][creature_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(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
                        }
@@ -1546,7 +1548,7 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
                }
        }
 
-       if (have_flag(f_ptr->flags, FF_ACID_PUDDLE) && !IS_INVULN() && !creature_ptr->immune_acid)
+       if (have_flag(f_ptr->flags, FF_ACID_PUDDLE) && !IS_INVULN(creature_ptr) && !creature_ptr->immune_acid)
        {
                int damage = 0;
 
@@ -1571,11 +1573,11 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
                        {
                                msg_print(_("酸が飛び散った!", "The acid melt you!"));
                                take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
-                                       f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+                                       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[creature_ptr->y][creature_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(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
                        }
@@ -1584,7 +1586,7 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
                }
        }
 
-       if (have_flag(f_ptr->flags, FF_POISON_PUDDLE) && !IS_INVULN())
+       if (have_flag(f_ptr->flags, FF_POISON_PUDDLE) && !IS_INVULN(creature_ptr))
        {
                int damage = 0;
 
@@ -1609,12 +1611,12 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
                        {
                                msg_print(_("毒気を吸い込んだ!", "The gas poisons you!"));
                                take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
-                                       f_name + f_info[get_feat_mimic(&current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+                                       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[creature_ptr->y][creature_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(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
                                if (creature_ptr->resist_pois) (void)set_poisoned(creature_ptr, creature_ptr->poisoned + 3);
@@ -1638,27 +1640,27 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
        if (creature_ptr->riding)
        {
                HIT_POINT damage;
-               if ((r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !creature_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[creature_ptr->riding].r_idx].level / 2;
+                       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(creature_ptr, DAMAGE_NOESCAPE, damage, _("炎のオーラ", "Fire aura"), -1);
                }
-               if ((r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !creature_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[creature_ptr->riding].r_idx].level / 2;
+                       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(creature_ptr, DAMAGE_NOESCAPE, damage, _("電気のオーラ", "Elec aura"), -1);
                }
-               if ((r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !creature_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[creature_ptr->riding].r_idx].level / 2;
+                       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!"));
@@ -1675,7 +1677,7 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
         */
        if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY))
        {
-               if (!IS_INVULN() && !creature_ptr->wraith_form && !creature_ptr->kabenuke && ((creature_ptr->chp > (creature_ptr->lev / 5)) || !creature_ptr->pass_wall))
+               if (!IS_INVULN(creature_ptr) && !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;
@@ -1717,7 +1719,7 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
        }
 
        /* Are we walking the pattern? */
-       if (pattern_effect())
+       if (pattern_effect(creature_ptr))
        {
                cave_no_regen = TRUE;
        }
@@ -1792,7 +1794,7 @@ static void process_world_aux_hp_and_sp(player_type *creature_ptr)
        /* Regenerate Hit Points if needed */
        if ((creature_ptr->chp < creature_ptr->mhp) && !cave_no_regen)
        {
-               regenhp(regen_amount);
+               regenhp(creature_ptr, regen_amount);
        }
 }
 
@@ -2181,7 +2183,7 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                        disturb(creature_ptr, FALSE, TRUE);
                        msg_print(_("あなたの位置は突然ひじょうに不確定になった...", "Your position suddenly seems very uncertain..."));
                        msg_print(NULL);
-                       teleport_player(40, TELEPORT_PASSIVE);
+                       teleport_player(creature_ptr, 40, TELEPORT_PASSIVE);
                }
        }
 
@@ -2205,9 +2207,9 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                        {
                                msg_print(NULL);
                                if (one_in_(3)) lose_all_info(creature_ptr);
-                               else wiz_dark();
-                               (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
-                               wiz_dark();
+                               else wiz_dark(creature_ptr);
+                               (void)teleport_player_aux(creature_ptr,100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
+                               wiz_dark(creature_ptr);
                                msg_print(_("あなたは見知らぬ場所で目が醒めた...頭が痛い。", "You wake up somewhere with a sore head..."));
                                msg_print(_("何も覚えていない。どうやってここに来たかも分からない!", "You can't remember a thing, or how you got here!"));
                        }
@@ -2237,7 +2239,7 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                disturb(creature_ptr, FALSE, TRUE);
                msg_print(_("ブゥーーッ!おっと。", "BRRAAAP! Oops."));
                msg_print(NULL);
-               fire_ball(GF_POIS, 0, creature_ptr->lev, 3);
+               fire_ball(creature_ptr, GF_POIS, 0, creature_ptr->lev, 3);
        }
 
        if ((creature_ptr->muta2 & MUT2_PROD_MANA) &&
@@ -2250,8 +2252,8 @@ static void process_world_aux_mutation(player_type *creature_ptr)
 
                flush();
                msg_print(NULL);
-               (void)get_hack_dir(&dire);
-               fire_ball(GF_MANA, dire, creature_ptr->lev * 2, 3);
+               (void)get_hack_dir(creature_ptr, &dire);
+               fire_ball(creature_ptr, GF_MANA, dire, creature_ptr->lev * 2, 3);
        }
 
        if ((creature_ptr->muta2 & MUT2_ATT_DEMON) && !creature_ptr->anti_magic && (randint1(6666) == 666))
@@ -2262,7 +2264,7 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                if (pet) mode |= PM_FORCE_PET;
                else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-               if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_DEMON, mode))
+               if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, mode))
                {
                        msg_print(_("あなたはデーモンを引き寄せた!", "You have attracted a demon!"));
                        disturb(creature_ptr, FALSE, TRUE);
@@ -2305,8 +2307,8 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                disturb(creature_ptr, FALSE, TRUE);
                msg_print(_("突然ほとんど孤独になった気がする。", "You suddenly feel almost lonely."));
 
-               banish_monsters(100);
-               if (!current_floor_ptr->dun_level && creature_ptr->town_num)
+               banish_monsters(creature_ptr, 100);
+               if (!creature_ptr->current_floor_ptr->dun_level && creature_ptr->town_num)
                {
                        int n;
 
@@ -2331,7 +2333,7 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                msg_print(NULL);
 
                /* Absorb light from the current possition */
-               if ((current_floor_ptr->grid_array[creature_ptr->y][creature_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)
                {
                        hp_player(creature_ptr, 10);
                }
@@ -2360,7 +2362,7 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                 * Unlite the area (radius 10) around player and
                 * do 50 points damage to every affected monster
                 */
-               unlite_area(50, 10);
+               unlite_area(creature_ptr, 50, 10);
        }
 
        if ((creature_ptr->muta2 & MUT2_ATT_ANIMAL) && !creature_ptr->anti_magic && one_in_(7000))
@@ -2371,7 +2373,7 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                if (pet) mode |= PM_FORCE_PET;
                else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-               if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_ANIMAL, mode))
+               if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_ANIMAL, mode))
                {
                        msg_print(_("動物を引き寄せた!", "You have attracted an animal!"));
                        disturb(creature_ptr, FALSE, TRUE);
@@ -2384,7 +2386,7 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                msg_print(_("周りの空間が歪んでいる気がする!", "You feel the world warping around you!"));
 
                msg_print(NULL);
-               fire_ball(GF_CHAOS, 0, creature_ptr->lev, 8);
+               fire_ball(creature_ptr, GF_CHAOS, 0, creature_ptr->lev, 8);
        }
        if ((creature_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000))
        {
@@ -2449,7 +2451,7 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                if (pet) mode |= PM_FORCE_PET;
                else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-               if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_DRAGON, mode))
+               if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON, mode))
                {
                        msg_print(_("ドラゴンを引き寄せた!", "You have attracted a dragon!"));
                        disturb(creature_ptr, FALSE, TRUE);
@@ -2475,12 +2477,12 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                msg_print(NULL);
                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 (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
        }
 
-       if ((creature_ptr->muta2 & MUT2_WALK_SHAD) && !creature_ptr->anti_magic && one_in_(12000) && !creature_ptr->inside_arena)
+       if ((creature_ptr->muta2 & MUT2_WALK_SHAD) && !creature_ptr->anti_magic && one_in_(12000) && !creature_ptr->current_floor_ptr->inside_arena)
        {
-               alter_reality();
+               reserve_alter_reality(creature_ptr);
        }
 
        if ((creature_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
@@ -2488,9 +2490,9 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                int danger_amount = 0;
                MONSTER_IDX monster;
 
-               for (monster = 0; monster < current_floor_ptr->m_max; monster++)
+               for (monster = 0; monster < creature_ptr->current_floor_ptr->m_max; monster++)
                {
-                       monster_type *m_ptr = &current_floor_ptr->m_list[monster];
+                       monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[monster];
                        monster_race *r_ptr = &r_info[m_ptr->r_idx];
                        if (!monster_is_valid(m_ptr)) continue;
 
@@ -2581,7 +2583,7 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                if (slot && !object_is_cursed(o_ptr))
                {
                        msg_print(_("武器を落としてしまった!", "You drop your weapon!"));
-                       inven_drop(slot, 1);
+                       drop_from_inventory(creature_ptr, slot, 1);
                }
        }
 
@@ -2632,7 +2634,7 @@ static void process_world_aux_curse(player_type *creature_ptr)
                        if (get_check_strict(_("テレポートしますか?", "Teleport? "), CHECK_OKAY_CANCEL))
                        {
                                disturb(creature_ptr, FALSE, TRUE);
-                               teleport_player(50, 0L);
+                               teleport_player(creature_ptr, 50, 0L);
                        }
                        else
                        {
@@ -2653,7 +2655,7 @@ static void process_world_aux_curse(player_type *creature_ptr)
                if ((creature_ptr->cursed & TRC_TY_CURSE) && one_in_(TY_CURSE_CHANCE))
                {
                        int count = 0;
-                       (void)activate_ty_curse(FALSE, &count);
+                       (void)activate_ty_curse(creature_ptr, FALSE, &count);
                }
                /* Handle experience draining */
                if (creature_ptr->prace != RACE_ANDROID && ((creature_ptr->cursed & TRC_DRAIN_EXP) && one_in_(4)))
@@ -2712,7 +2714,7 @@ static void process_world_aux_curse(player_type *creature_ptr)
                /* Call animal */
                if ((creature_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500))
                {
-                       if (summon_specific(0, creature_ptr->y, creature_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, creature_ptr->current_floor_ptr->dun_level, SUMMON_ANIMAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                        {
                                GAME_TEXT o_name[MAX_NLEN];
 
@@ -2724,7 +2726,7 @@ static void process_world_aux_curse(player_type *creature_ptr)
                /* Call demon */
                if ((creature_ptr->cursed & TRC_CALL_DEMON) && one_in_(1111))
                {
-                       if (summon_specific(0, creature_ptr->y, creature_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, creature_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                        {
                                GAME_TEXT o_name[MAX_NLEN];
 
@@ -2736,7 +2738,7 @@ static void process_world_aux_curse(player_type *creature_ptr)
                /* Call dragon */
                if ((creature_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800))
                {
-                       if (summon_specific(0, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_DRAGON,
+                       if (summon_specific(0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON,
                            (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                        {
                                GAME_TEXT o_name[MAX_NLEN];
@@ -2749,7 +2751,7 @@ static void process_world_aux_curse(player_type *creature_ptr)
                /* Call undead */
                if ((creature_ptr->cursed & TRC_CALL_UNDEAD) && one_in_(1111))
                {
-                       if (summon_specific(0, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_UNDEAD,
+                       if (summon_specific(0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD,
                            (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                        {
                                GAME_TEXT o_name[MAX_NLEN];
@@ -2774,7 +2776,7 @@ static void process_world_aux_curse(player_type *creature_ptr)
                        disturb(creature_ptr, FALSE, TRUE);
 
                        /* Teleport player */
-                       teleport_player(40, TELEPORT_PASSIVE);
+                       teleport_player(creature_ptr, 40, TELEPORT_PASSIVE);
                }
                /* Handle HP draining */
                if ((creature_ptr->cursed & TRC_DRAIN_HP) && one_in_(666))
@@ -2861,7 +2863,7 @@ static void process_world_aux_recharge(player_type *creature_ptr)
        /*
         * Recharge rods.  Rods now use timeout to control charging status,
         * and each charging rod in a stack decreases the stack's timeout by
-        * one per current_world_ptr->game_turn. -LM-
+        * one per turn. -LM-
         */
        for (changed = FALSE, i = 0; i < INVEN_PACK; i++)
        {
@@ -2905,9 +2907,9 @@ static void process_world_aux_recharge(player_type *creature_ptr)
        }
 
        /* Process objects on floor */
-       for (i = 1; i < current_floor_ptr->o_max; i++)
+       for (i = 1; i < creature_ptr->current_floor_ptr->o_max; i++)
        {
-               object_type *o_ptr = &current_floor_ptr->o_list[i];
+               object_type *o_ptr = &creature_ptr->current_floor_ptr->o_list[i];
 
                if (!OBJECT_IS_VALID(o_ptr)) continue;
 
@@ -2931,6 +2933,7 @@ static void process_world_aux_recharge(player_type *creature_ptr)
  */
 static void process_world_aux_movement(player_type *creature_ptr)
 {
+       floor_type *floor_ptr = creature_ptr->current_floor_ptr;
        /* Delayed Word-of-Recall */
        if (creature_ptr->word_recall)
        {
@@ -2940,7 +2943,7 @@ static void process_world_aux_movement(player_type *creature_ptr)
                 * he loads the autosaved game.
                 */
                if (autosave_l && (creature_ptr->word_recall == 1) && !creature_ptr->phase_out)
-                       do_cmd_save_game(TRUE);
+                       do_cmd_save_game(creature_ptr, TRUE);
 
                /* Count down towards recall */
                creature_ptr->word_recall--;
@@ -2954,21 +2957,21 @@ static void process_world_aux_movement(player_type *creature_ptr)
                        disturb(creature_ptr, FALSE, TRUE);
 
                        /* Determine the level */
-                       if (current_floor_ptr->dun_level || creature_ptr->inside_quest || creature_ptr->enter_dungeon)
+                       if (floor_ptr->dun_level || creature_ptr->current_floor_ptr->inside_quest || creature_ptr->enter_dungeon)
                        {
                                msg_print(_("上に引っ張りあげられる感じがする!", "You feel yourself yanked upwards!"));
 
                                if (creature_ptr->dungeon_idx) creature_ptr->recall_dungeon = creature_ptr->dungeon_idx;
                                if (record_stair)
-                                       exe_write_diary(creature_ptr, 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;
+                               floor_ptr->dun_level = 0;
                                creature_ptr->dungeon_idx = 0;
 
-                               leave_quest_check();
+                               leave_quest_check(creature_ptr);
                                leave_tower_check();
 
-                               creature_ptr->inside_quest = 0;
+                               creature_ptr->current_floor_ptr->inside_quest = 0;
 
                                creature_ptr->leaving = TRUE;
                        }
@@ -2979,26 +2982,26 @@ static void process_world_aux_movement(player_type *creature_ptr)
                                creature_ptr->dungeon_idx = creature_ptr->recall_dungeon;
 
                                if (record_stair)
-                                       exe_write_diary(creature_ptr, 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[creature_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) && (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[creature_ptr->dungeon_idx].maxdepth - 1;
+                                               floor_ptr->dun_level = d_info[creature_ptr->dungeon_idx].maxdepth - 1;
                                        }
                                }
 
@@ -3019,7 +3022,7 @@ static void process_world_aux_movement(player_type *creature_ptr)
                                 * Clear all saved floors
                                 * and create a first saved floor
                                 */
-                               prepare_change_floor_mode(CFM_FIRST_FLOOR);
+                               prepare_change_floor_mode(creature_ptr, CFM_FIRST_FLOOR);
                                creature_ptr->leaving = TRUE;
 
                                if (creature_ptr->dungeon_idx == DUNGEON_ANGBAND)
@@ -3033,7 +3036,7 @@ static void process_world_aux_movement(player_type *creature_ptr)
                                                
                                                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)creature_ptr->lev;
@@ -3054,7 +3057,7 @@ static void process_world_aux_movement(player_type *creature_ptr)
        if (creature_ptr->alter_reality)
        {
                if (autosave_l && (creature_ptr->alter_reality == 1) && !creature_ptr->phase_out)
-                       do_cmd_save_game(TRUE);
+                       do_cmd_save_game(creature_ptr, TRUE);
 
                /* Count down towards alter */
                creature_ptr->alter_reality--;
@@ -3068,7 +3071,7 @@ static void process_world_aux_movement(player_type *creature_ptr)
                        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!"));
 
@@ -3076,7 +3079,7 @@ static void process_world_aux_movement(player_type *creature_ptr)
                                 * Clear all saved floors
                                 * and create a first saved floor
                                 */
-                               prepare_change_floor_mode(CFM_FIRST_FLOOR);
+                               prepare_change_floor_mode(creature_ptr, CFM_FIRST_FLOOR);
                                creature_ptr->leaving = TRUE;
                        }
                        else
@@ -3094,7 +3097,7 @@ static void process_world_aux_movement(player_type *creature_ptr)
  * / Handle certain things once every 10 game turns
  * @return なし
  */
-static void process_world(void)
+static void process_world(player_type *player_ptr)
 {
        int day, hour, min;
 
@@ -3105,33 +3108,33 @@ static void process_world(void)
        extract_day_hour_min(&day, &hour, &min);
 
        /* Update dungeon feeling, and announce it if changed */
-       update_dungeon_feeling(current_floor_ptr);
+       update_dungeon_feeling(player_ptr, player_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))
+       if (ironman_downward && (player_ptr->dungeon_idx != DUNGEON_ANGBAND && player_ptr->dungeon_idx != 0))
        {
-               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;
-               p_ptr->wild_mode = FALSE;
-               p_ptr->leaving = TRUE;
+               player_ptr->current_floor_ptr->dun_level = 0;
+               player_ptr->dungeon_idx = 0;
+               prepare_change_floor_mode(player_ptr, CFM_FIRST_FLOOR | CFM_RAND_PLACE);
+               player_ptr->current_floor_ptr->inside_arena = FALSE;
+               player_ptr->wild_mode = FALSE;
+               player_ptr->leaving = TRUE;
        }
 
        /*** Check monster arena ***/
-       if (p_ptr->phase_out && !p_ptr->leaving)
+       if (player_ptr->phase_out && !player_ptr->leaving)
        {
                int i2, j2;
                int win_m_idx = 0;
                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 < player_ptr->current_floor_ptr->width; ++i2)
+                       for (j2 = 0; j2 < player_ptr->current_floor_ptr->height; j2++)
                        {
-                               grid_type *g_ptr = &current_floor_ptr->grid_array[j2][i2];
+                               grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[j2][i2];
 
-                               if ((g_ptr->m_idx > 0) && (g_ptr->m_idx != p_ptr->riding))
+                               if ((g_ptr->m_idx > 0) && (g_ptr->m_idx != player_ptr->riding))
                                {
                                        number_mon++;
                                        win_m_idx = g_ptr->m_idx;
@@ -3142,7 +3145,7 @@ static void process_world(void)
                {
                        msg_print(_("相打ちに終わりました。", "They have kill each other at the same time."));
                        msg_print(NULL);
-                       p_ptr->energy_need = 0;
+                       player_ptr->energy_need = 0;
                        update_gambling_monsters();
                }
                else if ((number_mon-1) == 0)
@@ -3150,7 +3153,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 = &player_ptr->current_floor_ptr->m_list[win_m_idx];
 
                        monster_desc(m_name, wm_ptr, 0);
                        msg_format(_("%sが勝利した!", "%s is winner!"), m_name);
@@ -3160,22 +3163,22 @@ static void process_world(void)
                        {
                                msg_print(_("おめでとうございます。", "Congratulations."));
                                msg_format(_("%d$を受け取った。", "You received %d gold."), battle_odds);
-                               p_ptr->au += battle_odds;
+                               player_ptr->au += battle_odds;
                        }
                        else
                        {
                                msg_print(_("残念でした。", "You lost gold."));
                        }
                        msg_print(NULL);
-                       p_ptr->energy_need = 0;
+                       player_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 - player_ptr->current_floor_ptr->generated_turn == 150 * TURNS_PER_TICK)
                {
                        msg_print(_("申し分けありませんが、この勝負は引き分けとさせていただきます。", "This battle have ended in a draw."));
-                       p_ptr->au += kakekin;
+                       player_ptr->au += kakekin;
                        msg_print(NULL);
-                       p_ptr->energy_need = 0;
+                       player_ptr->energy_need = 0;
                        update_gambling_monsters();
                }
        }
@@ -3184,13 +3187,13 @@ static void process_world(void)
        if (current_world_ptr->game_turn % TURNS_PER_TICK) return;
 
        /*** Attempt timed autosave ***/
-       if (autosave_t && autosave_freq && !p_ptr->phase_out)
+       if (autosave_t && autosave_freq && !player_ptr->phase_out)
        {
                if (!(current_world_ptr->game_turn % ((s32b)autosave_freq * TURNS_PER_TICK)))
-                       do_cmd_save_game(TRUE);
+                       do_cmd_save_game(player_ptr, TRUE);
        }
 
-       if (current_floor_ptr->monster_noise && !ignore_unview)
+       if (player_ptr->current_floor_ptr->monster_noise && !ignore_unview)
        {
                msg_print(_("何かが聞こえた。", "You hear noise."));
        }
@@ -3198,7 +3201,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 (!player_ptr->current_floor_ptr->dun_level && !player_ptr->current_floor_ptr->inside_quest && !player_ptr->phase_out && !player_ptr->current_floor_ptr->inside_arena)
        {
                /* Hack -- Daybreak/Nighfall in town */
                if (!(current_world_ptr->game_turn % ((TURNS_PER_TICK * TOWN_DAWN) / 2)))
@@ -3208,14 +3211,14 @@ static void process_world(void)
                        /* Check for dawn */
                        dawn = (!(current_world_ptr->game_turn % (TURNS_PER_TICK * TOWN_DAWN)));
 
-                       if (dawn) day_break(current_floor_ptr);
-                       else night_falls(current_floor_ptr);
+                       if (dawn) day_break(player_ptr->current_floor_ptr);
+                       else night_falls(player_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 && !player_ptr->current_floor_ptr->inside_quest && !player_ptr->phase_out && !player_ptr->current_floor_ptr->inside_arena)) && player_ptr->current_floor_ptr->dun_level)
        {
                /*** Shuffle the Storekeepers ***/
 
@@ -3265,25 +3268,25 @@ static void process_world(void)
        /*** Process the monsters ***/
 
        /* Check for creature generation. */
-       if (one_in_(d_info[p_ptr->dungeon_idx].max_m_alloc_chance) &&
-           !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->phase_out)
+       if (one_in_(d_info[player_ptr->dungeon_idx].max_m_alloc_chance) &&
+           !player_ptr->current_floor_ptr->inside_arena && !player_ptr->current_floor_ptr->inside_quest && !player_ptr->phase_out)
        {
                /* Make a new monster */
                (void)alloc_monster(MAX_SIGHT + 5, 0);
        }
 
        /* Hack -- Check for creature regeneration */
-       if (!(current_world_ptr->game_turn % (TURNS_PER_TICK * 10)) && !p_ptr->phase_out) regen_monsters();
+       if (!(current_world_ptr->game_turn % (TURNS_PER_TICK * 10)) && !player_ptr->phase_out) regen_monsters();
        if (!(current_world_ptr->game_turn % (TURNS_PER_TICK * 3))) regen_captured_monsters();
 
-       if (!p_ptr->leaving)
+       if (!player_ptr->leaving)
        {
                int i;
 
                /* 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 (player_ptr->current_floor_ptr->mproc_max[i] > 0) process_monsters_mtimed(i);
                }
        }
 
@@ -3293,7 +3296,7 @@ static void process_world(void)
        {
                if (min != prev_min)
                {
-                       exe_write_diary(p_ptr, NIKKI_HIGAWARI, 0, NULL);
+                       exe_write_diary(player_ptr, NIKKI_HIGAWARI, 0, NULL);
                        determine_today_mon(FALSE);
                }
        }
@@ -3309,7 +3312,7 @@ static void process_world(void)
                /* Every 15 minutes after 11:00 pm */
                if ((hour == 23) && !(min % 15))
                {
-                       disturb(p_ptr, FALSE, TRUE);
+                       disturb(player_ptr, FALSE, TRUE);
 
                        switch (min / 15)
                        {
@@ -3335,35 +3338,35 @@ static void process_world(void)
                if (!hour && !min)
                {
 
-                       disturb(p_ptr, TRUE, TRUE);
+                       disturb(player_ptr, TRUE, TRUE);
                        msg_print(_("遠くで鐘が何回も鳴り、死んだような静けさの中へ消えていった。", "A distant bell tolls many times, fading into an deathly silence."));
 
-                       if (p_ptr->wild_mode)
+                       if (player_ptr->wild_mode)
                        {
                                /* Go into large wilderness view */
-                               p_ptr->oldpy = randint1(MAX_HGT - 2);
-                               p_ptr->oldpx = randint1(MAX_WID - 2);
-                               change_wild_mode(TRUE);
+                               player_ptr->oldpy = randint1(MAX_HGT - 2);
+                               player_ptr->oldpx = randint1(MAX_WID - 2);
+                               change_wild_mode(player_ptr, TRUE);
 
                                /* Give first move to monsters */
-                               take_turn(p_ptr, 100);
+                               take_turn(player_ptr, 100);
 
                        }
 
-                       p_ptr->invoking_midnight_curse = TRUE;
+                       player_ptr->invoking_midnight_curse = TRUE;
                }
        }
 
-       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();
-       sense_inventory2();
-       process_world_aux_movement(p_ptr);
+       process_world_aux_digestion(player_ptr);
+       process_world_aux_hp_and_sp(player_ptr);
+       process_world_aux_timeout(player_ptr);
+       process_world_aux_light(player_ptr);
+       process_world_aux_mutation(player_ptr);
+       process_world_aux_curse(player_ptr);
+       process_world_aux_recharge(player_ptr);
+       sense_inventory1(player_ptr);
+       sense_inventory2(player_ptr);
+       process_world_aux_movement(player_ptr);
 }
 
 /*!
@@ -3374,7 +3377,7 @@ static void process_world(void)
 static bool enter_wizard_mode(void)
 {
        /* Ask first time */
-       if (!p_ptr->noscore)
+       if (!current_world_ptr->noscore)
        {
                /* Wizard mode is not permitted */
                if (!allow_debug_opts || arg_wizard)
@@ -3396,7 +3399,7 @@ static bool enter_wizard_mode(void)
 
                exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, _("ウィザードモードに突入してスコアを残せなくなった。", "give up recording score to enter wizard mode."));
                /* Mark savefile */
-               p_ptr->noscore |= 0x0002;
+               current_world_ptr->noscore |= 0x0002;
        }
 
        /* Success */
@@ -3414,7 +3417,7 @@ static bool enter_wizard_mode(void)
 static bool enter_debug_mode(void)
 {
        /* Ask first time */
-       if (!p_ptr->noscore)
+       if (!current_world_ptr->noscore)
        {
                /* Debug mode is not permitted */
                if (!allow_debug_opts)
@@ -3437,7 +3440,7 @@ static bool enter_debug_mode(void)
 
                exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, _("デバッグモードに突入してスコアを残せなくなった。", "give up sending score to use debug commands."));
                /* Mark savefile */
-               p_ptr->noscore |= 0x0008;
+               current_world_ptr->noscore |= 0x0008;
        }
 
        /* Success */
@@ -3462,7 +3465,7 @@ extern void do_cmd_debug(player_type *creature_ptr);
 static bool enter_borg_mode(void)
 {
        /* Ask first time */
-       if (!(p_ptr->noscore & 0x0010))
+       if (!(current_world_ptr->noscore & 0x0010))
        {
                /* Mention effects */
                msg_print(_("ボーグ・コマンドはデバッグと実験のためのコマンドです。 ", "The borg commands are for debugging and experimenting."));
@@ -3478,7 +3481,7 @@ static bool enter_borg_mode(void)
 
                exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, _("ボーグ・コマンドを使用してスコアを残せなくなった。", "give up recording score to use borg commands."));
                /* Mark savefile */
-               p_ptr->noscore |= 0x0010;
+               current_world_ptr->noscore |= 0x0010;
        }
 
        /* Success */
@@ -3499,7 +3502,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,10 +3512,11 @@ 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 */
+       floor_type *floor_ptr = creature_ptr->current_floor_ptr;
        switch (command_cmd)
        {
                /* Ignore */
@@ -3542,8 +3546,8 @@ static void process_command(void)
                                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 +3560,7 @@ static void process_command(void)
                {
                        if (enter_debug_mode())
                        {
-                               do_cmd_debug(p_ptr);
+                               do_cmd_debug(creature_ptr);
                        }
                        break;
                }
@@ -3571,7 +3575,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 +3589,42 @@ static void process_command(void)
                /* Wear/wield equipment */
                case 'w':
                {
-                       if (!p_ptr->wild_mode) do_cmd_wield(p_ptr);
+                       if (!creature_ptr->wild_mode) do_cmd_wield(creature_ptr);
                        break;
                }
 
                /* Take off equipment */
                case 't':
                {
-                       if (!p_ptr->wild_mode) do_cmd_takeoff(p_ptr);
+                       if (!creature_ptr->wild_mode) do_cmd_takeoff(creature_ptr);
                        break;
                }
 
                /* Drop an item */
                case 'd':
                {
-                       if (!p_ptr->wild_mode) do_cmd_drop(p_ptr);
+                       if (!creature_ptr->wild_mode) do_cmd_drop(creature_ptr);
                        break;
                }
 
                /* Destroy an item */
                case 'k':
                {
-                       do_cmd_destroy(p_ptr);
+                       do_cmd_destroy(creature_ptr);
                        break;
                }
 
                /* Equipment list */
                case 'e':
                {
-                       do_cmd_equip(p_ptr);
+                       do_cmd_equip(creature_ptr);
                        break;
                }
 
                /* Inventory list */
                case 'i':
                {
-                       do_cmd_inven(p_ptr);
+                       do_cmd_inven(creature_ptr);
                        break;
                }
 
@@ -3630,13 +3634,13 @@ static void process_command(void)
                /* Identify an object */
                case 'I':
                {
-                       do_cmd_observe(p_ptr);
+                       do_cmd_observe(creature_ptr);
                        break;
                }
 
                case KTRL('I'):
                {
-                       toggle_inven_equip(p_ptr);
+                       toggle_inven_equip(creature_ptr);
                        break;
                }
 
@@ -3646,28 +3650,28 @@ static void process_command(void)
                /* Alter a grid */
                case '+':
                {
-                       if (!p_ptr->wild_mode) do_cmd_alter(p_ptr);
+                       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 +3681,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;
                }
 
@@ -3722,92 +3726,92 @@ static void process_command(void)
                /* Enter store */
                case SPECIAL_KEY_STORE:
                {
-                       do_cmd_store();
+                       do_cmd_store(creature_ptr);
                        break;
                }
 
                /* Enter building -KMW- */
                case SPECIAL_KEY_BUILDING:
                {
-                       do_cmd_bldg();
+                       do_cmd_bldg(creature_ptr);
                        break;
                }
 
                /* Enter quest level -KMW- */
                case SPECIAL_KEY_QUEST:
                {
-                       do_cmd_quest();
+                       do_cmd_quest(creature_ptr);
                        break;
                }
 
                /* 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 && !floor_ptr->dun_level && !floor_ptr->inside_arena && !floor_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;
                                }
 
-                               change_wild_mode(FALSE);
+                               change_wild_mode(creature_ptr, FALSE);
                        }
                        else
-                               do_cmd_go_up(p_ptr);
+                               do_cmd_go_up(creature_ptr);
                        break;
                }
 
                /* Go down staircase */
                case '>':
                {
-                       if (p_ptr->wild_mode)
-                               change_wild_mode(FALSE);
+                       if (creature_ptr->wild_mode)
+                               change_wild_mode(creature_ptr, 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 +3821,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(p_ptr);
-                       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(p_ptr);
+                               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) 
-                            ) do_cmd_mind_browse();
-                       else if (p_ptr->pclass == CLASS_SMITH)
-                               do_cmd_kaji(p_ptr, TRUE);
-                       else if (p_ptr->pclass == CLASS_MAGIC_EATER)
-                               do_cmd_magic_eater(p_ptr, TRUE, FALSE);
-                       else if (p_ptr->pclass == CLASS_SNIPER)
-                               do_cmd_snipe_browse(p_ptr);
-                       else do_cmd_browse(p_ptr);
+                       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(creature_ptr);
+                       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 +3854,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 (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(p_ptr, FALSE);
-                                       else if (p_ptr->pclass == CLASS_MAGIC_EATER)
-                                               do_cmd_magic_eater(p_ptr, FALSE, FALSE);
-                                       else if (p_ptr->pclass == CLASS_SAMURAI)
-                                               do_cmd_hissatsu(p_ptr);
-                                       else if (p_ptr->pclass == CLASS_BLUE_MAGE)
-                                               do_cmd_cast_learned();
-                                       else if (p_ptr->pclass == CLASS_SMITH)
-                                               do_cmd_kaji(p_ptr, FALSE);
-                                       else if (p_ptr->pclass == CLASS_SNIPER)
-                                               do_cmd_snipe(p_ptr);
+                                               do_cmd_mind(creature_ptr);
+                                       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(creature_ptr);
+                                       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(p_ptr);
+                                               do_cmd_cast(creature_ptr);
                                }
                        }
                        break;
@@ -3915,7 +3919,7 @@ static void process_command(void)
                /* Issue a pet command */
                case 'p':
                {
-                       do_cmd_pet(p_ptr);
+                       do_cmd_pet(creature_ptr);
                        break;
                }
 
@@ -3924,56 +3928,56 @@ static void process_command(void)
                /* Inscribe an object */
                case '{':
                {
-                       do_cmd_inscribe(p_ptr);
+                       do_cmd_inscribe(creature_ptr);
                        break;
                }
 
                /* Uninscribe an object */
                case '}':
                {
-                       do_cmd_uninscribe(p_ptr);
+                       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(p_ptr);
+                       do_cmd_eat_food(creature_ptr);
                        break;
                }
 
                /* Fuel your lantern/torch */
                case 'F':
                {
-                       do_cmd_refill(p_ptr);
+                       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(p_ptr);
+                       do_cmd_aim_wand(creature_ptr);
                        break;
                }
 
@@ -3982,11 +3986,11 @@ static void process_command(void)
                {
                        if (use_command && rogue_like_commands)
                        {
-                               do_cmd_use(p_ptr);
+                               do_cmd_use(creature_ptr);
                        }
                        else
                        {
-                               do_cmd_zap_rod(p_ptr);
+                               do_cmd_zap_rod(creature_ptr);
                        }
                        break;
                }
@@ -3994,14 +3998,14 @@ static void process_command(void)
                /* Quaff a potion */
                case 'q':
                {
-                       do_cmd_quaff_potion(p_ptr);
+                       do_cmd_quaff_potion(creature_ptr);
                        break;
                }
 
                /* Read a scroll */
                case 'r':
                {
-                       do_cmd_read_scroll(p_ptr);
+                       do_cmd_read_scroll(creature_ptr);
                        break;
                }
 
@@ -4009,16 +4013,16 @@ static void process_command(void)
                case 'u':
                {
                        if (use_command && !rogue_like_commands)
-                               do_cmd_use(p_ptr);
+                               do_cmd_use(creature_ptr);
                        else
-                               do_cmd_use_staff(p_ptr);
+                               do_cmd_use_staff(creature_ptr);
                        break;
                }
 
                /* Use racial power */
                case 'U':
                {
-                       do_cmd_racial_power(p_ptr);
+                       do_cmd_racial_power(creature_ptr);
                        break;
                }
 
@@ -4035,21 +4039,21 @@ static void process_command(void)
                /* Locate player on map */
                case 'L':
                {
-                       do_cmd_locate(p_ptr);
+                       do_cmd_locate(creature_ptr);
                        break;
                }
 
                /* Look around */
                case 'l':
                {
-                       do_cmd_look();
+                       do_cmd_look(creature_ptr);
                        break;
                }
 
                /* Target monster or location */
                case '*':
                {
-                       do_cmd_target();
+                       do_cmd_target(creature_ptr);
                        break;
                }
 
@@ -4067,14 +4071,14 @@ static void process_command(void)
                /* Identify symbol */
                case '/':
                {
-                       do_cmd_query_symbol();
+                       do_cmd_query_symbol(creature_ptr);
                        break;
                }
 
                /* Character description */
                case 'C':
                {
-                       do_cmd_player_status(p_ptr);
+                       do_cmd_player_status(creature_ptr);
                        break;
                }
 
@@ -4103,30 +4107,30 @@ static void process_command(void)
 
                case '_':
                {
-                       do_cmd_edit_autopick();
+                       do_cmd_edit_autopick(creature_ptr);
                        break;
                }
 
                /* Interact with macros */
                case '@':
                {
-                       do_cmd_macros(p_ptr);
+                       do_cmd_macros(creature_ptr);
                        break;
                }
 
                /* Interact with visuals */
                case '%':
                {
-                       do_cmd_visuals(p_ptr);
-                       do_cmd_redraw(p_ptr);
+                       do_cmd_visuals(creature_ptr);
+                       do_cmd_redraw(creature_ptr);
                        break;
                }
 
                /* Interact with colors */
                case '&':
                {
-                       do_cmd_colors(p_ptr);
-                       do_cmd_redraw(p_ptr);
+                       do_cmd_colors(creature_ptr);
+                       do_cmd_redraw(creature_ptr);
                        break;
                }
 
@@ -4135,7 +4139,7 @@ static void process_command(void)
                {
                        do_cmd_options();
                        (void)combine_and_reorder_home(STORE_HOME);
-                       do_cmd_redraw(p_ptr);
+                       do_cmd_redraw(creature_ptr);
                        break;
                }
 
@@ -4158,7 +4162,7 @@ static void process_command(void)
                /* Repeat level feeling */
                case KTRL('F'):
                {
-                       do_cmd_feeling(p_ptr);
+                       do_cmd_feeling(creature_ptr);
                        break;
                }
 
@@ -4179,7 +4183,7 @@ static void process_command(void)
                /* Show quest status -KMW- */
                case KTRL('Q'):
                {
-                       do_cmd_checkquest();
+                       do_cmd_checkquest(creature_ptr);
                        break;
                }
 
@@ -4187,7 +4191,7 @@ static void process_command(void)
                case KTRL('R'):
                {
                        now_message = old_now_message;
-                       do_cmd_redraw(p_ptr);
+                       do_cmd_redraw(creature_ptr);
                        break;
                }
 
@@ -4196,7 +4200,7 @@ static void process_command(void)
                /* Hack -- Save and don't quit */
                case KTRL('S'):
                {
-                       do_cmd_save_game(FALSE);
+                       do_cmd_save_game(creature_ptr, FALSE);
                        break;
                }
 
@@ -4204,7 +4208,7 @@ static void process_command(void)
 
                case KTRL('T'):
                {
-                       do_cmd_time();
+                       do_cmd_time(creature_ptr);
                        break;
                }
 
@@ -4219,20 +4223,20 @@ static void process_command(void)
                /* Quit (commit suicide) */
                case 'Q':
                {
-                       do_cmd_suicide(p_ptr);
+                       do_cmd_suicide(creature_ptr);
                        break;
                }
 
                case '|':
                {
-                       do_cmd_nikki();
+                       do_cmd_diary(creature_ptr);
                        break;
                }
 
                /* Check artifacts, uniques, objects */
                case '~':
                {
-                       do_cmd_knowledge();
+                       do_cmd_knowledge(creature_ptr);
                        break;
                }
 
@@ -4246,7 +4250,7 @@ static void process_command(void)
                /* Save "screen dump" */
                case ')':
                {
-                       do_cmd_save_screen();
+                       do_cmd_save_screen(creature_ptr);
                        break;
                }
 
@@ -4260,17 +4264,17 @@ static void process_command(void)
                /* Make random artifact list */
                case KTRL('V'):
                {
-                       spoil_random_artifact("randifact.txt");
+                       spoil_random_artifact(creature_ptr, "randifact.txt");
                        break;
                }
 
 #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 +4299,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;
 }
 
@@ -4303,70 +4307,65 @@ static void process_command(void)
  * @brief アイテムの所持種類数が超えた場合にアイテムを床に落とす処理 / Hack -- Pack Overflow
  * @return なし
  */
-static void pack_overflow(void)
+static void pack_overflow(player_type *owner_ptr)
 {
-       if (p_ptr->inventory_list[INVEN_PACK].k_idx)
-       {
-               GAME_TEXT o_name[MAX_NLEN];
-               object_type *o_ptr;
+       if (owner_ptr->inventory_list[INVEN_PACK].k_idx == 0) return;
 
-               /* Is auto-destroy done? */
-               update_creature(p_ptr);
-               if (!p_ptr->inventory_list[INVEN_PACK].k_idx) return;
+       GAME_TEXT o_name[MAX_NLEN];
+       object_type *o_ptr;
 
-               /* Access the slot to be dropped */
-               o_ptr = &p_ptr->inventory_list[INVEN_PACK];
+       /* Is auto-destroy done? */
+       update_creature(owner_ptr);
+       if (!owner_ptr->inventory_list[INVEN_PACK].k_idx) return;
 
-               disturb(p_ptr, FALSE, TRUE);
+       /* Access the slot to be dropped */
+       o_ptr = &owner_ptr->inventory_list[INVEN_PACK];
 
-               /* Warning */
-               msg_print(_("ザックからアイテムがあふれた!", "Your pack overflows!"));
-               object_desc(o_name, o_ptr, 0);
+       disturb(owner_ptr, FALSE, TRUE);
 
-               msg_format(_("%s(%c)を落とした。", "You drop %s (%c)."), o_name, index_to_label(INVEN_PACK));
+       /* Warning */
+       msg_print(_("ザックからアイテムがあふれた!", "Your pack overflows!"));
+       object_desc(o_name, o_ptr, 0);
 
-               /* Drop it (carefully) near the player */
-               (void)drop_near(o_ptr, 0, p_ptr->y, p_ptr->x);
+       msg_format(_("%s(%c)を落とした。", "You drop %s (%c)."), o_name, index_to_label(INVEN_PACK));
 
-               /* Modify, Describe, Optimize */
-               inven_item_increase(INVEN_PACK, -255);
-               inven_item_describe(INVEN_PACK);
-               inven_item_optimize(INVEN_PACK);
+       /* Drop it (carefully) near the player */
+       (void)drop_near(owner_ptr, o_ptr, 0, owner_ptr->y, owner_ptr->x);
 
-               handle_stuff();
-       }
+       vary_item(owner_ptr, INVEN_PACK, -255);
+       handle_stuff(owner_ptr);
 }
 
 /*!
  * @brief プレイヤーの行動エネルギーが充填される(=プレイヤーのターンが回る)毎に行われる処理  / process the effects per 100 energy at player speed.
  * @return なし
  */
-static void process_upkeep_with_speed(void)
+static void process_upkeep_with_speed(player_type *creature_ptr)
 {
        /* Give the player some energy */
-       if (!load && p_ptr->enchant_energy_need > 0 && !p_ptr->leaving)
+       if (!load && creature_ptr->enchant_energy_need > 0 && !creature_ptr->leaving)
        {
-               p_ptr->enchant_energy_need -= SPEED_TO_ENERGY(p_ptr->pspeed);
+               creature_ptr->enchant_energy_need -= SPEED_TO_ENERGY(creature_ptr->pspeed);
        }
        
-       /* No current_world_ptr->game_turn yet */
-       if (p_ptr->enchant_energy_need > 0) return;
+       /* No turn yet */
+       if (creature_ptr->enchant_energy_need > 0) return;
        
-       while (p_ptr->enchant_energy_need <= 0)
+       while (creature_ptr->enchant_energy_need <= 0)
        {
                /* Handle the player song */
-               if (!load) check_music(p_ptr);
+               if (!load) check_music(creature_ptr);
 
                /* Hex - Handle the hex spells */
-               if (!load) check_hex();
-               if (!load) revenge_spell();
+               if (!load) check_hex(creature_ptr);
+               if (!load) revenge_spell(creature_ptr);
                
                /* There is some randomness of needed energy */
-               p_ptr->enchant_energy_need += ENERGY_NEED();
+               creature_ptr->enchant_energy_need += ENERGY_NEED();
        }
 }
 
-static void process_fishing(void)
+static void process_fishing(player_type *creature_ptr)
 {
        Term_xtra(TERM_XTRA_DELAY, 10);
        if (one_in_(1000))
@@ -4374,17 +4373,17 @@ 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(creature_ptr->current_floor_ptr->dun_level ? creature_ptr->current_floor_ptr->dun_level : wilderness[creature_ptr->wilderness_y][creature_ptr->wilderness_x].level);
                msg_print(NULL);
                if (r_idx && one_in_(2))
                {
                        POSITION y, x;
-                       y = p_ptr->y + ddy[p_ptr->fishing_dir];
-                       x = p_ptr->x + ddx[p_ptr->fishing_dir];
+                       y = creature_ptr->y + ddy[creature_ptr->fishing_dir];
+                       x = creature_ptr->x + ddx[creature_ptr->fishing_dir];
                        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, &creature_ptr->current_floor_ptr->m_list[creature_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 +4392,7 @@ static void process_fishing(void)
                {
                        msg_print(_("餌だけ食われてしまった!くっそ~!", "Damn!  The fish stole your bait!"));
                }
-               disturb(p_ptr, FALSE, TRUE);
+               disturb(creature_ptr, FALSE, TRUE);
        }
 }
 
@@ -4405,92 +4404,92 @@ 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;
+               activate_ty_curse(creature_ptr, FALSE, &count);
+               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;
 
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-                       update_monster(m_idx, FALSE);
+                       update_monster(creature_ptr, m_idx, FALSE);
                }
                prt_time();
        }
 
        /* 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;
+       /* No turn yet */
+       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(creature_ptr);
 
        /* 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 +4499,7 @@ static void process_player(void)
                        {
                                flush(); /* Flush input */
 
-                               disturb(p_ptr, FALSE, TRUE);
+                               disturb(creature_ptr, FALSE, TRUE);
 
                                /* Hack -- Show a Message */
                                msg_print(_("中断しました。", "Canceled."));
@@ -4508,9 +4507,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 +4517,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 +4525,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 +4537,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 +4549,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);
@@ -4559,57 +4558,57 @@ static void process_player(void)
                        }
                }
 
-               handle_stuff();
+               handle_stuff(creature_ptr);
        }
        
        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,71 +4616,71 @@ 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();
+               handle_stuff(creature_ptr);
 
                /* 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();
 
                /* Hack -- Pack Overflow */
-               pack_overflow();
+               pack_overflow(creature_ptr);
 
                /* Hack -- cancel "lurking browse mode" */
                if (!command_new) command_see = FALSE;
 
-               /* Assume free current_world_ptr->game_turn */
-               free_turn(p_ptr);
+               /* Assume free turn */
+               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);
@@ -4692,7 +4691,7 @@ static void process_player(void)
                else if (travel.run)
                {
                        /* Take a step */
-                       travel_step();
+                       travel_step(creature_ptr);
                }
 #endif
 
@@ -4702,8 +4701,8 @@ static void process_player(void)
                        /* Count this execution */
                        command_rep--;
 
-                       p_ptr->redraw |= (PR_STATE);
-                       handle_stuff();
+                       creature_ptr->redraw |= (PR_STATE);
+                       handle_stuff(creature_ptr);
 
                        /* Hack -- Assume messages were seen */
                        msg_flag = FALSE;
@@ -4712,14 +4711,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,39 +4726,39 @@ static void process_player(void)
                        can_save = FALSE;
 
                        /* Process the command */
-                       process_command();
+                       process_command(creature_ptr);
                }
 
                /* Hack -- Pack Overflow */
-               pack_overflow();
+               pack_overflow(creature_ptr);
 
                /*** 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 +4783,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 */
@@ -4818,10 +4817,10 @@ static void process_player(void)
 
                                                        /* Assume invisible */
                                                        m_ptr->ml = FALSE;
-                                                       update_monster(m_idx, FALSE);
+                                                       update_monster(creature_ptr, 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,59 +4828,59 @@ 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();
+                               handle_stuff(creature_ptr);
                        }
                }
 
                /* 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(p_ptr, 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 */
-       update_smell();
+       update_smell(creature_ptr->current_floor_ptr, creature_ptr);
 }
 
 /*!
@@ -4897,18 +4896,18 @@ static void process_player(void)
  * the user dies, or the game is terminated.\n
  * </p>
  */
-static void dungeon(bool load_game)
+static void dungeon(player_type *player_ptr, bool load_game)
 {
        int quest_num = 0;
 
        /* Set the base level */
-       current_floor_ptr->base_level = current_floor_ptr->dun_level;
+       player_ptr->current_floor_ptr->base_level = player_ptr->current_floor_ptr->dun_level;
 
        /* Reset various flags */
        current_world_ptr->is_loading_now = FALSE;
 
        /* Not leaving */
-       p_ptr->leaving = FALSE;
+       player_ptr->leaving = FALSE;
 
        /* Reset the "command" vars */
        command_cmd = 0;
@@ -4924,9 +4923,9 @@ static void dungeon(bool load_game)
 
        /* Cancel the target */
        target_who = 0;
-       p_ptr->pet_t_m_idx = 0;
-       p_ptr->riding_t_m_idx = 0;
-       p_ptr->ambush_flag = FALSE;
+       player_ptr->pet_t_m_idx = 0;
+       player_ptr->riding_t_m_idx = 0;
+       player_ptr->ambush_flag = FALSE;
 
        /* Cancel the health bar */
        health_track(0);
@@ -4936,10 +4935,10 @@ static void dungeon(bool load_game)
        repair_objects = TRUE;
 
 
-       disturb(p_ptr, TRUE, TRUE);
+       disturb(player_ptr, TRUE, TRUE);
 
        /* Get index of current quest (if any) */
-       quest_num = quest_number(current_floor_ptr->dun_level);
+       quest_num = quest_number(player_ptr->current_floor_ptr->dun_level);
 
        /* Inside a quest? */
        if (quest_num)
@@ -4949,20 +4948,20 @@ static void dungeon(bool load_game)
        }
 
        /* Track maximum player level */
-       if (p_ptr->max_plv < p_ptr->lev)
+       if (player_ptr->max_plv < player_ptr->lev)
        {
-               p_ptr->max_plv = p_ptr->lev;
+               player_ptr->max_plv = player_ptr->lev;
        }
 
 
        /* 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[player_ptr->dungeon_idx] < player_ptr->current_floor_ptr->dun_level) && !player_ptr->current_floor_ptr->inside_quest)
        {
-               max_dlv[p_ptr->dungeon_idx] = current_floor_ptr->dun_level;
-               if (record_maxdepth) exe_write_diary(p_ptr, NIKKI_MAXDEAPTH, current_floor_ptr->dun_level, NULL);
+               max_dlv[player_ptr->dungeon_idx] = player_ptr->current_floor_ptr->dun_level;
+               if (record_maxdepth) exe_write_diary(player_ptr, NIKKI_MAXDEAPTH, player_ptr->current_floor_ptr->dun_level, NULL);
        }
 
-       (void)calculate_upkeep(p_ptr);
+       (void)calculate_upkeep(player_ptr);
 
        /* Validate the panel */
        panel_bounds_center();
@@ -4976,29 +4975,29 @@ static void dungeon(bool load_game)
        /* Enter "xtra" mode */
        current_world_ptr->character_xtra = TRUE;
 
-       p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER | PW_MONSTER | PW_OVERHEAD | PW_DUNGEON);
-       p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY | PR_MAP);
-       p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS | PU_VIEW | PU_LITE | PU_MON_LITE | PU_TORCH | PU_MONSTERS | PU_DISTANCE | PU_FLOW);
+       player_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER | PW_MONSTER | PW_OVERHEAD | PW_DUNGEON);
+       player_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY | PR_MAP);
+       player_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS | PU_VIEW | PU_LITE | PU_MON_LITE | PU_TORCH | PU_MONSTERS | PU_DISTANCE | PU_FLOW);
 
-       handle_stuff();
+       handle_stuff(player_ptr);
 
        /* Leave "xtra" mode */
        current_world_ptr->character_xtra = FALSE;
 
-       p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
-       p_ptr->update |= (PU_COMBINE | PU_REORDER);
-       handle_stuff();
+       player_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
+       player_ptr->update |= (PU_COMBINE | PU_REORDER);
+       handle_stuff(player_ptr);
        Term_fresh();
 
        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(p_ptr);
+           !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling(player_ptr);
 
-       if (p_ptr->phase_out)
+       if (player_ptr->phase_out)
        {
                if (load_game)
                {
-                       p_ptr->energy_need = 0;
+                       player_ptr->energy_need = 0;
                        update_gambling_monsters();
                }
                else
@@ -5008,50 +5007,50 @@ static void dungeon(bool load_game)
                }
        }
 
-       if ((p_ptr->pclass == CLASS_BARD) && (SINGING_SONG_EFFECT(p_ptr) > MUSIC_DETECT))
-               SINGING_SONG_EFFECT(p_ptr) = MUSIC_DETECT;
+       if ((player_ptr->pclass == CLASS_BARD) && (SINGING_SONG_EFFECT(player_ptr) > MUSIC_DETECT))
+               SINGING_SONG_EFFECT(player_ptr) = MUSIC_DETECT;
 
        /* Hack -- notice death or departure */
-       if (!p_ptr->playing || p_ptr->is_dead) return;
+       if (!player_ptr->playing || player_ptr->is_dead) return;
 
        /* Print quest message if appropriate */
-       if (!p_ptr->inside_quest && (p_ptr->dungeon_idx == DUNGEON_ANGBAND))
+       if (!player_ptr->current_floor_ptr->inside_quest && (player_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(player_ptr->current_floor_ptr->dun_level));
+               player_ptr->current_floor_ptr->inside_quest = random_quest_number(player_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 ((player_ptr->current_floor_ptr->dun_level == d_info[player_ptr->dungeon_idx].maxdepth) && d_info[player_ptr->dungeon_idx].final_guardian)
        {
-               if (r_info[d_info[p_ptr->dungeon_idx].final_guardian].max_num)
+               if (r_info[d_info[player_ptr->dungeon_idx].final_guardian].max_num)
 #ifdef JP
                        msg_format("この階には%sの主である%sが棲んでいる。",
-                                  d_name+d_info[p_ptr->dungeon_idx].name, 
-                                  r_name+r_info[d_info[p_ptr->dungeon_idx].final_guardian].name);
+                                  d_name+d_info[player_ptr->dungeon_idx].name, 
+                                  r_name+r_info[d_info[player_ptr->dungeon_idx].final_guardian].name);
 #else
                        msg_format("%^s lives in this level as the keeper of %s.",
-                                          r_name+r_info[d_info[p_ptr->dungeon_idx].final_guardian].name, 
-                                          d_name+d_info[p_ptr->dungeon_idx].name);
+                                          r_name+r_info[d_info[player_ptr->dungeon_idx].final_guardian].name, 
+                                          d_name+d_info[player_ptr->dungeon_idx].name);
 #endif
        }
 
-       if (!load_game && (p_ptr->special_defense & NINJA_S_STEALTH)) set_superstealth(p_ptr, FALSE);
+       if (!load_game && (player_ptr->special_defense & NINJA_S_STEALTH)) set_superstealth(player_ptr, FALSE);
 
        /*** Process this dungeon level ***/
 
        /* Reset the monster generation level */
-       current_floor_ptr->monster_level = current_floor_ptr->base_level;
+       player_ptr->current_floor_ptr->monster_level = player_ptr->current_floor_ptr->base_level;
 
        /* Reset the object generation level */
-       current_floor_ptr->object_level = current_floor_ptr->base_level;
+       player_ptr->current_floor_ptr->object_level = player_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->energy_need = 0;
+       if (player_ptr->energy_need > 0 && !player_ptr->phase_out &&
+           (player_ptr->current_floor_ptr->dun_level || player_ptr->leaving_dungeon || player_ptr->current_floor_ptr->inside_arena))
+               player_ptr->energy_need = 0;
 
        /* Not leaving dungeon */
-       p_ptr->leaving_dungeon = FALSE;
+       player_ptr->leaving_dungeon = FALSE;
 
        /* Initialize monster process */
        mproc_init();
@@ -5060,74 +5059,74 @@ 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 ((player_ptr->current_floor_ptr->m_cnt + 32 > current_world_ptr->max_m_idx) && !player_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 ((player_ptr->current_floor_ptr->m_cnt + 32 < player_ptr->current_floor_ptr->m_max) && !player_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 (player_ptr->current_floor_ptr->o_cnt + 32 > current_world_ptr->max_o_idx) compact_objects(player_ptr->current_floor_ptr, 64);
 
                /* Hack -- Compress the object list occasionally */
-               if (current_floor_ptr->o_cnt + 32 < current_floor_ptr->o_max) compact_objects(0);
+               if (player_ptr->current_floor_ptr->o_cnt + 32 < player_ptr->current_floor_ptr->o_max) compact_objects(player_ptr->current_floor_ptr, 0);
 
                /* Process the player */
-               process_player();
-               process_upkeep_with_speed();
+               process_player(player_ptr);
+               process_upkeep_with_speed(player_ptr);
 
-               handle_stuff();
+               handle_stuff(player_ptr);
 
                /* Hack -- Hilite the player */
-               move_cursor_relative(p_ptr->y, p_ptr->x);
+               move_cursor_relative(player_ptr->y, player_ptr->x);
 
                /* Optional fresh */
                if (fresh_after) Term_fresh();
 
                /* Hack -- Notice death or departure */
-               if (!p_ptr->playing || p_ptr->is_dead) break;
+               if (!player_ptr->playing || player_ptr->is_dead) break;
 
                /* Process all of the monsters */
-               process_monsters();
+               process_monsters(player_ptr);
 
-               handle_stuff();
+               handle_stuff(player_ptr);
 
                /* Hack -- Hilite the player */
-               move_cursor_relative(p_ptr->y, p_ptr->x);
+               move_cursor_relative(player_ptr->y, player_ptr->x);
 
                /* Optional fresh */
                if (fresh_after) Term_fresh();
 
                /* Hack -- Notice death or departure */
-               if (!p_ptr->playing || p_ptr->is_dead) break;
+               if (!player_ptr->playing || player_ptr->is_dead) break;
 
                /* Process the world */
-               process_world();
+               process_world(player_ptr);
 
-               handle_stuff();
+               handle_stuff(player_ptr);
 
                /* Hack -- Hilite the player */
-               move_cursor_relative(p_ptr->y, p_ptr->x);
+               move_cursor_relative(player_ptr->y, player_ptr->x);
 
                /* Optional fresh */
                if (fresh_after) Term_fresh();
 
                /* Hack -- Notice death or departure */
-               if (!p_ptr->playing || p_ptr->is_dead) break;
+               if (!player_ptr->playing || player_ptr->is_dead) break;
 
                /* Count game turns */
                current_world_ptr->game_turn++;
 
                if (current_world_ptr->dungeon_turn < current_world_ptr->dungeon_turn_limit)
                {
-                       if (!p_ptr->wild_mode || wild_regen) current_world_ptr->dungeon_turn++;
-                       else if (p_ptr->wild_mode && !(current_world_ptr->game_turn % ((MAX_HGT + MAX_WID) / 2))) current_world_ptr->dungeon_turn++;
+                       if (!player_ptr->wild_mode || wild_regen) current_world_ptr->dungeon_turn++;
+                       else if (player_ptr->wild_mode && !(current_world_ptr->game_turn % ((MAX_HGT + MAX_WID) / 2))) current_world_ptr->dungeon_turn++;
                }
 
                prevent_turn_overflow();
 
                /* Handle "leaving" */
-               if (p_ptr->leaving) break;
+               if (player_ptr->leaving) break;
 
                if (wild_regen) wild_regen--;
        }
@@ -5140,13 +5139,13 @@ static void dungeon(bool load_game)
        }
 
        /* Not save-and-quit and not dead? */
-       if (p_ptr->playing && !p_ptr->is_dead)
+       if (player_ptr->playing && !player_ptr->is_dead)
        {
                /*
                 * Maintain Unique monsters and artifact, save current
                 * floor, then prepare next floor
                 */
-               leave_floor(p_ptr->change_floor_mode);
+               leave_floor(player_ptr);
 
                /* Forget the flag */
                reinit_wilderness = FALSE;
@@ -5221,6 +5220,7 @@ static void load_all_pref_files(void)
        autopick_load_pref(FALSE);
 }
 
+
 /*!
  * @brief 1ゲームプレイの主要ルーチン / Actually play a game
  * @return なし
@@ -5229,7 +5229,7 @@ static void load_all_pref_files(void)
  * savefile, we will commit suicide, if necessary, to allow the
  * player to start a new game.
  */
-void play_game(bool new_game)
+void play_game(player_type *player_ptr, bool new_game)
 {
        MONSTER_IDX i;
        bool load_game = TRUE;
@@ -5256,7 +5256,7 @@ void play_game(bool new_game)
                return;
        }
 
-       p_ptr->hack_mutation = FALSE;
+       player_ptr->hack_mutation = FALSE;
 
        /* Hack -- Character is "icky" */
        current_world_ptr->character_icky = TRUE;
@@ -5277,7 +5277,7 @@ void play_game(bool new_game)
                }
        }
 
-       /* Hack -- current_world_ptr->game_turn off the cursor */
+       /* Hack -- turn off the cursor */
        (void)Term_set_cursor(0);
 
 
@@ -5291,7 +5291,7 @@ void play_game(bool new_game)
        extract_option_vars();
 
        /* Report waited score */
-       if (p_ptr->wait_report_score)
+       if (player_ptr->wait_report_score)
        {
                char buf[1024];
                bool success;
@@ -5299,10 +5299,10 @@ void play_game(bool new_game)
                if (!get_check_strict(_("待機していたスコア登録を今行ないますか?", "Do you register score now? "), CHECK_NO_HISTORY))
                        quit(0);
 
-               p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
-               update_creature(p_ptr);
+               player_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
+               update_creature(player_ptr);
 
-               p_ptr->is_dead = TRUE;
+               player_ptr->is_dead = TRUE;
 
                current_world_ptr->start_time = (u32b)time(NULL);
 
@@ -5317,10 +5317,10 @@ void play_game(bool new_game)
                highscore_fd = fd_open(buf, O_RDWR);
 
                /* 町名消失バグ対策(#38205)のためここで世界マップ情報を読み出す */
-               process_dungeon_file("w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
+               process_dungeon_file(player_ptr, "w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
 
                /* Handle score, show Top scores */
-               success = send_world_score(TRUE);
+               success = send_world_score(player_ptr, TRUE);
 
                if (!success && !get_check_strict(_("スコア登録を諦めますか?", "Do you give up score registration? "), CHECK_NO_HISTORY))
                {
@@ -5329,9 +5329,9 @@ void play_game(bool new_game)
                }
                else
                {
-                       p_ptr->wait_report_score = FALSE;
-                       top_twenty();
-                       if (!save_player()) msg_print(_("セーブ失敗!", "death save failed!"));
+                       player_ptr->wait_report_score = FALSE;
+                       top_twenty(player_ptr);
+                       if (!save_player(player_ptr)) msg_print(_("セーブ失敗!", "death save failed!"));
                }
                /* Shut the high score file */
                (void)fd_close(highscore_fd);
@@ -5360,14 +5360,14 @@ void play_game(bool new_game)
                init_random_seed = TRUE;
 
                /* Initialize the saved floors data */
-               init_saved_floors(FALSE);
+               init_saved_floors(player_ptr, FALSE);
        }
 
        /* Old game is loaded.  But new game is requested. */
        else if (new_game)
        {
                /* Initialize the saved floors data */
-               init_saved_floors(TRUE);
+               init_saved_floors(player_ptr, TRUE);
        }
 
        /* Process old character */
@@ -5390,10 +5390,10 @@ void play_game(bool new_game)
                current_world_ptr->character_dungeon = FALSE;
 
                /* Start in town */
-               current_floor_ptr->dun_level = 0;
-               p_ptr->inside_quest = 0;
-               p_ptr->inside_arena = FALSE;
-               p_ptr->phase_out = FALSE;
+               player_ptr->current_floor_ptr->dun_level = 0;
+               player_ptr->current_floor_ptr->inside_quest = 0;
+               player_ptr->current_floor_ptr->inside_arena = FALSE;
+               player_ptr->phase_out = FALSE;
 
                write_level = TRUE;
 
@@ -5404,10 +5404,10 @@ void play_game(bool new_game)
                current_world_ptr->seed_town = randint0(0x10000000);
 
                /* Roll up a new character */
-               player_birth(p_ptr);
+               player_birth(player_ptr);
 
                counts_write(2,0);
-               p_ptr->count = 0;
+               player_ptr->count = 0;
 
                load = FALSE;
 
@@ -5415,28 +5415,28 @@ void play_game(bool new_game)
                determine_today_mon(FALSE);
 
                /* Initialize object array */
-               wipe_o_list();
+               wipe_o_list(player_ptr->current_floor_ptr);
        }
        else
        {
                write_level = FALSE;
 
-               exe_write_diary(p_ptr, NIKKI_GAMESTART, 1, 
+               exe_write_diary(player_ptr, NIKKI_GAMESTART, 1, 
                                          _("                            ----ゲーム再開----",
                                                "                            ---- Restart Game ----"));
 
 /*
- * 1.0.9 以前はセーブ前に p_ptr->riding = -1 としていたので、再設定が必要だった。
+ * 1.0.9 以前はセーブ前に player_ptr->riding = -1 としていたので、再設定が必要だった。
  * もう不要だが、以前のセーブファイルとの互換のために残しておく。
  */
-               if (p_ptr->riding == -1)
+               if (player_ptr->riding == -1)
                {
-                       p_ptr->riding = 0;
-                       for (i = current_floor_ptr->m_max; i > 0; i--)
+                       player_ptr->riding = 0;
+                       for (i = player_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(player_ptr, player_ptr->current_floor_ptr->m_list[i].fy, player_ptr->current_floor_ptr->m_list[i].fx))
                                {
-                                       p_ptr->riding = i;
+                                       player_ptr->riding = i;
                                        break;
                                }
                        }
@@ -5445,24 +5445,24 @@ void play_game(bool new_game)
 
        current_world_ptr->creating_savefile = FALSE;
 
-       p_ptr->teleport_town = FALSE;
-       p_ptr->sutemi = FALSE;
+       player_ptr->teleport_town = FALSE;
+       player_ptr->sutemi = FALSE;
        current_world_ptr->timewalk_m_idx = 0;
-       p_ptr->now_damaged = FALSE;
+       player_ptr->now_damaged = FALSE;
        now_message = 0;
        current_world_ptr->start_time = time(NULL) - 1;
        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 = player_ptr->current_floor_ptr->height;
+       panel_col_min = player_ptr->current_floor_ptr->width;
 
        /* Sexy gal gets bonus to maximum weapon skill of whip */
-       if (p_ptr->pseikaku == SEIKAKU_SEXY)
-               s_info[p_ptr->pclass].w_max[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_MASTER;
+       if (player_ptr->pseikaku == SEIKAKU_SEXY)
+               s_info[player_ptr->pclass].w_max[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_MASTER;
 
        /* Fill the arrays of floors and walls in the good proportions */
-       set_floor_and_wall(p_ptr->dungeon_idx);
+       set_floor_and_wall(player_ptr->dungeon_idx);
 
        /* Flavor the objects */
        flavor_init();
@@ -5481,55 +5481,55 @@ void play_game(bool new_game)
                {
                        current_world_ptr->wizard = TRUE;
 
-                       if (p_ptr->is_dead || !p_ptr->y || !p_ptr->x)
+                       if (player_ptr->is_dead || !player_ptr->y || !player_ptr->x)
                        {
                                /* Initialize the saved floors data */
-                               init_saved_floors(TRUE);
+                               init_saved_floors(player_ptr, TRUE);
 
                                /* Avoid crash */
-                               p_ptr->inside_quest = 0;
+                               player_ptr->current_floor_ptr->inside_quest = 0;
 
                                /* Avoid crash in update_view() */
-                               p_ptr->y = p_ptr->x = 10;
+                               player_ptr->y = player_ptr->x = 10;
                        }
                }
-               else if (p_ptr->is_dead)
+               else if (player_ptr->is_dead)
                {
                        quit("Already dead.");
                }
        }
 
        /* Initialize the town-buildings if necessary */
-       if (!current_floor_ptr->dun_level && !p_ptr->inside_quest)
+       if (!player_ptr->current_floor_ptr->dun_level && !player_ptr->current_floor_ptr->inside_quest)
        {
-               process_dungeon_file("w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
+               process_dungeon_file(player_ptr, "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(p_ptr);
+               process_dungeon_file(player_ptr, "t_info.txt", 0, 0, MAX_HGT, MAX_WID);
+               select_floor_music(player_ptr);
        }
 
        /* Generate a dungeon level if needed */
        if (!current_world_ptr->character_dungeon)
        {
-               change_floor(p_ptr->change_floor_mode);
+               change_floor(player_ptr);
        }
        else
        {
                /* HACK -- Restore from panic-save */
-               if (p_ptr->panic_save)
+               if (player_ptr->panic_save)
                {
                        /* No player?  -- Try to regenerate floor */
-                       if (!p_ptr->y || !p_ptr->x)
+                       if (!player_ptr->y || !player_ptr->x)
                        {
                                msg_print(_("プレイヤーの位置がおかしい。フロアを再生成します。", "What a strange player location.  Regenerate the dungeon floor."));
-                               change_floor(p_ptr->change_floor_mode);
+                               change_floor(player_ptr);
                        }
 
                        /* Still no player?  -- Try to locate random place */
-                       if (!p_ptr->y || !p_ptr->x) p_ptr->y = p_ptr->x = 10;
+                       if (!player_ptr->y || !player_ptr->x) player_ptr->y = player_ptr->x = 10;
 
                        /* No longer in panic */
-                       p_ptr->panic_save = 0;
+                       player_ptr->panic_save = 0;
                }
        }
 
@@ -5545,12 +5545,12 @@ void play_game(bool new_game)
        {
                char buf[80];
                sprintf(buf, _("%sに降り立った。", "You are standing in the %s."), map_name());
-               exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, buf);
+               exe_write_diary(player_ptr, NIKKI_BUNSHOU, 0, buf);
        }
 
 
        /* Start game */
-       p_ptr->playing = TRUE;
+       player_ptr->playing = TRUE;
 
        /* Reset the visual mappings */
        reset_visuals();
@@ -5561,33 +5561,33 @@ void play_game(bool new_game)
        /* Give startup outfit (after loading pref files) */
        if (new_game)
        {
-               player_outfit(p_ptr);
+               player_outfit(player_ptr);
        }
 
        /* React to changes */
        Term_xtra(TERM_XTRA_REACT, 0);
 
-       p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
-       p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
-       handle_stuff();
+       player_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
+       player_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
+       handle_stuff(player_ptr);
 
        /* Set or clear "rogue_like_commands" if requested */
        if (arg_force_original) rogue_like_commands = FALSE;
        if (arg_force_roguelike) rogue_like_commands = TRUE;
 
        /* Hack -- Enforce "delayed death" */
-       if (p_ptr->chp < 0) p_ptr->is_dead = TRUE;
+       if (player_ptr->chp < 0) player_ptr->is_dead = TRUE;
 
-       if (p_ptr->prace == RACE_ANDROID) calc_android_exp(p_ptr);
+       if (player_ptr->prace == RACE_ANDROID) calc_android_exp(player_ptr);
 
-       if (new_game && ((p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BEASTMASTER)))
+       if (new_game && ((player_ptr->pclass == CLASS_CAVALRY) || (player_ptr->pclass == CLASS_BEASTMASTER)))
        {
                monster_type *m_ptr;
-               MONRACE_IDX pet_r_idx = ((p_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
+               MONRACE_IDX pet_r_idx = ((player_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
                monster_race *r_ptr = &r_info[pet_r_idx];
-               place_monster_aux(0, p_ptr->y, p_ptr->x - 1, pet_r_idx,
+               place_monster_aux(0, player_ptr->y, player_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 = &player_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,18 +5599,18 @@ void play_game(bool new_game)
        (void)combine_and_reorder_home(STORE_HOME);
        (void)combine_and_reorder_home(STORE_MUSEUM);
 
-       select_floor_music(p_ptr);
+       select_floor_music(player_ptr);
 
        /* Process */
        while (TRUE)
        {
                /* Process the level */
-               dungeon(load_game);
+               dungeon(player_ptr, load_game);
 
                /* Hack -- prevent "icky" message */
                current_world_ptr->character_xtra = TRUE;
 
-               handle_stuff();
+               handle_stuff(player_ptr);
 
                current_world_ptr->character_xtra = FALSE;
 
@@ -5620,16 +5620,15 @@ void play_game(bool new_game)
                /* Cancel the health bar */
                health_track(0);
 
-               forget_lite();
-               forget_view();
-               clear_mon_lite(current_floor_ptr);
+               forget_lite(player_ptr->current_floor_ptr);
+               forget_view(player_ptr->current_floor_ptr);
+               clear_mon_lite(player_ptr->current_floor_ptr);
 
                /* Handle "quit and save" */
-               if (!p_ptr->playing && !p_ptr->is_dead) break;
+               if (!player_ptr->playing && !player_ptr->is_dead) break;
 
-               /* Erase the old current_floor_ptr->grid_array */
-               wipe_o_list();
-               if (!p_ptr->is_dead) wipe_m_list();
+               wipe_o_list(player_ptr->current_floor_ptr);
+               if (!player_ptr->is_dead) wipe_m_list();
 
 
                msg_print(NULL);
@@ -5637,46 +5636,46 @@ void play_game(bool new_game)
                load_game = FALSE;
 
                /* Accidental Death */
-               if (p_ptr->playing && p_ptr->is_dead)
+               if (player_ptr->playing && player_ptr->is_dead)
                {
-                       if (p_ptr->inside_arena)
+                       if (player_ptr->current_floor_ptr->inside_arena)
                        {
-                               p_ptr->inside_arena = FALSE;
-                               if (p_ptr->arena_number > MAX_ARENA_MONS)
-                                       p_ptr->arena_number++;
+                               player_ptr->current_floor_ptr->inside_arena = FALSE;
+                               if (player_ptr->arena_number > MAX_ARENA_MONS)
+                                       player_ptr->arena_number++;
                                else
-                                       p_ptr->arena_number = -1 - p_ptr->arena_number;
-                               p_ptr->is_dead = FALSE;
-                               p_ptr->chp = 0;
-                               p_ptr->chp_frac = 0;
-                               p_ptr->exit_bldg = TRUE;
-                               reset_tim_flags(p_ptr);
+                                       player_ptr->arena_number = -1 - player_ptr->arena_number;
+                               player_ptr->is_dead = FALSE;
+                               player_ptr->chp = 0;
+                               player_ptr->chp_frac = 0;
+                               player_ptr->exit_bldg = TRUE;
+                               reset_tim_flags(player_ptr);
 
                                /* Leave through the exit */
-                               prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_RAND_CONNECT);
+                               prepare_change_floor_mode(player_ptr, CFM_SAVE_FLOORS | CFM_RAND_CONNECT);
 
                                /* prepare next floor */
-                               leave_floor(p_ptr->change_floor_mode);
+                               leave_floor(player_ptr);
                        }
                        else
                        {
                                /* Mega-Hack -- Allow player to cheat death */
                                if ((current_world_ptr->wizard || cheat_live) && !get_check(_("死にますか? ", "Die? ")))
                                {
-                                       cheat_death(p_ptr);
+                                       cheat_death(player_ptr);
                                }
                        }
                }
 
                /* Handle "death" */
-               if (p_ptr->is_dead) break;
+               if (player_ptr->is_dead) break;
 
                /* Make a new level */
-               change_floor(p_ptr->change_floor_mode);
+               change_floor(player_ptr);
        }
 
        /* Close stuff */
-       close_game();
+       close_game(player_ptr);
 
        /* Quit */
        quit(NULL);
@@ -5702,6 +5701,7 @@ s32b turn_real(s32b hoge)
        }
 }
 
+
 /*!
  * @brief ターンのオーバーフローに対する対処
  * @details ターン及びターンを記録する変数をターンの限界の1日前まで巻き戻す.
@@ -5719,8 +5719,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;
@@ -5747,22 +5747,24 @@ void prevent_turn_overflow(void)
        }
 }
 
+
 /*!
  * @brief ゲーム終了処理 /
  * Close up the current game (player may or may not be dead)
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @return なし
  * @details
  * <pre>
  * This function is called only from "main.c" and "signals.c".
  * </pre>
  */
-void close_game(void)
+void close_game(player_type *player_ptr)
 {
        char buf[1024];
        bool do_send = TRUE;
 
        /*      concptr p = "[i:キャラクタの情報, f:ファイル書き出し, t:スコア, x:*鑑定*, ESC:ゲーム終了]"; */
-       handle_stuff();
+       handle_stuff(player_ptr);
 
        /* Flush the messages */
        msg_print(NULL);
@@ -5790,41 +5792,41 @@ void close_game(void)
        safe_setuid_drop();
 
        /* Handle death */
-       if (p_ptr->is_dead)
+       if (player_ptr->is_dead)
        {
                /* Handle retirement */
-               if (p_ptr->total_winner) kingly();
+               if (current_world_ptr->total_winner) kingly(player_ptr);
 
                /* Save memories */
                if (!cheat_save || get_check(_("死んだデータをセーブしますか? ", "Save death? ")))
                {
-                       if (!save_player()) msg_print(_("セーブ失敗!", "death save failed!"));
+                       if (!save_player(player_ptr)) msg_print(_("セーブ失敗!", "death save failed!"));
                }
                else do_send = FALSE;
 
                /* You are dead */
-               print_tomb();
+               print_tomb(player_ptr);
 
                flush();
 
                /* Show more info */
-               show_info();
+               show_info(player_ptr);
                Term_clear();
 
                if (check_score())
                {
-                       if ((!send_world_score(do_send)))
+                       if ((!send_world_score(player_ptr, do_send)))
                        {
                                if (get_check_strict(_("後でスコアを登録するために待機しますか?", "Stand by for later score registration? "),
                                        (CHECK_NO_ESCAPE | CHECK_NO_HISTORY)))
                                {
-                                       p_ptr->wait_report_score = TRUE;
-                                       p_ptr->is_dead = FALSE;
-                                       if (!save_player()) msg_print(_("セーブ失敗!", "death save failed!"));
+                                       player_ptr->wait_report_score = TRUE;
+                                       player_ptr->is_dead = FALSE;
+                                       if (!save_player(player_ptr)) msg_print(_("セーブ失敗!", "death save failed!"));
                                }
                        }
-                       if (!p_ptr->wait_report_score)
-                               (void)top_twenty();
+                       if (!player_ptr->wait_report_score)
+                               (void)top_twenty(player_ptr);
                }
                else if (highscore_fd >= 0)
                {
@@ -5840,14 +5842,14 @@ void close_game(void)
        else
        {
                /* Save the game */
-               do_cmd_save_game(FALSE);
+               do_cmd_save_game(player_ptr, FALSE);
 
                /* Prompt for scores */
                prt(_("リターンキーか ESC キーを押して下さい。", "Press Return (or Escape)."), 0, 40);
                play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_EXIT);
 
                /* Predict score (or ESCAPE) */
-               if (inkey() != ESCAPE) predict_score();
+               if (inkey() != ESCAPE) predict_score(player_ptr);
        }
 
 
@@ -5857,8 +5859,8 @@ void close_game(void)
        /* Forget the high score fd */
        highscore_fd = -1;
 
-       /* Kill all temporal files */
-       clear_saved_floor_files();
+       /* Kill all temporary files */
+       clear_saved_floor_files(player_ptr);
 
        /* Allow suspending now */
        signals_handle_tstp();
@@ -5870,16 +5872,16 @@ void close_game(void)
  * Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window"
  * @return なし
  */
-void handle_stuff(void)
+void handle_stuff(player_type *player_ptr)
 {
-       if (p_ptr->update) update_creature(p_ptr);
-       if (p_ptr->redraw) redraw_stuff();
-       if (p_ptr->window) window_stuff();
+       if (player_ptr->update) update_creature(player_ptr);
+       if (player_ptr->redraw) redraw_stuff(player_ptr);
+       if (player_ptr->window) window_stuff(player_ptr);
 }
 
-void update_output(void)
+
+void update_output(player_type *player_ptr)
 {
-       if (p_ptr->redraw) redraw_stuff();
-       if (p_ptr->window) window_stuff();
+       if (player_ptr->redraw) redraw_stuff(player_ptr);
+       if (player_ptr->window) window_stuff(player_ptr);
 }
-