OSDN Git Service

{@(コマンド)(数字)} と刻んだ場合に選択肢が "(数字))" に変わるのが不評
[hengband/hengband.git] / src / object1.c
index 8882b10..a4a0b6b 100644 (file)
@@ -1,15 +1,15 @@
 /* File: object1.c */
 
-/* Purpose: Object code, part 1 */
-
 /*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
  *
- * This software may be copied and distributed for educational, research, and
- * not for profit purposes provided that this copyright and statement are
- * included in all such copies.
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies.  Other copyrights may also apply.
  */
 
+/* Purpose: Object code, part 1 */
+
 #include "angband.h"
 
 #ifdef MACINTOSH
@@ -144,9 +144,9 @@ void object_flags(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
        for (i = 0; i < TR_FLAG_SIZE; i++)
                flgs[i] |= o_ptr->art_flags[i];
 
-       if ((o_ptr->tval > TV_CAPTURE) && o_ptr->xtra3)
+       if (item_tester_hook_smith(o_ptr))
        {
-                int add = o_ptr->xtra3 - 1;
+               int add = o_ptr->xtra3 - 1;
 
                if (add < TR_FLAG_MAX)
                {
@@ -277,9 +277,9 @@ void object_flags_known(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
                        flgs[i] |= o_ptr->art_flags[i];
        }
 
-       if ((o_ptr->tval > TV_CAPTURE) && o_ptr->xtra3)
+       if (item_tester_hook_smith(o_ptr))
        {
-                int add = o_ptr->xtra3 - 1;
+               int add = o_ptr->xtra3 - 1;
 
                if (add < TR_FLAG_MAX)
                {
@@ -1496,7 +1496,7 @@ return "
                case ART_AMBER:
                {
 #ifdef JP
-return "ÂÎÎϲóÉü(500) : 500 ¥¿¡¼¥óËè";
+return "ÂÎÎϲóÉü(700) : 250 ¥¿¡¼¥óËè";
 #else
                        return "heal (700) every 250 turns";
 #endif
@@ -1856,6 +1856,7 @@ return "
 #endif
                }
                case ART_NIGHT:
+               case ART_HELL:
                {
 #ifdef JP
 return "°Å¹õ¤ÎÍò(250) : 150+d150 ¥¿¡¼¥óËè";
@@ -1864,6 +1865,24 @@ return "
 #endif
 
                }
+               case ART_SACRED_KNIGHTS:
+               {
+#ifdef JP
+return "*²ò¼ö*¤ÈÄ´ºº: ¤¤¤Ä¤Ç¤â";
+#else
+                       return "Dispel Curse and Probing every turn";
+#endif
+
+               }
+               case ART_CHARMED:
+               {
+#ifdef JP
+return "ËâÎϤÎÍò(200) : 150+d150 ¥¿¡¼¥óËè";
+#else
+                       return "mana storm (200) every 150+d150 turns";
+#endif
+
+               }
        }
 
 
@@ -1877,50 +1896,45 @@ return "
 
        }
 
-       if ((o_ptr->tval > TV_CAPTURE) && o_ptr->xtra3)
-        {
-                switch (o_ptr->xtra3 - 1)
-                {
-                case ESSENCE_TMP_RES_ACID:
+       if (item_tester_hook_smith(o_ptr))
+       {
+               switch (o_ptr->xtra3 - 1)
+               {
+               case ESSENCE_TMP_RES_ACID:
 #ifdef JP
-                        return "»À¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
+                       return "»À¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
 #else
-                        return "resist acid every 50+d50 turns";
+                       return "resist acid every 50+d50 turns";
 #endif
-                        break;
 
-                case ESSENCE_TMP_RES_ELEC:
+               case ESSENCE_TMP_RES_ELEC:
 #ifdef JP
-                        return "ÅÅ·â¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
+                       return "ÅÅ·â¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
 #else
-                        return "resist elec every 50+d50 turns";
+                       return "resist elec every 50+d50 turns";
 #endif
-                        break;
 
-                case ESSENCE_TMP_RES_FIRE:
+               case ESSENCE_TMP_RES_FIRE:
 #ifdef JP
-                        return "²Ð¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
+                       return "²Ð¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
 #else
-                        return "resist fire every 50+d50 turns";
+                       return "resist fire every 50+d50 turns";
 #endif
-                        break;
 
-                case ESSENCE_TMP_RES_COLD:
+               case ESSENCE_TMP_RES_COLD:
 #ifdef JP
-                        return "Î䵤¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
+                       return "Î䵤¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
 #else
-                        return "resist cold every 50+d50 turns";
+                       return "resist cold every 50+d50 turns";
 #endif
-                        break;
 
-                case TR_IMPACT:
+               case TR_IMPACT:
 #ifdef JP
-                        return "ÃÏ¿Ì : 100+d100 ¥¿¡¼¥óËè";
+                       return "ÃÏ¿Ì : 100+d100 ¥¿¡¼¥óËè";
 #else
-                        return "earthquake every 100+d100 turns";
+                       return "earthquake every 100+d100 turns";
 #endif
-                        break;
-                }
+               }
        }
 
        if (o_ptr->name2 == EGO_TRUMP)
@@ -2141,74 +2155,64 @@ return "
                        {
                        case EGO_AMU_IDENT:
 #ifdef JP
-return "´ÕÄê : 10 ¥¿¡¼¥óËè";
+                               return "´ÕÄê : 10 ¥¿¡¼¥óËè";
 #else
                                return "identify every 10 turns";
 #endif
-                               break;
                        case EGO_AMU_CHARM:
 #ifdef JP
-return "¥â¥ó¥¹¥¿¡¼Ì¥Î» : 200 ¥¿¡¼¥óËè";
+                               return "¥â¥ó¥¹¥¿¡¼Ì¥Î» : 200 ¥¿¡¼¥óËè";
 #else
                                return "charm monster every 200 turns";
 #endif
-                               break;
                        case EGO_AMU_JUMP:
 #ifdef JP
-return "¥·¥ç¡¼¥È¡¦¥Æ¥ì¥Ý¡¼¥È : 10+d10 ¥¿¡¼¥óËè";
+                               return "¥·¥ç¡¼¥È¡¦¥Æ¥ì¥Ý¡¼¥È : 10+d10 ¥¿¡¼¥óËè";
 #else
                                return "blink every 10+d10 turns";
 #endif
-                               break;
                        case EGO_AMU_TELEPORT:
 #ifdef JP
-return "¥Æ¥ì¥Ý¡¼¥È : 50+d50 ¥¿¡¼¥óËè";
+                               return "¥Æ¥ì¥Ý¡¼¥È : 50+d50 ¥¿¡¼¥óËè";
 #else
                                return "teleport every 50+d50 turns";
 #endif
-                               break;
                        case EGO_AMU_D_DOOR:
 #ifdef JP
-return "¼¡¸µ¤ÎÈâ : 200 ¥¿¡¼¥óËè";
+                               return "¼¡¸µ¤ÎÈâ : 200 ¥¿¡¼¥óËè";
 #else
                                return "dimension door every 200 turns";
 #endif
-                               break;
                        case EGO_AMU_RES_FIRE_:
 #ifdef JP
-return "²Ð±ê¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
+                               return "²Ð±ê¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
 #else
                                return "resist fire every 50+d50 turns";
 #endif
-                               break;
                        case EGO_AMU_RES_COLD_:
 #ifdef JP
-return "Î䵤¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
+                               return "Î䵤¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
 #else
                                return "resist cold every 50+d50 turns";
 #endif
-                               break;
                        case EGO_AMU_RES_ELEC_:
 #ifdef JP
-return "ÅÅ·â¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
+                               return "ÅÅ·â¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
 #else
                                return "resist elec every 50+d50 turns";
 #endif
-                               break;
                        case EGO_AMU_RES_ACID_:
 #ifdef JP
-return "»À¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
+                               return "»À¤Ø¤ÎÂÑÀ­ : 50+d50¥¿¡¼¥óËè";
 #else
                                return "resist acid every 50+d50 turns";
 #endif
-                               break;
                        case EGO_AMU_DETECTION:
 #ifdef JP
-return "Á´´¶ÃΠ: 55+d55¥¿¡¼¥óËè";
+                               return "Á´´¶ÃΠ: 55+d55¥¿¡¼¥óËè";
 #else
                                return "detect all floor every 55+d55 turns";
 #endif
-                               break;
                        }
                }
        }
@@ -2374,7 +2378,7 @@ return "
 /*
  * Describe a "fully identified" item
  */
-bool identify_fully_aux(object_type *o_ptr)
+bool screen_object(object_type *o_ptr, bool real)
 {
        int                     i = 0, j, k;
 
@@ -2392,8 +2396,8 @@ bool identify_fully_aux(object_type *o_ptr)
                char temp[70 * 20];
 
                roff_to_buf(o_ptr->name1 ? (a_text + a_info[o_ptr->name1].text) :
-                           (k_text + k_info[lookup_kind(o_ptr->tval, o_ptr->sval)].text),
-                           77 - 15, temp);
+                           (k_text + k_info[lookup_kind(o_ptr->tval, o_ptr->sval)].text),
+                           77 - 15, temp, sizeof(temp));
                for (j = 0; temp[j]; j += 1 + strlen(&temp[j]))
                { info[i] = &temp[j]; i++;}
        }
@@ -2453,13 +2457,13 @@ info[i++] = "
 #ifdef JP
 info[i++] = "¤½¤ì¤Ï¼«Ê¬¼«¿È¤Ë¹¶·â¤¬Ê֤äƤ¯¤ë¤³¤È¤¬¤¢¤ë¡£";
 #else
-               info[i++] = "It strikes yourself sometimes.";
+               info[i++] = "It causes you to strike yourself sometimes.";
 #endif
 
 #ifdef JP
 info[i++] = "¤½¤ì¤Ï̵Ũ¤Î¥Ð¥ê¥¢¤òÀÚ¤êÎö¤¯¡£";
 #else
-               info[i++] = "It will always penetrates invulnerability barrier.";
+               info[i++] = "It always penetrates invulnerability barriers.";
 #endif
        }
 
@@ -2478,7 +2482,7 @@ info[i++] = "
 #ifdef JP
 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò²¼¤²¤ë¡£";
 #else
-               info[i++] = "It affects your ability to use magic devices.";
+               info[i++] = "It affects your ability to cast spells.";
 #endif
        }
 
@@ -2487,7 +2491,7 @@ info[i++] = "
 #ifdef JP
 info[i++] = "¤½¤ì¤ÏËâË¡¤ÎÆñ°×ÅÙ¤ò¾å¤²¤ë¡£";
 #else
-               info[i++] = "It prevents you from using magic items.";
+               info[i++] = "It interferes with casting spells.";
 #endif
        }
 
@@ -2539,10 +2543,28 @@ info[i++] = "
                if (o_ptr->name2 == EGO_LITE_DARKNESS)
                {
 #ifdef JP
-info[i++] = "¤½¤ì¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£";
+                       info[i++] = "¤½¤ì¤ÏÁ´¤¯¸÷¤é¤Ê¤¤¡£";
+#else
+                       info[i++] = "It provides no light.";
+#endif
+
+                       if (o_ptr->sval == SV_LITE_FEANOR ||
+                           o_ptr->sval == SV_LITE_LANTERN)
+                       {
+#ifdef JP
+                               info[i++] = "¤½¤ì¤ÏÌÀ¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-2)¡£";
+#else
+                               info[i++] = "It decreases radius of light source by 2.";
+#endif
+                       }
+                       else
+                       {
+#ifdef JP
+                               info[i++] = "¤½¤ì¤ÏÌÀ¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
 #else
-                       info[i++] = "It provides no light..";
+                               info[i++] = "It decreases radius of light source by 1.";
 #endif
+                       }
                }
                else if (artifact_p(o_ptr))
                {
@@ -3316,15 +3338,15 @@ info[i++] = "
        {
                if ((o_ptr->name2 == EGO_DARK) || (o_ptr->name1 == ART_NIGHT))
 #ifdef JP
-info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë¡£";
+info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
 #else
-                       info[i++] = "It decreases radius of your light source.";
+                       info[i++] = "It decreases radius of your light source by 1.";
 #endif
                else
 #ifdef JP
-info[i++] = "¤½¤ì¤Ï±Ê±ó¤ÎÌÀ¤«¤ê¤ò¼ø¤±¤ë¡£";
+info[i++] = "¤½¤ì¤Ï±Ê±ó¤ÎÌÀ¤«¤ê¤ò¼ø¤±¤ë(Ⱦ·Â¤Ë+1)¡£";
 #else
-                       info[i++] = "It provides permanent light.";
+                       info[i++] = "It provides permanent light. (radius +1)";
 #endif
 
        }
@@ -3699,7 +3721,7 @@ info[i++] = "
 #ifdef JP
 info[i++] = "¤½¤ì¤Ï¹¶·â¤ò³°¤·¤ä¤¹¤¤¡£";
 #else
-               info[i++] = "It causes you miss blows.";
+               info[i++] = "It causes you to miss blows.";
 #endif
 
        }
@@ -3708,7 +3730,7 @@ info[i++] = "
 #ifdef JP
 info[i++] = "¤½¤ì¤Ï¹¶·â¤ò¼õ¤±¤ä¤¹¤¤¡£";
 #else
-               info[i++] = "It helps your enemys' blows.";
+               info[i++] = "It helps your enemies' blows.";
 #endif
 
        }
@@ -3749,56 +3771,103 @@ info[i++] = "
 
        }
 
-       /* XTRA HACK ARTDESC */
-       if (have_flag(flgs, TR_IGNORE_ACID) &&
-           have_flag(flgs, TR_IGNORE_ELEC) &&
-           have_flag(flgs, TR_IGNORE_FIRE) &&
-           have_flag(flgs, TR_IGNORE_COLD))
+       /* Describe about this kind of object instead of THIS fake object */
+       if (!real)
        {
+               switch (o_ptr->tval)
+               {
+               case TV_RING:
+                       switch (o_ptr->sval)
+                       {
+                       case SV_RING_LORDLY:
 #ifdef JP
-         info[i++] = "¤½¤ì¤Ï»À¡¦Åŷ⡦²Ð±ê¡¦Î䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
+                               info[i++] = "¤½¤ì¤Ï´ö¤Ä¤«¤Î¥é¥ó¥À¥à¤ÊÂÑÀ­¤ò¼ø¤±¤ë¡£";
 #else
-         info[i++] = "It cannot be harmed by the elements.";
+                               info[i++] = "It provides some random resistances.";
 #endif
-       } else {
-       if (have_flag(flgs, TR_IGNORE_ACID))
-       {
+                               break;
+                       case SV_RING_WARNING:
 #ifdef JP
-info[i++] = "¤½¤ì¤Ï»À¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
+                               info[i++] = "¤½¤ì¤Ï¤Ò¤È¤Ä¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
 #else
-               info[i++] = "It cannot be harmed by acid.";
+                               info[i++] = "It may provide a low rank ESP.";
 #endif
+                               break;
+                       }
+                       break;
 
-       }
-       if (have_flag(flgs, TR_IGNORE_ELEC))
-       {
+               case TV_AMULET:
+                       switch (o_ptr->sval)
+                       {
+                       case SV_AMULET_RESISTANCE:
 #ifdef JP
-info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
+                               info[i++] = "¤½¤ì¤ÏÆǤؤÎÂÑÀ­¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
 #else
-               info[i++] = "It cannot be harmed by electricity.";
+                               info[i++] = "It may provides resistance to poison.";
 #endif
-
+#ifdef JP
+                               info[i++] = "¤½¤ì¤Ï¥é¥ó¥À¥à¤ÊÂÑÀ­¤ò¼ø¤±¤ë»ö¤¬¤¢¤ë¡£";
+#else
+                               info[i++] = "It may provide a random resistances.";
+#endif
+                               break;
+                       case SV_AMULET_THE_MAGI:
+#ifdef JP
+                               info[i++] = "¤½¤ì¤ÏºÇÂç¤Ç£³¤Ä¤Þ¤Ç¤ÎÄãµé¤ÊESP¤ò¼ø¤±¤ë¡£";
+#else
+                               info[i++] = "It provides up to three low rank ESPs.";
+#endif
+                               break;
+                       }
+                       break;
+               }
        }
-       if (have_flag(flgs, TR_IGNORE_FIRE))
+
+       if (have_flag(flgs, TR_IGNORE_ACID) &&
+           have_flag(flgs, TR_IGNORE_ELEC) &&
+           have_flag(flgs, TR_IGNORE_FIRE) &&
+           have_flag(flgs, TR_IGNORE_COLD))
        {
 #ifdef JP
-info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
+               info[i++] = "¤½¤ì¤Ï»À¡¦Åŷ⡦²Ð±ê¡¦Î䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
 #else
-               info[i++] = "It cannot be harmed by fire.";
+               info[i++] = "It cannot be harmed by the elements.";
 #endif
-
        }
-       if (have_flag(flgs, TR_IGNORE_COLD))
+       else
        {
+               if (have_flag(flgs, TR_IGNORE_ACID))
+               {
 #ifdef JP
-info[i++] = "¤½¤ì¤ÏÎ䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
+                       info[i++] = "¤½¤ì¤Ï»À¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
 #else
-               info[i++] = "It cannot be harmed by cold.";
+                       info[i++] = "It cannot be harmed by acid.";
 #endif
-
-       }
-
-       /* XTRA HACK ARTDESC */
+               }
+               if (have_flag(flgs, TR_IGNORE_ELEC))
+               {
+#ifdef JP
+                       info[i++] = "¤½¤ì¤ÏÅÅ·â¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
+#else
+                       info[i++] = "It cannot be harmed by electricity.";
+#endif
+               }
+               if (have_flag(flgs, TR_IGNORE_FIRE))
+               {
+#ifdef JP
+                       info[i++] = "¤½¤ì¤Ï²Ð±ê¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
+#else
+                       info[i++] = "It cannot be harmed by fire.";
+#endif
+               }
+               if (have_flag(flgs, TR_IGNORE_COLD))
+               {
+#ifdef JP
+                       info[i++] = "¤½¤ì¤ÏÎ䵤¤Ç¤Ï½ý¤Ä¤«¤Ê¤¤¡£";
+#else
+                       info[i++] = "It cannot be harmed by cold.";
+#endif
+               }
        }
 
        /* No special effects */
@@ -3811,8 +3880,12 @@ info[i++] = "
        Term_get_size(&wid, &hgt);
 
        /* Display Item name */
-       object_desc(o_name, o_ptr, TRUE, 3);
-       prt(format("%s", o_name), 0, 0);
+       if (real)
+               object_desc(o_name, o_ptr, TRUE, 3);
+       else
+               object_desc_store(o_name, o_ptr, TRUE, 0);
+
+       prt(o_name, 0, 0);
 
        /* Erase the screen */
        for (k = 1; k < hgt; k++) prt("", k, 13);
@@ -4350,7 +4423,10 @@ void display_inven(void)
        byte            attr = TERM_WHITE;
        char            tmp_val[80];
        char            o_name[MAX_NLEN];
+       int             wid, hgt;
 
+       /* Get size */
+       Term_get_size(&wid, &hgt);
 
        /* Find the "final" slot */
        for (i = 0; i < INVEN_PACK; i++)
@@ -4417,12 +4493,12 @@ void display_inven(void)
                        sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
 #endif
 
-                       Term_putstr(71, i, -1, TERM_WHITE, tmp_val);
+                       prt(tmp_val, i, wid - 9);
                }
        }
 
        /* Erase the rest of the window */
-       for (i = z; i < Term->hgt; i++)
+       for (i = z; i < hgt; i++)
        {
                /* Erase the line */
                Term_erase(0, i, 255);
@@ -4441,7 +4517,10 @@ void display_equip(void)
        byte            attr = TERM_WHITE;
        char            tmp_val[80];
        char            o_name[MAX_NLEN];
+       int             wid, hgt;
 
+       /* Get size */
+       Term_get_size(&wid, &hgt);
 
        /* Display the equipment */
        for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
@@ -4496,30 +4575,29 @@ void display_equip(void)
                /* Erase the rest of the line */
                Term_erase(3+n, i - INVEN_RARM, 255);
 
-               /* Display the slot description (if needed) */
-               if (show_labels)
-               {
-                       Term_putstr(61, i - INVEN_RARM, -1, TERM_WHITE, "<--");
-                       Term_putstr(65, i - INVEN_RARM, -1, TERM_WHITE, mention_use(i));
-               }
-
                /* Display the weight (if needed) */
                if (show_weights && o_ptr->weight)
                {
                        int wgt = o_ptr->weight * o_ptr->number;
-                       int col = (show_labels ? 52 : 71);
 #ifdef JP
                        sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
 #else
                        sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
 #endif
 
-                       Term_putstr(col, i - INVEN_RARM, -1, TERM_WHITE, tmp_val);
+                       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, " <-- ");
+                       prt(mention_use(i), i - INVEN_RARM, wid - 15);
                }
        }
 
        /* Erase the rest of the window */
-       for (i = INVEN_TOTAL - INVEN_RARM; i < Term->hgt; i++)
+       for (i = INVEN_TOTAL - INVEN_RARM; i < hgt; i++)
        {
                /* Clear that line */
                Term_erase(0, i, 255);
@@ -4527,133 +4605,378 @@ void display_equip(void)
 }
 
 
-
-
-
-
 /*
- * Display the inventory.
+ * Find the "first" inventory object with the given "tag".
  *
- * Hack -- do not display "trailing" empty slots
+ * A "tag" is a numeral "n" appearing as "@n" anywhere in the
+ * inscription of an object.  Alphabetical characters don't work as a
+ * tag in this form.
+ *
+ * Also, the tag "@xn" will work as well, where "n" is a any tag-char,
+ * and "x" is the "current" command_cmd code.
  */
-int show_inven(int target_item)
+static bool get_tag(int *cp, char tag, int mode)
 {
-       int             i, j, k, l, z = 0;
-       int             col, cur_col, len;
-       object_type     *o_ptr;
-       char            o_name[MAX_NLEN];
-       char            tmp_val[80];
-       int             out_index[23];
-       byte            out_color[23];
-       char            out_desc[23][MAX_NLEN];
-       int             target_item_label = 0;
-       int             wid, hgt;
-       char inven_spellbook_label[52+1];
-
-       /* See cmd5.c */
-       extern bool select_spellbook;
+       int i, start, end;
+       cptr s;
 
-       /* Starting column */
-       col = command_gap;
+       /* Extract index from mode */
+       switch (mode)
+       {
+       case USE_EQUIP:
+               start = INVEN_RARM;
+               end = INVEN_TOTAL - 1;
+               break;
 
-       /* Get size */
-       Term_get_size(&wid, &hgt);
+       case USE_INVEN:
+               start = 0;
+               end = INVEN_PACK - 1;
+               break;
 
-       /* Default "max-length" */
-       len = wid - col - 1;
+       default:
+               return FALSE;
+       }
 
+       /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
 
-       /* Find the "final" slot */
-       for (i = 0; i < INVEN_PACK; i++)
+       /* Check every inventory object */
+       for (i = start; i <= end; i++)
        {
-               o_ptr = &inventory[i];
+               object_type *o_ptr = &inventory[i];
 
                /* Skip non-objects */
                if (!o_ptr->k_idx) continue;
 
-               /* Track */
-               z = i + 1;
-       }
+               /* Skip empty inscriptions */
+               if (!o_ptr->inscription) continue;
 
-       if (select_spellbook)
-       {
-               int index;
+               /* Skip non-choice */
+               if (!item_tester_okay(o_ptr)) continue;
 
-               strcpy(inven_spellbook_label, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
-               for (i = 0; i < 52; i++)
-               {
-                        char c;
-                        if (i < 26) c = (char)('a' + i);
-                        else c = (char)('A' + i - 26);
+               /* Find a '@' */
+               s = strchr(quark_str(o_ptr->inscription), '@');
 
-                       if (get_tag(&index, c))
+               /* Process all tags */
+               while (s)
+               {
+                       /* Check the special tags */
+                       if ((s[1] == command_cmd) && (s[2] == tag))
                        {
-                               if (inven_spellbook_label[i] == c)
-                                        inven_spellbook_label[i] = ' ';
-                               inven_spellbook_label[index] = c;
+                               /* Save the actual inventory ID */
+                               *cp = i;
+
+                               /* Success */
+                               return (TRUE);
                        }
+
+                       /* Find another '@' */
+                       s = strchr(s + 1, '@');
                }
        }
 
-       /* Display the inventory */
-       for (k = 0, i = 0; i < z; i++)
-       {
-               o_ptr = &inventory[i];
 
-               /* Is this item acceptable? */
-               if (!item_tester_okay(o_ptr)) continue;
+       /**** Find a tag in the form of {@#} (allows only numerals)  ***/
 
-               /* Describe the object */
-               object_desc(o_name, o_ptr, TRUE, 3);
+       /* Don't allow {@#} with '#' being alphabet */
+       if (tag < '0' || '9' < tag)
+       {
+               /* No such tag */
+               return FALSE;
+       }
 
-               /* Save the object index, color, and description */
-               out_index[k] = i;
-               out_color[k] = tval_to_attr[o_ptr->tval % 128];
+       /* Check every object */
+       for (i = start; i <= end; i++)
+       {
+               object_type *o_ptr = &inventory[i];
 
-               /* Grey out charging items */
-               if (o_ptr->timeout)
-               {
-                       out_color[k] = TERM_L_DARK;
-               }
+               /* Skip non-objects */
+               if (!o_ptr->k_idx) continue;
 
-               (void)strcpy(out_desc[k], o_name);
+               /* Skip empty inscriptions */
+               if (!o_ptr->inscription) continue;
 
-               /* Find the predicted "line length" */
-               l = strlen(out_desc[k]) + 5;
+               /* Skip non-choice */
+               if (!item_tester_okay(o_ptr)) continue;
 
-               /* Be sure to account for the weight */
-               if (show_weights) l += 9;
+               /* Find a '@' */
+               s = strchr(quark_str(o_ptr->inscription), '@');
 
-               /* Account for icon if displayed */
-               if (show_item_graph)
+               /* Process all tags */
+               while (s)
                {
-                       l += 2;
-                       if (use_bigtile) l++;
-               }
+                       /* Check the normal tags */
+                       if (s[1] == tag)
+                       {
+                               /* Save the actual inventory ID */
+                               *cp = i;
 
-               /* Maintain the maximum length */
-               if (l > len) len = l;
+                               /* Success */
+                               return (TRUE);
+                       }
 
-               /* Advance to next "line" */
-               k++;
+                       /* Find another '@' */
+                       s = strchr(s + 1, '@');
+               }
        }
 
-       /* Find the column to start in */
-       col = (len > wid - 4) ? 0 : (wid - len - 1);
+       /* No such tag */
+       return (FALSE);
+}
 
-       /* Output each entry */
-       for (j = 0; j < k; j++)
-       {
-               /* Get the index */
-               i = out_index[j];
 
-               /* Get the item */
-               o_ptr = &inventory[i];
+/*
+ * Find the "first" floor object with the given "tag".
+ *
+ * A "tag" is a numeral "n" appearing as "@n" anywhere in the
+ * inscription of an object.  Alphabetical characters don't work as a
+ * tag in this form.
+ *
+ * Also, the tag "@xn" will work as well, where "n" is a any tag-char,
+ * and "x" is the "current" command_cmd code.
+ */
+static bool get_tag_floor(int *cp, char tag, int floor_list[], int floor_num)
+{
+       int i;
+       cptr s;
 
-               /* Clear the line */
-               prt("", j + 1, col ? col - 2 : col);
+       /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
 
-               if (use_menu && target_item)
+       /* Check every object in the grid */
+       for (i = 0; i < floor_num && i < 23; i++)
+       {
+               object_type *o_ptr = &o_list[floor_list[i]];
+
+               /* Skip empty inscriptions */
+               if (!o_ptr->inscription) continue;
+
+               /* Find a '@' */
+               s = strchr(quark_str(o_ptr->inscription), '@');
+
+               /* Process all tags */
+               while (s)
+               {
+                       /* Check the special tags */
+                       if ((s[1] == command_cmd) && (s[2] == tag))
+                       {
+                               /* Save the actual floor object ID */
+                               *cp = i;
+
+                               /* Success */
+                               return (TRUE);
+                       }
+
+                       /* Find another '@' */
+                       s = strchr(s + 1, '@');
+               }
+       }
+
+
+       /**** Find a tag in the form of {@#} (allows only numerals)  ***/
+
+       /* Don't allow {@#} with '#' being alphabet */
+       if (tag < '0' || '9' < tag)
+       {
+               /* No such tag */
+               return FALSE;
+       }
+
+       /* Check every object in the grid */
+       for (i = 0; i < floor_num && i < 23; i++)
+       {
+               object_type *o_ptr = &o_list[floor_list[i]];
+
+               /* Skip empty inscriptions */
+               if (!o_ptr->inscription) continue;
+
+               /* Find a '@' */
+               s = strchr(quark_str(o_ptr->inscription), '@');
+
+               /* Process all tags */
+               while (s)
+               {
+                       /* Check the normal tags */
+                       if (s[1] == tag)
+                       {
+                               /* Save the floor object ID */
+                               *cp = i;
+
+                               /* Success */
+                               return (TRUE);
+                       }
+
+                       /* Find another '@' */
+                       s = strchr(s + 1, '@');
+               }
+       }
+
+       /* No such tag */
+       return (FALSE);
+}
+
+
+/*
+ * Move around label characters with correspond tags
+ */
+static void prepare_label_string(char *label, int mode)
+{
+       cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+       int  offset = (mode == USE_EQUIP) ? INVEN_RARM : 0;
+       int  i;
+
+       /* Prepare normal labels */
+       strcpy(label, alphabet_chars);
+
+       /* Move each label */
+       for (i = 0; i < 52; i++)
+       {
+               int index;
+               char c = alphabet_chars[i];
+
+               /* Find a tag with this label */
+               if (get_tag(&index, c, mode))
+               {
+                       /* Delete the overwritten label */
+                       if (label[i] == c) label[i] = ' ';
+
+                       /* Move the label to the place of corresponding tag */
+                       label[index - offset] = c;
+               }
+       }
+}
+
+
+/*
+ * Move around label characters with correspond tags (floor version)
+ */
+static void prepare_label_string_floor(char *label, int floor_list[], int floor_num)
+{
+       cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+       int  i;
+
+       /* Prepare normal labels */
+       strcpy(label, alphabet_chars);
+
+       /* Move each label */
+       for (i = 0; i < 52; i++)
+       {
+               int index;
+               char c = alphabet_chars[i];
+
+               /* Find a tag with this label */
+               if (get_tag_floor(&index, c, floor_list, floor_num))
+               {
+                       /* Delete the overwritten label */
+                       if (label[i] == c) label[i] = ' ';
+
+                       /* Move the label to the place of corresponding tag */
+                       label[index] = c;
+               }
+       }
+}
+
+
+/*
+ * Display the inventory.
+ *
+ * Hack -- do not display "trailing" empty slots
+ */
+int show_inven(int target_item)
+{
+       int             i, j, k, l, z = 0;
+       int             col, cur_col, len;
+       object_type     *o_ptr;
+       char            o_name[MAX_NLEN];
+       char            tmp_val[80];
+       int             out_index[23];
+       byte            out_color[23];
+       char            out_desc[23][MAX_NLEN];
+       int             target_item_label = 0;
+       int             wid, hgt;
+       char            inven_label[52 + 1];
+
+       /* Starting column */
+       col = command_gap;
+
+       /* Get size */
+       Term_get_size(&wid, &hgt);
+
+       /* Default "max-length" */
+       len = wid - col - 1;
+
+
+       /* Find the "final" slot */
+       for (i = 0; i < INVEN_PACK; i++)
+       {
+               o_ptr = &inventory[i];
+
+               /* Skip non-objects */
+               if (!o_ptr->k_idx) continue;
+
+               /* Track */
+               z = i + 1;
+       }
+
+       prepare_label_string(inven_label, USE_INVEN);
+
+       /* Display the inventory */
+       for (k = 0, i = 0; i < z; i++)
+       {
+               o_ptr = &inventory[i];
+
+               /* Is this item acceptable? */
+               if (!item_tester_okay(o_ptr)) continue;
+
+               /* Describe the object */
+               object_desc(o_name, o_ptr, TRUE, 3);
+
+               /* Save the object index, color, and description */
+               out_index[k] = i;
+               out_color[k] = tval_to_attr[o_ptr->tval % 128];
+
+               /* Grey out charging items */
+               if (o_ptr->timeout)
+               {
+                       out_color[k] = TERM_L_DARK;
+               }
+
+               (void)strcpy(out_desc[k], o_name);
+
+               /* Find the predicted "line length" */
+               l = strlen(out_desc[k]) + 5;
+
+               /* Be sure to account for the weight */
+               if (show_weights) l += 9;
+
+               /* Account for icon if displayed */
+               if (show_item_graph)
+               {
+                       l += 2;
+                       if (use_bigtile) l++;
+               }
+
+               /* Maintain the maximum length */
+               if (l > len) len = l;
+
+               /* Advance to next "line" */
+               k++;
+       }
+
+       /* Find the column to start in */
+       col = (len > wid - 4) ? 0 : (wid - len - 1);
+
+       /* Output each entry */
+       for (j = 0; j < k; j++)
+       {
+               /* Get the index */
+               i = out_index[j];
+
+               /* Get the item */
+               o_ptr = &inventory[i];
+
+               /* Clear the line */
+               prt("", j + 1, col ? col - 2 : col);
+
+               if (use_menu && target_item)
                {
                        if (j == (target_item-1))
                        {
@@ -4666,9 +4989,10 @@ int show_inven(int target_item)
                        }
                        else strcpy(tmp_val, "  ");
                }
-               else if (i <= INVEN_PACK && select_spellbook)
+               else if (i <= INVEN_PACK)
                {
-                       sprintf(tmp_val, "%c)", inven_spellbook_label[i]);
+                       /* Prepare an index --(-- */
+                       sprintf(tmp_val, "%c)", inven_label[i]);
                }
                else
                {
@@ -4715,7 +5039,7 @@ int show_inven(int target_item)
                        (void)sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
 #endif
 
-                       put_str(tmp_val, j + 1, wid - 9);
+                       prt(tmp_val, j + 1, wid - 9);
                }
        }
 
@@ -4745,7 +5069,7 @@ int show_equip(int target_item)
        char            out_desc[23][MAX_NLEN];
        int             target_item_label = 0;
        int             wid, hgt;
-
+       char            equip_label[52 + 1];
 
        /* Starting column */
        col = command_gap;
@@ -4792,7 +5116,7 @@ int show_equip(int target_item)
 
                /* Extract the maximal length (see below) */
 #ifdef JP
-                l = strlen(out_desc[k]) + (2 + 1);
+               l = strlen(out_desc[k]) + (2 + 1);
 #else
                l = strlen(out_desc[k]) + (2 + 3);
 #endif
@@ -4800,7 +5124,7 @@ int show_equip(int target_item)
 
                /* Increase length for labels (if needed) */
 #ifdef JP
-                if (show_labels) l += (7 + 2);
+               if (show_labels) l += (7 + 2);
 #else
                if (show_labels) l += (14 + 2);
 #endif
@@ -4820,11 +5144,12 @@ int show_equip(int target_item)
 
        /* Hack -- Find a column to start in */
 #ifdef JP
-        col = (len > wid - 6) ? 0 : (wid - len - 1);
+       col = (len > wid - 6) ? 0 : (wid - len - 1);
 #else
        col = (len > wid - 4) ? 0 : (wid - len - 1);
 #endif
 
+       prepare_label_string(equip_label, USE_EQUIP);
 
        /* Output each entry */
        for (j = 0; j < k; j++)
@@ -4851,9 +5176,16 @@ int show_equip(int target_item)
                        }
                        else strcpy(tmp_val, "  ");
                }
-               else
+               else if (i >= INVEN_RARM)
+               {
+                       /* Prepare an index --(-- */
+                       sprintf(tmp_val, "%c)", equip_label[i - INVEN_RARM]);
+               }
+               else /* Paranoia */
+               {
                        /* Prepare an index --(-- */
                        sprintf(tmp_val, "%c)", index_to_label(i));
+               }
 
                /* Clear the line with the (possibly indented) index */
                put_str(tmp_val, j+1, col);
@@ -4912,12 +5244,12 @@ int show_equip(int target_item)
                {
                        int wgt = o_ptr->weight * o_ptr->number;
 #ifdef JP
-                        (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
+                       (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
 #else
                        (void)sprintf(tmp_val, "%3d.%d lb", wgt / 10, wgt % 10);
 #endif
 
-                       put_str(tmp_val, j+1, wid - 9);
+                       prt(tmp_val, j + 1, wid - 9);
                }
        }
 
@@ -5084,94 +5416,6 @@ static bool get_item_okay(int i)
 
 
 /*
- * Find the "first" inventory object with the given "tag".
- *
- * A "tag" is a char "n" appearing as "@n" anywhere in the
- * inscription of an object.
- *
- * Also, the tag "@xn" will work as well, where "n" is a tag-char,
- * and "x" is the "current" command_cmd code.
- */
-int get_tag(int *cp, char tag)
-{
-       int i;
-       cptr s;
-
-       /* Check every object */
-       for (i = 0; i < INVEN_TOTAL; ++i)
-       {
-               object_type *o_ptr = &inventory[i];
-
-               /* Skip non-objects */
-               if (!o_ptr->k_idx) continue;
-
-               /* Skip empty inscriptions */
-               if (!o_ptr->inscription) continue;
-
-               /* Skip non-choice */
-               if (!item_tester_okay(o_ptr)) continue;
-
-               /* Find a '@' */
-               s = strchr(quark_str(o_ptr->inscription), '@');
-
-               /* Process all tags */
-               while (s)
-               {
-                       /* Check the special tags */
-                       if ((s[1] == command_cmd) && (s[2] == tag))
-                       {
-                               /* Save the actual inventory ID */
-                               *cp = i;
-
-                               /* Success */
-                               return (TRUE);
-                       }
-
-                       /* Find another '@' */
-                       s = strchr(s + 1, '@');
-               }
-       }
-
-       /* Check every object */
-       for (i = 0; i < INVEN_TOTAL; ++i)
-       {
-               object_type *o_ptr = &inventory[i];
-
-               /* Skip non-objects */
-               if (!o_ptr->k_idx) continue;
-
-               /* Skip empty inscriptions */
-               if (!o_ptr->inscription) continue;
-
-               /* Skip non-choice */
-               if (!item_tester_okay(o_ptr)) continue;
-
-               /* Find a '@' */
-               s = strchr(quark_str(o_ptr->inscription), '@');
-
-               /* Process all tags */
-               while (s)
-               {
-                       /* Check the normal tags */
-                       if (s[1] == tag && !((s[2] >= '0' && s[2] <= '9') || (s[2] >= 'a' && s[2] <= 'z') || (s[2] >= 'A' && s[2] <= 'Z')))
-               {
-                               /* Save the actual inventory ID */
-                               *cp = i;
-
-                               /* Success */
-                               return (TRUE);
-                       }
-
-                       /* Find another '@' */
-                       s = strchr(s + 1, '@');
-               }
-       }
-
-       /* No such tag */
-       return (FALSE);
-}
-
-/*
  * Determine whether get_item() can get some item or not
  * assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).
  */
@@ -5244,7 +5488,7 @@ bool get_item(int *cp, cptr pmt, cptr str, int mode)
 {
        s16b this_o_idx, next_o_idx = 0;
 
-       char n1, n2, which = ' ';
+       char which = ' ';
 
        int j, k, i1, i2, e1, e2;
 
@@ -5264,7 +5508,6 @@ bool get_item(int *cp, cptr pmt, cptr str, int mode)
        char out_val[160];
 
        /* See cmd5.c */
-       extern bool select_spellbook;
        extern bool select_the_force;
 
        int menu_line = (use_menu ? 1 : 0);
@@ -5282,7 +5525,7 @@ bool get_item(int *cp, cptr pmt, cptr str, int mode)
        /* Get the item index */
        if (repeat_pull(cp))
        {
-               if (*cp == 1111) { /* the_force */
+               if (*cp == INVEN_FORCE) { /* the_force */
                    item_tester_tval = 0;
                    item_tester_hook = NULL;
                    return (TRUE);
@@ -5413,7 +5656,7 @@ bool get_item(int *cp, cptr pmt, cptr str, int mode)
                done = TRUE;
 
                if (select_the_force) {
-                   *cp = 1111;
+                   *cp = INVEN_FORCE;
                    item = TRUE;
                }
        }
@@ -5423,7 +5666,6 @@ bool get_item(int *cp, cptr pmt, cptr str, int mode)
        {
                /* Hack -- Start on equipment if requested */
                if (command_see && command_wrk && equip)
-
                {
                        command_wrk = TRUE;
                }
@@ -5448,10 +5690,10 @@ bool get_item(int *cp, cptr pmt, cptr str, int mode)
        }
 
 
-        /*
-         * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
-         */
-        if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
+       /*
+        * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
+        */
+       if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
 
        /* Hack -- start out in "display" mode */
        if (command_see)
@@ -5506,10 +5748,6 @@ bool get_item(int *cp, cptr pmt, cptr str, int mode)
                /* Inventory screen */
                if (!command_wrk)
                {
-                       /* Extract the legal requests */
-                       n1 = I2A(i1);
-                       n2 = I2A(i2);
-
                        /* Redraw if needed */
                        if (command_see) get_item_label = show_inven(menu_line);
                }
@@ -5517,10 +5755,6 @@ bool get_item(int *cp, cptr pmt, cptr str, int mode)
                /* Equipment screen */
                else
                {
-                       /* Extract the legal requests */
-                       n1 = I2A(e1 - INVEN_RARM);
-                       n2 = I2A(e2 - INVEN_RARM);
-
                        /* Redraw if needed */
                        if (command_see) get_item_label = show_equip(menu_line);
                }
@@ -5546,7 +5780,7 @@ sprintf(tmp_val, "%c-%c,'(',')',",
                                sprintf(tmp_val, " %c-%c,'(',')',",
 #endif
 
-                                       index_to_label(i1), index_to_label(i2));
+                                       index_to_label(i1), index_to_label(i2));
 
                                /* Append */
                                strcat(out_val, tmp_val);
@@ -5594,7 +5828,7 @@ sprintf(tmp_val, "%c-%c,'(',')',",
                                sprintf(tmp_val, " %c-%c,'(',')',",
 #endif
 
-                                       index_to_label(e1), index_to_label(e2));
+                                       index_to_label(e1), index_to_label(e2));
 
                                /* Append */
                                strcat(out_val, tmp_val);
@@ -5735,10 +5969,10 @@ if (allow_floor) strcat(out_val, " '-'
                                done = TRUE;
                                break;
                        }
-                       case 'w':
+                       case 'w':
                        {
                                if (select_the_force) {
-                                       *cp = 1111;
+                                       *cp = INVEN_FORCE;
                                        item = TRUE;
                                        done = TRUE;
                                        break;
@@ -5865,7 +6099,7 @@ if (other_query_flag && !verify("
                        case '7': case '8': case '9':
                        {
                                /* Look up the tag */
-                               if (!get_tag(&k, which))
+                               if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
                                {
                                        bell();
                                        break;
@@ -5902,7 +6136,6 @@ if (other_query_flag && !verify("
 #if 0
                        case '\n':
                        case '\r':
-#endif
                        {
                                /* Choose "default" inventory item */
                                if (!command_wrk)
@@ -5936,48 +6169,51 @@ if (other_query_flag && !verify("
                                done = TRUE;
                                break;
                        }
+#endif
 
-                       case 'w':
+                       case 'w':
                        {
                                if (select_the_force) {
-                                       *cp = 1111;
+                                       *cp = INVEN_FORCE;
                                        item = TRUE;
                                        done = TRUE;
                                        break;
                                }
+
+                               /* Fall through */
                        }
 
                        default:
                        {
                                int ver;
-                               if(select_spellbook){
-                                    bool not_found = FALSE;
-                                    /* Look up the tag */
-                                    if (!get_tag(&k, which))
-                                    {
+                               bool not_found = FALSE;
+
+                               /* Look up the alphabetical tag */
+                               if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
+                               {
                                        not_found = TRUE;
-                                    }
+                               }
 
-                                    /* Hack -- Validate the item */
-                                    if ((k < INVEN_RARM) ? !inven : !equip)
-                                    {
+                               /* Hack -- Validate the item */
+                               else if ((k < INVEN_RARM) ? !inven : !equip)
+                               {
                                        not_found = TRUE;
-                                    }
+                               }
 
-                                    /* Validate the item */
-                                    if (!get_item_okay(k))
-                                    {
+                               /* Validate the item */
+                               else if (!get_item_okay(k))
+                               {
                                        not_found = TRUE;
-                                    }
+                               }
 
-                                    if( !not_found ){
-                                        /* Accept that choice */
-                                        (*cp) = k;
-                                        item = TRUE;
-                                        done = TRUE;
-                                        break;
-                                    }
-                               }                               
+                               if (!not_found)
+                               {
+                                       /* Accept that choice */
+                                       (*cp) = k;
+                                       item = TRUE;
+                                       done = TRUE;
+                                       break;
+                               }
 
                                /* Extract "query" setting */
                                ver = isupper(which);
@@ -5986,16 +6222,16 @@ if (other_query_flag && !verify("
                                /* Convert letter to inventory index */
                                if (!command_wrk)
                                {
-                                        if (which == '(') k = i1;
-                                        else if (which == ')') k = i2;
-                                        else k = label_to_inven(which);
+                                       if (which == '(') k = i1;
+                                       else if (which == ')') k = i2;
+                                       else k = label_to_inven(which);
                                }
 
                                /* Convert letter to equipment index */
                                else
                                {
-                                        if (which == '(') k = e1;
-                                        else if (which == ')') k = e2;
+                                       if (which == '(') k = e1;
+                                       else if (which == ')') k = e2;
                                        else k = label_to_equip(which);
                                }
 
@@ -6138,6 +6374,7 @@ int scan_floor(int *items, int y, int x, int mode)
        return num;
 }
 
+
 /*
  * Display a list of the items on the floor at the given location.
  */
@@ -6159,6 +6396,7 @@ int show_floor(int target_item, int y, int x, int *min_width)
 
        int floor_list[23], floor_num;
        int wid, hgt;
+       char floor_label[52 + 1];
 
        /* Get size */
        Term_get_size(&wid, &hgt);
@@ -6170,7 +6408,7 @@ int show_floor(int target_item, int y, int x, int *min_width)
        /* Scan for objects in the grid, using item_tester_okay() */
        floor_num = scan_floor(floor_list, y, x, 0x01);
 
-       /* Display the inventory */
+       /* Display the floor objects */
        for (k = 0, i = 0; i < floor_num && i < 23; i++)
        {
                o_ptr = &o_list[floor_list[i]];
@@ -6206,6 +6444,8 @@ int show_floor(int target_item, int y, int x, int *min_width)
        /* Find the column to start in */
        col = (len > wid - 4) ? 0 : (wid - len - 1);
 
+       prepare_label_string_floor(floor_label, floor_list, floor_num);
+
        /* Output each entry */
        for (j = 0; j < k; j++)
        {
@@ -6232,8 +6472,10 @@ int show_floor(int target_item, int y, int x, int *min_width)
                        else strcpy(tmp_val, "   ");
                }
                else
+               {
                        /* Prepare an index --(-- */
-                       sprintf(tmp_val, "%c)", index_to_label(j));
+                       sprintf(tmp_val, "%c)", floor_label[j]);
+               }
 
                /* Clear the line with the (possibly indented) index */
                put_str(tmp_val, j + 1, col);
@@ -6251,7 +6493,7 @@ int show_floor(int target_item, int y, int x, int *min_width)
                        sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
 #endif
 
-                       put_str(tmp_val, j + 1, wid - 9);
+                       prt(tmp_val, j + 1, wid - 9);
                }
        }
 
@@ -6291,7 +6533,6 @@ bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
        int floor_num, floor_list[23], floor_top = 0;
        int min_width = 0;
 
-       extern bool select_spellbook;
        extern bool select_the_force;
 
        int menu_line = (use_menu ? 1 : 0);
@@ -6303,7 +6544,7 @@ bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
        /* Get the item index */
        if (repeat_pull(cp))
        {
-               if (*cp == 1111) { /* the_force */
+               if (*cp == INVEN_FORCE) { /* the_force */
                    item_tester_tval = 0;
                    item_tester_hook = NULL;
                    return (TRUE);
@@ -6433,7 +6674,7 @@ bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
                done = TRUE;
 
                if (select_the_force) {
-                   *cp = 1111;
+                   *cp = INVEN_FORCE;
                    item = TRUE;
                }
        }
@@ -6467,10 +6708,10 @@ bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
                }
        }
 
-        /*
-         * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
-         */
-        if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
+       /*
+        * Äɲ媥ץ·¥ç¥ó(always_show_list)¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¾ï¤Ë°ìÍ÷¤òɽ¼¨¤¹¤ë
+        */
+       if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
 
        /* Hack -- start out in "display" mode */
        if (command_see)
@@ -6576,7 +6817,7 @@ sprintf(tmp_val, "%c-%c,'(',')',",
                                sprintf(tmp_val, " %c-%c,'(',')',",
 #endif
 
-                                       index_to_label(i1), index_to_label(i2));
+                                       index_to_label(i1), index_to_label(i2));
 
                                /* Append */
                                strcat(out_val, tmp_val);
@@ -6659,7 +6900,7 @@ sprintf(tmp_val, "%c-%c,'(',')',",
                                sprintf(tmp_val, " %c-%c,'(',')',",
 #endif
 
-                                       index_to_label(e1), index_to_label(e2));
+                                       index_to_label(e1), index_to_label(e2));
 
                                /* Append */
                                strcat(out_val, tmp_val);
@@ -7010,10 +7251,10 @@ if (!command_see && !use_menu) strcat(out_val, " '*'
                                done = TRUE;
                                break;
                        }
-                       case 'w':
+                       case 'w':
                        {
                                if (select_the_force) {
-                                       *cp = 1111;
+                                       *cp = INVEN_FORCE;
                                        item = TRUE;
                                        done = TRUE;
                                        break;
@@ -7076,15 +7317,15 @@ if (!command_see && !use_menu) strcat(out_val, " '*'
 
                                /* 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;
-       
+       
                                /* Add after the last object. */
                                o_list[i].next_o_idx = o_idx;
-       
+       
                                /* Re-scan floor list */ 
                                floor_num = scan_floor(floor_list, py, px, 0x01);
 
@@ -7210,25 +7451,42 @@ if (!command_see && !use_menu) strcat(out_val, " '*'
                        case '4': case '5': case '6':
                        case '7': case '8': case '9':
                        {
-                               /* Look up the tag */
-                               if (!get_tag(&k, which))
+                               if (command_wrk != USE_FLOOR)
                                {
-                                       bell();
-                                       break;
-                               }
+                                       /* Look up the tag */
+                                       if (!get_tag(&k, which, command_wrk))
+                                       {
+                                               bell();
+                                               break;
+                                       }
 
-                               /* Hack -- Validate the item */
-                               if ((k < INVEN_RARM) ? !inven : !equip)
-                               {
-                                       bell();
-                                       break;
-                               }
+                                       /* Hack -- Validate the item */
+                                       if ((k < INVEN_RARM) ? !inven : !equip)
+                                       {
+                                               bell();
+                                               break;
+                                       }
 
-                               /* Validate the item */
-                               if (!get_item_okay(k))
+                                       /* Validate the item */
+                                       if (!get_item_okay(k))
+                                       {
+                                               bell();
+                                               break;
+                                       }
+                               }
+                               else
                                {
-                                       bell();
-                                       break;
+                                       /* Look up the alphabetical tag */
+                                       if (get_tag_floor(&k, which, floor_list, floor_num))
+                                       {
+                                               /* Special index */
+                                               k = 0 - floor_list[k];
+                                       }
+                                       else
+                                       {
+                                               bell();
+                                               break;
+                                       }
                                }
 
                                /* Allow player to "refuse" certain actions */
@@ -7306,48 +7564,68 @@ if (!command_see && !use_menu) strcat(out_val, " '*'
                        }
 #endif
 
-                       case 'w':
+                       case 'w':
                        {
                                if (select_the_force) {
-                                       *cp = 1111;
+                                       *cp = INVEN_FORCE;
                                        item = TRUE;
                                        done = TRUE;
                                        break;
                                }
+
+                               /* Fall through */
                        }
 
                        default:
                        {
                                int ver;
 
-                               if(select_spellbook){
-                                    bool not_found = FALSE;
-                                    /* Look up the tag */
-                                    if (!get_tag(&k, which))
-                                    {
-                                       not_found = TRUE;
-                                    }
+                               if (command_wrk != USE_FLOOR)
+                               {
+                                       bool not_found = FALSE;
 
-                                    /* Hack -- Validate the item */
-                                    if ((k < INVEN_RARM) ? !inven : !equip)
-                                    {
-                                       not_found = TRUE;
-                                    }
+                                       /* Look up the alphabetical tag */
+                                       if (!get_tag(&k, which, command_wrk))
+                                       {
+                                               not_found = TRUE;
+                                       }
 
-                                    /* Validate the item */
-                                    if (!get_item_okay(k))
-                                    {
-                                       not_found = TRUE;
-                                    }
+                                       /* Hack -- Validate the item */
+                                       else if ((k < INVEN_RARM) ? !inven : !equip)
+                                       {
+                                               not_found = TRUE;
+                                       }
 
-                                    if( !not_found ){
-                                        /* Accept that choice */
-                                        (*cp) = k;
-                                        item = TRUE;
-                                        done = TRUE;
-                                        break;
-                                    }
-                               }                               
+                                       /* Validate the item */
+                                       else if (!get_item_okay(k))
+                                       {
+                                               not_found = TRUE;
+                                       }
+
+                                       if (!not_found)
+                                       {
+                                               /* Accept that choice */
+                                               (*cp) = k;
+                                               item = TRUE;
+                                               done = TRUE;
+                                               break;
+                                       }
+                               }
+                               else
+                               {
+                                       /* Look up the alphabetical tag */
+                                       if (get_tag_floor(&k, which, floor_list, floor_num))
+                                       {
+                                               /* Special index */
+                                               k = 0 - floor_list[k];
+
+                                               /* Accept that choice */
+                                               (*cp) = k;
+                                               item = TRUE;
+                                               done = TRUE;
+                                               break;
+                                       }
+                               }
 
                                /* Extract "query" setting */
                                ver = isupper(which);
@@ -7356,24 +7634,24 @@ if (!command_see && !use_menu) strcat(out_val, " '*'
                                /* Convert letter to inventory index */
                                if (command_wrk == (USE_INVEN))
                                {
-                                        if (which == '(') k = i1;
-                                        else if (which == ')') k = i2;
+                                       if (which == '(') k = i1;
+                                       else if (which == ')') k = i2;
                                        else k = label_to_inven(which);
                                }
 
                                /* Convert letter to equipment index */
                                else if (command_wrk == (USE_EQUIP))
                                {
-                                        if (which == '(') k = e1;
-                                        else if (which == ')') k = e2;
+                                       if (which == '(') k = e1;
+                                       else if (which == ')') k = e2;
                                        else k = label_to_equip(which);
                                }
 
                                /* Convert letter to floor index */
                                else if (command_wrk == USE_FLOOR)
                                {
-                                        if (which == '(') k = 0;
-                                        else if (which == ')') k = floor_num - 1;
+                                       if (which == '(') k = 0;
+                                       else if (which == ')') k = floor_num - 1;
                                        else k = islower(which) ? A2I(which) : -1;
                                        if (k < 0 || k >= floor_num || k >= 23)
                                        {
@@ -7472,8 +7750,6 @@ static bool py_pickup_floor_aux(void)
 {
        s16b this_o_idx;
 
-       object_type *o_ptr;
-
        cptr q, s;
 
        int item;
@@ -7499,9 +7775,6 @@ static bool py_pickup_floor_aux(void)
                return (FALSE);
        }
 
-       /* Access the object */
-       o_ptr = &o_list[this_o_idx];
-
        /* Pick up the object */
        py_pickup_aux(this_o_idx);
 
@@ -7549,8 +7822,8 @@ void py_pickup_floor(int pickup)
                {
                        /* Message */
 #ifdef JP
-                msg_format(" $%ld ¤Î²ÁÃͤ¬¤¢¤ë%s¤ò¸«¤Ä¤±¤¿¡£",
-                           (long)o_ptr->pval, o_name);
+               msg_format(" $%ld ¤Î²ÁÃͤ¬¤¢¤ë%s¤ò¸«¤Ä¤±¤¿¡£",
+                          (long)o_ptr->pval, o_name);
 #else
                        msg_format("You have found %ld gold pieces worth of %s.",
                                (long) o_ptr->pval, o_name);
@@ -7626,7 +7899,7 @@ void py_pickup_floor(int pickup)
 
                        /* Message */
 #ifdef JP
-                                msg_format("%s¤¬¤¢¤ë¡£", o_name);
+                               msg_format("%s¤¬¤¢¤ë¡£", o_name);
 #else
                        msg_format("You see %s.", o_name);
 #endif
@@ -7674,7 +7947,7 @@ void py_pickup_floor(int pickup)
 
                        /* Message */
 #ifdef JP
-                                msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
+                               msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
 #else
                        msg_format("You have no room for %s.", o_name);
 #endif
@@ -7686,7 +7959,7 @@ void py_pickup_floor(int pickup)
                {
                        /* Message */
 #ifdef JP
-                        msg_format("¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£", o_name);
+                       msg_format("¥¶¥Ã¥¯¤Ë¤Ï¾²¤Ë¤¢¤ë¤É¤Î¥¢¥¤¥Æ¥à¤âÆþ¤é¤Ê¤¤¡£", o_name);
 #else
                        msg_print("You have no room for any of the objects on the floor.");
 #endif