OSDN Git Service

悪夢モードでモンスターからの経験値が約2倍入手できていたバグを修正.
[hengband/hengband.git] / src / store.c
index abe9e2a..11d76df 100644 (file)
@@ -1016,7 +1016,7 @@ static void mass_produce(object_type *o_ptr)
                case TV_DEATH_BOOK:
                case TV_TRUMP_BOOK:
                case TV_ARCANE_BOOK:
-               case TV_ENCHANT_BOOK:
+               case TV_CRAFT_BOOK:
                case TV_DAEMON_BOOK:
                case TV_CRUSADE_BOOK:
                case TV_MUSIC_BOOK:
@@ -1465,7 +1465,7 @@ static bool store_will_buy(object_type *o_ptr)
                                case TV_DEATH_BOOK:
                                case TV_TRUMP_BOOK:
                                case TV_ARCANE_BOOK:
-                               case TV_ENCHANT_BOOK:
+                               case TV_CRAFT_BOOK:
                                case TV_DAEMON_BOOK:
                                case TV_MUSIC_BOOK:
                                case TV_AMULET:
@@ -1500,7 +1500,7 @@ static bool store_will_buy(object_type *o_ptr)
                                case TV_LIFE_BOOK:
                                case TV_TRUMP_BOOK:
                                case TV_ARCANE_BOOK:
-                               case TV_ENCHANT_BOOK:
+                               case TV_CRAFT_BOOK:
                                case TV_DAEMON_BOOK:
                                case TV_CRUSADE_BOOK:
                                case TV_MUSIC_BOOK:
@@ -4098,7 +4098,7 @@ msg_format("%s
 
 
        /* Describe it fully */
-       if (!screen_object(o_ptr, TRUE))
+       if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL))
 #ifdef JP
 msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
 #else
@@ -4111,6 +4111,88 @@ msg_print("
 
 
 /*
+ * Remove an item from museum (Originally from TOband)
+ */
+static void museum_remove_object(void)
+{
+       int         i;
+       int         item;
+       object_type *o_ptr;
+       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
+
+               return;
+       }
+
+       /* Find the number of objects on this and following pages */
+       i = st_ptr->stock_num - store_top;
+
+       /* And then restrict it to the current page */
+       if (i > 12) i = 12;
+
+       /* Prompt */
+#ifdef JP
+       sprintf(out_val, "¤É¤Î¥¢¥¤¥Æ¥à¤ÎŸ¼¨¤ò¤ä¤á¤µ¤»¤Þ¤¹¤«¡©");
+#else
+       sprintf(out_val, "Which item do you want to order to remove? ");
+#endif
+
+       /* Get the item number to be removed */
+       if (!get_stock(&item, out_val, 0, i - 1)) return;
+
+       /* Get the actual index */
+       item = item + store_top;
+
+       /* 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
+
+       /* Message */
+#ifdef JP
+       msg_format("%s¤ÎŸ¼¨¤ò¤ä¤á¤µ¤»¤¿¡£", o_name);
+#else
+       msg_format("You ordered to remove %s.", o_name);
+#endif
+
+       /* Remove the items from the home */
+       store_item_increase(item, -o_ptr->number);
+       store_item_optimize(item);
+
+       /* The item is gone */
+
+       /* Nothing left */
+       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;
+
+       /* Redraw everything */
+       display_inventory();
+
+       return;
+}
+
+
+/*
  * Hack -- set this to leave the store
  */
 static bool leave_store = FALSE;
@@ -4304,7 +4386,16 @@ static void store_process_command(void)
                /* Browse a book */
                case 'b':
                {
-                       do_cmd_browse();
+                       if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
+                            (p_ptr->pclass == CLASS_BERSERKER) ||
+                            (p_ptr->pclass == CLASS_NINJA) ||
+                            (p_ptr->pclass == CLASS_MIRROR_MASTER) 
+                            ) do_cmd_mind_browse();
+                       else if (p_ptr->pclass == CLASS_SMITH)
+                               do_cmd_kaji(TRUE);
+                       else if (p_ptr->pclass == CLASS_MAGIC_EATER)
+                               do_cmd_magic_eater(TRUE);
+                       else do_cmd_browse();
                        break;
                }
 
@@ -4470,11 +4561,18 @@ static void store_process_command(void)
                /* Hack -- Unknown command */
                default:
                {
+                       if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r'))
+                       {
+                               museum_remove_object();
+                       }
+                       else
+                       {
 #ifdef JP
-                       msg_print("¤½¤Î¥³¥Þ¥ó¥É¤ÏŹ¤ÎÃæ¤Ç¤Ï»È¤¨¤Þ¤»¤ó¡£");
+                               msg_print("¤½¤Î¥³¥Þ¥ó¥É¤ÏŹ¤ÎÃæ¤Ç¤Ï»È¤¨¤Þ¤»¤ó¡£");
 #else
-                       msg_print("That command does not work in stores.");
+                               msg_print("That command does not work in stores.");
 #endif
+                       }
 
                        break;
                }
@@ -4517,7 +4615,7 @@ void do_cmd_store(void)
        }
 
        /* Extract the store code */
-       which = f_info[c_ptr->feat].power;
+       which = f_info[c_ptr->feat].subtype;
 
        old_town_num = p_ptr->town_num;
        if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
@@ -4630,28 +4728,28 @@ void do_cmd_store(void)
                if (cur_store_num == STORE_HOME)
                {
 #ifdef JP
-                  prt("g) ¥¢¥¤¥Æ¥à¤ò¼è¤ë", 21, 27);
-                  prt("d) ¥¢¥¤¥Æ¥à¤òÃÖ¤¯", 22, 27);
-                  prt("x) ²È¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤ë", 23,27);
+                       prt("g) ¥¢¥¤¥Æ¥à¤ò¼è¤ë", 21, 27);
+                       prt("d) ¥¢¥¤¥Æ¥à¤òÃÖ¤¯", 22, 27);
+                       prt("x) ²È¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤ë", 23,27);
 #else
-                  prt("g) Get an item.", 21, 27);
-                  prt("d) Drop an item.", 22, 27);
-                  prt("x) eXamine an item in the home.", 23,27);
+                       prt("g) Get an item.", 21, 27);
+                       prt("d) Drop an item.", 22, 27);
+                       prt("x) eXamine an item in the home.", 23,27);
 #endif
-
                }
 
                /* Museum commands */
                else if (cur_store_num == STORE_MUSEUM)
                {
 #ifdef JP
-                  prt("d) ¥¢¥¤¥Æ¥à¤òÃÖ¤¯", 21, 27);
-                  prt("x) Çîʪ´Û¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤ë", 23,27);
+                       prt("d) ¥¢¥¤¥Æ¥à¤òÃÖ¤¯", 21, 27);
+                       prt("r) ¥¢¥¤¥Æ¥à¤ÎŸ¼¨¤ò¤ä¤á¤ë", 22, 27);
+                       prt("x) Çîʪ´Û¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤ë", 23, 27);
 #else
-                  prt("d) Drop an item.", 21, 27);
-                  prt("x) eXamine an item in the museum.", 23,27);
+                       prt("d) Drop an item.", 21, 27);
+                       prt("r) order to Remove an item.", 22, 27);
+                       prt("x) eXamine an item in the museum.", 23, 27);
 #endif
-
                }
 
                /* Shop commands XXX XXX XXX */
@@ -4662,11 +4760,10 @@ void do_cmd_store(void)
                        prt("s) ¥¢¥¤¥Æ¥à¤òÇä¤ë", 22, 30);
                        prt("x) ¾¦ÉʤòÄ´¤Ù¤ë", 23,30);
 #else
-                  prt("p) Purchase an item.", 21, 30);
-                  prt("s) Sell an item.", 22, 30);
-                  prt("x) eXamine an item in the shop", 23,30);
+                       prt("p) Purchase an item.", 21, 30);
+                       prt("s) Sell an item.", 22, 30);
+                       prt("x) eXamine an item in the shop", 23,30);
 #endif
-
                }
 
 #ifdef JP
@@ -4674,7 +4771,7 @@ void do_cmd_store(void)
 
                prt("i/e) »ý¤Áʪ/ÁõÈ÷¤Î°ìÍ÷", 21, 56);
 
-               if( rogue_like_commands == TRUE )
+               if (rogue_like_commands)
                {
                        prt("w/T) ÁõÈ÷¤¹¤ë/¤Ï¤º¤¹", 22, 56);
                }
@@ -4685,7 +4782,7 @@ void do_cmd_store(void)
 #else
                prt("i/e) Inventry/Equipment list", 21, 56);
 
-               if( rogue_like_commands == TRUE )
+               if (rogue_like_commands)
                {
                        prt("w/T) Wear/Take off equipment", 22, 56);
                }
@@ -4949,8 +5046,6 @@ void store_maint(int town_num, int store_num)
 {
        int             j;
 
-       int     old_rating = rating;
-
        cur_store_num = store_num;
 
        /* Ignore home */
@@ -5021,10 +5116,6 @@ void store_maint(int town_num, int store_num)
 
        /* Acquire some new items */
        while (st_ptr->stock_num < j) store_create();
-
-
-       /* Hack -- Restore the rating */
-       rating = old_rating;
 }