*/
bool new_player_spot(void)
{
- position y = 0, x = 0;
+ POSITION y = 0, x = 0;
int max_attempts = 10000;
cave_type *c_ptr;
while (max_attempts--)
{
/* Pick a legal spot */
- y = (position)rand_range(1, cur_hgt - 2);
- x = (position)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];
*/
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 */
* inner -- inner room walls\n
* outer -- outer room walls\n
* solid -- solid room walls\n
- * TODO: tmp_row/tmp_col をposition型に後から直す。
*/
-bool build_tunnel(position row1, position col1, position row2, position 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 = (position)tmp_row;
- col1 = (position)tmp_col;
+ row1 = (POSITION)tmp_row;
+ col1 = (POSITION)tmp_col;
/* Save the wall location */
if (dun->wall_n < WALL_MAX)
else if (c_ptr->info & (CAVE_ROOM))
{
/* Accept the location */
- row1 = (position)tmp_row;
- col1 = (position)tmp_col;
+ row1 = tmp_row;
+ col1 = tmp_col;
}
/* Tunnel through all other walls */
else if (is_extra_grid(c_ptr) || is_inner_grid(c_ptr) || is_solid_grid(c_ptr))
{
/* Accept this location */
- row1 = (position)tmp_row;
- col1 = (position)tmp_col;
+ row1 = tmp_row;
+ col1 = tmp_col;
/* Save the tunnel location */
if (dun->tunn_n < TUNN_MAX)
else
{
/* Accept the location */
- row1 = (position)tmp_row;
- col1 = (position)tmp_col;
+ row1 = tmp_row;
+ col1 = tmp_col;
/* Collect legal door locations */
if (!door_flag)
* routine.\n
* @todo 特に詳細な処理の意味を調査すべし
*/
-static bool set_tunnel(position *x, position *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(position x, position y)
+static void create_cata_tunnel(POSITION x, POSITION y)
{
- position 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;
- position x, y;
+ POSITION x, y;
int length;
/* Check for early exit */
* 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(position x1, position y1, position x2, position 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; // TODO: いずれpositon型に変える
+ POSITION x3, y3, dx, dy;
int changex, changey;
int length;
int i;
/* Save the door location */
if (dun->door_n < DOOR_MAX)
{
- dun->door[dun->door_n].y = (position)y3;
- dun->door[dun->door_n].x = (position)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, (position)x3, (position)y3, type, cutoff))
+ if (build_tunnel2(x1, y1, (POSITION)x3, (POSITION)y3, type, cutoff))
{
- retval = build_tunnel2((position)x3, (position)y3, x2, y2, type, cutoff);
+ retval = build_tunnel2((POSITION)x3, (POSITION)y3, x2, y2, type, cutoff);
firstsuccede = TRUE;
}
else