Unify HP loss and passing out from overexertion
This commit is contained in:
@@ -896,6 +896,7 @@ E int NDECL(wiz_debug_cmd_traveldisplay);
|
|||||||
#endif
|
#endif
|
||||||
E boolean NDECL(u_rooted);
|
E boolean NDECL(u_rooted);
|
||||||
E void NDECL(domove);
|
E void NDECL(domove);
|
||||||
|
E void NDECL(overexert_hp);
|
||||||
E boolean NDECL(overexertion);
|
E boolean NDECL(overexertion);
|
||||||
E void NDECL(invocation_message);
|
E void NDECL(invocation_message);
|
||||||
E void NDECL(switch_terrain);
|
E void NDECL(switch_terrain);
|
||||||
|
|||||||
+1
-11
@@ -215,17 +215,7 @@ boolean resuming;
|
|||||||
if (wtcap > MOD_ENCUMBER && u.umoved) {
|
if (wtcap > MOD_ENCUMBER && u.umoved) {
|
||||||
if (!(wtcap < EXT_ENCUMBER ? g.moves % 30
|
if (!(wtcap < EXT_ENCUMBER ? g.moves % 30
|
||||||
: g.moves % 10)) {
|
: g.moves % 10)) {
|
||||||
if (Upolyd && u.mh > 1) {
|
overexert_hp();
|
||||||
u.mh--;
|
|
||||||
g.context.botl = TRUE;
|
|
||||||
} else if (!Upolyd && u.uhp > 1) {
|
|
||||||
u.uhp--;
|
|
||||||
g.context.botl = TRUE;
|
|
||||||
} else {
|
|
||||||
You("pass out from exertion!");
|
|
||||||
exercise(A_CON, FALSE);
|
|
||||||
fall_asleep(-10, FALSE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+17
-9
@@ -2061,6 +2061,22 @@ int x1, y1, x2, y2;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* HP loss or passing out from overexerting yourself */
|
||||||
|
void
|
||||||
|
overexert_hp()
|
||||||
|
{
|
||||||
|
int *hp = (!Upolyd ? &u.uhp : &u.mh);
|
||||||
|
|
||||||
|
if (*hp > 1) {
|
||||||
|
*hp -= 1;
|
||||||
|
g.context.botl = TRUE;
|
||||||
|
} else {
|
||||||
|
You("pass out from exertion!");
|
||||||
|
exercise(A_CON, FALSE);
|
||||||
|
fall_asleep(-10, FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* combat increases metabolism */
|
/* combat increases metabolism */
|
||||||
boolean
|
boolean
|
||||||
overexertion()
|
overexertion()
|
||||||
@@ -2070,15 +2086,7 @@ overexertion()
|
|||||||
execute if you decline to attack a peaceful monster */
|
execute if you decline to attack a peaceful monster */
|
||||||
gethungry();
|
gethungry();
|
||||||
if ((g.moves % 3L) != 0L && near_capacity() >= HVY_ENCUMBER) {
|
if ((g.moves % 3L) != 0L && near_capacity() >= HVY_ENCUMBER) {
|
||||||
int *hp = (!Upolyd ? &u.uhp : &u.mh);
|
overexert_hp();
|
||||||
|
|
||||||
if (*hp > 1) {
|
|
||||||
*hp -= 1;
|
|
||||||
} else {
|
|
||||||
You("pass out from exertion!");
|
|
||||||
exercise(A_CON, FALSE);
|
|
||||||
fall_asleep(-10, FALSE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return (boolean) (g.multi < 0); /* might have fainted (forced to sleep) */
|
return (boolean) (g.multi < 0); /* might have fainted (forced to sleep) */
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user