fix github issue #155 - encumbrance vs water

Fixes #155

When drowning, you need to be unencumbered in order to crawl out of
water.  When not drowing, you don't, but put a limit on how much can
be carried.  If polymorphed into a swimming creature, allow stressed
or less; otherwise (magical breathing), burdened or less.  (Doesn't
apply on the Plane of Water since there's no climb from water to land
involved.)
This commit is contained in:
PatR
2018-12-22 18:09:44 -08:00
parent d6ed41339e
commit 0eb11aa718
2 changed files with 16 additions and 1 deletions
+1
View File
@@ -302,6 +302,7 @@ when fire converts an ice location into a water location, dunk any monster on
training riding skill had an off-by-one bug when counting turns riding training riding skill had an off-by-one bug when counting turns riding
message sequencing when vampire shifts to fog cloud to pass under closed door: message sequencing when vampire shifts to fog cloud to pass under closed door:
when in sight, give form change message before moving to door spot when in sight, give form change message before moving to door spot
limit carrying heavy loads from water to land
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
+15 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 hack.c $NHDT-Date: 1544401269 2018/12/10 00:21:09 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.201 $ */ /* NetHack 3.6 hack.c $NHDT-Date: 1545530973 2018/12/23 02:09:33 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.202 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */ /*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1429,6 +1429,19 @@ domove()
} }
x = u.ux + u.dx; x = u.ux + u.dx;
y = u.uy + u.dy; y = u.uy + u.dy;
/* are we trying to move out of water while carrying too much? */
if (isok(x, y) && !is_pool(x, y) && !Is_waterlevel(&u.uz)
&& wtcap > (Swimming ? MOD_ENCUMBER : SLT_ENCUMBER)) {
/* when escaping from drowning you need to be unencumbered
in order to crawl out of water, but when not drowning,
doing so while encumbered is feasible; if in an aquatic
form, stressed or less is allowed; otherwise (magical
breathing), only burdened is allowed */
You("are carrying too much to climb out of the water.");
nomul(0);
return;
}
} }
if (!isok(x, y)) { if (!isok(x, y)) {
nomul(0); nomul(0);
@@ -1441,6 +1454,7 @@ domove()
if (iflags.mention_walls) { if (iflags.mention_walls) {
if (trap && trap->tseen) { if (trap && trap->tseen) {
int tt = what_trap(trap->ttyp); int tt = what_trap(trap->ttyp);
You("stop in front of %s.", You("stop in front of %s.",
an(defsyms[trap_to_defsym(tt)].explanation)); an(defsyms[trap_to_defsym(tt)].explanation));
} else if (is_pool_or_lava(x,y) && levl[x][y].seenv) { } else if (is_pool_or_lava(x,y) && levl[x][y].seenv) {