Rework stairs structure

Use a linked list to store stair and ladder information, instead
of having fixed up/down stairs/ladders and a single "special" (branch)
stair.

Breaks saves and bones.

Adds information to migrating objects and monsters for the dungeon
and level where they are migrating from.
This commit is contained in:
Pasi Kallinen
2020-11-09 18:50:02 +02:00
parent e23f764d11
commit 6ec55a3624
34 changed files with 552 additions and 361 deletions

View File

@@ -1015,6 +1015,7 @@ const char *s;
mazexy(&mm);
mkstairs(mm.x, mm.y, 0, (struct mkroom *) 0); /* down */
} else { /* choose "vibrating square" location */
stairway *stway;
int trycnt = 0;
#define x_maze_min 2
#define y_maze_min 2
@@ -1047,10 +1048,11 @@ const char *s;
to be on a spot that's already in use (wall|trap) */
if (++trycnt > 1000)
break;
} while (x == xupstair || y == yupstair /*(direct line)*/
|| abs(x - xupstair) == abs(y - yupstair)
|| distmin(x, y, xupstair, yupstair) <= INVPOS_DISTANCE
|| !SPACE_POS(levl[x][y].typ) || occupied(x, y));
} while (((stway = stairway_find_dir(TRUE)) != 0)
&& (x == stway->sx || y == stway->sy /*(direct line)*/
|| abs(x - stway->sx) == abs(y - stway->sy)
|| distmin(x, y, stway->sx, stway->sy) <= INVPOS_DISTANCE
|| !SPACE_POS(levl[x][y].typ) || occupied(x, y)));
g.inv_pos.x = x;
g.inv_pos.y = y;
maketrap(g.inv_pos.x, g.inv_pos.y, VIBRATING_SQUARE);