Allow fixed-destination teleport traps

Add a theme room with multiple visible teleportation traps
which will always teleport to specific locations in the same level.

Teleport trap change from xNetHack by copperwater <aosdict@gmail.com>.
This commit is contained in:
Pasi Kallinen
2024-06-14 19:47:29 +03:00
parent a8099edca6
commit 951401e52a
6 changed files with 76 additions and 3 deletions

View File

@@ -541,6 +541,15 @@ maketrap(coordxy x, coordxy y, int typ)
unearth_objs(x, y);
break;
case TELEP_TRAP:
if (isok(gl.launchplace.x, gl.launchplace.y)) {
ttmp->teledest.x = gx.xstart + gl.launchplace.x;
ttmp->teledest.y = gy.ystart + gl.launchplace.y;
if (ttmp->teledest.x == x && ttmp->teledest.y == y) {
impossible("making fixed-dest tele trap pointing to itself");
}
}
break;
}
if (!oldplace) {