From b055b2d9a427f7f1479c5f48738f5ba37b28464b Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Mon, 16 Dec 2013 11:11:47 -0700 Subject: [PATCH] classes: replenish 10MP on cron --- dist/habitrpg-shared.js | 4 ++++ script/index.coffee | 3 +++ 2 files changed, 7 insertions(+) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index 63827df7f7..d4c5a565d0 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -11838,6 +11838,10 @@ var process=require("__browserify_process");(function() { if (user.items.lastDrop.count > 0) { user.items.lastDrop.count = 0; } + user.stats.mp += 10; + if (user.stats.mp > user._statsComputed.maxMP) { + user.stats.mp = user._statsComputed.maxMP; + } if (user.preferences.sleep === true) { return; } diff --git a/script/index.coffee b/script/index.coffee index 2fcf6f082c..7d41aa2c04 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -981,6 +981,9 @@ api.wrap = (user) -> if user.items.lastDrop.count > 0 user.items.lastDrop.count = 0 + user.stats.mp += 10 + user.stats.mp = user._statsComputed.maxMP if user.stats.mp > user._statsComputed.maxMP + # User is resting at the inn. Used to be we un-checked each daily without performing calculation (see commits before fb29e35) # but to prevent abusing the inn (http://goo.gl/GDb9x) we now do *not* calculate dailies, and simply set lastCron to today return if user.preferences.sleep is true