diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index d253122e66..a48f318d5e 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -11936,7 +11936,7 @@ var process=require("__browserify_process");(function() { return typeof cb === "function" ? cb(null, _.pick(user, $w('stats'))) : void 0; }, score: function(req, cb) { - var addPoints, calculateDelta, delta, direction, id, mpDelta, num, options, stats, subtractPoints, task, th, _ref, _ref1, _ref2; + var addPoints, calculateDelta, delta, direction, id, mpDelta, multiplier, num, options, stats, subtractPoints, task, th, _ref, _ref1; _ref = req.params, id = _ref.id, direction = _ref.direction; task = user.tasks[id]; options = req.query || {}; @@ -12064,7 +12064,8 @@ var process=require("__browserify_process");(function() { } else { calculateDelta(); addPoints(); - mpDelta = _.max([1 + (((_ref1 = task.checklist) != null ? _ref1.length : void 0) || 0), .01 * user._statsComputed.maxMP * (1 + (((_ref2 = task.checklist) != null ? _ref2.length : void 0) || 0))]); + multiplier = ((_ref1 = task.checklist) != null ? _ref1.length : void 0) || 1; + mpDelta = _.max([multiplier, .01 * user._statsComputed.maxMP * multiplier]); if (direction === 'down') { mpDelta *= -1; } diff --git a/script/index.coffee b/script/index.coffee index 6e3be9808a..df76669523 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -845,7 +845,9 @@ api.wrap = (user, main=true) -> else calculateDelta() addPoints() # obviously for delta>0, but also a trick to undo accidental checkboxes - mpDelta = _.max([(1 + (task.checklist?.length or 0)), (.01 * user._statsComputed.maxMP * (1 + (task.checklist?.length or 0)))]) # MP++ per ToDo, bonus per CLI + # MP++ per checklist item in ToDo, bonus per CLI + multiplier = task.checklist?.length || 1 + mpDelta = _.max([(multiplier), (.01 * user._statsComputed.maxMP * multiplier)]) mpDelta *= -1 if direction is 'down' # unticking a todo user.stats.mp += mpDelta user.stats.mp = user._statsComputed.maxMP if user.stats.mp >= user._statsComputed.maxMP