Shows quest progress notification when completing task #7922 (#7951)

This commit is contained in:
Tom Gamble
2016-09-23 21:41:31 -04:00
committed by Blade Barringer
parent bccdf4e989
commit b54441a637
8 changed files with 73 additions and 3 deletions

View File

@@ -150,14 +150,17 @@ function _changeTaskValue (user, task, direction, times, cron) {
if (direction === 'up') { // Make progress on quest based on STR
user.party.quest.progress.up = user.party.quest.progress.up || 0;
let prevProgress = user.party.quest.progress.up;
if (task.type === 'todo' || task.type === 'daily') {
user.party.quest.progress.up += nextDelta * (1 + user._statsComputed.str / 200);
} else if (task.type === 'habit') {
user.party.quest.progress.up += nextDelta * (0.5 + user._statsComputed.str / 400);
}
}
if (!user._tmp.quest) user._tmp.quest = {};
user._tmp.quest.progressDelta = user.party.quest.progress.up - prevProgress;
}
task.value += nextDelta;
}