feat(content): FFFFFF Achievements
82
migrations/archive/2019/20191210_pet_color_achievements.js
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
/* eslint-disable no-console */
|
||||||
|
const MIGRATION_NAME = '20191210_pet_color_achievements';
|
||||||
|
import { model as User } from '../../../website/server/models/user';
|
||||||
|
|
||||||
|
const progressCount = 1000;
|
||||||
|
let count = 0;
|
||||||
|
|
||||||
|
async function updateUser (user) {
|
||||||
|
count++;
|
||||||
|
|
||||||
|
let set = {
|
||||||
|
migration: MIGRATION_NAME,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (user && user.items && user.items.pets) {
|
||||||
|
const pets = user.items.pets;
|
||||||
|
if (pets['Wolf-White'] > 0
|
||||||
|
&& pets['TigerCub-White'] > 0
|
||||||
|
&& pets['PandaCub-White'] > 0
|
||||||
|
&& pets['LionCub-White'] > 0
|
||||||
|
&& pets['Fox-White'] > 0
|
||||||
|
&& pets['FlyingPig-White'] > 0
|
||||||
|
&& pets['Dragon-White'] > 0
|
||||||
|
&& pets['Cactus-White'] > 0
|
||||||
|
&& pets['BearCub-White'] > 0) {
|
||||||
|
set['achievements.primedForPainting'] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user && user.items && user.items.mounts) {
|
||||||
|
const mounts = user.items.mounts;
|
||||||
|
if (mounts['Wolf-White']
|
||||||
|
&& mounts['TigerCub-White']
|
||||||
|
&& mounts['PandaCub-White']
|
||||||
|
&& mounts['LionCub-White']
|
||||||
|
&& mounts['Fox-White']
|
||||||
|
&& mounts['FlyingPig-White']
|
||||||
|
&& mounts['Dragon-White']
|
||||||
|
&& mounts['Cactus-White']
|
||||||
|
&& mounts['BearCub-White'] ) {
|
||||||
|
set['achievements.pearlyPro'] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count % progressCount === 0) console.warn(`${count} ${user._id}`);
|
||||||
|
|
||||||
|
return await User.update({ _id: user._id }, { $set: set }).exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = async function processUsers () {
|
||||||
|
let query = {
|
||||||
|
migration: { $ne: MIGRATION_NAME },
|
||||||
|
'auth.timestamps.loggedin': { $gt: new Date('2019-12-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
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -235,6 +235,16 @@ const NOTIFICATIONS = {
|
|||||||
label: $t => `${$t('achievement')}: ${$t('achievementUndeadUndertaker')}`,
|
label: $t => `${$t('achievement')}: ${$t('achievementUndeadUndertaker')}`,
|
||||||
modalId: 'generic-achievement',
|
modalId: 'generic-achievement',
|
||||||
},
|
},
|
||||||
|
ACHIEVEMENT_PRIMED_FOR_PAINTING: {
|
||||||
|
achievement: true,
|
||||||
|
label: $t => `${$t('achievement')}: ${$t('achievementPrimedForPainting')}`,
|
||||||
|
modalId: 'generic-achievement',
|
||||||
|
},
|
||||||
|
ACHIEVEMENT_PEARLY_PRO: {
|
||||||
|
achievement: true,
|
||||||
|
label: $t => `${$t('achievement')}: ${$t('achievementPearlyPro')}`,
|
||||||
|
modalId: 'generic-achievement',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -291,7 +301,8 @@ export default {
|
|||||||
'CRON', 'SCORED_TASK', 'LOGIN_INCENTIVE', 'ACHIEVEMENT_ALL_YOUR_BASE', 'ACHIEVEMENT_BACK_TO_BASICS',
|
'CRON', 'SCORED_TASK', 'LOGIN_INCENTIVE', 'ACHIEVEMENT_ALL_YOUR_BASE', 'ACHIEVEMENT_BACK_TO_BASICS',
|
||||||
'GENERIC_ACHIEVEMENT', 'ACHIEVEMENT_PARTY_UP', 'ACHIEVEMENT_PARTY_ON', 'ACHIEVEMENT_BEAST_MASTER',
|
'GENERIC_ACHIEVEMENT', 'ACHIEVEMENT_PARTY_UP', 'ACHIEVEMENT_PARTY_ON', 'ACHIEVEMENT_BEAST_MASTER',
|
||||||
'ACHIEVEMENT_MOUNT_MASTER', 'ACHIEVEMENT_TRIAD_BINGO', 'ACHIEVEMENT_DUST_DEVIL', 'ACHIEVEMENT_ARID_AUTHORITY',
|
'ACHIEVEMENT_MOUNT_MASTER', 'ACHIEVEMENT_TRIAD_BINGO', 'ACHIEVEMENT_DUST_DEVIL', 'ACHIEVEMENT_ARID_AUTHORITY',
|
||||||
'ACHIEVEMENT_MONSTER_MAGUS', 'ACHIEVEMENT_UNDEAD_UNDERTAKER', 'GENERIC_ACHIEVEMENT',
|
'ACHIEVEMENT_MONSTER_MAGUS', 'ACHIEVEMENT_UNDEAD_UNDERTAKER', 'ACHIEVEMENT_PRIMED_FOR_PAINTING',
|
||||||
|
'ACHIEVEMENT_PEARLY_PRO', 'GENERIC_ACHIEVEMENT',
|
||||||
].forEach(type => {
|
].forEach(type => {
|
||||||
handledNotifications[type] = true;
|
handledNotifications[type] = true;
|
||||||
});
|
});
|
||||||
@@ -697,6 +708,8 @@ export default {
|
|||||||
case 'ACHIEVEMENT_TRIAD_BINGO':
|
case 'ACHIEVEMENT_TRIAD_BINGO':
|
||||||
case 'ACHIEVEMENT_MONSTER_MAGUS':
|
case 'ACHIEVEMENT_MONSTER_MAGUS':
|
||||||
case 'ACHIEVEMENT_UNDEAD_UNDERTAKER':
|
case 'ACHIEVEMENT_UNDEAD_UNDERTAKER':
|
||||||
|
case 'ACHIEVEMENT_PRIMED_FOR_PAINTING':
|
||||||
|
case 'ACHIEVEMENT_PEARLY_PRO':
|
||||||
case 'GENERIC_ACHIEVEMENT':
|
case 'GENERIC_ACHIEVEMENT':
|
||||||
this.showNotificationWithModal(notification);
|
this.showNotificationWithModal(notification);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -34,5 +34,11 @@
|
|||||||
"achievementMonsterMagusModalText": "You collected all the Zombie Pets!",
|
"achievementMonsterMagusModalText": "You collected all the Zombie Pets!",
|
||||||
"achievementUndeadUndertaker": "Undead Undertaker",
|
"achievementUndeadUndertaker": "Undead Undertaker",
|
||||||
"achievementUndeadUndertakerText": "Has tamed all Zombie Mounts.",
|
"achievementUndeadUndertakerText": "Has tamed all Zombie Mounts.",
|
||||||
"achievementUndeadUndertakerModalText": "You tamed all the Zombie Mounts!"
|
"achievementUndeadUndertakerModalText": "You tamed all the Zombie Mounts!",
|
||||||
|
"achievementPrimedForPainting": "Primed for Painting",
|
||||||
|
"achievementPrimedForPaintingText": "Has collected all White Pets.",
|
||||||
|
"achievementPrimedForPaintingModalText": "You collected all the White Pets!",
|
||||||
|
"achievementPearlyPro": "Pearly Pro",
|
||||||
|
"achievementPearlyProText": "Has tamed all White Mounts.",
|
||||||
|
"achievementPearlyProModalText": "You tamed all the White Mounts!"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,6 +167,16 @@ const basicAchievs = {
|
|||||||
titleKey: 'achievementUndeadUndertaker',
|
titleKey: 'achievementUndeadUndertaker',
|
||||||
textKey: 'achievementUndeadUndertakerText',
|
textKey: 'achievementUndeadUndertakerText',
|
||||||
},
|
},
|
||||||
|
primedForPainting: {
|
||||||
|
icon: 'achievement-primedForPainting',
|
||||||
|
titleKey: 'achievementPrimedForPainting',
|
||||||
|
textKey: 'achievementPrimedForPaintingText',
|
||||||
|
},
|
||||||
|
pearlyPro: {
|
||||||
|
icon: 'achievement-pearlyPro',
|
||||||
|
titleKey: 'achievementPearlyPro',
|
||||||
|
textKey: 'achievementPearlyProText',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
Object.assign(achievementsData, basicAchievs);
|
Object.assign(achievementsData, basicAchievs);
|
||||||
|
|
||||||
|
|||||||
@@ -273,4 +273,7 @@ export const ANIMAL_COLOR_ACHIEVEMENTS = [
|
|||||||
{
|
{
|
||||||
color: 'Zombie', petAchievement: 'monsterMagus', petNotificationType: 'ACHIEVEMENT_MONSTER_MAGUS', mountAchievement: 'undeadUndertaker', mountNotificationType: 'ACHIEVEMENT_UNDEAD_UNDERTAKER',
|
color: 'Zombie', petAchievement: 'monsterMagus', petNotificationType: 'ACHIEVEMENT_MONSTER_MAGUS', mountAchievement: 'undeadUndertaker', mountNotificationType: 'ACHIEVEMENT_UNDEAD_UNDERTAKER',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
color: 'White', petAchievement: 'primedForPainting', petNotificationType: 'ACHIEVEMENT_PRIMED_FOR_PAINTING', mountAchievement: 'pearlyPro', mountNotificationType: 'ACHIEVEMENT_PEARLY_PRO',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -195,6 +195,8 @@ function _getBasicAchievements (user, language) {
|
|||||||
_addSimple(result, user, { path: 'aridAuthority', language });
|
_addSimple(result, user, { path: 'aridAuthority', language });
|
||||||
_addSimple(result, user, { path: 'monsterMagus', language });
|
_addSimple(result, user, { path: 'monsterMagus', language });
|
||||||
_addSimple(result, user, { path: 'undeadUndertaker', language });
|
_addSimple(result, user, { path: 'undeadUndertaker', language });
|
||||||
|
_addSimple(result, user, { path: 'primedForPainting', language });
|
||||||
|
_addSimple(result, user, { path: 'pearlyPro', 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 });
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -4,7 +4,7 @@ const api = {};
|
|||||||
|
|
||||||
// @TODO export this const, cannot export it from here because only routes are exported from
|
// @TODO export this const, cannot export it from here because only routes are exported from
|
||||||
// controllers
|
// controllers
|
||||||
const LAST_ANNOUNCEMENT_TITLE = 'NEW BACKGROUNDS AND ARMOIRE ITEMS!';
|
const LAST_ANNOUNCEMENT_TITLE = 'NEW PET COLLECTION BADGES!';
|
||||||
const worldDmg = { // @TODO
|
const worldDmg = { // @TODO
|
||||||
bailey: false,
|
bailey: false,
|
||||||
};
|
};
|
||||||
@@ -31,23 +31,22 @@ api.getNews = {
|
|||||||
<div class="mr-3 ${baileyClass}"></div>
|
<div class="mr-3 ${baileyClass}"></div>
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
<h1 class="align-self-center">${res.t('newStuff')}</h1>
|
<h1 class="align-self-center">${res.t('newStuff')}</h1>
|
||||||
<h2>12/3/2019 - ${LAST_ANNOUNCEMENT_TITLE}</h2>
|
<h2>12/10/2019 - ${LAST_ANNOUNCEMENT_TITLE}</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr/>
|
<hr/>
|
||||||
<div class="promo_armoire_backgrounds_201912 center-block"></div>
|
<div class="promo_achievement_white center-block"></div>
|
||||||
<p>
|
<p>
|
||||||
We’ve added three new backgrounds to the Background Shop! Now your avatar can shop a
|
We're releasing a new achievement so you can celebrate your successes in the world of
|
||||||
cheerful Holiday Market, enjoy the scent of a Holiday Wreath and bask in the starlight
|
Habitican pet collecting! Earn the Primed for Painting and Pearly Pro achievements by
|
||||||
of a Winter Nocturne. Check them out under User Icon > Backgrounds!
|
collecting White pets and mounts and you'll earn a nifty badge for your profile.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Plus, there’s new Gold-purchasable equipment in the Enchanted Armoire, including the
|
If you already have all the White pets and/or mounts in your stable, you'll receive the
|
||||||
Duffle Coat and Ear-Flap Hat. Better work hard on your real-life tasks to earn all
|
badge automatically! Check your profile and celebrate your new achievement with pride.
|
||||||
the pieces! Enjoy :)
|
|
||||||
</p>
|
</p>
|
||||||
<div class="small mb-3">
|
<div class="small mb-3">
|
||||||
by Katy133, gawrone, Vikte, Maans, GeraldThePixel, QuartzFox, KatieSlug, and SabreCat
|
by Piyowo and SabreCat
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
|
|||||||
@@ -132,6 +132,8 @@ export default new Schema({
|
|||||||
kickstarter2019: Boolean,
|
kickstarter2019: Boolean,
|
||||||
monsterMagus: Boolean,
|
monsterMagus: Boolean,
|
||||||
undeadUndertaker: Boolean,
|
undeadUndertaker: Boolean,
|
||||||
|
primedForPainting: Boolean,
|
||||||
|
pearlyPro: Boolean,
|
||||||
},
|
},
|
||||||
|
|
||||||
backer: {
|
backer: {
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ const NOTIFICATION_TYPES = [
|
|||||||
'ACHIEVEMENT_TRIAD_BINGO',
|
'ACHIEVEMENT_TRIAD_BINGO',
|
||||||
'ACHIEVEMENT_MONSTER_MAGUS',
|
'ACHIEVEMENT_MONSTER_MAGUS',
|
||||||
'ACHIEVEMENT_UNDEAD_UNDERTAKER',
|
'ACHIEVEMENT_UNDEAD_UNDERTAKER',
|
||||||
|
'ACHIEVEMENT_PRIMED_FOR_PAINTING',
|
||||||
|
'ACHIEVEMENT_PEARLY_PRO',
|
||||||
];
|
];
|
||||||
|
|
||||||
const { Schema } = mongoose;
|
const { Schema } = mongoose;
|
||||||
|
|||||||