mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 13:47:33 +01:00
Implement food seasons
This commit is contained in:
committed by
Sabe Jones
parent
041edb3042
commit
bca3e96e9c
@@ -45,7 +45,6 @@ if (process.env.ENABLE_TIME_TRAVEL) {
|
||||
now: time,
|
||||
shouldAdvanceTime: true,
|
||||
});
|
||||
|
||||
})();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,13 @@ export const REPEATING_EVENTS = {
|
||||
},
|
||||
],
|
||||
},
|
||||
birthday: {
|
||||
start: '1970-01-30T08:00-05:00',
|
||||
end: '1970-02-08T23:59-05:00',
|
||||
season: 'birthday',
|
||||
npcImageSuffix: '_birthday',
|
||||
foodSeason: 'Cake',
|
||||
},
|
||||
valentines: {
|
||||
start: '1970-02-13T08:00-05:00',
|
||||
end: '1970-02-17T23:59-05:00',
|
||||
@@ -39,17 +46,27 @@ export const REPEATING_EVENTS = {
|
||||
},
|
||||
],
|
||||
},
|
||||
birthday: {
|
||||
start: '1970-01-30T08:00-05:00',
|
||||
end: '1970-02-08T23:59-05:00',
|
||||
season: 'birthday',
|
||||
npcImageSuffix: '_birthday',
|
||||
piDay: {
|
||||
start: '1970-03-13T08:00-05:00',
|
||||
end: '1970-03-15T23:59-05:00',
|
||||
foodSeason: 'Pie',
|
||||
},
|
||||
namingDay: {
|
||||
start: '1970-07-30T08:00-05:00',
|
||||
end: '1970-08-01T23:59-05:00',
|
||||
foodSeason: 'Cake',
|
||||
},
|
||||
habitoween: {
|
||||
start: '1970-10-30T08:00-05:00',
|
||||
end: '1970-11-01T23:59-05:00',
|
||||
foodSeason: 'Candy',
|
||||
},
|
||||
harvestFeast: {
|
||||
start: '1970-11-22T08:00-05:00',
|
||||
end: '1970-11-27T20:00-05:00',
|
||||
season: 'thanksgiving',
|
||||
npcImageSuffix: '_thanksgiving',
|
||||
foodSeason: 'Pie',
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -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