OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / store.c
index 51ea9c3..98aa6e4 100644 (file)
@@ -1656,8 +1656,6 @@ bool combine_and_reorder_home(int store_num)
 
                /* Take note */
                flag = TRUE;
-
-               /* Get local object */
                j_ptr = &forge;
 
                /* Save a copy of the moving item */
@@ -2094,8 +2092,6 @@ static void store_create(void)
                        level = rand_range(1, STORE_OBJ_LEVEL);
                }
 
-
-               /* Get local object */
                q_ptr = &forge;
 
                /* Create a new object of the chosen kind */
@@ -3483,8 +3479,6 @@ static void store_purchase(void)
 
        /* Assume the player wants just one of them */
        amt = 1;
-
-       /* Get local object */
        j_ptr = &forge;
 
        /* Get a copy of the object */
@@ -3535,8 +3529,6 @@ msg_format("一つにつき $%ldです。", (long)(best));
                /* Allow user abort */
                if (amt <= 0) return;
        }
-
-       /* Get local object */
        j_ptr = &forge;
 
        /* Get desired object */
@@ -3676,8 +3668,6 @@ msg_format("%sを $%ldで購入しました。", o_name, (long)price);
                                {
                                        o_ptr->pval -= j_ptr->pval;
                                }
-
-                               /* Handle stuff */
                                handle_stuff();
 
                                /* Note how many slots the store used to have */
@@ -3790,8 +3780,6 @@ msg_format("%sを $%ldで購入しました。", o_name, (long)price);
                msg_format("You have %s (%c).",
 #endif
  o_name, index_to_label(item_new));
-
-               /* Handle stuff */
                handle_stuff();
 
                /* Take note if we take the last one */
@@ -3952,8 +3940,6 @@ static void store_sell(void)
                /* Allow user abort */
                if (amt <= 0) return;
        }
-
-       /* Get local object */
        q_ptr = &forge;
 
        /* Get a copy of the object */
@@ -4055,8 +4041,6 @@ static void store_sell(void)
 
                        /* Identify it */
                        identify_item(o_ptr);
-
-                       /* Get local object */
                        q_ptr = &forge;
 
                        /* Get a copy of the object */
@@ -4116,8 +4100,6 @@ msg_format("%sを $%ldで売却しました。", o_name, (long)price);
                                autopick_alter_item(item, FALSE);
 
                        inven_item_optimize(item);
-
-                       /* Handle stuff */
                        handle_stuff();
 
                        /* The store gets that (known) item */
@@ -4178,8 +4160,6 @@ msg_format("%sを $%ldで売却しました。", o_name, (long)price);
                inven_item_increase(item, -amt);
                inven_item_describe(item);
                inven_item_optimize(item);
-
-               /* Handle stuff */
                handle_stuff();
 
                /* Let the home carry it */
@@ -4209,8 +4189,6 @@ msg_format("%sを $%ldで売却しました。", o_name, (long)price);
                inven_item_increase(item, -amt);
                inven_item_describe(item);
                inven_item_optimize(item);
-
-               /* Handle stuff */
                handle_stuff();
 
                /* Let the home carry it */
@@ -4245,35 +4223,18 @@ static void store_examine(void)
        char        o_name[MAX_NLEN];
        char        out_val[160];
 
-
        /* Empty? */
        if (st_ptr->stock_num <= 0)
        {
                if (cur_store_num == STORE_HOME)
-#ifdef JP
-                       msg_print("我が家には何も置いてありません。");
-#else
-                       msg_print("Your home is empty.");
-#endif
-
+                       msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
                else if (cur_store_num == STORE_MUSEUM)
-#ifdef JP
-                       msg_print("博物館には何も置いてありません。");
-#else
-                       msg_print("Museum is empty.");
-#endif
-
+                       msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
                else
-#ifdef JP
-                       msg_print("現在商品の在庫を切らしています。");
-#else
-                       msg_print("I am currently out of stock.");
-#endif
-
+                       msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
                return;
        }
 
-
        /* Find the number of objects on this and following pages */
        i = (st_ptr->stock_num - store_top);
 
@@ -4281,12 +4242,7 @@ static void store_examine(void)
        if (i > store_bottom) i = store_bottom;
 
        /* Prompt */
-#ifdef JP
-sprintf(out_val, "どれを調べますか?");
-#else
-       sprintf(out_val, "Which item do you want to examine? ");
-#endif
-
+       sprintf(out_val, _("どれを調べますか?", "Which item do you want to examine? "));
 
        /* Get the item number to be examined */
        if (!get_stock(&item, out_val, 0, i - 1)) return;
@@ -4301,32 +4257,15 @@ sprintf(out_val, "どれを調べますか?");
        if (!(o_ptr->ident & IDENT_MENTAL))
        {
                /* This can only happen in the home */
-#ifdef JP
-msg_print("このアイテムについて特に知っていることはない。");
-#else
-               msg_print("You have no special knowledge about that item.");
-#endif
-
+               msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
                return;
        }
 
-       /* Description */
        object_desc(o_name, o_ptr, 0);
-#ifdef JP
-msg_format("%sを調べている...", o_name);
-#else
-       msg_format("Examining %s...", o_name);
-#endif
-
+       msg_format(_("%sを調べている...", "Examining %s..."), o_name);
 
-       /* Describe it fully */
        if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL))
-#ifdef JP
-msg_print("特に変わったところはないようだ。");
-#else
-               msg_print("You see nothing special.");
-#endif
-
+               msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
 
        return;
 }
@@ -4339,21 +4278,16 @@ msg_print("特に変わったところはないようだ。");
  */
 static void museum_remove_object(void)
 {
-       int         i;
+       int i;
        COMMAND_CODE item;
        object_type *o_ptr;
-       char        o_name[MAX_NLEN];
-       char        out_val[160];
+       char o_name[MAX_NLEN];
+       char out_val[160];
 
        /* Empty? */
        if (st_ptr->stock_num <= 0)
        {
-#ifdef JP
-               msg_print("博物館には何も置いてありません。");
-#else
-               msg_print("Museum is empty.");
-#endif
-
+               msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
                return;
        }
 
@@ -4364,11 +4298,7 @@ static void museum_remove_object(void)
        if (i > store_bottom) i = store_bottom;
 
        /* Prompt */
-#ifdef JP
-       sprintf(out_val, "どのアイテムの展示をやめさせますか?");
-#else
-       sprintf(out_val, "Which item do you want to order to remove? ");
-#endif
+       sprintf(out_val, _("どのアイテムの展示をやめさせますか?", "Which item do you want to order to remove? "));
 
        /* Get the item number to be removed */
        if (!get_stock(&item, out_val, 0, i - 1)) return;
@@ -4379,22 +4309,12 @@ static void museum_remove_object(void)
        /* Get the actual item */
        o_ptr = &st_ptr->stock[item];
 
-       /* Description */
        object_desc(o_name, o_ptr, 0);
 
-#ifdef JP
-       msg_print("展示をやめさせたアイテムは二度と見ることはできません!");
-       if (!get_check(format("本当に%sの展示をやめさせますか?", o_name))) return;
-#else
-       msg_print("You cannot see items which is removed from the Museum!");
-       if (!get_check(format("Really order to remove %s from the Museum? ", o_name))) return;
-#endif
+       msg_print(_("展示をやめさせたアイテムは二度と見ることはできません!", "You cannot see items which is removed from the Museum!"));
+       if (!get_check(format(_("本当に%sの展示をやめさせますか?", "Really order to remove %s from the Museum? "), o_name))) return;
 
-#ifdef JP
-       msg_format("%sの展示をやめさせた。", o_name);
-#else
-       msg_format("You ordered to remove %s.", o_name);
-#endif
+       msg_format(_("%sの展示をやめさせた。", "You ordered to remove %s."), o_name);
 
        /* Remove the items from the home */
        store_item_increase(item, -o_ptr->number);
@@ -4460,11 +4380,7 @@ static void store_process_command(void)
                case '-':
                {
                        if (st_ptr->stock_num <= store_bottom) {
-#ifdef JP
-                               msg_print("これで全部です。");
-#else
-                               msg_print("Entire inventory is shown.");
-#endif
+                               msg_print(_("これで全部です。", "Entire inventory is shown."));
                        }
                        else{
                                store_top -= store_bottom;
@@ -4482,12 +4398,7 @@ static void store_process_command(void)
                {
                        if (st_ptr->stock_num <= store_bottom)
                        {
-#ifdef JP
-                               msg_print("これで全部です。");
-#else
-                               msg_print("Entire inventory is shown.");
-#endif
-
+                               msg_print(_("これで全部です。", "Entire inventory is shown."));
                        }
                        else
                        {
@@ -4515,7 +4426,6 @@ static void store_process_command(void)
                        break;
                }
 
-               /* Redraw */
                case KTRL('R'):
                {
                        do_cmd_redraw();
@@ -4604,8 +4514,6 @@ static void store_process_command(void)
                        break;
                }
 
-
-
                /*** Use various objects ***/
 
                /* Browse a book */
@@ -4797,13 +4705,8 @@ static void store_process_command(void)
                        }
                        else
                        {
-#ifdef JP
-                               msg_print("そのコマンドは店の中では使えません。");
-#else
-                               msg_print("That command does not work in stores.");
-#endif
+                               msg_print(_("そのコマンドは店の中では使えません。", "That command does not work in stores."));
                        }
-
                        break;
                }
        }
@@ -4846,12 +4749,7 @@ void do_cmd_store(void)
        /* Verify a store */
        if (!cave_have_flag_grid(c_ptr, FF_STORE))
        {
-#ifdef JP
-               msg_print("ここには店がありません。");
-#else
-               msg_print("You see no store here.");
-#endif
-
+               msg_print(_("ここには店がありません。", "You see no store here."));
                return;
        }
 
@@ -4867,12 +4765,7 @@ void do_cmd_store(void)
        if ((town[p_ptr->town_num].store[which].store_open >= turn) ||
            (ironman_shops))
        {
-#ifdef JP
-               msg_print("ドアに鍵がかかっている。");
-#else
-               msg_print("The doors are locked.");
-#endif
-
+               msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
                p_ptr->town_num = old_town_num;
                return;
        }
@@ -5056,8 +4949,6 @@ void do_cmd_store(void)
 
                /* Notice stuff */
                notice_stuff();
-
-               /* Handle stuff */
                handle_stuff();
 
                /* Pack Overflow */
@@ -5119,8 +5010,6 @@ void do_cmd_store(void)
                                msg_print("Your pack overflows!");
 #endif
 
-
-                               /* Get local object */
                                q_ptr = &forge;
 
                                /* Grab a copy of the item */
@@ -5140,8 +5029,6 @@ void do_cmd_store(void)
                                inven_item_increase(item, -255);
                                inven_item_describe(item);
                                inven_item_optimize(item);
-
-                               /* Handle stuff */
                                handle_stuff();
 
                                /* Let the home carry it */
@@ -5200,7 +5087,6 @@ void do_cmd_store(void)
        /* Redraw entire screen */
        p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
 
-       /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);