refactor(achievements): crush down to much fewer notification types

most work by @CuriousMagpie
This commit is contained in:
SabreCat
2022-05-12 15:25:40 -05:00
parent d132b057eb
commit 1a74d2b3b0
21 changed files with 434 additions and 839 deletions

View File

@@ -258,7 +258,13 @@ schema.pre('save', true, function preSaveUser (next, done) {
&& this.achievements.beastMaster !== true
) {
this.achievements.beastMaster = true;
this.addNotification('ACHIEVEMENT_BEAST_MASTER');
this.addNotification(
'ACHIEVEMENT_STABLE',
{
achievement: 'beastMaster',
achievementNotification: 'beastAchievement',
},
);
}
// Determines if Mount Master should be awarded
@@ -269,7 +275,13 @@ schema.pre('save', true, function preSaveUser (next, done) {
&& this.achievements.mountMaster !== true
) {
this.achievements.mountMaster = true;
this.addNotification('ACHIEVEMENT_MOUNT_MASTER');
this.addNotification(
'ACHIEVEMENT_STABLE',
{
achievement: 'mountMaster',
achievementNotification: 'mountAchievement',
},
);
}
// Determines if Triad Bingo should be awarded
@@ -281,7 +293,13 @@ schema.pre('save', true, function preSaveUser (next, done) {
&& this.achievements.triadBingo !== true
) {
this.achievements.triadBingo = true;
this.addNotification('ACHIEVEMENT_TRIAD_BINGO');
this.addNotification(
'ACHIEVEMENT_STABLE',
{
achievement: 'triadBingo',
achievementNotification: 'triadBingoAchievement',
},
);
}
// EXAMPLE CODE for allowing all existing and new players to be