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);
}
});
console.log('setting current event');
this.currentEvent = _find(this.currentEventList, event => Boolean(['winter', 'spring', 'summer', 'fall'].includes(event.season)));
},
beforeDestroy () {

View File

@@ -40,14 +40,12 @@ if (process.env.ENABLE_TIME_TRAVEL) {
const sinon = await import('sinon');
const axios = await import('axios');
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);
Vue.config.clock = sinon.useFakeTimers({
now: time,
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 get from 'lodash/get';
@@ -6,6 +5,7 @@ import unlock from '@/../../common/script/ops/unlock';
import buy from '@/../../common/script/ops/buy/buy';
import appearanceSets from '@/../../common/script/content/appearance/sets';
import { getScheduleMatchingGroup } from '@/../../common/script/content/constants/schedule';
import { userStateMixin } from './userState';
@@ -18,13 +18,8 @@ export const avatarEditorUtilies = { // eslint-disable-line import/prefer-defaul
},
methods: {
hideSet (setKey) {
if (appearanceSets[setKey].availableFrom) {
return !moment().isBetween(
appearanceSets[setKey].availableFrom,
appearanceSets[setKey].availableUntil,
);
}
return moment(appearanceSets[setKey].availableUntil).isBefore(moment());
const matcher = getScheduleMatchingGroup('customizations');
return !matcher.match(setKey);
},
mapKeysToFreeOption (key, type, subType) {
const userPreference = subType

View File

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

View File

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

View File

@@ -1,6 +1,5 @@
import t from '../translation';
import prefill from './prefill';
import { EVENTS } from '../constants';
export default prefill({
baseHair1: { setPrice: 5, text: t('hairSet1') },
@@ -8,31 +7,31 @@ export default prefill({
baseHair3: { setPrice: 5, text: t('hairSet3') },
facialHair: { setPrice: 5, text: t('bodyFacialHair') },
specialShirts: { setPrice: 5, text: t('specialShirts') },
winterHairColors: { setPrice: 5, availableUntil: '2016-01-01' },
pastelHairColors: { setPrice: 5, availableUntil: '2016-01-01' },
winterHairColors: { setPrice: 5 },
pastelHairColors: { setPrice: 5 },
rainbowHairColors: { setPrice: 5, text: t('rainbowColors') },
shimmerHairColors: {
setPrice: 5, availableFrom: '2024-04-16T08:00-05:00', availableUntil: EVENTS.spring2024.end, text: t('shimmerColors'),
setPrice: 5, text: t('shimmerColors'),
},
hauntedHairColors: {
setPrice: 5, availableFrom: '2023-10-03T08:00-04:00', availableUntil: EVENTS.fall2023.end, text: t('hauntedColors'),
setPrice: 5, text: t('hauntedColors'),
},
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') },
animalSkins: { setPrice: 5, text: t('animalSkins') },
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: {
setPrice: 5, availableFrom: '2023-10-03T08:00-04:00', availableUntil: EVENTS.fall2023.end, text: t('supernaturalSkins'),
setPrice: 5, text: t('supernaturalSkins'),
},
splashySkins: {
setPrice: 5, availableFrom: '2023-07-11T08:00-05:00', availableUntil: EVENTS.summer2023.end, text: t('splashySkins'),
setPrice: 5, text: t('splashySkins'),
},
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',
'owl',
],
event: EVENTS.bundle202309,
canBuy () {
return moment().isBetween(EVENTS.bundle202309.start, EVENTS.bundle202309.end);
},
type: 'quests',
class: 'quest_bundle_featheredFriends',
value: 7,
@@ -35,10 +31,6 @@ const bundles = {
'turtle',
'whale',
],
event: EVENTS.bundle202306,
canBuy () {
return moment().isBetween(EVENTS.bundle202306.start, EVENTS.bundle202306.end);
},
type: 'quests',
class: 'quest_bundle_splashyPals',
value: 7,
@@ -52,10 +44,6 @@ const bundles = {
'horse',
'sheep',
],
event: EVENTS.bundle202209,
canBuy () {
return moment().isBetween(EVENTS.bundle202209.start, EVENTS.bundle202209.end);
},
type: 'quests',
value: 7,
},
@@ -68,10 +56,6 @@ const bundles = {
'spider',
'frog',
],
event: EVENTS.bundle202210,
canBuy () {
return moment().isBetween(EVENTS.bundle202210.start, EVENTS.bundle202210.end);
},
type: 'quests',
value: 7,
},
@@ -85,10 +69,6 @@ const bundles = {
'evilsanta2',
'penguin',
],
event: EVENTS.winter2024,
canBuy () {
return moment().isBetween(EVENTS.winter2024.start, EVENTS.winter2024.end);
},
type: 'quests',
value: 7,
},
@@ -101,9 +81,6 @@ const bundles = {
'beetle',
'butterfly',
],
canBuy () {
return moment().isBetween(EVENTS.bundle202308.start, EVENTS.bundle202308.end);
},
type: 'quests',
value: 7,
},
@@ -116,10 +93,6 @@ const bundles = {
'ferret',
'guineapig',
],
event: EVENTS.bundle202403,
canBuy () {
return moment().isBetween(EVENTS.bundle202403.start, EVENTS.bundle202403.end);
},
type: 'quests',
value: 7,
},
@@ -132,10 +105,6 @@ const bundles = {
'kraken',
'octopus',
],
event: EVENTS.bundle202206,
canBuy () {
return moment().isBetween(EVENTS.bundle202206.start, EVENTS.bundle202206.end);
},
type: 'quests',
value: 7,
},
@@ -148,10 +117,6 @@ const bundles = {
'hedgehog',
'treeling',
],
event: EVENTS.bundle202208,
canBuy () {
return moment().isBetween(EVENTS.bundle202208.start, EVENTS.bundle202208.end);
},
type: 'quests',
value: 7,
},
@@ -164,10 +129,6 @@ const bundles = {
'rock',
'yarn',
],
event: EVENTS.bundle202311,
canBuy () {
return moment().isBetween(EVENTS.bundle202311.start, EVENTS.bundle202311.end);
},
type: 'quests',
value: 7,
},
@@ -180,10 +141,6 @@ const bundles = {
'penguin',
'rooster',
],
event: EVENTS.bundle202305,
canBuy () {
return moment().isBetween(EVENTS.bundle202305.start, EVENTS.bundle202305.end);
},
type: 'quests',
value: 7,
},
@@ -196,10 +153,6 @@ const bundles = {
'seaserpent',
'gryphon',
],
event: EVENTS.bundle202402,
canBuy () {
return moment().isBetween(EVENTS.bundle202402.start, EVENTS.bundle202402.end);
},
type: 'quests',
value: 7,
},
@@ -212,10 +165,6 @@ const bundles = {
'snake',
'velociraptor',
],
event: EVENTS.bundle202211,
canBuy () {
return moment().isBetween(EVENTS.bundle202211.start, EVENTS.bundle202211.end);
},
type: 'quests',
value: 7,
},
@@ -228,9 +177,6 @@ const bundles = {
'triceratops',
'trex_undead',
],
canBuy () {
return moment().isBetween('2022-05-16', '2022-05-31');
},
type: 'quests',
value: 7,
},
@@ -243,10 +189,6 @@ const bundles = {
'sloth',
'treeling',
],
event: EVENTS.bundle202303,
canBuy () {
return moment().isBetween(EVENTS.bundle202303.start, EVENTS.bundle202303.end);
},
type: 'quests',
value: 7,
},
@@ -259,10 +201,6 @@ const bundles = {
'snake',
'spider',
],
event: EVENTS.bundle202310,
canBuy () {
return moment().isBetween(EVENTS.bundle202310.start, EVENTS.bundle202310.end);
},
type: 'quests',
value: 7,
},

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,7 @@
import assign from 'lodash/assign';
import defaults from 'lodash/defaults';
import each from 'lodash/each';
import moment from 'moment';
import t from './translation';
import { EVENTS } from './constants';
function hasQuestAchievementFunction (key) {
return user => user.achievements.quests && user.achievements.quests[key] > 0;
@@ -62,106 +60,70 @@ const premium = {
value: 2,
text: t('hatchingPotionCupid'),
limited: true,
event: EVENTS.potions202402,
_addlNotes: t('eventAvailability', {
date: t('dateEndFebruary'),
}),
canBuy () {
return moment().isBetween(EVENTS.potions202402.start, EVENTS.potions202402.end);
},
},
Shimmer: {
value: 2,
text: t('hatchingPotionShimmer'),
limited: true,
event: EVENTS.spring2024,
_addlNotes: t('eventAvailability', {
date: t('dateEndApril'),
}),
canBuy () {
return moment().isBetween(EVENTS.spring2024.start, EVENTS.spring2024.end);
},
},
Fairy: {
value: 2,
text: t('hatchingPotionFairy'),
limited: true,
event: EVENTS.potions202305,
_addlNotes: t('eventAvailability', {
date: t('dateEndMay'),
}),
canBuy () {
return moment().isBefore(EVENTS.potions202305.end);
},
},
Floral: {
value: 2,
text: t('hatchingPotionFloral'),
limited: true,
event: EVENTS.potions202305,
_addlNotes: t('eventAvailability', {
date: t('dateEndMay'),
}),
canBuy () {
return moment().isBefore(EVENTS.potions202305.end);
},
},
Aquatic: {
value: 2,
text: t('hatchingPotionAquatic'),
limited: true,
event: EVENTS.birthday10,
_addlNotes: t('eventAvailability', {
date: t('dateEndFebruary'),
}),
canBuy () {
return moment().isBetween(EVENTS.birthday10.start, EVENTS.birthday10.end);
},
},
Ember: {
value: 2,
text: t('hatchingPotionEmber'),
limited: true,
event: EVENTS.potions202311,
_addlNotes: t('eventAvailability', {
date: t('dateEndNovember'),
}),
canBuy () {
return moment().isBetween(EVENTS.potions202311.start, EVENTS.potions202311.end);
},
},
Thunderstorm: {
value: 2,
text: t('hatchingPotionThunderstorm'),
limited: true,
event: EVENTS.potions202308,
_addlNotes: t('eventAvailability', {
date: t('dateEndAugust'),
}),
canBuy () {
return moment().isBetween(EVENTS.potions202308.start, EVENTS.potions202308.end);
},
},
Spooky: {
value: 2,
text: t('hatchingPotionSpooky'),
limited: true,
event: EVENTS.fall2023,
_addlNotes: t('eventAvailability', {
date: t('dateEndOctober'),
}),
canBuy () {
return moment().isBetween(EVENTS.fall2023.start, EVENTS.fall2023.end);
},
},
Ghost: {
value: 2,
text: t('hatchingPotionGhost'),
limited: true,
event: EVENTS.fall2022,
canBuy () {
return moment().isBetween(EVENTS.fall2022.start, EVENTS.fall2022.end);
},
_addlNotes: t('eventAvailability', {
date: t('dateEndOctober'),
}),
@@ -173,10 +135,6 @@ const premium = {
_addlNotes: t('eventAvailability', {
date: t('dateEndJanuary'),
}),
event: EVENTS.winter2023,
canBuy () {
return moment().isBetween(EVENTS.winter2023.start, EVENTS.winter2023.end);
},
},
Peppermint: {
value: 2,
@@ -185,19 +143,11 @@ const premium = {
_addlNotes: t('eventAvailability', {
date: t('dateEndJanuary'),
}),
event: EVENTS.winter2024,
canBuy () {
return moment().isBetween(EVENTS.winter2024.start, EVENTS.winter2024.end);
},
},
StarryNight: {
value: 2,
text: t('hatchingPotionStarryNight'),
limited: true,
event: EVENTS.winter2023,
canBuy () {
return moment().isBetween(EVENTS.winter2023.start, EVENTS.winter2023.end);
},
_addlNotes: t('eventAvailability', {
date: t('dateEndJanuary'),
}),
@@ -209,10 +159,6 @@ const premium = {
_addlNotes: t('eventAvailability', {
date: t('dateEndApril'),
}),
event: EVENTS.spring2024,
canBuy () {
return moment().isBetween(EVENTS.spring2024.start, EVENTS.spring2024.end);
},
},
Glass: {
value: 2,
@@ -221,82 +167,54 @@ const premium = {
_addlNotes: t('eventAvailability', {
date: t('dateEndJuly'),
}),
event: EVENTS.summer2023,
canBuy () {
return moment().isBetween(EVENTS.summer2023.start, EVENTS.summer2023.end);
},
},
Glow: {
value: 2,
text: t('hatchingPotionGlow'),
limited: true,
event: EVENTS.fall2023,
_addlNotes: t('eventAvailability', {
date: t('dateEndOctober'),
}),
canBuy () {
return moment().isBetween(EVENTS.fall2023.start, EVENTS.fall2023.end);
},
},
Frost: {
value: 2,
text: t('hatchingPotionFrost'),
limited: true,
event: EVENTS.potions202311,
_addlNotes: t('eventAvailability', {
date: t('dateEndNovember'),
}),
canBuy () {
return moment().isBetween(EVENTS.potions202311.start, EVENTS.potions202311.end);
},
},
IcySnow: {
value: 2,
text: t('hatchingPotionIcySnow'),
limited: true,
event: EVENTS.winter2024,
_addlNotes: t('eventAvailability', {
date: t('dateEndJanuary'),
}),
canBuy () {
return moment().isBetween(EVENTS.winter2024.start, EVENTS.winter2024.end);
},
},
RoseQuartz: {
value: 2,
text: t('hatchingPotionRoseQuartz'),
limited: true,
event: EVENTS.potions202302,
_addlNotes: t('eventAvailability', {
date: t('dateEndFebruary'),
}),
canBuy () {
return moment().isBetween(EVENTS.potions202302.start, EVENTS.potions202302.end);
},
},
Celestial: {
value: 2,
text: t('hatchingPotionCelestial'),
limited: true,
event: EVENTS.spring2024,
_addlNotes: t('eventAvailability', {
date: t('dateEndApril'),
}),
canBuy () {
return moment().isBetween(EVENTS.spring2024.start, EVENTS.spring2024.end);
},
},
Sunshine: {
value: 2,
text: t('hatchingPotionSunshine'),
limited: true,
event: EVENTS.potions202205,
_addlNotes: t('eventAvailability', {
date: t('dateEndMay'),
}),
canBuy () {
return moment().isBefore(EVENTS.potions202205.end);
},
},
Bronze: {
value: 2,
@@ -309,13 +227,9 @@ const premium = {
value: 2,
text: t('hatchingPotionWatery'),
limited: true,
event: EVENTS.summer2022,
_addlNotes: t('eventAvailability', {
date: t('dateEndJuly'),
}),
canBuy () {
return moment().isBetween(EVENTS.summer2022.start, EVENTS.summer2022.end);
},
},
Silver: {
value: 2,
@@ -328,10 +242,6 @@ const premium = {
value: 2,
text: t('hatchingPotionShadow'),
limited: true,
event: EVENTS.fall2022,
canBuy () {
return moment().isBetween(EVENTS.fall2022.start, EVENTS.fall2022.end);
},
_addlNotes: t('eventAvailability', {
date: t('dateEndOctober'),
}),
@@ -350,10 +260,6 @@ const premium = {
_addlNotes: t('eventAvailability', {
date: t('dateEndJanuary'),
}),
event: EVENTS.winter2023,
canBuy () {
return moment().isBetween(EVENTS.winter2023.start, EVENTS.winter2023.end);
},
},
Ruby: {
value: 2,
@@ -366,13 +272,9 @@ const premium = {
value: 2,
text: t('hatchingPotionBirchBark'),
limited: true,
event: EVENTS.spring2023,
_addlNotes: t('eventAvailability', {
date: t('dateEndApril'),
}),
canBuy () {
return moment().isBefore(EVENTS.spring2023.end);
},
},
Fluorite: {
value: 2,
@@ -385,13 +287,9 @@ const premium = {
value: 2,
text: t('hatchingPotionSandSculpture'),
limited: true,
event: EVENTS.summer2023,
date: t('eventAvailability', {
date: t('dateEndJuly'),
}),
canBuy () {
return moment().isBetween(EVENTS.summer2023.start, EVENTS.summer2023.end);
},
},
Windup: {
value: 2,
@@ -411,25 +309,17 @@ const premium = {
value: 2,
text: t('hatchingPotionVampire'),
limited: true,
event: EVENTS.fall2023,
_addlNotes: t('eventAvailability', {
date: t('dateEndOctober'),
}),
canBuy () {
return moment().isBetween(EVENTS.fall2023.start, EVENTS.fall2023.end);
},
},
AutumnLeaf: {
value: 2,
text: t('hatchingPotionAutumnLeaf'),
limited: true,
event: EVENTS.potions202311,
_addlNotes: t('eventAvailability', {
date: t('dateEndNovember'),
}),
canBuy () {
return moment().isBetween(EVENTS.potions202311.start, EVENTS.potions202311.end);
},
},
BlackPearl: {
value: 2,
@@ -445,22 +335,14 @@ const premium = {
_addlNotes: t('eventAvailability', {
date: t('dateEndJanuary'),
}),
event: EVENTS.winter2024,
canBuy () {
return moment().isBetween(EVENTS.winter2024.start, EVENTS.winter2024.end);
},
},
PolkaDot: {
value: 2,
text: t('hatchingPotionPolkaDot'),
limited: true,
event: EVENTS.spring2023,
_addlNotes: t('eventAvailability', {
date: t('dateEndApril'),
}),
canBuy () {
return moment().isBefore(EVENTS.spring2023.end);
},
},
MossyStone: {
value: 2,
@@ -473,25 +355,17 @@ const premium = {
value: 2,
text: t('hatchingPotionSunset'),
limited: true,
event: EVENTS.summer2023,
_addlNotes: t('premiumPotionAddlNotes', {
date: t('dateEndJuly'),
}),
canBuy () {
return moment().isBetween(EVENTS.summer2023.start, EVENTS.summer2023.end);
},
},
Moonglow: {
value: 2,
text: t('hatchingPotionMoonglow'),
limited: true,
event: EVENTS.potions202208,
_addlNotes: t('premiumPotionAddlNotes', {
date: t('dateEndAugust'),
}),
canBuy () {
return moment().isBetween(EVENTS.potions202208.start, EVENTS.potions202208.end);
},
},
SolarSystem: {
value: 2,
@@ -511,13 +385,9 @@ const premium = {
value: 2,
text: t('hatchingPotionPorcelain'),
limited: true,
event: EVENTS.potions202308,
_addlNotes: t('eventAvailability', {
date: t('dateEndAugust'),
}),
canBuy () {
return moment().isBetween(EVENTS.potions202308.start, EVENTS.potions202308.end);
},
},
PinkMarble: {
value: 2,
@@ -544,13 +414,9 @@ const wacky = {
Veggie: {
text: t('hatchingPotionVeggie'),
limited: true,
event: EVENTS.spring2023,
_addlNotes: t('eventAvailability', {
date: t('dateEndApril'),
}),
canBuy () {
return moment().isBetween('2023-04-06T08:00-04:00', EVENTS.spring2023.end);
},
},
Dessert: {
text: t('hatchingPotionDessert'),
@@ -567,13 +433,9 @@ const wacky = {
TeaShop: {
text: t('hatchingPotionTeaShop'),
limited: true,
event: EVENTS.spring2023,
_addlNotes: t('premiumPotionAddlNotes', {
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'),
textThe: t('foodMeatThe'),
target: 'Base',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
},
Milk: {
text: t('foodMilk'),
textA: t('foodMilkA'),
textThe: t('foodMilkThe'),
target: 'White',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
},
Potatoe: {
text: t('foodPotatoe'),
textA: t('foodPotatoeA'),
textThe: t('foodPotatoeThe'),
target: 'Desert',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
},
Strawberry: {
text: t('foodStrawberry'),
textA: t('foodStrawberryA'),
textThe: t('foodStrawberryThe'),
target: 'Red',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
},
Chocolate: {
text: t('foodChocolate'),
textA: t('foodChocolateA'),
textThe: t('foodChocolateThe'),
target: 'Shade',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
},
Fish: {
text: t('foodFish'),
textA: t('foodFishA'),
textThe: t('foodFishThe'),
target: 'Skeleton',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
},
RottenMeat: {
text: t('foodRottenMeat'),
textA: t('foodRottenMeatA'),
textThe: t('foodRottenMeatThe'),
target: 'Zombie',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
},
CottonCandyPink: {
text: t('foodCottonCandyPink'),
textA: t('foodCottonCandyPinkA'),
textThe: t('foodCottonCandyPinkThe'),
target: 'CottonCandyPink',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
},
CottonCandyBlue: {
text: t('foodCottonCandyBlue'),
textA: t('foodCottonCandyBlueA'),
textThe: t('foodCottonCandyBlueThe'),
target: 'CottonCandyBlue',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
},
Honey: {
text: t('foodHoney'),
textA: t('foodHoneyA'),
textThe: t('foodHoneyThe'),
target: 'Golden',
canBuy () {
return FOOD_SEASON === 'Normal';
},
canDrop: FOOD_SEASON === 'Normal',
},
Saddle: {
canBuy () {
return true;
},
sellWarningNote: t('foodSaddleSellWarningNote'),
text: t('foodSaddleText'),
value: 5,
@@ -321,313 +278,201 @@ api.food = {
textA: t('foodCakeSkeletonA'),
textThe: t('foodCakeSkeletonThe'),
target: 'Skeleton',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
},
Cake_Base: {
text: t('foodCakeBase'),
textA: t('foodCakeBaseA'),
textThe: t('foodCakeBaseThe'),
target: 'Base',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
},
Cake_CottonCandyBlue: {
text: t('foodCakeCottonCandyBlue'),
textA: t('foodCakeCottonCandyBlueA'),
textThe: t('foodCakeCottonCandyBlueThe'),
target: 'CottonCandyBlue',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
},
Cake_CottonCandyPink: {
text: t('foodCakeCottonCandyPink'),
textA: t('foodCakeCottonCandyPinkA'),
textThe: t('foodCakeCottonCandyPinkThe'),
target: 'CottonCandyPink',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
},
Cake_Shade: {
text: t('foodCakeShade'),
textA: t('foodCakeShadeA'),
textThe: t('foodCakeShadeThe'),
target: 'Shade',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
},
Cake_White: {
text: t('foodCakeWhite'),
textA: t('foodCakeWhiteA'),
textThe: t('foodCakeWhiteThe'),
target: 'White',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
},
Cake_Golden: {
text: t('foodCakeGolden'),
textA: t('foodCakeGoldenA'),
textThe: t('foodCakeGoldenThe'),
target: 'Golden',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
},
Cake_Zombie: {
text: t('foodCakeZombie'),
textA: t('foodCakeZombieA'),
textThe: t('foodCakeZombieThe'),
target: 'Zombie',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
},
Cake_Desert: {
text: t('foodCakeDesert'),
textA: t('foodCakeDesertA'),
textThe: t('foodCakeDesertThe'),
target: 'Desert',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
},
Cake_Red: {
text: t('foodCakeRed'),
textA: t('foodCakeRedA'),
textThe: t('foodCakeRedThe'),
target: 'Red',
canBuy () {
return FOOD_SEASON === 'Cake';
},
canDrop: FOOD_SEASON === 'Cake',
},
Candy_Skeleton: {
text: t('foodCandySkeleton'),
textA: t('foodCandySkeletonA'),
textThe: t('foodCandySkeletonThe'),
target: 'Skeleton',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
},
Candy_Base: {
text: t('foodCandyBase'),
textA: t('foodCandyBaseA'),
textThe: t('foodCandyBaseThe'),
target: 'Base',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
},
Candy_CottonCandyBlue: {
text: t('foodCandyCottonCandyBlue'),
textA: t('foodCandyCottonCandyBlueA'),
textThe: t('foodCandyCottonCandyBlueThe'),
target: 'CottonCandyBlue',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
},
Candy_CottonCandyPink: {
text: t('foodCandyCottonCandyPink'),
textA: t('foodCandyCottonCandyPinkA'),
textThe: t('foodCandyCottonCandyPinkThe'),
target: 'CottonCandyPink',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
},
Candy_Shade: {
text: t('foodCandyShade'),
textA: t('foodCandyShadeA'),
textThe: t('foodCandyShadeThe'),
target: 'Shade',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
},
Candy_White: {
text: t('foodCandyWhite'),
textA: t('foodCandyWhiteA'),
textThe: t('foodCandyWhiteThe'),
target: 'White',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
},
Candy_Golden: {
text: t('foodCandyGolden'),
textA: t('foodCandyGoldenA'),
textThe: t('foodCandyGoldenThe'),
target: 'Golden',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
},
Candy_Zombie: {
text: t('foodCandyZombie'),
textA: t('foodCandyZombieA'),
textThe: t('foodCandyZombieThe'),
target: 'Zombie',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
},
Candy_Desert: {
text: t('foodCandyDesert'),
textA: t('foodCandyDesertA'),
textThe: t('foodCandyDesertThe'),
target: 'Desert',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
},
Candy_Red: {
text: t('foodCandyRed'),
textA: t('foodCandyRedA'),
textThe: t('foodCandyRedThe'),
target: 'Red',
canBuy () {
return FOOD_SEASON === 'Candy';
},
canDrop: FOOD_SEASON === 'Candy',
},
Pie_Skeleton: {
text: t('foodPieSkeleton'),
textA: t('foodPieSkeletonA'),
textThe: t('foodPieSkeletonThe'),
target: 'Skeleton',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
},
Pie_Base: {
text: t('foodPieBase'),
textA: t('foodPieBaseA'),
textThe: t('foodPieBaseThe'),
target: 'Base',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
},
Pie_CottonCandyBlue: {
text: t('foodPieCottonCandyBlue'),
textA: t('foodPieCottonCandyBlueA'),
textThe: t('foodPieCottonCandyBlueThe'),
target: 'CottonCandyBlue',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
},
Pie_CottonCandyPink: {
text: t('foodPieCottonCandyPink'),
textA: t('foodPieCottonCandyPinkA'),
textThe: t('foodPieCottonCandyPinkThe'),
target: 'CottonCandyPink',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
},
Pie_Shade: {
text: t('foodPieShade'),
textA: t('foodPieShadeA'),
textThe: t('foodPieShadeThe'),
target: 'Shade',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
},
Pie_White: {
text: t('foodPieWhite'),
textA: t('foodPieWhiteA'),
textThe: t('foodPieWhiteThe'),
target: 'White',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
},
Pie_Golden: {
text: t('foodPieGolden'),
textA: t('foodPieGoldenA'),
textThe: t('foodPieGoldenThe'),
target: 'Golden',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
},
Pie_Zombie: {
text: t('foodPieZombie'),
textA: t('foodPieZombieA'),
textThe: t('foodPieZombieThe'),
target: 'Zombie',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
},
Pie_Desert: {
text: t('foodPieDesert'),
textA: t('foodPieDesertA'),
textThe: t('foodPieDesertThe'),
target: 'Desert',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
},
Pie_Red: {
text: t('foodPieRed'),
textA: t('foodPieRedA'),
textThe: t('foodPieRedThe'),
target: 'Red',
canBuy () {
return FOOD_SEASON === 'Pie';
},
canDrop: FOOD_SEASON === 'Pie',
},
/* eslint-enable camelcase */
};
each(api.food, (food, key) => defaults(food, {
each(api.food, (food, key) => {
let foodType = 'Normal';
if (key.startsWith('Cake_')) {
foodType = 'Cake';
} else if (key.startsWith('Candy_')) {
foodType = 'Candy';
} else if (key.startsWith('Pie_')) {
foodType = 'Pie';
}
defaults(food, {
value: 1,
key,
notes: t('foodNotes'),
canBuy () {
return false;
},
canDrop: false,
}));
canBuy: () => FOOD_SEASON === foodType,
canDrop: FOOD_SEASON === foodType,
});
});
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';
const CURRENT_EVENT = find(EVENTS, event => moment()
.isBetween(event.start, event.end) && Boolean(event.season));
const QUEST_SEASONAL = {
// winter
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'),
notes: t('questEvilSantaNotes'),
addlNotes: t('evilSantaAddlNotes'),
@@ -37,10 +27,6 @@ const QUEST_SEASONAL = {
},
},
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'),
notes: t('questEvilSanta2Notes'),
addlNotes: t('evilSantaAddlNotes'),
@@ -71,10 +57,6 @@ const QUEST_SEASONAL = {
},
// spring
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'),
notes: t('questEggHuntNotes'),
completion: t('questEggHuntCompletion'),
@@ -135,10 +117,6 @@ const QUEST_SEASONAL = {
},
},
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'),
notes: t('questWaffleNotes'),
completion: t('questWaffleCompletion'),
@@ -178,10 +156,6 @@ const QUEST_SEASONAL = {
},
},
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'),
notes: t('questVirtualPetNotes'),
completion: t('questVirtualPetCompletion'),