make april fools cycle through

This commit is contained in:
Phillip Thelen
2026-02-04 14:09:16 +01:00
committed by Kalista Payne
parent d8a4216c41
commit cd1d926c98
2 changed files with 18 additions and 3 deletions
@@ -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}`,
@@ -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'),