The automaton guards gold only within sight (X2XN stall)

The guard-the-gold rung cast SAFE/GLUE at a floor treasure with no
line-of-sight check; the engine refused the cast and the fallback
burned the bot's whole turn.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Eric Wagoner
2026-08-20 21:21:00 -04:00
co-authored by Claude Fable 5
parent db0eeebcd5
commit e30f3f0903
2 changed files with 58 additions and 3 deletions
+4 -2
View File
@@ -1034,9 +1034,11 @@ function selfCare(view: GameView, style: AutomatonStyle, tier: TierTraits): Comm
const myFloorTreasure = tier.guardGold
? view.treasures.find((t) => t.owner === view.you && t.position && !t.carriedBy)
: undefined;
if (myFloorTreasure && enemyNear) {
// Both spells demand line of sight to the gold; a blind cast would be
// refused and cost the whole turn.
if (myFloorTreasure && enemyNear && sightedCellsFor(view).has(cellKey(myFloorTreasure.position!))) {
const safe = inHand(view, "safe");
if (safe) {
if (safe && !view.squareContents[cellKey(myFloorTreasure.position!)]) {
return { type: "cast", instanceId: safe.instanceId, target: { kind: "cell", cell: myFloorTreasure.position! } };
}
const glue = inHand(view, "glue");