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:
funman300
2026-07-14 15:05:02 -07:00
parent a2d16ae12f
commit 21995589df
3 changed files with 99 additions and 0 deletions
+7
View File
@@ -135,6 +135,13 @@ Three-layer split; `JCA` is the single global namespace:
nothing. Do not rebuild the neighbour lookup with the `a and b or c` idiom:
for a rightmost Blueprint the right-hand slot is nil and the idiom falls
through to the leftmost joker, confidently reporting the wrong card.
Shop copiers get the same treatment *before* purchase via
`JCA.copy_source_if_bought(key)`: a purchase always lands in the
**rightmost** slot (`buy_from_shop``G.jokers:emplace`,
`button_callbacks.lua:2279`; emplace appends, `cardarea.lua:53`), so a
bought Blueprint starts dead (buy-area tooltip names the joker to slot it
against) while a bought Brainstorm copies the leftmost joker immediately
(tooltip says which, chaining through a leftmost copier like copy_source).
- `JCA.is_eternal(card)` reads `card.ability.eternal` — the flag vanilla itself
uses for the badge (`card.lua:1141`). **Never call `SMODS.is_eternal()` from
an advisor path**: it runs a full `SMODS.calculate_context` per call