From ff0906a5c07c88227e510b44d5690b8bde9e4cc2 Mon Sep 17 00:00:00 2001 From: Verabird Date: Sat, 24 Jan 2015 12:07:39 -0500 Subject: [PATCH] Fix completed todos counting as checked dailies and change unless-else to if-else --- script/index.coffee | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/script/index.coffee b/script/index.coffee index b87e7a1827..42e4fb0603 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -1457,7 +1457,10 @@ api.wrap = (user, main=true) -> # Magic points calculated AFTER stealth -- stealthed tasks are treated as just not being there # Deduct experience for missed Daily tasks, but not for Todos (just increase todo's value) - unless completed + if completed + if (type is 'daily') + dailyChecked++ + else scheduleMisses = daysMissed # for dailys which have repeat dates, need to calculate how many they've missed according to their own schedule if (type is 'daily') and repeat @@ -1474,8 +1477,7 @@ api.wrap = (user, main=true) -> dailyDueUnchecked += 1 delta = user.ops.score({params:{id:task.id, direction:'down'}, query:{times:scheduleMisses, cron:true}}); user.party.quest.progress.down += delta if type is 'daily' - else - dailyChecked++ + switch type when 'daily' @@ -1527,10 +1529,10 @@ api.wrap = (user, main=true) -> # Adjust for fraction of dailies completed #console.log("Prior MP: " + user.stats.mp) dailyChecked=1 if dailyDueUnchecked is 0 and dailyChecked is 0 - # console.log("DueUnchecked: " + dailyDueUnchecked) - # console.log("Checked: " + dailyChecked) + #console.log("DueUnchecked: " + dailyDueUnchecked) + #console.log("Checked: " + dailyChecked) user.stats.mp += _.max([10,.1 * user._statsComputed.maxMP]) * dailyChecked / (dailyDueUnchecked + dailyChecked) - # console.log("After MP: " +user.stats.mp) + #console.log("After MP: " +user.stats.mp) 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