OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / store.c
index c5e93a4..f169c6e 100644 (file)
@@ -564,56 +564,37 @@ static void purchase_analyze(PRICE price, PRICE value, PRICE guess)
        /* Item was worthless, but we bought it */
        if ((value <= 0) && (price > value))
        {
-               /* Comment */
                msg_print(comment_7a[randint0(MAX_COMMENT_7A)]);
-
                chg_virtue(V_HONOUR, -1);
                chg_virtue(V_JUSTICE, -1);
-
                sound(SOUND_STORE1);
        }
 
        /* Item was cheaper than we thought, and we paid more than necessary */
        else if ((value < guess) && (price > value))
        {
-               /* Comment */
                msg_print(comment_7b[randint0(MAX_COMMENT_7B)]);
-
                chg_virtue(V_JUSTICE, -1);
-               if (one_in_(4))
-                       chg_virtue(V_HONOUR, -1);
-
+               if (one_in_(4)) chg_virtue(V_HONOUR, -1);
                sound(SOUND_STORE2);
        }
 
        /* Item was a good bargain, and we got away with it */
        else if ((value > guess) && (value < (4 * guess)) && (price < value))
        {
-               /* Comment */
                msg_print(comment_7c[randint0(MAX_COMMENT_7C)]);
-
-               if (one_in_(4))
-                       chg_virtue(V_HONOUR, -1);
-               else if (one_in_(4))
-                       chg_virtue(V_HONOUR, 1);
-
+               if (one_in_(4)) chg_virtue(V_HONOUR, -1);
+               else if (one_in_(4)) chg_virtue(V_HONOUR, 1);
                sound(SOUND_STORE3);
        }
 
        /* Item was a great bargain, and we got away with it */
        else if ((value > guess) && (price < value))
        {
-               /* Comment */
                msg_print(comment_7d[randint0(MAX_COMMENT_7D)]);
-
-               if (one_in_(2))
-                       chg_virtue(V_HONOUR, -1);
-               if (one_in_(4))
-                       chg_virtue(V_HONOUR, 1);
-
-               if (10 * price < value)
-                       chg_virtue(V_SACRIFICE, 1);
-
+               if (one_in_(2)) chg_virtue(V_HONOUR, -1);
+               if (one_in_(4)) chg_virtue(V_HONOUR, 1);
+               if (10 * price < value) chg_virtue(V_SACRIFICE, 1);
                sound(SOUND_STORE4);
        }
 }
@@ -2285,18 +2266,17 @@ static void display_entry(int pos)
                /* Leave room for weights, if necessary -DRS- */
                if (show_weights) maxwid -= 10;
 
-               /* Describe the object */
                object_desc(o_name, o_ptr, 0);
                o_name[maxwid] = '\0';
                c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
 
                /* Show weights */
-               if (show_weights)
+               if(show_weights)
                {
                        /* Only show the weight of an individual item */
                        int wgt = o_ptr->weight;
 #ifdef JP
-                       sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
+                       sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
                        put_str(out_val, i+6, 67);
 #else
                        (void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10);