Merge pull request #76 from Alys/patch-3
subtract MP when unticking a todo (instead of add)
This commit is contained in:
+4
-1
@@ -834,8 +834,11 @@ api.wrap = (user) ->
|
||||
else
|
||||
calculateDelta()
|
||||
addPoints() # obviously for delta>0, but also a trick to undo accidental checkboxes
|
||||
user.stats.mp += _.max([(1 + (task.checklist?.length or 0)), (.01 * user._statsComputed.maxMP * (1 + (task.checklist?.length or 0)))]) # MP++ per ToDo, bonus per CLI
|
||||
mpDelta = _.max([(1 + (task.checklist?.length or 0)), (.01 * user._statsComputed.maxMP * (1 + (task.checklist?.length or 0)))]) # MP++ per ToDo, bonus per CLI
|
||||
mpDelta *= -1 if direction is 'down' # unticking a todo
|
||||
user.stats.mp += mpDelta
|
||||
user.stats.mp = user._statsComputed.maxMP if user.stats.mp >= user._statsComputed.maxMP
|
||||
user.stats.mp = 0 if user.stats.mp < 0 # BUT DO WE WANT THIS? SEE COMMIT DESCRIPTION
|
||||
|
||||
when 'reward'
|
||||
# Don't adjust values for rewards
|
||||
|
||||
Reference in New Issue
Block a user