Warn when the upcoming boss will silence the joker on sale

Five bosses debuff a whole card class for the fight (game.lua P_BLINDS,
applied in Blind:debuff_card blind.lua:708): The Club/Goad/Head/Window
kill a suit, The Plant kills faces. A debuffed card scores nothing and
triggers nothing, so a shop joker wanting that class is a dead ante --
and one GIVING it is worse: Pareidolia under The Plant converts the
whole deck into debuffed faces, so givers warn too. JCA.upcoming_boss
reads G.GAME.round_resets and goes quiet once the boss is defeated.
Warning-only, never a score change, kept in learning mode.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-07-14 13:46:18 -07:00
parent ea8faac434
commit 445171dc0b
2 changed files with 68 additions and 0 deletions
+39
View File
@@ -309,6 +309,32 @@ function JCA.is_perished(card)
return not not (a and a.perishable and (a.perish_tally or 0) <= 0)
end
-- Boss-blind cautions: five bosses debuff a whole class of cards for the
-- fight (game.lua P_BLINDS; applied in Blind:debuff_card, blind.lua:708):
-- The Club/Goad/Head/Window each kill a suit, The Plant kills face cards.
-- A debuffed card scores nothing and triggers nothing, so a joker that wants
-- that class is walking into a dead ante -- and a joker that GIVES it is
-- worse (Pareidolia under The Plant makes every card a debuffed face).
-- Warning-only, like every trap: this never touches a score.
local BOSS_KILLS = {
bl_club = {tag = 'clubs', what = 'Clubs'},
bl_goad = {tag = 'spades', what = 'Spades'},
bl_head = {tag = 'hearts', what = 'Hearts'},
bl_window = {tag = 'diamonds', what = 'Diamonds'},
bl_plant = {tag = 'faces', what = 'face cards'},
}
JCA.boss_kills = BOSS_KILLS
-- The boss still ahead this ante, or nil once it is dealt with. Both fields
-- live in G.GAME.round_resets (game.lua:2019, misc_functions.lua:398).
function JCA.upcoming_boss()
local rr = G.GAME and G.GAME.round_resets
if not (rr and rr.blind_choices) then return nil end
local state = rr.blind_states and rr.blind_states.Boss
if state == 'Defeated' or state == 'Skipped' then return nil end
return rr.blind_choices.Boss
end
function JCA.weakest_link()
if not (G.jokers and G.jokers.cards) then return nil end
local cards = G.jokers.cards
@@ -592,6 +618,19 @@ 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
-- Boss caution: buying a joker whose card class the upcoming boss
-- debuffs is paying for a dead ante. Warnings survive learning mode.
if in_buy_area(card) then
local boss = JCA.upcoming_boss()
local kill = boss and BOSS_KILLS[boss]
local entry = JCA.db[key]
if kill and entry and (entry.wants[kill.tag] or entry.gives[kill.tag]) then
local bname = G.P_BLINDS and G.P_BLINDS[boss] and G.P_BLINDS[boss].name
text_row(('This ante: %s debuffs %s'):format(bname or 'the boss', kill.what),
G.C.RED)
end
end
-- Sticker facts (any area -- higher stakes put stickers on shop jokers
-- too). Mechanical numbers from the game source, not judgements, so
-- learning mode keeps them.