Valley map: start from any place and see every dragon's best route from there
Click a place name before choosing a dragon to see your chance of each dragon from that point on, one coloured route per dragon, with a panel that ranks them and links into each route kept through that place. Deep link: #valley/at/<place>. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e8c177fc15
commit
68587a55f0
@@ -7,6 +7,7 @@ const OUT = process.argv[2];
|
||||
const states = [["idle", "#valley"]];
|
||||
for (const c of ["red", "orange", "brown", "green", "blue", "black"]) states.push([c, "#valley/" + c]);
|
||||
const extra = { blue: ["shadow-Blue"], red: ["tree-Red"], orange: ["tree-Greens"], brown: ["tree-Greens"] };
|
||||
for (const id of (process.env.POINTS || "dir:Center,comp:Alone,scream,bully,wounded,hour,tree,valley,stream,meadow").split(",")) states.push(["at-" + id, "#valley/at/" + encodeURIComponent(id)]);
|
||||
for (const [c, encs] of Object.entries(extra)) encs.forEach((e) => states.push([c + "/" + e, `#valley/${c}/${e}`]));
|
||||
for (const [name, hash] of states) {
|
||||
await p.goto("http://localhost:8765/" + hash); await p.waitForTimeout(1800);
|
||||
@@ -28,14 +29,14 @@ const OUT = process.argv[2];
|
||||
if (ix > 3 && iy > 3 && items[i].txt !== items[j].txt) over.push(`"${items[i].txt}" × "${items[j].txt}"`);
|
||||
}
|
||||
const dragons = [...svg.querySelectorAll(".ex-dragon")].map((d) => ({ l: d.getAttribute("aria-label") || "twin", op: +d.getAttribute("opacity") })).filter((d) => d.op < 0.3);
|
||||
const card = document.querySelector(".ex-route-card.on");
|
||||
return { out, over, faint: dragons.map((d) => `${d.l.split(".")[0]} ${d.op}`), focus: card ? card.innerText.split("\n")[0] : "" };
|
||||
const card = document.querySelector(".ex-route-card.on") || (document.querySelector(".ex-from") && document.querySelector(".ex-from"));
|
||||
return { out, over, faint: dragons.map((d) => `${d.l.split(".")[0]} ${d.op}`), focus: card ? card.innerText.replace(/\s+/g, " ").slice(0, 160) : "" };
|
||||
});
|
||||
console.log(`\n[${name}] ${res.focus}`);
|
||||
if (res.out.length) console.log(" outside:", res.out.join(" | "));
|
||||
if (res.over.length) console.log(" overlaps:", [...new Set(res.over)].join(" | "));
|
||||
if (res.faint.length) console.log(" faint (<0.3):", res.faint.join(" | "));
|
||||
await p.locator("#ex-map").screenshot({ path: `${OUT}/map-${name.replace("/", "_")}.png` });
|
||||
await p.locator("#ex-map").screenshot({ path: `${OUT}/map-${name.replace(/[/:]/g, "_")}.png` });
|
||||
}
|
||||
await b.close();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user