Adjusted Key to the Kennel logic so only *release both* is free with Triad Bingo achievement

This commit is contained in:
Kevin Gisi
2015-03-26 18:30:50 -04:00
parent 334393d33b
commit ca87a46b04
5 changed files with 18 additions and 27 deletions

View File

@@ -6172,15 +6172,13 @@ api.wrap = function(user, main) {
},
releasePets: function(req, cb) {
var pet;
if (user.balance < 1 && !user.achievements.triadBingo) {
if (user.balance < 1) {
return typeof cb === "function" ? cb({
code: 401,
message: i18n.t('notEnoughGems', req.language)
}) : void 0;
} else {
if (!user.achievements.triadBingo) {
user.balance -= 1;
}
user.balance -= 1;
for (pet in content.pets) {
user.items.pets[pet] = 0;
}
@@ -6194,15 +6192,13 @@ api.wrap = function(user, main) {
},
releaseMounts: function(req, cb) {
var mount;
if (user.balance < 1 && !user.achievements.triadBingo) {
if (user.balance < 1) {
return typeof cb === "function" ? cb({
code: 401,
message: i18n.t('notEnoughGems', req.language)
}) : void 0;
} else {
if (!user.achievements.triadBingo) {
user.balance -= 1;
}
user.balance -= 1;
user.items.currentMount = "";
for (mount in content.pets) {
user.items.mounts[mount] = null;

View File

@@ -56,7 +56,7 @@
"petKeyInfo": "Miss the thrill of collecting pets? Now you can let them go, and have those drops be meaningful again!",
"petKeyInfo2": "Use the Key to the Kennels to reset your non-quest collectible pets and/or mounts to zero. (Quest-only and Rare pets and mounts are not affected.)",
"petKeyInfo3": "There are three Keys to the Kennels: Release Pets Only (4 Gems), Release Mounts Only (4 Gems), or Release Both Pets and Mounts (6 Gems). Using a Key lets you stack the Beast Master and Mount Master achievements. The Triad Bingo achievement will only stack if you use the \"Release Both Pets and Mounts\" key and have collected all 90 pets a second time. Show the world just how much of collection master you are! But choose wisely, because once you use a Key and open the kennel or stable doors, you won't be able to get them back without collecting them all again...",
"petKeyInfo4": "There are three Keys to the Kennels: Release Pets Only, Release Mounts Only, or Release Both Pets and Mounts. Using a Key lets you stack the Beast Master and Mount Master achievements. The Triad Bingo achievement will only stack if you use the \"Release Both Pets and Mounts\" key and have collected all 90 pets a second time. Show the world just how much of collection master you are! But choose wisely, because once you use a Key and open the kennel or stable doors, you won't be able to get them back without collecting them all again...",
"petKeyInfo4": "There are three Keys to the Kennels: Release Pets Only (4 Gems), Release Mounts Only (4 Gems), or Release Both Pets and Mounts. Using a Key lets you stack the Beast Master and Mount Master achievements. The Triad Bingo achievement will only stack if you use the \"Release Both Pets and Mounts\" key and have collected all 90 pets a second time. Show the world just how much of collection master you are! But choose wisely, because once you use a Key and open the kennel or stable doors, you won't be able to get them back without collecting them all again...",
"petKeyPets": "Release My Pets",
"petKeyMounts": "Release My Mounts",
"petKeyBoth": "Release Both",

View File

@@ -752,11 +752,10 @@ api.wrap = (user, main=true) ->
ga?.event('purchase', key).send()
releasePets: (req, cb) ->
if user.balance < 1 and not user.achievements.triadBingo
if user.balance < 1
return cb? {code:401,message: i18n.t('notEnoughGems', req.language)}
else
if not user.achievements.triadBingo
user.balance -= 1
user.balance -= 1
for pet of content.pets
user.items.pets[pet] = 0
if not user.achievements.beastMasterCount
@@ -766,11 +765,10 @@ api.wrap = (user, main=true) ->
cb? null, user
releaseMounts: (req, cb) ->
if user.balance < 1 and not user.achievements.triadBingo
if user.balance < 1
return cb? {code:401,message: i18n.t('notEnoughGems', req.language)}
else
if not user.achievements.triadBingo
user.balance -= 1
user.balance -= 1
user.items.currentMount = ""
for mount of content.pets
user.items.mounts[mount] = null

View File

@@ -238,7 +238,7 @@ script(type='text/ng-template', id='partials/options.inventory.drops.html')
span.Pet_Currency_Gem1x.inline-gems
div(ng-show='petCount >= 90 || mountCount >= 90')
button.customize-option(popover=env.t('petKeyPop'), popover-title=env.t('petKeyName'), popover-trigger='mouseenter', popover-placement='top', popover-append-to-body='true', ng-click='openModal("pet-key", {size:"lg"})', class='pet_key')
p(ng-show='!user.achievements.triadBingo')
p(ng-show='petCount < 90 || mountCount < 90 || !user.achievements.triadBingo')
| 4&nbsp;
span.Pet_Currency_Gem1x.inline-gems
div(ng-if='user.purchased.plan.customerId', ng-class='::{transparent:(Shared.planGemLimits.convCap + User.user.purchased.plan.consecutive.gemCapExtra - User.user.purchased.plan.gemsBought) < 1}')

View File

@@ -21,8 +21,7 @@ script(type='text/ng-template', id='modals/pet-key.html')
- var masterTitle='{{petCount >= 90 && mountCount >= 90 ? env.t("beastMountMasterName") : petCount >= 90 ? env.t("beastMasterName") : env.t("mountMasterName")}}'
h4=env.t('petKeyBegin', {title: masterTitle})
.modal-body
div(ng-if='!user.achievements.triadBingo')
+gemButton
+gemButton
figure
.npc_matt
p=env.t('petKeyInfo')
@@ -33,21 +32,19 @@ script(type='text/ng-template', id='modals/pet-key.html')
p(ng-if='!user.achievements.triadBingo')=env.t('petKeyInfo3')
.modal-footer
button.btn.btn-default(ng-click='$close()')=env.t('petKeyNeverMind')
span(ng-if='user.balance < 1 && !user.achievements.triadBingo')
span(ng-if='user.balance < 1')
a.btn.btn-success(ng-click='openModal("buyGems")')=env.t('buyMoreGems')
span.gem-cost=env.t('notEnoughGems')
span(ng-if='(user.balance >= 1 || user.achievements.triadBingo) && petCount >= 90', ng-controller='SettingsCtrl')
span(ng-if='user.balance >= 1 && petCount >= 90', ng-controller='SettingsCtrl')
a.btn.btn-danger(ng-click='$close(); releasePets()')
=env.t('petKeyPets')
span(ng-if='!user.achievements.triadBingo')
| : 4&nbsp;
span.Pet_Currency_Gem1x.inline-gems
span(ng-if='(user.balance >= 1 || user.achievements.triadBingo) && mountCount >= 90', ng-controller='SettingsCtrl')
| : 4&nbsp;
span.Pet_Currency_Gem1x.inline-gems
span(ng-if='user.balance >= 1 && mountCount >= 90', ng-controller='SettingsCtrl')
a.btn.btn-danger(ng-click='$close(); releaseMounts()')
=env.t('petKeyMounts')
span(ng-if='!user.achievements.triadBingo')
| : 4&nbsp;
span.Pet_Currency_Gem1x.inline-gems
| : 4&nbsp;
span.Pet_Currency_Gem1x.inline-gems
span(ng-if='(user.balance >= 1.5 || user.achievements.triadBingo) && petCount >= 90 && mountCount >= 90', ng-controller='SettingsCtrl')
a.btn.btn-danger(ng-click='$close(); releaseBoth()')
=env.t('petKeyBoth')