OSDN Git Service

[Refactor] #38997 teleport_player() に player_type * 引数を追加. / Add player_type * argume...
[hengband/hengband.git] / src / spells3.c
index 34ef9cb..cab7594 100644 (file)
@@ -74,7 +74,7 @@
  * Attempt to move the monster at least "dis/2" grids away.
  * But allow variation to prevent infinite loops.
  */
-bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
+bool teleport_away(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
 {
        POSITION oy, ox, d, i, min;
        int tries = 0;
@@ -82,7 +82,7 @@ bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
 
        bool look = TRUE;
 
-       monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+       monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
        if (!monster_is_valid(m_ptr)) return (FALSE);
 
        oy = m_ptr->fy;
@@ -92,10 +92,10 @@ bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
        min = dis / 2;
 
        if ((mode & TELEPORT_DEC_VALOUR) &&
-           (((p_ptr->chp * 10) / p_ptr->mhp) > 5) &&
-               (4+randint1(5) < ((p_ptr->chp * 10) / p_ptr->mhp)))
+           (((caster_ptr->chp * 10) / caster_ptr->mhp) > 5) &&
+               (4+randint1(5) < ((caster_ptr->chp * 10) / caster_ptr->mhp)))
        {
-               chg_virtue(p_ptr, V_VALOUR, -1);
+               chg_virtue(caster_ptr, V_VALOUR, -1);
        }
 
        /* Look until done */
@@ -119,13 +119,13 @@ bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
                        }
 
                        /* Ignore illegal locations */
-                       if (!in_bounds(p_ptr->current_floor_ptr, ny, nx)) continue;
+                       if (!in_bounds(caster_ptr->current_floor_ptr, ny, nx)) continue;
 
                        if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue;
 
                        /* No teleporting into vaults and such */
-                       if (!(p_ptr->inside_quest || p_ptr->inside_arena))
-                               if (p_ptr->current_floor_ptr->grid_array[ny][nx].info & CAVE_ICKY) continue;
+                       if (!(caster_ptr->current_floor_ptr->inside_quest || caster_ptr->current_floor_ptr->inside_arena))
+                               if (caster_ptr->current_floor_ptr->grid_array[ny][nx].info & CAVE_ICKY) continue;
 
                        /* This grid looks good */
                        look = FALSE;
@@ -147,10 +147,10 @@ bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
        sound(SOUND_TPOTHER);
 
        /* Update the old location */
-       p_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
+       caster_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
 
        /* Update the new location */
-       p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
+       caster_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
 
        /* Move the monster */
        m_ptr->fy = ny;
@@ -159,12 +159,12 @@ bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
        /* Forget the counter target */
        reset_target(m_ptr);
 
-       update_monster(m_idx, TRUE);
+       update_monster(caster_ptr, m_idx, TRUE);
        lite_spot(oy, ox);
        lite_spot(ny, nx);
 
        if (r_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
-               p_ptr->update |= (PU_MON_LITE);
+               caster_ptr->update |= (PU_MON_LITE);
 
        return (TRUE);
 }
@@ -255,7 +255,7 @@ void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power,
        m_ptr->fy = ny;
        m_ptr->fx = nx;
 
-       update_monster(m_idx, TRUE);
+       update_monster(p_ptr, m_idx, TRUE);
        lite_spot(oy, ox);
        lite_spot(ny, nx);
 
@@ -286,21 +286,21 @@ void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power,
  * </pre>
  */
 
-bool teleport_player_aux(POSITION dis, BIT_FLAGS mode)
+bool teleport_player_aux(player_type *creature_ptr, POSITION dis, BIT_FLAGS mode)
 {
        int candidates_at[MAX_TELEPORT_DISTANCE + 1];
        int total_candidates, cur_candidates;
        POSITION y = 0, x = 0;
        int min, pick, i;
 
-       int left = MAX(1, p_ptr->x - dis);
-       int right = MIN(p_ptr->current_floor_ptr->width - 2, p_ptr->x + dis);
-       int top = MAX(1, p_ptr->y - dis);
-       int bottom = MIN(p_ptr->current_floor_ptr->height - 2, p_ptr->y + dis);
+       int left = MAX(1, creature_ptr->x - dis);
+       int right = MIN(creature_ptr->current_floor_ptr->width - 2, creature_ptr->x + dis);
+       int top = MAX(1, creature_ptr->y - dis);
+       int bottom = MIN(creature_ptr->current_floor_ptr->height - 2, creature_ptr->y + dis);
 
-       if (p_ptr->wild_mode) return FALSE;
+       if (creature_ptr->wild_mode) return FALSE;
 
-       if (p_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
+       if (creature_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
        {
                msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
                return FALSE;
@@ -325,7 +325,7 @@ bool teleport_player_aux(POSITION dis, BIT_FLAGS mode)
                        if (!cave_player_teleportable_bold(y, x, mode)) continue;
 
                        /* Calculate distance */
-                       d = distance(p_ptr->y, p_ptr->x, y, x);
+                       d = distance(creature_ptr->y, creature_ptr->x, y, x);
 
                        /* Skip too far locations */
                        if (d > dis) continue;
@@ -364,7 +364,7 @@ bool teleport_player_aux(POSITION dis, BIT_FLAGS mode)
                        if (!cave_player_teleportable_bold(y, x, mode)) continue;
 
                        /* Calculate distance */
-                       d = distance(p_ptr->y, p_ptr->x, y, x);
+                       d = distance(creature_ptr->y, creature_ptr->x, y, x);
 
                        /* Skip too far locations */
                        if (d > dis) continue;
@@ -381,16 +381,16 @@ bool teleport_player_aux(POSITION dis, BIT_FLAGS mode)
                if (!pick) break;
        }
 
-       if (player_bold(y, x)) return FALSE;
+       if (player_bold(creature_ptr, y, x)) return FALSE;
 
        sound(SOUND_TELEPORT);
 
 #ifdef JP
-       if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (p_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
-               msg_format("『こっちだぁ、%s』", p_ptr->name);
+       if ((creature_ptr->pseikaku == SEIKAKU_COMBAT) || (creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
+               msg_format("『こっちだぁ、%s』", creature_ptr->name);
 #endif
 
-       (void)move_player_effect(p_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
+       (void)move_player_effect(creature_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
        return TRUE;
 }
 
@@ -400,25 +400,25 @@ bool teleport_player_aux(POSITION dis, BIT_FLAGS mode)
  * @param mode オプション
  * @return なし
  */
-void teleport_player(POSITION dis, BIT_FLAGS mode)
+void teleport_player(player_type *creature_ptr, POSITION dis, BIT_FLAGS mode)
 {
        POSITION yy, xx;
-       POSITION oy = p_ptr->y;
-       POSITION ox = p_ptr->x;
+       POSITION oy = creature_ptr->y;
+       POSITION ox = creature_ptr->x;
 
-       if (!teleport_player_aux(dis, mode)) return;
+       if (!teleport_player_aux(creature_ptr, dis, mode)) return;
 
        /* Monsters with teleport ability may follow the player */
        for (xx = -1; xx < 2; xx++)
        {
                for (yy = -1; yy < 2; yy++)
                {
-                       MONSTER_IDX tmp_m_idx = p_ptr->current_floor_ptr->grid_array[oy+yy][ox+xx].m_idx;
+                       MONSTER_IDX tmp_m_idx = creature_ptr->current_floor_ptr->grid_array[oy+yy][ox+xx].m_idx;
 
                        /* A monster except your mount may follow */
-                       if (tmp_m_idx && (p_ptr->riding != tmp_m_idx))
+                       if (tmp_m_idx && (creature_ptr->riding != tmp_m_idx))
                        {
-                               monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[tmp_m_idx];
+                               monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[tmp_m_idx];
                                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                                /*
@@ -428,7 +428,7 @@ void teleport_player(POSITION dis, BIT_FLAGS mode)
                                if ((r_ptr->a_ability_flags2 & RF6_TPORT) &&
                                    !(r_ptr->flagsr & RFR_RES_TELE))
                                {
-                                       if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, p_ptr->y, p_ptr->x, r_ptr->level, 0L);
+                                       if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, creature_ptr->y, creature_ptr->x, r_ptr->level, 0L);
                                }
                        }
                }
@@ -448,7 +448,7 @@ void teleport_player_away(MONSTER_IDX m_idx, POSITION dis)
        POSITION oy = p_ptr->y;
        POSITION ox = p_ptr->x;
 
-       if (!teleport_player_aux(dis, TELEPORT_PASSIVE)) return;
+       if (!teleport_player_aux(p_ptr, dis, TELEPORT_PASSIVE)) return;
 
        /* Monsters with teleport ability may follow the player */
        for (xx = -1; xx < 2; xx++)
@@ -491,12 +491,12 @@ void teleport_player_away(MONSTER_IDX m_idx, POSITION dis)
  * This function allows teleporting into vaults (!)
  * </pre>
  */
-void teleport_player_to(POSITION ny, POSITION nx, BIT_FLAGS mode)
+void teleport_player_to(player_type *creature_ptr, POSITION ny, POSITION nx, BIT_FLAGS mode)
 {
        POSITION y, x;
        POSITION dis = 0, ctr = 0;
 
-       if (p_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
+       if (creature_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
        {
                msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
                return;
@@ -510,11 +510,11 @@ void teleport_player_to(POSITION ny, POSITION nx, BIT_FLAGS mode)
                {
                        y = (POSITION)rand_spread(ny, dis);
                        x = (POSITION)rand_spread(nx, dis);
-                       if (in_bounds(p_ptr->current_floor_ptr, y, x)) break;
+                       if (in_bounds(creature_ptr->current_floor_ptr, y, x)) break;
                }
 
                /* Accept any grid when wizard mode */
-               if (current_world_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!p_ptr->current_floor_ptr->grid_array[y][x].m_idx || (p_ptr->current_floor_ptr->grid_array[y][x].m_idx == p_ptr->riding))) break;
+               if (current_world_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!creature_ptr->current_floor_ptr->grid_array[y][x].m_idx || (creature_ptr->current_floor_ptr->grid_array[y][x].m_idx == creature_ptr->riding))) break;
 
                /* Accept teleportable floor grids */
                if (cave_player_teleportable_bold(y, x, mode)) break;
@@ -528,7 +528,7 @@ void teleport_player_to(POSITION ny, POSITION nx, BIT_FLAGS mode)
        }
 
        sound(SOUND_TELEPORT);
-       (void)move_player_effect(p_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
+       (void)move_player_effect(creature_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
 }
 
 
@@ -540,9 +540,9 @@ void teleport_away_followable(MONSTER_IDX m_idx)
        bool old_ml = m_ptr->ml;
        POSITION old_cdis = m_ptr->cdis;
 
-       teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
+       teleport_away(p_ptr, m_idx, MAX_SIGHT * 2 + 5, 0L);
 
-       if (old_ml && (old_cdis <= MAX_SIGHT) && !current_world_ptr->timewalk_m_idx && !p_ptr->phase_out && los(p_ptr->y, p_ptr->x, oldfy, oldfx))
+       if (old_ml && (old_cdis <= MAX_SIGHT) && !current_world_ptr->timewalk_m_idx && !p_ptr->phase_out && los(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, oldfy, oldfx))
        {
                bool follow = FALSE;
 
@@ -574,10 +574,10 @@ void teleport_away_followable(MONSTER_IDX m_idx)
                        {
                                if (one_in_(3))
                                {
-                                       teleport_player(200, TELEPORT_PASSIVE);
+                                       teleport_player(p_ptr, 200, TELEPORT_PASSIVE);
                                        msg_print(_("失敗!", "Failed!"));
                                }
-                               else teleport_player_to(m_ptr->fy, m_ptr->fx, 0L);
+                               else teleport_player_to(p_ptr, m_ptr->fy, m_ptr->fx, 0L);
                                p_ptr->energy_need += ENERGY_NEED();
                        }
                }
@@ -595,8 +595,8 @@ bool teleport_level_other(player_type *creature_ptr)
        if (!target_set(TARGET_KILL)) return FALSE;
        target_m_idx = p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
        if (!target_m_idx) return TRUE;
-       if (!player_has_los_bold(target_row, target_col)) return TRUE;
-       if (!projectable(creature_ptr->y, creature_ptr->x, target_row, target_col)) return TRUE;
+       if (!player_has_los_bold(p_ptr, target_row, target_col)) return TRUE;
+       if (!projectable(creature_ptr->current_floor_ptr, creature_ptr->y, creature_ptr->x, target_row, target_col)) return TRUE;
        m_ptr = &p_ptr->current_floor_ptr->m_list[target_m_idx];
        r_ptr = &r_info[m_ptr->r_idx];
        monster_desc(m_name, m_ptr, 0);
@@ -607,7 +607,7 @@ bool teleport_level_other(player_type *creature_ptr)
        {
                msg_format(_("しかし効果がなかった!", "%^s is unaffected!"), m_name);
        }
-       else teleport_level(target_m_idx);
+       else teleport_level(creature_ptr, target_m_idx);
        return TRUE;
 }
 
@@ -617,11 +617,11 @@ bool teleport_level_other(player_type *creature_ptr)
  * @param m_idx テレポートの対象となるモンスターID(0ならばプレイヤー) / If m_idx <= 0, target is player.
  * @return なし
  */
-void teleport_level(MONSTER_IDX m_idx)
+void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx)
 {
-       bool         go_up;
+       bool go_up;
        GAME_TEXT m_name[160];
-       bool         see_m = TRUE;
+       bool see_m = TRUE;
 
        if (m_idx <= 0) /* To player */
        {
@@ -629,7 +629,7 @@ void teleport_level(MONSTER_IDX m_idx)
        }
        else /* To monster */
        {
-               monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+               monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
 
                /* Get the monster name (or "it") */
                monster_desc(m_name, m_ptr, 0);
@@ -644,7 +644,7 @@ void teleport_level(MONSTER_IDX m_idx)
                return;
        }
 
-       if ((m_idx <= 0) && p_ptr->anti_tele) /* To player */
+       if ((m_idx <= 0) && creature_ptr->anti_tele) /* To player */
        {
                msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
                return;
@@ -661,7 +661,7 @@ void teleport_level(MONSTER_IDX m_idx)
        }
 
        /* Down only */ 
-       if ((ironman_downward && (m_idx <= 0)) || (p_ptr->current_floor_ptr->dun_level <= d_info[p_ptr->dungeon_idx].mindepth))
+       if ((ironman_downward && (m_idx <= 0)) || (creature_ptr->current_floor_ptr->dun_level <= d_info[creature_ptr->dungeon_idx].mindepth))
        {
 #ifdef JP
                if (see_m) msg_format("%^sは床を突き破って沈んでいく。", m_name);
@@ -670,32 +670,32 @@ void teleport_level(MONSTER_IDX m_idx)
 #endif
                if (m_idx <= 0) /* To player */
                {
-                       if (!p_ptr->current_floor_ptr->dun_level)
+                       if (!creature_ptr->current_floor_ptr->dun_level)
                        {
-                               p_ptr->dungeon_idx = ironman_downward ? DUNGEON_ANGBAND : p_ptr->recall_dungeon;
-                               p_ptr->oldpy = p_ptr->y;
-                               p_ptr->oldpx = p_ptr->x;
+                               creature_ptr->dungeon_idx = ironman_downward ? DUNGEON_ANGBAND : creature_ptr->recall_dungeon;
+                               creature_ptr->oldpy = creature_ptr->y;
+                               creature_ptr->oldpx = creature_ptr->x;
                        }
 
-                       if (record_stair) exe_write_diary(p_ptr, NIKKI_TELE_LEV, 1, NULL);
+                       if (record_stair) exe_write_diary(creature_ptr, NIKKI_TELE_LEV, 1, NULL);
 
                        if (autosave_l) do_cmd_save_game(TRUE);
 
-                       if (!p_ptr->current_floor_ptr->dun_level)
+                       if (!creature_ptr->current_floor_ptr->dun_level)
                        {
-                               p_ptr->current_floor_ptr->dun_level = d_info[p_ptr->dungeon_idx].mindepth;
+                               creature_ptr->current_floor_ptr->dun_level = d_info[creature_ptr->dungeon_idx].mindepth;
                                prepare_change_floor_mode(CFM_RAND_PLACE);
                        }
                        else
                        {
                                prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
                        }
-                       p_ptr->leaving = TRUE;
+                       creature_ptr->leaving = TRUE;
                }
        }
 
        /* Up only */
-       else if (quest_number(p_ptr->current_floor_ptr->dun_level) || (p_ptr->current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth))
+       else if (quest_number(creature_ptr->current_floor_ptr->dun_level) || (creature_ptr->current_floor_ptr->dun_level >= d_info[creature_ptr->dungeon_idx].maxdepth))
        {
 #ifdef JP
                if (see_m) msg_format("%^sは天井を突き破って宙へ浮いていく。", m_name);
@@ -706,15 +706,15 @@ void teleport_level(MONSTER_IDX m_idx)
 
                if (m_idx <= 0) /* To player */
                {
-                       if (record_stair) exe_write_diary(p_ptr, NIKKI_TELE_LEV, -1, NULL);
+                       if (record_stair) exe_write_diary(creature_ptr, NIKKI_TELE_LEV, -1, NULL);
 
                        if (autosave_l) do_cmd_save_game(TRUE);
 
                        prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_UP | CFM_RAND_PLACE | CFM_RAND_CONNECT);
 
                        leave_quest_check();
-                       p_ptr->inside_quest = 0;
-                       p_ptr->leaving = TRUE;
+                       creature_ptr->current_floor_ptr->inside_quest = 0;
+                       creature_ptr->leaving = TRUE;
                }
        }
        else if (go_up)
@@ -728,12 +728,12 @@ void teleport_level(MONSTER_IDX m_idx)
 
                if (m_idx <= 0) /* To player */
                {
-                       if (record_stair) exe_write_diary(p_ptr, NIKKI_TELE_LEV, -1, NULL);
+                       if (record_stair) exe_write_diary(creature_ptr, NIKKI_TELE_LEV, -1, NULL);
 
                        if (autosave_l) do_cmd_save_game(TRUE);
 
                        prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_UP | CFM_RAND_PLACE | CFM_RAND_CONNECT);
-                       p_ptr->leaving = TRUE;
+                       creature_ptr->leaving = TRUE;
                }
        }
        else
@@ -747,19 +747,19 @@ void teleport_level(MONSTER_IDX m_idx)
                if (m_idx <= 0) /* To player */
                {
                        /* Never reach this code on the surface */
-                       /* if (!p_ptr->current_floor_ptr->dun_level) p_ptr->dungeon_idx = p_ptr->recall_dungeon; */
-                       if (record_stair) exe_write_diary(p_ptr, NIKKI_TELE_LEV, 1, NULL);
+                       /* if (!creature_ptr->current_floor_ptr->dun_level) creature_ptr->dungeon_idx = creature_ptr->recall_dungeon; */
+                       if (record_stair) exe_write_diary(creature_ptr, NIKKI_TELE_LEV, 1, NULL);
                        if (autosave_l) do_cmd_save_game(TRUE);
 
                        prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
-                       p_ptr->leaving = TRUE;
+                       creature_ptr->leaving = TRUE;
                }
        }
 
        /* Monster level teleportation is simple deleting now */
        if (m_idx > 0)
        {
-               monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+               monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
 
                check_quest_completion(m_ptr);
 
@@ -768,7 +768,7 @@ void teleport_level(MONSTER_IDX m_idx)
                        char m2_name[MAX_NLEN];
 
                        monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
-                       exe_write_diary(p_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_TELE_LEVEL, m2_name);
+                       exe_write_diary(creature_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_TELE_LEVEL, m2_name);
                }
 
                delete_monster_idx(m_idx);
@@ -791,13 +791,13 @@ bool recall_player(player_type *creature_ptr, TIME_EFFECT turns)
         */
 
        /* Ironman option */
-       if (creature_ptr->inside_arena || ironman_downward)
+       if (creature_ptr->current_floor_ptr->inside_arena || ironman_downward)
        {
                msg_print(_("何も起こらなかった。", "Nothing happens."));
                return TRUE;
        }
 
-       if (p_ptr->current_floor_ptr->dun_level && (max_dlv[p_ptr->dungeon_idx] > p_ptr->current_floor_ptr->dun_level) && !creature_ptr->inside_quest && !creature_ptr->word_recall)
+       if (p_ptr->current_floor_ptr->dun_level && (max_dlv[p_ptr->dungeon_idx] > p_ptr->current_floor_ptr->dun_level) && !creature_ptr->current_floor_ptr->inside_quest && !creature_ptr->word_recall)
        {
                if (get_check(_("ここは最深到達階より浅い階です。この階に戻って来ますか? ", "Reset recall depth? ")))
                {
@@ -930,9 +930,9 @@ bool reset_recall(void)
  * @return 劣化処理に関するメッセージが発せられた場合はTRUEを返す /
  * Return "TRUE" if the player notices anything
  */
-bool apply_disenchant(BIT_FLAGS mode)
+bool apply_disenchant(player_type *target_ptr, BIT_FLAGS mode)
 {
-       int             t = 0;
+       int t = 0;
        object_type *o_ptr;
        GAME_TEXT o_name[MAX_NLEN];
        int to_h, to_d, to_a, pval;
@@ -950,7 +950,7 @@ bool apply_disenchant(BIT_FLAGS mode)
                case 8: t = INVEN_FEET; break;
        }
 
-       o_ptr = &p_ptr->inventory_list[t];
+       o_ptr = &target_ptr->inventory_list[t];
 
        /* No item, nothing happens */
        if (!o_ptr->k_idx) return (FALSE);
@@ -1013,12 +1013,12 @@ bool apply_disenchant(BIT_FLAGS mode)
                        ((o_ptr->number != 1) ? "were" : "was"));
 #endif
 
-               chg_virtue(p_ptr, V_HARMONY, 1);
-               chg_virtue(p_ptr, V_ENCHANT, -2);
-               p_ptr->update |= (PU_BONUS);
-               p_ptr->window |= (PW_EQUIP | PW_PLAYER);
+               chg_virtue(target_ptr, V_HARMONY, 1);
+               chg_virtue(target_ptr, V_ENCHANT, -2);
+               target_ptr->update |= (PU_BONUS);
+               target_ptr->window |= (PW_EQUIP | PW_PLAYER);
 
-               calc_android_exp(p_ptr);
+               calc_android_exp(target_ptr);
        }
 
        return (TRUE);
@@ -1028,9 +1028,11 @@ bool apply_disenchant(BIT_FLAGS mode)
 /*!
  * @brief 虚無招来によるフロア中の全壁除去処理 /
  * Vanish all walls in this floor
+ * @params floor_ptr 対象となるフロアの対象ポインタ
+ * @params subject_ptr 現象を主観するクリーチャーの参照ポインタ
  * @return 実際に処理が反映された場合TRUE
  */
-static bool vanish_dungeon(void)
+static bool vanish_dungeon(floor_type *floor_ptr, player_type *subject_ptr)
 {
        POSITION y, x;
        grid_type *g_ptr;
@@ -1039,17 +1041,17 @@ static bool vanish_dungeon(void)
        GAME_TEXT m_name[MAX_NLEN];
 
        /* Prevent vasishing of quest levels and town */
-       if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !p_ptr->current_floor_ptr->dun_level)
+       if ((subject_ptr->current_floor_ptr->inside_quest && is_fixed_quest_idx(subject_ptr->current_floor_ptr->inside_quest)) || !floor_ptr->dun_level)
        {
                return FALSE;
        }
 
        /* Scan all normal grids */
-       for (y = 1; y < p_ptr->current_floor_ptr->height - 1; y++)
+       for (y = 1; y < floor_ptr->height - 1; y++)
        {
-               for (x = 1; x < p_ptr->current_floor_ptr->width - 1; x++)
+               for (x = 1; x < floor_ptr->width - 1; x++)
                {
-                       g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+                       g_ptr = &floor_ptr->grid_array[y][x];
 
                        /* Seeing true feature code (ignore mimic) */
                        f_ptr = &f_info[g_ptr->feat];
@@ -1057,7 +1059,7 @@ static bool vanish_dungeon(void)
                        /* Lose room and vault */
                        g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
 
-                       m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
+                       m_ptr = &floor_ptr->m_list[g_ptr->m_idx];
 
                        /* Awake monster */
                        if (g_ptr->m_idx && MON_CSLEEP(m_ptr))
@@ -1078,9 +1080,9 @@ static bool vanish_dungeon(void)
        }
 
        /* Special boundary walls -- Top and bottom */
-       for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
+       for (x = 0; x < floor_ptr->width; x++)
        {
-               g_ptr = &p_ptr->current_floor_ptr->grid_array[0][x];
+               g_ptr = &floor_ptr->grid_array[0][x];
                f_ptr = &f_info[g_ptr->mimic];
 
                /* Lose room and vault */
@@ -1095,7 +1097,7 @@ static bool vanish_dungeon(void)
                        if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
                }
 
-               g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->current_floor_ptr->height - 1][x];
+               g_ptr = &floor_ptr->grid_array[floor_ptr->height - 1][x];
                f_ptr = &f_info[g_ptr->mimic];
 
                /* Lose room and vault */
@@ -1112,9 +1114,9 @@ static bool vanish_dungeon(void)
        }
 
        /* Special boundary walls -- Left and right */
-       for (y = 1; y < (p_ptr->current_floor_ptr->height - 1); y++)
+       for (y = 1; y < (floor_ptr->height - 1); y++)
        {
-               g_ptr = &p_ptr->current_floor_ptr->grid_array[y][0];
+               g_ptr = &floor_ptr->grid_array[y][0];
                f_ptr = &f_info[g_ptr->mimic];
 
                /* Lose room and vault */
@@ -1129,7 +1131,7 @@ static bool vanish_dungeon(void)
                        if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
                }
 
-               g_ptr = &p_ptr->current_floor_ptr->grid_array[y][p_ptr->current_floor_ptr->width - 1];
+               g_ptr = &floor_ptr->grid_array[y][floor_ptr->width - 1];
                f_ptr = &f_info[g_ptr->mimic];
 
                /* Lose room and vault */
@@ -1146,9 +1148,9 @@ static bool vanish_dungeon(void)
        }
 
        /* Mega-Hack -- Forget the view and lite */
-       p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
-       p_ptr->redraw |= (PR_MAP);
-       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+       subject_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
+       subject_ptr->redraw |= (PR_MAP);
+       subject_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
        return TRUE;
 }
@@ -1156,8 +1158,10 @@ static bool vanish_dungeon(void)
 /*!
  * @brief 虚無招来処理 /
  * @return なし
+ * @details
+ * Sorry, it becomes not (void)...
  */
-void call_the_(void)
+void call_the_void(player_type *caster_ptr)
 {
        int i;
        grid_type *g_ptr;
@@ -1165,7 +1169,7 @@ void call_the_(void)
 
        for (i = 0; i < 9; i++)
        {
-               g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]];
+               g_ptr = &caster_ptr->current_floor_ptr->grid_array[caster_ptr->y + ddy_ddd[i]][caster_ptr->x + ddx_ddd[i]];
 
                if (!cave_have_flag_grid(g_ptr, FF_PROJECT))
                {
@@ -1197,7 +1201,7 @@ void call_the_(void)
        }
 
        /* Prevent destruction of quest levels and town */
-       else if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !p_ptr->current_floor_ptr->dun_level)
+       else if ((caster_ptr->current_floor_ptr->inside_quest && is_fixed_quest_idx(caster_ptr->current_floor_ptr->inside_quest)) || !caster_ptr->current_floor_ptr->dun_level)
        {
                msg_print(_("地面が揺れた。", "The ground trembles."));
        }
@@ -1216,17 +1220,17 @@ void call_the_(void)
 
                if (one_in_(666))
                {
-                       if (!vanish_dungeon()) msg_print(_("ダンジョンは一瞬静まり返った。", "The dungeon silences a moment."));
+                       if (!vanish_dungeon(caster_ptr->current_floor_ptr, caster_ptr)) msg_print(_("ダンジョンは一瞬静まり返った。", "The dungeon silences a moment."));
                }
                else
                {
-                       if (destroy_area(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, 15 + p_ptr->lev + randint0(11), FALSE))
+                       if (destroy_area(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, 15 + caster_ptr->lev + randint0(11), FALSE))
                                msg_print(_("ダンジョンが崩壊した...", "The dungeon collapses..."));
                        else
                                msg_print(_("ダンジョンは大きく揺れた。", "The dungeon trembles."));
                }
 
-               take_hit(p_ptr, DAMAGE_NOESCAPE, 100 + randint1(150), _("自殺的な虚無招来", "a suicidal Call the Void"), -1);
+               take_hit(caster_ptr, DAMAGE_NOESCAPE, 100 + randint1(150), _("自殺的な虚無招来", "a suicidal Call the Void"), -1);
        }
 }
 
@@ -1239,7 +1243,7 @@ void call_the_(void)
  * @param require_los 射線の通りを要求するならばTRUE
  * @return なし
  */
-void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
+void fetch(player_type *caster_ptr, DIRECTION dir, WEIGHT wgt, bool require_los)
 {
        POSITION ty, tx;
        OBJECT_IDX i;
@@ -1248,7 +1252,7 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
        GAME_TEXT o_name[MAX_NLEN];
 
        /* Check to see if an object is already there */
-       if (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx)
+       if (caster_ptr->current_floor_ptr->grid_array[caster_ptr->y][caster_ptr->x].o_idx)
        {
                msg_print(_("自分の足の下にある物は取れません。", "You can't fetch when you're already standing on something."));
                return;
@@ -1260,13 +1264,13 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
                tx = target_col;
                ty = target_row;
 
-               if (distance(p_ptr->y, p_ptr->x, ty, tx) > MAX_RANGE)
+               if (distance(caster_ptr->y, caster_ptr->x, ty, tx) > MAX_RANGE)
                {
                        msg_print(_("そんなに遠くにある物は取れません!", "You can't fetch something that far away!"));
                        return;
                }
 
-               g_ptr = &p_ptr->current_floor_ptr->grid_array[ty][tx];
+               g_ptr = &caster_ptr->current_floor_ptr->grid_array[ty][tx];
 
                /* We need an item to fetch */
                if (!g_ptr->o_idx)
@@ -1285,12 +1289,12 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
                /* We need to see the item */
                if (require_los)
                {
-                       if (!player_has_los_bold(ty, tx))
+                       if (!player_has_los_bold(p_ptr, ty, tx))
                        {
                                msg_print(_("そこはあなたの視界に入っていません。", "You have no direct line of sight to that location."));
                                return;
                        }
-                       else if (!projectable(p_ptr->y, p_ptr->x, ty, tx))
+                       else if (!projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, ty, tx))
                        {
                                msg_print(_("そこは壁の向こうです。", "You have no direct line of sight to that location."));
                                return;
@@ -1299,21 +1303,21 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
        }
        else
        {
-               ty = p_ptr->y; 
-               tx = p_ptr->x;
+               ty = caster_ptr->y; 
+               tx = caster_ptr->x;
                do
                {
                        ty += ddy[dir];
                        tx += ddx[dir];
-                       g_ptr = &p_ptr->current_floor_ptr->grid_array[ty][tx];
+                       g_ptr = &caster_ptr->current_floor_ptr->grid_array[ty][tx];
 
-                       if ((distance(p_ptr->y, p_ptr->x, ty, tx) > MAX_RANGE) ||
+                       if ((distance(caster_ptr->y, caster_ptr->x, ty, tx) > MAX_RANGE) ||
                                !cave_have_flag_bold(ty, tx, FF_PROJECT)) return;
                }
                while (!g_ptr->o_idx);
        }
 
-       o_ptr = &p_ptr->current_floor_ptr->o_list[g_ptr->o_idx];
+       o_ptr = &caster_ptr->current_floor_ptr->o_list[g_ptr->o_idx];
 
        if (o_ptr->weight > wgt)
        {
@@ -1324,17 +1328,17 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
 
        i = g_ptr->o_idx;
        g_ptr->o_idx = o_ptr->next_o_idx;
-       p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */
+       caster_ptr->current_floor_ptr->grid_array[caster_ptr->y][caster_ptr->x].o_idx = i; /* 'move' it */
 
        o_ptr->next_o_idx = 0;
-       o_ptr->iy = p_ptr->y;
-       o_ptr->ix = p_ptr->x;
+       o_ptr->iy = caster_ptr->y;
+       o_ptr->ix = caster_ptr->x;
 
        object_desc(o_name, o_ptr, OD_NAME_ONLY);
        msg_format(_("%^sがあなたの足元に飛んできた。", "%^s flies through the air to your feet."), o_name);
 
-       note_spot(p_ptr->y, p_ptr->x);
-       p_ptr->redraw |= PR_MAP;
+       note_spot(caster_ptr->y, caster_ptr->x);
+       caster_ptr->redraw |= PR_MAP;
 }
 
 /*!
@@ -1344,7 +1348,7 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
 void alter_reality(void)
 {
        /* Ironman option */
-       if (p_ptr->inside_arena || ironman_downward)
+       if (p_ptr->current_floor_ptr->inside_arena || ironman_downward)
        {
                msg_print(_("何も起こらなかった。", "Nothing happens."));
                return;
@@ -1406,14 +1410,14 @@ void identify_pack(void)
  * will not be uncursed.
  * </pre>
  */
-static int remove_curse_aux(int all)
+static int remove_curse_aux(player_type *creature_ptr, int all)
 {
        int i, cnt = 0;
 
        /* Attempt to uncurse items being worn */
        for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
        {
-               object_type *o_ptr = &p_ptr->inventory_list[i];
+               object_type *o_ptr = &creature_ptr->inventory_list[i];
                if (!o_ptr->k_idx) continue;
 
                /* Uncursed already */
@@ -1433,8 +1437,8 @@ static int remove_curse_aux(int all)
                o_ptr->ident |= (IDENT_SENSE);
                o_ptr->feeling = FEEL_NONE;
 
-               p_ptr->update |= (PU_BONUS);
-               p_ptr->window |= (PW_EQUIP);
+               creature_ptr->update |= (PU_BONUS);
+               creature_ptr->window |= (PW_EQUIP);
 
                /* Count the uncursings */
                cnt++;
@@ -1454,9 +1458,9 @@ static int remove_curse_aux(int all)
  * Remove most curses
  * @return 解呪に成功した装備数
  */
-int remove_curse(void)
+int remove_curse(player_type *caster_ptr)
 {
-       return (remove_curse_aux(FALSE));
+       return (remove_curse_aux(caster_ptr, FALSE));
 }
 
 /*!
@@ -1464,9 +1468,9 @@ int remove_curse(void)
  * Remove all curses
  * @return 解呪に成功した装備数
  */
-int remove_all_curse(void)
+int remove_all_curse(player_type *caster_ptr)
 {
-       return (remove_curse_aux(TRUE));
+       return (remove_curse_aux(caster_ptr, TRUE));
 }
 
 
@@ -2424,12 +2428,12 @@ void display_spell_list(player_type *caster_ptr)
  * @param use_realm 魔法領域
  * @return 経験値
  */
-EXP experience_of_spell(SPELL_IDX spell, REALM_IDX use_realm)
+EXP experience_of_spell(player_type *caster_ptr, SPELL_IDX spell, REALM_IDX use_realm)
 {
-       if (p_ptr->pclass == CLASS_SORCERER) return SPELL_EXP_MASTER;
-       else if (p_ptr->pclass == CLASS_RED_MAGE) return SPELL_EXP_SKILLED;
-       else if (use_realm == p_ptr->realm1) return p_ptr->spell_exp[spell];
-       else if (use_realm == p_ptr->realm2) return p_ptr->spell_exp[spell + 32];
+       if (caster_ptr->pclass == CLASS_SORCERER) return SPELL_EXP_MASTER;
+       else if (caster_ptr->pclass == CLASS_RED_MAGE) return SPELL_EXP_SKILLED;
+       else if (use_realm == caster_ptr->realm1) return caster_ptr->spell_exp[spell];
+       else if (use_realm == caster_ptr->realm2) return caster_ptr->spell_exp[spell + 32];
        else return 0;
 }
 
@@ -2455,7 +2459,7 @@ MANA_POINT mod_need_mana(MANA_POINT need_mana, SPELL_IDX spell, REALM_IDX realm)
                 * need_mana defaults if spell exp equals SPELL_EXP_EXPERT and !p_ptr->dec_mana.
                 * MANA_CONST is used to calculate need_mana effected from spell proficiency.
                 */
-               need_mana = need_mana * (MANA_CONST + SPELL_EXP_EXPERT - experience_of_spell(spell, realm)) + (MANA_CONST - 1);
+               need_mana = need_mana * (MANA_CONST + SPELL_EXP_EXPERT - experience_of_spell(p_ptr, spell, realm)) + (MANA_CONST - 1);
                need_mana *= p_ptr->dec_mana ? DEC_MANA_DIV : MANA_DIV;
                need_mana /= MANA_CONST * MANA_DIV;
                if (need_mana < 1) need_mana = 1;
@@ -2483,15 +2487,15 @@ MANA_POINT mod_need_mana(MANA_POINT need_mana, SPELL_IDX spell, REALM_IDX realm)
  * @return 失敗率(%)
  * @todo 統合を検討
  */
-PERCENTAGE mod_spell_chance_1(PERCENTAGE chance)
+PERCENTAGE mod_spell_chance_1(player_type *caster_ptr, PERCENTAGE chance)
 {
-       chance += p_ptr->to_m_chance;
+       chance += caster_ptr->to_m_chance;
 
-       if (p_ptr->heavy_spell) chance += 20;
+       if (caster_ptr->heavy_spell) chance += 20;
 
-       if (p_ptr->dec_mana && p_ptr->easy_spell) chance -= 4;
-       else if (p_ptr->easy_spell) chance -= 3;
-       else if (p_ptr->dec_mana) chance -= 2;
+       if (caster_ptr->dec_mana && caster_ptr->easy_spell) chance -= 4;
+       else if (caster_ptr->easy_spell) chance -= 3;
+       else if (caster_ptr->dec_mana) chance -= 2;
 
        return chance;
 }
@@ -2508,12 +2512,10 @@ PERCENTAGE mod_spell_chance_1(PERCENTAGE chance)
  * Note: variable "chance" cannot be negative.
  * @todo 統合を検討
  */
-PERCENTAGE mod_spell_chance_2(PERCENTAGE chance)
+PERCENTAGE mod_spell_chance_2(player_type *caster_ptr, PERCENTAGE chance)
 {
-       if (p_ptr->dec_mana) chance--;
-
-       if (p_ptr->heavy_spell) chance += 5;
-
+       if (caster_ptr->dec_mana) chance--;
+       if (caster_ptr->heavy_spell) chance += 5;
        return MAX(chance, 0);
 }
 
@@ -2525,7 +2527,7 @@ PERCENTAGE mod_spell_chance_2(PERCENTAGE chance)
  * @param use_realm 魔法領域ID
  * @return 失敗率(%)
  */
-PERCENTAGE spell_chance(SPELL_IDX spell, REALM_IDX use_realm)
+PERCENTAGE spell_chance(player_type *caster_ptr, SPELL_IDX spell, REALM_IDX use_realm)
 {
        PERCENTAGE chance, minfail;
        const magic_type *s_ptr;
@@ -2552,27 +2554,27 @@ PERCENTAGE spell_chance(SPELL_IDX spell, REALM_IDX use_realm)
        chance = s_ptr->sfail;
 
        /* Reduce failure rate by "effective" level adjustment */
-       chance -= 3 * (p_ptr->lev - s_ptr->slevel);
+       chance -= 3 * (caster_ptr->lev - s_ptr->slevel);
 
        /* Reduce failure rate by INT/WIS adjustment */
-       chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
+       chance -= 3 * (adj_mag_stat[caster_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
 
-       if (p_ptr->riding)
-               chance += (MAX(r_info[p_ptr->current_floor_ptr->m_list[p_ptr->riding].r_idx].level - p_ptr->skill_exp[GINOU_RIDING] / 100 - 10, 0));
+       if (caster_ptr->riding)
+               chance += (MAX(r_info[caster_ptr->current_floor_ptr->m_list[caster_ptr->riding].r_idx].level - caster_ptr->skill_exp[GINOU_RIDING] / 100 - 10, 0));
 
        /* Extract mana consumption rate */
        need_mana = mod_need_mana(s_ptr->smana, spell, use_realm);
 
        /* Not enough mana to cast */
-       if (need_mana > p_ptr->csp)
+       if (need_mana > caster_ptr->csp)
        {
-               chance += 5 * (need_mana - p_ptr->csp);
+               chance += 5 * (need_mana - caster_ptr->csp);
        }
 
-       if ((use_realm != p_ptr->realm1) && ((p_ptr->pclass == CLASS_MAGE) || (p_ptr->pclass == CLASS_PRIEST))) chance += 5;
+       if ((use_realm != caster_ptr->realm1) && ((caster_ptr->pclass == CLASS_MAGE) || (caster_ptr->pclass == CLASS_PRIEST))) chance += 5;
 
        /* Extract the minimum failure rate */
-       minfail = adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]];
+       minfail = adj_mag_fail[caster_ptr->stat_ind[mp_ptr->spell_stat]];
 
        /*
         * Non mage/priest characters never get too good
@@ -2584,22 +2586,22 @@ PERCENTAGE spell_chance(SPELL_IDX spell, REALM_IDX use_realm)
        }
 
        /* Hack -- Priest prayer penalty for "edged" weapons  -DGK */
-       if (((p_ptr->pclass == CLASS_PRIEST) || (p_ptr->pclass == CLASS_SORCERER)) && p_ptr->icky_wield[0]) chance += 25;
-       if (((p_ptr->pclass == CLASS_PRIEST) || (p_ptr->pclass == CLASS_SORCERER)) && p_ptr->icky_wield[1]) chance += 25;
+       if (((caster_ptr->pclass == CLASS_PRIEST) || (caster_ptr->pclass == CLASS_SORCERER)) && caster_ptr->icky_wield[0]) chance += 25;
+       if (((caster_ptr->pclass == CLASS_PRIEST) || (caster_ptr->pclass == CLASS_SORCERER)) && caster_ptr->icky_wield[1]) chance += 25;
 
-       chance = mod_spell_chance_1(chance);
+       chance = mod_spell_chance_1(caster_ptr, chance);
 
        /* Goodness or evilness gives a penalty to failure rate */
        switch (use_realm)
        {
        case REALM_NATURE:
-               if ((p_ptr->align > 50) || (p_ptr->align < -50)) chance += penalty;
+               if ((caster_ptr->align > 50) || (caster_ptr->align < -50)) chance += penalty;
                break;
        case REALM_LIFE: case REALM_CRUSADE:
-               if (p_ptr->align < -20) chance += penalty;
+               if (caster_ptr->align < -20) chance += penalty;
                break;
        case REALM_DEATH: case REALM_DAEMON: case REALM_HEX:
-               if (p_ptr->align > 20) chance += penalty;
+               if (caster_ptr->align > 20) chance += penalty;
                break;
        }
 
@@ -2607,22 +2609,22 @@ PERCENTAGE spell_chance(SPELL_IDX spell, REALM_IDX use_realm)
        if (chance < minfail) chance = minfail;
 
        /* Stunning makes spells harder */
-       if (p_ptr->stun > 50) chance += 25;
-       else if (p_ptr->stun) chance += 15;
+       if (caster_ptr->stun > 50) chance += 25;
+       else if (caster_ptr->stun) chance += 15;
 
        /* Always a 5 percent chance of working */
        if (chance > 95) chance = 95;
 
-       if ((use_realm == p_ptr->realm1) || (use_realm == p_ptr->realm2)
-           || (p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
+       if ((use_realm == caster_ptr->realm1) || (use_realm == caster_ptr->realm2)
+           || (caster_ptr->pclass == CLASS_SORCERER) || (caster_ptr->pclass == CLASS_RED_MAGE))
        {
-               EXP exp = experience_of_spell(spell, use_realm);
+               EXP exp = experience_of_spell(caster_ptr, spell, use_realm);
                if (exp >= SPELL_EXP_EXPERT) chance--;
                if (exp >= SPELL_EXP_MASTER) chance--;
        }
 
        /* Return the chance */
-       return mod_spell_chance_2(chance);
+       return mod_spell_chance_2(caster_ptr, chance);
 }
 
 
@@ -2631,6 +2633,7 @@ PERCENTAGE spell_chance(SPELL_IDX spell, REALM_IDX use_realm)
  * @brief 呪文情報の表示処理 /
  * Print a list of spells (for browsing or casting or viewing)
  * @param target_spell 呪文ID                    
+ * @param caster_ptr 術者の参照ポインタ
  * @param spells 表示するスペルID配列の参照ポインタ
  * @param num 表示するスペルの数(spellsの要素数)
  * @param y 表示メッセージ左上Y座標
@@ -2638,7 +2641,7 @@ PERCENTAGE spell_chance(SPELL_IDX spell, REALM_IDX use_realm)
  * @param use_realm 魔法領域ID
  * @return なし
  */
-void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y, TERM_LEN x, REALM_IDX use_realm)
+void print_spells(player_type* caster_ptr, SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y, TERM_LEN x, REALM_IDX use_realm)
 {
        int i;
        SPELL_IDX spell;
@@ -2666,9 +2669,9 @@ void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y
        put_str(_("名前", "Name"), y, x + 5);
        put_str(buf, y, x + 29);
 
-       if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE)) increment = 0;
-       else if (use_realm == p_ptr->realm1) increment = 0;
-       else if (use_realm == p_ptr->realm2) increment = 32;
+       if ((caster_ptr->pclass == CLASS_SORCERER) || (caster_ptr->pclass == CLASS_RED_MAGE)) increment = 0;
+       else if (use_realm == caster_ptr->realm1) increment = 0;
+       else if (use_realm == caster_ptr->realm2) increment = 32;
 
        /* Dump the spells */
        for (i = 0; i < num; i++)
@@ -2688,7 +2691,7 @@ void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y
                        need_mana = s_ptr->smana;
                else
                {
-                       EXP exp = experience_of_spell(spell, use_realm);
+                       EXP exp = experience_of_spell(caster_ptr, spell, use_realm);
 
                        /* Extract mana consumption rate */
                        need_mana = mod_need_mana(s_ptr->smana, spell, use_realm);
@@ -2700,7 +2703,7 @@ void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y
                        if (!increment && (exp_level == EXP_LEVEL_MASTER)) max = TRUE;
                        else if ((increment == 32) && (exp_level >= EXP_LEVEL_EXPERT)) max = TRUE;
                        else if (s_ptr->slevel >= 99) max = TRUE;
-                       else if ((p_ptr->pclass == CLASS_RED_MAGE) && (exp_level >= EXP_LEVEL_SKILLED)) max = TRUE;
+                       else if ((caster_ptr->pclass == CLASS_RED_MAGE) && (exp_level >= EXP_LEVEL_SKILLED)) max = TRUE;
 
                        strncpy(ryakuji, exp_level_str[exp_level], 4);
                        ryakuji[3] = ']';
@@ -2726,7 +2729,7 @@ void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y
                /* XXX XXX Could label spells above the players level */
 
                /* Get extra info */
-               strcpy(info, exe_spell(p_ptr, use_realm, spell, SPELL_INFO));
+               strcpy(info, exe_spell(caster_ptr, use_realm, spell, SPELL_INFO));
 
                /* Use that info */
                comment = info;
@@ -2735,41 +2738,41 @@ void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y
                line_attr = TERM_WHITE;
 
                /* Analyze the spell */
-               if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
+               if ((caster_ptr->pclass == CLASS_SORCERER) || (caster_ptr->pclass == CLASS_RED_MAGE))
                {
-                       if (s_ptr->slevel > p_ptr->max_plv)
+                       if (s_ptr->slevel > caster_ptr->max_plv)
                        {
                                comment = _("未知", "unknown");
                                line_attr = TERM_L_BLUE;
                        }
-                       else if (s_ptr->slevel > p_ptr->lev)
+                       else if (s_ptr->slevel > caster_ptr->lev)
                        {
                                comment = _("忘却", "forgotten");
                                line_attr = TERM_YELLOW;
                        }
                }
-               else if ((use_realm != p_ptr->realm1) && (use_realm != p_ptr->realm2))
+               else if ((use_realm != caster_ptr->realm1) && (use_realm != caster_ptr->realm2))
                {
                        comment = _("未知", "unknown");
                        line_attr = TERM_L_BLUE;
                }
-               else if ((use_realm == p_ptr->realm1) ?
-                   ((p_ptr->spell_forgotten1 & (1L << spell))) :
-                   ((p_ptr->spell_forgotten2 & (1L << spell))))
+               else if ((use_realm == caster_ptr->realm1) ?
+                   ((caster_ptr->spell_forgotten1 & (1L << spell))) :
+                   ((caster_ptr->spell_forgotten2 & (1L << spell))))
                {
                        comment = _("忘却", "forgotten");
                        line_attr = TERM_YELLOW;
                }
-               else if (!((use_realm == p_ptr->realm1) ?
-                   (p_ptr->spell_learned1 & (1L << spell)) :
-                   (p_ptr->spell_learned2 & (1L << spell))))
+               else if (!((use_realm == caster_ptr->realm1) ?
+                   (caster_ptr->spell_learned1 & (1L << spell)) :
+                   (caster_ptr->spell_learned2 & (1L << spell))))
                {
                        comment = _("未知", "unknown");
                        line_attr = TERM_L_BLUE;
                }
-               else if (!((use_realm == p_ptr->realm1) ?
-                   (p_ptr->spell_worked1 & (1L << spell)) :
-                   (p_ptr->spell_worked2 & (1L << spell))))
+               else if (!((use_realm == caster_ptr->realm1) ?
+                   (caster_ptr->spell_worked1 & (1L << spell)) :
+                   (caster_ptr->spell_worked2 & (1L << spell))))
                {
                        comment = _("未経験", "untried");
                        line_attr = TERM_L_GREEN;
@@ -2779,15 +2782,15 @@ void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y
                if (use_realm == REALM_HISSATSU)
                {
                        strcat(out_val, format("%-25s %2d %4d",
-                           exe_spell(p_ptr, use_realm, spell, SPELL_NAME), /* realm, spell */
+                           exe_spell(caster_ptr, use_realm, spell, SPELL_NAME), /* realm, spell */
                            s_ptr->slevel, need_mana));
                }
                else
                {
                        strcat(out_val, format("%-25s%c%-4s %2d %4d %3d%% %s",
-                           exe_spell(p_ptr, use_realm, spell, SPELL_NAME), /* realm, spell */
+                           exe_spell(caster_ptr, use_realm, spell, SPELL_NAME), /* realm, spell */
                            (max ? '!' : ' '), ryakuji,
-                           s_ptr->slevel, need_mana, spell_chance(spell, use_realm), comment));
+                           s_ptr->slevel, need_mana, spell_chance(caster_ptr, spell, use_realm), comment));
                }
                c_prt(line_attr, out_val, y + i + 1, x);
        }
@@ -2852,20 +2855,20 @@ static MONRACE_IDX poly_r_idx(MONRACE_IDX r_idx)
  * @param x 指定のX座標
  * @return 実際に変身したらTRUEを返す
  */
-bool polymorph_monster(POSITION y, POSITION x)
+bool polymorph_monster(player_type *caster_ptr, POSITION y, POSITION x)
 {
-       grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
-       monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
+       grid_type *g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
+       monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
        bool polymorphed = FALSE;
        MONRACE_IDX new_r_idx;
        MONRACE_IDX old_r_idx = m_ptr->r_idx;
        bool targeted = (target_who == g_ptr->m_idx) ? TRUE : FALSE;
-       bool health_tracked = (p_ptr->health_who == g_ptr->m_idx) ? TRUE : FALSE;
+       bool health_tracked = (caster_ptr->health_who == g_ptr->m_idx) ? TRUE : FALSE;
        monster_type back_m;
 
-       if (p_ptr->inside_arena || p_ptr->phase_out) return (FALSE);
+       if (caster_ptr->current_floor_ptr->inside_arena || caster_ptr->phase_out) return (FALSE);
 
-       if ((p_ptr->riding == g_ptr->m_idx) || (m_ptr->mflag2 & MFLAG2_KAGE)) return (FALSE);
+       if ((caster_ptr->riding == g_ptr->m_idx) || (m_ptr->mflag2 & MFLAG2_KAGE)) return (FALSE);
 
        /* Memorize the monster before polymorphing */
        back_m = *m_ptr;
@@ -2894,9 +2897,9 @@ bool polymorph_monster(POSITION y, POSITION x)
                /* Create a new monster (no groups) */
                if (place_monster_aux(0, y, x, new_r_idx, mode))
                {
-                       p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].nickname = back_m.nickname;
-                       p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].parent_m_idx = back_m.parent_m_idx;
-                       p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].hold_o_idx = back_m.hold_o_idx;
+                       caster_ptr->current_floor_ptr->m_list[hack_m_idx_ii].nickname = back_m.nickname;
+                       caster_ptr->current_floor_ptr->m_list[hack_m_idx_ii].parent_m_idx = back_m.parent_m_idx;
+                       caster_ptr->current_floor_ptr->m_list[hack_m_idx_ii].hold_o_idx = back_m.hold_o_idx;
 
                        /* Success */
                        polymorphed = TRUE;
@@ -2906,7 +2909,7 @@ bool polymorph_monster(POSITION y, POSITION x)
                        /* Placing the new monster failed */
                        if (place_monster_aux(0, y, x, old_r_idx, (mode | PM_NO_KAGE | PM_IGNORE_TERRAIN)))
                        {
-                               p_ptr->current_floor_ptr->m_list[hack_m_idx_ii] = back_m;
+                               caster_ptr->current_floor_ptr->m_list[hack_m_idx_ii] = back_m;
 
                                /* Re-initialize monster process */
                                mproc_init();
@@ -2919,7 +2922,7 @@ bool polymorph_monster(POSITION y, POSITION x)
                {
                        for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
                        {
-                               object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
+                               object_type *o_ptr = &caster_ptr->current_floor_ptr->o_list[this_o_idx];
                                next_o_idx = o_ptr->next_o_idx;
 
                                /* Held by new monster */
@@ -2930,7 +2933,7 @@ bool polymorph_monster(POSITION y, POSITION x)
                {
                        for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
                        {
-                               next_o_idx = p_ptr->current_floor_ptr->o_list[this_o_idx].next_o_idx;
+                               next_o_idx = caster_ptr->current_floor_ptr->o_list[this_o_idx].next_o_idx;
                                delete_object_idx(this_o_idx);
                        }
                }
@@ -2960,14 +2963,14 @@ static bool dimension_door_aux(DEPTH x, DEPTH y)
            (!randint0(plev / 10 + 10)))
        {
                p_ptr->energy_need += (s16b)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
-               teleport_player((plev + 2) * 2, TELEPORT_PASSIVE);
+               teleport_player(p_ptr, (plev + 2) * 2, TELEPORT_PASSIVE);
 
                /* Failed */
                return FALSE;
        }
        else
        {
-               teleport_player_to(y, x, 0L);
+               teleport_player_to(p_ptr, y, x, 0L);
 
                /* Success */
                return TRUE;
@@ -3019,7 +3022,7 @@ bool mirror_tunnel(void)
  * @param power 基本効力
  * @return ターンを消費した場合TRUEを返す
  */
-bool eat_magic(int power)
+bool eat_magic(player_type *caster_ptr, int power)
 {
        object_type *o_ptr;
        object_kind *k_ptr;
@@ -3038,7 +3041,7 @@ bool eat_magic(int power)
        q = _("どのアイテムから魔力を吸収しますか?", "Drain which item? ");
        s = _("魔力を吸収できるアイテムがありません。", "You have nothing to drain.");
 
-       o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+       o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
        if (!o_ptr) return FALSE;
 
        k_ptr = &k_info[o_ptr->k_idx];
@@ -3062,7 +3065,7 @@ bool eat_magic(int power)
                        }
                        else
                        {
-                               p_ptr->csp += lev;
+                               caster_ptr->csp += lev;
                                o_ptr->timeout += k_ptr->pval;
                        }
                }
@@ -3083,7 +3086,7 @@ bool eat_magic(int power)
                {
                        if (o_ptr->pval > 0)
                        {
-                               p_ptr->csp += lev / 2;
+                               caster_ptr->csp += lev / 2;
                                o_ptr->pval --;
 
                                /* XXX Hack -- unstack if necessary */
@@ -3102,7 +3105,7 @@ bool eat_magic(int power)
 
                                        /* Unstack the used item */
                                        o_ptr->number--;
-                                       p_ptr->total_weight -= q_ptr->weight;
+                                       caster_ptr->total_weight -= q_ptr->weight;
                                        item = inven_carry(q_ptr);
 
                                        msg_print(_("杖をまとめなおした。", "You unstack your staff."));
@@ -3141,7 +3144,7 @@ bool eat_magic(int power)
                        /*** Determine Seriousness of Failure ***/
 
                        /* Mages recharge objects more safely. */
-                       if (IS_WIZARD_CLASS(p_ptr))
+                       if (IS_WIZARD_CLASS(caster_ptr))
                        {
                                /* 10% chance to blow up one rod, otherwise draining. */
                                if (o_ptr->tval == TV_ROD)
@@ -3219,7 +3222,7 @@ bool eat_magic(int power)
                                        msg_format(_("乱暴な魔法のために%sが何本か壊れた!", "Wild magic consumes your %s!"), o_name);
                                }
                                
-                               /* Reduce and describe p_ptr->inventory_list */
+                               /* Reduce and describe caster_ptr->inventory_list */
                                if (item >= 0)
                                {
                                        inven_item_increase(item, -1);
@@ -3244,7 +3247,7 @@ bool eat_magic(int power)
                                else
                                        msg_format(_("乱暴な魔法のために%sが壊れた!", "Wild magic consumes your %s!"), o_name);
 
-                               /* Reduce and describe p_ptr->inventory_list */
+                               /* Reduce and describe caster_ptr->inventory_list */
                                if (item >= 0)
                                {
                                        inven_item_increase(item, -999);
@@ -3263,14 +3266,14 @@ bool eat_magic(int power)
                }
        }
 
-       if (p_ptr->csp > p_ptr->msp)
+       if (caster_ptr->csp > caster_ptr->msp)
        {
-               p_ptr->csp = p_ptr->msp;
+               caster_ptr->csp = caster_ptr->msp;
        }
 
-       p_ptr->redraw |= (PR_MANA);
-       p_ptr->update |= (PU_COMBINE | PU_REORDER);
-       p_ptr->window |= (PW_INVEN);
+       caster_ptr->redraw |= (PR_MANA);
+       caster_ptr->update |= (PU_COMBINE | PU_REORDER);
+       caster_ptr->window |= (PW_INVEN);
 
        return TRUE;
 }
@@ -3282,7 +3285,7 @@ bool eat_magic(int power)
  * @param px プレイヤーX座標
  * @return なし
  */
-void massacre(void)
+void massacre(player_type *caster_ptr)
 {
        POSITION x, y;
        grid_type *g_ptr;
@@ -3291,18 +3294,18 @@ void massacre(void)
 
        for (dir = 0; dir < 8; dir++)
        {
-               y = p_ptr->y + ddy_ddd[dir];
-               x = p_ptr->x + ddx_ddd[dir];
-               g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
-               m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
+               y = caster_ptr->y + ddy_ddd[dir];
+               x = caster_ptr->x + ddx_ddd[dir];
+               g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
+               m_ptr = &caster_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
 
                /* Hack -- attack monsters */
                if (g_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
-                       py_attack(p_ptr, y, x, 0);
+                       py_attack(caster_ptr, y, x, 0);
        }
 }
 
-bool eat_lock(void)
+bool eat_lock(player_type *caster_ptr)
 {
        POSITION x, y;
        grid_type *g_ptr;
@@ -3310,9 +3313,9 @@ bool eat_lock(void)
        DIRECTION dir;
 
        if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
-       y = p_ptr->y + ddy[dir];
-       x = p_ptr->x + ddx[dir];
-       g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+       y = caster_ptr->y + ddy[dir];
+       x = caster_ptr->x + ddx[dir];
+       g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
        f_ptr = &f_info[g_ptr->feat];
        mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)];
 
@@ -3328,10 +3331,10 @@ bool eat_lock(void)
        }
        else if (g_ptr->m_idx)
        {
-               monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
+               monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
                msg_print(_("何かが邪魔しています!", "There's something in the way!"));
 
-               if (!m_ptr->ml || !is_pet(m_ptr)) py_attack(p_ptr, y, x, 0);
+               if (!m_ptr->ml || !is_pet(m_ptr)) py_attack(caster_ptr, y, x, 0);
        }
        else if (have_flag(f_ptr->flags, FF_TREE))
        {
@@ -3343,49 +3346,49 @@ bool eat_lock(void)
        }
        else if (have_flag(f_ptr->flags, FF_DOOR) || have_flag(f_ptr->flags, FF_CAN_DIG))
        {
-               (void)set_food(p_ptr, p_ptr->food + 3000);
+               (void)set_food(caster_ptr, caster_ptr->food + 3000);
        }
        else if (have_flag(f_ptr->flags, FF_MAY_HAVE_GOLD) || have_flag(f_ptr->flags, FF_HAS_GOLD))
        {
-               (void)set_food(p_ptr, p_ptr->food + 5000);
+               (void)set_food(caster_ptr, caster_ptr->food + 5000);
        }
        else
        {
                msg_format(_("この%sはとてもおいしい!", "This %s is very filling!"), f_name + mimic_f_ptr->name);
-               (void)set_food(p_ptr, p_ptr->food + 10000);
+               (void)set_food(caster_ptr, caster_ptr->food + 10000);
        }
 
        /* Destroy the wall */
        cave_alter_feat(y, x, FF_HURT_ROCK);
 
-       (void)move_player_effect(p_ptr, y, x, MPE_DONT_PICKUP);
+       (void)move_player_effect(caster_ptr, y, x, MPE_DONT_PICKUP);
        return TRUE;
 }
 
 
-bool shock_power(void)
+bool shock_power(player_type *caster_ptr)
 {
        DIRECTION dir;
        POSITION y, x;
        HIT_POINT dam;
-       PLAYER_LEVEL plev = p_ptr->lev;
+       PLAYER_LEVEL plev = caster_ptr->lev;
        int boost = P_PTR_KI;
-       if (heavy_armor(p_ptr)) boost /= 2;
+       if (heavy_armor(caster_ptr)) boost /= 2;
 
        project_length = 1;
        if (!get_aim_dir(&dir)) return FALSE;
 
-       y = p_ptr->y + ddy[dir];
-       x = p_ptr->x + ddx[dir];
+       y = caster_ptr->y + ddy[dir];
+       x = caster_ptr->x + ddx[dir];
        dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
        fire_beam(GF_MISSILE, dir, dam);
-       if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
+       if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
        {
                int i;
                POSITION ty = y, tx = x;
                POSITION oy = y, ox = x;
-               MONSTER_IDX m_idx = p_ptr->current_floor_ptr->grid_array[y][x].m_idx;
-               monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+               MONSTER_IDX m_idx = caster_ptr->current_floor_ptr->grid_array[y][x].m_idx;
+               monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
                GAME_TEXT m_name[MAX_NLEN];
 
@@ -3401,7 +3404,7 @@ bool shock_power(void)
                        {
                                y += ddy[dir];
                                x += ddx[dir];
-                               if (cave_empty_bold(y, x))
+                               if (cave_empty_bold(caster_ptr->current_floor_ptr, y, x))
                                {
                                        ty = y;
                                        tx = x;
@@ -3411,17 +3414,17 @@ bool shock_power(void)
                        if ((ty != oy) || (tx != ox))
                        {
                                msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name);
-                               p_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
-                               p_ptr->current_floor_ptr->grid_array[ty][tx].m_idx = m_idx;
+                               caster_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
+                               caster_ptr->current_floor_ptr->grid_array[ty][tx].m_idx = m_idx;
                                m_ptr->fy = ty;
                                m_ptr->fx = tx;
 
-                               update_monster(m_idx, TRUE);
+                               update_monster(caster_ptr, m_idx, TRUE);
                                lite_spot(oy, ox);
                                lite_spot(ty, tx);
 
                                if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
-                                       p_ptr->update |= (PU_MON_LITE);
+                                       caster_ptr->update |= (PU_MON_LITE);
                        }
                }
        }
@@ -3454,9 +3457,9 @@ bool booze(player_type *creature_ptr)
                {
                        ident = TRUE;
                        if (one_in_(3)) lose_all_info(p_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!"));
                }
@@ -3473,10 +3476,10 @@ bool detonation(player_type *creature_ptr)
        return TRUE;
 }
 
-void blood_curse_to_enemy(MONSTER_IDX m_idx)
+void blood_curse_to_enemy(player_type *caster_ptr, MONSTER_IDX m_idx)
 {
-       monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
-       grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx];
+       monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
+       grid_type *g_ptr = &caster_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx];
        BIT_FLAGS curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
        int count = 0;
        do
@@ -3487,7 +3490,7 @@ void blood_curse_to_enemy(MONSTER_IDX m_idx)
                        if (!count)
                        {
                                msg_print(_("地面が揺れた...", "The ground trembles..."));
-                               earthquake(m_ptr->fy, m_ptr->fx, 4 + randint0(4), 0);
+                               earthquake(caster_ptr, m_ptr->fy, m_ptr->fx, 4 + randint0(4), 0);
                                if (!one_in_(6)) break;
                        }
                case 3: case 4: case 5: case 6:
@@ -3504,7 +3507,7 @@ void blood_curse_to_enemy(MONSTER_IDX m_idx)
                        {
                                msg_print(_("空間が歪んだ!", "Space warps about you!"));
 
-                               if (m_ptr->r_idx) teleport_away(g_ptr->m_idx, damroll(10, 10), TELEPORT_PASSIVE);
+                               if (m_ptr->r_idx) teleport_away(caster_ptr, g_ptr->m_idx, damroll(10, 10), TELEPORT_PASSIVE);
                                if (one_in_(13)) count += activate_hi_summon(m_ptr->fy, m_ptr->fx, TRUE);
                                if (!one_in_(6)) break;
                        }
@@ -3526,15 +3529,15 @@ void blood_curse_to_enemy(MONSTER_IDX m_idx)
                        if (pet) mode |= PM_FORCE_PET;
                        else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
 
-                       count += summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : p_ptr->current_floor_ptr->dun_level), 0, mode);
+                       count += summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, (pet ? caster_ptr->lev * 2 / 3 + randint1(caster_ptr->lev / 2) : caster_ptr->current_floor_ptr->dun_level), 0, mode);
                        if (!one_in_(6)) break;
                }
                case 23: case 24: case 25:
-                       if (p_ptr->hold_exp && (randint0(100) < 75)) break;
+                       if (caster_ptr->hold_exp && (randint0(100) < 75)) break;
                        msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
 
-                       if (p_ptr->hold_exp) lose_exp(p_ptr, p_ptr->exp / 160);
-                       else lose_exp(p_ptr, p_ptr->exp / 16);
+                       if (caster_ptr->hold_exp) lose_exp(caster_ptr, caster_ptr->exp / 160);
+                       else lose_exp(caster_ptr, caster_ptr->exp / 16);
                        if (!one_in_(6)) break;
                case 26: case 27: case 28:
                {
@@ -3545,7 +3548,7 @@ void blood_curse_to_enemy(MONSTER_IDX m_idx)
                                {
                                        do
                                        {
-                                               (void)do_dec_stat(p_ptr, i);
+                                               (void)do_dec_stat(caster_ptr, i);
                                        } while (one_in_(2));
 
                                        i++;
@@ -3553,7 +3556,7 @@ void blood_curse_to_enemy(MONSTER_IDX m_idx)
                        }
                        else
                        {
-                               (void)do_dec_stat(p_ptr, randint0(6));
+                               (void)do_dec_stat(caster_ptr, randint0(6));
                        }
                        break;
                }
@@ -3613,19 +3616,19 @@ bool fire_crimson(player_type *shooter_ptr)
  * @brief 町間のテレポートを行うメインルーチン。
  * @return テレポート処理を決定したか否か
  */
-bool tele_town(void)
+bool tele_town(player_type *caster_ptr)
 {
        int i;
        POSITION x, y;
        int num = 0;
 
-       if (p_ptr->current_floor_ptr->dun_level)
+       if (caster_ptr->current_floor_ptr->dun_level)
        {
                msg_print(_("この魔法は地上でしか使えない!", "This spell can only be used on the surface!"));
                return FALSE;
        }
 
-       if (p_ptr->inside_arena || p_ptr->phase_out)
+       if (caster_ptr->current_floor_ptr->inside_arena || caster_ptr->phase_out)
        {
                msg_print(_("この魔法は外でしか使えない!", "This spell can only be used outside!"));
                return FALSE;
@@ -3638,7 +3641,7 @@ bool tele_town(void)
        {
                char buf[80];
 
-               if ((i == NO_TOWN) || (i == SECRET_TOWN) || (i == p_ptr->town_num) || !(p_ptr->visit & (1L << (i - 1)))) continue;
+               if ((i == NO_TOWN) || (i == SECRET_TOWN) || (i == caster_ptr->town_num) || !(caster_ptr->visit & (1L << (i - 1)))) continue;
 
                sprintf(buf, "%c) %-20s", I2A(i - 1), town_info[i].name);
                prt(buf, 5 + i, 5);
@@ -3664,7 +3667,7 @@ bool tele_town(void)
                        return FALSE;
                }
                else if ((i < 'a') || (i > ('a' + max_towns - 2))) continue;
-               else if (((i - 'a' + 1) == p_ptr->town_num) || ((i - 'a' + 1) == NO_TOWN) || ((i - 'a' + 1) == SECRET_TOWN) || !(p_ptr->visit & (1L << (i - 'a')))) continue;
+               else if (((i - 'a' + 1) == caster_ptr->town_num) || ((i - 'a' + 1) == NO_TOWN) || ((i - 'a' + 1) == SECRET_TOWN) || !(caster_ptr->visit & (1L << (i - 'a')))) continue;
                break;
        }
 
@@ -3674,15 +3677,15 @@ bool tele_town(void)
                {
                        if (wilderness[y][x].town == (i - 'a' + 1))
                        {
-                               p_ptr->wilderness_y = y;
-                               p_ptr->wilderness_x = x;
+                               caster_ptr->wilderness_y = y;
+                               caster_ptr->wilderness_x = x;
                        }
                }
        }
 
-       p_ptr->leaving = TRUE;
-       p_ptr->leave_bldg = TRUE;
-       p_ptr->teleport_town = TRUE;
+       caster_ptr->leaving = TRUE;
+       caster_ptr->leave_bldg = TRUE;
+       caster_ptr->teleport_town = TRUE;
        screen_load();
        return TRUE;
 }