From 1dec4ba7a67addb423f2396d55de05d3119173b4 Mon Sep 17 00:00:00 2001 From: Alys Date: Sun, 10 May 2015 18:17:17 +1000 Subject: [PATCH] allow MP gained for Habits and Dailies to be increased when a critical hit occurs (crits are triggered in addPoints) --- common/script/index.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/script/index.coffee b/common/script/index.coffee index ed62b7a0ad..9018a4d29f 100644 --- a/common/script/index.coffee +++ b/common/script/index.coffee @@ -1130,9 +1130,9 @@ api.wrap = (user, main=true) -> switch task.type when 'habit' changeTaskValue() - gainMP(_.max([0.25, (.0025 * user._statsComputed.maxMP)]) * if direction is 'down' then -1 else 1) # Add habit value to habit-history (if different) if (delta > 0) then addPoints() else subtractPoints() + gainMP(_.max([0.25, (.0025 * user._statsComputed.maxMP)]) * if direction is 'down' then -1 else 1) # History th = (task.history ?= []) @@ -1149,10 +1149,10 @@ api.wrap = (user, main=true) -> task.streak = 0 unless user.stats.buffs.streaks else changeTaskValue() - gainMP(_.max([1, (.01 * user._statsComputed.maxMP)]) * if direction is 'down' then -1 else 1) if direction is 'down' delta = calculateDelta() # recalculate delta for unchecking so the gp and exp come out correctly addPoints() # obviously for delta>0, but also a trick to undo accidental checkboxes + gainMP(_.max([1, (.01 * user._statsComputed.maxMP)]) * if direction is 'down' then -1 else 1) if direction is 'up' task.streak = if task.streak then task.streak + 1 else 1 # Give a streak achievement when the streak is a multiple of 21