Keep leveling up as long as there is enough exp

* this maybe must be adapted to a more limited but makes sense,
  players will stay trying to get more and more levels..
* from e221221a34
  adapted to this minenux fork
* TODO: pending to fine tune to not infinite levels #40 at
  https://codeberg.org/minenux/minetest-game-adventuretest/issues/40
  and
  #40
master
mckaygerhard 2023-01-11 15:48:39 -04:00
parent 6d236fe10d
commit 6f081ff323
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ function skills.add_exp(name, exp)
l.exp = l.exp + exp
local next_level = ((l.level^2) * 50)
if l.exp >= next_level then
while l.exp >= next_level do
l.level = l.level + 1
l.exp = l.exp - next_level
minetest.chat_send_player(name,"You have gained a level! You are now level "..tostring(l.level))