mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-19 02:04:10 +00:00
classes: replenish 10MP on cron
This commit is contained in:
parent
49ba74f9bd
commit
b055b2d9a4
2 changed files with 7 additions and 0 deletions
4
dist/habitrpg-shared.js
vendored
4
dist/habitrpg-shared.js
vendored
|
|
@ -11838,6 +11838,10 @@ var process=require("__browserify_process");(function() {
|
|||
if (user.items.lastDrop.count > 0) {
|
||||
user.items.lastDrop.count = 0;
|
||||
}
|
||||
user.stats.mp += 10;
|
||||
if (user.stats.mp > user._statsComputed.maxMP) {
|
||||
user.stats.mp = user._statsComputed.maxMP;
|
||||
}
|
||||
if (user.preferences.sleep === true) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -981,6 +981,9 @@ api.wrap = (user) ->
|
|||
if user.items.lastDrop.count > 0
|
||||
user.items.lastDrop.count = 0
|
||||
|
||||
user.stats.mp += 10
|
||||
user.stats.mp = user._statsComputed.maxMP if user.stats.mp > user._statsComputed.maxMP
|
||||
|
||||
# User is resting at the inn. Used to be we un-checked each daily without performing calculation (see commits before fb29e35)
|
||||
# but to prevent abusing the inn (http://goo.gl/GDb9x) we now do *not* calculate dailies, and simply set lastCron to today
|
||||
return if user.preferences.sleep is true
|
||||
|
|
|
|||
Loading…
Reference in a new issue