Preen old scheduling code

This commit is contained in:
Phillip Thelen
2024-02-21 16:40:28 +01:00
committed by Sabe Jones
parent 6e96085f99
commit 041edb3042
12 changed files with 30 additions and 1083 deletions

View File

@@ -424,7 +424,6 @@ export default {
this.$root.$emit('buyModal::hidden', this.selectedItemToBuy.key); this.$root.$emit('buyModal::hidden', this.selectedItemToBuy.key);
} }
}); });
console.log('setting current event');
this.currentEvent = _find(this.currentEventList, event => Boolean(['winter', 'spring', 'summer', 'fall'].includes(event.season))); this.currentEvent = _find(this.currentEventList, event => Boolean(['winter', 'spring', 'summer', 'fall'].includes(event.season)));
}, },
beforeDestroy () { beforeDestroy () {

View File

@@ -40,14 +40,12 @@ if (process.env.ENABLE_TIME_TRAVEL) {
const sinon = await import('sinon'); const sinon = await import('sinon');
const axios = await import('axios'); const axios = await import('axios');
const response = await axios.get('/api/v4/debug/time-travel-time'); const response = await axios.get('/api/v4/debug/time-travel-time');
console.log(response.data.data.time);
const time = new Date(response.data.data.time); const time = new Date(response.data.data.time);
Vue.config.clock = sinon.useFakeTimers({ Vue.config.clock = sinon.useFakeTimers({
now: time, now: time,
shouldAdvanceTime: true, shouldAdvanceTime: true,
}); });
console.log('Time travel mode activated. It is now', new Date());
})(); })();
} }

View File

@@ -1,4 +1,3 @@
import moment from 'moment';
import axios from 'axios'; import axios from 'axios';
import get from 'lodash/get'; import get from 'lodash/get';
@@ -6,6 +5,7 @@ import unlock from '@/../../common/script/ops/unlock';
import buy from '@/../../common/script/ops/buy/buy'; import buy from '@/../../common/script/ops/buy/buy';
import appearanceSets from '@/../../common/script/content/appearance/sets'; import appearanceSets from '@/../../common/script/content/appearance/sets';
import { getScheduleMatchingGroup } from '@/../../common/script/content/constants/schedule';
import { userStateMixin } from './userState'; import { userStateMixin } from './userState';
@@ -18,13 +18,8 @@ export const avatarEditorUtilies = { // eslint-disable-line import/prefer-defaul
}, },
methods: { methods: {
hideSet (setKey) { hideSet (setKey) {
if (appearanceSets[setKey].availableFrom) { const matcher = getScheduleMatchingGroup('customizations');
return !moment().isBetween( return !matcher.match(setKey);
appearanceSets[setKey].availableFrom,
appearanceSets[setKey].availableUntil,
);
}
return moment(appearanceSets[setKey].availableUntil).isBefore(moment());
}, },
mapKeysToFreeOption (key, type, subType) { mapKeysToFreeOption (key, type, subType) {
const userPreference = subType const userPreference = subType

View File

@@ -8,7 +8,6 @@ export default {
}, },
methods: { methods: {
npcClass (name) { npcClass (name) {
console.log('npcClass', name, this.currentEvent);
if (!this.currentEvent || !this.currentEvent.season) return `npc_${name}`; if (!this.currentEvent || !this.currentEvent.season) return `npc_${name}`;
return `npc_${name} npc_${name}_${this.currentEvent.season}`; return `npc_${name} npc_${name}_${this.currentEvent.season}`;
}, },

View File

@@ -6,7 +6,6 @@ export async function getWorldState (store, options = {}) {
path: 'worldState', path: 'worldState',
url: '/api/v4/world-state', url: '/api/v4/world-state',
deserialize (response) { deserialize (response) {
console.log(response.data.data);
return response.data.data; return response.data.data;
}, },
forceLoad: options.forceLoad, forceLoad: options.forceLoad,

View File

@@ -1,6 +1,5 @@
import t from '../translation'; import t from '../translation';
import prefill from './prefill'; import prefill from './prefill';
import { EVENTS } from '../constants';
export default prefill({ export default prefill({
baseHair1: { setPrice: 5, text: t('hairSet1') }, baseHair1: { setPrice: 5, text: t('hairSet1') },
@@ -8,31 +7,31 @@ export default prefill({
baseHair3: { setPrice: 5, text: t('hairSet3') }, baseHair3: { setPrice: 5, text: t('hairSet3') },
facialHair: { setPrice: 5, text: t('bodyFacialHair') }, facialHair: { setPrice: 5, text: t('bodyFacialHair') },
specialShirts: { setPrice: 5, text: t('specialShirts') }, specialShirts: { setPrice: 5, text: t('specialShirts') },
winterHairColors: { setPrice: 5, availableUntil: '2016-01-01' }, winterHairColors: { setPrice: 5 },
pastelHairColors: { setPrice: 5, availableUntil: '2016-01-01' }, pastelHairColors: { setPrice: 5 },
rainbowHairColors: { setPrice: 5, text: t('rainbowColors') }, rainbowHairColors: { setPrice: 5, text: t('rainbowColors') },
shimmerHairColors: { shimmerHairColors: {
setPrice: 5, availableFrom: '2024-04-16T08:00-05:00', availableUntil: EVENTS.spring2024.end, text: t('shimmerColors'), setPrice: 5, text: t('shimmerColors'),
}, },
hauntedHairColors: { hauntedHairColors: {
setPrice: 5, availableFrom: '2023-10-03T08:00-04:00', availableUntil: EVENTS.fall2023.end, text: t('hauntedColors'), setPrice: 5, text: t('hauntedColors'),
}, },
winteryHairColors: { winteryHairColors: {
setPrice: 5, availableFrom: '2023-01-16T08:00-05:00', availableUntil: EVENTS.winter2024.end, text: t('winteryColors'), setPrice: 5, text: t('winteryColors'),
}, },
rainbowSkins: { setPrice: 5, text: t('rainbowSkins') }, rainbowSkins: { setPrice: 5, text: t('rainbowSkins') },
animalSkins: { setPrice: 5, text: t('animalSkins') }, animalSkins: { setPrice: 5, text: t('animalSkins') },
pastelSkins: { pastelSkins: {
setPrice: 5, availableFrom: '2024-04-16T08:00-05:00', availableUntil: EVENTS.spring2024.end, text: t('pastelSkins'), setPrice: 5, text: t('pastelSkins'),
}, },
spookySkins: { setPrice: 5, availableUntil: '2016-01-01', text: t('spookySkins') }, spookySkins: { setPrice: 5, text: t('spookySkins') },
supernaturalSkins: { supernaturalSkins: {
setPrice: 5, availableFrom: '2023-10-03T08:00-04:00', availableUntil: EVENTS.fall2023.end, text: t('supernaturalSkins'), setPrice: 5, text: t('supernaturalSkins'),
}, },
splashySkins: { splashySkins: {
setPrice: 5, availableFrom: '2023-07-11T08:00-05:00', availableUntil: EVENTS.summer2023.end, text: t('splashySkins'), setPrice: 5, text: t('splashySkins'),
}, },
winterySkins: { winterySkins: {
setPrice: 5, availableFrom: '2023-01-16T08:00-05:00', availableUntil: EVENTS.winter2024.end, text: t('winterySkins'), setPrice: 5, text: t('winterySkins'),
}, },
}); });

View File

@@ -18,10 +18,6 @@ const bundles = {
'harpy', 'harpy',
'owl', 'owl',
], ],
event: EVENTS.bundle202309,
canBuy () {
return moment().isBetween(EVENTS.bundle202309.start, EVENTS.bundle202309.end);
},
type: 'quests', type: 'quests',
class: 'quest_bundle_featheredFriends', class: 'quest_bundle_featheredFriends',
value: 7, value: 7,
@@ -35,10 +31,6 @@ const bundles = {
'turtle', 'turtle',
'whale', 'whale',
], ],
event: EVENTS.bundle202306,
canBuy () {
return moment().isBetween(EVENTS.bundle202306.start, EVENTS.bundle202306.end);
},
type: 'quests', type: 'quests',
class: 'quest_bundle_splashyPals', class: 'quest_bundle_splashyPals',
value: 7, value: 7,
@@ -52,10 +44,6 @@ const bundles = {
'horse', 'horse',
'sheep', 'sheep',
], ],
event: EVENTS.bundle202209,
canBuy () {
return moment().isBetween(EVENTS.bundle202209.start, EVENTS.bundle202209.end);
},
type: 'quests', type: 'quests',
value: 7, value: 7,
}, },
@@ -68,10 +56,6 @@ const bundles = {
'spider', 'spider',
'frog', 'frog',
], ],
event: EVENTS.bundle202210,
canBuy () {
return moment().isBetween(EVENTS.bundle202210.start, EVENTS.bundle202210.end);
},
type: 'quests', type: 'quests',
value: 7, value: 7,
}, },
@@ -85,10 +69,6 @@ const bundles = {
'evilsanta2', 'evilsanta2',
'penguin', 'penguin',
], ],
event: EVENTS.winter2024,
canBuy () {
return moment().isBetween(EVENTS.winter2024.start, EVENTS.winter2024.end);
},
type: 'quests', type: 'quests',
value: 7, value: 7,
}, },
@@ -101,9 +81,6 @@ const bundles = {
'beetle', 'beetle',
'butterfly', 'butterfly',
], ],
canBuy () {
return moment().isBetween(EVENTS.bundle202308.start, EVENTS.bundle202308.end);
},
type: 'quests', type: 'quests',
value: 7, value: 7,
}, },
@@ -116,10 +93,6 @@ const bundles = {
'ferret', 'ferret',
'guineapig', 'guineapig',
], ],
event: EVENTS.bundle202403,
canBuy () {
return moment().isBetween(EVENTS.bundle202403.start, EVENTS.bundle202403.end);
},
type: 'quests', type: 'quests',
value: 7, value: 7,
}, },
@@ -132,10 +105,6 @@ const bundles = {
'kraken', 'kraken',
'octopus', 'octopus',
], ],
event: EVENTS.bundle202206,
canBuy () {
return moment().isBetween(EVENTS.bundle202206.start, EVENTS.bundle202206.end);
},
type: 'quests', type: 'quests',
value: 7, value: 7,
}, },
@@ -148,10 +117,6 @@ const bundles = {
'hedgehog', 'hedgehog',
'treeling', 'treeling',
], ],
event: EVENTS.bundle202208,
canBuy () {
return moment().isBetween(EVENTS.bundle202208.start, EVENTS.bundle202208.end);
},
type: 'quests', type: 'quests',
value: 7, value: 7,
}, },
@@ -164,10 +129,6 @@ const bundles = {
'rock', 'rock',
'yarn', 'yarn',
], ],
event: EVENTS.bundle202311,
canBuy () {
return moment().isBetween(EVENTS.bundle202311.start, EVENTS.bundle202311.end);
},
type: 'quests', type: 'quests',
value: 7, value: 7,
}, },
@@ -180,10 +141,6 @@ const bundles = {
'penguin', 'penguin',
'rooster', 'rooster',
], ],
event: EVENTS.bundle202305,
canBuy () {
return moment().isBetween(EVENTS.bundle202305.start, EVENTS.bundle202305.end);
},
type: 'quests', type: 'quests',
value: 7, value: 7,
}, },
@@ -196,10 +153,6 @@ const bundles = {
'seaserpent', 'seaserpent',
'gryphon', 'gryphon',
], ],
event: EVENTS.bundle202402,
canBuy () {
return moment().isBetween(EVENTS.bundle202402.start, EVENTS.bundle202402.end);
},
type: 'quests', type: 'quests',
value: 7, value: 7,
}, },
@@ -212,10 +165,6 @@ const bundles = {
'snake', 'snake',
'velociraptor', 'velociraptor',
], ],
event: EVENTS.bundle202211,
canBuy () {
return moment().isBetween(EVENTS.bundle202211.start, EVENTS.bundle202211.end);
},
type: 'quests', type: 'quests',
value: 7, value: 7,
}, },
@@ -228,9 +177,6 @@ const bundles = {
'triceratops', 'triceratops',
'trex_undead', 'trex_undead',
], ],
canBuy () {
return moment().isBetween('2022-05-16', '2022-05-31');
},
type: 'quests', type: 'quests',
value: 7, value: 7,
}, },
@@ -243,10 +189,6 @@ const bundles = {
'sloth', 'sloth',
'treeling', 'treeling',
], ],
event: EVENTS.bundle202303,
canBuy () {
return moment().isBetween(EVENTS.bundle202303.start, EVENTS.bundle202303.end);
},
type: 'quests', type: 'quests',
value: 7, value: 7,
}, },
@@ -259,10 +201,6 @@ const bundles = {
'snake', 'snake',
'spider', 'spider',
], ],
event: EVENTS.bundle202310,
canBuy () {
return moment().isBetween(EVENTS.bundle202310.start, EVENTS.bundle202310.end);
},
type: 'quests', type: 'quests',
value: 7, value: 7,
}, },

View File

@@ -790,7 +790,6 @@ export function getScheduleMatchingGroup (type, date) {
cacheDate = null; cacheDate = null;
cachedScheduleMatchers = null; cachedScheduleMatchers = null;
} }
console.log('Loading content for', type, 'on', checkedDate, 'with cached date', cacheDate, 'and cached schedule');
if (!cachedScheduleMatchers) { if (!cachedScheduleMatchers) {
cacheDate = new Date(); cacheDate = new Date();
const scheduleMatchers = {}; const scheduleMatchers = {};

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,7 @@
import assign from 'lodash/assign'; import assign from 'lodash/assign';
import defaults from 'lodash/defaults'; import defaults from 'lodash/defaults';
import each from 'lodash/each'; import each from 'lodash/each';
import moment from 'moment';
import t from './translation'; import t from './translation';
import { EVENTS } from './constants';
function hasQuestAchievementFunction (key) { function hasQuestAchievementFunction (key) {
return user => user.achievements.quests && user.achievements.quests[key] > 0; return user => user.achievements.quests && user.achievements.quests[key] > 0;
@@ -62,106 +60,70 @@ const premium = {
value: 2, value: 2,
text: t('hatchingPotionCupid'), text: t('hatchingPotionCupid'),
limited: true, limited: true,
event: EVENTS.potions202402,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndFebruary'), date: t('dateEndFebruary'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.potions202402.start, EVENTS.potions202402.end);
},
}, },
Shimmer: { Shimmer: {
value: 2, value: 2,
text: t('hatchingPotionShimmer'), text: t('hatchingPotionShimmer'),
limited: true, limited: true,
event: EVENTS.spring2024,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndApril'), date: t('dateEndApril'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.spring2024.start, EVENTS.spring2024.end);
},
}, },
Fairy: { Fairy: {
value: 2, value: 2,
text: t('hatchingPotionFairy'), text: t('hatchingPotionFairy'),
limited: true, limited: true,
event: EVENTS.potions202305,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndMay'), date: t('dateEndMay'),
}), }),
canBuy () {
return moment().isBefore(EVENTS.potions202305.end);
},
}, },
Floral: { Floral: {
value: 2, value: 2,
text: t('hatchingPotionFloral'), text: t('hatchingPotionFloral'),
limited: true, limited: true,
event: EVENTS.potions202305,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndMay'), date: t('dateEndMay'),
}), }),
canBuy () {
return moment().isBefore(EVENTS.potions202305.end);
},
}, },
Aquatic: { Aquatic: {
value: 2, value: 2,
text: t('hatchingPotionAquatic'), text: t('hatchingPotionAquatic'),
limited: true, limited: true,
event: EVENTS.birthday10,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndFebruary'), date: t('dateEndFebruary'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.birthday10.start, EVENTS.birthday10.end);
},
}, },
Ember: { Ember: {
value: 2, value: 2,
text: t('hatchingPotionEmber'), text: t('hatchingPotionEmber'),
limited: true, limited: true,
event: EVENTS.potions202311,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndNovember'), date: t('dateEndNovember'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.potions202311.start, EVENTS.potions202311.end);
},
}, },
Thunderstorm: { Thunderstorm: {
value: 2, value: 2,
text: t('hatchingPotionThunderstorm'), text: t('hatchingPotionThunderstorm'),
limited: true, limited: true,
event: EVENTS.potions202308,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndAugust'), date: t('dateEndAugust'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.potions202308.start, EVENTS.potions202308.end);
},
}, },
Spooky: { Spooky: {
value: 2, value: 2,
text: t('hatchingPotionSpooky'), text: t('hatchingPotionSpooky'),
limited: true, limited: true,
event: EVENTS.fall2023,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndOctober'), date: t('dateEndOctober'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.fall2023.start, EVENTS.fall2023.end);
},
}, },
Ghost: { Ghost: {
value: 2, value: 2,
text: t('hatchingPotionGhost'), text: t('hatchingPotionGhost'),
limited: true, limited: true,
event: EVENTS.fall2022,
canBuy () {
return moment().isBetween(EVENTS.fall2022.start, EVENTS.fall2022.end);
},
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndOctober'), date: t('dateEndOctober'),
}), }),
@@ -173,10 +135,6 @@ const premium = {
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndJanuary'), date: t('dateEndJanuary'),
}), }),
event: EVENTS.winter2023,
canBuy () {
return moment().isBetween(EVENTS.winter2023.start, EVENTS.winter2023.end);
},
}, },
Peppermint: { Peppermint: {
value: 2, value: 2,
@@ -185,19 +143,11 @@ const premium = {
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndJanuary'), date: t('dateEndJanuary'),
}), }),
event: EVENTS.winter2024,
canBuy () {
return moment().isBetween(EVENTS.winter2024.start, EVENTS.winter2024.end);
},
}, },
StarryNight: { StarryNight: {
value: 2, value: 2,
text: t('hatchingPotionStarryNight'), text: t('hatchingPotionStarryNight'),
limited: true, limited: true,
event: EVENTS.winter2023,
canBuy () {
return moment().isBetween(EVENTS.winter2023.start, EVENTS.winter2023.end);
},
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndJanuary'), date: t('dateEndJanuary'),
}), }),
@@ -209,10 +159,6 @@ const premium = {
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndApril'), date: t('dateEndApril'),
}), }),
event: EVENTS.spring2024,
canBuy () {
return moment().isBetween(EVENTS.spring2024.start, EVENTS.spring2024.end);
},
}, },
Glass: { Glass: {
value: 2, value: 2,
@@ -221,82 +167,54 @@ const premium = {
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndJuly'), date: t('dateEndJuly'),
}), }),
event: EVENTS.summer2023,
canBuy () {
return moment().isBetween(EVENTS.summer2023.start, EVENTS.summer2023.end);
},
}, },
Glow: { Glow: {
value: 2, value: 2,
text: t('hatchingPotionGlow'), text: t('hatchingPotionGlow'),
limited: true, limited: true,
event: EVENTS.fall2023,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndOctober'), date: t('dateEndOctober'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.fall2023.start, EVENTS.fall2023.end);
},
}, },
Frost: { Frost: {
value: 2, value: 2,
text: t('hatchingPotionFrost'), text: t('hatchingPotionFrost'),
limited: true, limited: true,
event: EVENTS.potions202311,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndNovember'), date: t('dateEndNovember'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.potions202311.start, EVENTS.potions202311.end);
},
}, },
IcySnow: { IcySnow: {
value: 2, value: 2,
text: t('hatchingPotionIcySnow'), text: t('hatchingPotionIcySnow'),
limited: true, limited: true,
event: EVENTS.winter2024,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndJanuary'), date: t('dateEndJanuary'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.winter2024.start, EVENTS.winter2024.end);
},
}, },
RoseQuartz: { RoseQuartz: {
value: 2, value: 2,
text: t('hatchingPotionRoseQuartz'), text: t('hatchingPotionRoseQuartz'),
limited: true, limited: true,
event: EVENTS.potions202302,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndFebruary'), date: t('dateEndFebruary'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.potions202302.start, EVENTS.potions202302.end);
},
}, },
Celestial: { Celestial: {
value: 2, value: 2,
text: t('hatchingPotionCelestial'), text: t('hatchingPotionCelestial'),
limited: true, limited: true,
event: EVENTS.spring2024,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndApril'), date: t('dateEndApril'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.spring2024.start, EVENTS.spring2024.end);
},
}, },
Sunshine: { Sunshine: {
value: 2, value: 2,
text: t('hatchingPotionSunshine'), text: t('hatchingPotionSunshine'),
limited: true, limited: true,
event: EVENTS.potions202205,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndMay'), date: t('dateEndMay'),
}), }),
canBuy () {
return moment().isBefore(EVENTS.potions202205.end);
},
}, },
Bronze: { Bronze: {
value: 2, value: 2,
@@ -309,13 +227,9 @@ const premium = {
value: 2, value: 2,
text: t('hatchingPotionWatery'), text: t('hatchingPotionWatery'),
limited: true, limited: true,
event: EVENTS.summer2022,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndJuly'), date: t('dateEndJuly'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.summer2022.start, EVENTS.summer2022.end);
},
}, },
Silver: { Silver: {
value: 2, value: 2,
@@ -328,10 +242,6 @@ const premium = {
value: 2, value: 2,
text: t('hatchingPotionShadow'), text: t('hatchingPotionShadow'),
limited: true, limited: true,
event: EVENTS.fall2022,
canBuy () {
return moment().isBetween(EVENTS.fall2022.start, EVENTS.fall2022.end);
},
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndOctober'), date: t('dateEndOctober'),
}), }),
@@ -350,10 +260,6 @@ const premium = {
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndJanuary'), date: t('dateEndJanuary'),
}), }),
event: EVENTS.winter2023,
canBuy () {
return moment().isBetween(EVENTS.winter2023.start, EVENTS.winter2023.end);
},
}, },
Ruby: { Ruby: {
value: 2, value: 2,
@@ -366,13 +272,9 @@ const premium = {
value: 2, value: 2,
text: t('hatchingPotionBirchBark'), text: t('hatchingPotionBirchBark'),
limited: true, limited: true,
event: EVENTS.spring2023,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndApril'), date: t('dateEndApril'),
}), }),
canBuy () {
return moment().isBefore(EVENTS.spring2023.end);
},
}, },
Fluorite: { Fluorite: {
value: 2, value: 2,
@@ -385,13 +287,9 @@ const premium = {
value: 2, value: 2,
text: t('hatchingPotionSandSculpture'), text: t('hatchingPotionSandSculpture'),
limited: true, limited: true,
event: EVENTS.summer2023,
date: t('eventAvailability', { date: t('eventAvailability', {
date: t('dateEndJuly'), date: t('dateEndJuly'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.summer2023.start, EVENTS.summer2023.end);
},
}, },
Windup: { Windup: {
value: 2, value: 2,
@@ -411,25 +309,17 @@ const premium = {
value: 2, value: 2,
text: t('hatchingPotionVampire'), text: t('hatchingPotionVampire'),
limited: true, limited: true,
event: EVENTS.fall2023,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndOctober'), date: t('dateEndOctober'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.fall2023.start, EVENTS.fall2023.end);
},
}, },
AutumnLeaf: { AutumnLeaf: {
value: 2, value: 2,
text: t('hatchingPotionAutumnLeaf'), text: t('hatchingPotionAutumnLeaf'),
limited: true, limited: true,
event: EVENTS.potions202311,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndNovember'), date: t('dateEndNovember'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.potions202311.start, EVENTS.potions202311.end);
},
}, },
BlackPearl: { BlackPearl: {
value: 2, value: 2,
@@ -445,22 +335,14 @@ const premium = {
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndJanuary'), date: t('dateEndJanuary'),
}), }),
event: EVENTS.winter2024,
canBuy () {
return moment().isBetween(EVENTS.winter2024.start, EVENTS.winter2024.end);
},
}, },
PolkaDot: { PolkaDot: {
value: 2, value: 2,
text: t('hatchingPotionPolkaDot'), text: t('hatchingPotionPolkaDot'),
limited: true, limited: true,
event: EVENTS.spring2023,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndApril'), date: t('dateEndApril'),
}), }),
canBuy () {
return moment().isBefore(EVENTS.spring2023.end);
},
}, },
MossyStone: { MossyStone: {
value: 2, value: 2,
@@ -473,25 +355,17 @@ const premium = {
value: 2, value: 2,
text: t('hatchingPotionSunset'), text: t('hatchingPotionSunset'),
limited: true, limited: true,
event: EVENTS.summer2023,
_addlNotes: t('premiumPotionAddlNotes', { _addlNotes: t('premiumPotionAddlNotes', {
date: t('dateEndJuly'), date: t('dateEndJuly'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.summer2023.start, EVENTS.summer2023.end);
},
}, },
Moonglow: { Moonglow: {
value: 2, value: 2,
text: t('hatchingPotionMoonglow'), text: t('hatchingPotionMoonglow'),
limited: true, limited: true,
event: EVENTS.potions202208,
_addlNotes: t('premiumPotionAddlNotes', { _addlNotes: t('premiumPotionAddlNotes', {
date: t('dateEndAugust'), date: t('dateEndAugust'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.potions202208.start, EVENTS.potions202208.end);
},
}, },
SolarSystem: { SolarSystem: {
value: 2, value: 2,
@@ -511,13 +385,9 @@ const premium = {
value: 2, value: 2,
text: t('hatchingPotionPorcelain'), text: t('hatchingPotionPorcelain'),
limited: true, limited: true,
event: EVENTS.potions202308,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndAugust'), date: t('dateEndAugust'),
}), }),
canBuy () {
return moment().isBetween(EVENTS.potions202308.start, EVENTS.potions202308.end);
},
}, },
PinkMarble: { PinkMarble: {
value: 2, value: 2,
@@ -544,13 +414,9 @@ const wacky = {
Veggie: { Veggie: {
text: t('hatchingPotionVeggie'), text: t('hatchingPotionVeggie'),
limited: true, limited: true,
event: EVENTS.spring2023,
_addlNotes: t('eventAvailability', { _addlNotes: t('eventAvailability', {
date: t('dateEndApril'), date: t('dateEndApril'),
}), }),
canBuy () {
return moment().isBetween('2023-04-06T08:00-04:00', EVENTS.spring2023.end);
},
}, },
Dessert: { Dessert: {
text: t('hatchingPotionDessert'), text: t('hatchingPotionDessert'),
@@ -567,13 +433,9 @@ const wacky = {
TeaShop: { TeaShop: {
text: t('hatchingPotionTeaShop'), text: t('hatchingPotionTeaShop'),
limited: true, limited: true,
event: EVENTS.spring2023,
_addlNotes: t('premiumPotionAddlNotes', { _addlNotes: t('premiumPotionAddlNotes', {
date: t('dateEndApril'), date: t('dateEndApril'),
}), }),
canBuy () {
return moment().isBetween('2023-04-06T08:00-04:00', EVENTS.spring2023.end);
},
}, },
}; };

View File

@@ -211,105 +211,62 @@ api.food = {
textA: t('foodMeatA'), textA: t('foodMeatA'),
textThe: t('foodMeatThe'), textThe: t('foodMeatThe'),
target: 'Base', target: 'Base',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
}, },
Milk: { Milk: {
text: t('foodMilk'), text: t('foodMilk'),
textA: t('foodMilkA'), textA: t('foodMilkA'),
textThe: t('foodMilkThe'), textThe: t('foodMilkThe'),
target: 'White', target: 'White',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
}, },
Potatoe: { Potatoe: {
text: t('foodPotatoe'), text: t('foodPotatoe'),
textA: t('foodPotatoeA'), textA: t('foodPotatoeA'),
textThe: t('foodPotatoeThe'), textThe: t('foodPotatoeThe'),
target: 'Desert', target: 'Desert',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
}, },
Strawberry: { Strawberry: {
text: t('foodStrawberry'), text: t('foodStrawberry'),
textA: t('foodStrawberryA'), textA: t('foodStrawberryA'),
textThe: t('foodStrawberryThe'), textThe: t('foodStrawberryThe'),
target: 'Red', target: 'Red',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
}, },
Chocolate: { Chocolate: {
text: t('foodChocolate'), text: t('foodChocolate'),
textA: t('foodChocolateA'), textA: t('foodChocolateA'),
textThe: t('foodChocolateThe'), textThe: t('foodChocolateThe'),
target: 'Shade', target: 'Shade',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
}, },
Fish: { Fish: {
text: t('foodFish'), text: t('foodFish'),
textA: t('foodFishA'), textA: t('foodFishA'),
textThe: t('foodFishThe'), textThe: t('foodFishThe'),
target: 'Skeleton', target: 'Skeleton',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
}, },
RottenMeat: { RottenMeat: {
text: t('foodRottenMeat'), text: t('foodRottenMeat'),
textA: t('foodRottenMeatA'), textA: t('foodRottenMeatA'),
textThe: t('foodRottenMeatThe'), textThe: t('foodRottenMeatThe'),
target: 'Zombie', target: 'Zombie',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
}, },
CottonCandyPink: { CottonCandyPink: {
text: t('foodCottonCandyPink'), text: t('foodCottonCandyPink'),
textA: t('foodCottonCandyPinkA'), textA: t('foodCottonCandyPinkA'),
textThe: t('foodCottonCandyPinkThe'), textThe: t('foodCottonCandyPinkThe'),
target: 'CottonCandyPink', target: 'CottonCandyPink',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
}, },
CottonCandyBlue: { CottonCandyBlue: {
text: t('foodCottonCandyBlue'), text: t('foodCottonCandyBlue'),
textA: t('foodCottonCandyBlueA'), textA: t('foodCottonCandyBlueA'),
textThe: t('foodCottonCandyBlueThe'), textThe: t('foodCottonCandyBlueThe'),
target: 'CottonCandyBlue', target: 'CottonCandyBlue',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
}, },
Honey: { Honey: {
text: t('foodHoney'), text: t('foodHoney'),
textA: t('foodHoneyA'), textA: t('foodHoneyA'),
textThe: t('foodHoneyThe'), textThe: t('foodHoneyThe'),
target: 'Golden', target: 'Golden',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
}, },
Saddle: { Saddle: {
canBuy () {
return true;
},
sellWarningNote: t('foodSaddleSellWarningNote'), sellWarningNote: t('foodSaddleSellWarningNote'),
text: t('foodSaddleText'), text: t('foodSaddleText'),
value: 5, value: 5,
@@ -321,313 +278,201 @@ api.food = {
textA: t('foodCakeSkeletonA'), textA: t('foodCakeSkeletonA'),
textThe: t('foodCakeSkeletonThe'), textThe: t('foodCakeSkeletonThe'),
target: 'Skeleton', target: 'Skeleton',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
}, },
Cake_Base: { Cake_Base: {
text: t('foodCakeBase'), text: t('foodCakeBase'),
textA: t('foodCakeBaseA'), textA: t('foodCakeBaseA'),
textThe: t('foodCakeBaseThe'), textThe: t('foodCakeBaseThe'),
target: 'Base', target: 'Base',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
}, },
Cake_CottonCandyBlue: { Cake_CottonCandyBlue: {
text: t('foodCakeCottonCandyBlue'), text: t('foodCakeCottonCandyBlue'),
textA: t('foodCakeCottonCandyBlueA'), textA: t('foodCakeCottonCandyBlueA'),
textThe: t('foodCakeCottonCandyBlueThe'), textThe: t('foodCakeCottonCandyBlueThe'),
target: 'CottonCandyBlue', target: 'CottonCandyBlue',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
}, },
Cake_CottonCandyPink: { Cake_CottonCandyPink: {
text: t('foodCakeCottonCandyPink'), text: t('foodCakeCottonCandyPink'),
textA: t('foodCakeCottonCandyPinkA'), textA: t('foodCakeCottonCandyPinkA'),
textThe: t('foodCakeCottonCandyPinkThe'), textThe: t('foodCakeCottonCandyPinkThe'),
target: 'CottonCandyPink', target: 'CottonCandyPink',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
}, },
Cake_Shade: { Cake_Shade: {
text: t('foodCakeShade'), text: t('foodCakeShade'),
textA: t('foodCakeShadeA'), textA: t('foodCakeShadeA'),
textThe: t('foodCakeShadeThe'), textThe: t('foodCakeShadeThe'),
target: 'Shade', target: 'Shade',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
}, },
Cake_White: { Cake_White: {
text: t('foodCakeWhite'), text: t('foodCakeWhite'),
textA: t('foodCakeWhiteA'), textA: t('foodCakeWhiteA'),
textThe: t('foodCakeWhiteThe'), textThe: t('foodCakeWhiteThe'),
target: 'White', target: 'White',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
}, },
Cake_Golden: { Cake_Golden: {
text: t('foodCakeGolden'), text: t('foodCakeGolden'),
textA: t('foodCakeGoldenA'), textA: t('foodCakeGoldenA'),
textThe: t('foodCakeGoldenThe'), textThe: t('foodCakeGoldenThe'),
target: 'Golden', target: 'Golden',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
}, },
Cake_Zombie: { Cake_Zombie: {
text: t('foodCakeZombie'), text: t('foodCakeZombie'),
textA: t('foodCakeZombieA'), textA: t('foodCakeZombieA'),
textThe: t('foodCakeZombieThe'), textThe: t('foodCakeZombieThe'),
target: 'Zombie', target: 'Zombie',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
}, },
Cake_Desert: { Cake_Desert: {
text: t('foodCakeDesert'), text: t('foodCakeDesert'),
textA: t('foodCakeDesertA'), textA: t('foodCakeDesertA'),
textThe: t('foodCakeDesertThe'), textThe: t('foodCakeDesertThe'),
target: 'Desert', target: 'Desert',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
}, },
Cake_Red: { Cake_Red: {
text: t('foodCakeRed'), text: t('foodCakeRed'),
textA: t('foodCakeRedA'), textA: t('foodCakeRedA'),
textThe: t('foodCakeRedThe'), textThe: t('foodCakeRedThe'),
target: 'Red', target: 'Red',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
}, },
Candy_Skeleton: { Candy_Skeleton: {
text: t('foodCandySkeleton'), text: t('foodCandySkeleton'),
textA: t('foodCandySkeletonA'), textA: t('foodCandySkeletonA'),
textThe: t('foodCandySkeletonThe'), textThe: t('foodCandySkeletonThe'),
target: 'Skeleton', target: 'Skeleton',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
}, },
Candy_Base: { Candy_Base: {
text: t('foodCandyBase'), text: t('foodCandyBase'),
textA: t('foodCandyBaseA'), textA: t('foodCandyBaseA'),
textThe: t('foodCandyBaseThe'), textThe: t('foodCandyBaseThe'),
target: 'Base', target: 'Base',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
}, },
Candy_CottonCandyBlue: { Candy_CottonCandyBlue: {
text: t('foodCandyCottonCandyBlue'), text: t('foodCandyCottonCandyBlue'),
textA: t('foodCandyCottonCandyBlueA'), textA: t('foodCandyCottonCandyBlueA'),
textThe: t('foodCandyCottonCandyBlueThe'), textThe: t('foodCandyCottonCandyBlueThe'),
target: 'CottonCandyBlue', target: 'CottonCandyBlue',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
}, },
Candy_CottonCandyPink: { Candy_CottonCandyPink: {
text: t('foodCandyCottonCandyPink'), text: t('foodCandyCottonCandyPink'),
textA: t('foodCandyCottonCandyPinkA'), textA: t('foodCandyCottonCandyPinkA'),
textThe: t('foodCandyCottonCandyPinkThe'), textThe: t('foodCandyCottonCandyPinkThe'),
target: 'CottonCandyPink', target: 'CottonCandyPink',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
}, },
Candy_Shade: { Candy_Shade: {
text: t('foodCandyShade'), text: t('foodCandyShade'),
textA: t('foodCandyShadeA'), textA: t('foodCandyShadeA'),
textThe: t('foodCandyShadeThe'), textThe: t('foodCandyShadeThe'),
target: 'Shade', target: 'Shade',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
}, },
Candy_White: { Candy_White: {
text: t('foodCandyWhite'), text: t('foodCandyWhite'),
textA: t('foodCandyWhiteA'), textA: t('foodCandyWhiteA'),
textThe: t('foodCandyWhiteThe'), textThe: t('foodCandyWhiteThe'),
target: 'White', target: 'White',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
}, },
Candy_Golden: { Candy_Golden: {
text: t('foodCandyGolden'), text: t('foodCandyGolden'),
textA: t('foodCandyGoldenA'), textA: t('foodCandyGoldenA'),
textThe: t('foodCandyGoldenThe'), textThe: t('foodCandyGoldenThe'),
target: 'Golden', target: 'Golden',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
}, },
Candy_Zombie: { Candy_Zombie: {
text: t('foodCandyZombie'), text: t('foodCandyZombie'),
textA: t('foodCandyZombieA'), textA: t('foodCandyZombieA'),
textThe: t('foodCandyZombieThe'), textThe: t('foodCandyZombieThe'),
target: 'Zombie', target: 'Zombie',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
}, },
Candy_Desert: { Candy_Desert: {
text: t('foodCandyDesert'), text: t('foodCandyDesert'),
textA: t('foodCandyDesertA'), textA: t('foodCandyDesertA'),
textThe: t('foodCandyDesertThe'), textThe: t('foodCandyDesertThe'),
target: 'Desert', target: 'Desert',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
}, },
Candy_Red: { Candy_Red: {
text: t('foodCandyRed'), text: t('foodCandyRed'),
textA: t('foodCandyRedA'), textA: t('foodCandyRedA'),
textThe: t('foodCandyRedThe'), textThe: t('foodCandyRedThe'),
target: 'Red', target: 'Red',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
}, },
Pie_Skeleton: { Pie_Skeleton: {
text: t('foodPieSkeleton'), text: t('foodPieSkeleton'),
textA: t('foodPieSkeletonA'), textA: t('foodPieSkeletonA'),
textThe: t('foodPieSkeletonThe'), textThe: t('foodPieSkeletonThe'),
target: 'Skeleton', target: 'Skeleton',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
}, },
Pie_Base: { Pie_Base: {
text: t('foodPieBase'), text: t('foodPieBase'),
textA: t('foodPieBaseA'), textA: t('foodPieBaseA'),
textThe: t('foodPieBaseThe'), textThe: t('foodPieBaseThe'),
target: 'Base', target: 'Base',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
}, },
Pie_CottonCandyBlue: { Pie_CottonCandyBlue: {
text: t('foodPieCottonCandyBlue'), text: t('foodPieCottonCandyBlue'),
textA: t('foodPieCottonCandyBlueA'), textA: t('foodPieCottonCandyBlueA'),
textThe: t('foodPieCottonCandyBlueThe'), textThe: t('foodPieCottonCandyBlueThe'),
target: 'CottonCandyBlue', target: 'CottonCandyBlue',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
}, },
Pie_CottonCandyPink: { Pie_CottonCandyPink: {
text: t('foodPieCottonCandyPink'), text: t('foodPieCottonCandyPink'),
textA: t('foodPieCottonCandyPinkA'), textA: t('foodPieCottonCandyPinkA'),
textThe: t('foodPieCottonCandyPinkThe'), textThe: t('foodPieCottonCandyPinkThe'),
target: 'CottonCandyPink', target: 'CottonCandyPink',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
}, },
Pie_Shade: { Pie_Shade: {
text: t('foodPieShade'), text: t('foodPieShade'),
textA: t('foodPieShadeA'), textA: t('foodPieShadeA'),
textThe: t('foodPieShadeThe'), textThe: t('foodPieShadeThe'),
target: 'Shade', target: 'Shade',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
}, },
Pie_White: { Pie_White: {
text: t('foodPieWhite'), text: t('foodPieWhite'),
textA: t('foodPieWhiteA'), textA: t('foodPieWhiteA'),
textThe: t('foodPieWhiteThe'), textThe: t('foodPieWhiteThe'),
target: 'White', target: 'White',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
}, },
Pie_Golden: { Pie_Golden: {
text: t('foodPieGolden'), text: t('foodPieGolden'),
textA: t('foodPieGoldenA'), textA: t('foodPieGoldenA'),
textThe: t('foodPieGoldenThe'), textThe: t('foodPieGoldenThe'),
target: 'Golden', target: 'Golden',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
}, },
Pie_Zombie: { Pie_Zombie: {
text: t('foodPieZombie'), text: t('foodPieZombie'),
textA: t('foodPieZombieA'), textA: t('foodPieZombieA'),
textThe: t('foodPieZombieThe'), textThe: t('foodPieZombieThe'),
target: 'Zombie', target: 'Zombie',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
}, },
Pie_Desert: { Pie_Desert: {
text: t('foodPieDesert'), text: t('foodPieDesert'),
textA: t('foodPieDesertA'), textA: t('foodPieDesertA'),
textThe: t('foodPieDesertThe'), textThe: t('foodPieDesertThe'),
target: 'Desert', target: 'Desert',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
}, },
Pie_Red: { Pie_Red: {
text: t('foodPieRed'), text: t('foodPieRed'),
textA: t('foodPieRedA'), textA: t('foodPieRedA'),
textThe: t('foodPieRedThe'), textThe: t('foodPieRedThe'),
target: 'Red', target: 'Red',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
}, },
/* eslint-enable camelcase */ /* eslint-enable camelcase */
}; };
each(api.food, (food, key) => defaults(food, { each(api.food, (food, key) => {
value: 1, let foodType = 'Normal';
key, if (key.startsWith('Cake_')) {
notes: t('foodNotes'), foodType = 'Cake';
canBuy () { } else if (key.startsWith('Candy_')) {
return false; foodType = 'Candy';
}, } else if (key.startsWith('Pie_')) {
canDrop: false, foodType = 'Pie';
})); }
defaults(food, {
value: 1,
key,
notes: t('foodNotes'),
canBuy: () => FOOD_SEASON === foodType,
canDrop: FOOD_SEASON === foodType,
});
});
api.appearances = appearances; api.appearances = appearances;

View File

@@ -1,18 +1,8 @@
import find from 'lodash/find';
import moment from 'moment';
import { EVENTS } from '../constants/events';
import t from '../translation'; import t from '../translation';
const CURRENT_EVENT = find(EVENTS, event => moment()
.isBetween(event.start, event.end) && Boolean(event.season));
const QUEST_SEASONAL = { const QUEST_SEASONAL = {
// winter // winter
evilsanta: { evilsanta: {
event: CURRENT_EVENT && CURRENT_EVENT.season === 'winter' ? CURRENT_EVENT : null,
canBuy () {
return this.event && moment().isBetween(this.event.start, this.event.end);
},
text: t('questEvilSantaText'), text: t('questEvilSantaText'),
notes: t('questEvilSantaNotes'), notes: t('questEvilSantaNotes'),
addlNotes: t('evilSantaAddlNotes'), addlNotes: t('evilSantaAddlNotes'),
@@ -37,10 +27,6 @@ const QUEST_SEASONAL = {
}, },
}, },
evilsanta2: { evilsanta2: {
event: CURRENT_EVENT && CURRENT_EVENT.season === 'winter' ? CURRENT_EVENT : null,
canBuy () {
return this.event && moment().isBetween(this.event.start, this.event.end);
},
text: t('questEvilSanta2Text'), text: t('questEvilSanta2Text'),
notes: t('questEvilSanta2Notes'), notes: t('questEvilSanta2Notes'),
addlNotes: t('evilSantaAddlNotes'), addlNotes: t('evilSantaAddlNotes'),
@@ -71,10 +57,6 @@ const QUEST_SEASONAL = {
}, },
// spring // spring
egg: { egg: {
event: CURRENT_EVENT && CURRENT_EVENT.season === 'spring' ? CURRENT_EVENT : null,
canBuy () {
return this.event && moment().isBetween('2024-03-26T08:00-04:00', this.event.end);
},
text: t('questEggHuntText'), text: t('questEggHuntText'),
notes: t('questEggHuntNotes'), notes: t('questEggHuntNotes'),
completion: t('questEggHuntCompletion'), completion: t('questEggHuntCompletion'),
@@ -135,10 +117,6 @@ const QUEST_SEASONAL = {
}, },
}, },
waffle: { waffle: {
event: CURRENT_EVENT && CURRENT_EVENT.season === 'spring' ? CURRENT_EVENT : null,
canBuy () {
return this.event && moment().isBetween(this.event.start, this.event.end);
},
text: t('questWaffleText'), text: t('questWaffleText'),
notes: t('questWaffleNotes'), notes: t('questWaffleNotes'),
completion: t('questWaffleCompletion'), completion: t('questWaffleCompletion'),
@@ -178,10 +156,6 @@ const QUEST_SEASONAL = {
}, },
}, },
virtualpet: { virtualpet: {
event: CURRENT_EVENT && CURRENT_EVENT.season === 'spring' ? CURRENT_EVENT : null,
canBuy () {
return this.event && moment().isBetween(this.event.start, this.event.end);
},
text: t('questVirtualPetText'), text: t('questVirtualPetText'),
notes: t('questVirtualPetNotes'), notes: t('questVirtualPetNotes'),
completion: t('questVirtualPetCompletion'), completion: t('questVirtualPetCompletion'),