Warn about perishable scalers and rental money jokers at buy time

Per-instance sticker cautions, unlike the per-joker CAUTIONS table: the
same joker is a fine buy without the sticker. Perishable debuffs a joker
for good after 5 rounds (Card:calculate_perishable, card.lua:2652), so a
perishable Ride the Bus or Hologram is investment about to be wiped --
the new SCALERS set in synergies.lua lists the jokers whose stored gains
die that way, excluding computed (Bull) and round-scoped (Hit the Road)
values and Egg, whose sell value survives a debuff. Rental charges
every round (card.lua:2647), which can eat a money joker's whole payout.

The scaler-key integrity test caught j_canio for j_caino on the first
run -- the misspelled vanilla keys strike again.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-07-15 19:44:32 -07:00
parent f88b034970
commit 048ab40f85
3 changed files with 69 additions and 0 deletions
+24
View File
@@ -13,6 +13,7 @@ end
local data = assert(SMODS.load_file('synergies.lua'))()
JCA.db = data.jokers
JCA.scalers = data.scalers
-- Settings from config.lua, persisted by Steamodded across sessions.
-- Fallback defaults keep the engine usable outside the game (tests).
@@ -331,6 +332,24 @@ function JCA.is_rental(card)
return not not (card.ability and card.ability.rental)
end
-- Sticker traps on a specific shop card, as caution strings. Per-instance,
-- unlike JCA.cautions (which warns about the joker itself): the same joker is
-- a fine buy without the sticker. Perishable debuffs for good after
-- G.GAME.perishable_rounds (card.lua:2652); rental charges rental_rate ($3)
-- every round (card.lua:2647), which can eat a money joker's whole payout.
function JCA.sticker_cautions(card)
local out = {}
local key = card.config and card.config.center and card.config.center.key
local a = card.ability or {}
if a.perishable and key and JCA.scalers[key] then
out[#out + 1] = 'perishable: gains die in 5 rounds'
end
if a.rental and key and JCA.db[key] and JCA.db[key].gives.money then
out[#out + 1] = 'rental: rent may eat its payout'
end
return out
end
function JCA.is_perished(card)
local a = card.ability
return not not (a and a.perishable and (a.perish_tally or 0) <= 0)
@@ -732,6 +751,11 @@ local function tooltip_rows(card)
end
local caution = in_buy_area(card) and JCA.cautions[key]
if caution then text_row('Caution: ' .. caution, G.C.RED) end
if in_buy_area(card) then
for _, warn in ipairs(JCA.sticker_cautions(card)) do
text_row('Caution: ' .. warn, G.C.RED)
end
end
-- Copiers in the shop: a purchase always lands rightmost (see
-- copy_source_if_bought), so say what THIS board hands the copier the