mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user