mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-17 17:32:22 +00:00
use linear growth TNL algorithm
This commit is contained in:
parent
3cb7fd75c8
commit
79cf7d2bb9
4 changed files with 6 additions and 5 deletions
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
Loading…
Reference in a new issue