#4177

 · 
vanilla

Create a new stat to track the maximum level a player has ever reached, named “u.ulevelpeak”, and use it when computing the difficulty monsters should generate at, so that the player has no incentive to drain levels from themself to get easier monsters.

ulevelpeak is used rather than the existing ulevelmax because ulevelmax represents the highest level it is possible for the player to return to via restore ability, and shrinks when doing things such as quaffing blessed full healing to restore lost levels and losing levels when polymorphing into one’s own race, so it’s unsuitable for the monster generation purpose.