#ifdef POSITIONBAR
static void do_positionbar(void);
#endif
+static void regen_pw(int);
static void regen_hp(int);
static void interrupt_multi(const char *);
static void debug_fields(const char *);
}
}
- if (u.uen < u.uenmax
- && ((mvl_wtcap < MOD_ENCUMBER
- && (!(g.moves % ((MAXULEV + 8 - u.ulevel)
- * (Role_if(PM_WIZARD) ? 3 : 4)
- / 6)))) || Energy_regeneration)) {
- u.uen += rn1(
- (int) (ACURR(A_WIS) + ACURR(A_INT)) / 15 + 1, 1);
- if (u.uen > u.uenmax)
- u.uen = u.uenmax;
- g.context.botl = TRUE;
- if (u.uen == u.uenmax)
- interrupt_multi("You feel full of energy.");
- }
+ regen_pw(mvl_wtcap);
if (!u.uinvulnerable) {
if (Teleportation && !rn2(85)) {
}
}
+static void
+regen_pw(int wtcap)
+{
+ if (u.uen < u.uenmax
+ && ((wtcap < MOD_ENCUMBER
+ && (!(g.moves % ((MAXULEV + 8 - u.ulevel)
+ * (Role_if(PM_WIZARD) ? 3 : 4)
+ / 6)))) || Energy_regeneration)) {
+ int upper = (int) (ACURR(A_WIS) + ACURR(A_INT)) / 15 + 1;
+
+ u.uen += rn1(upper, 1);
+ if (u.uen > u.uenmax)
+ u.uen = u.uenmax;
+ g.context.botl = TRUE;
+ if (u.uen == u.uenmax)
+ interrupt_multi("You feel full of energy.");
+ }
+}
+
#define U_CAN_REGEN() (Regeneration || (Sleepy && u.usleep))
/* maybe recover some lost health (or lose some when an eel out of water) */