Game: which dragons each encounter can give; impossible bonds are not counted

A form row recording a Green bonded at the shadow Blue let the "eventually" objective
find a route whose only possible bond was that Green (ratio 1, near-zero chance).
game.yaml now lists the possible bonds per encounter (own colour; the two Greens also
Orange and Brown); anything else is a data-entry error and is not counted.

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-10 02:36:49 +00:00
co-authored by Claude Opus 5.5
parent 64fd3af235
commit 8f1f0383fe
3 changed files with 25 additions and 4 deletions
+8 -2
View File
@@ -158,6 +158,12 @@ def ctx_key(v, names):
# ---------------------------------------------------------------- 2. counts
def can_bond(ctx, colour):
"""Whether a bond with this colour is possible at this encounter (game.yaml `encounters`)."""
e = G["encounters"][ctx]
return colour == "burn" or colour == e["colour"] or colour in (e.get("also") or [])
def count_tables(prepared, weights=None):
"""Counts for every chance event at every back-off level, plus each encounter's outcomes. weights: per run,
{chance event: weight of the outcome it observed} (reporting-bias corrections, core/atlas/bias.py)."""
@@ -187,11 +193,11 @@ def count_tables(prepared, weights=None):
if not v.get("encCtx"):
continue
c = enc.setdefault(v["encCtx"], {"outcomes": {}, "seen": {}})
if v.get("encOutcome"):
if v.get("encOutcome") and can_bond(v["encCtx"], v["encOutcome"]):
c["outcomes"][v["encOutcome"]] = c["outcomes"].get(v["encOutcome"], 0) + 1
# which colours can ever end a run in this context (from all runs, genuine or not)
for v in prepared:
if v.get("encCtx") and v.get("encOutcome") and v["encOutcome"] != "burn":
if v.get("encCtx") and v.get("encOutcome") and v["encOutcome"] != "burn" and can_bond(v["encCtx"], v["encOutcome"]):
enc[v["encCtx"]]["seen"][v["encOutcome"]] = 1
return T