OSDN Git Service

[Refactor] #37287 #37353 型の置換。 / Type replacement.
[hengband/hengband.git] / src / racial.c
index 7b42f45..2599e49 100644 (file)
@@ -80,7 +80,8 @@ static bool do_cmd_archer(void)
        /**********Create shots*********/
        if (ext == 1)
        {
-               int x,y, dir;
+               POSITION x, y;
+               DIRECTION dir;
                cave_type *c_ptr;
 
                if (!get_rep_dir(&dir, FALSE)) return FALSE;
@@ -594,10 +595,10 @@ struct power_desc_type
 {
        char name[80];
        PLAYER_LEVEL level;
-       int  cost;
-       int  stat;
-       int  fail;
-       int  number;
+       int cost;
+       int stat;
+       int fail;
+       int number;
 };
 
 
@@ -805,23 +806,7 @@ static bool cmd_racial_power_aux(s32b command)
                }
                case CLASS_ROGUE:
                {
-                       int x, y;
-
-                       if (!get_rep_dir(&dir, FALSE)) return FALSE;
-                       y = p_ptr->y + ddy[dir];
-                       x = p_ptr->x + ddx[dir];
-                       if (cave[y][x].m_idx)
-                       {
-                               py_attack(y, x, 0);
-                               if (randint0(p_ptr->skill_dis) < 7)
-                                       msg_print(_("うまく逃げられなかった。", "You are failed to run away."));
-                               else teleport_player(30, 0L);
-                       }
-                       else
-                       {
-                               msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
-                               msg_print(NULL);
-                       }
+                       if(!panic_hit()) return FALSE;
                        break;
                }
                case CLASS_RANGER:
@@ -906,7 +891,7 @@ static bool cmd_racial_power_aux(s32b command)
                        }
                        else if (command == -4)
                        {
-                               int x, y;
+                               POSITION x, y;
 
                                if (!get_rep_dir(&dir, FALSE)) return FALSE;
                                y = p_ptr->y + ddy[dir];