Add a test suite, and fix the three dead-data bugs it found

There was no test file -- CLAUDE.md described the harness in prose and
referred to an "orphan-tag check" that did not exist. test.lua now stubs
the game globals and exercises the real engine, database and catalog tab
builders. It found three bugs on its first run:

* four_kind was the only theme in the catalog that could never be
  discovered. Theme discovery needs a giver and a wanter on two DIFFERENT
  fielded jokers, and The Family was its sole member -- so the Hands bar
  and the overall Progress bar could never reach 100%. DNA is the real
  enabler (copying a card is how you stack duplicate ranks, the only
  vanilla route to a reliable Four of a Kind), so it now gives the
  matching-hand tags as a pure enabler.

* hand_level was given by Space Joker and Burnt Joker and wanted by
  nobody, so it could never contribute to a score and its "want" tooltip
  text was unreachable. Nothing in vanilla rewards hand levels; the tag
  is dropped rather than faked.

* Invisible Joker had no tags at all, so it scored 0 against the entire
  game. Selling it duplicates one of your Jokers -- the same "stronger
  target, better payoff" logic Blueprint and Brainstorm already model --
  so it now wants copy_target.

The suite guards both directions of the tag contract (no orphan wants, no
dead gives), theme reachability, blurb widths, the inert-joker list, and
the card materialize fix from the previous commit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
funman300
2026-07-14 11:15:10 -07:00
parent f8bba13f28
commit 07cada9e49
4 changed files with 447 additions and 36 deletions
+10 -6
View File
@@ -114,7 +114,7 @@ j('j_fibonacci', {'mult'}, {'retrig_scoring'})
j('j_steel_joker', {'xmult'})
j('j_hack', {'retrig_scoring'})
j('j_pareidolia', {'faces'})
j('j_space', {'hand_level'}, {'probability'})
j('j_space', {}, {'probability'})
j('j_burglar', {'hands_up'})
j('j_blackboard', {'xmult'}, {'spades','clubs'})
j('j_sixth_sense', {'spectral_gen'}, {'spectral_gen'})
@@ -127,9 +127,12 @@ j('j_vampire', {'xmult'}, {'enhance_gen'})
j('j_hologram', {'xmult','copy_target'}, {'card_gen'})
j('j_cartomancer', {'tarot_gen'})
j('j_astronomer', {'planet'}, {'planet'})
j('j_burnt', {'hand_level'}, {'discards_up'})
j('j_burnt', {}, {'discards_up'})
j('j_bootstraps', {'mult'}, {'money'})
j('j_dna', {'card_gen'})
-- DNA copies a played card into the deck, which is how you stack duplicate
-- ranks -- the only vanilla route to a reliable Four of a Kind. Pure enabler:
-- it gives the matching-hand tags without wanting them.
j('j_dna', {'card_gen','pair','three_kind','four_kind'})
j('j_midas_mask', {'gold_gen','enhance_gen'}, {'faces'})
j('j_photograph', {'xmult','copy_target'}, {'faces','retrig_scoring'})
j('j_stone', {'chips'}, {'stone_gen'})
@@ -176,7 +179,9 @@ j('j_family', {'xmult','four_kind'}, {'four_kind'})
j('j_order', {'xmult','straight'}, {'straight'})
j('j_tribe', {'xmult','flush'}, {'flush'})
j('j_stuntman', {'chips'})
j('j_invisible', {})
-- Sell Invisible Joker to duplicate one of your Jokers: the same "the stronger
-- the target, the better" logic as Blueprint and Brainstorm.
j('j_invisible', {}, {'copy_target'})
j('j_blueprint', {}, {'copy_target'})
j('j_brainstorm', {}, {'copy_target'})
j('j_drivers_license', {'xmult'}, {'enhance_gen'})
@@ -258,7 +263,6 @@ local TAG_TEXT = {
discards_up = {give = 'grants extra discards', want = 'feeds on discards'},
probability = {give = 'improves listed odds', want = 'relies on listed odds'},
money = {give = 'earns money', want = 'scales with your money'},
hand_level = {give = 'levels up poker hands', want = 'rewards hand levels'},
tarot_gen = {give = 'creates Tarot cards', want = 'rewards Tarot use'},
planet = {both = 'shares the Planet economy'},
spectral_gen = {both = 'shares the Spectral theme'},
@@ -288,7 +292,7 @@ local TAG_ORDER = {
'retrig_held', 'retrig_scoring', 'faces',
'gold_gen', 'stone_gen', 'enhance_gen', 'card_gen',
'tarot_gen', 'spectral_gen', 'planet',
'probability', 'discards_up', 'hands_up', 'hand_size', 'hand_level',
'probability', 'discards_up', 'hands_up', 'hand_size',
'money', 'sell_value', 'joker_gen',
'hearts', 'diamonds', 'spades', 'clubs',
'pair', 'two_pair', 'three_kind', 'four_kind', 'straight', 'flush',