mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-03-21 17:54:13 -05:00
Move Salmon Run mystery weapon detection to the data store
This commit is contained in:
parent
a2ea3e8811
commit
260f70fa37
|
|
@ -19,14 +19,6 @@ export default class SalmonRunStatus extends StatusGenerator
|
|||
return Date.parse(schedule.startTime);
|
||||
}
|
||||
|
||||
_isGrizzcoMystery(schedule) {
|
||||
return schedule.settings.weapons.some(w => w.__splatoon3ink_id === 'edcfecb7e8acd1a7')
|
||||
}
|
||||
|
||||
_isMystery(schedule) {
|
||||
return schedule.settings.weapons.some(w => w.name === 'Random');
|
||||
}
|
||||
|
||||
async _getStatus() {
|
||||
let schedule = await this.getActiveSchedule();
|
||||
|
||||
|
|
@ -34,9 +26,9 @@ export default class SalmonRunStatus extends StatusGenerator
|
|||
|
||||
let mode = schedule.isBigRun ? 'BIG RUN' : 'Salmon Run';
|
||||
|
||||
if (this._isGrizzcoMystery(schedule)) {
|
||||
if (schedule.isGrizzcoMystery) {
|
||||
lines.push(`${mode} is now open on ${schedule.settings.coopStage.name} with GRIZZCO MYSTERY WEAPONS! #salmonrun #splatoon3`);
|
||||
} else if (this._isMystery(schedule)) {
|
||||
} else if (schedule.isMystery) {
|
||||
lines.push(`${mode} is now open on ${schedule.settings.coopStage.name} with MYSTERY WEAPONS! #salmonrun #splatoon3`);
|
||||
} else {
|
||||
lines.push(`${mode} is now open on ${schedule.settings.coopStage.name}! #salmonrun #splatoon3`);
|
||||
|
|
|
|||
|
|
@ -84,7 +84,12 @@ export const useSalmonRunSchedulesStore = defineScheduleStore('salmonRun', {
|
|||
let nodes = []
|
||||
.concat(data?.coopGroupingSchedule.regularSchedules.nodes.map(n => ({ ...n, isBigRun: false })))
|
||||
.concat(data?.coopGroupingSchedule.bigRunSchedules.nodes.map(n => ({ ...n, isBigRun: true })))
|
||||
.filter(n => n);
|
||||
.filter(n => n)
|
||||
.map(n => ({
|
||||
...n,
|
||||
isMystery: n.setting.weapons.some(w => w.name === 'Random'),
|
||||
isGrizzcoMystery: n.setting.weapons.some(w => w.__splatoon3ink_id === 'edcfecb7e8acd1a7'),
|
||||
}));
|
||||
|
||||
return sortBy(nodes, 'startTime');
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user