Skip to content

Commit

Permalink
Seasonal gear fix (#15255)
Browse files Browse the repository at this point in the history
* cleanup unneeded season definitions

* assign first winter seasonal gear right season

* add missing winter definition

* Fix enddate for winter galas

* fix lint

* fix halloween sprites

* set season

* fix loading habitoween sprites

* add missing customization shop sprites

* Fix test

* update customization shop sprites
  • Loading branch information
phillipthelen authored Jul 29, 2024
1 parent fc11941 commit e801547
Show file tree
Hide file tree
Showing 28 changed files with 40 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describe('GET /world-state', () => {

const res = await requester().get('/world-state');

expect(res.npcImageSuffix).to.equal('winter');
expect(res.npcImageSuffix).to.equal('fall');
});
});
});
6 changes: 6 additions & 0 deletions test/content/schedule.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ describe('Content Schedule', () => {
expect(matchers.seasonalGear.end).to.eql(moment.utc(`2024-06-21T${String(switchoverTime).padStart(2, '0')}:00:00.000Z`).toDate());
});

it('sets the end date for a winter gala', () => {
const date = new Date('2024-12-22');
const matchers = getAllScheduleMatchingGroups(date);
expect(matchers.seasonalGear.end).to.eql(moment.utc(`2025-03-21T${String(switchoverTime).padStart(2, '0')}:00:00.000Z`).toDate());
});

it('contains content for repeating events', () => {
const date = new Date('2024-04-15');
const matchers = getAllScheduleMatchingGroups(date);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/client/public/static/npc/normal/customizations_npc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions website/client/src/components/shops/customizations/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
</style>

<script>
import find from 'lodash/find';
import shops from '@/../../common/script/libs/shops';
import throttle from 'lodash/throttle';
import { mapState } from '@/libs/store';
Expand Down Expand Up @@ -145,9 +146,16 @@ export default {
return Object.values(this.viewOptions).some(g => g.selected);
},
imageURLs () {
const currentEvent = find(this.currentEventList, event => Boolean(event.season));
if (!currentEvent) {
return {
background: 'url(/static/npc/normal/customizations_background.png)',
npc: 'url(/static/npc/normal/customizations_npc.png)',
};
}
return {
background: 'url(/static/npc/normal/customizations_background.png)',
npc: 'url(/static/npc/normal/customizations_npc.png)',
background: `url(/static/npc/${currentEvent.season}/customizations_background.png)`,
npc: `url(/static/npc/${currentEvent.season}/customizations_npc.png)`,
};
},
categories () {
Expand Down
2 changes: 1 addition & 1 deletion website/client/src/components/shops/seasonal/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ export default {
});

await this.triggerGetWorldState();
this.currentEvent = _find(this.currentEventList, event => Boolean(['winter', 'spring', 'summer', 'fall'].includes(event.season)));
this.currentEvent = _find(this.currentEventList, event => Boolean(event.season));
this.imageURLs.background = `url(/static/npc/${this.currentEvent.season}/seasonal_shop_opened_background.png)`;
this.imageURLs.npc = `url(/static/npc/${this.currentEvent.season}/seasonal_shop_opened_npc.png)`;
},
Expand Down
2 changes: 2 additions & 0 deletions website/common/script/content/constants/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ export const REPEATING_EVENTS = {
start: new Date('1970-10-30T08:00-05:00'),
end: new Date('1970-11-01T23:59-05:00'),
foodSeason: 'Candy',
season: 'habitoween',
npcImageSuffix: '_halloween',
},
harvestFeast: {
start: new Date('1970-11-22T08:00-05:00'),
Expand Down
4 changes: 4 additions & 0 deletions website/common/script/content/constants/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ export function assembleScheduledMatchers (date) {
const gala = GALA_SCHEDULE[getGalaIndex(date)];
const galaMatchers = gala.matchers;
galaMatchers.forEach(matcher => {
matcher.startMonth = gala.startMonth;
matcher.endMonth = gala.endMonth;
});
items.push(...galaMatchers);
Expand Down Expand Up @@ -887,6 +888,9 @@ function makeEndDate (checkedDate, matcher) {
end.minute(0);
end.second(0);
if (matcher.endMonth !== undefined) {
if (matcher.startMonth && matcher.startMonth > matcher.endMonth) {
end.year(checkedDate.getFullYear() + 1);
}
end.month(matcher.endMonth);
} else if (end.date() <= checkedDate.getDate()) {
end = moment(end).add(1, 'months');
Expand Down
48 changes: 15 additions & 33 deletions website/common/script/content/gear/sets/special/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ const armor = {
notes: t('armorSpecialYetiNotes', { con: 9 }),
con: 9,
value: 90,
season: 'winter',
},
ski: {
specialClass: 'rogue',
Expand All @@ -157,6 +158,7 @@ const armor = {
notes: t('armorSpecialSkiNotes', { per: 15 }),
per: 15,
value: 90,
season: 'winter',
},
candycane: {
specialClass: 'wizard',
Expand All @@ -165,6 +167,7 @@ const armor = {
notes: t('armorSpecialCandycaneNotes', { int: 9 }),
int: 9,
value: 90,
season: 'winter',
},
snowflake: {
specialClass: 'healer',
Expand All @@ -173,6 +176,7 @@ const armor = {
notes: t('armorSpecialSnowflakeNotes', { con: 15 }),
con: 15,
value: 90,
season: 'winter',
},
birthday: {
event: EVENTS.birthday,
Expand All @@ -182,51 +186,39 @@ const armor = {
},
springRogue: {
set: 'stealthyKittySet',
season: 'spring',
},
springWarrior: {
set: 'mightyBunnySet',
season: 'spring',
},
springMage: {
set: 'magicMouseSet',
season: 'spring',
},
springHealer: {
set: 'lovingPupSet',
season: 'spring',
},
summerRogue: {
set: 'roguishPirateSet',
season: 'summer',
},
summerWarrior: {
set: 'daringSwashbucklerSet',
season: 'summer',
},
summerMage: {
set: 'emeraldMermageSet',
season: 'summer',
},
summerHealer: {
set: 'reefSeahealerSet',
season: 'summer',
},
fallRogue: {
set: 'vampireSmiterSet',
season: 'fall',
},
fallWarrior: {
set: 'monsterOfScienceSet',
season: 'fall',
},
fallMage: {
set: 'witchyWizardSet',
season: 'fall',
},
fallHealer: {
set: 'mummyMedicSet',
season: 'fall',
},
winter2015Rogue: {
set: 'icicleDrakeSet',
Expand Down Expand Up @@ -1228,6 +1220,7 @@ const head = {
notes: t('headSpecialYetiNotes', { str: 9 }),
str: 9,
value: 60,
season: 'winter',
},
ski: {
specialClass: 'rogue',
Expand All @@ -1236,6 +1229,7 @@ const head = {
notes: t('headSpecialSkiNotes', { per: 9 }),
per: 9,
value: 60,
season: 'winter',
},
candycane: {
specialClass: 'wizard',
Expand All @@ -1244,6 +1238,7 @@ const head = {
notes: t('headSpecialCandycaneNotes', { per: 7 }),
per: 7,
value: 60,
season: 'winter',
},
snowflake: {
specialClass: 'healer',
Expand All @@ -1252,54 +1247,43 @@ const head = {
notes: t('headSpecialSnowflakeNotes', { int: 7 }),
int: 7,
value: 60,
season: 'winter',
},
springRogue: {
set: 'stealthyKittySet',
season: 'spring',
},
springWarrior: {
set: 'mightyBunnySet',
season: 'spring',
},
springMage: {
set: 'magicMouseSet',
season: 'spring',
},
springHealer: {
set: 'lovingPupSet',
season: 'spring',
},
summerRogue: {
set: 'roguishPirateSet',
season: 'summer',
},
summerWarrior: {
set: 'daringSwashbucklerSet',
season: 'summer',
},
summerMage: {
set: 'emeraldMermageSet',
season: 'summer',
},
summerHealer: {
set: 'reefSeahealerSet',
season: 'summer',
},
fallRogue: {
set: 'vampireSmiterSet',
season: 'fall',
},
fallWarrior: {
set: 'monsterOfScienceSet',
season: 'fall',
},
fallMage: {
set: 'witchyWizardSet',
season: 'fall',
},
fallHealer: {
set: 'mummyMedicSet',
season: 'fall',
},
winter2015Rogue: {
set: 'icicleDrakeSet',
Expand Down Expand Up @@ -2114,6 +2098,7 @@ const shield = {
notes: t('shieldSpecialYetiNotes', { con: 7 }),
con: 7,
value: 70,
season: 'winter',
},
ski: {
specialClass: 'rogue',
Expand All @@ -2122,6 +2107,7 @@ const shield = {
notes: t('weaponSpecialSkiNotes', { str: 8 }),
str: 8,
value: 90,
season: 'winter',
},
snowflake: {
specialClass: 'healer',
Expand All @@ -2130,42 +2116,34 @@ const shield = {
notes: t('shieldSpecialSnowflakeNotes', { con: 9 }),
con: 9,
value: 70,
season: 'winter',
},
springRogue: {
set: 'stealthyKittySet',
season: 'spring',
},
springWarrior: {
set: 'mightyBunnySet',
season: 'spring',
},
springHealer: {
set: 'lovingPupSet',
season: 'spring',
},
summerRogue: {
set: 'roguishPirateSet',
season: 'summer',
},
summerWarrior: {
set: 'daringSwashbucklerSet',
season: 'summer',
},
summerHealer: {
set: 'reefSeahealerSet',
season: 'summer',
},
fallRogue: {
set: 'vampireSmiterSet',
season: 'fall',
},
fallWarrior: {
set: 'monsterOfScienceSet',
season: 'fall',
},
fallHealer: {
set: 'mummyMedicSet',
season: 'fall',
},
winter2015Rogue: {
set: 'icicleDrakeSet',
Expand Down Expand Up @@ -2665,6 +2643,7 @@ const weapon = {
notes: t('weaponSpecialYetiNotes', { str: 15 }),
str: 15,
value: 90,
season: 'winter',
},
ski: {
specialClass: 'rogue',
Expand All @@ -2673,6 +2652,7 @@ const weapon = {
notes: t('weaponSpecialSkiNotes', { str: 8 }),
str: 8,
value: 90,
season: 'winter',
},
candycane: {
specialClass: 'wizard',
Expand All @@ -2683,6 +2663,7 @@ const weapon = {
int: 15,
per: 7,
value: 160,
season: 'winter',
},
snowflake: {
specialClass: 'healer',
Expand All @@ -2691,6 +2672,7 @@ const weapon = {
notes: t('weaponSpecialSnowflakeNotes', { int: 9 }),
int: 9,
value: 90,
season: 'winter',
},
springRogue: {
set: 'stealthyKittySet',
Expand Down
2 changes: 1 addition & 1 deletion website/server/controllers/api-v3/world.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ api.getWorldState = {
}

worldState.currentEventList.forEach(event => {
if (event.npcImageSuffix) {
if (event.npcImageSuffix && !worldState.npcImageSuffix) {
worldState.npcImageSuffix = event.npcImageSuffix;
}
});
Expand Down

0 comments on commit e801547

Please sign in to comment.