feat(content): Time Traveler quest, achievement

This commit is contained in:
Sabe Jones
2021-08-24 15:42:40 -05:00
parent 268f25e42c
commit 48f1bec83a
55 changed files with 232 additions and 3 deletions

View File

@@ -0,0 +1,138 @@
/* eslint-disable no-console */
const MIGRATION_NAME = '20210824_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['Ferret-Base']
&& pets['Ferret-CottonCandyBlue']
&& pets['Ferret-CottonCandyPink']
&& pets['Ferret-Desert']
&& pets['Ferret-Golden']
&& pets['Ferret-Red']
&& pets['Ferret-Shade']
&& pets['Ferret-Skeleton']
&& pets['Ferret-White']
&& pets['Ferret-Zombie']
&& pets['GuineaPig-Base']
&& pets['GuineaPig-CottonCandyBlue']
&& pets['GuineaPig-CottonCandyPink']
&& pets['GuineaPig-Desert']
&& pets['GuineaPig-Golden']
&& pets['GuineaPig-Red']
&& pets['GuineaPig-Shade']
&& pets['GuineaPig-Skeleton']
&& pets['GuineaPig-White']
&& pets['GuineaPig-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['Rat-Base']
&& pets['Rat-CottonCandyBlue']
&& pets['Rat-CottonCandyPink']
&& pets['Rat-Desert']
&& pets['Rat-Golden']
&& pets['Rat-Red']
&& pets['Rat-Shade']
&& pets['Rat-Skeleton']
&& pets['Rat-White']
&& pets['Rat-Zombie']
&& pets['Bunny-Base']
&& pets['Bunny-CottonCandyBlue']
&& pets['Bunny-CottonCandyPink']
&& pets['Bunny-Desert']
&& pets['Bunny-Golden']
&& pets['Bunny-Red']
&& pets['Bunny-Shade']
&& pets['Bunny-Skeleton']
&& pets['Bunny-White']
&& pets['Bunny-Zombie']
&& pets['Horse-Base']
&& pets['Horse-CottonCandyBlue']
&& pets['Horse-CottonCandyPink']
&& pets['Horse-Desert']
&& pets['Horse-Golden']
&& pets['Horse-Red']
&& pets['Horse-Shade']
&& pets['Horse-Skeleton']
&& pets['Horse-White']
&& pets['Horse-Zombie']
&& pets['Cow-Base']
&& pets['Cow-CottonCandyBlue']
&& pets['Cow-CottonCandyPink']
&& pets['Cow-Desert']
&& pets['Cow-Golden']
&& pets['Cow-Red']
&& pets['Cow-Shade']
&& pets['Cow-Skeleton']
&& pets['Cow-White']
&& pets['Cow-Zombie']) {
set['achievements.domesticated'] = 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
}
};

View File

@@ -10,6 +10,12 @@
height: 219px;
}
.quest_solarSystem {
background: url("~@/assets/images/animated/quest_solarSystem.gif") no-repeat;
width: 219px;
height: 219px;
}
.Pet_HatchingPotion_Dessert, .Pet_HatchingPotion_Veggie, .Pet_HatchingPotion_Windup {
width: 68px;
height: 68px;

View File

@@ -419,6 +419,14 @@ const NOTIFICATIONS = {
achievement: 'wildBlueYonder',
},
},
ACHIEVEMENT_DOMESTICATED: {
achievement: true,
label: $t => `${$t('achievement')}: ${$t('achievementDomesticated')}`,
modalId: 'generic-achievement',
data: {
achievement: 'domesticated',
},
},
};
export default {
@@ -482,7 +490,7 @@ export default {
'ACHIEVEMENT_FRESHWATER_FRIENDS', 'ACHIEVEMENT_GOOD_AS_GOLD', 'ACHIEVEMENT_ALL_THAT_GLITTERS',
'ACHIEVEMENT_BONE_COLLECTOR', 'ACHIEVEMENT_SKELETON_CREW', 'ACHIEVEMENT_SEEING_RED',
'ACHIEVEMENT_RED_LETTER_DAY', 'ACHIEVEMENT_LEGENDARY_BESTIARY', 'ACHIEVEMENT_SEASONAL_SPECIALIST',
'ACHIEVEMENT_VIOLETS_ARE_BLUE', 'ACHIEVEMENT_WILD_BLUE_YONDER',
'ACHIEVEMENT_VIOLETS_ARE_BLUE', 'ACHIEVEMENT_WILD_BLUE_YONDER', 'ACHIEVEMENT_DOMESTICATED',
].forEach(type => {
handledNotifications[type] = true;
});
@@ -909,6 +917,7 @@ export default {
case 'ACHIEVEMENT_SEASONAL_SPECIALIST':
case 'ACHIEVEMENT_VIOLETS_ARE_BLUE':
case 'ACHIEVEMENT_WILD_BLUE_YONDER':
case 'ACHIEVEMENT_DOMESTICATED':
case 'GENERIC_ACHIEVEMENT':
this.showNotificationWithModal(notification);
break;

View File

@@ -114,5 +114,8 @@
"achievementVioletsAreBlueModalText": "You collected all the Cotton Candy Blue Pets!",
"achievementWildBlueYonder": "Wild Blue Yonder",
"achievementWildBlueYonderText": "Has tamed all Cotton Candy Blue Mounts.",
"achievementWildBlueYonderModalText": "You tamed all the Cotton Candy Blue Mounts!"
"achievementWildBlueYonderModalText": "You tamed all the Cotton Candy Blue Mounts!",
"achievementDomesticated": "E-I-E-I-O",
"achievementDomesticatedText": "Has hatched all standard colors of domesticated pets: Ferret, Guinea Pig, Rooster, Flying Pig, Rat, Bunny, Horse, and Cow!",
"achievementDomesticatedModalText": "You collected all the domesticated pets!"
}

View File

@@ -306,6 +306,7 @@
"hatchingPotionMossyStone": "Mossy Stone",
"hatchingPotionSunset": "Sunset",
"hatchingPotionMoonglow": "Moonglow",
"hatchingPotionSolarSystem": "Solar System",
"hatchingPotionNotes": "Pour this on an egg, and it will hatch as a <%= potText(locale) %> pet.",
"premiumPotionAddlNotes": "Not usable on quest pet eggs. Available for purchase until <%= date(locale) %>.",

View File

@@ -851,5 +851,12 @@
"questStoneCollectCapricornRunes": "Capricorn Runes",
"questStoneCollectMossyStones": "Mossy Stones",
"questStoneDropMossyStonePotion": "Mossy Stone Hatching Potion",
"questStoneUnlockText": "Unlocks Mossy Stone Hatching Potions for purchase in the Market"
"questStoneUnlockText": "Unlocks Mossy Stone Hatching Potions for purchase in the Market",
"questSolarSystemText": "A Voyage of Cosmic Concentration",
"questSolarSystemNotes": "Your party is traveling through the cosmos, seeing the sights in a fantastical airship designed by talented space engineer @gawrone. Its meditationite propulsion relies on the calm of your Party to stay on course.<br><br>Up ahead in the clouds of sparkling galaxies, you spot an ominously pulsing star. “Keep your focus,” warns @beffymaroo. “If we get too distracted when were passing that nova, the pull between the star and our ship may veer us off course!”<br><br>As you near the star, pulses of strange energy come toward the ship.<br><br>“Theyre Diversionoids, thought creatures trying to get us lost,” says @SabreCat. “If we can let them flow by without carrying us away, we should be able to stay pointed toward our goal!”",
"questSolarSystemCompletion": "Through careful practice, you and the crew manage to keep the Diversionoids from sweeping you overboard, just by noticing and acknowledging them without letting them take over. As you pass safely by the pulsing star, @gawrone notices a cluster of floating bottles and pulls them aboard. Each appears to contain a tiny solar system!<br><br>“Well, looks like our hard work has brought us some fine rewards!” says @beffymaroo. “Lets see what celestial wonders might appear if we hatch pet eggs with these new potions.”",
"questSolarSystemBoss": "Diversionoids",
"questSolarSystemDropSolarSystemPotion": "Solar System Hatching Potion",
"questSolarSystemUnlockText": "Unlocks Solar System Hatching Potions for purchase in the Market"
}

View File

@@ -252,6 +252,11 @@ const basicAchievs = {
titleKey: 'achievementWildBlueYonder',
textKey: 'achievementWildBlueYonderText',
},
domesticated: {
icon: 'achievement-domesticated',
titleKey: 'achievementDomesticated',
textKey: 'achievementDomesticatedText',
},
};
Object.assign(achievementsData, basicAchievs);

View File

@@ -11,6 +11,21 @@ const ANIMAL_SET_ACHIEVEMENTS = {
achievementKey: 'legendaryBestiary',
notificationType: 'ACHIEVEMENT_LEGENDARY_BESTIARY',
},
domesticated: {
type: 'pet',
species: [
'Ferret',
'GuineaPig',
'Rooster',
'FlyingPig',
'Rat',
'Rabbit',
'Horse',
'Cow',
],
achievementKey: 'domesticated',
notificationType: 'ACHIEVEMENT_DOMESTICATED',
},
};
export default ANIMAL_SET_ACHIEVEMENTS;

View File

@@ -489,6 +489,13 @@ const premium = {
return moment().isBetween(EVENTS.potions202108.start, EVENTS.potions202108.end);
},
},
SolarSystem: {
value: 2,
text: t('hatchingPotionSolarSystem'),
limited: true,
canBuy: hasQuestAchievementFunction('solarSystem'),
_addlNotes: t('premiumPotionUnlimitedNotes'),
},
};
const wacky = {

View File

@@ -3804,6 +3804,41 @@ const quests = {
unlock: t('questStoneUnlockText'),
},
},
solarSystem: {
text: t('questSolarSystemText'),
notes: t('questSolarSystemNotes'),
completion: t('questSolarSystemCompletion'),
value: 1,
category: 'timeTravelers',
canBuy () {
return false;
},
boss: {
name: t('questSolarSystemBoss'),
hp: 1500,
str: 2.5,
},
drop: {
items: [
{
type: 'hatchingPotions',
key: 'SolarSystem',
text: t('questSolarSystemDropSolarSystemPotion'),
}, {
type: 'hatchingPotions',
key: 'SolarSystem',
text: t('questSolarSystemDropSolarSystemPotion'),
}, {
type: 'hatchingPotions',
key: 'SolarSystem',
text: t('questSolarSystemDropSolarSystemPotion'),
},
],
gp: 90,
exp: 900,
unlock: t('questSolarSystemUnlockText'),
},
},
};
each(quests, (v, key) => {

View File

@@ -212,6 +212,7 @@ function _getBasicAchievements (user, language) {
_addSimple(result, user, { path: 'seasonalSpecialist', language });
_addSimple(result, user, { path: 'violetsAreBlue', language });
_addSimple(result, user, { path: 'wildBlueYonder', language });
_addSimple(result, user, { path: 'domesticated', language });
_addSimpleWithMasterCount(result, user, { path: 'beastMaster', language });
_addSimpleWithMasterCount(result, user, { path: 'mountMaster', language });

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 803 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 978 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 797 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 B

View File

@@ -144,6 +144,7 @@ export default new Schema({
seasonalSpecialist: Boolean,
violetsAreBlue: Boolean,
wildBlueYonder: Boolean,
domesticated: Boolean,
// Onboarding Guide
createdTask: Boolean,
completedTask: Boolean,

View File

@@ -67,6 +67,7 @@ const NOTIFICATION_TYPES = [
'ACHIEVEMENT_SEASONAL_SPECIALIST',
'ACHIEVEMENT_VIOLETS_ARE_BLUE',
'ACHIEVEMENT_WILD_BLUE_YONDER',
'ACHIEVEMENT_DOMESTICATED',
'ACHIEVEMENT', // generic achievement notification, details inside `notification.data`
'DROP_CAP_REACHED',
];