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

@@ -2891,6 +2891,7 @@ struct obj *obj; /* wand or spell */
struct engr *e;
struct trap *ttmp;
char buf[BUFSZ];
stairway *stway = g.stairs;
/* some wands have special effects other than normal bhitpile */
/* drawbridge might change <u.ux,u.uy> */
@@ -2913,11 +2914,16 @@ struct obj *obj; /* wand or spell */
return TRUE; /* we've done our own bhitpile */
case WAN_OPENING:
case SPE_KNOCK:
while (stway) {
if (!stway->isladder && !stway->up && stway->tolev.dnum == u.uz.dnum)
break;
stway = stway->next;
}
/* up or down, but at closed portcullis only */
if (is_db_wall(x, y) && find_drawbridge(&xx, &yy)) {
open_drawbridge(xx, yy);
disclose = TRUE;
} else if (u.dz > 0 && (x == xdnstair && y == ydnstair)
} else if (u.dz > 0 && stway && stway->sx == x && stway->sy == y
/* can't use the stairs down to quest level 2 until
leader "unlocks" them; give feedback if you try */
&& on_level(&u.uz, &qstart_level) && !ok_to_quest()) {