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:
@@ -220,6 +220,30 @@ function JCA.copy_source(card)
|
||||
return nil, 'none', chain
|
||||
end
|
||||
|
||||
-- What a copier still IN THE SHOP would copy if bought right now. A purchase
|
||||
-- always lands in the RIGHTMOST slot (buy_from_shop hands the card to
|
||||
-- G.jokers:emplace, button_callbacks.lua:2279, and emplace appends,
|
||||
-- cardarea.lua:53) -- so a bought Blueprint arrives with no right-hand
|
||||
-- neighbour and copies nothing until the player reorders, while a bought
|
||||
-- Brainstorm reads the leftmost joker the moment it lands. Same returns as
|
||||
-- copy_source; a leftmost joker that is itself a copier is followed through
|
||||
-- copy_source so the chain resolves to the joker actually copied.
|
||||
function JCA.copy_source_if_bought(key)
|
||||
if not (COPIERS[key] and G.jokers and G.jokers.cards) then return nil, 'none', {} end
|
||||
if COPIERS[key] == 'right' then return nil, 'none', {} end
|
||||
local target = G.jokers.cards[1]
|
||||
local center = target and target.config and target.config.center
|
||||
if not center then return nil, 'none', {} end
|
||||
if COPIERS[center.key] then
|
||||
local final, status, chain = JCA.copy_source(target)
|
||||
table.insert(chain, 1, target)
|
||||
return final, status, chain
|
||||
end
|
||||
if not center.blueprint_compat then return target, 'incompatible', {} end
|
||||
if target.debuff then return target, 'debuffed', {} end
|
||||
return target, 'ok', {}
|
||||
end
|
||||
|
||||
-- Ceremonial Dagger is positional too, and it is the dangerous one: when the
|
||||
-- blind is selected it DESTROYS the joker to its right and eats twice its sell
|
||||
-- value as Mult (card.lua:2945). The card text says so; what it cannot tell you
|
||||
@@ -633,6 +657,42 @@ local function tooltip_rows(card)
|
||||
local caution = in_buy_area(card) and JCA.cautions[key]
|
||||
if caution then text_row('Caution: ' .. caution, G.C.RED) end
|
||||
|
||||
-- Copiers in the shop: a purchase always lands rightmost (see
|
||||
-- copy_source_if_bought), so say what THIS board hands the copier the
|
||||
-- moment it arrives -- by name, before the player pays. Explanations,
|
||||
-- not verdicts, so learning mode keeps them.
|
||||
if in_buy_area(card) and COPIERS[key] then
|
||||
if key == 'j_blueprint' then
|
||||
-- The caution above already says a rightmost Blueprint is dead;
|
||||
-- add the one thing it cannot know: which joker to slot it against.
|
||||
local best = JCA.best_copy_target(card)
|
||||
if best then
|
||||
text_row('Fix after buying: slot it just left of '
|
||||
.. name_of(best.config.center.key), G.C.GREEN)
|
||||
end
|
||||
else
|
||||
local target, status, chain = JCA.copy_source_if_bought(key)
|
||||
local via = ''
|
||||
for _, link in ipairs(chain) do
|
||||
via = via .. name_of(link.config.center.key) .. ' -> '
|
||||
end
|
||||
local tname = target and name_of(target.config.center.key)
|
||||
if status == 'ok' then
|
||||
text_row('Will copy ' .. via .. tname .. ' as soon as it lands', G.C.GREEN)
|
||||
elseif status == 'incompatible' then
|
||||
text_row('Will copy ' .. via .. tname .. ' - which cannot be copied', G.C.RED)
|
||||
elseif status == 'debuffed' then
|
||||
text_row('Will copy ' .. via .. tname .. ' - debuffed, so nothing', G.C.RED)
|
||||
else
|
||||
local best = JCA.best_copy_target(card)
|
||||
text_row(best
|
||||
and ('Will copy nothing - make ' .. name_of(best.config.center.key)
|
||||
.. ' your leftmost joker first')
|
||||
or 'Will copy nothing - no copyable joker on your board', G.C.RED)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Run context: this deck, these hand levels. Facts that frame the tags,
|
||||
-- never part of the score; capped at two lines so multi-suit jokers do
|
||||
-- not flood the tooltip. Fixed iteration order keeps hovers stable.
|
||||
|
||||
Reference in New Issue
Block a user