Point a dead copier at its fix: name the best target one reorder away
JCA.best_copy_target scans the board for copyable jokers (same truth test as copy_source: blueprint_compat must be true, debuffed excluded, other copiers excluded) and prefers the ones the database marks copy_target. When a Blueprint or Brainstorm reports anything but 'ok', the tooltip now adds the reorder that revives it: 'Fix: slot this just left of Baron' / 'Fix: make Baron your leftmost joker'. Explanation, not verdict, so learning mode keeps it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -339,6 +339,30 @@ local ring = field('j_brainstorm', 'j_blueprint')
|
||||
for _, c in ipairs(ring) do c.config.center.blueprint_compat = true end
|
||||
eq(JCA.copy_source(ring[2]), nil, 'a Blueprint/Brainstorm ring resolves to nothing')
|
||||
|
||||
-- A dead copier's fix is a reorder, so the advisor names the best target on
|
||||
-- the board: copyable (blueprint_compat for TRUTH, not debuffed, not another
|
||||
-- copier), preferring jokers the db marks as prime copy targets.
|
||||
field('j_hiker', 'j_baron', 'j_blueprint')
|
||||
for _, c in ipairs(G.jokers.cards) do c.config.center.blueprint_compat = true end
|
||||
local best, prime = JCA.best_copy_target(G.jokers.cards[3])
|
||||
eq(best, G.jokers.cards[2], 'the prime copy target (Baron) beats a plain joker')
|
||||
eq(prime, true, 'and is reported as prime')
|
||||
|
||||
-- With no prime target, the leftmost copyable joker wins; copiers and
|
||||
-- uncopyable jokers never get suggested.
|
||||
field('j_blueprint', 'j_hiker', 'j_splash')
|
||||
G.jokers.cards[2].config.center.blueprint_compat = true
|
||||
best, prime = JCA.best_copy_target(G.jokers.cards[1])
|
||||
eq(best, G.jokers.cards[2], 'falls back to the leftmost copyable joker')
|
||||
eq(prime, false, 'which is not prime')
|
||||
|
||||
-- A debuffed joker is never the suggestion: it copies as nothing.
|
||||
field('j_blueprint', 'j_baron')
|
||||
G.jokers.cards[2].config.center.blueprint_compat = true
|
||||
G.jokers.cards[2].debuff = true
|
||||
eq(JCA.best_copy_target(G.jokers.cards[1]), nil,
|
||||
'a debuffed joker is not suggested as a copy target')
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
section('Engine: the sell advisor respects what you can actually sell')
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user