OSDN Git Service

#37287 #37353 (2.2.0.89) 型の置換を継続中。 / Ongoing type replacement.
[hengband/hengband.git] / src / cmd2.c
index 7cbe03c..a1e7fa4 100644 (file)
@@ -874,7 +874,7 @@ static bool do_cmd_open_chest(int y, int x, s16b o_idx)
  * @param feat 地形ID
  * @return 開いた地形である場合TRUEを返す /  Return TRUE if the given feature is an open door
  */
-static bool is_open(int feat)
+static bool is_open(IDX feat)
 {
        return have_flag(f_info[feat].flags, FF_CLOSE) && (feat != feat_state(feat, FF_CLOSE));
 }
@@ -891,7 +891,7 @@ static bool is_open(int feat)
  * @details Return the number of features around (or under) the character.
  * Usually look for doors and floor traps.
  */
-static int count_dt(int *y, int *x, bool (*test)(int feat), bool under)
+static int count_dt(POSITION *y, POSITION *x, bool (*test)(IDX feat), bool under)
 {
        int d, count, xx, yy;
 
@@ -946,9 +946,10 @@ static int count_dt(int *y, int *x, bool (*test)(int feat), bool under)
  * @details
  * If requested, count only trapped chests.
  */
-static int count_chests(int *y, int *x, bool trapped)
+static int count_chests(POSITION *y, POSITION *x, bool trapped)
 {
-       int d, count, o_idx;
+       int d, count;
+       IDX o_idx;
 
        object_type *o_ptr;
 
@@ -995,7 +996,7 @@ static int count_chests(int *y, int *x, bool trapped)
  * @param x 方角を確認したX座標
  * @return 方向ID
  */
-static direction coords_to_dir(position y, position x)
+static DIRECTION coords_to_dir(POSITION y, POSITION x)
 {
        int d[3][3] = { {7, 4, 1}, {8, 5, 2}, {9, 6, 3} };
        int dy, dx;
@@ -1119,9 +1120,9 @@ static bool do_cmd_open_aux(int y, int x)
  */
 void do_cmd_open(void)
 {
-       int y, x;
-       direction dir;
-       idx o_idx;
+       POSITION y, x;
+       DIRECTION dir;
+       IDX o_idx;
 
        bool more = FALSE;
 
@@ -1295,7 +1296,8 @@ static bool do_cmd_close_aux(int y, int x)
  */
 void do_cmd_close(void)
 {
-       int y, x, dir;
+       POSITION y, x;
+       DIRECTION dir;
 
        bool more = FALSE;
 
@@ -1956,8 +1958,8 @@ static bool do_cmd_disarm_aux(int y, int x, int dir)
  */
 void do_cmd_disarm(void)
 {
-       int y, x, dir;
-
+       POSITION y, x;
+       DIRECTION dir;
        s16b o_idx;
 
        bool more = FALSE;
@@ -1983,8 +1985,7 @@ void do_cmd_disarm(void)
                /* See if only one target */
                if (num_traps || num_chests)
                {
-                       bool too_many = (num_traps && num_chests) || (num_traps > 1) ||
-                           (num_chests > 1);
+                       bool too_many = (num_traps && num_chests) || (num_traps > 1) || (num_chests > 1);
                        if (!too_many) command_dir = coords_to_dir(y, x);
                }
        }
@@ -3486,7 +3487,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
                                int now_exp = p_ptr->weapon_exp[0][j_ptr->sval];
                                if (now_exp < s_info[p_ptr->pclass].w_max[0][j_ptr->sval])
                                {
-                                       int amount = 0;
+                                       SUB_EXP amount = 0;
                                        if (now_exp < WEAPON_EXP_BEGINNER) amount = 80;
                                        else if (now_exp < WEAPON_EXP_SKILLED) amount = 25;
                                        else if ((now_exp < WEAPON_EXP_EXPERT) && (p_ptr->lev > 19)) amount = 10;
@@ -3646,12 +3647,12 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
                                        if (snipe_type == SP_RUSH)
                                        {
                                                int n = randint1(5) + 3;
-                                               int m_idx = c_mon_ptr->m_idx;
+                                               IDX m_idx = c_mon_ptr->m_idx;
 
                                                for ( ; cur_dis <= tdis; )
                                                {
-                                                       int ox = nx;
-                                                       int oy = ny;
+                                                       POSITION ox = nx;
+                                                       POSITION oy = ny;
 
                                                        if (!n) break;
 
@@ -3709,9 +3710,9 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
 
        if (stick_to)
        {
-               int m_idx = cave[y][x].m_idx;
+               IDX m_idx = cave[y][x].m_idx;
                monster_type *m_ptr = &m_list[m_idx];
-               int o_idx = o_pop();
+               IDX o_idx = o_pop();
 
                if (!o_idx)
                {
@@ -4616,7 +4617,8 @@ static void travel_flow(int ty, int tx)
  */
 void do_cmd_travel(void)
 {
-       int x, y, i;
+       POSITION x, y;
+       int i;
        int dx, dy, sx, sy;
        feature_type *f_ptr;