Planes of Water and Air

Make the Plane of Water be water all the way to edge instead of having
stone on left, top, and right.  The Plane of Air already has air all
the way to edge (including unused/unuseable column #0) but does so via
code rather than the level description file so Water does that now too.

The edges of the Plane of Air were cloudless (3 columns on the left,
2 rows on the top, and 2 columns on the right; don't recall about the
bottom) and that looked pretty strange.  Those rows and columns are
beyond the range of bubble/cloud movement so just make some of those
spots randomly be sight-blocking cloud terrain instead of all open air.
It isn't integrated with the moving clouds but looks fairly good when
the hero moves along the edge of the level.

Using wizard mode to leave Water or Air and later return resulted in
no clouds on the Air level and bubbles as usual on the Water level.
I still don't understand why, but on return to those levels run the
bubble creation routine as if the old discarded bubbles or clouds were
being restored.
This commit is contained in:
PatR
2019-05-31 03:42:06 -07:00
parent 791b87833b
commit 48cd573e32
3 changed files with 65 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 do.c $NHDT-Date: 1559088523 2019/05/29 00:08:43 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.190 $ */
/* NetHack 3.6 do.c $NHDT-Date: 1559299314 2019/05/31 10:41:54 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.191 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1374,7 +1374,7 @@ boolean at_stairs, falling, portal;
created instead), we need to discard them to avoid a memory leak;
so bubbles are now discarded as we leave the level they're used on */
if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz))
save_waterlevel(fd, FREE_SAVE); /* note: doesn't use 'fd' */
save_waterlevel(-1, FREE_SAVE);
bclose(fd);
if (cant_go_back) {
/* discard unreachable levels; keep #0 */
@@ -1434,6 +1434,11 @@ boolean at_stairs, falling, portal;
reseed_random(rn2_on_display_rng);
minit(); /* ZEROCOMP */
getlev(fd, hackpid, new_ledger, FALSE);
/* when in wizard mode, it is possible to leave from and return to
any level in the endgame; above, we discarded bubble/cloud info
when leaving Plane of Water or Air so recreate some now */
if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz))
restore_waterlevel(-1);
(void) nhclose(fd);
oinit(); /* reassign level dependent obj probabilities */
}