Merge branch 'release' into develop

This commit is contained in:
SabreCat 2022-03-09 16:18:08 -06:00
commit 5320de93a8
15 changed files with 304 additions and 4 deletions

@ -1 +1 @@
Subproject commit 41ed9abde7b691d972c38b0cc1397882fb4382e1
Subproject commit 8d7fa3c3dae2d3718886fff5e8026b8ba8aeb7fb

View file

@ -0,0 +1,138 @@
/* eslint-disable no-console */
const MIGRATION_NAME = '20220309_pet_group_achievements';
import { model as User } from '../../../website/server/models/user';
const progressCount = 1000;
let count = 0;
async function updateUser (user) {
count++;
const set = {
migration: MIGRATION_NAME,
};
if (user && user.items && user.items.pets) {
const pets = user.items.pets;
if (pets['FlyingPig-Base']
&& pets['FlyingPig-CottonCandyBlue']
&& pets['FlyingPig-CottonCandyPink']
&& pets['FlyingPig-Desert']
&& pets['FlyingPig-Golden']
&& pets['FlyingPig-Red']
&& pets['FlyingPig-Shade']
&& pets['FlyingPig-Skeleton']
&& pets['FlyingPig-White']
&& pets['FlyingPig-Zombie']
&& pets['Owl-Base']
&& pets['Owl-CottonCandyBlue']
&& pets['Owl-CottonCandyPink']
&& pets['Owl-Desert']
&& pets['Owl-Golden']
&& pets['Owl-Red']
&& pets['Owl-Shade']
&& pets['Owl-Skeleton']
&& pets['Owl-White']
&& pets['Owl-Zombie']
&& pets['Parrot-Base']
&& pets['Parrot-CottonCandyBlue']
&& pets['Parrot-CottonCandyPink']
&& pets['Parrot-Desert']
&& pets['Parrot-Golden']
&& pets['Parrot-Red']
&& pets['Parrot-Shade']
&& pets['Parrot-Skeleton']
&& pets['Parrot-White']
&& pets['Parrot-Zombie']
&& pets['Rooster-Base']
&& pets['Rooster-CottonCandyBlue']
&& pets['Rooster-CottonCandyPink']
&& pets['Rooster-Desert']
&& pets['Rooster-Golden']
&& pets['Rooster-Red']
&& pets['Rooster-Shade']
&& pets['Rooster-Skeleton']
&& pets['Rooster-White']
&& pets['Rooster-Zombie']
&& pets['Pterodactyl-Base']
&& pets['Pterodactyl-CottonCandyBlue']
&& pets['Pterodactyl-CottonCandyPink']
&& pets['Pterodactyl-Desert']
&& pets['Pterodactyl-Golden']
&& pets['Pterodactyl-Red']
&& pets['Pterodactyl-Shade']
&& pets['Pterodactyl-Skeleton']
&& pets['Pterodactyl-White']
&& pets['Pterodactyl-Zombie']
&& pets['Gryphon-Base']
&& pets['Gryphon-CottonCandyBlue']
&& pets['Gryphon-CottonCandyPink']
&& pets['Gryphon-Desert']
&& pets['Gryphon-Golden']
&& pets['Gryphon-Red']
&& pets['Gryphon-Shade']
&& pets['Gryphon-Skeleton']
&& pets['Gryphon-White']
&& pets['Gryphon-Zombie']
&& pets['Falcon-Base']
&& pets['Falcon-CottonCandyBlue']
&& pets['Falcon-CottonCandyPink']
&& pets['Falcon-Desert']
&& pets['Falcon-Golden']
&& pets['Falcon-Red']
&& pets['Falcon-Shade']
&& pets['Falcon-Skeleton']
&& pets['Falcon-White']
&& pets['Falcon-Zombie']
&& pets['Peacock-Base']
&& pets['Peacock-CottonCandyBlue']
&& pets['Peacock-CottonCandyPink']
&& pets['Peacock-Desert']
&& pets['Peacock-Golden']
&& pets['Peacock-Red']
&& pets['Peacock-Shade']
&& pets['Peacock-Skeleton']
&& pets['Peacock-White']
&& pets['Peacock-Zombie']) {
set['achievements.birdsOfAFeather'] = true;
}
}
if (count % progressCount === 0) console.warn(`${count} ${user._id}`);
return await User.update({ _id: user._id }, { $set: set }).exec();
}
export default async function processUsers () {
let query = {
// migration: { $ne: MIGRATION_NAME },
'auth.timestamps.loggedin': { $gt: new Date('2021-08-01') },
};
const fields = {
_id: 1,
items: 1,
};
while (true) { // eslint-disable-line no-constant-condition
const users = await User // eslint-disable-line no-await-in-loop
.find(query)
.limit(250)
.sort({_id: 1})
.select(fields)
.lean()
.exec();
if (users.length === 0) {
console.warn('All appropriate users found and modified.');
console.warn(`\n${count} users processed\n`);
break;
} else {
query._id = {
$gt: users[users.length - 1]._id,
};
}
await Promise.all(users.map(updateUser)); // eslint-disable-line no-await-in-loop
}
};

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "habitica",
"version": "4.223.0",
"version": "4.224.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -1,7 +1,7 @@
{
"name": "habitica",
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
"version": "4.223.0",
"version": "4.224.0",
"main": "./website/server/index.js",
"dependencies": {
"@babel/core": "^7.17.5",

View file

@ -48,6 +48,11 @@
width: 48px;
height: 52px;
}
.achievement-birdsOfAFeather2x {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/achievement-birdsOfAFeather2x.png');
width: 68px;
height: 68px;
}
.achievement-birthday2x {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/achievement-birthday2x.png');
width: 48px;
@ -493,6 +498,11 @@
width: 141px;
height: 147px;
}
.background_animals_den {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/background_animals_den.png');
width: 141px;
height: 147px;
}
.background_apple_picking {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/background_apple_picking.png');
width: 141px;
@ -628,6 +638,11 @@
width: 141px;
height: 147px;
}
.background_brick_wall_with_ivy {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/background_brick_wall_with_ivy.png');
width: 141px;
height: 147px;
}
.background_bridge {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/background_bridge.png');
width: 141px;
@ -888,6 +903,16 @@
width: 60px;
height: 60px;
}
.background_flowering_prairie {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/background_flowering_prairie.png');
width: 141px;
height: 147px;
}
.customize-option.background_flowering_prairie {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/background_flowering_prairie.png');
width: 60px;
height: 60px;
}
.background_flying_in_a_thunderstorm {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/background_flying_in_a_thunderstorm.png');
width: 141px;
@ -1943,6 +1968,11 @@
width: 68px;
height: 68px;
}
.icon_background_animals_den {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/icon_background_animals_den.png');
width: 68px;
height: 68px;
}
.icon_background_apple_picking {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/icon_background_apple_picking.png');
width: 68px;
@ -2078,6 +2108,11 @@
width: 68px;
height: 68px;
}
.icon_background_brick_wall_with_ivy {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/icon_background_brick_wall_with_ivy.png');
width: 68px;
height: 68px;
}
.icon_background_bridge {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/icon_background_bridge.png');
width: 68px;
@ -2343,6 +2378,16 @@
width: 60px;
height: 60px;
}
.icon_background_flowering_prairie {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/icon_background_flowering_prairie.png');
width: 60px;
height: 60px;
}
.customize-option.icon_background_flowering_prairie {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/icon_background_flowering_prairie.png');
width: 60px;
height: 60px;
}
.icon_background_flying_in_a_thunderstorm {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/icon_background_flying_in_a_thunderstorm.png');
width: 68px;
@ -16688,6 +16733,11 @@
width: 114px;
height: 90px;
}
.broad_armor_armoire_gardenersOveralls {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/broad_armor_armoire_gardenersOveralls.png');
width: 114px;
height: 90px;
}
.broad_armor_armoire_gladiatorArmor {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/broad_armor_armoire_gladiatorArmor.png');
width: 90px;
@ -17123,6 +17173,11 @@
width: 114px;
height: 90px;
}
.head_armoire_gardenersSunHat {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/head_armoire_gardenersSunHat.png');
width: 114px;
height: 90px;
}
.head_armoire_gladiatorHelm {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/head_armoire_gladiatorHelm.png');
width: 90px;
@ -17473,6 +17528,11 @@
width: 114px;
height: 90px;
}
.shield_armoire_gardenersSpade {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shield_armoire_gardenersSpade.png');
width: 114px;
height: 90px;
}
.shield_armoire_gladiatorShield {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shield_armoire_gladiatorShield.png');
width: 90px;
@ -17833,6 +17893,11 @@
width: 68px;
height: 68px;
}
.shop_armor_armoire_gardenersOveralls {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_armor_armoire_gardenersOveralls.png');
width: 68px;
height: 68px;
}
.shop_armor_armoire_gladiatorArmor {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_armor_armoire_gladiatorArmor.png');
width: 68px;
@ -18283,6 +18348,11 @@
width: 68px;
height: 68px;
}
.shop_head_armoire_gardenersSunHat {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_head_armoire_gardenersSunHat.png');
width: 68px;
height: 68px;
}
.shop_head_armoire_gladiatorHelm {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_head_armoire_gladiatorHelm.png');
width: 68px;
@ -18633,6 +18703,11 @@
width: 68px;
height: 68px;
}
.shop_shield_armoire_gardenersSpade {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_shield_armoire_gardenersSpade.png');
width: 68px;
height: 68px;
}
.shop_shield_armoire_gladiatorShield {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_shield_armoire_gladiatorShield.png');
width: 68px;
@ -18983,6 +19058,11 @@
width: 68px;
height: 68px;
}
.shop_weapon_armoire_gardenersWateringCan {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_weapon_armoire_gardenersWateringCan.png');
width: 68px;
height: 68px;
}
.shop_weapon_armoire_glassblowersBlowpipe {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shop_weapon_armoire_glassblowersBlowpipe.png');
width: 68px;
@ -19398,6 +19478,11 @@
width: 114px;
height: 90px;
}
.slim_armor_armoire_gardenersOveralls {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/slim_armor_armoire_gardenersOveralls.png');
width: 114px;
height: 90px;
}
.slim_armor_armoire_gladiatorArmor {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/slim_armor_armoire_gladiatorArmor.png');
width: 90px;
@ -19798,6 +19883,11 @@
width: 90px;
height: 90px;
}
.weapon_armoire_gardenersWateringCan {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/weapon_armoire_gardenersWateringCan.png');
width: 114px;
height: 90px;
}
.weapon_armoire_glassblowersBlowpipe {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/weapon_armoire_glassblowersBlowpipe.png');
width: 114px;

View file

@ -450,6 +450,14 @@ const NOTIFICATIONS = {
achievement: 'zodiacZookeeper',
},
},
ACHIEVEMENT_BIRDS_OF_A_FEATHER: {
achievement: true,
label: $t => `${$t('achievement')}: ${$t('achievementBirdsOfAFeather')}`,
modalId: 'generic-achievement',
data: {
achievement: 'birdsOfAFeather',
},
},
};
export default {
@ -514,6 +522,7 @@ export default {
'ACHIEVEMENT_RED_LETTER_DAY', 'ACHIEVEMENT_LEGENDARY_BESTIARY', 'ACHIEVEMENT_SEASONAL_SPECIALIST',
'ACHIEVEMENT_VIOLETS_ARE_BLUE', 'ACHIEVEMENT_WILD_BLUE_YONDER', 'ACHIEVEMENT_DOMESTICATED',
'ACHIEVEMENT_SHADY_CUSTOMER', 'ACHIEVEMENT_SHADE_OF_IT_ALL', 'ACHIEVEMENT_ZODIAC_ZOOKEEPER',
'ACHIEVEMENT_BIRDS_OF_A_FEATHER',
].forEach(type => {
handledNotifications[type] = true;
});
@ -948,6 +957,7 @@ export default {
case 'ACHIEVEMENT_SHADY_CUSTOMER':
case 'ACHIEVEMENT_SHADE_OF_IT_ALL':
case 'ACHIEVEMENT_ZODIAC_ZOOKEEPER':
case 'ACHIEVEMENT_BIRDS_OF_A_FEATHER':
case 'GENERIC_ACHIEVEMENT':
this.showNotificationWithModal(notification);
break;

View file

@ -126,5 +126,8 @@
"achievementShadeOfItAllModalText": "You tamed all the Shade Mounts!",
"achievementZodiacZookeeper": "Zodiac Zookeeper",
"achievementZodiacZookeeperText": "Has hatched all the zodiac pets: Rat, Cow, Bunny, Snake, Horse, Sheep, Monkey, Rooster, Wolf, Tiger, Flying Pig, and Dragon!",
"achievementZodiacZookeeperModalText": "You collected all the zodiac pets!"
"achievementZodiacZookeeperModalText": "You collected all the zodiac pets!",
"achievementBirdsOfAFeather": "Birds of a Feather",
"achievementBirdsOfAFeatherText": "Has hatched all the flying pets: Flying Pig, Owl, Parrot, Pterodactyl, Gryphon, and Falcon.",
"achievementBirdsOfAFeatherModalText":"You collected all the flying pets!"
}

View file

@ -762,6 +762,14 @@
"backgroundIridescentCloudsText": "Iridescent Clouds",
"backgroundIridescentCloudsNotes": "Float in Iridescent Clouds.",
"backgrounds032022": "SET 94: Released March 2022",
"backgroundAnimalsDenText": "Woodland Critter's Den",
"backgroundAnimalsDenNotes": "Cozy up in a Woodland Critter's Den.",
"backgroundBrickWallWithIvyText": "Brick Wall with Ivy",
"backgroundBrickWallWithIvyNotes": "Admire a Brick Wall with Ivy.",
"backgroundFloweringPrairieText": "Flowering Prairie",
"backgroundFloweringPrairieNotes": "Frolic through a Flowering Prairie.",
"timeTravelBackgrounds": "Steampunk Backgrounds",
"backgroundAirshipText": "Airship",
"backgroundAirshipNotes": "Become a sky sailor on board your very own Airship.",

View file

@ -617,6 +617,8 @@
"weaponArmoireShootingStarSpellNotes": "Surround yourself in a spell of stardust magic to help you make all your wishes come true. Increases Strength and Intelligence by <%= attrs %> each. Enchanted Armoire: Stardust Set (Item 3 of 3).",
"weaponArmoirePinkLongbowText": "Pink Longbow",
"weaponArmoirePinkLongbowNotes": "Be a cupid-in-training, mastering both archery and matters of the heart with this beautiful bow. Increases Perception by <%= per %> and Strength by <%= str %>. Enchanted Armoire: Independent Item.",
"weaponArmoireGardenersWateringCanText": "Watering Can",
"weaponArmoireGardenersWateringCanNotes": "You cant get far without water! Have an infinite supply on hand with this magic, refilling watering can. Increases Intelligence by <%= int %>. Enchanted Armoire: Gardener Set (Item 4 of 4).",
"armor": "armor",
"armorCapitalized": "Armor",
@ -1303,6 +1305,8 @@
"armorArmoireShootingStarCostumeNotes": "Rumored to have been spun out of the night sky itself, this flowy gown lets you rise above all obstacles in your path. Increases Constitution by <%= con %>. Enchanted Armoire: Stardust Set (Item 2 of 3).",
"armorArmoireSoftVioletSuitText": "Soft Violet Suit",
"armorArmoireSoftVioletSuitNotes": "Purple is a luxurious color. Relax in style after youve accomplished all your daily tasks. Increases Constitution and Strength by <%= attrs %> each. Enchanted Armoire: Violet Loungewear Set (Item 2 of 3).",
"armorArmoireGardenersOverallsText": "Gardener's Overalls",
"armorArmoireGardenersOverallsNotes": "Dont be afraid to work down in the dirt when youre wearing these durable overalls. Increases Constitution by <%= con %>. Enchanted Armoire: Gardener Set (Item 1 of 4).",
"headgear": "helm",
"headgearCapitalized": "Headgear",
@ -2010,6 +2014,8 @@
"headArmoireRegalCrownNotes": "Any monarch would be lucky to have such a majestic, smart-looking crown. Increases Intelligence by <%= int %>. Enchanted Armoire: Regal Set (Item 1 of 2).",
"headArmoireShootingStarCrownText": "Star Crown",
"headArmoireShootingStarCrownNotes": "With this brightly shining headpiece, you will literally be the star of your own adventure! Increases Perception by <%= per %>. Enchanted Armoire: Stardust Set (Item 1 of 3).",
"headArmoireGardenersSunHatText": "Gardener's Sun Hat",
"headArmoireGardenersSunHatNotes": "The bright light of the day star wont shine in your eyes when you wear this wide-brimmed hat. Increases Perception by <%= per %>. Enchanted Armoire: Gardener Set (Item 2 of 4).",
"offhand": "off-hand item",
"offHandCapitalized": "Off-Hand Item",
@ -2380,6 +2386,8 @@
"shieldArmoireSoftBlackPillowNotes": "The brave warrior packs a pillow for any expedition. Guard yourself from tiresome tasks... even while you nap. Increases Intelligence and Perception by <%= attrs %> each. Enchanted Armoire: Black Loungewear Set (Item 3 of 3).",
"shieldArmoireSoftVioletPillowText": "Soft Violet Pillow",
"shieldArmoireSoftVioletPillowNotes": "The clever warrior packs a pillow for any expedition. Protect yourself from procrastination-induced panic... even while you nap. Increases Intelligence by <%= int %>. Enchanted Armoire: Violet Loungewear Set (Item 3 of 3).",
"shieldArmoireGardenersSpadeText": "Gardener's Spade",
"shieldArmoireGardenersSpadeNotes": "Whether youre digging in the garden, searching for buried treasure, or creating a secret tunnel, this trusty spade is at your side. Increases Strength by <%= str %>. Enchanted Armoire: Gardener Set (Item 3 of 4).",
"back": "Back Accessory",
"backBase0Text": "No Back Accessory",

View file

@ -272,6 +272,11 @@ const basicAchievs = {
titleKey: 'achievementZodiacZookeeper',
textKey: 'achievementZodiacZookeeperText',
},
birdsOfAFeather: {
icon: 'achievement-birdsOfAFeather',
titleKey: 'achievementBirdsOfAFeather',
textKey: 'achievementBirdsOfAFeatherText',
},
};
Object.assign(achievementsData, basicAchievs);

View file

@ -485,6 +485,11 @@ const backgrounds = {
orange_grove: { },
iridescent_clouds: { },
},
backgrounds032022: {
animals_den: { },
brick_wall_with_ivy: { },
flowering_prairie: { },
},
timeTravelBackgrounds: {
airship: {
price: 1,

View file

@ -11,6 +11,21 @@ const ANIMAL_SET_ACHIEVEMENTS = {
achievementKey: 'legendaryBestiary',
notificationType: 'ACHIEVEMENT_LEGENDARY_BESTIARY',
},
birdsOfAFeather: {
type: 'pet',
species: [
'FlyingPig',
'Owl',
'Parrot',
'Pterodactyl',
'Gryphon',
'Falcon',
'Rooster',
'Peacock',
],
achievementKey: 'birdsOfAFeather',
notificationType: 'ACHIEVEMENT_BIRDS_OF_A_FEATHER',
},
domesticated: {
type: 'pet',
species: [

View file

@ -388,6 +388,10 @@ const armor = {
str: 7,
set: 'violetLoungewear',
},
gardenersOveralls: {
con: 7,
set: 'gardenerSet',
},
};
const body = {
@ -787,6 +791,10 @@ const head = {
per: 10,
set: 'shootingStar',
},
gardenersSunHat: {
per: 7,
set: 'gardenerSet',
},
};
const shield = {
@ -1056,6 +1064,10 @@ const shield = {
int: 10,
set: 'violetLoungewear',
},
gardenersSpade: {
str: 8,
set: 'gardenerSet',
},
};
const headAccessory = {
@ -1436,6 +1448,10 @@ const weapon = {
str: 5,
twoHanded: true,
},
gardenersWateringCan: {
int: 8,
set: 'gardenerSet',
},
};
forEach({

View file

@ -216,6 +216,7 @@ function _getBasicAchievements (user, language) {
_addSimple(result, user, { path: 'shadyCustomer', language });
_addSimple(result, user, { path: 'shadeOfItAll', language });
_addSimple(result, user, { path: 'zodiacZookeeper', language });
_addSimple(result, user, { path: 'birdsOfAFeather', language });
_addSimpleWithMasterCount(result, user, { path: 'beastMaster', language });
_addSimpleWithMasterCount(result, user, { path: 'mountMaster', language });

View file

@ -71,6 +71,7 @@ const NOTIFICATION_TYPES = [
'ACHIEVEMENT_SHADY_CUSTOMER',
'ACHIEVEMENT_SHADE_OF_IT_ALL',
'ACHIEVEMENT_ZODIAC_ZOOKEEPER',
'ACHIEVEMENT_BIRDS_OF_A_FEATHER',
'ACHIEVEMENT', // generic achievement notification, details inside `notification.data`
'DROP_CAP_REACHED',
];