Implement new content schedule for magic hatching potions

This commit is contained in:
Phillip Thelen
2024-01-31 18:29:58 +01:00
committed by Sabe Jones
parent f223b5dd2a
commit 129cb7627c
3 changed files with 102 additions and 2 deletions

View File

@@ -71,8 +71,10 @@ shops.getMarketCategories = function getMarket (user, language) {
text: i18n.t('magicHatchingPotions', language),
notes: i18n.t('premiumPotionNoDropExplanation', language),
};
const matchers = assembleScheduledMatchers(new Date()).filter(matcher => matcher.type === 'premiumHatchingPotions').map(matcher => matcher.matcher);
premiumHatchingPotionsCategory.items = sortBy(values(content.hatchingPotions)
.filter(hp => hp.limited && hp.canBuy(user))
.filter(hp => hp.limited
&& matchers.map(matcher => matcher(hp.key)).every(matcher => matcher === true))
.map(premiumHatchingPotion => getItemInfo(user, 'premiumHatchingPotion', premiumHatchingPotion, officialPinnedItems, language)), 'key');
if (premiumHatchingPotionsCategory.items.length > 0) {
categories.push(premiumHatchingPotionsCategory);