Answer for shop copiers before the player pays
A purchase always lands in the rightmost slot (buy_from_shop emplaces at the end, button_callbacks.lua:2279), which the two copiers experience in opposite ways: a bought Blueprint arrives copying nothing, a bought Brainstorm copies the leftmost joker immediately. The buy-area tooltip now says which, by name — JCA.copy_source_if_bought resolves the arrival target (chaining through a leftmost copier exactly like copy_source), and Blueprint's line names the joker to slot it against after buying. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -352,6 +352,38 @@ 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 copier still in the SHOP is positional before it is even bought: a purchase
|
||||
-- always lands in the rightmost slot (buy_from_shop emplaces at the end,
|
||||
-- button_callbacks.lua:2279), so a bought Blueprint starts dead while a bought
|
||||
-- Brainstorm reads the leftmost joker immediately.
|
||||
field('j_baron', 'j_mime')
|
||||
eq(JCA.copy_source_if_bought('j_blueprint'), nil,
|
||||
'a bought Blueprint arrives rightmost, copying nothing')
|
||||
eq(select(2, JCA.copy_source_if_bought('j_blueprint')), 'none',
|
||||
'and reports the empty slot, not an error')
|
||||
|
||||
local arrival = field('j_baron', 'j_mime')
|
||||
arrival[1].config.center.blueprint_compat = true
|
||||
local bought, bought_status = JCA.copy_source_if_bought('j_brainstorm')
|
||||
eq(bought, arrival[1], 'a bought Brainstorm copies the leftmost joker on arrival')
|
||||
eq(bought_status, 'ok', 'and reports it as live')
|
||||
|
||||
-- The leftmost joker being a copier chains exactly like an owned Brainstorm:
|
||||
-- the answer is the joker at the end, and the walked copier is recorded.
|
||||
local shop_chain = field('j_blueprint', 'j_baron')
|
||||
for _, c in ipairs(shop_chain) do c.config.center.blueprint_compat = true end
|
||||
local final_b, st_b, via_b = JCA.copy_source_if_bought('j_brainstorm')
|
||||
eq(final_b, shop_chain[2], 'a leftmost Blueprint chains to the joker it copies')
|
||||
eq(st_b, 'ok', 'and reports it as live')
|
||||
eq(#via_b, 1, 'and records the copier walked through')
|
||||
eq(via_b[1], shop_chain[1], 'which is the leftmost Blueprint')
|
||||
|
||||
field('j_baron', 'j_mime')
|
||||
G.jokers.cards = {}
|
||||
eq(JCA.copy_source_if_bought('j_brainstorm'), nil,
|
||||
'an empty board gives a bought Brainstorm nothing to copy')
|
||||
eq(JCA.copy_source_if_bought('j_baron'), nil, 'a non-copier has no arrival answer')
|
||||
|
||||
-- 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.
|
||||
|
||||
Reference in New Issue
Block a user