fix(wacky): revise text, address linting

This commit is contained in:
Kalista Payne
2025-03-18 16:52:19 -05:00
parent 2d49a16f55
commit 1a50413402
3 changed files with 29 additions and 27 deletions

View File

@@ -354,6 +354,8 @@
"hatchingPotionNotes": "Pour this on an egg, and it will hatch as a <%= potText(locale) %> Pet.",
"premiumPotionUnlimitedNotes": "Not usable on Quest Pet eggs.",
"wackyPotionNotes": "Pour this on an egg, and it will hatch as a Wacky <%= potText(locale) %> Pet.",
"wackyPotionAddlNotes": "Cannot be raised to Mounts or used on Quest Pet eggs.",
"foodMeat": "Meat",
"foodMeatThe": "the Meat",

View File

@@ -841,6 +841,30 @@ function getGalaIndex (date) {
return parseInt((galaCount / 12) * galaMonth, 10);
}
function makeEndDate (checkedDate, matcher) {
let end = moment.utc(checkedDate);
end.hour(SWITCHOVER_TIME);
end.minute(0);
end.second(0);
if (matcher.end !== undefined) {
end.date(matcher.end.getDate());
end.month(matcher.end.getMonth());
} else {
end.date(TYPE_SCHEDULE[matcher.type]);
if (matcher.endMonth !== undefined) {
if (matcher.startMonth
&& matcher.startMonth > matcher.endMonth
&& checkedDate.getMonth() > matcher.endMonth) {
end.year(checkedDate.getFullYear() + 1);
}
end.month(matcher.endMonth);
} else if (end.valueOf() <= checkedDate.getTime()) {
end = moment(end).add(1, 'months');
}
}
return end.toDate();
}
export function assembleScheduledMatchers (date) {
const items = [];
const month = getMonth(date);
@@ -910,30 +934,6 @@ function makeMatcherClass (date) {
};
}
function makeEndDate (checkedDate, matcher) {
let end = moment.utc(checkedDate);
end.hour(SWITCHOVER_TIME);
end.minute(0);
end.second(0);
if (matcher.end !== undefined) {
end.date(matcher.end.getDate());
end.month(matcher.end.getMonth());
} else {
end.date(TYPE_SCHEDULE[matcher.type]);
if (matcher.endMonth !== undefined) {
if (matcher.startMonth
&& matcher.startMonth > matcher.endMonth
&& checkedDate.getMonth() > matcher.endMonth) {
end.year(checkedDate.getFullYear() + 1);
}
end.month(matcher.endMonth);
} else if (end.valueOf() <= checkedDate.getTime()) {
end = moment(end).add(1, 'months');
}
}
return end.toDate();
}
export function clearCachedMatchers () {
cacheDate = null;
cachedScheduleMatchers = null;
@@ -959,7 +959,7 @@ export function getAllScheduleMatchingGroups (date) {
cachedScheduleMatchers[matcher.type] = makeMatcherClass(adjustedDate);
}
if (matcher.end === undefined) {
// we want the default end date to be for matcher type
// we want the default end date to be for matcher type
cachedScheduleMatchers[matcher.type].end = makeEndDate(checkedDate, matcher);
}
if (matcher.matcher instanceof Function) {

View File

@@ -191,10 +191,10 @@ each(wacky, (pot, key) => {
key,
value: 2,
text: t(`hatchingPotion${key}`),
notes: t('hatchingPotionNotes', {
notes: t('wackyPotionNotes', {
potText: t(`hatchingPotion${key}`),
}),
_addlNotes: t('premiumPotionUnlimitedNotes'),
_addlNotes: t('wackyPotionAddlNotes'),
premium: false,
limited: true,
wacky: true,