mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
set lower default tokens
This commit is contained in:
parent
96b983b564
commit
7133295dbe
2 changed files with 3 additions and 3 deletions
|
|
@ -50,7 +50,7 @@ module.exports.app = (appExports, model) ->
|
||||||
taskTypes = ['habit', 'daily', 'todo', 'reward']
|
taskTypes = ['habit', 'daily', 'todo', 'reward']
|
||||||
batch.set 'tasks', {}
|
batch.set 'tasks', {}
|
||||||
_.each taskTypes, (type) -> batch.set "#{type}Ids", []
|
_.each taskTypes, (type) -> batch.set "#{type}Ids", []
|
||||||
batch.set 'balance', 2 if user.get('balance') < 2 #only if they haven't manually bought tokens
|
batch.set 'balance', 1 if user.get('balance') < 1 #only if they haven't manually bought tokens
|
||||||
revive(batch)
|
revive(batch)
|
||||||
batch.commit()
|
batch.commit()
|
||||||
browser.resetDom(model)
|
browser.resetDom(model)
|
||||||
|
|
@ -97,7 +97,7 @@ userSchema =
|
||||||
rewardIds: []
|
rewardIds: []
|
||||||
apiToken: null # set in newUserObject below
|
apiToken: null # set in newUserObject below
|
||||||
lastCron: 'new' #this will be replaced with `+new Date` on first run
|
lastCron: 'new' #this will be replaced with `+new Date` on first run
|
||||||
balance: 2
|
balance: 1
|
||||||
tasks: {}
|
tasks: {}
|
||||||
flags:
|
flags:
|
||||||
partyEnabled: false
|
partyEnabled: false
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ module.exports.app = (appExports, model) ->
|
||||||
user.set 'items.pet', pet
|
user.set 'items.pet', pet
|
||||||
else
|
else
|
||||||
tokens = user.get('balance')*4
|
tokens = user.get('balance')*4
|
||||||
if tokens > 3
|
if tokens > pet.value
|
||||||
r = confirm("Buy this pet with #{pet.value} of your #{tokens} tokens?");
|
r = confirm("Buy this pet with #{pet.value} of your #{tokens} tokens?");
|
||||||
if r
|
if r
|
||||||
user.set "items.pets.#{name}", true
|
user.set "items.pets.#{name}", true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue