mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Implement food seasons
This commit is contained in:
committed by
Sabe Jones
parent
041edb3042
commit
bca3e96e9c
@@ -34,6 +34,7 @@ import faq from './faq';
|
||||
import timeTravelers from './time-travelers';
|
||||
|
||||
import { getScheduleMatchingGroup } from './constants/schedule';
|
||||
import { getRepeatingEvents } from './constants/events';
|
||||
|
||||
import loginIncentives from './loginIncentives';
|
||||
|
||||
@@ -202,9 +203,6 @@ api.premiumMounts = stable.premiumMounts;
|
||||
api.specialMounts = stable.specialMounts;
|
||||
api.mountInfo = stable.mountInfo;
|
||||
|
||||
// For seasonal events, change this constant:
|
||||
const FOOD_SEASON = moment().isBefore('2023-03-15T12:00-05:00') ? 'Pie' : 'Normal';
|
||||
|
||||
api.food = {
|
||||
Meat: {
|
||||
text: t('foodMeat'),
|
||||
@@ -456,6 +454,12 @@ api.food = {
|
||||
/* eslint-enable camelcase */
|
||||
};
|
||||
|
||||
let FOOD_SEASON = 'Normal';
|
||||
getRepeatingEvents(moment()).forEach(event => {
|
||||
if (event.foodSeason) {
|
||||
FOOD_SEASON = event.foodSeason;
|
||||
}
|
||||
});
|
||||
each(api.food, (food, key) => {
|
||||
let foodType = 'Normal';
|
||||
if (key.startsWith('Cake_')) {
|
||||
|
||||
Reference in New Issue
Block a user