groundwork: u.uinwater manipulation

Toggle u.uinwater on or off in just one place.
This commit is contained in:
PatR
2020-04-03 01:04:27 -07:00
parent 5f9714bf92
commit a2338e92aa
9 changed files with 22 additions and 13 deletions

View File

@@ -3805,7 +3805,7 @@ drown()
placebc();
}
vision_recalc(2); /* unsee old position */
u.uinwater = 1;
set_uinwater(1); /* u.uinwater = 1 */
under_water(1);
g.vision_full_recalc = 1;
return FALSE;
@@ -3871,7 +3871,7 @@ drown()
/* still too much weight */
pline("But in vain.");
}
u.uinwater = 1;
set_uinwater(1); /* u.uinwater = 1 */
You("drown.");
for (i = 0; i < 5; i++) { /* arbitrary number of loops */
/* killer format and name are reconstructed every iteration
@@ -3890,7 +3890,7 @@ drown()
pline("You're still drowning.");
}
if (u.uinwater) {
u.uinwater = 0;
set_uinwater(0); /* u.uinwater = 0 */
You("find yourself back %s.",
Is_waterlevel(&u.uz) ? "in an air bubble" : "on land");
}