iterative levelling

This commit is contained in:
Philip How 2013-03-05 13:11:13 +00:00
parent d616579e4e
commit 8e7c93aa0b

View file

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