MCPcopy Index your code
hub / github.com/NetHack/NetHack / regen_pw

Function regen_pw

src/allmain.c:599–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

597}
598
599staticfn void
600regen_pw(int wtcap)
601{
602 if (u.uen < u.uenmax
603 && ((wtcap < MOD_ENCUMBER
604 && (!(svm.moves % ((MAXULEV + 8 - u.ulevel)
605 * (Role_if(PM_WIZARD) ? 3 : 4)
606 / 6)))) || Energy_regeneration)) {
607 int upper = (int) (ACURR(A_WIS) + ACURR(A_INT)) / 15 + 1;
608
609 if (EMagical_breathing)
610 upper += 2;
611
612 u.uen += rn1(upper, 1);
613 if (u.uen > u.uenmax)
614 u.uen = u.uenmax;
615 disp.botl = TRUE;
616 if (u.uen == u.uenmax)
617 interrupt_multi("You feel full of energy.");
618 }
619}
620
621#define U_CAN_REGEN() (Regeneration || (Sleepy && u.usleep))
622

Callers 1

allmain.cFile · 0.85

Calls 1

interrupt_multiFunction · 0.85

Tested by

no test coverage detected