Don't give n+1 MP for a todo with n checklist items

This commit is contained in:
Cole Gleason 2014-01-09 13:16:39 -06:00
parent 3e290b4734
commit 98e0c5213e

View file

@ -845,7 +845,10 @@ api.wrap = (user, main=true) ->
else
calculateDelta()
addPoints() # obviously for delta>0, but also a trick to undo accidental checkboxes
mpDelta = _.max([(1 + (task.checklist?.length or 0)), (.01 * user._statsComputed.maxMP * (1 + (task.checklist?.length or 0)))]) # MP++ per ToDo, bonus per CLI
console.log(task.checklist?.length)
# MP++ per checklist item in ToDo, bonus per CLI
multiplier = task.checklist?.length || 1
mpDelta = _.max([(multiplier), (.01 * user._statsComputed.maxMP * multiplier)])
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