The Odds: summary cards count cadets, not deliberate deaths

'Become a rider' and 'riders sent to Malek' now leave out runs where the rider
died on purpose (burned at an encounter they did not genuinely attempt, the
solver's genuineAttempt rule) and runs with no recorded outcome.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
This commit is contained in:
ekcSchiano
2026-11-02 16:39:07 +00:00
co-authored by Claude Opus 5.5
parent 3d1c09138d
commit efb54f3d7a
+13 -5
View File
@@ -171,12 +171,20 @@
const cb = r.chance.blue_meadow; const cb = r.chance.blue_meadow;
const bulkB = stratum(cb, "Bulk"); const bulkB = stratum(cb, "Bulk");
const tag = (txt) => `<span class="how">${txt}</span>`; const tag = (txt) => `<span class="how">${txt}</span>`;
const bonded = Object.entries(r.meta.outcomes).filter(([k]) => k.startsWith("Bonded")).reduce((a, [, v]) => a + v, 0); // A cadet who walks in and either dies or bonds. Deliberate deaths are left out: a rider burned at a bonding
const dead = Object.entries(r.meta.outcomes).filter(([k]) => k.startsWith("Incinerated") || k.startsWith("Died")).reduce((a, [, v]) => a + v, 0); // encounter they did not genuinely attempt (they were after another colour and planned to seek Malek). Runs with
// no recorded outcome are left out too. Same rule the solver uses for encounter odds (ThreshSolver.genuineAttempt).
const S = window.ThreshSolver;
const ended = state.runs.filter((x) => ["Bonded", "Incinerated", "Died before the hour"].includes(x.outcome));
const deliberate = (x) => { if (x.outcome !== "Incinerated" || !S) return false; const v = S.prepareRun(x); return !!v.encCtx && !S.genuineAttempt(x, v.encCtx); };
const cadets = ended.filter((x) => !deliberate(x));
const nDeliberate = ended.length - cadets.length;
const bonded = cadets.filter((x) => x.outcome === "Bonded").length;
const dead = cadets.length - bonded;
const earlyDeaths = cadets.filter((x) => x.outcome === "Died before the hour").length;
const cards = [ const cards = [
// "become a rider" = the run ended bonded to a dragon (reaching the hour alive is not the same thing) { c: "--accent", big: pct(bonded / cadets.length), what: "become a rider", how: `${bonded.toLocaleString()} of ${cadets.length.toLocaleString()} cadets bonded a dragon. ${pct(1 - earlyDeaths / cadets.length)} made it to the tree-or-valley choice alive.`, w: { k: bonded, n: cadets.length } },
{ c: "--accent", big: pct(bonded / r.n), what: "become a rider", how: `${bonded.toLocaleString()} of ${r.n.toLocaleString()} logged runs ended bonded to a dragon. ${pct(reach.p)} made it to the tree-or-valley choice alive; most of the rest were burned at the encounter.`, w: { k: bonded, n: r.n } }, { c: "--death", big: dead.toLocaleString(), what: "riders sent to Malek", how: `${pct(dead / cadets.length)} of cadets were burned or killed. Deliberate deaths (${nDeliberate.toLocaleString()} runs where the rider chose to die and try again) are not counted.`, w: { k: dead, n: cadets.length }, death: true },
{ c: "--death", big: dead.toLocaleString(), what: "riders sent to Malek", how: `${pct(dead / r.n)} of logged runs ended in fire or worse. Most were riders dying on purpose to try again.`, w: { k: dead, n: r.n }, death: true },
]; ];
$("#odds").innerHTML = cards.map((c) => `<div class="odd${c.death ? " death deco" : ""}" style="--c: var(${c.c})"><span class="big">${esc(c.big)}</span><span class="what">${esc(c.what)}</span>${dots(c.w.k, c.w.n, cssVar(c.c))}${tag(c.how)}</div>`).join(""); $("#odds").innerHTML = cards.map((c) => `<div class="odd${c.death ? " death deco" : ""}" style="--c: var(${c.c})"><span class="big">${esc(c.big)}</span><span class="what">${esc(c.what)}</span>${dots(c.w.k, c.w.n, cssVar(c.c))}${tag(c.how)}</div>`).join("");
getPolicy().then(renderColourOdds); getPolicy().then(renderColourOdds);