From 6ff82541371dfd2a0dd7ffc83a32bc0faeb7b8f0 Mon Sep 17 00:00:00 2001 From: Frank Maximus Date: Sun, 31 May 2020 22:08:18 +0200 Subject: [PATCH] Only show attainable and owned special pets/mounts (#12206) * Only show attainable and owned special pets/mounts Fixes #9498 * #9498: Handle comments Don't change API, put canFind in petInfo and mountInfo * #9498: Move canFind to itemInfo, to allow sync * #9498: Create a show method, to allow update without reload. --- .../src/components/inventory/stable/index.vue | 13 +++- website/common/script/content/stable.js | 69 +++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/website/client/src/components/inventory/stable/index.vue b/website/client/src/components/inventory/stable/index.vue index 101ad6f853..61b8c6864b 100644 --- a/website/client/src/components/inventory/stable/index.vue +++ b/website/client/src/components/inventory/stable/index.vue @@ -154,6 +154,7 @@
@@ -225,6 +227,7 @@ :popover-position="'top'" :show-popover="true" @click="selectMount(item)" + >

{{ item.name }}

@@ -688,6 +691,11 @@ export default { setShowMore (key) { this.$_openedItemRows_toggleByType(key, !this.$_openedItemRows_isToggled(key)); }, + show (type, item) { + return item.canFind === undefined + || isOwned(type, item, this.userItems) + || item.canFind; + }, getAnimalList (animalGroup, type) { const { key } = animalGroup; @@ -706,11 +714,14 @@ export default { const eggKey = specialKey.split('-')[0]; const potionKey = specialKey.split('-')[1]; + const { canFind, text } = this.content[`${type}Info`][specialKey]; + animals.push({ key: specialKey, eggKey, potionKey, - name: this.content[`${type}Info`][specialKey].text(), + name: text(), + canFind, isOwned () { return isOwned(type, this, userItems); }, diff --git a/website/common/script/content/stable.js b/website/common/script/content/stable.js index 44add8b53d..6c1b3b7ac5 100644 --- a/website/common/script/content/stable.js +++ b/website/common/script/content/stable.js @@ -81,6 +81,73 @@ const [premiumPets, premiumMounts] = constructSet('premium', dropEggs, premiumPo const [questPets, questMounts] = constructSet('quest', questEggs, dropPotions); const wackyPets = constructPetOnlySet('wacky', dropEggs, wackyPotions); +const canFindSpecial = { + pets: { + // Veteran Pet Ladder - verifyUserName + 'Wolf-Veteran': true, + 'Tiger-Veteran': false, + 'Lion-Veteran': false, + 'Bear-Veteran': false, + 'Fox-Veteran': false, + + // Thanksgiving pet ladder + 'Turkey-Base': false, + 'Turkey-Gilded': false, + // Habitoween pet ladder + 'JackOLantern-Base': false, + 'JackOLantern-Glow': false, + 'JackOLantern-Ghost': false, + // Naming Day + 'Gryphon-RoyalPurple': false, + // Summer Splash Orca + 'Orca-Base': false, + + // Quest pets + 'BearCub-Polar': true, // evilsanta + // World Quest Pets - Found in Time Travel Stable + 'MantisShrimp-Base': true, // dilatory + 'Mammoth-Base': true, // stressbeast + 'Phoenix-Base': true, // burnout + 'MagicalBee-Base': true, // bewilder + 'Hippogriff-Hopeful': true, // dysheartener + + // Contributor/Backer pets + 'Dragon-Hydra': true, // Contributor level 6 + 'Jackalope-RoyalPurple': true, // subscription + 'Wolf-Cerberus': false, // Pet once granted to backers + 'Gryphon-Gryphatrice': false, // Pet once granted to kickstarter + }, + mounts: { + // Thanksgiving pet ladder + 'Turkey-Base': false, + 'Turkey-Gilded': false, + + // Habitoween pet ladder + 'JackOLantern-Base': false, + 'JackOLantern-Glow': false, + 'JackOLantern-Ghost': false, + // Naming Day + 'Gryphon-RoyalPurple': false, + // Summer Splash Orca + 'Orca-Base': false, + + // Quest mounts + 'BearCub-Polar': true, // evilsanta + 'Aether-Invisible': true, // lostMasterclasser4 + // World Quest Pets - Found in Time Travel + 'MantisShrimp-Base': true, // dilatory + 'Mammoth-Base': true, // stressbeast + 'Phoenix-Base': true, // burnout + 'MagicalBee-Base': true, + 'Hippogriff-Hopeful': true, + + // Contributor/Backer pets + 'LionCub-Ethereal': true, // Backer tier 90 + 'Jackalope-RoyalPurple': true, // subscription + 'Gryphon-Gryphatrice': false, // Pet once granted to kickstarter + }, +}; + const specialPets = { 'Wolf-Veteran': 'veteranWolf', 'Wolf-Cerberus': 'cerberusPup', @@ -131,6 +198,7 @@ each(specialPets, (translationString, key) => { key, type: 'special', text: t(translationString), + canFind: canFindSpecial.pets[key], }; }); @@ -139,6 +207,7 @@ each(specialMounts, (translationString, key) => { key, type: 'special', text: t(translationString), + canFind: canFindSpecial.mounts[key], }; });