OSDN Git Service

誤簡易鑑定が装備警告に反映されないので修正。(討論スレ8 877さんのパッチをいただきました)
[hengband/hengband.git] / src / cmd3.c
index d12c54b..cf25c74 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
 
 
@@ -409,8 +407,10 @@ void do_cmd_wield(void)
                return;
        }
 
-       if (object_is_cursed(o_ptr) && confirm_wear &&
-           (object_is_known(o_ptr) || (o_ptr->ident & IDENT_SENSE)))
+       if (confirm_wear &&
+               ((object_is_cursed(o_ptr) && object_is_known(o_ptr)) ||
+               ((o_ptr->ident & IDENT_SENSE) &&
+                       (FEEL_BROKEN <= o_ptr->feeling) && (o_ptr->feeling <= FEEL_CURSED))))
        {
                char dummy[MAX_NLEN+80];
 
@@ -532,43 +532,40 @@ msg_print("
        /* Wear the new stuff */
        object_copy(o_ptr, q_ptr);
 
+       /* Player touches it */
+       o_ptr->marked |= OM_TOUCHED;
+
        /* Increase the weight */
        p_ptr->total_weight += q_ptr->weight;
 
        /* 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
+               if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_LARM) && CAN_TWO_HANDS_WIELDING())
+                       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
+               if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(FALSE) == EMPTY_HAND_RARM) && CAN_TWO_HANDS_WIELDING())
+                       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:
@@ -664,7 +661,7 @@ void kamaenaoshi(int item)
                                p_ptr->total_weight += o_ptr->weight;
                                inven_item_increase(INVEN_LARM, -((int)o_ptr->number));
                                inven_item_optimize(INVEN_LARM);
-                               if (object_allow_two_hands_wielding(o_ptr) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
+                               if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
 #ifdef JP
                                        msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
 #else
@@ -674,12 +671,12 @@ 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
                        {
-                               if (object_allow_two_hands_wielding(o_ptr) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
+                               if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
 #ifdef JP
                                        msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
 #else
@@ -695,7 +692,7 @@ void kamaenaoshi(int item)
 
                if (buki_motteruka(INVEN_RARM))
                {
-                       if (object_allow_two_hands_wielding(o_ptr) && (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE)))
+                       if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
 #ifdef JP
                                msg_format("%s¤òξ¼ê¤Ç¹½¤¨¤¿¡£", o_name);
 #else
@@ -922,7 +919,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))
@@ -1243,9 +1240,9 @@ void do_cmd_observe(void)
 
        /* Describe it fully */
 #ifdef JP
-       if (!screen_object(o_ptr, TRUE)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
+       if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
 #else
-       if (!screen_object(o_ptr, TRUE)) msg_print("You see nothing special.");
+       if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print("You see nothing special.");
 #endif
 
 }