Add reward gear info to the Salmon Run shift tweet

This commit is contained in:
Matt Isenhower 2019-07-30 16:30:56 -07:00
parent ec52eae6fc
commit 558ca28aa6
2 changed files with 24 additions and 7 deletions

View File

@ -19,25 +19,42 @@ class SalmonRunTweet extends TwitterPostBase {
return Object.values(results);
}
getSalmonRunGear() {
let timeline = readData('timeline.json');
return timeline.coop && timeline.coop.reward_gear;
}
getData() {
return this.getSalmonRunSchedules().find(s => s.start_time == this.getDataTime());
const schedule = this.getSalmonRunSchedules().find(s => s.start_time == this.getDataTime());
const gear = this.getSalmonRunGear();
return { schedule, gear };
}
getTestData() {
return this.getSalmonRunSchedules()[0];
const schedule = this.getSalmonRunSchedules()[0];
const gear = this.getSalmonRunGear();
return { schedule, gear };
}
getImage(data) {
return captureSalmonRunScreenshot(data.start_time);
return captureSalmonRunScreenshot(data.schedule.start_time);
}
getText(data) {
let hasMysteryWeapon = data.weapons.some(w => w === null || w.coop_special_weapon);
let gear = '';
if (data.gear) {
gear = `Current reward gear is the ${data.gear.gear.name}. `;
}
let hasMysteryWeapon = data.schedule.weapons.some(w => w === null || w.coop_special_weapon);
if (hasMysteryWeapon)
return `Salmon Run is now open on ${data.stage.name} with MYSTERY WEAPONS! #salmonrun #splatoon2`;
return `Salmon Run is now open on ${data.schedule.stage.name} with MYSTERY WEAPONS! ${gear} #salmonrun #splatoon2`;
return `Salmon Run is now open on ${data.stage.name}! #salmonrun #splatoon2`;
return `Salmon Run is now open on ${data.schedule.stage.name}! ${gear} #salmonrun #splatoon2`;
}
}

View File

@ -21,7 +21,7 @@
<div class="column is-4 salmon-run-ad-img">
<div class="image is-16by9 is-hidden-desktop"></div>
<template v-if="!screenshotMode && rewardGear">
<template v-if="rewardGear">
<div class="salmon-run-gear-text">
{{ $t('coop.current_gear') }}
</div>