Advise on consumables and packs, not just jokers
A Planet card or Celestial Pack feeds Constellation; Arcana supply feeds Fortune Teller; a Standard Pack permanently adds playing cards, which is what card_gen wanters grow on -- and what shrinks Erosion, so that pack gets a red caution when Erosion is owned (same verified mechanism as its joker clashes, card.lua:4318). The tooltip stays silent when no owned joker cares; Buffoon packs and vouchers are not advice material. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -623,6 +623,41 @@ field('j_jolly')
|
||||
looking = JCA.build_gaps()
|
||||
eq(table.concat(looking, ','), 'pair', 'a lone cluster member still wants its cluster')
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
section('Engine: consumable advice names the fed jokers')
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local function consumable(set, kind)
|
||||
return {config = {center = {set = set, kind = kind, key = 'c_test'}}}
|
||||
end
|
||||
|
||||
field('j_constellation', 'j_fortune_teller', 'j_mod_unknown')
|
||||
|
||||
local fed, tag = JCA.consumable_partners(consumable('Planet'))
|
||||
eq(tag, 'planet', 'a Planet card maps to the planet tag')
|
||||
eq(#fed, 1, 'exactly one owned joker is fed by a Planet card')
|
||||
eq(fed[1].key, 'j_constellation', 'and it is Constellation')
|
||||
|
||||
fed, tag = JCA.consumable_partners(consumable('Booster', 'Celestial'))
|
||||
eq(tag, 'planet', 'a Celestial Pack counts as Planet supply')
|
||||
eq(fed[1].key, 'j_constellation', 'the pack feeds Constellation too')
|
||||
|
||||
fed = JCA.consumable_partners(consumable('Tarot'))
|
||||
eq(fed[1].key, 'j_fortune_teller', 'a Tarot card feeds Fortune Teller')
|
||||
|
||||
-- Advice material with nobody home: tag resolves, list stays empty.
|
||||
fed, tag = JCA.consumable_partners(consumable('Spectral'))
|
||||
eq(tag, 'spectral_gen', 'a Spectral card still resolves its tag')
|
||||
eq(#fed, 0, 'but feeds nobody on this board')
|
||||
|
||||
-- A Standard Pack is card supply; a Buffoon Pack is not advice material.
|
||||
fed, tag = JCA.consumable_partners(consumable('Booster', 'Standard'))
|
||||
eq(tag, 'card_gen', 'a Standard Pack maps to card_gen')
|
||||
eq(JCA.consumable_partners(consumable('Booster', 'Buffoon')), nil,
|
||||
'a Buffoon Pack yields no consumable advice')
|
||||
eq(JCA.consumable_partners({config = {center = {set = 'Voucher'}}}), nil,
|
||||
'a Voucher yields no consumable advice')
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
section('Data: themes are reachable')
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user