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

@@ -3958,6 +3958,7 @@ boolean doit;
schar typ = levl[u.ux][u.uy].typ;
int npick;
menu_item *picks = (menu_item *) 0;
stairway *stway = stairway_at(u.ux, u.uy);
win = create_nhwindow(NHW_MENU);
start_menu(win, MENU_BEHAVE_STANDARD);
@@ -3974,16 +3975,14 @@ boolean doit;
add_herecmd_menuitem(win, dosit,
"Sit on the throne");
if (On_stairs_up(u.ux, u.uy)) {
if (stway && stway->up) {
Sprintf(buf, "Go up the %s",
(u.ux == xupladder && u.uy == yupladder)
? "ladder" : "stairs");
stway->isladder ? "ladder" : "stairs");
add_herecmd_menuitem(win, doup, buf);
}
if (On_stairs_dn(u.ux, u.uy)) {
if (stway && !stway->up) {
Sprintf(buf, "Go down the %s",
(u.ux == xupladder && u.uy == yupladder)
? "ladder" : "stairs");
stway->isladder ? "ladder" : "stairs");
add_herecmd_menuitem(win, dodown, buf);
}
if (u.usteed) { /* another movement choice */