static boolean air_turbulence(void);
static void slippery_ice_fumbling(void);
static boolean impaired_movement(xchar *, xchar *);
+static boolean carrying_too_much(void);
static void domove_core(void);
static void maybe_smudge_engr(int, int, int, int);
static struct monst *monstinroom(struct permonst *, int);
HFumbling &= ~FROMOUTSIDE;
}
-/* change movement dir if impaire. return TRUE if can't move */
+/* change movement dir if impaired. return TRUE if can't move */
static boolean
impaired_movement(xchar *x, xchar *y)
{
return FALSE;
}
+/* carrying too much to be able to move? */
+static boolean
+carrying_too_much(void)
+{
+ int wtcap;
+
+ if (((wtcap = near_capacity()) >= OVERLOADED
+ || (wtcap > SLT_ENCUMBER
+ && (Upolyd ? (u.mh < 5 && u.mh != u.mhmax)
+ : (u.uhp < 10 && u.uhp != u.uhpmax))))
+ && !Is_airlevel(&u.uz)) {
+ if (wtcap < OVERLOADED) {
+ You("don't have enough stamina to move.");
+ exercise(A_CON, FALSE);
+ } else
+ You("collapse under your load.");
+ nomul(0);
+ return TRUE;
+ }
+ return FALSE;
+}
+
void
domove(void)
{
register struct rm *tmpr;
xchar x, y;
struct trap *trap = NULL;
- int wtcap, glyph;
+ int glyph;
xchar chainx = 0, chainy = 0,
ballx = 0, bally = 0; /* ball&chain new positions */
int bc_control = 0; /* control for ball&chain */
g.context.travel1 = 0;
}
- if (((wtcap = near_capacity()) >= OVERLOADED
- || (wtcap > SLT_ENCUMBER
- && (Upolyd ? (u.mh < 5 && u.mh != u.mhmax)
- : (u.uhp < 10 && u.uhp != u.uhpmax))))
- && !Is_airlevel(&u.uz)) {
- if (wtcap < OVERLOADED) {
- You("don't have enough stamina to move.");
- exercise(A_CON, FALSE);
- } else
- You("collapse under your load.");
- nomul(0);
+ if (carrying_too_much())
return;
- }
+
if (u.uswallow) {
u.dx = u.dy = 0;
x = u.ustuck->mx, y = u.ustuck->my;