Put the known traps in the catalog, as an open book
A Traps tab joins the synergy catalog: clash duos rendered like the Combos tab, then the per-joker cautions, one pager spanning both page kinds. Deliberately no discovery gating and no Progress entry -- the Combos tab hides pairs to keep the fun of finding them, but a warning locked behind fielding the bad pair would reward exactly what it warns against. register_clash now maintains JCA.clash_list alongside the blurb map so third-party clashes appear on the tab, re-registration updates without duplicating, and blurbs are read back through clash_blurb at build time so the newest wording always wins. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -716,6 +716,15 @@ ok(JCA.score('j_mod_test', 'j_dusk') >= 2, 'a registered joker scores against va
|
||||
local before = JCA.score('j_mod_test', 'j_baron')
|
||||
JCA.register_pair('j_mod_test', 'j_baron', 'test blurb')
|
||||
eq(JCA.score('j_mod_test', 'j_baron') - before, 4, 'JCA.register_pair adds the +4 pair bonus')
|
||||
|
||||
-- register_clash must feed the Traps tab too: the list gains the entry once,
|
||||
-- and a re-registration updates the blurb without duplicating it.
|
||||
local clashes_before = #JCA.clash_list
|
||||
JCA.register_clash('j_mod_test', 'j_baron', 'test warning')
|
||||
eq(#JCA.clash_list, clashes_before + 1, 'JCA.register_clash lands in the traps list')
|
||||
JCA.register_clash('j_mod_test', 'j_baron', 'updated warning')
|
||||
eq(#JCA.clash_list, clashes_before + 1, 're-registering a clash does not duplicate it')
|
||||
ok(JCA._traps_dirty, 'and marks the traps tab for a re-sort')
|
||||
JCA.db.j_mod_test = nil -- keep the UI section on vanilla data only
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
@@ -787,12 +796,22 @@ G.OVERLAY_MENU = {get_UIE_by_ID = function()
|
||||
return {config = {object = {remove = function() end}},
|
||||
UIBox = {recalculate = function() end}}
|
||||
end}
|
||||
for _, name in ipairs({'Combos', 'Engine', 'Economy', 'Hands'}) do
|
||||
for _, name in ipairs({'Combos', 'Engine', 'Economy', 'Hands', 'Traps'}) do
|
||||
build(name .. ' page 2', function()
|
||||
G.FUNCS['jca_page_' .. name]{cycle_config = {current_option = 2}}
|
||||
end)
|
||||
end
|
||||
|
||||
-- The Traps pager spans two page kinds; also build the first CAUTION page
|
||||
-- (the option right after the last clash page) and the very last page.
|
||||
local first_caution = math.ceil(#JCA.clash_list / 6) + 1
|
||||
build('Traps first caution page', function()
|
||||
G.FUNCS.jca_page_Traps{cycle_config = {current_option = first_caution}}
|
||||
end)
|
||||
build('Traps last page', function()
|
||||
G.FUNCS.jca_page_Traps{cycle_config = {current_option = 999}}
|
||||
end)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
print(('\n%d passed, %d failed'):format(pass, fail))
|
||||
os.exit(fail == 0 and 0 or 1)
|
||||
|
||||
Reference in New Issue
Block a user