From ca87a46b0400a1bc8c6ec0e1bd5d05bb5e2896e5 Mon Sep 17 00:00:00 2001 From: Kevin Gisi Date: Thu, 26 Mar 2015 18:30:50 -0400 Subject: [PATCH] Adjusted Key to the Kennel logic so only *release both* is free with Triad Bingo achievement --- common/dist/scripts/habitrpg-shared.js | 12 ++++-------- common/locales/en/pets.json | 2 +- common/script/index.coffee | 10 ++++------ .../views/options/inventory/inventory.jade | 2 +- website/views/shared/modals/drops.jade | 19 ++++++++----------- 5 files changed, 18 insertions(+), 27 deletions(-) diff --git a/common/dist/scripts/habitrpg-shared.js b/common/dist/scripts/habitrpg-shared.js index ac1e95b47a..f2acb07ac4 100644 --- a/common/dist/scripts/habitrpg-shared.js +++ b/common/dist/scripts/habitrpg-shared.js @@ -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; diff --git a/common/locales/en/pets.json b/common/locales/en/pets.json index 1518b832d8..0b77eccba4 100644 --- a/common/locales/en/pets.json +++ b/common/locales/en/pets.json @@ -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", diff --git a/common/script/index.coffee b/common/script/index.coffee index 00de9ed4d7..9f595e5ccd 100644 --- a/common/script/index.coffee +++ b/common/script/index.coffee @@ -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 diff --git a/website/views/options/inventory/inventory.jade b/website/views/options/inventory/inventory.jade index 004c294da8..10ddaa89b3 100644 --- a/website/views/options/inventory/inventory.jade +++ b/website/views/options/inventory/inventory.jade @@ -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  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}') diff --git a/website/views/shared/modals/drops.jade b/website/views/shared/modals/drops.jade index 354e7995d3..3e26912548 100644 --- a/website/views/shared/modals/drops.jade +++ b/website/views/shared/modals/drops.jade @@ -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  - span.Pet_Currency_Gem1x.inline-gems - span(ng-if='(user.balance >= 1 || user.achievements.triadBingo) && mountCount >= 90', ng-controller='SettingsCtrl') + | : 4  + 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  - span.Pet_Currency_Gem1x.inline-gems + | : 4  + 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')