From e9c69f93a67c0d0373d58f9baf8338cbb61561bc Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Mon, 29 Mar 2021 17:51:33 -0500 Subject: [PATCH] feat(content): seasonal quest achievement --- website/client/src/components/notifications.vue | 11 ++++++++++- website/common/locales/en/achievements.json | 5 ++++- website/common/script/content/achievements.js | 5 +++++ .../content/constants/questSeriesAchievements.js | 5 +++++ website/common/script/libs/achievements.js | 1 + website/server/models/user/schema.js | 1 + website/server/models/userNotification.js | 1 + 7 files changed, 27 insertions(+), 2 deletions(-) diff --git a/website/client/src/components/notifications.vue b/website/client/src/components/notifications.vue index 30d8447c58..4ccb64cc1e 100644 --- a/website/client/src/components/notifications.vue +++ b/website/client/src/components/notifications.vue @@ -395,6 +395,14 @@ const NOTIFICATIONS = { achievement: 'legendaryBestiary', }, }, + ACHIEVEMENT_SEASONAL_SPECIALIST: { + achievement: true, + label: $t => `${$t('achievement')}: ${$t('achievementSeasonalSpecialist')}`, + modalId: 'generic-achievement', + data: { + achievement: 'seasonalSpecialist', + }, + }, }; export default { @@ -457,7 +465,7 @@ export default { 'ONBOARDING_COMPLETE', 'FIRST_DROPS', 'ACHIEVEMENT_BUG_BONANZA', 'ACHIEVEMENT_BARE_NECESSITIES', '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_RED_LETTER_DAY', 'ACHIEVEMENT_LEGENDARY_BESTIARY', 'ACHIEVEMENT_SEASONAL_SPECIALIST', ].forEach(type => { handledNotifications[type] = true; }); @@ -879,6 +887,7 @@ export default { case 'ACHIEVEMENT_SEEING_RED': case 'ACHIEVEMENT_RED_LETTER_DAY': case 'ACHIEVEMENT_LEGENDARY_BESTIARY': + case 'ACHIEVEMENT_SEASONAL_SPECIALIST': case 'GENERIC_ACHIEVEMENT': this.showNotificationWithModal(notification); break; diff --git a/website/common/locales/en/achievements.json b/website/common/locales/en/achievements.json index bb7e5bfd3e..c134a31411 100644 --- a/website/common/locales/en/achievements.json +++ b/website/common/locales/en/achievements.json @@ -105,5 +105,8 @@ "achievementRedLetterDayModalText": "You tamed all the Red Mounts!", "achievementLegendaryBestiary": "Legendary Bestiary", "achievementLegendaryBestiaryText": "Has hatched all the mythical pets: Dragon, Flying Pig, Gryphon, Sea Serpent, and Unicorn!", - "achievementLegendaryBestiaryModalText": "You collected all the mythical pets!" + "achievementLegendaryBestiaryModalText": "You collected all the mythical pets!", + "achievementSeasonalSpecialist": "Seasonal Specialist", + "achievementSeasonalSpecialistText": "Has completed all the Spring and Winter seasonal quests: Egg Hunt, Trapper Santa, and Find the Cub!", + "achievementSeasonalSpecialistModalText": "You completed all the seasonal quests!" } diff --git a/website/common/script/content/achievements.js b/website/common/script/content/achievements.js index 4b8d1ccd2d..68551150f3 100644 --- a/website/common/script/content/achievements.js +++ b/website/common/script/content/achievements.js @@ -237,6 +237,11 @@ const basicAchievs = { titleKey: 'achievementLegendaryBestiary', textKey: 'achievementLegendaryBestiaryText', }, + seasonalSpecialist: { + icon: 'achievement-seasonalSpecialist', + titleKey: 'achievementSeasonalSpecialist', + textKey: 'achievementSeasonalSpecialistText', + }, }; Object.assign(achievementsData, basicAchievs); diff --git a/website/common/script/content/constants/questSeriesAchievements.js b/website/common/script/content/constants/questSeriesAchievements.js index 337abf43ca..f9ca87a489 100644 --- a/website/common/script/content/constants/questSeriesAchievements.js +++ b/website/common/script/content/constants/questSeriesAchievements.js @@ -48,6 +48,11 @@ const QUEST_SERIES_ACHIEVEMENTS = { 'frog', 'hippo', ], + seasonalSpecialist: [ + 'egg', + 'evilsanta', + 'evilsanta2', + ], }; export default QUEST_SERIES_ACHIEVEMENTS; diff --git a/website/common/script/libs/achievements.js b/website/common/script/libs/achievements.js index be23cfdf08..6fb63a7225 100644 --- a/website/common/script/libs/achievements.js +++ b/website/common/script/libs/achievements.js @@ -209,6 +209,7 @@ function _getBasicAchievements (user, language) { _addSimple(result, user, { path: 'seeingRed', language }); _addSimple(result, user, { path: 'redLetterDay', language }); _addSimple(result, user, { path: 'legendaryBestiary', language }); + _addSimple(result, user, { path: 'seasonalSpecialist', language }); _addSimpleWithMasterCount(result, user, { path: 'beastMaster', language }); _addSimpleWithMasterCount(result, user, { path: 'mountMaster', language }); diff --git a/website/server/models/user/schema.js b/website/server/models/user/schema.js index e3555b6c55..5c64499f1d 100644 --- a/website/server/models/user/schema.js +++ b/website/server/models/user/schema.js @@ -141,6 +141,7 @@ export default new Schema({ seeingRed: Boolean, redLetterDay: Boolean, legendaryBestiary: Boolean, + seasonalSpecialist: Boolean, // Onboarding Guide createdTask: Boolean, completedTask: Boolean, diff --git a/website/server/models/userNotification.js b/website/server/models/userNotification.js index 1d71dd01bd..45b0f1bdba 100644 --- a/website/server/models/userNotification.js +++ b/website/server/models/userNotification.js @@ -64,6 +64,7 @@ const NOTIFICATION_TYPES = [ 'ACHIEVEMENT_SEEING_RED', 'ACHIEVEMENT_RED_LETTER_DAY', 'ACHIEVEMENT_LEGENDARY_BESTIARY', + 'ACHIEVEMENT_SEASONAL_SPECIALIST', 'ACHIEVEMENT', // generic achievement notification, details inside `notification.data` 'DROP_CAP_REACHED', ];