From b98cfdb06619fece320d98c4ef49c4acec29b6b0 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Sat, 21 Dec 2013 15:20:02 -0700 Subject: [PATCH] restore MP on level up, and some additional MP on cron (based on stats.int) @wc8 --- dist/habitrpg-shared.js | 5 +++++ script/index.coffee | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index 0e3d1cf3a9..383c1edb73 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -11911,6 +11911,7 @@ var process=require("__browserify_process");(function() { stats.exp = 0; } user.stats.hp = 50; + user.stats.mp = user._statsComputed.maxMP; } } user.stats.exp = stats.exp; @@ -12065,6 +12066,10 @@ var process=require("__browserify_process");(function() { stealth: 0, streaks: false }; + user.stats.mp += Math.ceil(user._statsComputed.int * .15); + if (user.stats.mp > user._statsComputed.maxMP) { + user.stats.mp = user._statsComputed.maxMP; + } return user; }, preenUserHistory: function(minHistLen) { diff --git a/script/index.coffee b/script/index.coffee index 063fcd6a5a..39be8ecad0 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -970,6 +970,7 @@ api.wrap = (user) -> if user.stats.lvl == 100 stats.exp = 0 user.stats.hp = 50 + user.stats.mp = user._statsComputed.maxMP user.stats.exp = stats.exp # Set flags when they unlock features @@ -1081,6 +1082,9 @@ api.wrap = (user) -> user.markModified? 'history' user.markModified? 'dailys' # covers dailys.*.history user.stats.buffs = {str:0,int:0,per:0,con:0,stealth:0,streaks:false} + user.stats.mp += Math.ceil(user._statsComputed.int * .15) + if user.stats.mp > user._statsComputed.maxMP + user.stats.mp = user._statsComputed.maxMP user # Registered users with some history