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
https://git.minetest.io/minenux/minetest-game-adventuretest/issues/40
This commit is contained in:
parent
6d236fe10d
commit
6f081ff323
@ -63,7 +63,7 @@ function skills.add_exp(name, exp)
|
|||||||
l.exp = l.exp + exp
|
l.exp = l.exp + exp
|
||||||
local next_level = ((l.level^2) * 50)
|
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.level = l.level + 1
|
||||||
l.exp = l.exp - next_level
|
l.exp = l.exp - next_level
|
||||||
minetest.chat_send_player(name,"You have gained a level! You are now level "..tostring(l.level))
|
minetest.chat_send_player(name,"You have gained a level! You are now level "..tostring(l.level))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user