OSDN Git Service

[Refactor] #37353 バリアント名称とバージョン定義を core.h へ移動.
[hengband/hengband.git] / src / object1.c
index 2b82418..474f996 100644 (file)
  */
 
 #include "angband.h"
+#include "core.h"
+#include "util.h"
+
+#include "artifact.h"
+#include "floor.h"
+#include "cmd-activate.h"
+#include "objectkind.h"
+#include "object-ego.h"
+#include "object-flavor.h"
+#include "object-hook.h"
+#include "player-move.h"
+#include "monster.h"
+#include "files.h"
+#include "term.h"
+#include "cmd-smith.h"
+#include "snipe.h"
+#include "view-mainwindow.h"
 
 #if defined(MACINTOSH) || defined(MACH_O_CARBON)
 #ifdef verify
@@ -78,7 +95,7 @@ void reset_visuals(void)
                process_pref_file("graf.prf");
 
                /* Access the "character" pref file */
-               sprintf(buf, "graf-%s.prf", player_base);
+               sprintf(buf, "graf-%s.prf", p_ptr->base_name);
 
                /* Process "graf-<playername>.prf" */
                process_pref_file(buf);
@@ -93,7 +110,7 @@ void reset_visuals(void)
                process_pref_file("font.prf");
 
                /* Access the "character" pref file */
-               sprintf(buf, "font-%s.prf", player_base);
+               sprintf(buf, "font-%s.prf", p_ptr->base_name);
 
                /* Process "font-<playername>.prf" */
                process_pref_file(buf);
@@ -339,9 +356,9 @@ void object_flags_known(object_type *o_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
 /*!
  * @brief オブジェクトの発動効果名称を返す(サブルーチン/ブレス)
  * @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ
- * @return cptr 発動名称を返す文字列ポインタ
+ * @return concptr 発動名称を返す文字列ポインタ
  */
-static cptr item_activation_dragon_breath(object_type *o_ptr)
+static concptr item_activation_dragon_breath(object_type *o_ptr)
 {
        static char desc[256];
        BIT_FLAGS flgs[TR_FLAG_SIZE]; /* for resistance flags */
@@ -368,12 +385,12 @@ static cptr item_activation_dragon_breath(object_type *o_ptr)
 /*!
  * @brief オブジェクトの発動効果名称を返す(サブルーチン/汎用)
  * @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ
- * @return cptr 発動名称を返す文字列ポインタ
+ * @return concptr 発動名称を返す文字列ポインタ
  */
-static cptr item_activation_aux(object_type *o_ptr)
+static concptr item_activation_aux(object_type *o_ptr)
 {
        static char activation_detail[256];
-       cptr desc;
+       concptr desc;
        char timeout[32];
        int constant, dice;
        const activation_type* const act_ptr = find_activation_info(o_ptr);
@@ -425,8 +442,8 @@ static cptr item_activation_aux(object_type *o_ptr)
        constant = act_ptr->timeout.constant;
        dice = act_ptr->timeout.dice;
        if (constant == 0 && dice == 0) {
-               /* We can activate it every turn */
-               strcpy(timeout, _("いつでも", "every turn"));
+               /* We can activate it every current_world_ptr->game_turn */
+               strcpy(timeout, _("いつでも", "every current_world_ptr->game_turn"));
        } else if (constant < 0) {
                /* Activations that have special timeout */
                switch (act_ptr->index) {
@@ -469,13 +486,11 @@ static cptr item_activation_aux(object_type *o_ptr)
  * @brief オブジェクトの発動効果名称を返す(メインルーチン) /
  * Determine the "Activation" (if any) for an artifact Return a string, or NULL for "no activation"
  * @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ
- * @return cptr 発動名称を返す文字列ポインタ
+ * @return concptr 発動名称を返す文字列ポインタ
  */
-cptr item_activation(object_type *o_ptr)
+concptr item_activation(object_type *o_ptr)
 {
        BIT_FLAGS flgs[TR_FLAG_SIZE];
-
-       /* Extract the flags */
        object_flags(o_ptr, flgs);
 
        /* Require activation ability */
@@ -516,15 +531,13 @@ bool screen_object(object_type *o_ptr, BIT_FLAGS mode)
        BIT_FLAGS flgs[TR_FLAG_SIZE];
 
        char temp[70 * 20];
-       cptr            info[128];
-       char o_name[MAX_NLEN];
+       concptr            info[128];
+       GAME_TEXT o_name[MAX_NLEN];
        int wid, hgt;
        POSITION rad;
        char desc[256];
 
        int trivial_info = 0;
-
-       /* Extract the flags */
        object_flags(o_ptr, flgs);
 
        /* Extract the description */
@@ -559,7 +572,7 @@ bool screen_object(object_type *o_ptr, BIT_FLAGS mode)
        /* Figurines, a hack */
        if (o_ptr->name1 == ART_STONEMASK)
        {
-               info[i++] = _("それを装備した者は吸血鬼になる。", "It makes you turn into a vampire permanently.");
+               info[i++] = _("それを装備した者は吸血鬼になる。", "It makes you current_world_ptr->game_turn into a vampire permanently.");
        }
 
        if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI))
@@ -1291,7 +1304,7 @@ bool screen_object(object_type *o_ptr, BIT_FLAGS mode)
 
 /*!
  * @brief オブジェクト選択時の選択アルファベットラベルを返す /
- * Convert an inventory index into a one character label
+ * Convert an p_ptr->inventory_list index into a one character label
  * @param i プレイヤーの所持/装備オブジェクトID
  * @return 対応するアルファベット
  * @details Note that the label does NOT distinguish inven/equip.
@@ -1322,7 +1335,7 @@ INVENTORY_IDX label_to_inven(int c)
        if ((i < 0) || (i > INVEN_PACK)) return (-1);
 
        /* Empty slots can never be chosen */
-       if (!inventory[i].k_idx) return (-1);
+       if (!p_ptr->inventory_list[i].k_idx) return (-1);
 
        /* Return the index */
        return (i);
@@ -1362,7 +1375,7 @@ INVENTORY_IDX label_to_equip(int c)
        if (select_ring_slot) return is_ring_slot(i) ? i : -1;
 
        /* Empty slots can never be chosen */
-       if (!inventory[i].k_idx) return (-1);
+       if (!p_ptr->inventory_list[i].k_idx) return (-1);
 
        /* Return the index */
        return (i);
@@ -1386,8 +1399,8 @@ s16b wield_slot(object_type *o_ptr)
                case TV_POLEARM:
                case TV_SWORD:
                {
-                       if (!inventory[INVEN_RARM].k_idx) return (INVEN_RARM);
-                       if (inventory[INVEN_LARM].k_idx) return (INVEN_RARM);
+                       if (!p_ptr->inventory_list[INVEN_RARM].k_idx) return (INVEN_RARM);
+                       if (p_ptr->inventory_list[INVEN_LARM].k_idx) return (INVEN_RARM);
                        return (INVEN_LARM);
                }
 
@@ -1395,8 +1408,8 @@ s16b wield_slot(object_type *o_ptr)
                case TV_CARD:
                case TV_SHIELD:
                {
-                       if (!inventory[INVEN_LARM].k_idx) return (INVEN_LARM);
-                       if (inventory[INVEN_RARM].k_idx) return (INVEN_LARM);
+                       if (!p_ptr->inventory_list[INVEN_LARM].k_idx) return (INVEN_LARM);
+                       if (p_ptr->inventory_list[INVEN_RARM].k_idx) return (INVEN_LARM);
                        return (INVEN_RARM);
                }
 
@@ -1408,7 +1421,7 @@ s16b wield_slot(object_type *o_ptr)
                case TV_RING:
                {
                        /* Use the right hand first */
-                       if (!inventory[INVEN_RIGHT].k_idx) return (INVEN_RIGHT);
+                       if (!p_ptr->inventory_list[INVEN_RIGHT].k_idx) return (INVEN_RIGHT);
 
                        /* Use the left hand for swapping (by default) */
                        return (INVEN_LEFT);
@@ -1464,9 +1477,9 @@ s16b wield_slot(object_type *o_ptr)
  * @param i 部位表現を求めるプレイヤーの所持/装備オブジェクトID
  * @return 部位表現の文字列ポインタ
  */
-cptr mention_use(int i)
+concptr mention_use(int i)
 {
-       cptr p;
+       concptr p;
 
        /* Examine the location */
        switch (i)
@@ -1483,24 +1496,9 @@ cptr mention_use(int i)
                case INVEN_LARM:  p = p_ptr->heavy_wield[1] ? "Just lifting" : (p_ptr->hidarite ? "Wielding" : "On arm"); break;
 #endif
 
-#ifdef JP
-               case INVEN_BOW:   p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "運搬中" : "射撃用"; break;
-#else
-               case INVEN_BOW:   p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "Just holding" : "Shooting"; break;
-#endif
-
-#ifdef JP
-               case INVEN_RIGHT: p = (left_hander ? "左手指" : "右手指"); break;
-#else
-               case INVEN_RIGHT: p = (left_hander ? "On left hand" : "On right hand"); break;
-#endif
-
-#ifdef JP
-               case INVEN_LEFT:  p = (left_hander ? "右手指" : "左手指"); break;
-#else
-               case INVEN_LEFT:  p = (left_hander ? "On right hand" : "On left hand"); break;
-#endif
-
+               case INVEN_BOW:   p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < p_ptr->inventory_list[i].weight / 10) ? _("運搬中", "Just holding") : _("射撃用", "Shooting"); break;
+               case INVEN_RIGHT: p = (left_hander ? _("左手指", "On left hand") : _("右手指", "On right hand")); break;
+               case INVEN_LEFT:  p = (left_hander ? _("右手指", "On right hand") : _("左手指", "On left hand")); break;
                case INVEN_NECK:  p = _("  首", "Around neck"); break;
                case INVEN_LITE:  p = _(" 光源", "Light source"); break;
                case INVEN_BODY:  p = _("  体", "On body"); break;
@@ -1522,11 +1520,11 @@ cptr mention_use(int i)
  * @param i 状態表現を求めるプレイヤーの所持/装備オブジェクトID
  * @return 状態表現内容の文字列ポインタ
  * @details
- * Currently, only used for items in the equipment, not inventory.
+ * Currently, only used for items in the equipment, not p_ptr->inventory_list.
  */
-cptr describe_use(int i)
+concptr describe_use(int i)
 {
-       cptr p;
+       concptr p;
 
        switch (i)
        {
@@ -1542,24 +1540,9 @@ cptr describe_use(int i)
                case INVEN_LARM:  p = p_ptr->heavy_wield[1] ? "just lifting" : (p_ptr->hidarite ? "attacking monsters with" : "wearing on your arm"); break;
 #endif
 
-#ifdef JP
-               case INVEN_BOW:   p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "持つだけで精一杯の" : "射撃用に装備している"; break;
-#else
-               case INVEN_BOW:   p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < inventory[i].weight / 10) ? "just holding" : "shooting missiles with"; break;
-#endif
-
-#ifdef JP
-               case INVEN_RIGHT: p = (left_hander ? "左手の指にはめている" : "右手の指にはめている"); break;
-#else
-               case INVEN_RIGHT: p = (left_hander ? "wearing on your left hand" : "wearing on your right hand"); break;
-#endif
-
-#ifdef JP
-               case INVEN_LEFT:  p = (left_hander ? "右手の指にはめている" : "左手の指にはめている"); break;
-#else
-               case INVEN_LEFT:  p = (left_hander ? "wearing on your right hand" : "wearing on your left hand"); break;
-#endif
-
+               case INVEN_BOW:   p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < p_ptr->inventory_list[i].weight / 10) ? _("持つだけで精一杯の", "just holding") : _("射撃用に装備している", "shooting missiles with"); break;
+               case INVEN_RIGHT: p = (left_hander ? _("左手の指にはめている", "wearing on your left hand") : _("右手の指にはめている", "wearing on your right hand")); break;
+               case INVEN_LEFT:  p = (left_hander ? _("右手の指にはめている", "wearing on your right hand") : _("左手の指にはめている", "wearing on your left hand")); break;
                case INVEN_NECK:  p = _("首にかけている", "wearing around your neck"); break;
                case INVEN_LITE:  p = _("光源にしている", "using to light the way"); break;
                case INVEN_BODY:  p = _("体に着ている", "wearing on your body"); break;
@@ -1598,6 +1581,18 @@ bool check_book_realm(const OBJECT_TYPE_VALUE book_tval, const OBJECT_SUBTYPE_VA
        return (REALM1_BOOK == book_tval || REALM2_BOOK == book_tval);
 }
 
+/*
+ * Here is a "hook" used during calls to "get_item()" and
+ * "show_inven()" and "show_equip()", and the choice window routines.
+ */
+bool(*item_tester_hook)(object_type*);
+
+/*
+ * Here is a "pseudo-hook" used during calls to "get_item()" and
+ * "show_inven()" and "show_equip()", and the choice window routines.
+ */
+OBJECT_TYPE_VALUE item_tester_tval;
+
 /*!
  * @brief アイテムがitem_tester_hookグローバル関数ポインタの条件を満たしているかを返す汎用関数
  * Check an item against the item tester info
@@ -1607,7 +1602,7 @@ bool check_book_realm(const OBJECT_TYPE_VALUE book_tval, const OBJECT_SUBTYPE_VA
 bool item_tester_okay(object_type *o_ptr)
 {
        /* Hack -- allow listing empty slots */
-       if (item_tester_full) return (TRUE);
+       // if (item_tester_full) return (TRUE); // TODO:DELETE
 
        /* Require an item */
        if (!o_ptr->k_idx) return (FALSE);
@@ -1650,88 +1645,58 @@ bool item_tester_okay(object_type *o_ptr)
  */
 void display_inven(void)
 {
-       register        int i, n, z = 0;
-       object_type     *o_ptr;
-       TERM_COLOR      attr = TERM_WHITE;
-       char            tmp_val[80];
-       char            o_name[MAX_NLEN];
-       int             wid, hgt;
+       register int i, n, z = 0;
+       object_type *o_ptr;
+       TERM_COLOR attr = TERM_WHITE;
+       char tmp_val[80];
+       GAME_TEXT o_name[MAX_NLEN];
+       TERM_LEN wid, hgt;
 
        Term_get_size(&wid, &hgt);
 
-       /* Find the "final" slot */
        for (i = 0; i < INVEN_PACK; i++)
        {
-               o_ptr = &inventory[i];
-
-               /* Skip non-objects */
+               o_ptr = &p_ptr->inventory_list[i];
                if (!o_ptr->k_idx) continue;
-
-               /* Track */
                z = i + 1;
        }
 
-       /* Display the pack */
        for (i = 0; i < z; i++)
        {
-               /* Examine the item */
-               o_ptr = &inventory[i];
-
-               /* Start with an empty "index" */
+               o_ptr = &p_ptr->inventory_list[i];
                tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
-
-               /* Is this item "acceptable"? */
                if (item_tester_okay(o_ptr))
                {
-                       /* Prepare an "index" */
                        tmp_val[0] = index_to_label(i);
-
-                       /* Bracket the "index" --(-- */
                        tmp_val[1] = ')';
                }
 
-               /* Display the index (or blank space) */
                Term_putstr(0, i, 3, TERM_WHITE, tmp_val);
-
-               /* Obtain an item description */
                object_desc(o_name, o_ptr, 0);
-
-               /* Obtain the length of the description */
                n = strlen(o_name);
-
-               /* Get a color */
                attr = tval_to_attr[o_ptr->tval % 128];
-
-               /* Grey out charging items */
                if (o_ptr->timeout)
                {
                        attr = TERM_L_DARK;
                }
 
-               /* Display the entry itself */
                Term_putstr(3, i, n, attr, o_name);
-
-               /* Erase the rest of the line */
                Term_erase(3+n, i, 255);
 
-               /* Display the weight if needed */
                if (show_weights)
                {
                        int wgt = o_ptr->weight * o_ptr->number;
 #ifdef JP
-                       sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt),lbtokg2(wgt) );
+                       sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt), lbtokg2(wgt));
 #else
                        sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
 #endif
-
                        prt(tmp_val, i, wid - 9);
                }
        }
 
-       /* Erase the rest of the window */
        for (i = z; i < hgt; i++)
        {
-               /* Erase the line */
                Term_erase(0, i, 255);
        }
 }
@@ -1745,38 +1710,26 @@ void display_inven(void)
  */
 void display_equip(void)
 {
-       register        int i, n;
-       object_type     *o_ptr;
-       TERM_COLOR      attr = TERM_WHITE;
-       char            tmp_val[80];
-       char            o_name[MAX_NLEN];
-       int             wid, hgt;
+       register int i, n;
+       object_type *o_ptr;
+       TERM_COLOR attr = TERM_WHITE;
+       char tmp_val[80];
+       GAME_TEXT o_name[MAX_NLEN];
+       TERM_LEN wid, hgt;
 
        Term_get_size(&wid, &hgt);
 
-       /* Display the equipment */
        for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
        {
-               /* Examine the item */
-               o_ptr = &inventory[i];
-
-               /* Start with an empty "index" */
+               o_ptr = &p_ptr->inventory_list[i];
                tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
-
-               /* Is this item "acceptable"? */
                if (select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr))
                {
-                       /* Prepare an "index" */
                        tmp_val[0] = index_to_label(i);
-
-                       /* Bracket the "index" --(-- */
                        tmp_val[1] = ')';
                }
 
-               /* Display the index (or blank space) */
                Term_putstr(0, i - INVEN_RARM, 3, TERM_WHITE, tmp_val);
-
-               /* Obtain an item description */
                if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
                {
                        strcpy(o_name, _("(武器を両手持ち)", "(wielding with two-hands)"));
@@ -1788,22 +1741,15 @@ void display_equip(void)
                        attr = tval_to_attr[o_ptr->tval % 128];
                }
 
-               /* Obtain the length of the description */
                n = strlen(o_name);
-
-               /* Grey out charging items */
                if (o_ptr->timeout)
                {
                        attr = TERM_L_DARK;
                }
-
-               /* Display the entry itself */
                Term_putstr(3, i - INVEN_RARM, n, attr, o_name);
 
-               /* Erase the rest of the line */
-               Term_erase(3+n, i - INVEN_RARM, 255);
+               Term_erase(3 + n, i - INVEN_RARM, 255);
 
-               /* Display the weight (if needed) */
                if (show_weights)
                {
                        int wgt = o_ptr->weight * o_ptr->number;
@@ -1816,7 +1762,6 @@ void display_equip(void)
                        prt(tmp_val, i - INVEN_RARM, wid - (show_labels ? 28 : 9));
                }
 
-               /* Display the slot description (if needed) */
                if (show_labels)
                {
                        Term_putstr(wid - 20, i - INVEN_RARM, -1, TERM_WHITE, " <-- ");
@@ -1824,10 +1769,8 @@ void display_equip(void)
                }
        }
 
-       /* Erase the rest of the window */
        for (i = INVEN_TOTAL - INVEN_RARM; i < hgt; i++)
        {
-               /* Clear that line */
                Term_erase(0, i, 255);
        }
 }
@@ -1835,7 +1778,7 @@ void display_equip(void)
 
 /*!
  * @brief 所持/装備オブジェクトに選択タグを与える/タグに該当するオブジェクトがあるかを返す /
- * Find the "first" inventory object with the given "tag".
+ * Find the "first" p_ptr->inventory_list object with the given "tag".
  * @param cp 対応するタグIDを与える参照ポインタ
  * @param tag 該当するオブジェクトがあるかを調べたいタグ
  * @param mode 所持、装備の切り替え
@@ -1852,7 +1795,7 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
 {
        COMMAND_CODE i;
        COMMAND_CODE start, end;
-       cptr s;
+       concptr s;
 
        /* Extract index from mode */
        switch (mode)
@@ -1873,19 +1816,17 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
 
        /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
 
-       /* Check every inventory object */
+       /* Check every p_ptr->inventory_list object */
        for (i = start; i <= end; i++)
        {
-               object_type *o_ptr = &inventory[i];
-
-               /* Skip non-objects */
+               object_type *o_ptr = &p_ptr->inventory_list[i];
                if (!o_ptr->k_idx) continue;
 
                /* Skip empty inscriptions */
                if (!o_ptr->inscription) continue;
 
                /* Skip non-choice */
-               if (!item_tester_okay(o_ptr)) continue;
+               if (!item_tester_okay(o_ptr) && !(mode & USE_FULL)) continue;
 
                /* Find a '@' */
                s = my_strchr(quark_str(o_ptr->inscription), '@');
@@ -1896,7 +1837,7 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
                        /* Check the special tags */
                        if ((s[1] == command_cmd) && (s[2] == tag))
                        {
-                               /* Save the actual inventory ID */
+                               /* Save the actual p_ptr->inventory_list ID */
                                *cp = i;
 
                                /* Success */
@@ -1921,16 +1862,14 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
        /* Check every object */
        for (i = start; i <= end; i++)
        {
-               object_type *o_ptr = &inventory[i];
-
-               /* Skip non-objects */
+               object_type *o_ptr = &p_ptr->inventory_list[i];
                if (!o_ptr->k_idx) continue;
 
                /* Skip empty inscriptions */
                if (!o_ptr->inscription) continue;
 
                /* Skip non-choice */
-               if (!item_tester_okay(o_ptr)) continue;
+               if (!item_tester_okay(o_ptr) && !(mode & USE_FULL)) continue;
 
                /* Find a '@' */
                s = my_strchr(quark_str(o_ptr->inscription), '@');
@@ -1941,7 +1880,7 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
                        /* Check the normal tags */
                        if (s[1] == tag)
                        {
-                               /* Save the actual inventory ID */
+                               /* Save the actual p_ptr->inventory_list ID */
                                *cp = i;
 
                                /* Success */
@@ -1960,7 +1899,7 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
 
 /*!
  * @brief 床オブジェクトに選択タグを与える/タグに該当するオブジェクトがあるかを返す /
- * Find the "first" inventory object with the given "tag".
+ * Find the "first" p_ptr->inventory_list object with the given "tag".
  * @param cp 対応するタグIDを与える参照ポインタ
  * @param tag 該当するオブジェクトがあるかを調べたいタグ
  * @param floor_list 床上アイテムの配列
@@ -1977,14 +1916,14 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
 static bool get_tag_floor(COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
 {
        COMMAND_CODE i;
-       cptr s;
+       concptr s;
 
        /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
 
        /* Check every object in the grid */
        for (i = 0; i < floor_num && i < 23; i++)
        {
-               object_type *o_ptr = &o_list[floor_list[i]];
+               object_type *o_ptr = &current_floor_ptr->o_list[floor_list[i]];
 
                /* Skip empty inscriptions */
                if (!o_ptr->inscription) continue;
@@ -2023,7 +1962,7 @@ static bool get_tag_floor(COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], IT
        /* Check every object in the grid */
        for (i = 0; i < floor_num && i < 23; i++)
        {
-               object_type *o_ptr = &o_list[floor_list[i]];
+               object_type *o_ptr = &current_floor_ptr->o_list[floor_list[i]];
 
                /* Skip empty inscriptions */
                if (!o_ptr->inscription) continue;
@@ -2063,7 +2002,7 @@ static bool get_tag_floor(COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], IT
  */
 static void prepare_label_string(char *label, BIT_FLAGS mode)
 {
-       cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+       concptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        int  offset = (mode == USE_EQUIP) ? INVEN_RARM : 0;
        int  i;
 
@@ -2074,7 +2013,7 @@ static void prepare_label_string(char *label, BIT_FLAGS mode)
        for (i = 0; i < 52; i++)
        {
                COMMAND_CODE index;
-               char c = alphabet_chars[i];
+               SYMBOL_CODE c = alphabet_chars[i];
 
                /* Find a tag with this label */
                if (get_tag(&index, c, mode))
@@ -2101,7 +2040,7 @@ static void prepare_label_string(char *label, BIT_FLAGS mode)
  */
 static void prepare_label_string_floor(char *label, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
 {
-       cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+       concptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        int  i;
 
        /* Prepare normal labels */
@@ -2111,7 +2050,7 @@ static void prepare_label_string_floor(char *label, FLOOR_IDX floor_list[], ITEM
        for (i = 0; i < 52; i++)
        {
                COMMAND_CODE index;
-               char c = alphabet_chars[i];
+               SYMBOL_CODE c = alphabet_chars[i];
 
                /* Find a tag with this label */
                if (get_tag_floor(&index, c, floor_list, floor_num))
@@ -2128,26 +2067,26 @@ static void prepare_label_string_floor(char *label, FLOOR_IDX floor_list[], ITEM
 
 /*!
  * @brief 所持アイテムの表示を行う /
- * Display the inventory.
+ * Display the p_ptr->inventory_list.
  * @param target_item アイテムの選択処理を行うか否か。
  * @return 選択したアイテムのタグ
  * @details
  * Hack -- do not display "trailing" empty slots
  */
-COMMAND_CODE show_inven(int target_item)
+COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode)
 {
        COMMAND_CODE i;
        int j, k, l, z = 0;
        int             col, cur_col, len;
-       object_type     *o_ptr;
-       char            o_name[MAX_NLEN];
+       object_type *o_ptr;
+       GAME_TEXT o_name[MAX_NLEN];
        char            tmp_val[80];
        COMMAND_CODE    out_index[23];
        TERM_COLOR      out_color[23];
        char            out_desc[23][MAX_NLEN];
        COMMAND_CODE target_item_label = 0;
        TERM_LEN wid, hgt;
-       char            inven_label[52 + 1];
+       char inven_label[52 + 1];
 
        /* Starting column */
        col = command_gap;
@@ -2161,9 +2100,7 @@ COMMAND_CODE show_inven(int target_item)
        /* Find the "final" slot */
        for (i = 0; i < INVEN_PACK; i++)
        {
-               o_ptr = &inventory[i];
-
-               /* Skip non-objects */
+               o_ptr = &p_ptr->inventory_list[i];
                if (!o_ptr->k_idx) continue;
 
                /* Track */
@@ -2172,13 +2109,13 @@ COMMAND_CODE show_inven(int target_item)
 
        prepare_label_string(inven_label, USE_INVEN);
 
-       /* Display the inventory */
+       /* Display the p_ptr->inventory_list */
        for (k = 0, i = 0; i < z; i++)
        {
-               o_ptr = &inventory[i];
+               o_ptr = &p_ptr->inventory_list[i];
 
                /* Is this item acceptable? */
-               if (!item_tester_okay(o_ptr)) continue;
+               if (!item_tester_okay(o_ptr) && !(mode & USE_FULL)) continue;
 
                object_desc(o_name, o_ptr, 0);
 
@@ -2220,10 +2157,8 @@ COMMAND_CODE show_inven(int target_item)
        /* Output each entry */
        for (j = 0; j < k; j++)
        {
-               /* Get the index */
                i = out_index[j];
-
-               o_ptr = &inventory[i];
+               o_ptr = &p_ptr->inventory_list[i];
 
                /* Clear the line */
                prt("", j + 1, col ? col - 2 : col);
@@ -2256,8 +2191,8 @@ COMMAND_CODE show_inven(int target_item)
                /* Display graphics for object, if desired */
                if (show_item_graph)
                {
-                       byte  a = object_attr(o_ptr);
-                       char c = object_char(o_ptr);
+                       TERM_COLOR a = object_attr(o_ptr);
+                       SYMBOL_CODE c = object_char(o_ptr);
                        Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
                        if (use_bigtile) cur_col++;
 
@@ -2298,14 +2233,14 @@ COMMAND_CODE show_inven(int target_item)
  * @param target_item アイテムの選択処理を行うか否か。
  * @return 選択したアイテムのタグ
  */
-COMMAND_CODE show_equip(int target_item)
+COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode)
 {
        COMMAND_CODE i;
        int j, k, l;
        int             col, cur_col, len;
-       object_type     *o_ptr;
+       object_type *o_ptr;
        char            tmp_val[80];
-       char            o_name[MAX_NLEN];
+       GAME_TEXT o_name[MAX_NLEN];
        COMMAND_CODE    out_index[23];
        TERM_COLOR      out_color[23];
        char            out_desc[23][MAX_NLEN];
@@ -2325,14 +2260,13 @@ COMMAND_CODE show_equip(int target_item)
        /* Scan the equipment list */
        for (k = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
        {
-               o_ptr = &inventory[i];
+               o_ptr = &p_ptr->inventory_list[i];
 
                /* Is this item acceptable? */
-               if (!(select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr)) &&
+               if (!(select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr) || (mode & USE_FULL)) &&
                    (!((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute) ||
-                    item_tester_no_ryoute)) continue;
+                               (mode & IGNORE_BOTHHAND_SLOT))) continue;
 
-               /* Description */
                object_desc(o_name, o_ptr, 0);
 
                if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
@@ -2393,10 +2327,8 @@ COMMAND_CODE show_equip(int target_item)
        /* Output each entry */
        for (j = 0; j < k; j++)
        {
-               /* Get the index */
                i = out_index[j];
-
-               o_ptr = &inventory[i];
+               o_ptr = &p_ptr->inventory_list[i];
 
                /* Clear the line */
                prt("", j + 1, col ? col - 2 : col);
@@ -2415,7 +2347,7 @@ COMMAND_CODE show_equip(int target_item)
                        /* Prepare an index --(-- */
                        sprintf(tmp_val, "%c)", equip_label[i - INVEN_RARM]);
                }
-               else /* Paranoia */
+               else
                {
                        /* Prepare an index --(-- */
                        sprintf(tmp_val, "%c)", index_to_label(i));
@@ -2429,8 +2361,8 @@ COMMAND_CODE show_equip(int target_item)
                /* Display graphics for object, if desired */
                if (show_item_graph)
                {
-                       byte a = object_attr(o_ptr);
-                       char c = object_char(o_ptr);
+                       TERM_COLOR a = object_attr(o_ptr);
+                       SYMBOL_CODE c = object_char(o_ptr);
                        Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
                        if (use_bigtile) cur_col++;
 
@@ -2524,9 +2456,9 @@ void toggle_inven_equip(void)
  * @return 確認がYesならTRUEを返す。
  * @details The item can be negative to mean "item on floor".
  */
-static bool verify(cptr prompt, INVENTORY_IDX item)
+static bool verify(concptr prompt, INVENTORY_IDX item)
 {
-       char        o_name[MAX_NLEN];
+       GAME_TEXT o_name[MAX_NLEN];
        char        out_val[MAX_NLEN+20];
        object_type *o_ptr;
 
@@ -2534,13 +2466,13 @@ static bool verify(cptr prompt, INVENTORY_IDX item)
        /* Inventory */
        if (item >= 0)
        {
-               o_ptr = &inventory[item];
+               o_ptr = &p_ptr->inventory_list[item];
        }
 
        /* Floor */
        else
        {
-               o_ptr = &o_list[0 - item];
+               o_ptr = &current_floor_ptr->o_list[0 - item];
        }
        object_desc(o_name, o_ptr, 0);
 
@@ -2561,20 +2493,20 @@ static bool verify(cptr prompt, INVENTORY_IDX item)
  */
 static bool get_item_allow(INVENTORY_IDX item)
 {
-       cptr s;
+       concptr s;
        object_type *o_ptr;
        if (!command_cmd) return TRUE; /* command_cmd is no longer effective */
 
        /* Inventory */
        if (item >= 0)
        {
-               o_ptr = &inventory[item];
+               o_ptr = &p_ptr->inventory_list[item];
        }
 
        /* Floor */
        else
        {
-               o_ptr = &o_list[0 - item];
+               o_ptr = &current_floor_ptr->o_list[0 - item];
        }
 
        /* No inscription */
@@ -2616,7 +2548,7 @@ static bool get_item_okay(OBJECT_IDX i)
        if (select_ring_slot) return is_ring_slot(i);
 
        /* Verify the item */
-       if (!item_tester_okay(&inventory[i])) return (FALSE);
+       if (!item_tester_okay(&p_ptr->inventory_list[i])) return (FALSE);
 
        /* Assume okay */
        return (TRUE);
@@ -2635,7 +2567,7 @@ bool can_get_item(void)
        ITEM_NUMBER floor_num = 0;
 
        for (j = 0; j < INVEN_TOTAL; j++)
-               if (item_tester_okay(&inventory[j]))
+               if (item_tester_okay(&p_ptr->inventory_list[j]))
                        return TRUE;
 
        floor_num = scan_floor(floor_list, p_ptr->y, p_ptr->x, 0x03);
@@ -2661,10 +2593,10 @@ bool can_get_item(void)
  * All "item_tester" restrictions are cleared before this function returns.\n
  *\n
  * The user is allowed to choose acceptable items from the equipment,\n
- * inventory, or floor, respectively, if the proper flag was given,\n
+ * p_ptr->inventory_list, or floor, respectively, if the proper flag was given,\n
  * and there are any acceptable items in that location.\n
  *\n
- * The equipment or inventory are displayed (even if no acceptable\n
+ * The equipment or p_ptr->inventory_list are displayed (even if no acceptable\n
  * items are in that location) if the proper flag was given.\n
  *\n
  * If there are no acceptable items available anywhere, and "str" is\n
@@ -2673,10 +2605,10 @@ bool can_get_item(void)
  *\n
  * Note that the user must press "-" to specify the item on the floor,\n
  * and there is no way to "examine" the item on the floor, while the\n
- * use of "capital" letters will "examine" an inventory/equipment item,\n
+ * use of "capital" letters will "examine" an p_ptr->inventory_list/equipment item,\n
  * and prompt for its use.\n
  *\n
- * If a legal item is selected from the inventory, we save it in "cp"\n
+ * If a legal item is selected from the p_ptr->inventory_list, we save it in "cp"\n
  * directly (0 to 35), and return TRUE.\n
  *\n
  * If a legal item is selected from the floor, we save it in "cp" as\n
@@ -2687,7 +2619,7 @@ bool can_get_item(void)
  *\n
  * If no item is selected, we do nothing to "cp", and return FALSE.\n
  *\n
- * Global "p_ptr->command_new" is used when viewing the inventory or equipment\n
+ * Global "p_ptr->command_new" is used when viewing the p_ptr->inventory_list or equipment\n
  * to allow the user to enter a command while viewing those screens, and\n
  * also to induce "auto-enter" of stores, and other such stuff.\n
  *\n
@@ -2695,12 +2627,12 @@ bool can_get_item(void)
  * out in "browse" mode.  It is cleared before this function returns.\n
  *\n
  * Global "p_ptr->command_wrk" is used to choose between equip/inven listings.\n
- * If it is TRUE then we are viewing inventory, else equipment.\n
+ * If it is TRUE then we are viewing p_ptr->inventory_list, else equipment.\n
  *\n
  * We always erase the prompt when we are done, leaving a blank line,\n
  * or a warning message, if appropriate, if no items are available.\n
  */
-bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
+bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode)
 {
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
@@ -2726,9 +2658,6 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        char tmp_val[160];
        char out_val[160];
 
-       /* See cmd5.c */
-       extern bool select_the_force;
-
        int menu_line = (use_menu ? 1 : 0);
        int max_inven = 0;
        int max_equip = 0;
@@ -2747,7 +2676,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        if (repeat_pull(cp))
        {
                /* the_force */
-               if (select_the_force && (*cp == INVEN_FORCE))
+               if (mode & USE_FORCE && (*cp == INVEN_FORCE))
                {
                        item_tester_tval = 0;
                        item_tester_hook = NULL;
@@ -2762,10 +2691,10 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
 
                        /* Special index */
                        k = 0 - (*cp);
-                       o_ptr = &o_list[k];
+                       o_ptr = &current_floor_ptr->o_list[k];
 
                        /* Validate the item */
-                       if (item_tester_okay(o_ptr))
+                       if (item_tester_okay(o_ptr) || (mode & USE_FULL))
                        {
                                /* Forget restrictions */
                                item_tester_tval = 0;
@@ -2816,8 +2745,6 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        }
                }
        }
-
-       /* Paranoia */
        msg_print(NULL);
 
        /* Not done */
@@ -2827,19 +2754,19 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        item = FALSE;
 
 
-       /* Full inventory */
+       /* Full p_ptr->inventory_list */
        i1 = 0;
        i2 = INVEN_PACK - 1;
 
-       /* Forbid inventory */
+       /* Forbid p_ptr->inventory_list */
        if (!inven) i2 = -1;
        else if (use_menu)
        {
                for (j = 0; j < INVEN_PACK; j++)
-                       if (item_tester_okay(&inventory[j])) max_inven++;
+                       if (item_tester_okay(&p_ptr->inventory_list[j]) || (mode & USE_FULL)) max_inven++;
        }
 
-       /* Restrict inventory indexes */
+       /* Restrict p_ptr->inventory_list indexes */
        while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
        while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
 
@@ -2853,15 +2780,15 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        else if (use_menu)
        {
                for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
-                       if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
-               if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
+                       if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&p_ptr->inventory_list[j]) || (mode & USE_FULL)) max_equip++;
+               if (p_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT)) max_equip++;
        }
 
        /* Restrict equipment indexes */
        while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
        while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
 
-       if (equip && p_ptr->ryoute && !item_tester_no_ryoute)
+       if (equip && p_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT))
        {
                if (p_ptr->migite)
                {
@@ -2875,16 +2802,14 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        if (floor)
        {
                /* Scan all objects in the grid */
-               for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+               for (this_o_idx = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
                {
                        object_type *o_ptr;
-                       o_ptr = &o_list[this_o_idx];
-
-                       /* Acquire next object */
+                       o_ptr = &current_floor_ptr->o_list[this_o_idx];
                        next_o_idx = o_ptr->next_o_idx;
 
                        /* Accept the item on the floor if legal */
-                       if (item_tester_okay(o_ptr) && (o_ptr->marked & OM_FOUND)) allow_floor = TRUE;
+                       if ((item_tester_okay(o_ptr) || (mode & USE_FULL)) && (o_ptr->marked & OM_FOUND)) allow_floor = TRUE;
                }
        }
 
@@ -2893,12 +2818,10 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        {
                /* Cancel p_ptr->command_see */
                command_see = FALSE;
-
                oops = TRUE;
-
                done = TRUE;
 
-               if (select_the_force) {
+               if (mode & USE_FORCE) {
                    *cp = INVEN_FORCE;
                    item = TRUE;
                }
@@ -2913,7 +2836,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        command_wrk = TRUE;
                }
 
-               /* Use inventory if allowed */
+               /* Use p_ptr->inventory_list if allowed */
                else if (inven)
                {
                        command_wrk = FALSE;
@@ -2925,7 +2848,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        command_wrk = TRUE;
                }
 
-               /* Use inventory for floor */
+               /* Use p_ptr->inventory_list for floor */
                else
                {
                        command_wrk = FALSE;
@@ -2984,17 +2907,17 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                if (!command_wrk)
                {
                        /* Redraw if needed */
-                       if (command_see) get_item_label = show_inven(menu_line);
+                       if (command_see) get_item_label = show_inven(menu_line, mode);
                }
 
                /* Equipment screen */
                else
                {
                        /* Redraw if needed */
-                       if (command_see) get_item_label = show_equip(menu_line);
+                       if (command_see) get_item_label = show_equip(menu_line, mode);
                }
 
-               /* Viewing inventory */
+               /* Viewing p_ptr->inventory_list */
                if (!command_wrk)
                {
                        /* Begin the prompt */
@@ -3015,11 +2938,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        if (!command_see && !use_menu) strcat(out_val, _(" '*'一覧,", " * to see,"));
 
                        /* Append */
-#ifdef JP
-                       if (equip) strcat(out_val, format(" %s 装備品,", use_menu ? "'4'or'6'" : "'/'"));
-#else
-                       if (equip) strcat(out_val, format(" %s for Equip,", use_menu ? "4 or 6" : "/"));
-#endif
+                       if (equip) strcat(out_val, format(_(" %s 装備品,", " %s for Equip,"), use_menu ? _("'4'or'6'", "4 or 6") : _("'/'", "/")));
                }
 
                /* Viewing equipment */
@@ -3043,16 +2962,12 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        if (!command_see && !use_menu) strcat(out_val, _(" '*'一覧,", " * to see,"));
 
                        /* Append */
-#ifdef JP
-                       if (inven) strcat(out_val, format(" %s 持ち物,", use_menu ? "'4'or'6'" : "'/'"));
-#else
-                       if (inven) strcat(out_val, format(" %s for Inven,", use_menu ? "4 or 6" : "'/'"));
-#endif
+                       if (inven) strcat(out_val, format(_(" %s 持ち物,", " %s for Inven,"), use_menu ? _("'4'or'6'", "4 or 6") : _("'/'", "'/'")));
                }
 
                /* Indicate legality of the "floor" item */
                if (allow_floor) strcat(out_val, _(" '-'床上,", " - for floor,"));
-               if (select_the_force) strcat(out_val, _(" 'w'練気術,", " w for the Force,"));
+               if (mode & USE_FORCE) strcat(out_val, _(" 'w'練気術,", " w for the Force,"));
 
                /* Finish the prompt */
                strcat(out_val, " ESC");
@@ -3162,7 +3077,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        }
                        case 'w':
                        {
-                               if (select_the_force) {
+                               if (mode & USE_FORCE) {
                                        *cp = INVEN_FORCE;
                                        item = TRUE;
                                        done = TRUE;
@@ -3235,16 +3150,14 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                if (allow_floor)
                                {
                                        /* Scan all objects in the grid */
-                                       for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+                                       for (this_o_idx = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
                                        {
                                                object_type *o_ptr;
-                                               o_ptr = &o_list[this_o_idx];
-
-                                               /* Acquire next object */
+                                               o_ptr = &current_floor_ptr->o_list[this_o_idx];
                                                next_o_idx = o_ptr->next_o_idx;
 
                                                /* Validate the item */
-                                               if (!item_tester_okay(o_ptr)) continue;
+                                               if (!item_tester_okay(o_ptr) && !(mode & USE_FULL)) continue;
 
                                                /* Special index */
                                                k = 0 - this_o_idx;
@@ -3315,7 +3228,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        case '\n':
                        case '\r':
                        {
-                               /* Choose "default" inventory item */
+                               /* Choose "default" p_ptr->inventory_list item */
                                if (!command_wrk)
                                {
                                        k = ((i1 == i2) ? i1 : -1);
@@ -3351,7 +3264,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
 
                        case 'w':
                        {
-                               if (select_the_force) {
+                               if (mode & USE_FORCE) {
                                        *cp = INVEN_FORCE;
                                        item = TRUE;
                                        done = TRUE;
@@ -3398,7 +3311,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                ver = isupper(which);
                                which = (char)tolower(which);
 
-                               /* Convert letter to inventory index */
+                               /* Convert letter to p_ptr->inventory_list index */
                                if (!command_wrk)
                                {
                                        if (which == '(') k = i1;
@@ -3459,8 +3372,6 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        /* Forget the item_tester_tval restriction */
        item_tester_tval = 0;
 
-       item_tester_no_ryoute = FALSE;
-
        /* Forget the item_tester_hook restriction */
        item_tester_hook = NULL;
 
@@ -3490,17 +3401,19 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
 /*
  * Choose an item and get auto-picker entry from it.
  */
-object_type *choose_object(OBJECT_IDX *idx, cptr q, cptr s, BIT_FLAGS option)
+object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option)
 {
        OBJECT_IDX item;
        if (!get_item(&item, q, s, option)) return NULL;
        if (idx) *idx = item;
 
+       if (item == INVEN_FORCE) return NULL;
+
        /* Get the item (in the pack) */
-       if (item >= 0) return &inventory[item];
+       else if (item >= 0) return &p_ptr->inventory_list[item];
 
        /* Get the item (on the floor) */
-       else return &o_list[0 - item];
+       else return &current_floor_ptr->o_list[0 - item];
 }
 
 
@@ -3512,7 +3425,7 @@ object_type *choose_object(OBJECT_IDX *idx, cptr q, cptr s, BIT_FLAGS option)
  * @param mode オプションフラグ
  * @return 対象のマスに落ちているアイテム数
  * @details
- * Return a list of o_list[] indexes of items at the given cave
+ * Return a list of o_list[] indexes of items at the given current_floor_ptr->grid_array
  * location. Valid flags are:
  *
  *             mode & 0x01 -- Item tester
@@ -3529,12 +3442,10 @@ ITEM_NUMBER scan_floor(OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode
        if (!in_bounds(y, x)) return 0;
 
        /* Scan all objects in the grid */
-       for (this_o_idx = cave[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+       for (this_o_idx = current_floor_ptr->grid_array[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
        {
                object_type *o_ptr;
-               o_ptr = &o_list[this_o_idx];
-
-               /* Acquire next object */
+               o_ptr = &current_floor_ptr->o_list[this_o_idx];
                next_o_idx = o_ptr->next_o_idx;
 
                /* Item tester */
@@ -3574,7 +3485,7 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_w
 
        object_type *o_ptr;
 
-       char o_name[MAX_NLEN];
+       GAME_TEXT o_name[MAX_NLEN];
        char tmp_val[80];
 
        COMMAND_CODE out_index[23];
@@ -3600,14 +3511,14 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_w
        /* Display the floor objects */
        for (k = 0, i = 0; i < floor_num && i < 23; i++)
        {
-               o_ptr = &o_list[floor_list[i]];
+               o_ptr = &current_floor_ptr->o_list[floor_list[i]];
 
                object_desc(o_name, o_ptr, 0);
 
                /* Save the index */
                out_index[k] = i;
 
-               /* Acquire inventory color */
+               /* Acquire p_ptr->inventory_list color */
                out_color[k] = tval_to_attr[o_ptr->tval & 0x7F];
 
                /* Save the object description */
@@ -3641,10 +3552,8 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_w
        /* Output each entry */
        for (j = 0; j < k; j++)
        {
-               /* Get the index */
                m = floor_list[out_index[j]];
-
-               o_ptr = &o_list[m];
+               o_ptr = &current_floor_ptr->o_list[m];
 
                /* Clear the line */
                prt("", j + 1, col ? col - 2 : col);
@@ -3699,7 +3608,7 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_w
  * @param mode オプションフラグ
  * @return プレイヤーによりアイテムが選択されたならTRUEを返す。/
  */
-bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
+bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
 {
        char n1 = ' ', n2 = ' ', which = ' ';
 
@@ -3716,6 +3625,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        bool equip = (mode & USE_EQUIP) ? TRUE : FALSE;
        bool inven = (mode & USE_INVEN) ? TRUE : FALSE;
        bool floor = (mode & USE_FLOOR) ? TRUE : FALSE;
+       bool force = (mode & USE_FORCE) ? TRUE : FALSE;
 
        bool allow_equip = FALSE;
        bool allow_inven = FALSE;
@@ -3731,8 +3641,6 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        int floor_top = 0;
        TERM_LEN min_width = 0;
 
-       extern bool select_the_force;
-
        int menu_line = (use_menu ? 1 : 0);
        int max_inven = 0;
        int max_equip = 0;
@@ -3744,7 +3652,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        if (repeat_pull(cp))
        {
                /* the_force */
-               if (select_the_force && (*cp == INVEN_FORCE))
+               if (force && (*cp == INVEN_FORCE))
                {
                        item_tester_tval = 0;
                        item_tester_hook = NULL;
@@ -3779,7 +3687,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        }
 
                        /* Validate the item */
-                       else if (item_tester_okay(&o_list[0 - (*cp)]))
+                       else if (item_tester_okay(&current_floor_ptr->o_list[0 - (*cp)]) || (mode & USE_FULL))
                        {
                                /* Forget restrictions */
                                item_tester_tval = 0;
@@ -3831,8 +3739,6 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                }
        }
 
-
-       /* Paranoia */
        msg_print(NULL);
 
 
@@ -3843,19 +3749,19 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        item = FALSE;
 
 
-       /* Full inventory */
+       /* Full p_ptr->inventory_list */
        i1 = 0;
        i2 = INVEN_PACK - 1;
 
-       /* Forbid inventory */
+       /* Forbid p_ptr->inventory_list */
        if (!inven) i2 = -1;
        else if (use_menu)
        {
                for (j = 0; j < INVEN_PACK; j++)
-                       if (item_tester_okay(&inventory[j])) max_inven++;
+                       if (item_tester_okay(&p_ptr->inventory_list[j]) || (mode & USE_FULL)) max_inven++;
        }
 
-       /* Restrict inventory indexes */
+       /* Restrict p_ptr->inventory_list indexes */
        while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
        while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
 
@@ -3869,15 +3775,15 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        else if (use_menu)
        {
                for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
-                       if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
-               if (p_ptr->ryoute && !item_tester_no_ryoute) max_equip++;
+                       if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&p_ptr->inventory_list[j]) || (mode & USE_FULL)) max_equip++;
+               if (p_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT)) max_equip++;
        }
 
        /* Restrict equipment indexes */
        while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
        while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
 
-       if (equip && p_ptr->ryoute && !item_tester_no_ryoute)
+       if (equip && p_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT))
        {
                if (p_ptr->migite)
                {
@@ -3897,7 +3803,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                floor_num = scan_floor(floor_list, p_ptr->y, p_ptr->x, 0x03);
        }
 
-       /* Accept inventory */
+       /* Accept p_ptr->inventory_list */
        if (i1 <= i2) allow_inven = TRUE;
 
        /* Accept equipment */
@@ -3911,12 +3817,10 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        {
                /* Cancel p_ptr->command_see */
                command_see = FALSE;
-
                oops = TRUE;
-
                done = TRUE;
 
-               if (select_the_force) {
+               if (force) {
                    *cp = INVEN_FORCE;
                    item = TRUE;
                }
@@ -3932,7 +3836,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        command_wrk = (USE_EQUIP);
                }
 
-               /* Use inventory if allowed */
+               /* Use p_ptr->inventory_list if allowed */
                else if (allow_inven)
                {
                        command_wrk = (USE_INVEN);
@@ -4006,7 +3910,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        n2 = I2A(i2);
 
                        /* Redraw if needed */
-                       if (command_see) get_item_label = show_inven(menu_line);
+                       if (command_see) get_item_label = show_inven(menu_line, mode);
                }
 
                /* Equipment screen */
@@ -4017,7 +3921,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        n2 = I2A(e2 - INVEN_RARM);
 
                        /* Redraw if needed */
-                       if (command_see) get_item_label = show_equip(menu_line);
+                       if (command_see) get_item_label = show_equip(menu_line, mode);
                }
 
                /* Floor screen */
@@ -4034,7 +3938,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        if (command_see) get_item_label = show_floor(menu_line, p_ptr->y, p_ptr->x, &min_width);
                }
 
-               /* Viewing inventory */
+               /* Viewing p_ptr->inventory_list */
                if (command_wrk == (USE_INVEN))
                {
                        /* Begin the prompt */
@@ -4169,7 +4073,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                }
 
                /* Append */
-               if (select_the_force) strcat(out_val, _(" 'w'練気術,", " w for the Force,"));
+               if (force) strcat(out_val, _(" 'w'練気術,", " w for the Force,"));
 
                /* Finish the prompt */
                strcat(out_val, " ESC");
@@ -4368,7 +4272,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        }
                        case 'w':
                        {
-                               if (select_the_force) {
+                               if (force) {
                                        *cp = INVEN_FORCE;
                                        item = TRUE;
                                        done = TRUE;
@@ -4418,26 +4322,26 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        {
                                int i;
                                OBJECT_IDX o_idx;
-                               cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
+                               grid_type *g_ptr = &current_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
 
                                if (command_wrk != (USE_FLOOR)) break;
 
                                /* Get the object being moved. */
-                               o_idx = c_ptr->o_idx;
+                               o_idx = g_ptr->o_idx;
 
                                /* Only rotate a pile of two or more objects. */
-                               if (!(o_idx && o_list[o_idx].next_o_idx)) break;
+                               if (!(o_idx && current_floor_ptr->o_list[o_idx].next_o_idx)) break;
 
                                /* Remove the first object from the list. */
                                excise_object_idx(o_idx);
 
                                /* Find end of the list. */
-                               i = c_ptr->o_idx;
-                               while (o_list[i].next_o_idx)
-                                       i = o_list[i].next_o_idx;
+                               i = g_ptr->o_idx;
+                               while (current_floor_ptr->o_list[i].next_o_idx)
+                                       i = current_floor_ptr->o_list[i].next_o_idx;
 
                                /* Add after the last object. */
-                               o_list[i].next_o_idx = o_idx;
+                               current_floor_ptr->o_list[i].next_o_idx = o_idx;
 
                                /* Re-scan floor list */ 
                                floor_num = scan_floor(floor_list, p_ptr->y, p_ptr->x, 0x03);
@@ -4612,7 +4516,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        case '\n':
                        case '\r':
                        {
-                               /* Choose "default" inventory item */
+                               /* Choose "default" p_ptr->inventory_list item */
                                if (command_wrk == (USE_INVEN))
                                {
                                        k = ((i1 == i2) ? i1 : -1);
@@ -4671,7 +4575,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
 
                        case 'w':
                        {
-                               if (select_the_force) {
+                               if (force) {
                                        *cp = INVEN_FORCE;
                                        item = TRUE;
                                        done = TRUE;
@@ -4738,7 +4642,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                ver = isupper(which);
                                which = (char)tolower(which);
 
-                               /* Convert letter to inventory index */
+                               /* Convert letter to p_ptr->inventory_list index */
                                if (command_wrk == (USE_INVEN))
                                {
                                        if (which == '(') k = i1;
@@ -4847,9 +4751,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
 static bool py_pickup_floor_aux(void)
 {
        OBJECT_IDX this_o_idx;
-
-       cptr q, s;
-
+       concptr q, s;
        OBJECT_IDX item;
 
        /* Restrict the choices */
@@ -4859,7 +4761,7 @@ static bool py_pickup_floor_aux(void)
        q = _("どれを拾いますか?", "Get which item? ");
        s = _("もうザックには床にあるどのアイテムも入らない。", "You no longer have any room for the objects on the floor.");
 
-       if (get_item(&item, q, s, (USE_FLOOR)))
+       if (choose_object(&item, q, s, (USE_FLOOR)))
        {
                this_o_idx = 0 - item;
        }
@@ -4885,7 +4787,7 @@ void py_pickup_floor(bool pickup)
 {
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
-       char o_name[MAX_NLEN];
+       GAME_TEXT o_name[MAX_NLEN];
        object_type *o_ptr;
 
        int floor_num = 0;
@@ -4894,17 +4796,16 @@ void py_pickup_floor(bool pickup)
        int can_pickup = 0;
 
        /* Scan the pile of objects */
-       for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+       for (this_o_idx = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
        {
                /* Access the object */
-               o_ptr = &o_list[this_o_idx];
+               o_ptr = &current_floor_ptr->o_list[this_o_idx];
 
                object_desc(o_name, o_ptr, 0);
 
                /* Access the next object */
                next_o_idx = o_ptr->next_o_idx;
 
-               /* Hack -- disturb */
                disturb(FALSE, FALSE);
 
                /* Pick up gold */
@@ -4964,7 +4865,7 @@ void py_pickup_floor(bool pickup)
                if (floor_num == 1)
                {
                        /* Access the object */
-                       o_ptr = &o_list[floor_o_idx];
+                       o_ptr = &current_floor_ptr->o_list[floor_o_idx];
 
 #ifdef ALLOW_EASY_SENSE
 
@@ -4998,7 +4899,7 @@ void py_pickup_floor(bool pickup)
                if (floor_num == 1)
                {
                        /* Access the object */
-                       o_ptr = &o_list[floor_o_idx];
+                       o_ptr = &current_floor_ptr->o_list[floor_o_idx];
 
 #ifdef ALLOW_EASY_SENSE
 
@@ -5035,7 +4936,7 @@ void py_pickup_floor(bool pickup)
                        char out_val[MAX_NLEN+20];
 
                        /* Access the object */
-                       o_ptr = &o_list[floor_o_idx];
+                       o_ptr = &current_floor_ptr->o_list[floor_o_idx];
 
 #ifdef ALLOW_EASY_SENSE
 
@@ -5061,7 +4962,7 @@ void py_pickup_floor(bool pickup)
                }
 
                /* Access the object */
-               o_ptr = &o_list[floor_o_idx];
+               o_ptr = &current_floor_ptr->o_list[floor_o_idx];
 
 #ifdef ALLOW_EASY_SENSE
 
@@ -5087,3 +4988,61 @@ void py_pickup_floor(bool pickup)
                }
        }
 }
+
+
+/*!
+ * @brief 矢弾を射撃した場合の破損確率を返す /
+ * Determines the odds of an object breaking when thrown at a monster
+ * @param o_ptr 矢弾のオブジェクト構造体参照ポインタ
+ * @return 破損確率(%)
+ * @details
+ * Note that artifacts never break, see the "drop_near()" function.
+ */
+PERCENTAGE breakage_chance(object_type *o_ptr, SPELL_IDX snipe_type)
+{
+       PERCENTAGE archer_bonus = (p_ptr->pclass == CLASS_ARCHER ? (PERCENTAGE)(p_ptr->lev - 1) / 7 + 4 : 0);
+
+       /* Examine the snipe type */
+       if (snipe_type)
+       {
+               if (snipe_type == SP_KILL_WALL) return (100);
+               if (snipe_type == SP_EXPLODE) return (100);
+               if (snipe_type == SP_PIERCE) return (100);
+               if (snipe_type == SP_FINAL) return (100);
+               if (snipe_type == SP_NEEDLE) return (100);
+               if (snipe_type == SP_EVILNESS) return (40);
+               if (snipe_type == SP_HOLYNESS) return (40);
+       }
+
+       /* Examine the item type */
+       switch (o_ptr->tval)
+       {
+               /* Always break */
+       case TV_FLASK:
+       case TV_POTION:
+       case TV_BOTTLE:
+       case TV_FOOD:
+       case TV_JUNK:
+               return (100);
+
+               /* Often break */
+       case TV_LITE:
+       case TV_SCROLL:
+       case TV_SKELETON:
+               return (50);
+
+               /* Sometimes break */
+       case TV_WAND:
+       case TV_SPIKE:
+               return (25);
+       case TV_ARROW:
+               return (20 - archer_bonus * 2);
+
+               /* Rarely break */
+       case TV_SHOT:
+       case TV_BOLT:
+               return (10 - archer_bonus);
+       default:
+               return (10);
+       }
+}