2023 November Content Prebuild (#14954)

* feat(content): October sub items

* feat(content): October bgs and armoire

* feat(content): add Dune Buddy achievement

* feat(releases): timed Backgrounds and Armoire

* feat(content): timed release achievement

* feat(content): November subscriber items

* feat(content): November pet quest bundle

* feat(content): November magic hatching potions

* feat(content): November backgrounds and armoire

* feat(content): new achievement code -- needs work

* update package.lock on local/origin repos

* fix(content): added October headgear info and November set name

* fix(typo): spelling is important

* feat(content): added logic to allow for pets & mounts to be in one achievement and fixed issues with image

* fix(armoire): correct month

* fix(armoire): deprecate armoireEmpty flag

---------

Co-authored-by: SabreCat <sabe@habitica.com>
Co-authored-by: Sabe Jones <sabrecat@gmail.com>
This commit is contained in:
Natalie
2023-11-07 09:55:50 -05:00
committed by GitHub
parent 1892d6288a
commit a80ef78be0
24 changed files with 354 additions and 143 deletions

View File

@@ -86,16 +86,26 @@ export default function hatch (user, req = {}, analytics) {
if (content.dropHatchingPotions[hatchingPotion]) {
forEach(content.animalSetAchievements, achievement => {
if (!user.achievements[achievement.achievementKey]) {
if (achievement.type === 'pet') {
if (achievement.type === 'pet' || achievement.type === 'petMount') {
let achieved = true;
forEach(achievement.species, species => {
if (!achieved) return;
const petIndex = findIndex(
keys(content.dropHatchingPotions),
color => !user.items.pets[`${species}-${color}`],
color => !user.items.pets[`${species}-${color}`] || user.items.pets[`${species}-${color}`] === -1,
);
if (petIndex !== -1) achieved = false;
});
if (achievement.type === 'petMount') {
forEach(achievement.species, species => {
if (!achieved) return;
const mountIndex = findIndex(
keys(content.dropHatchingPotions),
color => !user.items.mounts[`${species}-${color}`],
);
if (mountIndex !== -1) achieved = false;
});
}
if (achieved) {
user.achievements[achievement.achievementKey] = true;
if (user.addNotification) {