OSDN Git Service

[Fix] #39587 misc_english_usage_patch.txt に従い英文校正 / Proofreading English in complianc...
[hengband/hengband.git] / src / cmd / cmd-basic.c
index 6ad13a2..cbef947 100644 (file)
@@ -57,6 +57,7 @@
 
 #include "view-mainwindow.h"
 #include "targeting.h"
+#include "world.h"
 
 /*!
  * @brief フロア脱出時に出戻りが不可能だった場合に警告を加える処理
  */
 static bool confirm_leave_level(player_type *creature_ptr, bool down_stair)
 {
-       quest_type *q_ptr = &quest[creature_ptr->inside_quest];
+       quest_type *q_ptr = &quest[creature_ptr->current_floor_ptr->inside_quest];
 
        /* Confirm leaving from once only quest */
-       if (confirm_quest && creature_ptr->inside_quest &&
+       if (confirm_quest && creature_ptr->current_floor_ptr->inside_quest &&
            (q_ptr->type == QUEST_TYPE_RANDOM ||
             (q_ptr->flags & QUEST_FLAG_ONCE &&
                                                q_ptr->status != QUEST_STATUS_COMPLETED) ||
@@ -144,7 +145,7 @@ bool cmd_limit_stun(player_type *creature_ptr)
 
 bool cmd_limit_arena(player_type *creature_ptr)
 {
-       if (creature_ptr->inside_arena)
+       if (creature_ptr->current_floor_ptr->inside_arena)
        {
                msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
                msg_print(NULL);
@@ -160,7 +161,7 @@ bool cmd_limit_blind(player_type *creature_ptr)
                msg_print(_("目が見えない。", "You can't see anything."));
                return TRUE;
        }
-       if (no_lite())
+       if (no_lite(creature_ptr))
        {
                msg_print(_("明かりがないので見えない。", "You have no light."));
                return TRUE;
@@ -217,23 +218,23 @@ void do_cmd_go_up(player_type *creature_ptr)
                else
                        msg_print(_("上の階に登った。", "You enter the up staircase."));
 
-               leave_quest_check();
+               leave_quest_check(creature_ptr);
 
-               creature_ptr->inside_quest = g_ptr->special;
+               creature_ptr->current_floor_ptr->inside_quest = g_ptr->special;
 
                /* Activate the quest */
-               if (!quest[creature_ptr->inside_quest].status)
+               if (!quest[creature_ptr->current_floor_ptr->inside_quest].status)
                {
-                       if (quest[creature_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
+                       if (quest[creature_ptr->current_floor_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
                        {
                                init_flags = INIT_ASSIGN;
-                               process_dungeon_file("q_info.txt", 0, 0, 0, 0);
+                               process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
                        }
-                       quest[creature_ptr->inside_quest].status = QUEST_STATUS_TAKEN;
+                       quest[creature_ptr->current_floor_ptr->inside_quest].status = QUEST_STATUS_TAKEN;
                }
 
                /* Leaving a quest */
-               if (!creature_ptr->inside_quest)
+               if (!creature_ptr->current_floor_ptr->inside_quest)
                {
                        creature_ptr->current_floor_ptr->dun_level = 0;
                }
@@ -261,24 +262,24 @@ void do_cmd_go_up(player_type *creature_ptr)
 
        take_turn(creature_ptr, 100);
 
-       if (autosave_l) do_cmd_save_game(TRUE);
+       if (autosave_l) do_cmd_save_game(creature_ptr, TRUE);
 
        /* For a random quest */
-       if (creature_ptr->inside_quest &&
-           quest[creature_ptr->inside_quest].type == QUEST_TYPE_RANDOM)
+       if (creature_ptr->current_floor_ptr->inside_quest &&
+           quest[creature_ptr->current_floor_ptr->inside_quest].type == QUEST_TYPE_RANDOM)
        {
-               leave_quest_check();
+               leave_quest_check(creature_ptr);
 
-               creature_ptr->inside_quest = 0;
+               creature_ptr->current_floor_ptr->inside_quest = 0;
        }
 
        /* For a fixed quest */
-       if (creature_ptr->inside_quest &&
-           quest[creature_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
+       if (creature_ptr->current_floor_ptr->inside_quest &&
+           quest[creature_ptr->current_floor_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
        {
-               leave_quest_check();
+               leave_quest_check(creature_ptr);
 
-               creature_ptr->inside_quest = g_ptr->special;
+               creature_ptr->current_floor_ptr->inside_quest = g_ptr->special;
                creature_ptr->current_floor_ptr->dun_level = 0;
                up_num = 0;
        }
@@ -290,14 +291,14 @@ void do_cmd_go_up(player_type *creature_ptr)
                if (have_flag(f_ptr->flags, FF_SHAFT))
                {
                        /* Create a way back */
-                       prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_UP | CFM_SHAFT);
+                       prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_UP | CFM_SHAFT);
 
                        up_num = 2;
                }
                else
                {
                        /* Create a way back */
-                       prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_UP);
+                       prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_UP);
 
                        up_num = 1;
                }
@@ -321,14 +322,11 @@ void do_cmd_go_up(player_type *creature_ptr)
 
 /*!
  * @brief 階段を使って階層を降りる処理 / Go down one level
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @return なし
  */
 void do_cmd_go_down(player_type *creature_ptr)
 {
-       /* Player grid */
-       grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
-       feature_type *f_ptr = &f_info[g_ptr->feat];
-
        bool fall_trap = FALSE;
        int down_num = 0;
 
@@ -338,6 +336,8 @@ void do_cmd_go_down(player_type *creature_ptr)
        }
 
        /* Verify stairs */
+       grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
+       feature_type *f_ptr = &f_info[g_ptr->feat];
        if (!have_flag(f_ptr->flags, FF_MORE))
        {
                msg_print(_("ここには下り階段が見当たらない。", "I see no down staircase here."));
@@ -349,11 +349,12 @@ void do_cmd_go_down(player_type *creature_ptr)
        /* Quest entrance */
        if (have_flag(f_ptr->flags, FF_QUEST_ENTER))
        {
-               do_cmd_quest();
+               do_cmd_quest(creature_ptr);
+               return;
        }
 
        /* Quest down stairs */
-       else if (have_flag(f_ptr->flags, FF_QUEST))
+       if (have_flag(f_ptr->flags, FF_QUEST))
        {
                /* Confirm Leaving */
                if(!confirm_leave_level(creature_ptr, TRUE)) return;
@@ -363,24 +364,24 @@ void do_cmd_go_down(player_type *creature_ptr)
                else
                        msg_print(_("下の階に降りた。", "You enter the down staircase."));
 
-               leave_quest_check();
+               leave_quest_check(creature_ptr);
                leave_tower_check();
 
-               creature_ptr->inside_quest = g_ptr->special;
+               creature_ptr->current_floor_ptr->inside_quest = g_ptr->special;
 
                /* Activate the quest */
-               if (!quest[creature_ptr->inside_quest].status)
+               if (!quest[creature_ptr->current_floor_ptr->inside_quest].status)
                {
-                       if (quest[creature_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
+                       if (quest[creature_ptr->current_floor_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
                        {
                                init_flags = INIT_ASSIGN;
-                               process_dungeon_file("q_info.txt", 0, 0, 0, 0);
+                               process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
                        }
-                       quest[creature_ptr->inside_quest].status = QUEST_STATUS_TAKEN;
+                       quest[creature_ptr->current_floor_ptr->inside_quest].status = QUEST_STATUS_TAKEN;
                }
 
                /* Leaving a quest */
-               if (!creature_ptr->inside_quest)
+               if (!creature_ptr->current_floor_ptr->inside_quest)
                {
                        creature_ptr->current_floor_ptr->dun_level = 0;
                }
@@ -389,100 +390,96 @@ void do_cmd_go_down(player_type *creature_ptr)
                creature_ptr->oldpy = 0;
                
                take_turn(creature_ptr, 100);
+               return;
        }
 
-       else
+       DUNGEON_IDX target_dungeon = 0;
+
+       if (!creature_ptr->current_floor_ptr->dun_level)
        {
-               DUNGEON_IDX target_dungeon = 0;
+               target_dungeon = have_flag(f_ptr->flags, FF_ENTRANCE) ? g_ptr->special : DUNGEON_ANGBAND;
 
-               if (!creature_ptr->current_floor_ptr->dun_level)
+               if (ironman_downward && (target_dungeon != DUNGEON_ANGBAND))
                {
-                       target_dungeon = have_flag(f_ptr->flags, FF_ENTRANCE) ? g_ptr->special : DUNGEON_ANGBAND;
-
-                       if (ironman_downward && (target_dungeon != DUNGEON_ANGBAND))
-                       {
-                               msg_print(_("ダンジョンの入口は塞がれている!", "The entrance of this dungeon is closed!"));
-                               return;
-                       }
-                       if (!max_dlv[target_dungeon])
-                       {
-                               msg_format(_("ここには%sの入り口(%d階相当)があります", "There is the entrance of %s (Danger level: %d)"),
-                                                       d_name+d_info[target_dungeon].name, d_info[target_dungeon].mindepth);
-                               if (!get_check(_("本当にこのダンジョンに入りますか?", "Do you really get in this dungeon? "))) return;
-                       }
+                       msg_print(_("ダンジョンの入口は塞がれている!", "The entrance of this dungeon is closed!"));
+                       return;
+               }
+               if (!max_dlv[target_dungeon])
+               {
+                       msg_format(_("ここには%sの入り口(%d階相当)があります", "There is the entrance of %s (Danger level: %d)"),
+                               d_name + d_info[target_dungeon].name, d_info[target_dungeon].mindepth);
+                       if (!get_check(_("本当にこのダンジョンに入りますか?", "Do you really get in this dungeon? "))) return;
+               }
 
-                       /* Save old player position */
-                       creature_ptr->oldpx = creature_ptr->x;
-                       creature_ptr->oldpy = creature_ptr->y;
-                       creature_ptr->dungeon_idx = target_dungeon;
+               /* Save old player position */
+               creature_ptr->oldpx = creature_ptr->x;
+               creature_ptr->oldpy = creature_ptr->y;
+               creature_ptr->dungeon_idx = target_dungeon;
 
-                       /*
-                        * Clear all saved floors
-                        * and create a first saved floor
-                        */
-                       prepare_change_floor_mode(CFM_FIRST_FLOOR);
-               }
+               /*
+                * Clear all saved floors
+                * and create a first saved floor
+                */
+               prepare_change_floor_mode(creature_ptr, CFM_FIRST_FLOOR);
+       }
 
-               take_turn(creature_ptr, 100);
+       take_turn(creature_ptr, 100);
 
-               if (autosave_l) do_cmd_save_game(TRUE);
+       if (autosave_l) do_cmd_save_game(creature_ptr, TRUE);
 
-               /* Go down */
-               if (have_flag(f_ptr->flags, FF_SHAFT)) down_num += 2;
-               else down_num += 1;
+       /* Go down */
+       if (have_flag(f_ptr->flags, FF_SHAFT)) down_num += 2;
+       else down_num += 1;
 
-               if (!creature_ptr->current_floor_ptr->dun_level)
-               {
-                       /* Enter the dungeon just now */
-                       creature_ptr->enter_dungeon = TRUE;
-                       down_num = d_info[creature_ptr->dungeon_idx].mindepth;
-               }
+       if (!creature_ptr->current_floor_ptr->dun_level)
+       {
+               /* Enter the dungeon just now */
+               creature_ptr->enter_dungeon = TRUE;
+               down_num = d_info[creature_ptr->dungeon_idx].mindepth;
+       }
 
-               if (record_stair)
-               {
-                       if (fall_trap) exe_write_diary(creature_ptr, NIKKI_STAIR, down_num, _("落とし戸に落ちた", "fell through a trap door"));
-                       else exe_write_diary(creature_ptr, NIKKI_STAIR, down_num, _("階段を下りた", "climbed down the stairs to"));
-               }
+       if (record_stair)
+       {
+               if (fall_trap) exe_write_diary(creature_ptr, NIKKI_STAIR, down_num, _("落とし戸に落ちた", "fell through a trap door"));
+               else exe_write_diary(creature_ptr, NIKKI_STAIR, down_num, _("階段を下りた", "climbed down the stairs to"));
+       }
 
-               if (fall_trap)
+       if (fall_trap)
+       {
+               msg_print(_("わざと落とし戸に落ちた。", "You deliberately jump through the trap door."));
+       }
+       else
+       {
+               /* Success */
+               if (target_dungeon)
                {
-                       msg_print(_("わざと落とし戸に落ちた。", "You deliberately jump through the trap door."));
+                       msg_format(_("%sへ入った。", "You entered %s."), d_text + d_info[creature_ptr->dungeon_idx].text);
                }
                else
                {
-                       /* Success */
-                       if (target_dungeon)
-                       {
-                               msg_format(_("%sへ入った。", "You entered %s."), d_text + d_info[creature_ptr->dungeon_idx].text);
-                       }
+                       if ((creature_ptr->pseikaku == SEIKAKU_COMBAT) || (creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
+                               msg_print(_("なんだこの階段は!", "What's this STAIRWAY!"));
                        else
-                       {
-                               if ((creature_ptr->pseikaku == SEIKAKU_COMBAT) || (creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
-                                       msg_print(_("なんだこの階段は!", "What's this STAIRWAY!"));
-                               else
-                                       msg_print(_("階段を下りて新たなる迷宮へと足を踏み入れた。", "You enter a maze of down staircases."));
-                       }
+                               msg_print(_("階段を下りて新たなる迷宮へと足を踏み入れた。", "You enter a maze of down staircases."));
                }
+       }
 
-               creature_ptr->leaving = TRUE;
+       creature_ptr->leaving = TRUE;
 
-               if (fall_trap)
-               {
-                       prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
-               }
-               else
-               {
-                       if (have_flag(f_ptr->flags, FF_SHAFT))
-                       {
-                               /* Create a way back */
-                               prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN | CFM_SHAFT);
-                       }
-                       else
-                       {
-                               /* Create a way back */
-                               prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN);
-                       }
-               }
+       if (fall_trap)
+       {
+               prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
+               return;
+       }
+       
+       /* Create a way back */
+       if (have_flag(f_ptr->flags, FF_SHAFT))
+       {
+               prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_DOWN | CFM_SHAFT);
+       }
+       else
+       {
+               prepare_change_floor_mode(creature_ptr, CFM_SAVE_FLOORS | CFM_DOWN);
        }
 }
 
@@ -503,8 +500,8 @@ void do_cmd_search(player_type * creature_ptr)
                /* Cancel the arg */
                command_arg = 0;
        }
-       take_turn(creature_ptr, 100);
 
+       take_turn(creature_ptr, 100);
        search(creature_ptr);
 }
 
@@ -516,9 +513,9 @@ void do_cmd_search(player_type * creature_ptr)
  * @param trapped TRUEならばトラップが存在する箱のみ、FALSEならば空でない箱全てを対象にする
  * @return 箱が存在する場合そのオブジェクトID、存在しない場合0を返す。
  */
-static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped)
+static OBJECT_IDX chest_check(floor_type *floor_ptr, POSITION y, POSITION x, bool trapped)
 {
-       grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+       grid_type *g_ptr = &floor_ptr->grid_array[y][x];
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
        /* Scan all objects in the grid */
@@ -526,7 +523,7 @@ static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped)
        {
                object_type *o_ptr;
 
-               o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
+               o_ptr = &floor_ptr->o_list[this_o_idx];
                next_o_idx = o_ptr->next_o_idx;
 
                /* Skip unknown chests XXX XXX */
@@ -540,7 +537,8 @@ static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped)
                        return (this_o_idx);
                }
        }
-       return (0);
+
+       return 0;
 }
 
 /*!
@@ -555,7 +553,6 @@ static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped)
  */
 static bool exe_open_chest(player_type *creature_ptr, POSITION y, POSITION x, OBJECT_IDX o_idx)
 {
-       int i, j;
        bool flag = TRUE;
        bool more = FALSE;
        object_type *o_ptr = &creature_ptr->current_floor_ptr->o_list[o_idx];
@@ -569,14 +566,14 @@ static bool exe_open_chest(player_type *creature_ptr, POSITION y, POSITION x, OB
                flag = FALSE;
 
                /* Get the "disarm" factor */
-               i = creature_ptr->skill_dis;
+               int i = creature_ptr->skill_dis;
 
                /* Penalize some conditions */
-               if (creature_ptr->blind || no_lite()) i = i / 10;
+               if (creature_ptr->blind || no_lite(creature_ptr)) i = i / 10;
                if (creature_ptr->confused || creature_ptr->image) i = i / 10;
 
                /* Extract the difficulty */
-               j = i - o_ptr->pval;
+               int j = i - o_ptr->pval;
 
                /* Always have a small chance of success */
                if (j < 2) j = 2;
@@ -607,9 +604,10 @@ static bool exe_open_chest(player_type *creature_ptr, POSITION y, POSITION x, OB
                chest_trap(creature_ptr, y, x, o_idx);
 
                /* Let the Chest drop items */
-               chest_death(FALSE, y, x, o_idx);
+               chest_death(creature_ptr, FALSE, y, x, o_idx);
        }
-       return (more);
+
+       return more;
 }
 
 /*!
@@ -625,15 +623,9 @@ static bool exe_open_chest(player_type *creature_ptr, POSITION y, POSITION x, OB
  */
 static int count_dt(player_type *creature_ptr, POSITION *y, POSITION *x, bool (*test)(FEAT_IDX feat), bool under)
 {
-       DIRECTION d;
-       int count;
-       POSITION xx, yy;
-
-       /* Count how many matches */
-       count = 0;
-
        /* Check around (and under) the character */
-       for (d = 0; d < 9; d++)
+       int count = 0;
+       for (DIRECTION d = 0; d < 9; d++)
        {
                grid_type *g_ptr;
                FEAT_IDX feat;
@@ -642,8 +634,8 @@ static int count_dt(player_type *creature_ptr, POSITION *y, POSITION *x, bool (*
                if ((d == 8) && !under) continue;
 
                /* Extract adjacent (legal) location */
-               yy = creature_ptr->y + ddy_ddd[d];
-               xx = creature_ptr->x + ddx_ddd[d];
+               POSITION yy = creature_ptr->y + ddy_ddd[d];
+               POSITION xx = creature_ptr->x + ddx_ddd[d];
 
                /* Get the creature_ptr->current_floor_ptr->grid_array */
                g_ptr = &creature_ptr->current_floor_ptr->grid_array[yy][xx];
@@ -682,25 +674,20 @@ static int count_dt(player_type *creature_ptr, POSITION *y, POSITION *x, bool (*
  */
 static int count_chests(player_type *creature_ptr, POSITION *y, POSITION *x, bool trapped)
 {
-       DIRECTION d;
-       int count;
-       OBJECT_IDX o_idx;
-       object_type *o_ptr;
-
-       /* Count how many matches */
-       count = 0;
-
        /* Check around (and under) the character */
-       for (d = 0; d < 9; d++)
+       int count = 0;
+       for (DIRECTION d = 0; d < 9; d++)
        {
                /* Extract adjacent (legal) location */
                POSITION yy = creature_ptr->y + ddy_ddd[d];
                POSITION xx = creature_ptr->x + ddx_ddd[d];
 
                /* No (visible) chest is there */
-               if ((o_idx = chest_check(yy, xx, FALSE)) == 0) continue;
+               OBJECT_IDX o_idx = chest_check(creature_ptr->current_floor_ptr, yy, xx, FALSE);
+               if (!o_idx) continue;
 
                /* Grab the object */
+               object_type *o_ptr;
                o_ptr = &creature_ptr->current_floor_ptr->o_list[o_idx];
 
                /* Already open */
@@ -737,8 +724,6 @@ static int count_chests(player_type *creature_ptr, POSITION *y, POSITION *x, boo
  */
 static bool exe_open(player_type *creature_ptr, POSITION y, POSITION x)
 {
-       int i, j;
-
        /* Get requested grid */
        grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
        feature_type *f_ptr = &f_info[g_ptr->feat];
@@ -753,63 +738,47 @@ static bool exe_open(player_type *creature_ptr, POSITION y, POSITION x)
        {
                /* Stuck */
                msg_format(_("%sはがっちりと閉じられているようだ。", "The %s appears to be stuck."), f_name + f_info[get_feat_mimic(g_ptr)].name);
+               return more;
        }
 
-       /* Locked door */
-       else if (f_ptr->power)
+       if (!f_ptr->power)
        {
-               /* Disarm factor */
-               i = creature_ptr->skill_dis;
-
-               /* Penalize some conditions */
-               if (creature_ptr->blind || no_lite()) i = i / 10;
-               if (creature_ptr->confused || creature_ptr->image) i = i / 10;
-
-               /* Extract the lock power */
-               j = f_ptr->power;
-
-               /* Extract the difficulty */
-               j = i - (j * 4);
-
-               /* Always have a small chance of success */
-               if (j < 2) j = 2;
-
-               /* Success */
-               if (randint0(100) < j)
-               {
-                       msg_print(_("鍵をはずした。", "You have picked the lock."));
+               cave_alter_feat(creature_ptr, y, x, FF_OPEN);
+               sound(SOUND_OPENDOOR);
+               return more;
+       }
+       
+       /* Disarm factor */
+       int i = creature_ptr->skill_dis;
 
-                       /* Open the door */
-                       cave_alter_feat(y, x, FF_OPEN);
+       /* Penalize some conditions */
+       if (creature_ptr->blind || no_lite(creature_ptr)) i = i / 10;
+       if (creature_ptr->confused || creature_ptr->image) i = i / 10;
 
-                       sound(SOUND_OPENDOOR);
+       /* Extract the difficulty */
+       int j = f_ptr->power;
+       j = i - (j * 4);
 
-                       /* Experience */
-                       gain_exp(creature_ptr, 1);
-               }
+       /* Always have a small chance of success */
+       if (j < 2) j = 2;
 
-               /* Failure */
-               else
-               {
-                       /* Failure */
-                       if (flush_failure) flush();
+       if (randint0(100) >= j)
+       {
+               if (flush_failure) flush();
+               msg_print(_("鍵をはずせなかった。", "You failed to pick the lock."));
+               more = TRUE;
+       }
 
-                       msg_print(_("鍵をはずせなかった。", "You failed to pick the lock."));
+       msg_print(_("鍵をはずした。", "You have picked the lock."));
 
-                       /* We may keep trying */
-                       more = TRUE;
-               }
-       }
+       /* Open the door */
+       cave_alter_feat(creature_ptr, y, x, FF_OPEN);
 
-       /* Closed door */
-       else
-       {
-               /* Open the door */
-               cave_alter_feat(y, x, FF_OPEN);
+       sound(SOUND_OPENDOOR);
 
-               sound(SOUND_OPENDOOR);
-       }
-       return (more);
+       /* Experience */
+       gain_exp(creature_ptr, 1);
+       return more;
 }
 
 /*!
@@ -877,7 +846,7 @@ void do_cmd_open(player_type *creature_ptr)
                feat = get_feat_mimic(g_ptr);
 
                /* Check for chest */
-               o_idx = chest_check(y, x, FALSE);
+               o_idx = chest_check(creature_ptr->current_floor_ptr, y, x, FALSE);
 
                if (!have_flag(f_info[feat].flags, FF_OPEN) && !o_idx)
                {
@@ -905,7 +874,8 @@ void do_cmd_open(player_type *creature_ptr)
 
 
 
-/*!
+/*
+ * todo 常にFALSEを返している
  * @brief 「閉じる」動作コマンドのサブルーチン /
  * Perform the basic "close" command
  * @param y 対象を行うマスのY座標
@@ -927,33 +897,36 @@ static bool exe_close(player_type *creature_ptr, POSITION y, POSITION x)
        /* Seeing true feature code (ignore mimic) */
 
        /* Open door */
-       if (have_flag(f_info[old_feat].flags, FF_CLOSE))
+       if (!have_flag(f_info[old_feat].flags, FF_CLOSE))
+       {
+               return more;
+       }
+       
+       s16b closed_feat = feat_state(old_feat, FF_CLOSE);
+
+       /* Hack -- object in the way */
+       if ((g_ptr->o_idx || (g_ptr->info & CAVE_OBJECT)) &&
+               (closed_feat != old_feat) && !have_flag(f_info[closed_feat].flags, FF_DROP))
        {
-               s16b closed_feat = feat_state(old_feat, FF_CLOSE);
+               msg_print(_("何かがつっかえて閉まらない。", "There seems stuck."));
+       }
+       else
+       {
+               /* Close the door */
+               cave_alter_feat(creature_ptr, y, x, FF_CLOSE);
 
-               /* Hack -- object in the way */
-               if ((g_ptr->o_idx || (g_ptr->info & CAVE_OBJECT)) &&
-                   (closed_feat != old_feat) && !have_flag(f_info[closed_feat].flags, FF_DROP))
+               /* Broken door */
+               if (old_feat == g_ptr->feat)
                {
-                       msg_print(_("何かがつっかえて閉まらない。", "There seems stuck."));
+                       msg_print(_("ドアは壊れてしまっている。", "The door appears to be broken."));
                }
                else
                {
-                       /* Close the door */
-                       cave_alter_feat(y, x, FF_CLOSE);
-
-                       /* Broken door */
-                       if (old_feat == g_ptr->feat)
-                       {
-                               msg_print(_("ドアは壊れてしまっている。", "The door appears to be broken."));
-                       }
-                       else
-                       {
-                               sound(SOUND_SHUTDOOR);
-                       }
+                       sound(SOUND_SHUTDOOR);
                }
        }
-       return (more);
+
+       return more;
 }
 
 
@@ -1049,9 +1022,9 @@ void do_cmd_close(player_type *creature_ptr)
  * @param x 対象を行うマスのX座標
  * @return 
  */
-static bool do_cmd_tunnel_test(POSITION y, POSITION x)
+static bool do_cmd_tunnel_test(floor_type *floor_ptr, POSITION y, POSITION x)
 {
-       grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+       grid_type *g_ptr = &floor_ptr->grid_array[y][x];
 
        /* Must have knowledge */
        if (!(g_ptr->info & CAVE_MARK))
@@ -1093,7 +1066,7 @@ static bool exe_tunnel(player_type *creature_ptr, POSITION y, POSITION x)
        bool more = FALSE;
 
        /* Verify legality */
-       if (!do_cmd_tunnel_test(y, x)) return (FALSE);
+       if (!do_cmd_tunnel_test(creature_ptr->current_floor_ptr, y, x)) return (FALSE);
 
        take_turn(creature_ptr, 100);
 
@@ -1132,7 +1105,7 @@ static bool exe_tunnel(player_type *creature_ptr, POSITION y, POSITION x)
                        msg_format(_("%sをくずした。", "You have removed the %s."), name);
 
                        /* Remove the feature */
-                       cave_alter_feat(y, x, FF_TUNNEL);
+                       cave_alter_feat(creature_ptr, y, x, FF_TUNNEL);
                        creature_ptr->update |= (PU_FLOW);
                }
                else
@@ -1161,7 +1134,7 @@ static bool exe_tunnel(player_type *creature_ptr, POSITION y, POSITION x)
                        if (have_flag(f_ptr->flags, FF_GLASS)) sound(SOUND_GLASS);
 
                        /* Remove the feature */
-                       cave_alter_feat(y, x, FF_TUNNEL);
+                       cave_alter_feat(creature_ptr, y, x, FF_TUNNEL);
 
                        chg_virtue(creature_ptr, V_DILIGENCE, 1);
                        chg_virtue(creature_ptr, V_NATURE, -1);
@@ -1192,6 +1165,7 @@ static bool exe_tunnel(player_type *creature_ptr, POSITION y, POSITION x)
                /* Occasional Search XXX XXX */
                if (randint0(100) < 25) search(creature_ptr);
        }
+
        return more;
 }
 
@@ -1322,7 +1296,7 @@ bool easy_open_door(player_type *creature_ptr, POSITION y, POSITION x)
                i = creature_ptr->skill_dis;
 
                /* Penalize some conditions */
-               if (creature_ptr->blind || no_lite()) i = i / 10;
+               if (creature_ptr->blind || no_lite(creature_ptr)) i = i / 10;
                if (creature_ptr->confused || creature_ptr->image) i = i / 10;
 
                /* Extract the lock power */
@@ -1340,7 +1314,7 @@ bool easy_open_door(player_type *creature_ptr, POSITION y, POSITION x)
                        msg_print(_("鍵をはずした。", "You have picked the lock."));
 
                        /* Open the door */
-                       cave_alter_feat(y, x, FF_OPEN);
+                       cave_alter_feat(creature_ptr, y, x, FF_OPEN);
 
                        sound(SOUND_OPENDOOR);
 
@@ -1363,10 +1337,11 @@ bool easy_open_door(player_type *creature_ptr, POSITION y, POSITION x)
        else
        {
                /* Open the door */
-               cave_alter_feat(y, x, FF_OPEN);
+               cave_alter_feat(creature_ptr, y, x, FF_OPEN);
 
                sound(SOUND_OPENDOOR);
        }
+
        return (TRUE);
 }
 
@@ -1396,7 +1371,7 @@ static bool exe_disarm_chest(player_type *creature_ptr, POSITION y, POSITION x,
        i = creature_ptr->skill_dis;
 
        /* Penalize some conditions */
-       if (creature_ptr->blind || no_lite()) i = i / 10;
+       if (creature_ptr->blind || no_lite(creature_ptr)) i = i / 10;
        if (creature_ptr->confused || creature_ptr->image) i = i / 10;
 
        /* Extract the difficulty */
@@ -1448,6 +1423,7 @@ static bool exe_disarm_chest(player_type *creature_ptr, POSITION y, POSITION x,
                sound(SOUND_FAIL);
                chest_trap(creature_ptr, y, x, o_idx);
        }
+
        return (more);
 }
 
@@ -1488,7 +1464,7 @@ bool exe_disarm(player_type *creature_ptr, POSITION y, POSITION x, DIRECTION dir
        take_turn(creature_ptr, 100);
 
        /* Penalize some conditions */
-       if (creature_ptr->blind || no_lite()) i = i / 10;
+       if (creature_ptr->blind || no_lite(creature_ptr)) i = i / 10;
        if (creature_ptr->confused || creature_ptr->image) i = i / 10;
 
        /* Extract the difficulty */
@@ -1506,7 +1482,7 @@ bool exe_disarm(player_type *creature_ptr, POSITION y, POSITION x, DIRECTION dir
                gain_exp(creature_ptr, power);
 
                /* Remove the trap */
-               cave_alter_feat(y, x, FF_DISARM);
+               cave_alter_feat(creature_ptr, y, x, FF_DISARM);
 
                /* Move the player onto the trap */
                move_player(creature_ptr, dir, easy_disarm, FALSE);
@@ -1531,6 +1507,7 @@ bool exe_disarm(player_type *creature_ptr, POSITION y, POSITION x, DIRECTION dir
                /* Move the player onto the trap */
                move_player(creature_ptr, dir, easy_disarm, FALSE);
        }
+
        return (more);
 }
 
@@ -1573,8 +1550,7 @@ void do_cmd_disarm(player_type *creature_ptr)
                        if (!too_many) command_dir = coords_to_dir(creature_ptr, y, x);
                }
        }
-
-
+       
        /* Allow repeated command */
        if (command_arg)
        {
@@ -1600,7 +1576,7 @@ void do_cmd_disarm(player_type *creature_ptr)
                feat = get_feat_mimic(g_ptr);
 
                /* Check for chests */
-               o_idx = chest_check(y, x, TRUE);
+               o_idx = chest_check(creature_ptr->current_floor_ptr, y, x, TRUE);
 
                /* Disarm a trap */
                if (!is_trap(feat) && !o_idx)
@@ -1689,13 +1665,13 @@ static bool do_cmd_bash_aux(player_type *creature_ptr, POSITION y, POSITION x, D
                /* Break down the door */
                if ((randint0(100) < 50) || (feat_state(g_ptr->feat, FF_OPEN) == g_ptr->feat) || have_flag(f_ptr->flags, FF_GLASS))
                {
-                       cave_alter_feat(y, x, FF_BASH);
+                       cave_alter_feat(creature_ptr, y, x, FF_BASH);
                }
 
                /* Open the door */
                else
                {
-                       cave_alter_feat(y, x, FF_OPEN);
+                       cave_alter_feat(creature_ptr, y, x, FF_OPEN);
                }
 
                /* Hack -- Fall through the door */
@@ -1720,6 +1696,7 @@ static bool do_cmd_bash_aux(player_type *creature_ptr, POSITION y, POSITION x, D
                /* Hack -- Lose balance ala paralysis */
                (void)set_paralyzed(creature_ptr, creature_ptr->paralyzed + 2 + randint0(2));
        }
+
        return (more);
 }
 
@@ -1951,6 +1928,7 @@ static bool get_spike(player_type *creature_ptr, INVENTORY_IDX *ip)
 /*!
  * @brief 「くさびを打つ」動作コマンドのメインルーチン /
  * Jam a closed door with a spike
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @return なし
  * @details
  * <pre>
@@ -1968,75 +1946,63 @@ void do_cmd_spike(player_type *creature_ptr)
        }
 
        /* Get a "repeated" direction */
-       if (get_rep_dir(&dir, FALSE))
-       {
-               POSITION y, x;
-               INVENTORY_IDX item;
-               grid_type *g_ptr;
-               FEAT_IDX feat;
+       if (!get_rep_dir(&dir, FALSE)) return;
 
-               y = creature_ptr->y + ddy[dir];
-               x = creature_ptr->x + ddx[dir];
-               g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
+       POSITION y = creature_ptr->y + ddy[dir];
+       POSITION x = creature_ptr->x + ddx[dir];
+       grid_type *g_ptr;
+       g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
 
-               /* Feature code (applying "mimic" field) */
-               feat = get_feat_mimic(g_ptr);
+       /* Feature code (applying "mimic" field) */
+       FEAT_IDX feat = get_feat_mimic(g_ptr);
 
-               /* Require closed door */
-               if (!have_flag(f_info[feat].flags, FF_SPIKE))
-               {
-                       msg_print(_("そこにはくさびを打てるものが見当たらない。", "You see nothing there to spike."));
-               }
+       /* Require closed door */
+       INVENTORY_IDX item;
+       if (!have_flag(f_info[feat].flags, FF_SPIKE))
+       {
+               msg_print(_("そこにはくさびを打てるものが見当たらない。", "You see nothing there to spike."));
+       }
 
-               /* Get a spike */
-               else if (!get_spike(creature_ptr, &item))
-               {
-                       msg_print(_("くさびを持っていない!", "You have no spikes!"));
-               }
+       /* Get a spike */
+       else if (!get_spike(creature_ptr, &item))
+       {
+               msg_print(_("くさびを持っていない!", "You have no spikes!"));
+       }
 
-               /* Is a monster in the way? */
-               else if (g_ptr->m_idx)
-               {
-                       take_turn(creature_ptr, 100);
+       /* Is a monster in the way? */
+       else if (g_ptr->m_idx)
+       {
+               take_turn(creature_ptr, 100);
 
-                       msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
+               msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
-                       /* Attack */
-                       py_attack(creature_ptr, y, x, 0);
-               }
+               /* Attack */
+               py_attack(creature_ptr, y, x, 0);
+       }
 
-               /* Go for it */
-               else
-               {
-                       take_turn(creature_ptr, 100);
+       /* Go for it */
+       else
+       {
+               take_turn(creature_ptr, 100);
 
-                       /* Successful jamming */
-                       msg_format(_("%sにくさびを打ち込んだ。", "You jam the %s with a spike."), f_name + f_info[feat].name);
-                       cave_alter_feat(y, x, FF_SPIKE);
+               /* Successful jamming */
+               msg_format(_("%sにくさびを打ち込んだ。", "You jam the %s with a spike."), f_name + f_info[feat].name);
+               cave_alter_feat(creature_ptr, y, x, FF_SPIKE);
 
-                       /* Use up, and describe, a single spike, from the bottom */
-                       inven_item_increase(item, -1);
-                       inven_item_describe(item);
-                       inven_item_optimize(item);
-               }
+               vary_item(creature_ptr, item, -1);
        }
 }
 
 
-
 /*!
  * @brief 「歩く」動作コマンドのメインルーチン /
  * Support code for the "Walk" and "Jump" commands
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @param pickup アイテムの自動拾いを行うならTRUE
  * @return なし
  */
 void do_cmd_walk(player_type *creature_ptr, bool pickup)
 {
-       DIRECTION dir;
-
-       bool more = FALSE;
-
-
        /* Allow repeated command */
        if (command_arg)
        {
@@ -2049,6 +2015,8 @@ void do_cmd_walk(player_type *creature_ptr, bool pickup)
        }
 
        /* Get a "repeated" direction */
+       bool more = FALSE;
+       DIRECTION dir;
        if (get_rep_dir(&dir, FALSE))
        {
                take_turn(creature_ptr, 100);
@@ -2070,7 +2038,7 @@ void do_cmd_walk(player_type *creature_ptr, bool pickup)
        }
 
        /* Hack again -- Is there a special encounter ??? */
-       if (creature_ptr->wild_mode && !cave_have_flag_bold(creature_ptr->y, creature_ptr->x, FF_TOWN))
+       if (creature_ptr->wild_mode && !cave_have_flag_bold(creature_ptr->current_floor_ptr, creature_ptr->y, creature_ptr->x, FF_TOWN))
        {
                int tmp = 120 + creature_ptr->lev*10 - wilderness[creature_ptr->y][creature_ptr->x].level + 5;
                if (tmp < 1) 
@@ -2099,6 +2067,7 @@ void do_cmd_walk(player_type *creature_ptr, bool pickup)
 /*!
  * @brief 「走る」動作コマンドのメインルーチン /
  * Start running.
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @return なし
  */
 void do_cmd_run(player_type *creature_ptr)
@@ -2127,6 +2096,7 @@ void do_cmd_run(player_type *creature_ptr)
  * @brief 「留まる」動作コマンドのメインルーチン /
  * Stay still.  Search.  Enter stores.
  * Pick up treasure if "pickup" is true.
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @param pickup アイテムの自動拾いを行うならTRUE
  * @return なし
  */
@@ -2155,11 +2125,11 @@ void do_cmd_stay(player_type *creature_ptr, bool pickup)
 /*!
  * @brief 「休む」動作コマンドのメインルーチン /
  * Resting allows a player to safely restore his hp    -RAK-
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @return なし
  */
 void do_cmd_rest(player_type *creature_ptr)
 {
-
        set_action(creature_ptr, ACTION_NONE);
 
        if ((creature_ptr->pclass == CLASS_BARD) && (SINGING_SONG_EFFECT(creature_ptr) || INTERUPTING_SONG_EFFECT(creature_ptr)))
@@ -2167,7 +2137,7 @@ void do_cmd_rest(player_type *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);
 
        /* Prompt for time if needed */
        if (command_arg <= 0)
@@ -2175,8 +2145,7 @@ void do_cmd_rest(player_type *creature_ptr)
                concptr p = _("休憩 (0-9999, '*' で HP/MP全快, '&' で必要なだけ): ", 
                                   "Rest (0-9999, '*' for HP/SP, '&' as needed): ");
 
-
-               char out_val[80];
+char out_val[80];
 
                /* Default */
                strcpy(out_val, "&");
@@ -2232,15 +2201,18 @@ void do_cmd_rest(player_type *creature_ptr)
        update_creature(creature_ptr);
 
        creature_ptr->redraw |= (PR_STATE);
-       update_output();
+       update_output(creature_ptr);
 
        Term_fresh();
 }
 
 
 
-/*!
+/*
+ * todo Doxygenの加筆求む
  * @brief 射撃処理のメインルーチン
+ * @param creature_ptr プレーヤーへの参照ポインタ
+ * @param snipe_type ???
  * @return なし
  */
 void do_cmd_fire(player_type *creature_ptr, SPELL_IDX snipe_type)
@@ -2302,8 +2274,9 @@ void do_cmd_fire(player_type *creature_ptr, SPELL_IDX snipe_type)
        /* Sniper actions after some shootings */
        if (snipe_type == SP_AWAY)
        {
-               teleport_player(10 + (creature_ptr->concent * 2), 0L);
+               teleport_player(creature_ptr, 10 + (creature_ptr->concent * 2), 0L);
        }
+
        if (snipe_type == SP_FINAL)
        {
                msg_print(_("射撃の反動が体を襲った。", "A reactionary of shooting attacked you. "));
@@ -2317,6 +2290,7 @@ void do_cmd_fire(player_type *creature_ptr, SPELL_IDX snipe_type)
  * @brief 投射処理メインルーチン /
  * Throw an object from the pack or floor.
  * @param mult 威力の倍率
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @param boomerang ブーメラン処理ならばTRUE
  * @param shuriken 忍者の手裏剣処理ならばTRUE
  * @return ターンを消費した場合TRUEを返す
@@ -2415,7 +2389,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                return FALSE;
        }
 
-       if (creature_ptr->inside_arena && !boomerang)
+       if (creature_ptr->current_floor_ptr->inside_arena && !boomerang)
        {
                if (o_ptr->tval != TV_SPIKE)
                {
@@ -2424,8 +2398,8 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
 
                        return FALSE;
                }
-
        }
+
        q_ptr = &forge;
        object_copy(q_ptr, o_ptr);
 
@@ -2487,21 +2461,19 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
            (q_ptr->name1 == ART_AEGISFANG) || boomerang)
                return_when_thrown = TRUE;
 
-       /* Reduce and describe creature_ptr->inventory_list */
        if (item >= 0)
        {
-               inven_item_increase(item, -1);
+               inven_item_increase(creature_ptr, item, -1);
                if (!return_when_thrown)
-                       inven_item_describe(item);
-               inven_item_optimize(item);
+                       inven_item_describe(creature_ptr, item);
+               inven_item_optimize(creature_ptr, item);
        }
-
-       /* Reduce and describe floor item */
        else
        {
-               floor_item_increase(0 - item, -1);
-               floor_item_optimize(0 - item);
+               floor_item_increase(creature_ptr->current_floor_ptr, 0 - item, -1);
+               floor_item_optimize(creature_ptr->current_floor_ptr, 0 - item);
        }
+
        if (item >= INVEN_RARM)
        {
                equiped_item = TRUE;
@@ -2518,7 +2490,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
        y = creature_ptr->y;
        x = creature_ptr->x;
 
-       handle_stuff();
+       handle_stuff(creature_ptr);
 
        if ((creature_ptr->pclass == CLASS_NINJA) && ((q_ptr->tval == TV_SPIKE) || ((have_flag(flgs, TR_THROW)) && (q_ptr->tval == TV_SWORD)))) shuriken = TRUE;
        else shuriken = FALSE;
@@ -2545,20 +2517,20 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                mmove2(&ny[cur_dis], &nx[cur_dis], creature_ptr->y, creature_ptr->x, ty, tx);
 
                /* Stopped by walls/doors */
-               if (!cave_have_flag_bold(ny[cur_dis], nx[cur_dis], FF_PROJECT))
+               if (!cave_have_flag_bold(creature_ptr->current_floor_ptr, ny[cur_dis], nx[cur_dis], FF_PROJECT))
                {
                        hit_wall = TRUE;
                        if ((q_ptr->tval == TV_FIGURINE) || object_is_potion(q_ptr) || !creature_ptr->current_floor_ptr->grid_array[ny[cur_dis]][nx[cur_dis]].m_idx) break;
                }
 
                /* The player can see the (on screen) missile */
-               if (panel_contains(ny[cur_dis], nx[cur_dis]) && player_can_see_bold(ny[cur_dis], nx[cur_dis]))
+               if (panel_contains(ny[cur_dis], nx[cur_dis]) && player_can_see_bold(creature_ptr, ny[cur_dis], nx[cur_dis]))
                {
                        SYMBOL_CODE c = object_char(q_ptr);
                        TERM_COLOR a = object_attr(q_ptr);
 
                        /* Draw, Hilite, Fresh, Pause, Erase */
-                       print_rel(c, a, ny[cur_dis], nx[cur_dis]);
+                       print_rel(creature_ptr, c, a, ny[cur_dis], nx[cur_dis]);
                        move_cursor_relative(ny[cur_dis], nx[cur_dis]);
                        Term_fresh();
                        Term_xtra(TERM_XTRA_DELAY, msec);
@@ -2697,7 +2669,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
        j = (hit_body ? breakage_chance(q_ptr, creature_ptr->pclass == CLASS_ARCHER, 0) : 0);
 
        /* Figurines transform */
-       if ((q_ptr->tval == TV_FIGURINE) && !(creature_ptr->inside_arena))
+       if ((q_ptr->tval == TV_FIGURINE) && !(creature_ptr->current_floor_ptr->inside_arena))
        {
                j = 100;
 
@@ -2749,13 +2721,13 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                {
                        for (i = cur_dis - 1; i > 0; i--)
                        {
-                               if (panel_contains(ny[i], nx[i]) && player_can_see_bold(ny[i], nx[i]))
+                               if (panel_contains(ny[i], nx[i]) && player_can_see_bold(creature_ptr, ny[i], nx[i]))
                                {
                                        char c = object_char(q_ptr);
                                        byte a = object_attr(q_ptr);
 
                                        /* Draw, Hilite, Fresh, Pause, Erase */
-                                       print_rel(c, a, ny[i], nx[i]);
+                                       print_rel(creature_ptr, c, a, ny[i], nx[i]);
                                        move_cursor_relative(ny[i], nx[i]);
                                        Term_fresh();
                                        Term_xtra(TERM_XTRA_DELAY, msec);
@@ -2777,7 +2749,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                        {
                                if (item >= 0)
                                {
-                                       msg_format(_("%sを受け損ねた!", "%s backs, but you can't catch!"), o2_name);
+                                       msg_format(_("%sを受け損ねた!", "%s comes backs, but you can't catch!"), o2_name);
                                }
                                else
                                {
@@ -2789,7 +2761,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                }
                else
                {
-                       msg_format(_("%sが返ってこなかった!", "%s doesn't back!"), o2_name);
+                       msg_format(_("%sが返ってこなかった!", "%s doesn't come back!"), o2_name);
                }
        }
 
@@ -2813,7 +2785,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                }
                else
                {
-                       inven_carry(q_ptr);
+                       inven_carry(creature_ptr, q_ptr);
                }
                do_drop = FALSE;
        }
@@ -2825,13 +2797,13 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
 
        if (do_drop)
        {
-               if (cave_have_flag_bold(y, x, FF_PROJECT))
+               if (cave_have_flag_bold(creature_ptr->current_floor_ptr, y, x, FF_PROJECT))
                {
-                       (void)drop_near(q_ptr, j, y, x);
+                       (void)drop_near(creature_ptr, q_ptr, j, y, x);
                }
                else
                {
-                       (void)drop_near(q_ptr, j, prev_y, prev_x);
+                       (void)drop_near(creature_ptr, q_ptr, j, prev_y, prev_x);
                }
        }
 
@@ -2852,7 +2824,7 @@ void do_cmd_suicide(player_type *creature_ptr)
        flush();
 
        /* Verify Retirement */
-       if (creature_ptr->total_winner)
+       if (current_world_ptr->total_winner)
        {
                /* Verify */
                if (!get_check_strict(_("引退しますか? ", "Do you want to retire? "), CHECK_NO_HISTORY)) return;
@@ -2865,7 +2837,7 @@ void do_cmd_suicide(player_type *creature_ptr)
                if (!get_check(_("本当に自殺しますか?", "Do you really want to commit suicide? "))) return;
        }
 
-       if (!creature_ptr->noscore)
+       if (!current_world_ptr->noscore)
        {
                /* Special Verification for suicide */
                prt(_("確認のため '@' を押して下さい。", "Please verify SUICIDE by typing the '@' sign: "), 0, 0);
@@ -2883,7 +2855,7 @@ void do_cmd_suicide(player_type *creature_ptr)
        creature_ptr->last_message = NULL;
 
        /* Hack -- Note *winning* message */
-       if (creature_ptr->total_winner && last_words)
+       if (current_world_ptr->total_winner && last_words)
        {
                char buf[1024] = "";
                play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_WINNER);
@@ -2906,7 +2878,7 @@ void do_cmd_suicide(player_type *creature_ptr)
        creature_ptr->is_dead = TRUE;
        creature_ptr->leaving = TRUE;
 
-       if (!creature_ptr->total_winner)
+       if (!current_world_ptr->total_winner)
        {
                exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 0, _("ダンジョンの探索に絶望して自殺した。", "give up all hope to commit suicide."));
                exe_write_diary(creature_ptr, NIKKI_GAMESTART, 1, _("-------- ゲームオーバー --------", "--------   Game  Over   --------"));