Interrupt a multi turn action if hp or pw is restored to maximum

via UnNetHack by Patric Mueller
This commit is contained in:
Pasi Kallinen
2016-05-19 22:01:41 +03:00
parent d11241f61e
commit 2ea8666583
2 changed files with 22 additions and 0 deletions

View File

@@ -377,6 +377,7 @@ during end of game disclosure, the vanquished monsters list can be sorted in
one of several ways by answering 'a' to "disclose vanquished monsters?"
when #terrain is displaying a censored version of the map (no monsters, &c),
moving the cursor will display farlook's brief autodescribe feedback
interrupt a multi turn action if hp or pw is restored to maximum
Platform- and/or Interface-Specific New Features

View File

@@ -13,6 +13,7 @@
#ifdef POSITIONBAR
STATIC_DCL void NDECL(do_positionbar);
#endif
STATIC_DCL void FDECL(interrupt_multi, (const char *));
void
moveloop(resuming)
@@ -216,6 +217,8 @@ boolean resuming;
|| (wtcap < MOD_ENCUMBER && !(moves % 20))) {
context.botl = 1;
u.mh++;
if (u.mh >= u.mhmax)
interrupt_multi("You are in full health.");
}
} else if (u.uhp < u.uhpmax
&& (wtcap < MOD_ENCUMBER || !u.umoved
@@ -234,6 +237,8 @@ boolean resuming;
u.uhp += heal;
if (u.uhp > u.uhpmax)
u.uhp = u.uhpmax;
if (u.uhp >= u.uhpmax)
interrupt_multi("You are in full health.");
} else if (Regeneration
|| (u.ulevel <= 9
&& !(moves
@@ -241,6 +246,8 @@ boolean resuming;
+ 1)))) {
context.botl = 1;
u.uhp++;
if (u.uhp >= u.uhpmax)
interrupt_multi("You are in full health.");
}
}
@@ -270,6 +277,8 @@ boolean resuming;
if (u.uen > u.uenmax)
u.uen = u.uenmax;
context.botl = 1;
if (u.uen >= u.uenmax)
interrupt_multi("You feel full of energy.");
}
if (!u.uinvulnerable) {
@@ -690,4 +699,16 @@ do_positionbar()
}
#endif
STATIC_DCL void
interrupt_multi(msg)
const char *msg;
{
if (multi > 0 && !context.travel) {
nomul(0);
if (flags.verbose && msg)
Norep("%s", msg);
}
}
/*allmain.c*/