mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-21 11:14:14 +00:00
Merge pull request #234 from HabitRPG/sabe/crits
feat(crits): Make crit hits boost MP
This commit is contained in:
commit
327a337a26
1 changed files with 1 additions and 0 deletions
|
|
@ -906,6 +906,7 @@ api.wrap = (user, main=true) ->
|
|||
# MP++ per checklist item in ToDo, bonus per CLI
|
||||
multiplier = _.max([(_.reduce(task.checklist,((m,i)->m+(if i.completed then 1 else 0)),1)),1])
|
||||
mpDelta = _.max([(multiplier), (.01 * user._statsComputed.maxMP * multiplier)])
|
||||
mpDelta *= user._tmp.crit or 1
|
||||
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