From eb016649e1af54f6b03c3517b92868225dbc26c4 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Mon, 30 Dec 2013 14:51:49 -0700 Subject: [PATCH] checklists: grant GP bonus for CLIs on To-Dos --- dist/habitrpg-shared.js | 7 ++++--- script/index.coffee | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index a44dc420f0..cdaad1aa09 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -11662,7 +11662,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, num, options, stats, subtractPoints, task, th, _ref; + var addPoints, calculateDelta, delta, direction, id, num, options, stats, subtractPoints, task, th, _ref, _ref1; _ref = req.params, id = _ref.id, direction = _ref.direction; task = user.tasks[id]; options = req.query || {}; @@ -11784,8 +11784,9 @@ var process=require("__browserify_process");(function() { } else { calculateDelta(); addPoints(); - if (!(user.stats.mp >= user._statsComputed.maxMP)) { - user.stats.mp++; + user.stats.mp += 1 + (((_ref1 = task.checklist) != null ? _ref1.length : void 0) || 0); + if (user.stats.mp >= user._statsComputed.maxMP) { + user.stats.mp = user._statsComputed.maxMP; } } break; diff --git a/script/index.coffee b/script/index.coffee index 66603dfac5..f16d6a0129 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -782,7 +782,8 @@ api.wrap = (user) -> else calculateDelta() addPoints() # obviously for delta>0, but also a trick to undo accidental checkboxes - user.stats.mp++ unless user.stats.mp >= user._statsComputed.maxMP + user.stats.mp += (1 + (task.checklist?.length or 0)) # MP++ per ToDo, bonus per CLI + user.stats.mp = user._statsComputed.maxMP if user.stats.mp >= user._statsComputed.maxMP when 'reward' # Don't adjust values for rewards