Architect runs: a generated run every week
scripts/weekly-architect.js picks an HQ in a region the last weeks did not have and designs each brief against the network a reference architect has built so far, so every brief asks for something new; the game's own checklist and chaos monkey review judge it, and the whole run is replayed from the file for three stars. The game fetches architect/weekly/<key>.json when Puzzles opens, checks it field by field and writes the briefs' text itself. The Sunday job and the release deploy carry it like the weekly puzzles and scenarios. Later briefs' cities no longer show early.
This commit is contained in:
parent
601f7028bd
commit
4e6e8294d2
21 changed files with 461 additions and 17 deletions
|
|
@ -25,8 +25,8 @@ self.addEventListener('fetch', (e) => {
|
|||
}
|
||||
const local = url.origin === location.origin, fonts = /fonts\.(googleapis|gstatic)\.com$/.test(url.hostname);
|
||||
if (!local && !fonts) return;
|
||||
// Weekly puzzles and scenarios are published between releases: ask the network first, and keep a copy for offline.
|
||||
if (local && (url.pathname.startsWith('/puzzles/weekly/') || url.pathname.startsWith('/scenarios/weekly/'))) {
|
||||
// Weekly puzzles, scenarios and Architect runs are published between releases: ask the network first, and keep a copy for offline.
|
||||
if (local && (url.pathname.startsWith('/puzzles/weekly/') || url.pathname.startsWith('/scenarios/weekly/') || url.pathname.startsWith('/architect/weekly/'))) {
|
||||
e.respondWith(fetch(req).then((r) => { if (r.ok) { const copy = r.clone(); caches.open(CACHE).then((c) => c.put(req, copy)); } return r; })
|
||||
.catch(() => caches.match(req).then((r) => r || Response.error())));
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue