Files
habitica/website/common/script/content/stable.js
T
Kalista Payne 31b2781333 Squashed commit of the following:
commit 866f074a15512e2f897d007ad1a5379ffee456d7
Author: Kalista Payne <kalista@habitica.com>
Date:   Wed Mar 18 15:51:18 2026 -0500

    fix(quests): remove backticks from text

commit d06fc2825e8638d5c127277f92ef94f26f3daba0
Author: Kalista Payne <kalista@habitica.com>
Date:   Wed Mar 18 13:16:32 2026 -0500

    fix(background): add missing data

commit 55156c5f808e3ad9bf16d6465b5b7596fce12631
Author: Kalista Payne <kalista@habitica.com>
Date:   Wed Mar 18 13:00:43 2026 -0500

    fix(lint): max-len

commit db88092acfceac7c465c1e01638ae18bd1572ee3
Author: Kalista Payne <kalista@habitica.com>
Date:   Wed Mar 18 12:56:30 2026 -0500

    fix(customization): show event backgrounds for AF

commit d6fd1ce7fa1b15771786518656a6663e46ba42bc
Author: Phillip Thelen <phillip@habitica.com>
Date:   Tue Mar 17 15:55:53 2026 +0100

    set release date

commit b876d8c78928283a81fadfeb1116e09c73f3e25f
Author: Phillip Thelen <phillip@habitica.com>
Date:   Tue Mar 17 11:40:17 2026 +0100

    Improve swap handling

commit f75a4d01473b492ef28b2324f2defe46cb3845f8
Author: Phillip Thelen <phillip@habitica.com>
Date:   Tue Mar 17 11:22:42 2026 +0100

    use correct name for bear sprites

commit 195db1b1328a73043e1a1c9014e9ce22a3df72f3
Author: Phillip Thelen <phillip@habitica.com>
Date:   Mon Mar 16 23:01:35 2026 +0100

    more fix

commit a42d3f08d749abf2a072805e4c54f67564c1e320
Author: Phillip Thelen <phillip@habitica.com>
Date:   Mon Mar 16 18:43:21 2026 +0100

    fix test

commit 9c06299c343fd29c5dcddfe62e83d410f6c93115
Author: Phillip Thelen <phillip@habitica.com>
Date:   Mon Mar 16 09:13:13 2026 +0100

    AF tweaks

commit 5465e23e679cad1d81404a0911204aaf18c231b7
Author: Kalista Payne <kalista@habitica.com>
Date:   Wed Mar 11 19:43:01 2026 -0500

    fix(sprites): add missing gif redirects

commit 5721ecc6f2b21fd6049a028fddc79fb6dea0434e
Author: Kalista Payne <kalista@habitica.com>
Date:   Tue Mar 10 16:34:26 2026 -0500

    chore(css): run sprites

commit 2184ff2e6937459c404f3067c9d0662c9d908074
Author: Kalista Payne <kalista@habitica.com>
Date:   Tue Mar 10 10:38:34 2026 -0500

    fix(test): date

commit d684a7297c2f86f417677a1f0fa7ae47c8d4d1d6
Author: Kalista Payne <kalista@habitica.com>
Date:   Tue Mar 10 10:32:04 2026 -0500

    fix(test): update for 2026, also more lint

commit 82e7947fd7bc99d1dd33ff08490f2bda0ff74d2b
Author: Kalista Payne <kalista@habitica.com>
Date:   Tue Mar 10 10:22:05 2026 -0500

    fix(event): lint and missing pieces

commit 96818b2d778848fdbff99afdf50b9f305c25b1a9
Author: Kalista Payne <kalista@habitica.com>
Date:   Mon Mar 9 20:11:22 2026 -0500

    feat(event): finished Alien build

commit 4c9763b676f5873d83c4c9c249e7e0ffb5905a2e
Author: Kalista Payne <kalista@habitica.com>
Date:   Fri Mar 6 16:30:36 2026 -0600

    wip(event): April Fools 2026 build

commit 2f16a016e63f523c81a9425d5d7c49e9138c46a5
Author: Phillip Thelen <phillip@habitica.com>
Date:   Wed Feb 4 14:16:50 2026 +0100

    add april fools tests

commit cd1d926c9898f5faf4fe82e4ecccc4d801248f06
Author: Phillip Thelen <phillip@habitica.com>
Date:   Wed Feb 4 14:09:16 2026 +0100

    make april fools cycle through

commit d8a4216c412437448ea15f8fd456765ebd5f53f9
Author: Phillip Thelen <phillip@habitica.com>
Date:   Mon Feb 2 14:41:26 2026 +0100

    fix lint

commit 8265a15923f34ad1afdaab05992c3def5cb4d202
Author: Phillip Thelen <phillip@habitica.com>
Date:   Mon Feb 2 12:34:46 2026 +0100

    name key more generic

commit 9c7bde8ad563bd346b548fdf59fb0454910ae256
Author: Phillip Thelen <phillip@habitica.com>
Date:   Mon Feb 2 12:26:43 2026 +0100

    right date for april fools

commit c2b92c6311d60a609e8b8743fc0efe3cbac853b6
Author: Phillip Thelen <phillip@habitica.com>
Date:   Mon Feb 2 12:26:19 2026 +0100

    rework how april fools works
2026-03-19 15:09:32 -05:00

259 lines
6.9 KiB
JavaScript

import each from 'lodash/each';
import allEggs from './eggs';
import allPotions from './hatching-potions';
import t from './translation';
import memoize from '../fns/datedMemoize';
function constructSet (type, eggs, potions, petInfo, mountInfo, hasMounts = true) {
const pets = {};
const mounts = {};
each(eggs, egg => {
each(potions, potion => {
const key = `${egg.key}-${potion.key}`;
function getAnimalData (text) {
return {
key,
type,
potion: potion.key,
egg: egg.key,
text,
};
}
petInfo[key] = getAnimalData(t('petName', {
potion: potion.text,
egg: egg.text,
}));
pets[key] = true;
if (hasMounts) {
mountInfo[key] = getAnimalData(t('mountName', {
potion: potion.text,
mount: egg.mountText,
}));
mounts[key] = true;
}
});
});
if (hasMounts) {
return [pets, mounts];
}
return pets;
}
const canFindSpecial = {
pets: {
// Veteran Pet Ladder - awarded on major updates
// https://habitica.fandom.com/wiki/Event_Item_Sequences#Veteran_Pets
'Wolf-Veteran': false,
'Tiger-Veteran': false,
'Lion-Veteran': false,
'Bear-Veteran': false,
'Fox-Veteran': false,
'Dragon-Veteran': false,
'Cactus-Veteran': false,
// Thanksgiving pet ladder
'Turkey-Base': false,
'Turkey-Gilded': false,
// Habitoween pet ladder
'JackOLantern-Base': false,
'JackOLantern-Glow': false,
'JackOLantern-Ghost': false,
'JackOLantern-RoyalPurple': 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
// Birthday Pet
'Gryphatrice-Jubilant': false,
},
mounts: {
// Thanksgiving pet ladder
'Turkey-Base': false,
'Turkey-Gilded': false,
// Habitoween pet ladder
'JackOLantern-Base': false,
'JackOLantern-Glow': false,
'JackOLantern-Ghost': false,
'JackOLantern-RoyalPurple': 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
'Dragon-Hydra': true, // Contributor level 7
'LionCub-Ethereal': false, // Backer tier 90
'Jackalope-RoyalPurple': true, // subscription
'Gryphon-Gryphatrice': false, // Pet once granted to kickstarter
},
};
const specialPets = {
'Wolf-Veteran': 'veteranWolf',
'Wolf-Cerberus': 'cerberusPup',
'Dragon-Hydra': 'hydra',
'Turkey-Base': 'turkey',
'BearCub-Polar': 'polarBearPup',
'MantisShrimp-Base': 'mantisShrimp',
'JackOLantern-Base': 'jackolantern',
'Mammoth-Base': 'mammoth',
'Tiger-Veteran': 'veteranTiger',
'Phoenix-Base': 'phoenix',
'Turkey-Gilded': 'gildedTurkey',
'MagicalBee-Base': 'magicalBee',
'Lion-Veteran': 'veteranLion',
'Gryphon-RoyalPurple': 'royalPurpleGryphon',
'JackOLantern-Ghost': 'ghostJackolantern',
'Jackalope-RoyalPurple': 'royalPurpleJackalope',
'Orca-Base': 'orca',
'Bear-Veteran': 'veteranBear',
'Hippogriff-Hopeful': 'hopefulHippogriffPet',
'Fox-Veteran': 'veteranFox',
'JackOLantern-Glow': 'glowJackolantern',
'Gryphon-Gryphatrice': 'gryphatrice',
'Gryphatrice-Jubilant': 'jubilantGryphatrice',
'JackOLantern-RoyalPurple': 'royalPurpleJackolantern',
'Dragon-Veteran': 'veteranDragon',
'Cactus-Veteran': 'veteranCactus',
};
const specialMounts = {
'BearCub-Polar': 'polarBear',
'Dragon-Hydra': 'hydra',
'LionCub-Ethereal': 'etherealLion',
'MantisShrimp-Base': 'mantisShrimp',
'Turkey-Base': 'turkey',
'Mammoth-Base': 'mammoth',
'Orca-Base': 'orca',
'Gryphon-RoyalPurple': 'royalPurpleGryphon',
'Phoenix-Base': 'phoenix',
'JackOLantern-Base': 'jackolantern',
'MagicalBee-Base': 'magicalBee',
'Turkey-Gilded': 'gildedTurkey',
'Jackalope-RoyalPurple': 'royalPurpleJackalope',
'Aether-Invisible': 'invisibleAether',
'JackOLantern-Ghost': 'ghostJackolantern',
'Hippogriff-Hopeful': 'hopefulHippogriffMount',
'Gryphon-Gryphatrice': 'gryphatrice',
'JackOLantern-Glow': 'glowJackolantern',
'JackOLantern-RoyalPurple': 'royalPurpleJackolantern',
};
function buildInfo () {
const petInfo = {};
const mountInfo = {};
const [dropPets, dropMounts] = constructSet('drop', allEggs.drops, allPotions.drops, petInfo, mountInfo);
const [premiumPets, premiumMounts] = constructSet('premium', allEggs.drops, allPotions.premium, petInfo, mountInfo);
const [questPets, questMounts] = constructSet('quest', allEggs.quests, allPotions.drops, petInfo, mountInfo);
const wackyPets = constructSet('wacky', allEggs.drops, allPotions.wacky, petInfo, mountInfo, false);
each(specialPets, (translationString, key) => {
petInfo[key] = {
key,
type: 'special',
text: t(translationString),
canFind: canFindSpecial.pets[key],
};
});
Object.assign(petInfo['Gryphatrice-Jubilant'], {
canBuy () {
return false;
},
currency: 'gems',
event: 'birthday10',
value: 60,
purchaseType: 'pets',
});
each(specialMounts, (translationString, key) => {
mountInfo[key] = {
key,
type: 'special',
text: t(translationString),
canFind: canFindSpecial.mounts[key],
};
});
return {
dropPets,
premiumPets,
questPets,
wackyPets,
dropMounts,
questMounts,
premiumMounts,
specialPets,
specialMounts,
petInfo,
mountInfo,
};
}
const memoizedBuildInfo = memoize(buildInfo);
export default {
get dropPets () {
return memoizedBuildInfo().dropPets;
},
get premiumPets () {
return memoizedBuildInfo().premiumPets;
},
get questPets () {
return memoizedBuildInfo().questPets;
},
get wackyPets () {
return memoizedBuildInfo().wackyPets;
},
get dropMounts () {
return memoizedBuildInfo().dropMounts;
},
get questMounts () {
return memoizedBuildInfo().questMounts;
},
get premiumMounts () {
return memoizedBuildInfo().premiumMounts;
},
get petInfo () {
return memoizedBuildInfo().petInfo;
},
get mountInfo () {
return memoizedBuildInfo().mountInfo;
},
specialPets,
specialMounts,
};