| 597 | } |
| 598 | |
| 599 | staticfn void |
| 600 | regen_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 |
no test coverage detected