OSDN Git Service

#37287 #37353 (2.2.0.89) 型の置換を継続中。 / Ongoing type replacement.
[hengband/hengband.git] / src / store.c
index ab4d72b..54007ab 100644 (file)
@@ -963,7 +963,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 +1099,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 +1113,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;
        }
 }
 
@@ -1632,8 +1622,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);
@@ -1940,6 +1930,7 @@ 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)
 {
@@ -1956,7 +1947,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;
 }
 
 
@@ -2286,11 +2277,6 @@ static void display_entry(int pos)
                byte a = object_attr(o_ptr);
                char c = object_char(o_ptr);
 
-#ifdef AMIGA
-               if (a & 0x80)
-                       a |= 0x40;
-#endif
-
                Term_queue_bigchar(cur_col, i + 6, a, c, 0, 0);
                if (use_bigtile) cur_col++;
 
@@ -2624,7 +2610,7 @@ 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];
@@ -3444,9 +3430,11 @@ static bool sell_haggle(object_type *o_ptr, s32b *price)
  */
 static void store_purchase(void)
 {
-       int i, amt, choice;
+       int i, choice;
        int item, item_new;
 
+       ITEM_NUMBER amt;
+
        s32b price, best;
 
        object_type forge;
@@ -3633,7 +3621,7 @@ msg_format("一つにつき $%ldです。", (long)(best));
 
                        /* Message */
 #ifdef JP
-msg_format("%s(%c)を購入する。", o_name, I2A(item));
+                       msg_format("%s(%c)を購入する。", o_name, I2A(item));
 #else
                        msg_format("Buying %s (%c).", o_name, I2A(item));
 #endif
@@ -3714,7 +3702,7 @@ msg_format("%sを $%ldで購入しました。", o_name, (long)price);
 
                                /* Message */
 #ifdef JP
-               msg_format("%s(%c)を手に入れた。", o_name, index_to_label(item_new));
+                               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));
@@ -3840,7 +3828,7 @@ msg_format("%sを $%ldで購入しました。", o_name, (long)price);
 
                /* Message */
 #ifdef JP
-                               msg_format("%s(%c)を取った。",
+               msg_format("%s(%c)を取った。",
 #else
                msg_format("You have %s (%c).",
 #endif
@@ -4909,7 +4897,7 @@ 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))
@@ -5245,7 +5233,7 @@ void do_cmd_store(void)
        p_ptr->town_num = old_town_num;
 
        /* Free turn XXX XXX XXX */
-       energy_use = 100;
+       p_ptr->energy_use = 100;
 
 
        /* Hack -- Character is no longer in "icky" mode */