*/
bool new_player_spot(void)
{
- int y, x;
+ POSITION y = 0, x = 0;
int max_attempts = 10000;
cave_type *c_ptr;
while (max_attempts--)
{
/* Pick a legal spot */
- y = rand_range(1, cur_hgt - 2);
- x = rand_range(1, cur_wid - 2);
+ y = (POSITION)rand_range(1, cur_hgt - 2);
+ x = (POSITION)rand_range(1, cur_wid - 2);
c_ptr = &cave[y][x];
return FALSE;
/* Save the new player grid */
- py = y;
- px = x;
+ p_ptr->y = y;
+ p_ptr->x = x;
return TRUE;
}
*/
void vault_monsters(int y1, int x1, int num)
{
- int k, i, y, x;
+ int k, i;
+ POSITION y, x;
cave_type *c_ptr;
/* Try to summon "num" monsters "near" the given location */
* outer -- outer room walls\n
* solid -- solid room walls\n
*/
-bool build_tunnel(int row1, int col1, int row2, int col2)
+bool build_tunnel(POSITION row1, POSITION col1, POSITION row2, POSITION col2)
{
int y, x;
- int tmp_row, tmp_col;
+ POSITION tmp_row, tmp_col;
int row_dir, col_dir;
int start_row, start_col;
int main_loop_count = 0;
if (is_solid_bold(y, x)) continue;
/* Accept this location */
- row1 = tmp_row;
- col1 = tmp_col;
+ row1 = (POSITION)tmp_row;
+ col1 = (POSITION)tmp_col;
/* Save the wall location */
if (dun->wall_n < WALL_MAX)
* routine.\n
* @todo 特に詳細な処理の意味を調査すべし
*/
-static bool set_tunnel(int *x, int *y, bool affectwall)
+static bool set_tunnel(POSITION *x, POSITION *y, bool affectwall)
{
int i, j, dx, dy;
* Note that this routine is only called on "even" squares - so it gives
* a natural checkerboard pattern.
*/
-static void create_cata_tunnel(int x, int y)
+static void create_cata_tunnel(POSITION x, POSITION y)
{
- int x1, y1;
+ POSITION x1, y1;
/* Build tunnel */
x1 = x - 1;
*/
static void short_seg_hack(int x1, int y1, int x2, int y2, int type, int count, bool *fail)
{
- int i, x, y;
+ int i;
+ POSITION x, y;
int length;
/* Check for early exit */
/*!
* @brief 特定の壁(永久壁など)を避けながら部屋間の通路を作成する / This routine maps a path from (x1, y1) to (x2, y2) avoiding SOLID walls.
* @return なし
- * @todo 詳細用調査
+ * @todo 詳細要調査
* @details
* Permanent rock is ignored in this path finding- sometimes there is no\n
* path around anyway -so there will be a crash if we try to find one.\n
* Note it is VERY important that the "stop if hit another passage" logic\n
* stays as is. Without this the dungeon turns into Swiss Cheese...\n
*/
-bool build_tunnel2(int x1, int y1, int x2, int y2, int type, int cutoff)
+bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff)
{
- int x3, y3, dx, dy;
+ POSITION x3, y3, dx, dy;
int changex, changey;
int length;
int i;
/* perturbation perpendicular to path */
changex = (randint0(abs(dy) + 2) * 2 - abs(dy) - 1) / 2;
-
- /* perturbation perpendicular to path */
changey = (randint0(abs(dx) + 2) * 2 - abs(dx) - 1) / 2;
/* Work out "mid" ponit */
/* Save the door location */
if (dun->door_n < DOOR_MAX)
{
- dun->door[dun->door_n].y = y3;
- dun->door[dun->door_n].x = x3;
+ dun->door[dun->door_n].y = (POSITION)y3;
+ dun->door[dun->door_n].x = (POSITION)x3;
dun->door_n++;
}
else return FALSE;
else
{
/* tunnel through walls */
- if (build_tunnel2(x1, y1, x3, y3, type, cutoff))
+ if (build_tunnel2(x1, y1, (POSITION)x3, (POSITION)y3, type, cutoff))
{
- retval = build_tunnel2(x3, y3, x2, y2, type, cutoff);
+ retval = build_tunnel2((POSITION)x3, (POSITION)y3, x2, y2, type, cutoff);
firstsuccede = TRUE;
}
else