mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
update balance, display real value of pet
This commit is contained in:
parent
81edf7ede3
commit
967589baf7
1 changed files with 2 additions and 1 deletions
|
|
@ -150,10 +150,11 @@ module.exports.app = (appExports, model) ->
|
|||
else
|
||||
tokens = user.get('balance')*4
|
||||
if tokens > 3
|
||||
r = confirm("Buy this pet with 2 of your #{tokens} tokens?");
|
||||
r = confirm("Buy this pet with #{pet.value} of your #{tokens} tokens?");
|
||||
if r
|
||||
user.set "items.pets.#{name}", true
|
||||
user.set 'items.pet', pet
|
||||
user.set 'balance', (tokens-pet.value)/4
|
||||
else
|
||||
$('#more-tokens-modal').modal('show')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue