Make Key to the Kennels free for Triad Bingoers.
* Updated logic in `common/script/index.coffee` to accept Triad Bingo achievement in lieu of gems. * Removed Gem cost on inventory page if user has achievement. * Updated Key to the Kennels modal to hide "Buy Gems" button if user has achievement. * Removed Gem costs from buttons if user has achievement. * Added new copy for Key to the Kennels modal that omits gem prices if the user has the achievement.
This commit is contained in:
@@ -675,7 +675,7 @@ api.wrap = (user, main=true) ->
|
||||
# Generate pet display name variable
|
||||
potionText = if content.hatchingPotions[potion] then content.hatchingPotions[potion].text() else potion
|
||||
eggText = if content.eggs[egg] then content.eggs[egg].text() else egg
|
||||
petDisplayName = i18n.t('petName', {
|
||||
petDisplayName = i18n.t('petName', {
|
||||
potion: potionText
|
||||
egg: eggText
|
||||
})
|
||||
@@ -752,10 +752,11 @@ api.wrap = (user, main=true) ->
|
||||
ga?.event('purchase', key).send()
|
||||
|
||||
releasePets: (req, cb) ->
|
||||
if user.balance < 1
|
||||
if user.balance < 1 and not user.achievements.triadBingo
|
||||
return cb? {code:401,message: i18n.t('notEnoughGems', req.language)}
|
||||
else
|
||||
user.balance--
|
||||
if not user.achievements.triadBingo
|
||||
user.balance -= 1
|
||||
for pet of content.pets
|
||||
user.items.pets[pet] = 0
|
||||
if not user.achievements.beastMasterCount
|
||||
@@ -765,10 +766,11 @@ api.wrap = (user, main=true) ->
|
||||
cb? null, user
|
||||
|
||||
releaseMounts: (req, cb) ->
|
||||
if user.balance < 1
|
||||
if user.balance < 1 and not user.achievements.triadBingo
|
||||
return cb? {code:401,message: i18n.t('notEnoughGems', req.language)}
|
||||
else
|
||||
user.balance -= 1
|
||||
if not user.achievements.triadBingo
|
||||
user.balance -= 1
|
||||
user.items.currentMount = ""
|
||||
for mount of content.pets
|
||||
user.items.mounts[mount] = null
|
||||
@@ -778,11 +780,12 @@ api.wrap = (user, main=true) ->
|
||||
cb? null, user
|
||||
|
||||
releaseBoth: (req, cb) ->
|
||||
if user.balance < 1.5
|
||||
if user.balance < 1.5 and not user.achievements.triadBingo
|
||||
return cb? {code:401,message: i18n.t('notEnoughGems', req.language)}
|
||||
else
|
||||
giveTriadBingo = true
|
||||
user.balance -= 1.5
|
||||
if not user.achievements.triadBingo
|
||||
user.balance -= 1.5
|
||||
user.items.currentMount = ""
|
||||
user.items.currentPet = ""
|
||||
for animal of content.pets
|
||||
|
||||
Reference in New Issue
Block a user