Merge pull request #387 from SabreCat/rebalancing

Implement boss damage from Habits
This commit is contained in:
Alice Harris
2014-12-13 05:27:00 +10:00
2 changed files with 6 additions and 5 deletions
+4 -1
View File
@@ -15550,11 +15550,14 @@ api.wrap = function(user, main) {
if (user.preferences.automaticAllocation === true && user.preferences.allocationMode === 'taskbased' && !(task.type === 'todo' && direction === 'down')) {
user.stats.training[task.attribute] += nextDelta;
}
if (direction === 'up' && !(task.type === 'habit' && !task.down)) {
if (direction === 'up') {
user.party.quest.progress.up = user.party.quest.progress.up || 0;
if ((_ref1 = task.type) === 'daily' || _ref1 === 'todo') {
user.party.quest.progress.up += nextDelta * (1 + (user._statsComputed.str / 200));
}
if (task.type === 'habit') {
user.party.quest.progress.up += nextDelta * (0.5 + (user._statsComputed.str / 400));
}
}
task.value += nextDelta;
}
+2 -4
View File
@@ -1003,12 +1003,10 @@ api.wrap = (user, main=true) ->
nextDelta = if not options.cron and direction is 'down' then calculateReverseDelta() else calculateDelta()
unless task.type is 'reward'
if (user.preferences.automaticAllocation is true and user.preferences.allocationMode is 'taskbased' and !(task.type is 'todo' and direction is 'down')) then user.stats.training[task.attribute] += nextDelta
# ===== STRENGTH =====
# (Only for up-scoring, ignore up-onlies and rewards)
# Note, we create a new val (adjustAmt) to add to task.value, since delta will be used in Exp & GP calculations - we don't want STR to bonus that
if direction is 'up' and !(task.type is 'habit' and !task.down)
if direction is 'up' # Make progress on quest based on STR
user.party.quest.progress.up = user.party.quest.progress.up || 0;
user.party.quest.progress.up += (nextDelta * (1 + (user._statsComputed.str / 200))) if task.type in ['daily','todo']
user.party.quest.progress.up += (nextDelta * (0.5 + (user._statsComputed.str / 400))) if task.type is 'habit'
task.value += nextDelta
delta += nextDelta