fix(cron): Move daily MP after Perfect Day

Previously, users gained MP very early in the cron process. This meant that no buffs affected daily MP gain. Now, MP gain happens after the Perfect Day bonus is applied, so getting an INT boost that pushes you over 100 max MP gives you a tangible benefit.
This commit is contained in:
Sabe Jones 2014-04-22 21:05:58 -05:00
parent b0c1b13af0
commit 676d90fda0

View file

@ -1182,9 +1182,6 @@ api.wrap = (user, main=true) ->
if user.items.lastDrop.count > 0
user.items.lastDrop.count = 0
user.stats.mp += _.max([10,.1 * user._statsComputed.maxMP])
user.stats.mp = user._statsComputed.maxMP if user.stats.mp > user._statsComputed.maxMP
# "Perfect Day" achievement for perfect-days
perfect = true
clearBuffs = {str:0,int:0,per:0,con:0,stealth:0,streaks:false}
@ -1258,6 +1255,11 @@ api.wrap = (user, main=true) ->
{str:lvlDiv2,int:lvlDiv2,per:lvlDiv2,con:lvlDiv2,stealth:0,streaks:false}
else clearBuffs
# Add 10 MP, or 10% of max MP if that'd be more. Perform this after Perfect Day for maximum benefit
user.stats.mp += _.max([10,.1 * user._statsComputed.maxMP])
user.stats.mp = user._statsComputed.maxMP if user.stats.mp > user._statsComputed.maxMP
# After all is said and done, progress up user's effect on quest, return those values & reset the user's
progress = user.party.quest.progress; _progress = _.cloneDeep progress
_.merge progress, {down:0,up:0}