diff --git a/CLAUDE.md b/CLAUDE.md index 581bf68..e9f1a65 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -136,6 +136,10 @@ Three-layer split; `JCA` is the single global namespace: - Unknown joker keys (from other mods) must keep scoring 0 — never index `JCA.db[key]` without a nil guard. - Display names go through `localize{type='name_text', set='Joker', ...}` with a - pcall + `center.name` fallback; anti-synergies are deliberately not modeled. + pcall + `center.name` fallback. +- Anti-synergies never affect scores. Known traps are warning-only data: + `CLASHES` (pairwise, red "Clashes -" tooltip line vs owned jokers) and + `CAUTIONS` (per-joker, buy-area "Caution:" line) in `synergies.lua`, same + ~34-char blurb budget as `PAIRS`. Learning mode keeps warnings visible. - The UI hooks are the only untested-in-game surface; if a tooltip regression is reported, suspect the `aut.info` entry format first and check the lovely log. diff --git a/main.lua b/main.lua index 07b4afb..c0e0bc4 100644 --- a/main.lua +++ b/main.lua @@ -36,6 +36,13 @@ for _, p in ipairs(data.pairs) do JCA.pair_blurb[pair_key(p[1], p[2])] = p[3] end +-- Known traps: warning-only, never part of the synergy score. +JCA.clash_blurb = {} +for _, p in ipairs(data.clashes or {}) do + JCA.clash_blurb[pair_key(p[1], p[2])] = p[3] +end +JCA.cautions = data.cautions or {} + -- Scoring ------------------------------------------------------------------- -- Synergy score between two joker center keys. 0 = no known synergy. @@ -205,6 +212,7 @@ end local function tooltip_rows(card) -- Touch mode enlarges every advice row for phone screens (see config.lua). local S = JCA.config.touch_mode and 1.4 or 1 + local key = card.config.center.key local partners, total = JCA.partners_for(card) local rows = {} @@ -239,7 +247,6 @@ local function tooltip_rows(card) else text_row('Active combos with:') end - local key = card.config.center.key local shown = math.min(3, #partners) for i = 1, shown do local p = partners[i] @@ -263,6 +270,26 @@ local function tooltip_rows(card) text_row('Strong pick for this build!', G.C.GREEN) end end + -- Anti-synergy warnings: known traps against the board you keep. These + -- never touch the score (learning mode keeps them too — they teach). + if G.jokers and G.jokers.cards then + for _, owned in ipairs(G.jokers.cards) do + if owned ~= card and owned.config.center.set == 'Joker' then + local warn = JCA.clash_blurb[pair_key(key, owned.config.center.key)] + if warn then + rows[#rows + 1] = { + {n = G.UIT.T, config = { + text = 'Clashes - ' .. name_of(owned.config.center.key) .. ': ', + colour = G.C.RED, scale = 0.3 * S}}, + {n = G.UIT.T, config = {text = warn, + colour = G.C.UI.TEXT_DARK, scale = 0.3 * S}}, + } + end + end + end + end + local caution = in_buy_area(card) and JCA.cautions[key] + if caution then text_row('Caution: ' .. caution, G.C.RED) end rows.name = 'Combo Advisor' return rows end diff --git a/synergies.lua b/synergies.lua index 95d731d..eb8a76e 100644 --- a/synergies.lua +++ b/synergies.lua @@ -214,6 +214,25 @@ local PAIRS = { {'j_oops', 'j_lucky_cat', 'better odds, more Lucky payoffs'}, } +-- Known traps: pairs that actively hurt each other. Warning-only — they +-- never subtract from the synergy score; the tooltip just flags them with +-- a red "Clashes" line. Keep warnings under ~34 chars (one tooltip row). +local CLASHES = { + {'j_ride_the_bus', 'j_pareidolia', 'every card counts as a face'}, + {'j_vampire', 'j_steel_joker', 'drains the Steel it counts'}, + {'j_vampire', 'j_lucky_cat', 'strips Lucky cards before they pay'}, + {'j_smeared', 'j_flower_pot', 'merged suits cannot make all four'}, +} + +-- Per-joker cautions for the buy-area tooltip: the joker is fine on its +-- own, but it interacts badly with a board you want to keep. Same length +-- budget as clash warnings. +local CAUTIONS = { + j_ceremonial = 'eats the joker to its right', + j_madness = 'destroys a random joker each blind', + j_stencil = 'xMult grows with EMPTY joker slots', +} + -- How to phrase a tag link in the tooltip, from the partner's perspective: -- `give` when the partner provides the tag, `want` when the partner consumes -- it, `both` for cluster tags where the pair simply shares the theme. @@ -307,5 +326,5 @@ for _, entry in pairs(J) do entry.gives, entry.wants = g, w end -return { jokers = J, pairs = PAIRS, tag_text = TAG_TEXT, tag_order = TAG_ORDER, - theme_info = THEME_INFO } +return { jokers = J, pairs = PAIRS, clashes = CLASHES, cautions = CAUTIONS, + tag_text = TAG_TEXT, tag_order = TAG_ORDER, theme_info = THEME_INFO }