OSDN Git Service

inkey_special()自体のバグを直すので、その前に取り敢えず
[hengband/hengband.git] / src / cmd3.c
index 688ebf8..0a7308a 100644 (file)
@@ -47,12 +47,11 @@ void do_cmd_inven(void)
 #ifdef JP
        sprintf(out_val, "»ý¤Áʪ¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ",
            lbtokg1(p_ptr->total_weight) , lbtokg2(p_ptr->total_weight) ,
-           (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) 
-/ 2));
+           (p_ptr->total_weight * 100) / weight_limit());
 #else
        sprintf(out_val, "Inventory: carrying %d.%d pounds (%ld%% of capacity). Command: ",
            (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
-           (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2));
+           (p_ptr->total_weight * 100) / weight_limit());
 #endif
 
 
@@ -122,12 +121,11 @@ void do_cmd_equip(void)
 #ifdef JP
        sprintf(out_val, "ÁõÈ÷¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ",
            lbtokg1(p_ptr->total_weight) , lbtokg2(p_ptr->total_weight) ,
-           (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) 
-/ 2));
+           (p_ptr->total_weight * 100) / weight_limit());
 #else
        sprintf(out_val, "Equipment: carrying %d.%d pounds (%ld%% of capacity). Command: ",
            (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
-           (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2));
+           (p_ptr->total_weight * 100) / weight_limit());
 #endif
 
 
@@ -201,6 +199,8 @@ static bool item_tester_hook_melee_weapon(object_type *o_ptr)
 }
 
 
+bool select_ring_slot = FALSE;
+
 /*
  * Wield or wear a single item from the pack or floor
  */
@@ -351,23 +351,40 @@ void do_cmd_wield(void)
 
        /* Rings */
        case TV_RING:
+               /* Choose a ring slot */
                if (inventory[INVEN_LEFT].k_idx && inventory[INVEN_RIGHT].k_idx)
                {
-                       /* Restrict the choices */
-                       item_tester_tval = TV_RING;
-                       item_tester_no_ryoute = TRUE;
-
-                       /* Choose a ring from the equipment only */
 #ifdef JP
                        q = "¤É¤Á¤é¤Î»ØÎؤȼè¤êÂؤ¨¤Þ¤¹¤«?";
-                       s = "¤ª¤Ã¤È¡£";
 #else
                        q = "Replace which ring? ";
-                       s = "Oops.";
+#endif
+               }
+               else
+               {
+#ifdef JP
+                       q = "¤É¤Á¤é¤Î¼ê¤ËÁõÈ÷¤·¤Þ¤¹¤«?";
+#else
+                       q = "Equip which hand? ";
+#endif
+               }
+
+#ifdef JP
+               s = "¤ª¤Ã¤È¡£";
+#else
+               s = "Oops.";
 #endif
 
-                       if (!get_item(&slot, q, s, (USE_EQUIP))) return;
+               /* Restrict the choices */
+               select_ring_slot = TRUE;
+               item_tester_no_ryoute = TRUE;
+
+               if (!get_item(&slot, q, s, (USE_EQUIP)))
+               {
+                       select_ring_slot = FALSE;
+                       return;
                }
+               select_ring_slot = FALSE;
                break;
        }
 
@@ -519,37 +536,31 @@ msg_print("
        /* Increment the equip counter by hand */
        equip_cnt++;
 
+#ifdef JP
+#define STR_WIELD_RARM "%s(%c)¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿¡£"
+#define STR_WIELD_LARM "%s(%c)¤òº¸¼ê¤ËÁõÈ÷¤·¤¿¡£"
+#define STR_WIELD_ARMS "%s(%c)¤òξ¼ê¤Ç¹½¤¨¤¿¡£"
+#else
+#define STR_WIELD_RARM "You are wielding %s (%c) in your right hand."
+#define STR_WIELD_LARM "You are wielding %s (%c) in your left hand."
+#define STR_WIELD_ARMS "You are wielding %s (%c) with both hands."
+#endif
+
        /* Where is the item now */
        switch (slot)
        {
        case INVEN_RARM:
                if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_LARM) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
-#ifdef JP
-                       act = "%s(%c)¤òξ¼ê¤Ç¹½¤¨¤¿¡£";
-#else
-                       act = "You are wielding %s (%c) with both hands.";
-#endif
+                       act = STR_WIELD_ARMS;
                else
-#ifdef JP
-                       act = (left_hander ? "%s(%c)¤òº¸¼ê¤ËÁõÈ÷¤·¤¿¡£" : "%s(%c)¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿¡£");
-#else
-                       act = (left_hander ? "You are wielding %s (%c) on left hand." : "You are wielding %s (%c) on right hand.");
-#endif
+                       act = (left_hander ? STR_WIELD_LARM : STR_WIELD_RARM);
                break;
 
        case INVEN_LARM:
                if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_RARM) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
-#ifdef JP
-                       act = "%s(%c)¤òξ¼ê¤Ç¹½¤¨¤¿¡£";
-#else
-                       act = "You are wielding %s (%c) with both hands.";
-#endif
+                       act = STR_WIELD_ARMS;
                else
-#ifdef JP
-                       act = (left_hander ? "%s(%c)¤ò±¦¼ê¤ËÁõÈ÷¤·¤¿¡£" : "%s(%c)¤òº¸¼ê¤ËÁõÈ÷¤·¤¿¡£");
-#else
-                       act = (left_hander ? "You are wielding %s (%c) on right hand." : "You are wielding %s (%c) on left hand.");
-#endif
+                       act = (left_hander ? STR_WIELD_RARM : STR_WIELD_LARM);
                break;
 
        case INVEN_BOW:
@@ -655,7 +666,7 @@ void kamaenaoshi(int item)
 #ifdef JP
                                        msg_format("%s¤ò%s¤Ç¹½¤¨¤¿¡£", o_name, (left_hander ? "º¸¼ê" : "±¦¼ê"));
 #else
-                                       msg_format("You are wielding %s on %s hand.", o_name, (left_hander ? "left":"right"));
+                                       msg_format("You are wielding %s in your %s hand.", o_name, (left_hander ? "left":"right"));
 #endif
                        }
                        else
@@ -903,7 +914,7 @@ static bool high_level_book(object_type *o_ptr)
            (o_ptr->tval == TV_CHAOS_BOOK) ||
            (o_ptr->tval == TV_DEATH_BOOK) ||
            (o_ptr->tval == TV_TRUMP_BOOK) ||
-           (o_ptr->tval == TV_ENCHANT_BOOK) ||
+           (o_ptr->tval == TV_CRAFT_BOOK) ||
            (o_ptr->tval == TV_DAEMON_BOOK) ||
            (o_ptr->tval == TV_CRUSADE_BOOK) ||
            (o_ptr->tval == TV_MUSIC_BOOK))