mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-05 13:33:00 +00:00
Don't give n+1 MP for a todo with n checklist items
This commit is contained in:
parent
3e290b4734
commit
98e0c5213e
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue