OSDN Git Service

自宅/博物館内でpref読み込みが行われた際に, $TOWNを使う処理で誤った街
[hengbandforosx/hengbandosx.git] / src / store.c
index 018e230..7506c03 100644 (file)
@@ -1,15 +1,15 @@
 /* File: store.c */
 
-/* Purpose: Store commands */
-
 /*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
  *
- * This software may be copied and distributed for educational, research, and
- * not for profit purposes provided that this copyright and statement are
- * included in all such copies.
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies.  Other copyrights may also apply.
  */
 
+/* Purpose: Store commands */
+
 #include "angband.h"
 
 
@@ -20,6 +20,8 @@ static int store_top = 0;
 static store_type *st_ptr = NULL;
 static owner_type *ot_ptr = NULL;
 #endif
+static s16b old_town_num = 0;
+static s16b inner_town_num = 0;
 #define RUMOR_CHANCE 8
 
 #define MAX_COMMENT_1  6
@@ -307,13 +309,13 @@ static void say_comment_1(void)
        char rumour[1024];
 
 #ifdef JP
-        /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î¤È¤­¤ÏÊ̤Υá¥Ã¥»¡¼¥¸¤ò½Ð¤¹ */
-        if ( cur_store_num == STORE_BLACK ) {
-                msg_print(comment_1_B[randint0(MAX_COMMENT_1)]);
-        }
-        else{
-                msg_print(comment_1[randint0(MAX_COMMENT_1)]);
-        }
+       /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î¤È¤­¤ÏÊ̤Υá¥Ã¥»¡¼¥¸¤ò½Ð¤¹ */
+       if ( cur_store_num == STORE_BLACK ) {
+               msg_print(comment_1_B[randint0(MAX_COMMENT_1)]);
+       }
+       else{
+               msg_print(comment_1[randint0(MAX_COMMENT_1)]);
+       }
 #else
        msg_print(comment_1[randint0(MAX_COMMENT_1)]);
 #endif
@@ -419,15 +421,15 @@ static void say_comment_3(s32b value, int annoyed)
 static void say_comment_4(void)
 {
 #ifdef JP
-        /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î»þ¤ÏÊ̤Υá¥Ã¥»¡¼¥¸¤ò½Ð¤¹ */
-        if ( cur_store_num == STORE_BLACK ){
-                msg_print(comment_4a_B[randint0(MAX_COMMENT_4A)]);
-                msg_print(comment_4b_B[randint0(MAX_COMMENT_4B)]);
-        }
-        else{
-                msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
-                msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
-        }
+       /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î»þ¤ÏÊ̤Υá¥Ã¥»¡¼¥¸¤ò½Ð¤¹ */
+       if ( cur_store_num == STORE_BLACK ){
+               msg_print(comment_4a_B[randint0(MAX_COMMENT_4A)]);
+               msg_print(comment_4b_B[randint0(MAX_COMMENT_4B)]);
+       }
+       else{
+               msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
+               msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
+       }
 #else
        msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
        msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
@@ -442,13 +444,13 @@ static void say_comment_4(void)
 static void say_comment_5(void)
 {
 #ifdef JP
-        /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î»þ¤ÏÊ̤Υá¥Ã¥»¡¼¥¸¤ò½Ð¤¹ */
-        if ( cur_store_num == STORE_BLACK ){
-                msg_print(comment_5_B[randint0(MAX_COMMENT_5)]);
-        }
-        else{
-                msg_print(comment_5[randint0(MAX_COMMENT_5)]);
-        }
+       /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î»þ¤ÏÊ̤Υá¥Ã¥»¡¼¥¸¤ò½Ð¤¹ */
+       if ( cur_store_num == STORE_BLACK ){
+               msg_print(comment_5_B[randint0(MAX_COMMENT_5)]);
+       }
+       else{
+               msg_print(comment_5[randint0(MAX_COMMENT_5)]);
+       }
 #else
        msg_print(comment_5[randint0(MAX_COMMENT_5)]);
 #endif
@@ -934,6 +936,10 @@ static s32b price_item(object_type *o_ptr, int greed, bool flip)
                /* Mega-Hack -- Black market sucks */
                if (cur_store_num == STORE_BLACK)
                        price = price / 2;
+
+               /* Compute the final price (with rounding) */
+               /* Hack -- prevent underflow */
+               price = (price * adjust + 50L) / 100L;
        }
 
        /* Shop is selling */
@@ -948,10 +954,11 @@ static s32b price_item(object_type *o_ptr, int greed, bool flip)
                /* Mega-Hack -- Black market sucks */
                if (cur_store_num == STORE_BLACK)
                        price = price * 2;
-       }
 
-       /* Compute the final price (with rounding) */
-       price = (price * adjust + 50L) / 100L;
+               /* Compute the final price (with rounding) */
+               /* Hack -- prevent overflow */
+               price = (s32b)(((u32b)price * (u32b)adjust + 50UL) / 100UL);
+       }
 
        /* Note -- Never become "free" */
        if (price <= 0L) return (1L);
@@ -983,6 +990,7 @@ static void mass_produce(object_type *o_ptr)
                {
                        if (cost <= 5L) size += damroll(3, 5);
                        if (cost <= 20L) size += damroll(3, 5);
+                       if (cost <= 50L) size += damroll(2, 2);
                        break;
                }
 
@@ -1005,7 +1013,7 @@ static void mass_produce(object_type *o_ptr)
                case TV_ARCANE_BOOK:
                case TV_ENCHANT_BOOK:
                case TV_DAEMON_BOOK:
-               case TV_HAJA_BOOK:
+               case TV_CRUSADE_BOOK:
                case TV_MUSIC_BOOK:
                case TV_HISSATSU_BOOK:
                {
@@ -1138,6 +1146,8 @@ msg_print("
  */
 static bool store_object_similar(object_type *o_ptr, object_type *j_ptr)
 {
+       int i;
+
        /* Hack -- Identical items cannot be stacked */
        if (o_ptr == j_ptr) return (0);
 
@@ -1162,10 +1172,8 @@ static bool store_object_similar(object_type *o_ptr, object_type *j_ptr)
        if (o_ptr->art_name || j_ptr->art_name) return (0);
 
        /* Hack -- Identical art_flags! */
-       if ((o_ptr->art_flags1 != j_ptr->art_flags1) ||
-               (o_ptr->art_flags2 != j_ptr->art_flags2) ||
-               (o_ptr->art_flags3 != j_ptr->art_flags3))
-                       return (0);
+       for (i = 0; i < TR_FLAG_SIZE; i++)
+               if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return (0);
 
        /* Hack -- Never stack "powerful" items */
        if (o_ptr->xtra1 || j_ptr->xtra1) return (0);
@@ -1196,21 +1204,24 @@ static bool store_object_similar(object_type *o_ptr, object_type *j_ptr)
  */
 static void store_object_absorb(object_type *o_ptr, object_type *j_ptr)
 {
+       int max_num = (o_ptr->tval == TV_ROD) ?
+               MIN(99, MAX_SHORT / k_info[o_ptr->k_idx].pval) : 99;
        int total = o_ptr->number + j_ptr->number;
+       int diff = (total > max_num) ? total - max_num : 0;
 
        /* Combine quantity, lose excess items */
-       o_ptr->number = (total > 99) ? 99 : total;
+       o_ptr->number = (total > max_num) ? max_num : total;
 
        /* Hack -- if rods are stacking, add the pvals (maximum timeouts) together. -LM- */
        if (o_ptr->tval == TV_ROD)
        {
-               o_ptr->pval += j_ptr->pval;
+               o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
        }
 
        /* Hack -- if wands are stacking, combine the charges. -LM- */
        if (o_ptr->tval == TV_WAND)
        {
-               o_ptr->pval += j_ptr->pval;
+               o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
        }
 }
 
@@ -1281,9 +1292,9 @@ static int store_check_num(object_type *o_ptr)
 
 static bool is_blessed(object_type *o_ptr)
 {
-       u32b f1, f2, f3;
-       object_flags(o_ptr, &f1, &f2, &f3);
-       if (f3 & TR3_BLESSED) return (TRUE);
+       u32b flgs[TR_FLAG_SIZE];
+       object_flags(o_ptr, flgs);
+       if (have_flag(flgs, TR_BLESSED)) return (TRUE);
        else return (FALSE);
 }
 
@@ -1308,6 +1319,9 @@ static bool store_will_buy(object_type *o_ptr)
                        /* Analyze the type */
                        switch (o_ptr->tval)
                        {
+                               case TV_POTION:
+                                       if (o_ptr->sval != SV_POTION_WATER) return FALSE;
+
                                case TV_WHISTLE:
                                case TV_FOOD:
                                case TV_LITE:
@@ -1385,7 +1399,7 @@ static bool store_will_buy(object_type *o_ptr)
                        switch (o_ptr->tval)
                        {
                                case TV_LIFE_BOOK:
-                               case TV_HAJA_BOOK:
+                               case TV_CRUSADE_BOOK:
                                case TV_SCROLL:
                                case TV_POTION:
                                case TV_HAFTED:
@@ -1485,6 +1499,7 @@ static bool store_will_buy(object_type *o_ptr)
                                case TV_ARCANE_BOOK:
                                case TV_ENCHANT_BOOK:
                                case TV_DAEMON_BOOK:
+                               case TV_CRUSADE_BOOK:
                                case TV_MUSIC_BOOK:
                                        break;
                                default:
@@ -1912,7 +1927,7 @@ static void store_create(void)
                object_prep(q_ptr, i);
 
                /* Apply some "low-level" magic (no artifacts) */
-               apply_magic(q_ptr, level, FALSE, FALSE, FALSE, FALSE);
+               apply_magic(q_ptr, level, AM_NO_FIXED_ART);
 
                /* Require valid object */
                if (!store_will_buy(q_ptr)) continue;
@@ -2089,8 +2104,8 @@ static void display_entry(int pos)
                        /* 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) );
-                        put_str(out_val, i+6, 67);
+                       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);
                        put_str(out_val, i+6, 68);
@@ -2119,8 +2134,8 @@ static void display_entry(int pos)
                        /* Only show the weight of an individual item */
                        int wgt = o_ptr->weight;
 #ifdef JP
-                        sprintf(out_val, "%3d.%1d", lbtokg1(wgt) , lbtokg2(wgt) );
-                        put_str(out_val, i+6, 60);
+                       sprintf(out_val, "%3d.%1d", lbtokg1(wgt) , lbtokg2(wgt) );
+                       put_str(out_val, i+6, 60);
 #else
                        (void)sprintf(out_val, "%3d.%d", wgt / 10, wgt % 10);
                        put_str(out_val, i+6, 61);
@@ -2213,10 +2228,11 @@ static void display_inventory(void)
 
 
                /* Indicate the "current page" */
+               /* Trailing spaces are to display (Page xx) and (Page x) */
 #ifdef JP
-               put_str(format("(%d¥Ú¡¼¥¸)", store_top/12 + 1), 5, 20);
+               put_str(format("(%d¥Ú¡¼¥¸)  ", store_top/12 + 1), 5, 20);
 #else
-               put_str(format("(Page %d)", store_top/12 + 1), 5, 20);
+               put_str(format("(Page %d)  ", store_top/12 + 1), 5, 20);
 #endif
 
        }
@@ -2400,8 +2416,8 @@ static int get_stock(int *com_val, cptr pmt, int i, int j)
 
        /* Build the prompt */
 #ifdef JP
-        (void)sprintf(out_val, "(%s:%c-%c, ESC¤ÇÃæÃÇ) %s",
-                (((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) ? "¥¢¥¤¥Æ¥à" : "¾¦ÉÊ"), 
+       (void)sprintf(out_val, "(%s:%c-%c, ESC¤ÇÃæÃÇ) %s",
+               (((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) ? "¥¢¥¤¥Æ¥à" : "¾¦ÉÊ"), 
                                  I2A(i), I2A(j), pmt);
 #else
        (void)sprintf(out_val, "(Items %c-%c, ESC to exit) %s",
@@ -2658,8 +2674,8 @@ static int get_haggle(cptr pmt, s32b *poffer, s32b price, int final)
  * Return TRUE if offer is NOT okay
  */
 static bool receive_offer(cptr pmt, s32b *poffer,
-                          s32b last_offer, int factor,
-                          s32b price, int final)
+                         s32b last_offer, int factor,
+                         s32b price, int final)
 {
        /* Haggle till done */
        while (TRUE)
@@ -2799,7 +2815,7 @@ static bool purchase_haggle(object_type *o_ptr, s32b *price)
                        cancel = receive_offer("What do you offer? ",
 #endif
 
-                                              &offer, last_offer, 1, cur_ask, final);
+                                              &offer, last_offer, 1, cur_ask, final);
 
                        if (cancel)
                        {
@@ -2936,6 +2952,12 @@ static bool sell_haggle(object_type *o_ptr, s32b *price)
        /* No need to haggle */
        if (noneed || !manual_haggle || (final_ask >= purse))
        {
+               /* Apply Sales Tax (if needed) */
+               if (!manual_haggle && !noneed)
+               {
+                       final_ask -= final_ask / 10;
+               }
+
                /* No reason to haggle */
                if (final_ask >= purse)
                {
@@ -2976,9 +2998,6 @@ static bool sell_haggle(object_type *o_ptr, s32b *price)
 #endif
 
                        msg_print(NULL);
-
-                       /* Apply Sales Tax */
-                       final_ask -= final_ask / 10;
                }
 
                /* Final price */
@@ -3112,7 +3131,7 @@ static bool sell_haggle(object_type *o_ptr, s32b *price)
                                prt("", 1, 0);
                                (void)sprintf(out_val,
 #ifdef JP
-                                             "Á°²ó¤ÎÄ󼨲Á³Ê $%ld", (long)last_offer);
+                                             "Á°²ó¤ÎÄ󼨲Á³Ê $%ld", (long)last_offer);
 #else
                                                          "Your last bid %ld", (long)last_offer);
 #endif
@@ -3193,18 +3212,18 @@ static void store_purchase(void)
 
        /* Prompt */
 #ifdef JP
-        /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î»þ¤ÏÊ̤Υá¥Ã¥»¡¼¥¸ */
-        switch( cur_store_num ) {
-                case 7:
-                        sprintf(out_val, "¤É¤Î¥¢¥¤¥Æ¥à¤ò¼è¤ê¤Þ¤¹¤«? ");
-                        break;
-                case 6:
-                        sprintf(out_val, "¤É¤ì? ");
-                        break;
-                default:
-                        sprintf(out_val, "¤É¤ÎÉÊʪ¤¬Íߤ·¤¤¤ó¤À¤¤? ");
-                        break;
-        }
+       /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î»þ¤ÏÊ̤Υá¥Ã¥»¡¼¥¸ */
+       switch( cur_store_num ) {
+               case 7:
+                       sprintf(out_val, "¤É¤Î¥¢¥¤¥Æ¥à¤ò¼è¤ê¤Þ¤¹¤«? ");
+                       break;
+               case 6:
+                       sprintf(out_val, "¤É¤ì? ");
+                       break;
+               default:
+                       sprintf(out_val, "¤É¤ÎÉÊʪ¤¬Íߤ·¤¤¤ó¤À¤¤? ");
+                       break;
+       }
 #else
        if (cur_store_num == STORE_HOME)
        {
@@ -3352,6 +3371,8 @@ msg_format("%s(%c)
                        /* Player can afford it */
                        if (p_ptr->au >= price)
                        {
+                               int idx;
+
                                /* Say "okay" */
                                say_comment_1();
 
@@ -3416,6 +3437,9 @@ msg_format("%s
                                                   o_name, index_to_label(item_new));
 #endif
 
+                               /* Auto-inscription */
+                               idx = is_autopick(&inventory[item_new]);
+                               auto_inscribe_item(item_new, idx);
 
                                /* Now, reduce the original stack's pval. */
                                if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
@@ -3983,21 +4007,21 @@ static void store_examine(void)
        {
                if (cur_store_num == STORE_HOME)
 #ifdef JP
-msg_print("²æ¤¬²È¤Ë¤Ï²¿¤âÃÖ¤¤¤Æ¤¢¤ê¤Þ¤»¤ó¡£");
+                       msg_print("²æ¤¬²È¤Ë¤Ï²¿¤âÃÖ¤¤¤Æ¤¢¤ê¤Þ¤»¤ó¡£");
 #else
                        msg_print("Your home is empty.");
 #endif
 
-               if (cur_store_num == STORE_MUSEUM)
+               else if (cur_store_num == STORE_MUSEUM)
 #ifdef JP
-msg_print("Çîʪ´Û¤Ë¤Ï²¿¤âÃÖ¤¤¤Æ¤¢¤ê¤Þ¤»¤ó¡£");
+                       msg_print("Çîʪ´Û¤Ë¤Ï²¿¤âÃÖ¤¤¤Æ¤¢¤ê¤Þ¤»¤ó¡£");
 #else
                        msg_print("Museum is empty.");
 #endif
 
                else
 #ifdef JP
-msg_print("¸½ºß¾¦Éʤκ߸ˤòÀڤ餷¤Æ¤¤¤Þ¤¹¡£");
+                       msg_print("¸½ºß¾¦Éʤκ߸ˤòÀڤ餷¤Æ¤¤¤Þ¤¹¡£");
 #else
                        msg_print("I am currently out of stock.");
 #endif
@@ -4054,7 +4078,7 @@ msg_format("%s
 
 
        /* Describe it fully */
-       if (!identify_fully_aux(o_ptr))
+       if (!screen_object(o_ptr, TRUE))
 #ifdef JP
 msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
 #else
@@ -4141,23 +4165,23 @@ static void store_process_command(void)
                        else
                        {
                                store_top += 12;
-                                /*
-                                 * ±£¤·¥ª¥×¥·¥ç¥ó(powerup_home)¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤­¤Ï
-                                 * ²æ¤¬²È¤Ç¤Ï 2 ¥Ú¡¼¥¸¤Þ¤Ç¤·¤«É½¼¨¤·¤Ê¤¤
-                                 */
-                                if ((cur_store_num == STORE_HOME) && 
-                                    (powerup_home == FALSE) && 
-                                        (st_ptr->stock_num >= STORE_INVEN_MAX))
-                                {
-                                        if (store_top >= (STORE_INVEN_MAX - 1))
-                                        {
-                                                store_top = 0;
-                                        }
-                                }
-                                else
-                                {
-                                        if (store_top >= st_ptr->stock_num) store_top = 0;
-                                }
+                               /*
+                                * ±£¤·¥ª¥×¥·¥ç¥ó(powerup_home)¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤­¤Ï
+                                * ²æ¤¬²È¤Ç¤Ï 2 ¥Ú¡¼¥¸¤Þ¤Ç¤·¤«É½¼¨¤·¤Ê¤¤
+                                */
+                               if ((cur_store_num == STORE_HOME) && 
+                                   (powerup_home == FALSE) && 
+                                       (st_ptr->stock_num >= STORE_INVEN_MAX))
+                               {
+                                       if (store_top >= (STORE_INVEN_MAX - 1))
+                                       {
+                                               store_top = 0;
+                                       }
+                               }
+                               else
+                               {
+                                       if (store_top >= st_ptr->stock_num) store_top = 0;
+                               }
 
                                display_inventory();
                        }
@@ -4299,7 +4323,9 @@ static void store_process_command(void)
                /* Character description */
                case 'C':
                {
+                       p_ptr->town_num = old_town_num;
                        do_cmd_change_name();
+                       p_ptr->town_num = inner_town_num;
                        display_store();
                        break;
                }
@@ -4317,28 +4343,36 @@ static void store_process_command(void)
                /* Single line from a pref file */
                case '"':
                {
+                       p_ptr->town_num = old_town_num;
                        do_cmd_pref();
+                       p_ptr->town_num = inner_town_num;
                        break;
                }
 
                /* Interact with macros */
                case '@':
                {
+                       p_ptr->town_num = old_town_num;
                        do_cmd_macros();
+                       p_ptr->town_num = inner_town_num;
                        break;
                }
 
                /* Interact with visuals */
                case '%':
                {
+                       p_ptr->town_num = old_town_num;
                        do_cmd_visuals();
+                       p_ptr->town_num = inner_town_num;
                        break;
                }
 
                /* Interact with colors */
                case '&':
                {
+                       p_ptr->town_num = old_town_num;
                        do_cmd_colors();
+                       p_ptr->town_num = inner_town_num;
                        break;
                }
 
@@ -4442,10 +4476,9 @@ void do_cmd_store(void)
 {
        int         which;
        int         maintain_num;
-       int         tmp_chr;
        int         i;
        cave_type   *c_ptr;
-       s16b        old_town_num;
+       bool        need_redraw_store_inv; /* To redraw missiles damage and prices in store */
 
 
        /* Access the player grid */
@@ -4472,6 +4505,7 @@ void do_cmd_store(void)
        old_town_num = p_ptr->town_num;
        if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
        if (dun_level) p_ptr->town_num = NO_TOWN;
+       inner_town_num = p_ptr->town_num;
 
        /* Hack -- Check the "locked doors" */
        if ((town[p_ptr->town_num].store[which].store_open >= turn) ||
@@ -4488,7 +4522,7 @@ void do_cmd_store(void)
        }
 
        /* Calculate the number of store maintainances since the last visit */
-       maintain_num = (turn - town[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TURNS);
+       maintain_num = (turn - town[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
 
        /* Maintain the store max. 10 times */
        if (maintain_num > 10) maintain_num = 10;
@@ -4547,9 +4581,6 @@ void do_cmd_store(void)
                /* Hack -- Clear line 1 */
                prt("", 1, 0);
 
-               /* Hack -- Check the charisma */
-               tmp_chr = p_ptr->stat_use[A_CHR];
-
                /* Clear */
                clear_from(20);
 
@@ -4579,8 +4610,8 @@ void do_cmd_store(void)
                if (cur_store_num == STORE_HOME)
                {
 #ifdef JP
-                   prt("g) ¥¢¥¤¥Æ¥à¤ò¼è¤ë", 21, 27);
-                   prt("d) ¥¢¥¤¥Æ¥à¤òÃÖ¤¯", 22, 27);
+                  prt("g) ¥¢¥¤¥Æ¥à¤ò¼è¤ë", 21, 27);
+                  prt("d) ¥¢¥¤¥Æ¥à¤òÃÖ¤¯", 22, 27);
                   prt("x) ²È¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤ë", 23,27);
 #else
                   prt("g) Get an item.", 21, 27);
@@ -4594,7 +4625,7 @@ void do_cmd_store(void)
                else if (cur_store_num == STORE_MUSEUM)
                {
 #ifdef JP
-                   prt("d) ¥¢¥¤¥Æ¥à¤òÃÖ¤¯", 21, 27);
+                  prt("d) ¥¢¥¤¥Æ¥à¤òÃÖ¤¯", 21, 27);
                   prt("x) Çîʪ´Û¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤ë", 23,27);
 #else
                   prt("d) Drop an item.", 21, 27);
@@ -4607,8 +4638,8 @@ void do_cmd_store(void)
                else
                {
 #ifdef JP
-                        prt("p) ¾¦ÉʤòÇ㤦", 21, 30);
-                        prt("s) ¥¢¥¤¥Æ¥à¤òÇä¤ë", 22, 30);
+                       prt("p) ¾¦ÉʤòÇ㤦", 21, 30);
+                       prt("s) ¥¢¥¤¥Æ¥à¤òÇä¤ë", 22, 30);
                        prt("x) ¾¦ÉʤòÄ´¤Ù¤ë", 23,30);
 #else
                   prt("p) Purchase an item.", 21, 30);
@@ -4619,29 +4650,29 @@ void do_cmd_store(void)
                }
 
 #ifdef JP
-                /* ´ðËÜŪ¤Ê¥³¥Þ¥ó¥É¤ÎÄɲÃɽ¼¨ */
-
-                prt("i/e) »ý¤Áʪ/ÁõÈ÷¤Î°ìÍ÷", 21, 56);
-
-                if( rogue_like_commands == TRUE )
-                {
-                        prt("w/T) ÁõÈ÷¤¹¤ë/¤Ï¤º¤¹", 22, 56);
-                }
-                else
-                {
-                        prt("w/t) ÁõÈ÷¤¹¤ë/¤Ï¤º¤¹", 22, 56);
-                }
+               /* ´ðËÜŪ¤Ê¥³¥Þ¥ó¥É¤ÎÄɲÃɽ¼¨ */
+
+               prt("i/e) »ý¤Áʪ/ÁõÈ÷¤Î°ìÍ÷", 21, 56);
+
+               if( rogue_like_commands == TRUE )
+               {
+                       prt("w/T) ÁõÈ÷¤¹¤ë/¤Ï¤º¤¹", 22, 56);
+               }
+               else
+               {
+                       prt("w/t) ÁõÈ÷¤¹¤ë/¤Ï¤º¤¹", 22, 56);
+               }
 #else
-                prt("i/e) Inventry/Equipment list", 21, 56);
-
-                if( rogue_like_commands == TRUE )
-                {
-                        prt("w/T) Wear/Take off equipment", 22, 56);
-                }
-                else
-                {
-                        prt("w/t) Wear/Take off equipment", 22, 56);
-                }
+               prt("i/e) Inventry/Equipment list", 21, 56);
+
+               if( rogue_like_commands == TRUE )
+               {
+                       prt("w/T) Wear/Take off equipment", 22, 56);
+               }
+               else
+               {
+                       prt("w/t) Wear/Take off equipment", 22, 56);
+               }
 #endif
                /* Prompt */
 #ifdef JP
@@ -4657,6 +4688,12 @@ void do_cmd_store(void)
                /* Process the command */
                store_process_command();
 
+               /*
+                * Hack -- To redraw missiles damage and prices in store
+                * If player's charisma changes, or if player changes a bow, PU_BONUS is set
+                */
+               need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
+
                /* Hack -- Character is still in "icky" mode */
                character_icky = TRUE;
 
@@ -4766,7 +4803,8 @@ void do_cmd_store(void)
                }
 
                /* Hack -- Redisplay store prices if charisma changes */
-               if (tmp_chr != p_ptr->stat_use[A_CHR]) display_inventory();
+               /* Hack -- Redraw missiles damage if player changes bow */
+               if (need_redraw_store_inv) display_inventory();
 
                /* Hack -- get kicked out of the store */
                if (st_ptr->store_open >= turn) leave_store = TRUE;
@@ -4798,7 +4836,7 @@ void do_cmd_store(void)
 
 
        /* Update everything */
-       p_ptr->update |= (PU_VIEW | PU_LITE);
+       p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
        p_ptr->update |= (PU_MONSTERS);
 
        /* Redraw entire screen */
@@ -5013,7 +5051,7 @@ void store_init(int town_num, int store_num)
         * MEGA-HACK - Last visit to store is
         * BEFORE player birth to enable store restocking
         */
-       st_ptr->last_visit = -200L * STORE_TURNS;
+       st_ptr->last_visit = -10L * TURNS_PER_TICK * STORE_TICKS;
 
        /* Clear any old items */
        for (k = 0; k < st_ptr->stock_size; k++)