Squashed commit of the following:

commit 27287ac3aa
Author: CuriousMagpie <eilatan@gmail.com>
Date:   Mon May 22 15:59:20 2023 -0400

    fix(typo): typos fixed

commit a4df8097cf
Author: CuriousMagpie <eilatan@gmail.com>
Date:   Mon May 22 15:57:17 2023 -0400

    feat(content): add migration script

commit 23ff7845c1
Merge: d02644e21b 8ba7117fa5
Author: CuriousMagpie <eilatan@gmail.com>
Date:   Mon May 22 15:42:32 2023 -0400

    Merge branch 'develop' into achievement-dinosaur-dynasty

commit 8ba7117fa5
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon May 22 12:35:07 2023 -0400

    build(deps): bump stripe from 12.5.0 to 12.6.0 (#14662)

    Bumps [stripe](https://github.com/stripe/stripe-node) from 12.5.0 to 12.6.0.
    - [Release notes](https://github.com/stripe/stripe-node/releases)
    - [Changelog](https://github.com/stripe/stripe-node/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/stripe/stripe-node/compare/v12.5.0...v12.6.0)

    ---
    updated-dependencies:
    - dependency-name: stripe
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit fe5d4a0551
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon May 22 12:34:28 2023 -0400

    build(deps-dev): bump sinon from 15.0.4 to 15.1.0 (#14661)

    Bumps [sinon](https://github.com/sinonjs/sinon) from 15.0.4 to 15.1.0.
    - [Release notes](https://github.com/sinonjs/sinon/releases)
    - [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
    - [Commits](https://github.com/sinonjs/sinon/compare/v15.0.4...v15.1.0)

    ---
    updated-dependencies:
    - dependency-name: sinon
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit d02644e21b
Author: CuriousMagpie <eilatan@gmail.com>
Date:   Wed May 17 11:36:28 2023 -0400

    feat(content): add dinosaur dynasty achievement
This commit is contained in:
SabreCat
2023-05-22 15:13:49 -05:00
parent bedce203ee
commit a7bde80349
10 changed files with 208 additions and 29 deletions

View File

@@ -0,0 +1,158 @@
/* eslint-disable no-console */
const MIGRATION_NAME = '20230522_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['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['Triceratops-Base']
&& pets['Triceratops-CottonCandyBlue']
&& pets['Triceratops-CottonCandyPink']
&& pets['Triceratops-Desert']
&& pets['Triceratops-Golden']
&& pets['Triceratops-Red']
&& pets['Triceratops-Shade']
&& pets['Triceratops-Skeleton']
&& pets['Triceratops-White']
&& pets['Triceratops-Zombie']
&& pets['TRex-Base']
&& pets['TRex-CottonCandyBlue']
&& pets['TRex-CottonCandyPink']
&& pets['TRex-Desert']
&& pets['TRex-Golden']
&& pets['TRex-Red']
&& pets['TRex-Shade']
&& pets['TRex-Skeleton']
&& pets['TRex-White']
&& pets['TRex-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['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['Velociraptor-Base']
&& pets['Velociraptor-CottonCandyBlue']
&& pets['Velociraptor-CottonCandyPink']
&& pets['Velociraptor-Desert']
&& pets['Velociraptor-Golden']
&& pets['Velociraptor-Red']
&& pets['Velociraptor-Shade']
&& pets['Velociraptor-Skeleton']
&& pets['Velociraptor-White']
&& pets['Velociraptor-Zombie']
&& pets['Penguin-Base']
&& pets['Penguin-CottonCandyBlue']
&& pets['Penguin-CottonCandyPink']
&& pets['Penguin-Desert']
&& pets['Penguin-Golden']
&& pets['Penguin-Red']
&& pets['Penguin-Shade']
&& pets['Penguin-Skeleton']
&& pets['Penguin-White']
&& pets['Penguin-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.dinosaurDynasty'] = 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('2023-04-15') },
};
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
}
};

39
package-lock.json generated
View File

@@ -2281,23 +2281,12 @@
} }
}, },
"@sinonjs/fake-timers": { "@sinonjs/fake-timers": {
"version": "10.0.2", "version": "10.2.0",
"resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz", "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.2.0.tgz",
"integrity": "sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==", "integrity": "sha512-OPwQlEdg40HAj5KNF8WW6q2KG4Z+cBCZb3m4ninfTZKaBmbIJodviQsDBoYMPHkOyJJMHnOJo5j2+LKDOhOACg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@sinonjs/commons": "^2.0.0" "@sinonjs/commons": "^3.0.0"
},
"dependencies": {
"@sinonjs/commons": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz",
"integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==",
"dev": true,
"requires": {
"type-detect": "4.0.8"
}
}
} }
}, },
"@sinonjs/samsam": { "@sinonjs/samsam": {
@@ -13776,13 +13765,13 @@
} }
}, },
"sinon": { "sinon": {
"version": "15.0.4", "version": "15.1.0",
"resolved": "https://registry.npmjs.org/sinon/-/sinon-15.0.4.tgz", "resolved": "https://registry.npmjs.org/sinon/-/sinon-15.1.0.tgz",
"integrity": "sha512-uzmfN6zx3GQaria1kwgWGeKiXSSbShBbue6Dcj0SI8fiCNFbiUDqKl57WFlY5lyhxZVUKmXvzgG2pilRQCBwWg==", "integrity": "sha512-cS5FgpDdE9/zx7no8bxROHymSlPLZzq0ChbbLk1DrxBfc+eTeBK3y8nIL+nu/0QeYydhhbLIr7ecHJpywjQaoQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@sinonjs/commons": "^3.0.0", "@sinonjs/commons": "^3.0.0",
"@sinonjs/fake-timers": "^10.0.2", "@sinonjs/fake-timers": "^10.2.0",
"@sinonjs/samsam": "^8.0.0", "@sinonjs/samsam": "^8.0.0",
"diff": "^5.1.0", "diff": "^5.1.0",
"nise": "^5.1.4", "nise": "^5.1.4",
@@ -14435,18 +14424,18 @@
} }
}, },
"stripe": { "stripe": {
"version": "12.5.0", "version": "12.6.0",
"resolved": "https://registry.npmjs.org/stripe/-/stripe-12.5.0.tgz", "resolved": "https://registry.npmjs.org/stripe/-/stripe-12.6.0.tgz",
"integrity": "sha512-eDBh4bv+Uo+GdhjnQ246lM5KaOReoBzxFltgW0HJqco/QEAgSYxZPOpFbd5+gJnZlRqHSB5B+Zqw273SlbdPag==", "integrity": "sha512-aJat4pGA6fr5DvuojRVXMaOCAw8ceS3UQM4ux1BMUViG686NmOAf1psEh6Wu+NFUifoy6kV7+4APq66OlTWtTw==",
"requires": { "requires": {
"@types/node": ">=8.1.0", "@types/node": ">=8.1.0",
"qs": "^6.11.0" "qs": "^6.11.0"
}, },
"dependencies": { "dependencies": {
"qs": { "qs": {
"version": "6.11.1", "version": "6.11.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.1.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz",
"integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==", "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==",
"requires": { "requires": {
"side-channel": "^1.0.4" "side-channel": "^1.0.4"
} }

View File

@@ -67,7 +67,7 @@
"remove-markdown": "^0.5.0", "remove-markdown": "^0.5.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"short-uuid": "^4.2.2", "short-uuid": "^4.2.2",
"stripe": "^12.5.0", "stripe": "^12.6.0",
"superagent": "^8.0.9", "superagent": "^8.0.9",
"universal-analytics": "^0.5.3", "universal-analytics": "^0.5.3",
"useragent": "^2.1.9", "useragent": "^2.1.9",
@@ -122,7 +122,7 @@
"monk": "^7.3.4", "monk": "^7.3.4",
"require-again": "^2.0.0", "require-again": "^2.0.0",
"run-rs": "^0.7.7", "run-rs": "^0.7.7",
"sinon": "^15.0.4", "sinon": "^15.1.0",
"sinon-chai": "^3.7.0", "sinon-chai": "^3.7.0",
"sinon-stub-promise": "^4.0.0" "sinon-stub-promise": "^4.0.0"
}, },

View File

@@ -138,6 +138,11 @@
width: 48px; width: 48px;
height: 52px; height: 52px;
} }
.achievement-dinosaurDynasty2x {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/achievement-dinosaurDynasty2x.png');
width: 68px;
height: 68px;
}
.achievement-domesticated2x { .achievement-domesticated2x {
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/achievement-domesticated2x.png'); background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/achievement-domesticated2x.png');
width: 60px; width: 60px;

View File

@@ -147,5 +147,8 @@
"achievementPolarProModalText": "You collected all the Polar Pets!", "achievementPolarProModalText": "You collected all the Polar Pets!",
"achievementPlantParent": "Plant Parent", "achievementPlantParent": "Plant Parent",
"achievementPlantParentText": "Has hatched all standard colors of Plant pets: Cactus and Treeling!", "achievementPlantParentText": "Has hatched all standard colors of Plant pets: Cactus and Treeling!",
"achievementPlantParentModalText": "You collected all the Plant Pets!" "achievementPlantParentModalText": "You collected all the Plant Pets!",
"achievementDinosaurDynasty": "Dinosaur Dynasty",
"achievementDinosaurDynastyText": "Has hatched all standard colors of bird and dinosaur pets: Falcon, Owl, Parrot, Peacock, Penguin, Rooster, Pterodactyl, T-Rex, Triceratops, and Velociraptor!",
"achievementDinosaurDynastyModalText": "You collected all the bird and dinosaur pets!"
} }

View File

@@ -178,6 +178,11 @@ const animalSetAchievs = {
titleKey: 'achievementBirdsOfAFeather', titleKey: 'achievementBirdsOfAFeather',
textKey: 'achievementBirdsOfAFeatherText', textKey: 'achievementBirdsOfAFeatherText',
}, },
dinosaurDynasty: {
icon: 'achievement-dinosaurDynasty',
titleKey: 'achievementDinosaurDynasty',
textKey: 'achievementDinosaurDynastyText',
},
domesticated: { domesticated: {
icon: 'achievement-domesticated', icon: 'achievement-domesticated',
titleKey: 'achievementDomesticated', titleKey: 'achievementDomesticated',

View File

@@ -26,6 +26,23 @@ const ANIMAL_SET_ACHIEVEMENTS = {
achievementKey: 'birdsOfAFeather', achievementKey: 'birdsOfAFeather',
notificationType: 'ACHIEVEMENT_ANIMAL_SET', notificationType: 'ACHIEVEMENT_ANIMAL_SET',
}, },
dinosaurDynasty: {
type: 'pet',
species: [
'Falcon',
'Owl',
'Parrot',
'Peacock',
'Penguin',
'Rooster',
'Pterodactyl',
'TRex',
'Triceratops',
'Velociraptor',
],
achievementKey: 'dinosaurDynasty',
notificationType: 'ACHIEVEMENT_ANIMAL_SET',
},
domesticated: { domesticated: {
type: 'pet', type: 'pet',
species: [ species: [

View File

@@ -222,6 +222,7 @@ function _getBasicAchievements (user, language) {
_addSimple(result, user, { path: 'boneToPick', language }); _addSimple(result, user, { path: 'boneToPick', language });
_addSimple(result, user, { path: 'polarPro', language }); _addSimple(result, user, { path: 'polarPro', language });
_addSimple(result, user, { path: 'plantParent', language }); _addSimple(result, user, { path: 'plantParent', language });
_addSimple(result, user, { path: 'dinosaurDynasty', language });
_addSimpleWithMasterCount(result, user, { path: 'beastMaster', language }); _addSimpleWithMasterCount(result, user, { path: 'beastMaster', language });
_addSimpleWithMasterCount(result, user, { path: 'mountMaster', language }); _addSimpleWithMasterCount(result, user, { path: 'mountMaster', language });

View File

@@ -154,6 +154,7 @@ export default new Schema({
boneToPick: Boolean, boneToPick: Boolean,
polarPro: Boolean, polarPro: Boolean,
plantParent: Boolean, plantParent: Boolean,
dinosaurDynasty: Boolean,
// Onboarding Guide // Onboarding Guide
createdTask: Boolean, createdTask: Boolean,
completedTask: Boolean, completedTask: Boolean,