use linear growth TNL algorithm

This commit is contained in:
Tyler Renelle 2012-09-06 12:27:41 -04:00
parent 3cb7fd75c8
commit 79cf7d2bb9
4 changed files with 6 additions and 5 deletions

View file

@ -59,7 +59,7 @@ get('/:uidParam?', function(page, model, _arg, next) {
reroll: content.items.reroll
});
model.fn('_user._tnl', '_user.stats.lvl', function(lvl) {
return (50 * Math.pow(lvl, 2) - 150 * lvl + 200) / 5;
return (lvl * 100) / 5;
});
model.refList("_habitList", "_user.tasks", "_user.habitIds");
model.refList("_dailyList", "_user.tasks", "_user.dailyIds");

View file

@ -205,7 +205,7 @@ module.exports.tally = function(user, momentDate) {
lvl = 0;
while (lvl < (user.get('stats.lvl') - 1)) {
lvl++;
expTally += (50 * Math.pow(lvl, 2) - 150 * lvl + 200) / 5;
expTally += (lvl * 100) / 5;
}
return user.push('history.exp', {
date: new Date(),

View file

@ -47,8 +47,9 @@ get '/:uidParam?', (page, model, {uidParam}, next) ->
reroll: content.items.reroll
model.fn '_user._tnl', '_user.stats.lvl', (lvl) ->
# http://tibia.wikia.com/wiki/Formula
(50 * Math.pow(lvl, 2) - 150 * lvl + 200)/5
# see https://github.com/lefnire/habitrpg/issues/4
# also update in scoring.coffee. TODO create a function accessible in both locations
(lvl*100)/5
# Default Tasks
model.refList "_habitList", "_user.tasks", "_user.habitIds"

View file

@ -166,5 +166,5 @@ module.exports.tally = (user, momentDate) ->
lvl = 0 #iterator
while lvl < (user.get('stats.lvl')-1)
lvl++
expTally += (50 * Math.pow(lvl, 2) - 150 * lvl + 200)/5
expTally += (lvl*100)/5
user.push 'history.exp', { date: new Date(), value: expTally }