OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / store.c
index 1b40d48..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);
        }
 }
@@ -1537,7 +1518,7 @@ static bool store_will_buy(object_type *o_ptr)
                }
        }
 
-       /* XXX XXX XXX Ignore "worthless" items */
+       /* Ignore "worthless" items */
        if (object_value(o_ptr) <= 0) return (FALSE);
 
        /* Assume okay */
@@ -1575,7 +1556,6 @@ bool combine_and_reorder_home(int store_num)
                /* Combine the items in the home (backwards) */
                for (i = st_ptr->stock_num - 1; i > 0; i--)
                {
-                       /* Get the item */
                        o_ptr = &st_ptr->stock[i];
 
                        /* Skip empty items */
@@ -1586,7 +1566,6 @@ bool combine_and_reorder_home(int store_num)
                        {
                                int max_num;
 
-                               /* Get the item */
                                j_ptr = &st_ptr->stock[j];
 
                                /* Skip empty items */
@@ -1658,7 +1637,6 @@ bool combine_and_reorder_home(int store_num)
        /* Re-order the items in the home (forwards) */
        for (i = 0; i < st_ptr->stock_num; i++)
        {
-               /* Get the item */
                o_ptr = &st_ptr->stock[i];
 
                /* Skip empty slots */
@@ -1935,7 +1913,6 @@ static void store_item_increase(INVENTORY_IDX item, int num)
        int             cnt;
        object_type *o_ptr;
 
-       /* Get the item */
        o_ptr = &st_ptr->stock[item];
 
        /* Verify the number */
@@ -1960,7 +1937,6 @@ static void store_item_optimize(INVENTORY_IDX item)
        int             j;
        object_type *o_ptr;
 
-       /* Get the item */
        o_ptr = &st_ptr->stock[item];
 
        /* Must exist */
@@ -2259,10 +2235,8 @@ static void display_entry(int pos)
        char            o_name[MAX_NLEN];
        char            out_val[160];
 
-
        int maxwid = 75;
 
-       /* Get the item */
        o_ptr = &st_ptr->stock[pos];
 
        /* Get the "offset" */
@@ -2292,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);
@@ -2617,8 +2590,6 @@ static int get_stock(COMMAND_CODE *com_val, cptr pmt, int i, int j)
        char    out_val[160];
        char    lo, hi;
 
-#ifdef ALLOW_REPEAT /* TNB */
-
        /* Get the item index */
        if (repeat_pull(com_val))
        {
@@ -2630,9 +2601,7 @@ static int get_stock(COMMAND_CODE *com_val, cptr pmt, int i, int j)
                }
        }
 
-#endif /* ALLOW_REPEAT -- TNB */
-
-       /* Paranoia XXX XXX XXX */
+       /* Paranoia */
        msg_print(NULL);
 
 
@@ -2675,7 +2644,6 @@ static int get_stock(COMMAND_CODE *com_val, cptr pmt, int i, int j)
                        break;
                }
 
-               /* Oops */
                bell();
        }
 
@@ -2685,12 +2653,8 @@ static int get_stock(COMMAND_CODE *com_val, cptr pmt, int i, int j)
        /* Cancel */
        if (command == ESCAPE) return (FALSE);
 
-#ifdef ALLOW_REPEAT /* TNB */
-
        repeat_push(*com_val);
 
-#endif /* ALLOW_REPEAT -- TNB */
-
        /* Success */
        return (TRUE);
 }
@@ -2833,7 +2797,7 @@ static int get_haggle(cptr pmt, s32b *poffer, PRICE price, int final)
        }
 
 
-       /* Paranoia XXX XXX XXX */
+       /* Paranoia */
        msg_print(NULL);
 
 
@@ -3287,7 +3251,7 @@ static bool sell_haggle(object_type *o_ptr, s32b *price)
        final_ask *= o_ptr->number;
 
 
-       /* XXX XXX XXX Display commands */
+       /* Display commands */
 
        /* Haggling parameters */
        min_per = ot_ptr->haggle_per;
@@ -3921,7 +3885,6 @@ static void store_sell(void)
        /* Only allow items the store will buy */
        item_tester_hook = store_will_buy;
 
-       /* Get an item */
        /* 我が家でおかしなメッセージが出るオリジナルのバグを修正 */
        if (cur_store_num == STORE_HOME)
        {
@@ -3966,7 +3929,6 @@ static void store_sell(void)
        /* Hack -- Cannot remove cursed items */
        if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
        {
-               /* Oops */
 #ifdef JP
                msg_print("ふーむ、どうやらそれは呪われているようだね。");
 #else
@@ -3974,7 +3936,6 @@ static void store_sell(void)
 #endif
 
 
-               /* Nope */
                return;
        }
 
@@ -4482,13 +4443,9 @@ static bool leave_store = FALSE;
  */
 static void store_process_command(void)
 {
-#ifdef ALLOW_REPEAT /* TNB */
-
        /* Handle repeating the last command */
        repeat_check();
 
-#endif /* ALLOW_REPEAT -- TNB */
-
        if (rogue_like_commands && command_cmd == 'l')
        {
                command_cmd = 'x';      /* hack! */
@@ -5046,7 +5003,7 @@ void do_cmd_store(void)
 #endif
                }
 
-               /* Shop commands XXX XXX XXX */
+               /* Shop commands */
                else
                {
 #ifdef JP
@@ -5114,7 +5071,7 @@ void do_cmd_store(void)
                /* Handle stuff */
                handle_stuff();
 
-               /* XXX XXX XXX Pack Overflow */
+               /* Pack Overflow */
                if (inventory[INVEN_PACK].k_idx)
                {
                        INVENTORY_IDX item = INVEN_PACK;
@@ -5222,7 +5179,7 @@ void do_cmd_store(void)
 
        p_ptr->town_num = old_town_num;
 
-       /* Free turn XXX XXX XXX */
+       /* Free turn */
        p_ptr->energy_use = 100;
 
 
@@ -5239,7 +5196,7 @@ void do_cmd_store(void)
        /* Allow expanding macros */
        get_com_no_macros = FALSE;
 
-       /* Flush messages XXX XXX XXX */
+       /* Flush messages */
        msg_print(NULL);
 
 
@@ -5314,7 +5271,6 @@ void store_shuffle(int which)
        {
                object_type *o_ptr;
 
-               /* Get the item */
                o_ptr = &st_ptr->stock[i];
 
                if (!object_is_artifact(o_ptr))
@@ -5326,11 +5282,7 @@ void store_shuffle(int which)
                        o_ptr->ident &= ~(IDENT_FIXED);
 
                        /* Mega-Hack -- Note that the item is "on sale" */
-#ifdef JP
-                       o_ptr->inscription = quark_add("売出中");
-#else
-                       o_ptr->inscription = quark_add("on sale");
-#endif
+                       o_ptr->inscription = quark_add(_("売出中", "on sale"));
                }
        }
 }