mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
Merge branch 'develop' into challenges
This commit is contained in:
commit
2c8112cd61
3 changed files with 19 additions and 15 deletions
|
|
@ -286,7 +286,7 @@
|
|||
"sheild1Text": "Decreases HP loss by 3%",
|
||||
"sheild2Name" : "Buckler",
|
||||
"sheild2Text": "Decreases HP loss by 4%",
|
||||
"sheild3Name" : "Enforced Shield",
|
||||
"sheild3Name" : "Reinforced Shield",
|
||||
"sheild3Text": "Decreases HP loss by 5%",
|
||||
"sheild4Name" : "Red Shield",
|
||||
"sheild4Text": "Decreases HP loss by 7%",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
"derby": "git://github.com/lefnire/derby#habitrpg",
|
||||
"racer": "git://github.com/lefnire/racer#habitrpg",
|
||||
"racer-db-mongo": "git://github.com/lefnire/racer-db-mongo#habitrpg",
|
||||
"derby-ui-boot": "git://github.com/codeparty/derby-ui-boot#master",
|
||||
"derby-ui-boot": "git://github.com/codeparty/derby-ui-boot#f04ba2c7e7b3a8f1462a6e70fe4f81055d74c4b2",
|
||||
"derby-auth": "git://github.com/lefnire/derby-auth#master",
|
||||
"connect-mongo": "*",
|
||||
"passport-facebook": "*",
|
||||
|
|
|
|||
|
|
@ -151,17 +151,21 @@ ready (model) ->
|
|||
require('./filters').app(exports, model)
|
||||
require('./challenges').app(exports, model)
|
||||
|
||||
###
|
||||
Cron
|
||||
###
|
||||
uObj = misc.hydrate(user.get())
|
||||
cron = ->
|
||||
#return setTimeout(cron, 1) if model._txnQueue.length > 0
|
||||
# habitrpg-shared/algos requires uObj.habits, uObj.dailys etc instead of uObj.tasks
|
||||
_.each ['habit','daily','todo','reward'], (type) ->
|
||||
uObj["#{type}s"] = _.where(uObj.tasks, {type:type}); true
|
||||
paths = {}
|
||||
algos.cron(uObj, {paths:paths})
|
||||
lostHp = delete paths['stats.hp'] # we'll set this manually so we can get a cool animation
|
||||
_.each paths, (v,k) -> user.pass({cron:true}).set(k,helpers.dotGet(k, uObj)); true
|
||||
if lostHp
|
||||
browser.resetDom(model)
|
||||
setTimeout (-> user.set('stats.hp', uObj.stats.hp)), 750
|
||||
cron() if algos.shouldCron(uObj)
|
||||
# habitrpg-shared/algos requires uObj.habits, uObj.dailys etc instead of uObj.tasks
|
||||
_.each ['habit','daily','todo','reward'], (type) ->
|
||||
uObj["#{type}s"] = _.where(uObj.tasks, {type:type}); true
|
||||
paths = {}
|
||||
algos.cron(uObj, {paths:paths})
|
||||
if !_.isEmpty(paths)
|
||||
if paths['lastCron'] and _.size(paths) is 1
|
||||
user.set "lastCron", uObj.lastCron
|
||||
else
|
||||
lostHp = delete paths['stats.hp'] # we'll set this manually so we can get a cool animation
|
||||
_.each paths, (v,k) -> user.pass({cron:true}).set(k,helpers.dotGet(k, uObj)); true
|
||||
if lostHp
|
||||
browser.resetDom(model)
|
||||
setTimeout (-> user.set('stats.hp', uObj.stats.hp)), 750
|
||||
|
|
|
|||
Loading…
Reference in a new issue