Recap the run's high-water mark: peak board synergy

JCA.board_synergy sums every owned pair once; the emplace hook that
already drives discovery keeps the maximum in G.GAME.jca_peak_synergy
(it can only rise when a joker arrives). The post-run recap shows it,
now also on runs that fielded no famous pair.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-07-14 13:48:47 -07:00
parent f73507f5c6
commit 2b43d24994
2 changed files with 68 additions and 14 deletions
+22
View File
@@ -415,6 +415,28 @@ per[2].ability = {perishable = true, perish_tally = 0}
eq(JCA.weakest_link(), per[2],
'but a perished joker is the cut at any score - it will never work again')
--------------------------------------------------------------------------------
section('Engine: board synergy total and its run peak')
--------------------------------------------------------------------------------
-- Every owned pair scored once: Baron+Mime is the famous 6, the plain Joker
-- adds only its generic +1 against Baron's xMult.
field('j_baron', 'j_mime', 'j_joker')
eq(JCA.board_synergy(), 7, 'board synergy sums every owned pair once')
-- The peak rides the same emplace hook as discovery, and never goes down.
-- Discovery state is snapshotted so this cannot leak into the UI tests.
local saved_disc, saved_themes = JCA.config.discovered, JCA.config.themes_found
JCA.config.discovered, JCA.config.themes_found = {}, {}
G.GAME = {}
JCA.check_discoveries()
eq(G.GAME.jca_peak_synergy, 7, 'the emplace hook records the high-water mark')
field('j_joker')
JCA.check_discoveries()
eq(G.GAME.jca_peak_synergy, 7, 'selling down does not lower the recorded peak')
G.GAME = {}
JCA.config.discovered, JCA.config.themes_found = saved_disc, saved_themes
--------------------------------------------------------------------------------
section('Engine: deck context counts base suits')
--------------------------------------------------------------------------------