diff --git a/website/common/script/content/constants/april_fools.js b/website/common/script/content/constants/april_fools.js index 69f99343c5..ba8245bffe 100644 --- a/website/common/script/content/constants/april_fools.js +++ b/website/common/script/content/constants/april_fools.js @@ -1,6 +1,21 @@ import eggs from '../eggs'; -export default function makeSubstitutionMap (swappedPotion) { +const SWAPS = [ + 'Veggie', + 'Dessert', + 'VirtualPet', + 'TeaShop', + 'Fungi', + 'Cryptid', +]; + +export function getMatchingSwap () { + const year = new Date().getFullYear(); + const diff = year - 2020; + return SWAPS[diff % SWAPS.length]; +} + +export function makeSubstitutionMap (swappedPotion) { const substitutions = { pets: { 'Pet-Wolf-': `Pet-Wolf-${swappedPotion}`, diff --git a/website/common/script/content/constants/events.js b/website/common/script/content/constants/events.js index ee82ebf97b..447e3f21ec 100644 --- a/website/common/script/content/constants/events.js +++ b/website/common/script/content/constants/events.js @@ -1,6 +1,6 @@ /* eslint-disable key-spacing */ import moment from 'moment'; -import makeSubstitutionMap from './april_fools'; +import { getMatchingSwap, makeSubstitutionMap} from './april_fools'; // gem block: number of gems const gemsPromo = { @@ -54,7 +54,7 @@ export const REPEATING_EVENTS = { aprilFools: { start: new Date('1970-04-01T04:00-04:00'), end: new Date('1970-04-02T03:59-04:00'), - spriteSubstitutions: makeSubstitutionMap('Cryptid'), + spriteSubstitutions: makeSubstitutionMap(getMatchingSwap()), }, aprilFoolsResale: { start: new Date('1970-04-03T04:00-04:00'),