From 3057637b1e099e7a72d8b1a8996ecd95a36c4cc1 Mon Sep 17 00:00:00 2001 From: Phillip Thelen Date: Wed, 4 Feb 2026 14:09:16 +0100 Subject: [PATCH] make april fools cycle through --- .../script/content/constants/april_fools.js | 17 ++++++++++++++++- .../common/script/content/constants/events.js | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) 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'),