mirror of
https://github.com/HabitRPG/habitica.git
synced 2026-04-21 11:28:35 -05:00
make april fools cycle through
This commit is contained in:
committed by
Kalista Payne
parent
d8a4216c41
commit
cd1d926c98
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user