iterative levelling

This commit is contained in:
Philip How 2013-03-05 13:17:46 +00:00
parent 8e7c93aa0b
commit 7e402c5688

View file

@ -142,14 +142,11 @@ updateStats = (model, newStats, batch) ->
silent = false
if newStats.exp >= tnl
silent = true
#user.set('stats.exp', newStats.exp)
while newStats.exp >= tnl
console.log(newStats.exp + " " + tnl)
user.set('stats.exp', newStats.exp)
while newStats.exp >= tnl # keep levelling up
newStats.exp -= tnl
obj.stats.lvl++
tnl = obj.stats.lvl * 2
#tnl = algos.tnl(obj.stats.lvl)
console.log(tnl)
tnl = algos.tnl(obj.stats.lvl)
obj.stats.hp = 50
obj.stats.exp = newStats.exp