OSDN Git Service

[Refactor] #38824 get_item() を choose_object() に置換完了。 / Replaced get_item() to choose...
[hengband/hengband.git] / src / store.c
index 984c248..2114f7b 100644 (file)
  */
 
 #include "angband.h"
+#include "cmd-item.h"
+#include "cmd-zapwand.h"
+#include "cmd-magiceat.h"
+#include "store.h"
 
 #define MIN_STOCK 12
 
@@ -340,7 +344,7 @@ static void say_comment_1(void)
  * @param annoyed 店主のいらつき度
  * @return なし
  */
-static void say_comment_2(s32b value, int annoyed)
+static void say_comment_2(PRICE value, int annoyed)
 {
        char    tmp_val[80];
 
@@ -381,7 +385,7 @@ static void say_comment_2(s32b value, int annoyed)
  * @param annoyed 店主のいらつき度
  * @return なし
  */
-static void say_comment_3(s32b value, int annoyed)
+static void say_comment_3(PRICE value, int annoyed)
 {
        char    tmp_val[80];
 
@@ -556,65 +560,42 @@ static cptr comment_7d[MAX_COMMENT_7D] =
  * @details 
  * We paid "price", it was worth "value", and we thought it was worth "guess"
  */
-static void purchase_analyze(s32b price, s32b value, s32b guess)
+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(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);
-
-               /* Sound */
+               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);
-
-               /* Sound */
+               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);
-
-               /* Sound */
+               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);
        }
 }
@@ -963,7 +944,7 @@ static s32b price_item(object_type *o_ptr, int greed, bool flip)
 static void mass_produce(object_type *o_ptr)
 {
        int size = 1;
-       int discount = 0;
+       DISCOUNT_RATE discount = 0;
 
        s32b cost = object_value(o_ptr);
 
@@ -1099,18 +1080,8 @@ static void mass_produce(object_type *o_ptr)
                discount = 90;
        }
 
-
        if (o_ptr->art_name)
        {
-               if (cheat_peek && discount)
-               {
-#ifdef JP
-msg_print("ランダムアーティファクトは値引きなし。");
-#else
-                       msg_print("No discount on random artifacts.");
-#endif
-
-               }
                discount = 0;
        }
 
@@ -1123,7 +1094,7 @@ msg_print("ランダムアーティファクトは値引きなし。");
        /* Ensure that mass-produced rods and wands get the correct pvals. */
        if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
        {
-               o_ptr->pval *= o_ptr->number;
+               o_ptr->pval *= (PARAMETER_VALUE)o_ptr->number;
        }
 }
 
@@ -1326,7 +1297,7 @@ static int store_check_num(object_type *o_ptr)
  */
 static bool is_blessed(object_type *o_ptr)
 {
-       u32b flgs[TR_FLAG_SIZE];
+       BIT_FLAGS flgs[TR_FLAG_SIZE];
        object_flags(o_ptr, flgs);
        if (have_flag(flgs, TR_BLESSED)) return (TRUE);
        else return (FALSE);
@@ -1548,7 +1519,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 */
@@ -1586,7 +1557,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 */
@@ -1597,7 +1567,6 @@ bool combine_and_reorder_home(int store_num)
                        {
                                int max_num;
 
-                               /* Get the item */
                                j_ptr = &st_ptr->stock[j];
 
                                /* Skip empty items */
@@ -1632,8 +1601,8 @@ bool combine_and_reorder_home(int store_num)
                                        }
                                        else
                                        {
-                                               int old_num = o_ptr->number;
-                                               int remain = j_ptr->number + o_ptr->number - max_num;
+                                               ITEM_NUMBER old_num = o_ptr->number;
+                                               ITEM_NUMBER remain = j_ptr->number + o_ptr->number - max_num;
 
                                                /* Add together the item counts */
                                                object_absorb(j_ptr, o_ptr);
@@ -1656,8 +1625,6 @@ bool combine_and_reorder_home(int store_num)
 
                                        /* Take note */
                                        combined = TRUE;
-
-                                       /* Done */
                                        break;
                                }
                        }
@@ -1670,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 */
@@ -1690,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 */
@@ -1940,13 +1904,13 @@ static int store_carry(object_type *o_ptr)
  * Increase, by a given amount, the number of a certain item
  * in a certain store. This can result in zero items.
  * </pre>
+ * @todo numは本来ITEM_NUMBER型にしたい。
  */
-static void store_item_increase(int item, int num)
+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 */
@@ -1956,7 +1920,7 @@ static void store_item_increase(int item, int num)
        num = cnt - o_ptr->number;
 
        /* Save the new number */
-       o_ptr->number += num;
+       o_ptr->number += (ITEM_NUMBER)num;
 }
 
 
@@ -1966,12 +1930,11 @@ static void store_item_increase(int item, int num)
  * @param item 削除したいアイテムのID
  * @return なし
  */
-static void store_item_optimize(int item)
+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 */
@@ -2048,10 +2011,11 @@ static bool black_market_crap(object_type *o_ptr)
  */
 static void store_delete(void)
 {
-       int what, num;
+       INVENTORY_IDX what;
+       int num;
 
        /* Pick a random slot */
-       what = randint0(st_ptr->stock_num);
+       what = (INVENTORY_IDX)randint0(st_ptr->stock_num);
 
        /* Determine how many items are here */
        num = st_ptr->stock[what].number;
@@ -2090,7 +2054,9 @@ static void store_delete(void)
  */
 static void store_create(void)
 {
-       int i, tries, level;
+       OBJECT_IDX i;
+       int tries;
+       DEPTH level;
 
        object_type forge;
        object_type *q_ptr;
@@ -2126,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 */
@@ -2195,7 +2159,7 @@ static void store_create(void)
  * @param minprice アイテムの最低販売価格
  * @return 割引を禁止するならTRUEを返す。
  */
-static bool noneedtobargain(s32b minprice)
+static bool noneedtobargain(PRICE minprice)
 {
        s32b good = st_ptr->good_buy;
        s32b bad = st_ptr->bad_buy;
@@ -2222,7 +2186,7 @@ static bool noneedtobargain(s32b minprice)
  * @param num 売買数 
  * @return なし
  */
-static void updatebargain(s32b price, s32b minprice, int num)
+static void updatebargain(PRICE price, PRICE minprice, int num)
 {
        /* Hack -- auto-haggle */
        if (!manual_haggle) return;
@@ -2264,13 +2228,11 @@ static void display_entry(int pos)
        object_type     *o_ptr;
        s32b            x;
 
-       char            o_name[MAX_NLEN];
+       GAME_TEXT o_name[MAX_NLEN];
        char            out_val[160];
 
-
        int maxwid = 75;
 
-       /* Get the item */
        o_ptr = &st_ptr->stock[pos];
 
        /* Get the "offset" */
@@ -2283,8 +2245,8 @@ static void display_entry(int pos)
        cur_col = 3;
        if (show_item_graph)
        {
-               byte a = object_attr(o_ptr);
-               char c = object_char(o_ptr);
+               TERM_COLOR a = object_attr(o_ptr);
+               SYMBOL_CODE c = object_char(o_ptr);
 
                Term_queue_bigchar(cur_col, i + 6, a, c, 0, 0);
                if (use_bigtile) cur_col++;
@@ -2300,18 +2262,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;
+                       WEIGHT 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);
@@ -2492,38 +2453,21 @@ static void display_store(void)
 {
        char buf[80];
 
-
-       /* Clear screen */
        Term_clear();
 
        /* The "Home" is special */
        if (cur_store_num == STORE_HOME)
        {
                /* Put the owner name */
-#ifdef JP
-               put_str("我が家", 3, 31);
-#else
-               put_str("Your Home", 3, 30);
-#endif
-
+               put_str(_("我が家", "Your Home"), 3, 31);
 
                /* Label the item descriptions */
-#ifdef JP
-               put_str("アイテムの一覧", 5, 4);
-#else
-               put_str("Item Description", 5, 3);
-#endif
-
+               put_str(_("アイテムの一覧", "Item Description"), 5, 4);
 
                /* If showing weights, show label */
                if (show_weights)
                {
-#ifdef JP
-                       put_str("重さ", 5, 72);
-#else
-                       put_str("Weight", 5, 70);
-#endif
-
+                       put_str(_("  重さ", "Weight"), 5, 70);
                }
        }
 
@@ -2531,30 +2475,15 @@ static void display_store(void)
        else if (cur_store_num == STORE_MUSEUM)
        {
                /* Put the owner name */
-#ifdef JP
-               put_str("博物館", 3, 31);
-#else
-               put_str("Museum", 3, 30);
-#endif
-
+               put_str(_("博物館", "Museum"), 3, 31);
 
                /* Label the item descriptions */
-#ifdef JP
-               put_str("アイテムの一覧", 5, 4);
-#else
-               put_str("Item Description", 5, 3);
-#endif
-
+               put_str(_("アイテムの一覧", "Item Description"), 5, 4);
 
                /* If showing weights, show label */
                if (show_weights)
                {
-#ifdef JP
-                       put_str("重さ", 5, 72);
-#else
-                       put_str("Weight", 5, 70);
-#endif
-
+                       put_str(_("  重さ", "Weight"), 5, 70);
                }
        }
 
@@ -2574,31 +2503,17 @@ static void display_store(void)
                prt(buf, 3, 50);
 
                /* Label the item descriptions */
-#ifdef JP
-               put_str("商品の一覧", 5, 7);
-#else
-               put_str("Item Description", 5, 3);
-#endif
+               put_str(_("商品の一覧", "Item Description"), 5, 5);
 
 
                /* If showing weights, show label */
                if (show_weights)
                {
-#ifdef JP
-                       put_str("重さ", 5, 62);
-#else
-                       put_str("Weight", 5, 60);
-#endif
-
+                       put_str(_("  重さ", "Weight"), 5, 60);
                }
 
                /* Label the asking price (in stores) */
-#ifdef JP
-               put_str("価格", 5, 73);
-#else
-               put_str("Price", 5, 72);
-#endif
-
+               put_str(_(" 価格", "Price"), 5, 72);
        }
 
        /* Display the current gold */
@@ -2619,13 +2534,11 @@ static void display_store(void)
  * @param j 選択範囲の最大値
  * @return 実際に選択したらTRUE、キャンセルしたらFALSE
  */
-static int get_stock(int *com_val, cptr pmt, int i, int j)
+static int get_stock(COMMAND_CODE *com_val, cptr pmt, int i, int j)
 {
-       char    command;
-       char    out_val[160];
-       char    lo, hi;
-
-#ifdef ALLOW_REPEAT /* TNB */
+       char command;
+       char out_val[160];
+       char lo, hi;
 
        /* Get the item index */
        if (repeat_pull(com_val))
@@ -2638,12 +2551,9 @@ static int get_stock(int *com_val, cptr pmt, int i, int j)
                }
        }
 
-#endif /* ALLOW_REPEAT -- TNB */
-
-       /* Paranoia XXX XXX XXX */
+       /* Paranoia */
        msg_print(NULL);
 
-
        /* Assume failure */
        *com_val = (-1);
 
@@ -2663,7 +2573,7 @@ static int get_stock(int *com_val, cptr pmt, int i, int j)
        /* Ask until done */
        while (TRUE)
        {
-               int k;
+               COMMAND_CODE k;
 
                /* Escape */
                if (!get_com(out_val, &command, FALSE)) break;
@@ -2683,22 +2593,16 @@ static int get_stock(int *com_val, cptr pmt, int i, int j)
                        break;
                }
 
-               /* Oops */
                bell();
        }
 
        /* Clear the prompt */
        prt("", 0, 0);
 
-       /* Cancel */
        if (command == ESCAPE) return (FALSE);
 
-#ifdef ALLOW_REPEAT /* TNB */
-
        repeat_push(*com_val);
 
-#endif /* ALLOW_REPEAT -- TNB */
-
        /* Success */
        return (TRUE);
 }
@@ -2787,7 +2691,7 @@ static s32b last_inc = 0L;
  * @param final 最終確定価格ならばTRUE
  * @return プレイヤーを締め出す場合TRUEを返す
  */
-static int get_haggle(cptr pmt, s32b *poffer, s32b price, int final)
+static int get_haggle(cptr pmt, s32b *poffer, PRICE price, int final)
 {
        s32b            i;
 
@@ -2841,7 +2745,7 @@ static int get_haggle(cptr pmt, s32b *poffer, s32b price, int final)
        }
 
 
-       /* Paranoia XXX XXX XXX */
+       /* Paranoia */
        msg_print(NULL);
 
 
@@ -2948,7 +2852,7 @@ static int get_haggle(cptr pmt, s32b *poffer, s32b price, int final)
  */
 static bool receive_offer(cptr pmt, s32b *poffer,
                          s32b last_offer, int factor,
-                         s32b price, int final)
+                         PRICE price, int final)
 {
        /* Haggle till done */
        while (TRUE)
@@ -3178,10 +3082,8 @@ static bool purchase_haggle(object_type *o_ptr, s32b *price)
                }
        }
 
-       /* Cancel */
        if (cancel) return (TRUE);
 
-       /* Update bargaining info */
        updatebargain(*price, final_ask, o_ptr->number);
 
        /* Do not cancel */
@@ -3240,7 +3142,6 @@ static bool sell_haggle(object_type *o_ptr, s32b *price)
                /* No reason to haggle */
                if (final_ask >= purse)
                {
-                       /* Message */
 #ifdef JP
                        msg_print("即座にこの金額にまとまった。");
 #else
@@ -3256,7 +3157,6 @@ static bool sell_haggle(object_type *o_ptr, s32b *price)
                /* No need to haggle */
                else if (noneed)
                {
-                       /* Message */
 #ifdef JP
                        msg_print("結局この金額にまとまった。");
 #else
@@ -3297,7 +3197,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;
@@ -3421,10 +3321,8 @@ static bool sell_haggle(object_type *o_ptr, s32b *price)
                }
        }
 
-       /* Cancel */
        if (cancel) return (TRUE);
 
-       /* Update bargaining info */
        updatebargain(*price, final_ask, o_ptr->number);
 
        /* Do not cancel */
@@ -3439,17 +3337,19 @@ static bool sell_haggle(object_type *o_ptr, s32b *price)
  */
 static void store_purchase(void)
 {
-       int i, amt, choice;
-       int item, item_new;
+       int i, choice;
+       COMMAND_CODE item, item_new;
+
+       ITEM_NUMBER amt;
 
-       s32b price, best;
+       PRICE price, best;
 
        object_type forge;
        object_type *j_ptr;
 
        object_type *o_ptr;
 
-       char o_name[MAX_NLEN];
+       GAME_TEXT o_name[MAX_NLEN];
 
        char out_val[160];
 
@@ -3527,8 +3427,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 */
@@ -3546,12 +3444,7 @@ static void store_purchase(void)
        /* Hack -- require room in pack */
        if (!inven_carry_okay(j_ptr))
        {
-#ifdef JP
-msg_print("そんなにアイテムを持てない。");
-#else
-               msg_print("You cannot carry that many different items.");
-#endif
-
+               msg_print(_("そんなにアイテムを持てない。", "You cannot carry that many different items."));
                return;
        }
 
@@ -3565,12 +3458,7 @@ msg_print("そんなにアイテムを持てない。");
                if ((cur_store_num != STORE_HOME) &&
                    (o_ptr->ident & IDENT_FIXED))
                {
-#ifdef JP
-msg_format("一つにつき $%ldです。", (long)(best));
-#else
-                       msg_format("That costs %ld gold per item.", (long)(best));
-#endif
-
+                       msg_format(_("一つにつき $%ldです。", "That costs %ld gold per item."), (long)(best));
                }
 
                /* Get a quantity */
@@ -3579,8 +3467,6 @@ msg_format("一つにつき $%ldです。", (long)(best));
                /* Allow user abort */
                if (amt <= 0) return;
        }
-
-       /* Get local object */
        j_ptr = &forge;
 
        /* Get desired object */
@@ -3598,12 +3484,7 @@ msg_format("一つにつき $%ldです。", (long)(best));
        /* Hack -- require room in pack */
        if (!inven_carry_okay(j_ptr))
        {
-#ifdef JP
-               msg_print("ザックにそのアイテムを入れる隙間がない。");
-#else
-               msg_print("You cannot carry that many items.");
-#endif
-
+               msg_print(_("ザックにそのアイテムを入れる隙間がない。", "You cannot carry that many items."));
                return;
        }
 
@@ -3625,14 +3506,7 @@ msg_format("一つにつき $%ldです。", (long)(best));
                {
                        /* Describe the object (fully) */
                        object_desc(o_name, j_ptr, 0);
-
-                       /* Message */
-#ifdef JP
-msg_format("%s(%c)を購入する。", o_name, I2A(item));
-#else
-                       msg_format("Buying %s (%c).", o_name, I2A(item));
-#endif
-
+                       msg_format(_("%s(%c)を購入する。", "Buying %s (%c)."), o_name, I2A(item));
                        msg_print(NULL);
 
                        /* Haggle for a final price */
@@ -3680,12 +3554,7 @@ msg_format("%s(%c)を購入する。", o_name, I2A(item));
                                /* Describe the transaction */
                                object_desc(o_name, j_ptr, 0);
 
-                               /* Message */
-#ifdef JP
-msg_format("%sを $%ldで購入しました。", o_name, (long)price);
-#else
-                               msg_format("You bought %s for %ld gold.", o_name, (long)price);
-#endif
+                               msg_format(_("%sを $%ldで購入しました。", "You bought %s for %ld gold."), o_name, (long)price);
 
                                strcpy(record_o_name, o_name);
                                record_turn = turn;
@@ -3706,14 +3575,7 @@ msg_format("%sを $%ldで購入しました。", o_name, (long)price);
 
                                /* Describe the final result */
                                object_desc(o_name, &inventory[item_new], 0);
-
-                               /* Message */
-#ifdef JP
-               msg_format("%s(%c)を手に入れた。", o_name, index_to_label(item_new));
-#else
-                               msg_format("You have %s (%c).",
-                                                  o_name, index_to_label(item_new));
-#endif
+                               msg_format(_("%s(%c)を手に入れた。", "You have %s (%c)."), o_name, index_to_label(item_new));
 
                                /* Auto-inscription */
                                autopick_alter_item(item_new, FALSE);
@@ -3723,8 +3585,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 */
@@ -3741,13 +3601,7 @@ msg_format("%sを $%ldで購入しました。", o_name, (long)price);
                                        if (one_in_(STORE_SHUFFLE))
                                        {
                                                char buf[80];
-                                               /* Message */
-#ifdef JP
-                                               msg_print("店主は引退した。");
-#else
-                                               msg_print("The shopkeeper retires.");
-#endif
-
+                                               msg_print(_("店主は引退した。", "The shopkeeper retires."));
 
                                                /* Shuffle the store */
                                                store_shuffle(cur_store_num);
@@ -3764,13 +3618,7 @@ msg_format("%sを $%ldで購入しました。", o_name, (long)price);
                                        /* Maintain */
                                        else
                                        {
-                                               /* Message */
-#ifdef JP
-                                               msg_print("店主は新たな在庫を取り出した。");
-#else
-                                               msg_print("The shopkeeper brings out some new stock.");
-#endif
-
+                                               msg_print(_("店主は新たな在庫を取り出した。", "The shopkeeper brings out some new stock."));
                                        }
 
                                        /* New inventory */
@@ -3782,8 +3630,6 @@ msg_format("%sを $%ldで購入しました。", o_name, (long)price);
 
                                        /* Start over */
                                        store_top = 0;
-
-                                       /* Redraw everything */
                                        display_inventory();
                                }
 
@@ -3792,8 +3638,6 @@ msg_format("%sを $%ldで購入しました。", o_name, (long)price);
                                {
                                        /* Pick the correct screen */
                                        if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
-
-                                       /* Redraw everything */
                                        display_inventory();
                                }
 
@@ -3809,12 +3653,7 @@ msg_format("%sを $%ldで購入しました。", o_name, (long)price);
                        else
                        {
                                /* Simple message (no insult) */
-#ifdef JP
-                               msg_print("お金が足りません。");
-#else
-                               msg_print("You do not have enough gold.");
-#endif
-
+                               msg_print(_("お金が足りません。", "You do not have enough gold."));
                        }
                }
        }
@@ -3833,15 +3672,7 @@ msg_format("%sを $%ldで購入しました。", o_name, (long)price);
                /* Describe just the result */
                object_desc(o_name, &inventory[item_new], 0);
 
-               /* Message */
-#ifdef JP
-                               msg_format("%s(%c)を取った。",
-#else
-               msg_format("You have %s (%c).",
-#endif
- o_name, index_to_label(item_new));
-
-               /* Handle stuff */
+               msg_format(_("%s(%c)を取った。", "You have %s (%c)."), o_name, index_to_label(item_new));
                handle_stuff();
 
                /* Take note if we take the last one */
@@ -3856,7 +3687,6 @@ msg_format("%sを $%ldで購入しました。", o_name, (long)price);
                /* Hack -- Item is still here */
                if (i == st_ptr->stock_num)
                {
-                       /* Redraw everything */
                        if (combined_or_reordered) display_inventory();
 
                        /* Redraw the item */
@@ -3871,8 +3701,6 @@ msg_format("%sを $%ldで購入しました。", o_name, (long)price);
 
                        /* Nothing left on that screen */
                        else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
-
-                       /* Redraw everything */
                        display_inventory();
 
                        chg_virtue(V_SACRIFICE, 1);
@@ -3892,10 +3720,11 @@ msg_format("%sを $%ldで購入しました。", o_name, (long)price);
 static void store_sell(void)
 {
        int choice;
-       int item, item_pos;
+       OBJECT_IDX item;
+       int item_pos;
        int amt;
 
-       s32b price, value, dummy;
+       PRICE price, value, dummy;
 
        object_type forge;
        object_type *q_ptr;
@@ -3904,94 +3733,46 @@ static void store_sell(void)
 
        cptr q, s;
 
-       char o_name[MAX_NLEN];
+       GAME_TEXT o_name[MAX_NLEN];
 
 
        /* Prepare a prompt */
        if (cur_store_num == STORE_HOME)
-#ifdef JP
-       q = "どのアイテムを置きますか? ";
-#else
-               q = "Drop which item? ";
-#endif
+               q = _("どのアイテムを置きますか? ", "Drop which item? ");
 
        else if (cur_store_num == STORE_MUSEUM)
-#ifdef JP
-       q = "どのアイテムを寄贈しますか? ";
-#else
-               q = "Give which item? ";
-#endif
+               q = _("どのアイテムを寄贈しますか? ", "Give which item? ");
 
        else
-#ifdef JP
-               q = "どのアイテムを売りますか? ";
-#else
-               q = "Sell which item? ";
-#endif
+               q = _("どのアイテムを売りますか? ", "Sell which item? ");
 
-
-       item_tester_no_ryoute = TRUE;
        /* Only allow items the store will buy */
        item_tester_hook = store_will_buy;
 
-       /* Get an item */
        /* 我が家でおかしなメッセージが出るオリジナルのバグを修正 */
        if (cur_store_num == STORE_HOME)
        {
-#ifdef JP
-               s = "置けるアイテムを持っていません。";
-#else
-               s = "You don't have any item to drop.";
-#endif
+               s = _("置けるアイテムを持っていません。", "You don't have any item to drop.");
        }
        else if (cur_store_num == STORE_MUSEUM)
        {
-#ifdef JP
-               s = "寄贈できるアイテムを持っていません。";
-#else
-               s = "You don't have any item to give.";
-#endif
+               s = _("寄贈できるアイテムを持っていません。", "You don't have any item to give.");
        }
        else
        {
-#ifdef JP
-               s = "欲しい物がないですねえ。";
-#else
-               s = "You have nothing that I want.";
-#endif
-       }
-
-       if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;
-
-       /* Get the item (in the pack) */
-       if (item >= 0)
-       {
-               o_ptr = &inventory[item];
-       }
-
-       /* Get the item (on the floor) */
-       else
-       {
-               o_ptr = &o_list[0 - item];
+               s = _("欲しい物がないですねえ。", "You have nothing that I want.");
        }
 
+       o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
+       if (!o_ptr) return;
 
        /* Hack -- Cannot remove cursed items */
        if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
        {
-               /* Oops */
-#ifdef JP
-               msg_print("ふーむ、どうやらそれは呪われているようだね。");
-#else
-               msg_print("Hmmm, it seems to be cursed.");
-#endif
-
-
-               /* Nope */
+               msg_print(_("ふーむ、どうやらそれは呪われているようだね。", "Hmmm, it seems to be cursed."));
                return;
        }
 
-
        /* Assume one item */
        amt = 1;
 
@@ -4004,8 +3785,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 */
@@ -4037,25 +3816,13 @@ static void store_sell(void)
        if (!store_check_num(q_ptr))
        {
                if (cur_store_num == STORE_HOME)
-#ifdef JP
-                       msg_print("我が家にはもう置く場所がない。");
-#else
-                       msg_print("Your home is full.");
-#endif
+                       msg_print(_("我が家にはもう置く場所がない。", "Your home is full."));
 
                else if (cur_store_num == STORE_MUSEUM)
-#ifdef JP
-                       msg_print("博物館はもう満杯だ。");
-#else
-                       msg_print("Museum is full.");
-#endif
+                       msg_print(_("博物館はもう満杯だ。", "Museum is full."));
 
                else
-#ifdef JP
-                       msg_print("すいませんが、店にはもう置く場所がありません。");
-#else
-                       msg_print("I have not the room in my store to keep it.");
-#endif
+                       msg_print(_("すいませんが、店にはもう置く場所がありません。", "I have not the room in my store to keep it."));
 
                return;
        }
@@ -4065,11 +3832,7 @@ static void store_sell(void)
        if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
        {
                /* Describe the transaction */
-#ifdef JP
-               msg_format("%s(%c)を売却する。", o_name, index_to_label(item));
-#else
-               msg_format("Selling %s (%c).", o_name, index_to_label(item));
-#endif
+               msg_format(_("%s(%c)を売却する。", "Selling %s (%c)."), o_name, index_to_label(item));
 
                msg_print(NULL);
 
@@ -4105,10 +3868,7 @@ static void store_sell(void)
                        /* Get the "apparent" value */
                        dummy = object_value(q_ptr) * q_ptr->number;
 
-                       /* Identify it */
                        identify_item(o_ptr);
-
-                       /* Get local object */
                        q_ptr = &forge;
 
                        /* Get a copy of the object */
@@ -4136,11 +3896,7 @@ static void store_sell(void)
                        object_desc(o_name, q_ptr, 0);
 
                        /* Describe the result (in message buffer) */
-#ifdef JP
-msg_format("%sを $%ldで売却しました。", o_name, (long)price);
-#else
-                       msg_format("You sold %s for %ld gold.", o_name, (long)price);
-#endif
+                       msg_format(_("%sを $%ldで売却しました。", "You sold %s for %ld gold."), o_name, (long)price);
 
                        if (record_sell) do_cmd_write_nikki(NIKKI_SELL, 0, o_name);
 
@@ -4168,8 +3924,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 */
@@ -4192,48 +3946,27 @@ msg_format("%sを $%ldで売却しました。", o_name, (long)price);
 
                if (-1 == store_check_num(q_ptr))
                {
-#ifdef JP
-                       msg_print("それと同じ品物は既に博物館にあるようです。");
-#else
-                       msg_print("The same object as it is already in the Museum.");
-#endif
+                       msg_print(_("それと同じ品物は既に博物館にあるようです。", "The same object as it is already in the Museum."));
                }
                else
                {
-#ifdef JP
-                       msg_print("博物館に寄贈したものは取り出すことができません!!");
-#else
-                       msg_print("You cannot take items which is given to the Museum back!!");
-#endif
+                       msg_print(_("博物館に寄贈したものは取り出すことができません!!", "You cannot take items which is given to the Museum back!!"));
                }
-#ifdef JP
-               if (!get_check(format("本当に%sを寄贈しますか?", o2_name))) return;
-#else
-               if (!get_check(format("Really give %s to the Museum? ", o2_name))) return;
-#endif
 
-               /* Identify it */
+               if (!get_check(format(_("本当に%sを寄贈しますか?", "Really give %s to the Museum? "), o2_name))) return;
+
                identify_item(q_ptr);
                q_ptr->ident |= IDENT_MENTAL;
 
                /* Distribute charges of wands/rods */
                distribute_charges(o_ptr, q_ptr, amt);
-
-               /* Describe */
-#ifdef JP
-               msg_format("%sを置いた。(%c)", o_name, index_to_label(item));
-#else
-               msg_format("You drop %s (%c).", o_name, index_to_label(item));
-#endif
-
+               msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
                choice = 0;
 
                /* Take it from the players inventory */
                inven_item_increase(item, -amt);
                inven_item_describe(item);
                inven_item_optimize(item);
-
-               /* Handle stuff */
                handle_stuff();
 
                /* Let the home carry it */
@@ -4251,13 +3984,7 @@ msg_format("%sを $%ldで売却しました。", o_name, (long)price);
        {
                /* Distribute charges of wands/rods */
                distribute_charges(o_ptr, q_ptr, amt);
-
-               /* Describe */
-#ifdef JP
-               msg_format("%sを置いた。(%c)", o_name, index_to_label(item));
-#else
-               msg_format("You drop %s (%c).", o_name, index_to_label(item));
-#endif
+               msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
 
                choice = 0;
 
@@ -4265,8 +3992,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 */
@@ -4296,40 +4021,23 @@ msg_format("%sを $%ldで売却しました。", o_name, (long)price);
 static void store_examine(void)
 {
        int         i;
-       int         item;
+       COMMAND_CODE item;
        object_type *o_ptr;
-       char        o_name[MAX_NLEN];
+       GAME_TEXT 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);
 
@@ -4337,12 +4045,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;
@@ -4357,34 +4060,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);
+       msg_format(_("%sを調べている...", "Examining %s..."), o_name);
 
-       /* Describe */
-#ifdef JP
-msg_format("%sを調べている...", o_name);
-#else
-       msg_format("Examining %s...", o_name);
-#endif
-
-
-       /* 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;
 }
@@ -4397,21 +4081,16 @@ msg_print("特に変わったところはないようだ。");
  */
 static void museum_remove_object(void)
 {
-       int         i;
-       int         item;
+       int i;
+       COMMAND_CODE item;
        object_type *o_ptr;
-       char        o_name[MAX_NLEN];
-       char        out_val[160];
+       GAME_TEXT 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;
        }
 
@@ -4422,11 +4101,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;
@@ -4437,23 +4112,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;
 
-       /* Message */
-#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);
@@ -4468,8 +4132,6 @@ static void museum_remove_object(void)
 
        /* Nothing left on that screen */
        else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
-
-       /* Redraw everything */
        display_inventory();
 
        return;
@@ -4496,13 +4158,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! */
@@ -4523,11 +4181,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;
@@ -4545,12 +4199,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
                        {
@@ -4578,7 +4227,6 @@ static void store_process_command(void)
                        break;
                }
 
-               /* Redraw */
                case KTRL('R'):
                {
                        do_cmd_redraw();
@@ -4667,8 +4315,6 @@ static void store_process_command(void)
                        break;
                }
 
-
-
                /*** Use various objects ***/
 
                /* Browse a book */
@@ -4860,13 +4506,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;
                }
        }
@@ -4889,14 +4530,14 @@ static void store_process_command(void)
  */
 void do_cmd_store(void)
 {
-       int         which;
-       int         maintain_num;
-       int         i;
-       cave_type   *c_ptr;
-       bool        need_redraw_store_inv; /* To redraw missiles damage and prices in store */
-       int w, h;
+       int which;
+       int maintain_num;
+       int i;
+       cave_type *c_ptr;
+       bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
+       TERM_LEN w, h;
 
-       /* Get term size */
+       if(p_ptr->wild_mode) return;
        Term_get_size(&w, &h);
 
        /* Calculate stocks per 1 page */
@@ -4904,17 +4545,12 @@ void do_cmd_store(void)
        store_bottom = MIN_STOCK + xtra_stock;
 
        /* Access the player grid */
-       c_ptr = &cave[py][px];
+       c_ptr = &cave[p_ptr->y][p_ptr->x];
 
        /* 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;
        }
 
@@ -4930,12 +4566,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;
        }
@@ -4956,24 +4587,15 @@ void do_cmd_store(void)
                town[p_ptr->town_num].store[which].last_visit = turn;
        }
 
-       /* Forget the lite */
        forget_lite();
-
-       /* Forget the view */
        forget_view();
 
-
        /* Hack -- Character is in "icky" mode */
        character_icky = TRUE;
 
-
-       /* No command argument */
+       /* command reset */
        command_arg = 0;
-
-       /* No repeated command */
        command_rep = 0;
-
-       /* No automatic command */
        command_new = 0;
 
        /* Do not expand macros */
@@ -4989,13 +4611,11 @@ void do_cmd_store(void)
        st_ptr = &town[p_ptr->town_num].store[cur_store_num];
        ot_ptr = &owners[cur_store_num][st_ptr->owner];
 
-
        /* Start at the beginning */
        store_top = 0;
 
        play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BUILD);
 
-       /* Display the store */
        display_store();
 
        /* Do not leave */
@@ -5010,104 +4630,55 @@ void do_cmd_store(void)
                /* Clear */
                clear_from(20 + xtra_stock);
 
-
                /* Basic commands */
-#ifdef JP
-               prt(" ESC) 建物から出る", 21 + xtra_stock, 0);
-#else
-               prt(" ESC) Exit from Building.", 21 + xtra_stock, 0);
-#endif
-
+               prt(_(" ESC) 建物から出る", " ESC) Exit from Building."), 21 + xtra_stock, 0);
 
                /* Browse if necessary */
                if (st_ptr->stock_num > store_bottom)
                {
-#ifdef JP
-                       prt(" -)前ページ", 22 + xtra_stock, 0);
-                       prt(" スペース) 次ページ", 23 + xtra_stock, 0);
-#else
-                       prt(" -) Previous page", 22 + xtra_stock, 0);
-                       prt(" SPACE) Next page", 23 + xtra_stock, 0);
-#endif
-
+                       prt(_(" -)前ページ", " -) Previous page"), 22 + xtra_stock, 0);
+                       prt(_(" スペース) 次ページ", " SPACE) Next page"), 23 + xtra_stock, 0);
                }
 
                /* Home commands */
                if (cur_store_num == STORE_HOME)
                {
-#ifdef JP
-                       prt("g) アイテムを取る", 21 + xtra_stock, 27);
-                       prt("d) アイテムを置く", 22 + xtra_stock, 27);
-                       prt("x) 家のアイテムを調べる", 23 + xtra_stock, 27);
-#else
-                       prt("g) Get an item.", 21 + xtra_stock, 27);
-                       prt("d) Drop an item.", 22 + xtra_stock, 27);
-                       prt("x) eXamine an item in the home.", 23 + xtra_stock, 27);
-#endif
+                       prt(_("g) アイテムを取る", "g) Get an item."), 21 + xtra_stock, 27);
+                       prt(_("d) アイテムを置く", "d) Drop an item."), 22 + xtra_stock, 27);
+                       prt(_("x) 家のアイテムを調べる", "x) eXamine an item in the home."), 23 + xtra_stock, 27);
                }
 
                /* Museum commands */
                else if (cur_store_num == STORE_MUSEUM)
                {
-#ifdef JP
-                       prt("d) アイテムを置く", 21 + xtra_stock, 27);
-                       prt("r) アイテムの展示をやめる", 22 + xtra_stock, 27);
-                       prt("x) 博物館のアイテムを調べる", 23 + xtra_stock, 27);
-#else
-                       prt("d) Drop an item.", 21 + xtra_stock, 27);
-                       prt("r) order to Remove an item.", 22 + xtra_stock, 27);
-                       prt("x) eXamine an item in the museum.", 23 + xtra_stock, 27);
-#endif
+                       prt(_("d) アイテムを置く", "d) Drop an item."), 21 + xtra_stock, 27);
+                       prt(_("r) アイテムの展示をやめる", "r) order to Remove an item."), 22 + xtra_stock, 27);
+                       prt(_("x) 博物館のアイテムを調べる", "x) eXamine an item in the museum."), 23 + xtra_stock, 27);
                }
 
-               /* Shop commands XXX XXX XXX */
+               /* Shop commands */
                else
                {
-#ifdef JP
-                       prt("p) 商品を買う", 21 + xtra_stock, 30);
-                       prt("s) アイテムを売る", 22 + xtra_stock, 30);
-                       prt("x) 商品を調べる", 23 + xtra_stock,30);
-#else
-                       prt("p) Purchase an item.", 21 + xtra_stock, 30);
-                       prt("s) Sell an item.", 22 + xtra_stock, 30);
-                       prt("x) eXamine an item in the shop", 23 + xtra_stock,30);
-#endif
+                       prt(_("p) 商品を買う", "p) Purchase an item."), 21 + xtra_stock, 30);
+                       prt(_("s) アイテムを売る", "s) Sell an item."), 22 + xtra_stock, 30);
+                       prt(_("x) 商品を調べる", "x) eXamine an item in the shop"), 23 + xtra_stock,30);
                }
 
-#ifdef JP
                /* 基本的なコマンドの追加表示 */
-
-               prt("i/e) 持ち物/装備の一覧", 21 + xtra_stock, 56);
+               prt(_("i/e) 持ち物/装備の一覧", "i/e) Inventry/Equipment list"), 21 + xtra_stock, 56);
 
                if (rogue_like_commands)
                {
-                       prt("w/T) 装備する/はずす", 22 + xtra_stock, 56);
+                       prt(_("w/T) 装備する/はずす", "w/T) Wear/Take off equipment"), 22 + xtra_stock, 56);
                }
                else
                {
-                       prt("w/t) 装備する/はずす", 22 + xtra_stock, 56);
+                       prt(_("w/t) 装備する/はずす", "w/t) Wear/Take off equipment"), 22 + xtra_stock, 56);
                }
-#else
-               prt("i/e) Inventry/Equipment list", 21 + xtra_stock, 56);
 
-               if (rogue_like_commands)
-               {
-                       prt("w/T) Wear/Take off equipment", 22 + xtra_stock, 56);
-               }
-               else
-               {
-                       prt("w/t) Wear/Take off equipment", 22 + xtra_stock, 56);
-               }
-#endif
                /* Prompt */
-#ifdef JP
-               prt("コマンド:", 20 + xtra_stock, 0);
-#else
-               prt("You may: ", 20 + xtra_stock, 0);
-#endif
+               prt(_("コマンド:", "You may: "), 20 + xtra_stock, 0);
 
-
-               /* Get a command */
                request_command(TRUE);
 
                /* Process the command */
@@ -5122,35 +4693,22 @@ void do_cmd_store(void)
                /* Hack -- Character is still in "icky" mode */
                character_icky = TRUE;
 
-               /* Notice stuff */
-               notice_stuff();
-
-               /* Handle stuff */
                handle_stuff();
 
-               /* XXX XXX XXX Pack Overflow */
+               /* Pack Overflow */
                if (inventory[INVEN_PACK].k_idx)
                {
-                       int item = INVEN_PACK;
+                       INVENTORY_IDX item = INVEN_PACK;
 
                        object_type *o_ptr = &inventory[item];
 
                        /* Hack -- Flee from the store */
                        if (cur_store_num != STORE_HOME)
                        {
-                               /* Message */
-#ifdef JP
                                if (cur_store_num == STORE_MUSEUM)
-                                       msg_print("ザックからアイテムがあふれそうなので、あわてて博物館から出た...");
+                                       msg_print(_("ザックからアイテムがあふれそうなので、あわてて博物館から出た...", "Your pack is so full that you flee the Museum..."));
                                else
-                                       msg_print("ザックからアイテムがあふれそうなので、あわてて店から出た...");
-#else
-                               if (cur_store_num == STORE_MUSEUM)
-                                       msg_print("Your pack is so full that you flee the Museum...");
-                               else
-                                       msg_print("Your pack is so full that you flee the store...");
-#endif
-
+                                       msg_print(_("ザックからアイテムがあふれそうなので、あわてて店から出た...", "Your pack is so full that you flee the store..."));
 
                                /* Leave */
                                leave_store = TRUE;
@@ -5159,14 +4717,7 @@ void do_cmd_store(void)
                        /* Hack -- Flee from the home */
                        else if (!store_check_num(o_ptr))
                        {
-                               /* Message */
-#ifdef JP
-                               msg_print("ザックからアイテムがあふれそうなので、あわてて家から出た...");
-#else
-                               msg_print("Your pack is so full that you flee your home...");
-#endif
-
-
+                               msg_print(_("ザックからアイテムがあふれそうなので、あわてて家から出た...", "Your pack is so full that you flee your home..."));
                                /* Leave */
                                leave_store = TRUE;
                        }
@@ -5179,40 +4730,22 @@ void do_cmd_store(void)
                                object_type forge;
                                object_type *q_ptr;
 
-                               char o_name[MAX_NLEN];
-
+                               GAME_TEXT o_name[MAX_NLEN];
 
                                /* Give a message */
-#ifdef JP
-                               msg_print("ザックからアイテムがあふれてしまった!");
-#else
-                               msg_print("Your pack overflows!");
-#endif
-
+                               msg_print(_("ザックからアイテムがあふれてしまった!", "Your pack overflows!"));
 
-                               /* Get local object */
                                q_ptr = &forge;
 
-                               /* Grab a copy of the item */
                                object_copy(q_ptr, o_ptr);
-
-                               /* Describe it */
                                object_desc(o_name, q_ptr, 0);
 
-                               /* Message */
-#ifdef JP
-                               msg_format("%sが落ちた。(%c)", o_name, index_to_label(item));
-#else
-                               msg_format("You drop %s (%c).", o_name, index_to_label(item));
-#endif
-
+                               msg_format(_("%sが落ちた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
 
                                /* Remove it from the players inventory */
                                inven_item_increase(item, -255);
                                inven_item_describe(item);
                                inven_item_optimize(item);
-
-                               /* Handle stuff */
                                handle_stuff();
 
                                /* Let the home carry it */
@@ -5239,8 +4772,8 @@ void do_cmd_store(void)
 
        p_ptr->town_num = old_town_num;
 
-       /* Free turn XXX XXX XXX */
-       energy_use = 100;
+       /* Free turn */
+       p_ptr->energy_use = 100;
 
 
        /* Hack -- Character is no longer in "icky" mode */
@@ -5256,25 +4789,16 @@ void do_cmd_store(void)
        /* Allow expanding macros */
        get_com_no_macros = FALSE;
 
-       /* Flush messages XXX XXX XXX */
-       msg_print(NULL);
-
-
-       /* Clear the screen */
+       msg_erase();
        Term_clear();
 
-
        /* Update everything */
        p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
        p_ptr->update |= (PU_MONSTERS);
 
        /* Redraw entire screen */
        p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
-
-       /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
-
-       /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 }
 
@@ -5332,7 +4856,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))
@@ -5344,11 +4867,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"));
                }
        }
 }
@@ -5363,7 +4882,7 @@ void store_shuffle(int which)
  */
 void store_maint(int town_num, int store_num)
 {
-       int             j;
+       INVENTORY_IDX j;
 
        cur_store_num = store_num;
 
@@ -5447,8 +4966,7 @@ void store_maint(int town_num, int store_num)
  */
 void store_init(int town_num, int store_num)
 {
-       int             k;
-
+       int k;
        cur_store_num = store_num;
 
        /* Activate that store */