Uses of energy

If you have teleportitis, self-teleporting using ^T uses 19 energy [1], but you need 20 energy to attempt it. Having the Amulet of Yendor does not increase this. The usual random teleportitis does not use energy.

Gaining energy

You normally regain energy slowly over time, unless your encumbrance is Stressed or worse, which blocks normal energy regeneration. Having the Eye of the Aethiopica allows you to regain energy rapidly, even when stressed.

Reading any scroll of charging while confused recharges your energy to its maximum. If it was already maximum, you gain 5d4 total energy instead.[5]

Eating a newt corpse sometimes increases energy by 1 to 3 points. If this would put you over the maximum, your maximum energy might also increase by 1.

If you trigger a magic trap and it explodes, “Your body absorbs some of the magical energy!” and your maximum energy is increased by 2; your energy is then completely refilled.[6]

Attacking a spellcasting monster with Magicbane has a chance of cancelling it and increasing your current and maximum energy by 1 (“You absorb magical energy!”)[7]. Only the cancellation from Magicbane can absorb energy. This effect happens every time the cancellation attack hits, not just the first time, when the monster is actually cancelled.

Level gain

First, a random number is chosen;[10] your race minimum is then added to the result.[11]

Your role modifier depends on whether your experience level (before the level gain) is lower than a certain cutoff which varies between roles. If it is, apply the "low-XL" modifier; else use the "high-XL" modifier.

The result of this is then multiplied with your energy modifier, which depends on your role, and rounded down.[12]

The final result will be added to both your current and maximum energy.