OSDN Git Service

Sniper gets 'Lion Slayer' at Old Castle Quest
[hengband/hengband.git] / src / store.c
index 23a2887..b0e6138 100644 (file)
@@ -19,7 +19,7 @@ static int store_top = 0;
 static int store_bottom = 0;
 static int xtra_stock = 0;
 static store_type *st_ptr = NULL;
-static owner_type *ot_ptr = NULL;
+static const owner_type *ot_ptr = NULL;
 static s16b old_town_num = 0;
 static s16b inner_town_num = 0;
 #define RUMOR_CHANCE 8
@@ -306,8 +306,6 @@ static cptr comment_6[MAX_COMMENT_6] =
  */
 static void say_comment_1(void)
 {
-       char rumour[1024];
-
 #ifdef JP
        /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î¤È¤­¤ÏÊ̤Υá¥Ã¥»¡¼¥¸¤ò½Ð¤¹ */
        if ( cur_store_num == STORE_BLACK ) {
@@ -324,19 +322,11 @@ static void say_comment_1(void)
        if (one_in_(RUMOR_CHANCE))
        {
 #ifdef JP
-msg_print("Ź¼ç¤Ï¼ª¤¦¤Á¤·¤¿:");
+               msg_print("Ź¼ç¤Ï¼ª¤¦¤Á¤·¤¿:");
 #else
                msg_print("The shopkeeper whispers something into your ear:");
 #endif
-
-
-#ifdef JP
-if (!get_rnd_line_jonly("rumors_j.txt", 0, rumour, 10))
-#else
-               if (!get_rnd_line("rumors.txt", 0, rumour))
-#endif
-
-                       msg_print(rumour);
+               display_rumor(TRUE);
        }
 }
 
@@ -630,7 +620,7 @@ static byte rgold_adj[MAX_RACES][MAX_RACES] =
        /*Hum, HfE, Elf,  Hal, Gno, Dwa, HfO, HfT, Dun, HiE, Barbarian,
         HfOg, HGn, HTn, Cyc, Yek, Klc, Kbd, Nbl, DkE, Drc, Mind Flayer,
         Imp,  Glm, Skl, Zombie, Vampire, Spectre, Fairy, Beastman, Ent,
-        Angel, Demon, Kuta*/
+        Angel, Demon, Kuta*/
 
        /* Human */
        { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
@@ -842,7 +832,7 @@ static byte rgold_adj[MAX_RACES][MAX_RACES] =
          110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
          110, 101, 115, 110 },
 
-       /* Kuta */
+       /* Kutar */
        { 110, 110, 105, 105, 110, 115, 115, 115, 110, 105, 110,
          115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
          115, 115, 125, 125, 125, 125, 105, 115, 105,  95, 140,
@@ -990,6 +980,7 @@ static void mass_produce(object_type *o_ptr)
                case TV_CRUSADE_BOOK:
                case TV_MUSIC_BOOK:
                case TV_HISSATSU_BOOK:
+               case TV_HEX_BOOK:
                {
                        if (cost <= 50L) size += damroll(2, 3);
                        if (cost <= 500L) size += damroll(1, 3);
@@ -1057,12 +1048,6 @@ static void mass_produce(object_type *o_ptr)
                                if (cost < 1601L) size += damroll(1, 5);
                                else if (cost < 3201L) size += damroll(1, 3);
                        }
-
-                       /* 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 *= size;
-                       }
                        break;
                }
        }
@@ -1110,6 +1095,12 @@ msg_print("
 
        /* Save the total pile size */
        o_ptr->number = size - (size * discount / 100);
+
+       /* 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;
+       }
 }
 
 
@@ -1461,6 +1452,7 @@ static bool store_will_buy(object_type *o_ptr)
                                case TV_CRAFT_BOOK:
                                case TV_DAEMON_BOOK:
                                case TV_MUSIC_BOOK:
+                               case TV_HEX_BOOK:
                                case TV_AMULET:
                                case TV_RING:
                                case TV_STAFF:
@@ -1497,6 +1489,7 @@ static bool store_will_buy(object_type *o_ptr)
                                case TV_DAEMON_BOOK:
                                case TV_CRUSADE_BOOK:
                                case TV_MUSIC_BOOK:
+                               case TV_HEX_BOOK:
                                        break;
                                default:
                                        return (FALSE);
@@ -2365,6 +2358,18 @@ static void display_inventory(void)
 #endif
 
        }
+
+       if (cur_store_num == STORE_HOME || cur_store_num == STORE_MUSEUM)
+       {
+               k = st_ptr->stock_size;
+
+               if (cur_store_num == STORE_HOME && !powerup_home) k /= 10;
+#ifdef JP
+               put_str(format("¥¢¥¤¥Æ¥à¿ô:  %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 27);
+#else
+               put_str(format("Objects:  %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 30);
+#endif
+       }
 }
 
 
@@ -3660,7 +3665,7 @@ msg_format("%s
                                else if (st_ptr->stock_num != i)
                                {
                                        /* Pick the correct screen */
-                                       if (store_top >= st_ptr->stock_num) store_top -= 12;
+                                       if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
 
                                        /* Redraw everything */
                                        display_inventory();
@@ -3739,7 +3744,7 @@ msg_format("%s
                        if (st_ptr->stock_num == 0) store_top = 0;
 
                        /* Nothing left on that screen */
-                       else if (store_top >= st_ptr->stock_num) store_top -= 12;
+                       else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
 
                        /* Redraw everything */
                        display_inventory();
@@ -4199,7 +4204,7 @@ static void store_examine(void)
        i = (st_ptr->stock_num - store_top);
 
        /* And then restrict it to the current page */
-       if (i > 12) i = 12;
+       if (i > store_bottom) i = store_bottom;
 
        /* Prompt */
 #ifdef JP
@@ -4282,7 +4287,7 @@ static void museum_remove_object(void)
        i = st_ptr->stock_num - store_top;
 
        /* And then restrict it to the current page */
-       if (i > 12) i = 12;
+       if (i > store_bottom) i = store_bottom;
 
        /* Prompt */
 #ifdef JP
@@ -4330,7 +4335,7 @@ static void museum_remove_object(void)
        if (st_ptr->stock_num == 0) store_top = 0;
 
        /* Nothing left on that screen */
-       else if (store_top >= st_ptr->stock_num) store_top -= 12;
+       else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
 
        /* Redraw everything */
        display_inventory();
@@ -4541,7 +4546,9 @@ static void store_process_command(void)
                        else if (p_ptr->pclass == CLASS_SMITH)
                                do_cmd_kaji(TRUE);
                        else if (p_ptr->pclass == CLASS_MAGIC_EATER)
-                               do_cmd_magic_eater(TRUE);
+                               do_cmd_magic_eater(TRUE, FALSE);
+                       else if (p_ptr->pclass == CLASS_SNIPER)
+                               do_cmd_snipe_browse();
                        else do_cmd_browse();
                        break;
                }
@@ -4829,6 +4836,8 @@ void do_cmd_store(void)
        /* No automatic command */
        command_new = 0;
 
+       /* Do not expand macros */
+       get_com_no_macros = TRUE;
 
        /* Save the store number */
        cur_store_num = which;
@@ -5070,7 +5079,7 @@ void do_cmd_store(void)
                                /* Redraw the home */
                                if (item_pos >= 0)
                                {
-                                       store_top = (item_pos / 12) * 12;
+                                       store_top = (item_pos / store_bottom) * store_bottom;
                                        display_inventory();
                                }
                        }
@@ -5100,6 +5109,8 @@ void do_cmd_store(void)
        /* Hack -- Cancel "see" mode */
        command_see = FALSE;
 
+       /* Allow expanding macros */
+       get_com_no_macros = FALSE;
 
        /* Flush messages XXX XXX XXX */
        msg_print(NULL);