set lower default tokens

This commit is contained in:
Tyler Renelle 2013-02-13 02:02:31 -05:00
parent 96b983b564
commit 7133295dbe
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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