Files
cardgen/tools/live-build/generate_remaining_live_decks.py
T

239 lines
76 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import json
from pathlib import Path
BASE = Path('/home/prime/.openclaw/workspace/cardgen')
RARITY = {'arch1':'Rare','arch2':'Epic','arch3':'Legendary','common':'Common','uncommon':'Uncommon','rare':'Rare','epic':'Epic','legendary':'Legendary'}
def fixed(n): return {'Fixed': n}
def count(n=1, all=False): return {'All': True} if all else {'N': n}
def target(type_, ownership, scope='Battlefield', n=1, all=False, filters=None):
t={'Type':type_,'Ownership':ownership,'Scope':scope,'Count':count(n,all)}
if filters: t['Filters']=filters
return t
def action(target_, effects, conditions=None, duration=None):
d={'Target':target_,'Effects':effects}
if conditions: d['Conditions']=conditions
if duration: d['Duration']=duration
return d
def dur_turn(): return {'Type':'UntilEndOfTurn'}
def trig(type_, **kwargs): d={'$type':type_}; d.update(kwargs); return d
def cond_aff(aff, subject='Target'): return {'$type':'IsOnTileWithAffinity','Subject':subject,'Affinity':aff}
def mod(stat, amt, stat_target=None):
d={'$type':f'Modify{stat}','Amount':fixed(amt)}
if stat_target: d['StatTarget']=stat_target
return d
def setflag(flag, value): return {'$type':f'Set{flag}','Value':value}
def ability(name, type_, desc, actions, **kwargs):
d={'Name':name,'Type':type_,'Description':desc,'Actions':actions}
d.update(kwargs)
return d
def unit(name, desc, affinity, sp, st, hp, df, dmg, move_type, mp, atk_min, atk_max, genus, rarity, abilities, card_type='Spirit', tier=None, prev=None, min_channel=None, max_channel=None, requires_los=False):
card={
'name':name,'description':desc,'cardType':card_type,'affinity':affinity,
'spCost':sp,'stCost':st,'maxHealth':hp,'maxDefense':df,'damage':dmg,
'movementType':move_type,'movementPoints':mp,'minAttackRange':atk_min,'maxAttackRange':atk_max,
'attackType':'Ranged' if atk_max>1 else 'Melee','requiresLos':requires_los,
'canAttack':True,'canDefend':True,'canBeAttacked':True,'canBeBlocked':True,
'canMove':True,'canBeObstructed':True,'canUseAbility':True,'canBeSacrificed':card_type=='Spirit',
'genus':genus,'rarity':rarity,'abilitiesJson':abilities
}
if tier is not None: card['tier']=tier
if prev is not None: card['previousTierName']=prev
if min_channel is not None: card['minChannelRange']=min_channel
if max_channel is not None: card['maxChannelRange']=max_channel
return card
def spell(name, desc, affinity, sp, rarity, effects, card_type):
return {'name':name,'description':desc,'cardType':card_type,'affinity':affinity,'spCost':sp,'stCost':0,'rarity':rarity,'effectsJson':effects}
def ruin(name, desc, affinity, sp, rarity, abilities):
return {'name':name,'description':desc,'cardType':'Ruin','affinity':affinity,'spCost':sp,'stCost':0,'rarity':rarity,'abilitiesJson':abilities}
def terr(name, desc, affinity, mode, sp, rarity='Common'):
tiles = 1 if mode=='Mono' else 2 if mode=='Di' else 3
return {'name':name,'description':desc,'cardType':'Terramorpha','affinity':affinity,'spCost':sp,'stCost':0,'terramorphaMode':mode,'rarity':rarity,
'effectsJson':[action(target('Tile','Any',n=tiles), [{'$type':'PushAffinity','Affinity':fixed(affinity)}])]}
def passive_affs(name, affs, effects, desc, spirit_only=False):
ttype = 'Spirit' if spirit_only else 'Unit'
return ability(name,'Passive',desc,[action(target(ttype,'Owner',all=True),effects,[cond_aff(a)]) for a in affs])
def write_json(name, data):
(BASE/name).write_text(json.dumps(data, indent=2))
# ---------- Amberthrone ----------
def amber():
cards=[]
cards += [
unit('Brakka, Ditchborn Mootspeaker','An orc reeve in patched grain-war mail stands atop a roadside grain ditch between ripe wheat and a levy embankment beneath a hard gold sky.','Plains',10,0,8,2,1,'Walk',2,1,1,['Orc','Leader'],RARITY['arch1'],[
passive_affs('Bread Before Blood',['Field','Hill','Plains'],[mod('Defense',1,'Max')],'Friendly units on Field, Hill, or Plains gain +1 Defense.'),
ability('Open the Granary','Active','Target friendly unit gains +1 Damage and can use abilities until end of turn.',[action(target('Unit','Owner'),[mod('Damage',1), setflag('CanUseAbility',True)],duration=dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':1}],Range={'Min':1,'Max':3},UsesPerTurn=1),
ability('Public Witness','Triggered','When a friendly Spirit enters the battlefield on Plains, gain 1 SP.',[action(target('Player','Owner',scope='Player'), [{'$type':'ModifySP','Amount':fixed(1)}])],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Spirit',Ownership='Owner'),ActivationConditions=[cond_aff('Plains')])
],card_type='ArchSpirit',tier=1,min_channel=1,max_channel=3),
unit('Brakka, Shield of Blackfurrow','Brakka plants a shovel-headed war standard before a common granary while gray stormclouds gather over the road and villagers brace behind fieldworks.','Plains',6,1,10,3,2,'Walk',2,1,2,['Orc','Leader'],RARITY['arch2'],[
passive_affs('Shared Stores, Shared Steel',['Plains'],[mod('Damage',1)],'Friendly Spirits on Plains gain +1 Damage.', spirit_only=True),
ability('Moot Order','Active','Target enemy loses CanMove until end of turn. If it is on Plains, it also loses CanAttack until end of turn.',[action(target('Unit','Enemy'),[setflag('CanMove',False)],duration=dur_turn()),action(target('Unit','Target'),[setflag('CanAttack',False)],[cond_aff('Plains')],dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':2}],Range={'Min':1,'Max':4},UsesPerTurn=1),
ability('Feed the Line','Triggered','When another friendly unit enters this aura range, it gains +1 current Defense.',[action(target('Unit','Target'),[mod('Defense',1,'Current')])],AuraRange={'Min':1,'Max':2},TriggerEvent=trig('OnEnterAuraRange',AuraOwnership='Owner',UnitOwnership='Owner'))
],card_type='ArchSpirit',tier=2,prev='Brakka, Ditchborn Mootspeaker',min_channel=1,max_channel=4),
unit('Brakka, Mother of the Open Granary','Ascended Brakka stands in a wind-blown sea of wheat where monastery stone, field ditches, and road markers form a radiant civic circle around her.','Plains',7,2,12,4,3,'Walk',2,1,2,['Orc','Leader'],RARITY['arch3'],[
passive_affs('The Realm Eats Together',['Field','Hill','Plains'],[mod('Damage',1),mod('Health',1,'Max')],'Friendly units on Field, Hill, or Plains gain +1/+1.'),
ability('Declare Common Right','Active','Target tile becomes Plains. Then target friendly unit gains +1 MP this turn.',[action(target('Tile','Any'), [{'$type':'PushFinalAffinity','Affinity':fixed('Plains')}]),action(target('Unit','Owner'), [mod('MP',1,'Current')], duration=dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':3}],Range={'Min':1,'Max':5},UsesPerTurn=1)
],card_type='ArchSpirit',tier=3,prev='Brakka, Shield of Blackfurrow',min_channel=1,max_channel=5),
terr('Titheland Monomorpha','Furrow lines glow as a single patch of war-torn soil returns to ordered farmland.','Field','Mono',2),
terr('Watchmound Monomorpha','A lone levy mound rises over the road under a fluttering village pennant.','Hill','Mono',2),
terr('Musterbank Dimorpha','Two raised embankments and watch mounds rise out of the roadside mud under rally banners.','Hill','Di',3),
terr('Commons Verge Dimorpha','Twin bands of open country are redrawn into lawful common ground.','Field','Di',3),
terr('Crownland Trimorpha','Grain rows, road ditches, and shrine stones race across the battlefield into one coherent bread-route.','Field','Tri',4,'Rare'),
terr('Granary Concord Trimorpha','Three linked civic lanes blaze into being as the commons reclaim the road.','Hill','Tri',4,'Rare'),
]
spirit_specs=[
('Barley Road Courier','Field',1,0,2,0,1,'Walk',3,1,1,['Centaur','Scout'],'Common','When this moves onto Plains, gain 1 SP.', ability('Barley Road Ledger','Triggered','When this moves onto Plains, gain 1 SP.',[action(target('Player','Owner',scope='Player'), [{'$type':'ModifySP','Amount':fixed(1)}])],TriggerEvent=trig('OnUnitMove',Ownership='ExactSelf'),ActivationConditions=[cond_aff('Plains','Self')])),
('Granary Lock Warden','Hill',1,0,1,1,1,'Walk',2,1,1,['Iron Golem','Warden'],'Common','On channel, a friendly unit gains +1 Defense until end of turn.', ability('Gatebar Discipline','Triggered','On channel, a friendly unit gains +1 Defense until end of turn.',[action(target('Unit','Owner'),[mod('Defense',1,'Current')],duration=dur_turn())],TriggerEvent=trig('OnChanneled',CardType='Spirit',Ownership='Owner',Filter={'$type':'IsSelf'}))),
('Orchard Salt-Pledge Pixie','Field',2,0,1,1,1,'Flight',3,1,1,['Pixie'],'Common','When this enters, draw 1 then discard 1.', ability('Salt-Pledge Flutter','Triggered','When this enters, draw 1 then discard 1.',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':1,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}])],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),
('Ridge Pennant Rider','Hill',2,0,2,1,1,'Flight',3,1,1,['Hippogriff','Courier'],'Common','When this enters, another friendly unit gains +1 MP this turn.', ability('Relay Pennant','Triggered','When this enters, another friendly unit gains +1 MP this turn.',[action(target('Unit','Owner'),[mod('MP',1,'Current')],duration=dur_turn())],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),
('Common Right Reeve','Plains',2,0,2,2,1,'Walk',2,1,1,['Orc','Officer'],'Uncommon','Aura 1: friendly units on Plains gain +1 Defense.', ability('Common Right Aura','Aura','Friendly units on Plains in aura range gain +1 Defense.',[action(target('Unit','Owner',all=True),[mod('Defense',1,'Max')],[cond_aff('Plains')])],AuraRange={'Min':1,'Max':1})),
('Longview Orchard Elder','Field',3,0,3,2,1,'Walk',2,1,2,['Giraffe','Witness'],'Uncommon','Target enemy loses CanUseAbility until end of turn.', ability('Longview Exposure','Active','Target enemy loses CanUseAbility until end of turn.',[action(target('Unit','Enemy'),[setflag('CanUseAbility',False)],duration=dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':1}],Range={'Min':1,'Max':2},UsesPerTurn=1)),
('Ditchline Militia Captain','Hill',3,0,3,2,2,'Walk',2,1,1,['Orc','Soldier'],'Uncommon','When this attacks while on Plains, it gains +1 Damage until end of turn.', ability('Ditchline Charge','Triggered','When this attacks while on Plains, it gains +1 Damage until end of turn.',[action(target('Unit','ExactSelf'),[mod('Damage',1)],duration=dur_turn())],TriggerEvent=trig('OnUnitAttack',Ownership='Owner',Filter={'$type':'IsSelf'}),ActivationConditions=[cond_aff('Plains','Self')])),
('March Witness Cavalier','Plains',3,0,3,1,2,'Walk',4,1,1,['Centaur','Knight'],'Uncommon','When this moves onto Plains, it gains +1 MP this turn.', ability('Witness Gallop','Triggered','When this moves onto Plains, it gains +1 MP this turn.',[action(target('Unit','ExactSelf'),[mod('MP',1,'Current')],duration=dur_turn())],TriggerEvent=trig('OnUnitMove',Ownership='ExactSelf'),ActivationConditions=[cond_aff('Plains','Self')])),
('Hearthcross Scale-Inspector','Plains',3,0,2,2,2,'Walk',2,1,2,['Iron Golem','Jurist'],'Uncommon','When this enters, target enemy gets -1 Damage and loses CanMove until end of turn.', ability('False Measure Cited','Triggered','When this enters, target enemy gets -1 Damage and loses CanMove until end of turn.',[action(target('Unit','Enemy'),[mod('Damage',-1),setflag('CanMove',False)],duration=dur_turn())],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),
('Ashen Hedge Packguide','Hill',4,0,4,1,2,'Walk',3,1,1,['Gray Wolf'],'Rare','When a friendly unit enters this aura range, it gains +1 MP this turn.', ability('Hedge Route','Triggered','When a friendly unit enters this aura range, it gains +1 MP this turn.',[action(target('Unit','Target'),[mod('MP',1,'Current')],duration=dur_turn())],AuraRange={'Min':1,'Max':2},TriggerEvent=trig('OnEnterAuraRange',AuraOwnership='Owner',UnitOwnership='Owner'))),
('Pilgrim Road Bellwarden','Field',4,0,4,2,2,'Walk',2,1,2,['Giraffe','Monk'],'Rare','When a friendly unit on Plains enters this aura range, heal it 1.', ability('Pilgrim Bell','Triggered','When a friendly unit on Plains enters this aura range, heal it 1.',[action(target('Unit','Target'),[{'$type':'HealDamage','Amount':fixed(1)}],[cond_aff('Plains')])],AuraRange={'Min':1,'Max':2},TriggerEvent=trig('OnEnterAuraRange',AuraOwnership='Owner',UnitOwnership='Owner'))),
('Red Harvest Standard-Dead','Hill',4,0,4,2,3,'Walk',2,1,1,['Revenant','Knight'],'Rare','When this attacks a unit, that unit loses CanAttack until end of turn.', ability('The Dead Remember the Charge','Triggered','When this attacks a unit, that unit loses CanAttack until end of turn.',[action(target('Unit','Enemy'),[setflag('CanAttack',False)],duration=dur_turn())],TriggerEvent=trig('OnUnitAttack',Ownership='Owner',Filter={'$type':'IsSelf'}))),
('Grain Crown Testifier','Plains',4,0,4,2,2,'Walk',2,1,2,['Giraffe','Witness'],'Rare','If this enters on Plains, draw 2 then discard 1.', ability('Grain-Crown Testimony','Triggered','If this enters on Plains, draw 2 then discard 1.',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':2,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}],[cond_aff('Plains','Self')])],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),
('Halcyon Seedvault Sentinel','Hill',5,0,5,3,2,'Walk',2,1,2,['Iron Golem','Guardian'],'Rare','Adjacent enemies have -1 Damage.', ability('Seedvault Pressure','Aura','Adjacent enemies have -1 Damage.',[action(target('Unit','Enemy',all=True,filters=[{'$type':'IsAdjacentToSource'}]),[mod('Damage',-1)])],AuraRange={'Min':1,'Max':1})),
('Marek, Banner of Shared Roads','Plains',5,0,5,2,3,'Walk',4,1,2,['Centaur','Heroic'],'Epic','Friendly Plains units in aura range cannot be blocked.', ability('Banner of Shared Roads','Aura','Friendly Plains units in aura range cannot be blocked.',[action(target('Unit','Owner',all=True),[setflag('CanBeBlocked',False)],[cond_aff('Plains')])],AuraRange={'Min':1,'Max':2})),
('Open Granary Colossus','Plains',7,1,7,3,3,'Walk',2,1,2,['Iron Golem','Mythic'],'Legendary','Friendly Plains units gain +1/+1.', ability('Open Granary Mandate','Passive','Friendly Plains units gain +1/+1.',[action(target('Unit','Owner',all=True),[mod('Damage',1),mod('Health',1,'Max')],[cond_aff('Plains')])])),
]
for s in spirit_specs: cards.append(unit(s[0],s[11] if False else next(x for x in [
'Placeholder']),'',0,0,0,0,0,'Walk',0,1,1,[], 'Common', []))
# overwrite with correct constructed units
cards = cards[:9]
descs = {
'Barley Road Courier':'A lean rider skims between grain carts with sealed grain tallies strapped to their flank.',
'Granary Lock Warden':'A squat golem braces a lockbar across a granary gate while tally sigils burn in its chest.',
'Orchard Salt-Pledge Pixie':'A tiny orchard spirit flits through apple bloom carrying salt and bread charms.',
'Ridge Pennant Rider':'A mail-clad rider and hippogriff skim over ridge beacons with relay pennants cracking in the wind.',
'Common Right Reeve':'An armored reeve reads famine law from a nail-bound tablet in the middle of a village square.',
'Longview Orchard Elder':'A towering orchard warden surveys smoke on the horizon from a laddered pear terrace.',
'Ditchline Militia Captain':'A scarred captain braces in a half-finished earthwork with neighbors at their shoulders.',
'March Witness Cavalier':'A bannered centaur thunders across open grainland with writs pinned to a lance.',
'Hearthcross Scale-Inspector':'A market golem compares glowing counterweights over a crowded square where everyone is suddenly nervous.',
'Ashen Hedge Packguide':'A rangy wolf scouts the hedgerow margins between farms and old battle mounds.',
'Pilgrim Road Bellwarden':'A long-necked monk rings a road bell from a hill shrine while refugees gather below.',
'Red Harvest Standard-Dead':'A dead standard-bearer rises from trampled wheat with a torn war banner still upright.',
'Grain Crown Testifier':'A solemn abbot speaks from a terrace overlooking court, camp, and field all at once.',
'Halcyon Seedvault Sentinel':'A monastery vault guardian towers over sealed seed doors carved into mountain stone.',
'Marek, Banner of Shared Roads':'A gold-maned envoy rides with oath ribbons streaming from a ceremonial spear.',
'Open Granary Colossus':'A massive famine-law automaton unfolds from monastery grain doors and steps into daylight for the first time in centuries.'
}
cards += [unit(n,descs[n],aff,sp,st,hp,df,dmg,mv,mp,a1,a2,gen,rar,[ab]) for (n,aff,sp,st,hp,df,dmg,mv,mp,a1,a2,gen,rar,_,ab) in spirit_specs]
cards += [
spell('Open the Storehouses','Granary bars are lifted while frightened villagers watch in dawn light.','Field',1,'Common',[action(target('Unit','Owner'),[setflag('CanBeAttacked',False)],duration=dur_turn())],'Repentance'),
spell('Moot of the High Road','Riders, monks, and reeves argue beneath waystones while the whole road waits on the verdict.','Hill',2,'Common',[action(target('Unit','Enemy'),[setflag('CanAttack',False)],duration=dur_turn())],'Repentance'),
spell('Ledger of True Measure','False tallies burn off a public ledger under common scrutiny.','Plains',2,'Uncommon',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':2,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}])],'Repentance'),
spell('Declare the Commons','Boundary stones are redrawn around a village’s fields while banners lower in shame.','Plains',3,'Uncommon',[action(target('Tile','Any'), [{'$type':'PushFinalAffinity','Affinity':fixed('Plains')}]), action(target('Unit','Owner'), [mod('Defense',1,'Current')], duration=dur_turn())],'Repentance'),
spell('Famine Law Proclaimed','A public decree is nailed to a grain beam while every nearby face is lit by torch and outrage.','Plains',4,'Rare',[action(target('Unit','Owner',all=True),[mod('Damage',1),mod('Health',1,'Max'),setflag('CanUseAbility',True)],[cond_aff('Plains')],dur_turn())],'Repentance'),
ruin('Red Harvest Witness Mound','A low battlefield cairn overlooks replanted grain where the dead still remember who lied first.','Plains',3,'Rare',[
ability('Witness Grain','Triggered','If occupied by a friendly unit when this activates, gain 1 SP.',[action(target('Player','Owner',scope='Player'), [{'$type':'ModifySP','Amount':fixed(1)}])],TriggerEvent=trig('OnRuinActivation',RuinOwnership='Owner',OccupantOwnership='Owner')),
ability('Witness Ledger','Triggered','If occupied by a friendly unit when this activates, draw 1 then discard 1.',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':1,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}])],TriggerEvent=trig('OnRuinActivation',RuinOwnership='Owner',OccupantOwnership='Owner')),
ability('Witness Rebuke','Triggered','If occupied by a friendly unit when this activates, target enemy in range loses CanMove until end of turn.',[action(target('Unit','Enemy',filters=[{'$type':'WithinRange','Min':1,'Max':2}]), [setflag('CanMove',False)], duration=dur_turn())],TriggerEvent=trig('OnRuinActivation',RuinOwnership='Owner',OccupantOwnership='Owner'))]),
spell('Stand Before the Barn','Villagers and reeves lock shields in front of a granary door with nowhere else to retreat.','Plains',1,'Common',[action(target('Unit','Enemy'),[setflag('CanAttack',False)],duration={'Type':'UntilEndOfSequence'})],'Instinct'),
spell('Hitch the Relief Team','Draft lines snap taut as carts lurch into motion through churned mud.','Field',2,'Common',[action(target('Unit','Owner'),[mod('MP',2,'Current')],duration=dur_turn())],'Instinct'),
spell('Public Accusation','A witness points from the raised roadbank and the guilty freeze under every eye.','Hill',2,'Common',[action(target('Unit','Enemy'),[setflag('CanMove',False)],duration={'Type':'UntilEndOfSequence'})],'Instinct'),
]
manifest={
'name':'Grain Oath Concord','description':'Field/Hill common-rights midrange deck for Amberthrone Fields. Build Plains lanes, protect the commons, and grind advantage through lawful logistics.','archSpiritName':'Brakka, Ditchborn Mootspeaker','isActive':False,'isStarterDeck':False,'isAvailableInShop':False,
'cards':[{'name':'Brakka, Ditchborn Mootspeaker','quantity':1},{'name':'Brakka, Shield of Blackfurrow','quantity':1},{'name':'Brakka, Mother of the Open Granary','quantity':1},
{'name':'Titheland Monomorpha','quantity':3},{'name':'Watchmound Monomorpha','quantity':3},{'name':'Musterbank Dimorpha','quantity':2},{'name':'Commons Verge Dimorpha','quantity':2},{'name':'Crownland Trimorpha','quantity':1},{'name':'Granary Concord Trimorpha','quantity':1},
{'name':'Barley Road Courier','quantity':3},{'name':'Granary Lock Warden','quantity':3},{'name':'Orchard Salt-Pledge Pixie','quantity':3},{'name':'Ridge Pennant Rider','quantity':2},{'name':'Common Right Reeve','quantity':3},{'name':'Longview Orchard Elder','quantity':3},{'name':'Ditchline Militia Captain','quantity':3},{'name':'March Witness Cavalier','quantity':3},{'name':'Hearthcross Scale-Inspector','quantity':2},{'name':'Ashen Hedge Packguide','quantity':2},{'name':'Pilgrim Road Bellwarden','quantity':1},{'name':'Red Harvest Standard-Dead','quantity':1},{'name':'Grain Crown Testifier','quantity':1},{'name':'Halcyon Seedvault Sentinel','quantity':1},{'name':'Marek, Banner of Shared Roads','quantity':1},
{'name':'Open the Storehouses','quantity':2},{'name':'Moot of the High Road','quantity':2},{'name':'Ledger of True Measure','quantity':2},{'name':'Declare the Commons','quantity':2},{'name':'Famine Law Proclaimed','quantity':1},{'name':'Red Harvest Witness Mound','quantity':1},{'name':'Stand Before the Barn','quantity':1},{'name':'Hitch the Relief Team','quantity':1},{'name':'Public Accusation','quantity':1}]
}
issues='''# Amberthrone Fields — Live Catalog Issue Log\n\nDeck: **Grain Oath Concord**\nPlan file: `cardgen/amberthrone_fields_card_plan.json`\nPrebuilt manifest: `cardgen/amberthrone_fields_prebuilt_manifest.json`\n\n## Summary\n- Prepared **31 catalog definitions** for Amberthrone Fields.\n- Live prebuilt uses the standardized **12-card Terramorpha package** (6 mono / 4 di / 2 tri) aligned to Field/Hill → Plains identity.\n- Normalized ArchSpirit costs to the standing live rule set: **10 / 6+1 / 7+2**.\n\n## Key rewrites / compromises\n- Removed once-per-turn language from **Public Witness** and **Feed the Line** because the live trigger system still lacks clean caps.\n- **Declare Common Right**, **Ridge Pennant Rider**, and **March Witness Cavalier** use `+1 MP this turn` instead of exact 1-tile reposition.\n- **Ditchline Militia Captain** checks “while on Plains when it attacks” rather than true from/into destination logic.\n- **Red Harvest Standard-Dead** uses attack-trigger memory instead of exact damage-source tracking.\n- **Grain Crown Testifier** is locked to the stronger but simpler Plains branch (`draw 2, discard 1`) rather than named-Brakka conditional logic.\n- Omitted the Tier 3 death-prevention ability from the live card plan; still not cleanly engine-safe.\n\n## Prebuilt cuts / notes\n- To fit the 12-card Terramorpha retrofit, duplicates were trimmed first from support and top-end before touching the deck’s core Plains engine.\n- Current live prebuilt keeps the arch line, core Plains payoffs, and basic control package intact.\n'''
return cards, manifest, issues
# To keep this manageable, the remaining three decks use the same authoring style but lighter helper data.
# ---------- Greenveil ----------
def green():
cards=[]
cards += [
unit('Elowen, Archive Nestling','A young owl magistrate stands in a root-arched archive glade while luminous leaves hang like legal lanterns.','Grove',10,0,8,2,1,'Walk',2,1,2,['Barn Owl','Leader'],RARITY['arch1'],[
passive_affs('Record What the Forest Knows',['Field','Forest','Grove'],[mod('Defense',1,'Max')],'Friendly units on Field, Forest, or Grove gain +1 Defense.'),
ability('Quiet Citation','Active','Target enemy loses CanUseAbility until end of turn.',[action(target('Unit','Enemy'),[setflag('CanUseAbility',False)],duration=dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':1}],Range={'Min':1,'Max':3},UsesPerTurn=1),
ability('Recover the Name','Triggered','When a friendly Spirit enters the battlefield on Grove, draw 1 then discard 1.',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':1,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}])],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Spirit',Ownership='Owner'),ActivationConditions=[cond_aff('Grove')])
],card_type='ArchSpirit',tier=1,min_channel=1,max_channel=3),
unit('Elowen, Voice in the Silent Wood','Elowen presides over a silent riot court in the moonlit forest, signaling verdicts by lantern shutters while thunder rolls through the canopy.','Grove',6,1,10,3,2,'Walk',2,1,2,['Barn Owl','Leader'],RARITY['arch2'],[
passive_affs('Accord Restored in Parts',['Grove'],[mod('Damage',1),setflag('CanBeBlocked',False)],'Friendly Spirits on Grove gain +1 Damage and cannot be blocked.', spirit_only=True),
ability('Sign-Lantern Verdict','Active','Target enemy loses CanMove until end of turn. If it is on Grove, it also loses CanAttack until end of turn.',[action(target('Unit','Enemy'),[setflag('CanMove',False)],duration=dur_turn()),action(target('Unit','Target'),[setflag('CanAttack',False)],[cond_aff('Grove')],dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':2}],Range={'Min':1,'Max':4},UsesPerTurn=1),
ability('Testimony Preserved','Triggered','When a friendly unit enters this aura range, heal it 1.',[action(target('Unit','Target'),[{'$type':'HealDamage','Amount':fixed(1)}])],AuraRange={'Min':1,'Max':2},TriggerEvent=trig('OnEnterAuraRange',AuraOwnership='Owner',UnitOwnership='Owner'))
],card_type='ArchSpirit',tier=2,prev='Elowen, Archive Nestling',min_channel=1,max_channel=4),
unit('Elowen, First Scribe of Greenveil','Ascended Elowen hovers above a colossal treaty glade where root tables, fungal towers, and silver canopy bridges inscribe themselves in living light.','Grove',7,2,12,4,3,'Walk',2,1,2,['Barn Owl','Leader'],RARITY['arch3'],[
passive_affs('The Forest Remembers Everyone',['Field','Forest','Grove'],[mod('Damage',1),mod('Health',1,'Max')],'Friendly units on Field, Forest, or Grove gain +1/+1.'),
ability('Rewrite the Accord','Active','Target tile becomes Grove. Then target friendly unit gains +1 MP this turn.',[action(target('Tile','Any'), [{'$type':'PushFinalAffinity','Affinity':fixed('Grove')}]),action(target('Unit','Owner'), [mod('MP',1,'Current')], duration=dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':3}],Range={'Min':1,'Max':5},UsesPerTurn=1)
],card_type='ArchSpirit',tier=3,prev='Elowen, Voice in the Silent Wood',min_channel=1,max_channel=5),
terr('Shrine-Clearing Monomorpha','Vines pull back from luminous soil to reveal a legal glade marked by old stone and pollen light.','Field','Mono',2), terr('Underbough Monomorpha','A quiet strip of sacred undergrowth rises into lawful form.','Forest','Mono',2), terr('Rootpath Dimorpha','Twin root roads and fungal lanternways bloom through the undergrowth.','Forest','Di',3), terr('Treaty-Lantern Dimorpha','Two shrine lanes join under memory-light and root-song.','Field','Di',3), terr('Crownseed Bloom Trimorpha','A false glade is overtaken by true green law as three luminous clearings ignite in sequence.','Field','Tri',4,'Rare'), terr('Remembrance Canopy Trimorpha','Three linked forest courts awaken beneath silver canopy fire.','Forest','Tri',4,'Rare')]
specs=[
('Root Archive Clerk','A tiny archivist records testimony on bark-thin tablets while sitting inside a hollow root shelf.','Field',1,0,1,1,1,'Walk',2,1,1,['Barn Owl','Clerk'],'Common', ability('Archive Marginalia','Triggered','On channel, draw 1 then discard 1.',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':1,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}])],TriggerEvent=trig('OnChanneled',CardType='Spirit',Ownership='Owner',Filter={'$type':'IsSelf'}))),
('Mosstrail Forager','A sleek six-limbed prowler slips between roots and moonlit spores with impossible grace.','Forest',1,0,2,0,1,'Walk',3,1,1,['Displacer Beast','Scout'],'Common', ability('Mosstrail Levy','Triggered','When this moves onto Grove, gain 1 SP.',[action(target('Player','Owner',scope='Player'), [{'$type':'ModifySP','Amount':fixed(1)}])],TriggerEvent=trig('OnUnitMove',Ownership='ExactSelf'),ActivationConditions=[cond_aff('Grove','Self')])) ,
('Reedhorn Purifier','A pale guardian lowers its prism horn into a poisoned spring until the water clears around its hooves.','Grove',2,0,2,2,1,'Walk',3,1,1,['Unicorn'],'Common', ability('Purifying Touch','Triggered','When this enters, heal a friendly unit 2.',[action(target('Unit','Owner'),[{'$type':'HealDamage','Amount':fixed(2)}])],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),
('Thornpath Magistrate','A robed magistrate signals rulings between hanging lanterns and briar seals.','Field',2,0,2,1,1,'Walk',2,1,2,['Barn Owl','Jurist'],'Common', ability('Thornpath Injunction','Active','Target enemy loses CanUseAbility until end of turn.',[action(target('Unit','Enemy'),[setflag('CanUseAbility',False)],duration=dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':1}],Range={'Min':1,'Max':2},UsesPerTurn=1)),
('Canopy Stormling','A young thunderbird dives between giant branches carrying static in its feathers.','Forest',2,0,2,1,2,'Flight',3,1,1,['Thunderbird'],'Common', ability('Canopy Slipstream','Triggered','When this enters, another friendly unit gains +1 MP this turn.',[action(target('Unit','Owner'),[mod('MP',1,'Current')],duration=dur_turn())],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),
('Lunasyl Rememberer','A silver-lit ancestor spirit drifts above the shrine spring with names circling her like petals.','Grove',3,0,3,2,1,'Walk',2,1,2,['Ghost'],'Uncommon', ability('Remembered Name','Triggered','When this enters on Grove, draw 1.',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':1,'Player':'Owner'}],[cond_aff('Grove','Self')])],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),
('Roothelm Claim-Warden','A bronze-scaled burrow guardian emerges from a treaty mound with old seals embedded in its claws.','Forest',3,0,3,2,2,'Walk',2,1,1,['Lindworm'],'Uncommon', ability('Roothelm Lock','Active','Target enemy loses CanMove until end of turn.',[action(target('Unit','Enemy'),[setflag('CanMove',False)],duration=dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':1}],Range={'Min':1,'Max':2},UsesPerTurn=1)),
('Accord Glade Warden','A luminous horned judge walks the perimeter of a sacred glade, every footprint blooming softly behind it.','Grove',3,0,3,2,2,'Walk',2,1,1,['Qilin'],'Uncommon', ability('Accord Glade Aura','Aura','Friendly Grove units in aura range gain +1 Damage.',[action(target('Unit','Owner',all=True),[mod('Damage',1)],[cond_aff('Grove')])],AuraRange={'Min':1,'Max':1})),
('Witchwood Collar-Breaker','A hunt-mother tears a thorn-collar apart with phase-shifted tendrils as stormlight flashes overhead.','Forest',4,0,4,1,3,'Walk',3,1,1,['Displacer Beast'],'Rare', ability('Break the Collar','Triggered','When this attacks a unit, that unit loses CanUseAbility until end of turn.',[action(target('Unit','Enemy'),[setflag('CanUseAbility',False)],duration=dur_turn())],TriggerEvent=trig('OnUnitAttack',Ownership='Owner',Filter={'$type':'IsSelf'}))),
('Briarthorn Echo-Speaker','A dead litigant speaks through fungus lamps and silver threads in a vine-swallowed court.','Field',4,0,4,2,2,'Walk',2,1,2,['Ghost','Witness'],'Rare', ability('Echo of Mercy','Triggered','When a friendly unit enters this aura range, heal it 1.',[action(target('Unit','Target'),[{'$type':'HealDamage','Amount':fixed(1)}])],AuraRange={'Min':1,'Max':2},TriggerEvent=trig('OnEnterAuraRange',AuraOwnership='Owner',UnitOwnership='Owner'))),
('Iron-Eater Totembeast','A chittering scavenger crowned in ritual ribbons gnaws through abandoned war gear beneath mushroom towers.','Forest',4,0,4,2,2,'Walk',2,1,1,['Rust Monster'],'Rare', ability('Rust-Totem Pressure','Aura','Adjacent enemies have -1 Defense.',[action(target('Unit','Enemy',all=True,filters=[{'$type':'IsAdjacentToSource'}]),[mod('Defense',-1,'Current')])],AuraRange={'Min':1,'Max':1})),
('Crownseed Restorer','A luminous healer presses its horn to a split treaty sapling while memory-light pours back into the wood.','Grove',4,0,4,3,2,'Walk',2,1,2,['Unicorn','Healer'],'Rare', ability('Crownseed Renewal','Aura','Friendly units in aura range heal 1 when they enter.',[action(target('Unit','Target'),[{'$type':'HealDamage','Amount':fixed(1)}])],AuraRange={'Min':1,'Max':2},TriggerEvent=trig('OnEnterAuraRange',AuraOwnership='Owner',UnitOwnership='Owner'))),
('Skythorn Trial-Raptor','A great storm bird circles over the upper canopy with thunderfruit sparks snapping in its wake.','Forest',5,0,5,2,3,'Flight',3,1,2,['Thunderbird'],'Rare', ability('Skythorn Trial','Aura','Friendly Grove units in aura range cannot be obstructed.',[action(target('Unit','Owner',all=True),[setflag('CanBeObstructed',False)],[cond_aff('Grove')])],AuraRange={'Min':1,'Max':2})),
('Palegrove Chorus-Mother','A many-voiced matriarch formed from overlapping ancestral silhouettes rises out of a moonlit root crypt.','Grove',5,0,5,2,2,'Walk',2,1,2,['Ghost','Ancestor'],'Epic', ability('Return the Lesser Name','Triggered','When this enters, return a cost 2 or less friendly Spirit from discard to hand.',[action(target('Spirit','Owner',scope='Discard',filters=[{'$type':'SpCostLessThanOrEqual','N':2}]),[{'$type':'ReturnToHand'}])],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),
('Serrat, Warden Below the New Accord','A great scale-matriarch coils around a treaty root chamber instead of a hoard, guarding law rather than possession.','Grove',6,1,6,2,4,'Walk',2,1,1,['Lindworm','Heroic'],'Legendary', ability('Accord Chamber Opens','Triggered','When this enters, target adjacent tile becomes Grove.',[action(target('Tile','Any',filters=[{'$type':'WithinRange','Min':1,'Max':1}]), [{'$type':'PushFinalAffinity','Affinity':fixed('Grove')}])],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),
('Crownseed Memory-Stag','A colossal stag-dragon crowned in living antlers walks through glade, shrine, and storm as though they are one court.','Grove',7,1,7,3,3,'Walk',3,1,2,['Qilin','Mythic'],'Legendary', ability('Memory Crown','Passive','Friendly Grove units gain +1/+1.',[action(target('Unit','Owner',all=True),[mod('Damage',1),mod('Health',1,'Max')],[cond_aff('Grove')])])),
]
cards += [unit(n,d,a,sp,st,hp,df,dm,mv,mp,r1,r2,g,rar,[ab]) for (n,d,a,sp,st,hp,df,dm,mv,mp,r1,r2,g,rar,ab) in specs]
cards += [spell('Quiet the Witchwood','The forest hushes around a predator until even malice loses its nerve.','Forest',1,'Common',[action(target('Unit','Enemy'),[setflag('CanAttack',False)],duration=dur_turn())],'Repentance'),spell('Return the Name','A stolen memory drifts back into its rightful owner like pollen finding the flower it left.','Grove',2,'Common',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':2,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}])],'Repentance'),spell('Lantern-Sign Inquiry','Magistrates conduct a legal hearing entirely through lantern code and wing signs beneath riotous branches.','Field',2,'Common',[action(target('Unit','Enemy'),[setflag('CanUseAbility',False)],duration=dur_turn())],'Repentance'),spell('Replant the Accord','A fallen treaty glade surges back to life under moonlight and root-song.','Grove',3,'Uncommon',[action(target('Tile','Any'), [{'$type':'PushFinalAffinity','Affinity':fixed('Grove')}]),action(target('Unit','Owner'),[{'$type':'HealDamage','Amount':fixed(1)}])],'Repentance'),spell('No Soul Excluded','Living, dead, feral, and noble alike stand within one luminous legal circle beneath the restored Crownseed.','Grove',4,'Rare',[action(target('Unit','Owner',all=True),[mod('Damage',1),mod('Health',1,'Max'),setflag('CanUseAbility',True)],[cond_aff('Grove')],dur_turn())],'Repentance'),ruin('Hollow of the First Branch','The original chamber where a treaty branch was hidden away glows whenever someone enters with honest intent.','Grove',3,'Rare',[ability('First Branch Memory','Triggered','If occupied by a friendly unit when this activates, draw 1 then discard 1.',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':1,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}])],TriggerEvent=trig('OnRuinActivation',RuinOwnership='Owner',OccupantOwnership='Owner')),ability('First Branch Mercy','Triggered','If occupied by a friendly unit when this activates, heal the occupant 2.',[action(target('Unit','Owner'),[{'$type':'HealDamage','Amount':fixed(2)}])],TriggerEvent=trig('OnRuinActivation',RuinOwnership='Owner',OccupantOwnership='Owner')),ability('First Branch Grant','Triggered','If occupied by a friendly unit when this activates, gain 1 SP.',[action(target('Player','Owner',scope='Player'), [{'$type':'ModifySP','Amount':fixed(1)}])],TriggerEvent=trig('OnRuinActivation',RuinOwnership='Owner',OccupantOwnership='Owner'))]),spell('Branch Between Fangs','A living bough whips between hunter and prey at the exact moment blood would spill.','Grove',1,'Common',[action(target('Unit','Owner'),[setflag('CanBeAttacked',False)],duration=dur_turn())],'Instinct'),spell('Phase-Slip Through Roots','A shadow-cat vanishes sideways and an ally is suddenly somewhere safer.','Forest',2,'Common',[action(target('Unit','Owner'),[mod('MP',1,'Current')],duration=dur_turn())],'Instinct'),spell('Silent Verdict','One lantern shutter closes and an entire violent argument stops.','Field',2,'Common',[action(target('Unit','Enemy'),[setflag('CanUseAbility',False)],duration={'Type':'UntilEndOfSequence'})],'Instinct')]
manifest={'name':'Crownseed Remembrance','description':'Field/Forest value-midrange deck for Greenveil Reckoning. Build Grove lanes, restore advantage through healing and memory, and outlast hostile control.','archSpiritName':'Elowen, Archive Nestling','isActive':False,'isStarterDeck':False,'isAvailableInShop':False,'cards':[{'name':'Elowen, Archive Nestling','quantity':1},{'name':'Elowen, Voice in the Silent Wood','quantity':1},{'name':'Elowen, First Scribe of Greenveil','quantity':1},{'name':'Shrine-Clearing Monomorpha','quantity':3},{'name':'Underbough Monomorpha','quantity':3},{'name':'Rootpath Dimorpha','quantity':2},{'name':'Treaty-Lantern Dimorpha','quantity':2},{'name':'Crownseed Bloom Trimorpha','quantity':1},{'name':'Remembrance Canopy Trimorpha','quantity':1},{'name':'Root Archive Clerk','quantity':3},{'name':'Mosstrail Forager','quantity':3},{'name':'Reedhorn Purifier','quantity':3},{'name':'Thornpath Magistrate','quantity':3},{'name':'Canopy Stormling','quantity':2},{'name':'Lunasyl Rememberer','quantity':3},{'name':'Roothelm Claim-Warden','quantity':3},{'name':'Accord Glade Warden','quantity':3},{'name':'Witchwood Collar-Breaker','quantity':2},{'name':'Briarthorn Echo-Speaker','quantity':2},{'name':'Iron-Eater Totembeast','quantity':1},{'name':'Crownseed Restorer','quantity':1},{'name':'Skythorn Trial-Raptor','quantity':1},{'name':'Palegrove Chorus-Mother','quantity':1},{'name':'Serrat, Warden Below the New Accord','quantity':1},{'name':'Quiet the Witchwood','quantity':2},{'name':'Return the Name','quantity':2},{'name':'Lantern-Sign Inquiry','quantity':2},{'name':'Replant the Accord','quantity':2},{'name':'No Soul Excluded','quantity':1},{'name':'Hollow of the First Branch','quantity':1},{'name':'Branch Between Fangs','quantity':1},{'name':'Phase-Slip Through Roots','quantity':1},{'name':'Silent Verdict','quantity':1}]}
issues='''# Greenveil Reckoning — Live Catalog Issue Log\n\nDeck: **Crownseed Remembrance**\nPlan file: `cardgen/greenveil_reckoning_card_plan.json`\nPrebuilt manifest: `cardgen/greenveil_reckoning_prebuilt_manifest.json`\n\n## Summary\n- Prepared **31 catalog definitions** for Greenveil Reckoning.\n- Live prebuilt uses the standardized **12-card Terramorpha package** aligned to Field/Forest → Grove identity.\n- ArchSpirit costs normalized to **10 / 6+1 / 7+2**.\n\n## Key rewrites / compromises\n- Removed once-per-turn caps from **Recover the Name** and **Testimony Preserved**.\n- **Rewrite the Accord** and **Canopy Stormling** use `+1 MP this turn` instead of exact one-tile movement.\n- **Accord Restored in Parts** makes unblockable unconditional while on Grove.\n- **Crownseed Restorer** was rewritten from true death-prevention timing into a safer healing/aura support role.\n- Tier 3 death-prevention text (**No Name Erased**) remains omitted from the live plan.\n- **Crownseed Memory-Stag** keeps only the stable Grove-wide +1/+1 rider; the first-channel loot rider remains deferred.\n'''
return cards, manifest, issues
# ---------- Sunscar ----------
def sunscar():
cards=[]
cards += [unit('Sevra, Keeper of Measured Thirst','A dwarf matron in copper veil-armor stands at a cistern checkpoint between oasis gardens and canyon shadow, ledger-chains gleaming beneath a blood moon.','Steppe',10,0,8,2,1,'Walk',2,1,1,['Dwarfkin','Leader'],RARITY['arch1'],[passive_affs('Water Is Public Duty',['Field','Mountain','Steppe'],[mod('Defense',1,'Max')],'Friendly units on Field, Mountain, or Steppe gain +1 Defense.'),ability('Audit the Route','Active','Target enemy loses CanUseAbility until end of turn.',[action(target('Unit','Enemy'),[setflag('CanUseAbility',False)],duration=dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':1}],Range={'Min':1,'Max':3},UsesPerTurn=1),ability('Caravan Counted','Triggered','When a friendly Spirit enters the battlefield on Steppe, gain 1 SP.',[action(target('Player','Owner',scope='Player'), [{'$type':'ModifySP','Amount':fixed(1)}])],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Spirit',Ownership='Owner'),ActivationConditions=[cond_aff('Steppe')])],card_type='ArchSpirit',tier=1,min_channel=1,max_channel=3), unit('Sevra, Breaker of the Hidden Seal','Sevra stands before the opened Brass Sepulcher, canyon winds whipping sand through gold-lit vault doors while caravan banners gather at her back.','Steppe',6,1,10,3,2,'Walk',2,1,2,['Dwarfkin','Leader'],RARITY['arch2'],[passive_affs('Law Travels Faster Than Greed',['Steppe'],[mod('Damage',1),setflag('CanBeBlocked',False)],'Friendly Spirits on Steppe gain +1 Damage and cannot be blocked.', spirit_only=True),ability('Mark the Public Road','Active','Target enemy loses CanMove until end of turn. If it is on Steppe, it also loses CanAttack until end of turn.',[action(target('Unit','Enemy'),[setflag('CanMove',False)],duration=dur_turn()),action(target('Unit','Target'),[setflag('CanAttack',False)],[cond_aff('Steppe')],dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':2}],Range={'Min':1,'Max':4},UsesPerTurn=1),ability('Proper Distribution','Triggered','When another friendly unit enters this aura range, draw 1 then discard 1.',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':1,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}])],AuraRange={'Min':1,'Max':2},TriggerEvent=trig('OnEnterAuraRange',AuraOwnership='Owner',UnitOwnership='Owner'))],card_type='ArchSpirit',tier=2,prev='Sevra, Keeper of Measured Thirst',min_channel=1,max_channel=4), unit('Sevra, Mother of the Open Wells','Ascended Sevra stands over a glowing map of aquifers and roads inscribed across the desert floor itself.','Steppe',7,2,12,4,3,'Walk',2,1,2,['Dwarfkin','Leader'],RARITY['arch3'],[passive_affs('Shared Water, Shared Horizon',['Field','Mountain','Steppe'],[mod('Damage',1),mod('Health',1,'Max')],'Friendly units on Field, Mountain, or Steppe gain +1/+1.'),ability('Reopen the Caravan Way','Active','Target tile becomes Steppe. Then target friendly unit gains +1 MP this turn.',[action(target('Tile','Any'), [{'$type':'PushFinalAffinity','Affinity':fixed('Steppe')}]),action(target('Unit','Owner'),[mod('MP',1,'Current')],duration=dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':3}],Range={'Min':1,'Max':5},UsesPerTurn=1)],card_type='ArchSpirit',tier=3,prev='Sevra, Breaker of the Hidden Seal',min_channel=1,max_channel=5), terr('Oasis Plot Monomorpha','Irrigation furrows shimmer into being around a market garden under canvas shade.','Field','Mono',2), terr('Suntrack Monomorpha','A single hard caravan lane is hammered into honest desert road.','Mountain','Mono',2), terr('Canyon Spine Dimorpha','Two linked shelves of red stone rise into a caravan-protecting corridor.','Mountain','Di',3), terr('Wellroute Dimorpha','Twin lines of worked ground link cistern to market under public seal.','Field','Di',3), terr('Lost Atlas Trimorpha','Three forgotten canyon links flare alive from a half-erased map.','Mountain','Tri',4,'Rare'), terr('Open Wells Trimorpha','Three shared-water lanes ignite beneath dawn and measured law.','Field','Tri',4,'Rare')]
specs=[('Sidepath Burrow Runner','A wiry route-runner scampers through cut sandstone and rope ladders with a folded illicit map in hand.','Mountain',1,0,2,0,1,'Walk',3,1,1,['Kobold','Scout'],'Common',ability('Stolen Map, Honest Use','Triggered','When this moves onto Steppe, draw 1 then discard 1.',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':1,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}])],TriggerEvent=trig('OnUnitMove',Ownership='ExactSelf'),ActivationConditions=[cond_aff('Steppe','Self')])),('Wellsquare Registrar','A severe market registrar weighs skins of water beneath a copper awning.','Field',1,0,1,1,1,'Walk',2,1,1,['Dwarfkin','Clerk'],'Common',ability('Registrar’s Correction','Triggered','On channel, a friendly unit gains +1 Defense until end of turn.',[action(target('Unit','Owner'),[mod('Defense',1,'Current')],duration=dur_turn())],TriggerEvent=trig('OnChanneled',CardType='Spirit',Ownership='Owner',Filter={'$type':'IsSelf'}))),('Dustwind Sylph Courier','A ribbon-bodied wind courier darts between canyon ledges carrying sigil-wrapped messages.','Mountain',2,0,2,1,1,'Flight',4,1,1,['Sylph'],'Common',ability('Dustwind Relay','Triggered','When this enters, another friendly unit gains +1 MP this turn.',[action(target('Unit','Owner'),[mod('MP',1,'Current')],duration=dur_turn())],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),('Oasis Lantern Steward','A broad amphibious engineer tends lantern-lit canals and night cistern valves.','Field',2,0,2,2,1,'Walk',2,1,1,['Giant Salamander'],'Common',ability('Lantern Steward Aura','Aura','Friendly units in aura range gain +1 Defense.',[action(target('Unit','Owner',all=True),[mod('Defense',1,'Max')])],AuraRange={'Min':1,'Max':1})),('Steppe Ledger Rider','A luminous judge-beast strides beside a racing caravan, each hoofprint leaving legal fire in the dust.','Steppe',2,0,2,1,2,'Walk',4,1,1,['Qilin','Courier'],'Common',ability('Stamped Passage','Triggered','When this enters on Steppe, gain 1 SP.',[action(target('Player','Owner',scope='Player'), [{'$type':'ModifySP','Amount':fixed(1)}],[cond_aff('Steppe','Self')])],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),('Sunvault Mason','A stonecutter seals and unseals canyon doors with practical reverence.','Mountain',3,0,3,2,1,'Walk',2,1,2,['Dwarfkin','Builder'],'Uncommon',ability('Vault Shut','Active','Target enemy loses CanMove until end of turn.',[action(target('Unit','Enemy'),[setflag('CanMove',False)],duration=dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':1}],Range={'Min':1,'Max':2},UsesPerTurn=1)),('Bazaar Mask Trickster','A laughing tea-seller swaps masks faster than the market can decide whether she is mocking or saving it.','Field',3,0,3,1,2,'Walk',2,1,2,['Tanuki Spirit'],'Uncommon',ability('Mask-Pulled Fraud','Triggered','When this enters, target enemy loses CanUseAbility until end of turn.',[action(target('Unit','Enemy'),[setflag('CanUseAbility',False)],duration=dur_turn())],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),('Common Road Pathfinder','A dust-caped guide races across hardpan with boundary flags tucked under one arm.','Steppe',3,0,3,2,2,'Walk',3,1,1,['Kobold','Guide'],'Uncommon',ability('Pathfinder Burst','Triggered','When this moves onto Steppe, it gains +1 MP this turn.',[action(target('Unit','ExactSelf'),[mod('MP',1,'Current')],duration=dur_turn())],TriggerEvent=trig('OnUnitMove',Ownership='ExactSelf'),ActivationConditions=[cond_aff('Steppe','Self')])),('Saltwind Pack Spear','A lean dune raider plants a hooked spear from the lip of a canyon switchback.','Mountain',4,0,4,1,3,'Walk',3,1,1,['Gnoll'],'Rare',ability('Switchback Hook','Triggered','When this attacks a unit, push that unit 1 tile.',[action(target('Unit','Enemy'),[{'$type':'PushUnit','Tiles':1}])],TriggerEvent=trig('OnUnitAttack',Ownership='Owner',Filter={'$type':'IsSelf'}))),('Veiled Spring Adjudicator','A radiant arbiter emerges from moonlit reeds beside a hidden spring no tyrant can keep.','Steppe',4,0,4,2,2,'Walk',3,1,2,['Qilin','Judge'],'Rare',ability('Veiled Spring Aura','Aura','Friendly Steppe units in aura range gain +1 Damage.',[action(target('Unit','Owner',all=True),[mod('Damage',1)],[cond_aff('Steppe')])],AuraRange={'Min':1,'Max':2})),('Brass Sepulcher Basilisk','A vault serpent coils through brass-lit darkness with curse sigils sliding over its scales.','Mountain',4,0,4,2,2,'Walk',2,1,2,['Basilisk'],'Rare',ability('Sepulcher Stare','Triggered','When this enters, target enemy loses CanAttack until end of turn.',[action(target('Unit','Enemy'),[setflag('CanAttack',False)],duration=dur_turn())],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),('Canal-Heart Mechanist','A master canal worker leans over a sluicewheel in the heat shimmer beneath an oasis wall.','Field',4,0,4,3,1,'Walk',2,1,1,['Giant Salamander','Engineer'],'Rare',ability('Canal Accounting','Triggered','At the start of your turn, if this is on Steppe, gain 1 SP.',[action(target('Player','Owner',scope='Player'), [{'$type':'ModifySP','Amount':fixed(1)}],[cond_aff('Steppe','Self')])],TriggerEvent=trig('OnTurnStart',Ownership='Owner'))),('Sun Ledger Processioner','A solemn procession bearer carries the recovered ledger on a chained stand through hostile desert light.','Steppe',5,0,5,2,3,'Walk',3,1,2,['Dwarfkin','Witness'],'Epic',ability('Ledger Route Restored','Triggered','When this enters, target adjacent tile becomes Steppe.',[action(target('Tile','Any',filters=[{'$type':'WithinRange','Min':1,'Max':1}]), [{'$type':'PushFinalAffinity','Affinity':fixed('Steppe')}])],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),('Canyon Gale Standard','A wind-banner commander holds a cliff pass while storm ribbons whip around them.','Mountain',5,0,5,2,2,'Walk',2,1,2,['Sylph','Officer'],'Epic',ability('Canyon Gale Order','Aura','Friendly units in aura range cannot be obstructed.',[action(target('Unit','Owner',all=True),[setflag('CanBeObstructed',False)])],AuraRange={'Min':1,'Max':2})),('Samir, Grace of Shared Water','A majestic judge-beast walks between oasis moonlight and canyon dawn, making tyrants lower their eyes.','Steppe',6,1,6,2,3,'Walk',4,1,2,['Qilin','Heroic'],'Legendary',ability('Grace of Shared Water','Aura','Adjacent enemies have -1 Damage.',[action(target('Unit','Enemy',all=True,filters=[{'$type':'IsAdjacentToSource'}]),[mod('Damage',-1)])],AuraRange={'Min':1,'Max':1})),('Open Wells Colossus','A colossal canal-wyrm surges up through buried aquifer stone trailing chains, lamps, and water law sigils.','Steppe',7,1,7,3,4,'Walk',2,1,2,['Giant Salamander','Mythic'],'Legendary',ability('Open Wells Mandate','Passive','Friendly Steppe units gain +1/+1.',[action(target('Unit','Owner',all=True),[mod('Damage',1),mod('Health',1,'Max')],[cond_aff('Steppe')])]))]
cards += [unit(n,d,a,sp,st,hp,df,dm,mv,mp,r1,r2,g,rar,[ab]) for (n,d,a,sp,st,hp,df,dm,mv,mp,r1,r2,g,rar,ab) in specs]
cards += [spell('Water for the Road','A steward presses a skin of water into trembling hands despite the crowd watching.','Field',1,'Common',[action(target('Unit','Owner'),[setflag('CanBeAttacked',False)],duration=dur_turn())],'Repentance'),spell('Expose the Toll Fraud','Hidden charges and forged route marks are nailed up in the market for all to see.','Steppe',2,'Common',[action(target('Unit','Enemy'),[setflag('CanUseAbility',False)],duration=dur_turn()),action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':1,'Player':'Owner'}])],'Repentance'),spell('Incomplete Map, Honest Path','A half-burned atlas is corrected in the dust by someone who actually walked the road.','Mountain',2,'Common',[action(target('Unit','Owner'),[mod('MP',2,'Current')],duration=dur_turn())],'Repentance'),spell('Reopen the Canyon Way','Caravan markers are replanted through a previously seized pass before dawn breaks.','Steppe',3,'Uncommon',[action(target('Tile','Any'), [{'$type':'PushFinalAffinity','Affinity':fixed('Steppe')}]),action(target('Unit','Owner'),[mod('Damage',1)],duration=dur_turn())],'Repentance'),spell('The Ledger Speaks at Sunrise','In the first light, the lost law is read aloud and the desert seems to accept it.','Steppe',4,'Rare',[action(target('Unit','Owner',all=True),[mod('Damage',1),mod('Health',1,'Max'),setflag('CanUseAbility',True)],[cond_aff('Steppe')],dur_turn())],'Repentance'),ruin('Broken Cistern of Nahar','A cracked oasis basin reflects stars and blood moon alike, but only answers those who stand in service rather than greed.','Steppe',3,'Rare',[ability('Cistern Grant','Triggered','If occupied by a friendly unit when this activates, gain 1 SP.',[action(target('Player','Owner',scope='Player'), [{'$type':'ModifySP','Amount':fixed(1)}])],TriggerEvent=trig('OnRuinActivation',RuinOwnership='Owner',OccupantOwnership='Owner')),ability('Cistern Memory','Triggered','If occupied by a friendly unit when this activates, draw 1 then discard 1.',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':1,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}])],TriggerEvent=trig('OnRuinActivation',RuinOwnership='Owner',OccupantOwnership='Owner')),ability('Cistern Rebuke','Triggered','If occupied by a friendly unit when this activates, target enemy in range loses CanMove until end of turn.',[action(target('Unit','Enemy',filters=[{'$type':'WithinRange','Min':1,'Max':2}]),[setflag('CanMove',False)],duration=dur_turn())],TriggerEvent=trig('OnRuinActivation',RuinOwnership='Owner',OccupantOwnership='Owner'))]),spell('Sand-Swerve Intercept','A fast-moving escort line cuts across an ambush before the raiders understand the angle.','Steppe',1,'Common',[action(target('Unit','Enemy'),[setflag('CanAttack',False)],duration={'Type':'UntilEndOfSequence'})],'Instinct'),spell('Mirage Detour','Heat shimmer folds the road and an ally vanishes into safety or an enemy stumbles off-route.','Field',2,'Common',[action(target('Unit','Any'),[{'$type':'PushUnit','Tiles':1}])],'Instinct'),spell('Canyon Rebuke','A shouted warning rebounds through red stone and stops a killing rush cold.','Mountain',2,'Common',[action(target('Unit','Enemy'),[setflag('CanMove',False)],duration={'Type':'UntilEndOfSequence'})],'Instinct')]
manifest={'name':'Sun Ledger Procession','description':'Field/Mountain tempo-midrange deck for Sunscar Caravans. Build Steppe lanes, out-position opponents, and control the road through lawful logistics.','archSpiritName':'Sevra, Keeper of Measured Thirst','isActive':False,'isStarterDeck':False,'isAvailableInShop':False,'cards':[{'name':'Sevra, Keeper of Measured Thirst','quantity':1},{'name':'Sevra, Breaker of the Hidden Seal','quantity':1},{'name':'Sevra, Mother of the Open Wells','quantity':1},{'name':'Oasis Plot Monomorpha','quantity':3},{'name':'Suntrack Monomorpha','quantity':3},{'name':'Canyon Spine Dimorpha','quantity':2},{'name':'Wellroute Dimorpha','quantity':2},{'name':'Lost Atlas Trimorpha','quantity':1},{'name':'Open Wells Trimorpha','quantity':1},{'name':'Sidepath Burrow Runner','quantity':3},{'name':'Wellsquare Registrar','quantity':3},{'name':'Dustwind Sylph Courier','quantity':2},{'name':'Oasis Lantern Steward','quantity':3},{'name':'Steppe Ledger Rider','quantity':3},{'name':'Sunvault Mason','quantity':3},{'name':'Bazaar Mask Trickster','quantity':3},{'name':'Common Road Pathfinder','quantity':3},{'name':'Saltwind Pack Spear','quantity':2},{'name':'Veiled Spring Adjudicator','quantity':2},{'name':'Brass Sepulcher Basilisk','quantity':1},{'name':'Canal-Heart Mechanist','quantity':1},{'name':'Sun Ledger Processioner','quantity':1},{'name':'Canyon Gale Standard','quantity':1},{'name':'Samir, Grace of Shared Water','quantity':1},{'name':'Water for the Road','quantity':2},{'name':'Expose the Toll Fraud','quantity':2},{'name':'Incomplete Map, Honest Path','quantity':2},{'name':'Reopen the Canyon Way','quantity':2},{'name':'The Ledger Speaks at Sunrise','quantity':1},{'name':'Broken Cistern of Nahar','quantity':1},{'name':'Sand-Swerve Intercept','quantity':1},{'name':'Mirage Detour','quantity':1},{'name':'Canyon Rebuke','quantity':1}]}
issues='''# Sunscar Caravans — Live Catalog Issue Log\n\nDeck: **Sun Ledger Procession**\nPlan file: `cardgen/sunscar_caravans_card_plan.json`\nPrebuilt manifest: `cardgen/sunscar_caravans_prebuilt_manifest.json`\n\n## Summary\n- Prepared **31 catalog definitions** for Sunscar Caravans.\n- Live prebuilt uses the standardized **12-card Terramorpha package** aligned to Field/Mountain → Steppe identity.\n- ArchSpirit costs normalized to **10 / 6+1 / 7+2**.\n\n## Key rewrites / compromises\n- Removed once-per-turn caps from **Caravan Counted** and **Proper Distribution**.\n- **Reopen the Caravan Way**, **Dustwind Sylph Courier**, and **Common Road Pathfinder** use `+1 MP this turn` instead of exact one-tile movement.\n- **Law Travels Faster Than Greed** makes unblockable unconditional while on Steppe.\n- **Samir, Grace of Shared Water** was simplified from adjacency-to-Steppe-tile logic into a normal adjacency aura.\n- Tier 3 death-prevention text (**No Caravan Seized**) remains omitted from the live plan.\n- **Open Wells Colossus** keeps only the stable Steppe-wide +1/+1 rider.\n'''
return cards, manifest, issues
# ---------- Tidecrown ----------
def tide():
cards=[]
cards += [unit('Ilyra, Exiled Daughter','A sea-cloaked noblewoman stands at a storm harbor at dusk, the empty Tidecrown reflected in tidal pools and lantern glass around her.','Island',10,0,8,2,1,'Walk',2,1,2,['Elfkin','Leader'],RARITY['arch1'],[passive_affs('Steward of Tides, Not Owner',['Lake','Ocean','Island'],[mod('Defense',1,'Max')],'Friendly units on Lake, Ocean, or Island gain +1 Defense.'),ability('Recall the Convoy','Active','Target friendly unit gains +1 MP this turn. If it is on Island, draw 1 then discard 1.',[action(target('Unit','Owner'),[mod('MP',1,'Current')],duration=dur_turn()),action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':1,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}],[cond_aff('Island')])],Cost=[{'Type':'SpiritPoints','Amount':1}],Range={'Min':1,'Max':3},UsesPerTurn=1),ability('Harbor Testimony','Triggered','When a friendly Spirit enters the battlefield on Island, gain 1 SP.',[action(target('Player','Owner',scope='Player'), [{'$type':'ModifySP','Amount':fixed(1)}])],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Spirit',Ownership='Owner'),ActivationConditions=[cond_aff('Island')])],card_type='ArchSpirit',tier=1,min_channel=1,max_channel=3), unit('Ilyra, Tide-Law Restorer','Ilyra stands on a shattered quay as signal fires burn down the coast, the court’s banners behind her and relief sails beyond her.','Island',6,1,10,3,2,'Walk',2,1,2,['Elfkin','Leader'],RARITY['arch2'],[passive_affs('Open Harbor Doctrine',['Island'],[mod('Damage',1),setflag('CanBeObstructed',False)],'Friendly Spirits on Island gain +1 Damage and cannot be obstructed.', spirit_only=True),ability('Seize the Registry','Active','Target enemy loses CanMove until end of turn. If it is on Island, it also loses CanAttack until end of turn.',[action(target('Unit','Enemy'),[setflag('CanMove',False)],duration=dur_turn()),action(target('Unit','Target'),[setflag('CanAttack',False)],[cond_aff('Island')],dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':2}],Range={'Min':1,'Max':4},UsesPerTurn=1),ability('Safe Passage Recognized','Triggered','When another friendly unit enters this aura range, it gains +1 current Defense.',[action(target('Unit','Target'),[mod('Defense',1,'Current')])],AuraRange={'Min':1,'Max':2},TriggerEvent=trig('OnEnterAuraRange',AuraOwnership='Owner',UnitOwnership='Owner'))],card_type='ArchSpirit',tier=2,prev='Ilyra, Exiled Daughter',min_channel=1,max_channel=4), unit('Ilyra, Crown of Open Harbors','Ascended Ilyra stands upon a tide bridge of coral law and iron registry chains while storm and dawn split the sea behind her.','Island',7,2,12,4,3,'Walk',2,1,2,['Elfkin','Leader'],RARITY['arch3'],[passive_affs('Let the Hungry Through',['Lake','Ocean','Island'],[mod('Damage',1),mod('Health',1,'Max')],'Friendly units on Lake, Ocean, or Island gain +1/+1.'),ability('Reopen the Harbor Chain','Active','Target tile becomes Island. Then target friendly unit gains +1 MP this turn.',[action(target('Tile','Any'), [{'$type':'PushFinalAffinity','Affinity':fixed('Island')}]),action(target('Unit','Owner'),[mod('MP',1,'Current')],duration=dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':3}],Range={'Min':1,'Max':5},UsesPerTurn=1)],card_type='ArchSpirit',tier=3,prev='Ilyra, Tide-Law Restorer',min_channel=1,max_channel=5), terr('Harbor Basin Monomorpha','A sheltered basin of calm water forms amid wreckage and storm chop.','Lake','Mono',2), terr('Stormwake Monomorpha','A single clean sea-lane opens through the gale under convoy lamps.','Ocean','Mono',2), terr('Stormlane Dimorpha','Twin bands of black-blue current carve reliable convoy lines through the gale.','Ocean','Di',3), terr('Ballast Chain Dimorpha','Two linked harbor channels deepen into lawful approach lanes.','Lake','Di',3), terr('Harbor Crown Trimorpha','Three ports relight in sequence across the archipelago under storm and law.','Lake','Tri',4,'Rare'), terr('Open Passage Trimorpha','Three linked sea-roads strike clean through rain-black water.','Ocean','Tri',4,'Rare')]
specs=[('Dock-Warren Listener','A quick dockside watcher races along ropes and fish crates with three rumors and one knife.','Lake',1,0,1,1,1,'Walk',3,1,1,['Meerkat','Scout'],'Common',ability('Dockside Ledger','Triggered','On channel, draw 1 then discard 1.',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':1,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}])],TriggerEvent=trig('OnChanneled',CardType='Spirit',Ownership='Owner',Filter={'$type':'IsSelf'}))),('Skywake Relay Squire','A young rider crosses sea spray and towerlight at impossible speed.','Ocean',1,0,2,0,1,'Flight',4,1,1,['Hippogriff','Courier'],'Common',ability('Relay Stamp','Triggered','When this moves onto Island, gain 1 SP.',[action(target('Player','Owner',scope='Player'), [{'$type':'ModifySP','Amount':fixed(1)}])],TriggerEvent=trig('OnUnitMove',Ownership='ExactSelf'),ActivationConditions=[cond_aff('Island','Self')])),('Ballast Fault Reader','A salvage diver inspects cracked ballast channels by lantern and tideglass.','Lake',2,0,2,1,1,'Walk',2,1,2,['Giant Salamander','Engineer'],'Common',ability('Ballast Fault Cited','Triggered','When this enters, target enemy loses CanUseAbility until end of turn.',[action(target('Unit','Enemy'),[setflag('CanUseAbility',False)],duration=dur_turn())],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),('Shrineback Currentbearer','A small shrine-shell ferries votive lamps and refugees between rain-dark reefs.','Ocean',2,0,2,2,1,'Walk',2,1,1,['Green Sea Turtle'],'Common',ability('Currentbearer Aura','Aura','Friendly units in aura range gain +1 Defense.',[action(target('Unit','Owner',all=True),[mod('Defense',1,'Max')])],AuraRange={'Min':1,'Max':1})),('Island Registry Keeper','A harbor registrar stamps seawet ledgers while gulls wheel overhead.','Island',2,0,2,1,2,'Walk',3,1,1,['Elfkin','Clerk'],'Common',ability('Registry Intake','Triggered','When this enters on Island, draw 1.',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':1,'Player':'Owner'}],[cond_aff('Island','Self')])],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),('Frostglass Winterguard','A broad northern guardian plants a winter spear on a frozen quay.','Lake',3,0,3,2,2,'Walk',2,1,1,['Polar Bear'],'Uncommon',ability('Winterglass Pressure','Aura','Adjacent enemies have -1 Damage.',[action(target('Unit','Enemy',all=True,filters=[{'$type':'IsAdjacentToSource'}]),[mod('Damage',-1)])],AuraRange={'Min':1,'Max':1})),('Galecrest Rescue Rider','A storm rider snatches survivors from a shattering mast while lightning webs behind him.','Ocean',3,0,3,1,2,'Flight',4,1,1,['Hippogriff','Soldier'],'Uncommon',ability('Rescue Vector','Triggered','When this enters, another friendly unit gains +1 MP this turn.',[action(target('Unit','Owner'),[mod('MP',1,'Current')],duration=dur_turn())],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),('Open Harbor Adjudicator','A mantis duelist stands in rain under lantern law, blade lowered but decisive.','Island',3,0,3,2,2,'Walk',2,1,2,['Praying Mantis','Jurist'],'Uncommon',ability('Harbor Adjudication','Active','Target enemy loses CanAttack until end of turn.',[action(target('Unit','Enemy'),[setflag('CanAttack',False)],duration=dur_turn())],Cost=[{'Type':'SpiritPoints','Amount':1}],Range={'Min':1,'Max':2},UsesPerTurn=1)),('Mourning Tide Witness','A drowned sailor points from the rail of a spectral wreck toward the living liar on shore.','Ocean',4,0,4,1,2,'Walk',2,1,2,['Ghost'],'Rare',ability('Mourning Accusation','Triggered','When this enters, target enemy loses CanMove until end of turn.',[action(target('Unit','Enemy'),[setflag('CanMove',False)],duration=dur_turn())],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),('Harbor Chain Marshal','A chainmail harbor commander directs relief hulls and war galleys with the same grim precision.','Island',4,0,4,2,3,'Walk',2,1,1,['Elfkin','Officer'],'Rare',ability('Chain Marshal Aura','Aura','Friendly Island units in aura range gain +1 Damage.',[action(target('Unit','Owner',all=True),[mod('Damage',1)],[cond_aff('Island')])],AuraRange={'Min':1,'Max':2})),('Drowned Archive Diver','A diver surfaces from coral-law ruins carrying a tablet wrapped in eel-skin and chains.','Lake',4,0,4,2,2,'Walk',2,1,2,['Giant Salamander','Salvager'],'Rare',ability('Recovered Logs','Triggered','If this enters on Island, draw 2 then discard 1.',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':2,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}],[cond_aff('Island','Self')])],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),('Storm Coast Interceptor','A veteran patrol rider cuts through rain-black sky with a legal pennant crackling from the saddle.','Ocean',4,0,4,2,2,'Flight',3,1,2,['Hippogriff','Officer'],'Rare',ability('Storm Intercept','Aura','Friendly Island units in aura range cannot be blocked.',[action(target('Unit','Owner',all=True),[setflag('CanBeBlocked',False)],[cond_aff('Island')])],AuraRange={'Min':1,'Max':2})),('Shellfather Convoyback','A massive shrine-backed elder turtle bears lamps, children, and legal banners across stormwater.','Island',5,0,5,3,2,'Walk',2,1,2,['Green Sea Turtle','Elder'],'Epic',ability('Convoy Shelter','Triggered','When a friendly unit enters this aura range, heal it 1.',[action(target('Unit','Target'),[{'$type':'HealDamage','Amount':fixed(1)}])],AuraRange={'Min':1,'Max':2},TriggerEvent=trig('OnEnterAuraRange',AuraOwnership='Owner',UnitOwnership='Owner'))),('Wake-Choir Accuser','Overlapping drowned voices rise around a half-sunk admiral standard and point as one.','Ocean',5,0,5,2,3,'Walk',2,1,2,['Ghost'],'Epic',ability('Wake-Choir Silence','Aura','Enemies in aura range lose CanUseAbility.',[action(target('Unit','Enemy',all=True),[setflag('CanUseAbility',False)])],AuraRange={'Min':1,'Max':2})),('Joren, Last Writ Through the Gale','A lone courier punches through impossible stormlight with the evidence case chained to his chest.','Ocean',5,0,5,2,3,'Flight',4,1,1,['Hippogriff','Heroic'],'Legendary',ability('Carry the Last Writ','Triggered','When this enters, another friendly unit gains +1 MP and cannot be attacked until end of turn.',[action(target('Unit','Owner'),[mod('MP',1,'Current'),setflag('CanBeAttacked',False)],duration=dur_turn())],TriggerEvent=trig('OnUnitEnterBattlefield',UnitType='Unit',Ownership='Owner',Filter={'$type':'IsSelf'}))),('Tidecrown Leviathan','A colossal sea-shadow rises beneath convoy lanterns and court banners as though the old law itself has taken form.','Island',7,1,7,3,4,'Flight',2,1,2,['Mythic Sea Beast'],'Legendary',ability('Law Below the Waves','Passive','Friendly Island units gain +1/+1.',[action(target('Unit','Owner',all=True),[mod('Damage',1),mod('Health',1,'Max')],[cond_aff('Island')])]))]
cards += [unit(n,d,a,sp,st,hp,df,dm,mv,mp,r1,r2,g,rar,[ab]) for (n,d,a,sp,st,hp,df,dm,mv,mp,r1,r2,g,rar,ab) in specs]
cards += [spell('Harbor Amnesty','Chains fall from a closed port gate and relief ships slip through before anyone can reverse the order.','Island',1,'Common',[action(target('Unit','Owner'),[setflag('CanBeAttacked',False)],duration=dur_turn())],'Repentance'),spell('Seize the Ballast Logs','Divers retrieve sabotage records from the queen’s wrecked flagship by lantern and prayer.','Lake',2,'Common',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':2,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}])],'Repentance'),spell('Stormlane Reroute','Signal fires leap from tower to tower and the convoy changes course under the enemy’s nose.','Ocean',2,'Common',[action(target('Unit','Owner'),[mod('MP',2,'Current')],duration=dur_turn())],'Repentance'),spell('Restore the Harbor Chain','Closed ports relight one by one across the archipelago as lawful authority returns.','Island',3,'Uncommon',[action(target('Tile','Any'), [{'$type':'PushFinalAffinity','Affinity':fixed('Island')}]),action(target('Unit','Owner'),[mod('Defense',1,'Current')],duration=dur_turn())],'Repentance'),spell('Maritime Justice Declared','Court, convoy, and ghost witness all align in one storm-ringed proclamation.','Island',4,'Rare',[action(target('Unit','Owner',all=True),[mod('Damage',1),mod('Health',1,'Max'),setflag('CanUseAbility',True)],[cond_aff('Island')],dur_turn())],'Repentance'),ruin('Queen’s Lantern Reef','The reef where the drowned queen’s route-lamps still burn beneath the water whenever a rightful witness approaches.','Island',3,'Rare',[ability('Lantern Reef Grant','Triggered','If occupied by a friendly unit when this activates, gain 1 SP.',[action(target('Player','Owner',scope='Player'), [{'$type':'ModifySP','Amount':fixed(1)}])],TriggerEvent=trig('OnRuinActivation',RuinOwnership='Owner',OccupantOwnership='Owner')),ability('Lantern Reef Logs','Triggered','If occupied by a friendly unit when this activates, draw 1 then discard 1.',[action(target('Player','Owner',scope='Player'), [{'$type':'DrawCards','N':1,'Player':'Owner'},{'$type':'DiscardCards','N':1,'Player':'Owner'}])],TriggerEvent=trig('OnRuinActivation',RuinOwnership='Owner',OccupantOwnership='Owner')),ability('Lantern Reef Condemnation','Triggered','If occupied by a friendly unit when this activates, target enemy in range loses CanAttack until end of turn.',[action(target('Unit','Enemy',filters=[{'$type':'WithinRange','Min':1,'Max':2}]),[setflag('CanAttack',False)],duration=dur_turn())],TriggerEvent=trig('OnRuinActivation',RuinOwnership='Owner',OccupantOwnership='Owner'))]),spell('Cut the Smuggler’s Line','A patrol swoops through rain and slices a hidden towline clean.','Ocean',1,'Common',[action(target('Unit','Enemy'),[setflag('CanMove',False)],duration={'Type':'UntilEndOfSequence'})],'Instinct'),spell('Breakwater Shelter','An ally ducks behind stone, hull, and spray just before the strike lands.','Lake',2,'Common',[action(target('Unit','Owner'),[setflag('CanBeAttacked',False)],duration=dur_turn())],'Instinct'),spell('The Dead Point and Speak','Spectral hands rise from surf and the guilty forget every practiced lie at once.','Island',2,'Common',[action(target('Unit','Enemy'),[setflag('CanUseAbility',False)],duration={'Type':'UntilEndOfSequence'})],'Instinct')]
manifest={'name':'Open Harbors Claim','description':'Lake/Ocean mobile-control deck for Tidecrown Intrigue. Build Island footholds, stabilize with convoy law, and win through route control and evidence.','archSpiritName':'Ilyra, Exiled Daughter','isActive':False,'isStarterDeck':False,'isAvailableInShop':False,'cards':[{'name':'Ilyra, Exiled Daughter','quantity':1},{'name':'Ilyra, Tide-Law Restorer','quantity':1},{'name':'Ilyra, Crown of Open Harbors','quantity':1},{'name':'Harbor Basin Monomorpha','quantity':3},{'name':'Stormwake Monomorpha','quantity':3},{'name':'Stormlane Dimorpha','quantity':2},{'name':'Ballast Chain Dimorpha','quantity':2},{'name':'Harbor Crown Trimorpha','quantity':1},{'name':'Open Passage Trimorpha','quantity':1},{'name':'Dock-Warren Listener','quantity':3},{'name':'Skywake Relay Squire','quantity':3},{'name':'Ballast Fault Reader','quantity':3},{'name':'Shrineback Currentbearer','quantity':3},{'name':'Island Registry Keeper','quantity':3},{'name':'Frostglass Winterguard','quantity':3},{'name':'Galecrest Rescue Rider','quantity':2},{'name':'Open Harbor Adjudicator','quantity':3},{'name':'Mourning Tide Witness','quantity':1},{'name':'Harbor Chain Marshal','quantity':2},{'name':'Drowned Archive Diver','quantity':1},{'name':'Storm Coast Interceptor','quantity':1},{'name':'Shellfather Convoyback','quantity':1},{'name':'Wake-Choir Accuser','quantity':1},{'name':'Joren, Last Writ Through the Gale','quantity':1},{'name':'Tidecrown Leviathan','quantity':1},{'name':'Harbor Amnesty','quantity':2},{'name':'Seize the Ballast Logs','quantity':2},{'name':'Stormlane Reroute','quantity':2},{'name':'Restore the Harbor Chain','quantity':2},{'name':'Maritime Justice Declared','quantity':1},{'name':'Queen’s Lantern Reef','quantity':1},{'name':'Cut the Smuggler’s Line','quantity':1},{'name':'Breakwater Shelter','quantity':1},{'name':'The Dead Point and Speak','quantity':1}]}
issues='''# Tidecrown Intrigue — Live Catalog Issue Log\n\nDeck: **Open Harbors Claim**\nPlan file: `cardgen/tidecrown_intrigue_card_plan.json`\nPrebuilt manifest: `cardgen/tidecrown_intrigue_prebuilt_manifest.json`\n\n## Summary\n- Prepared **31 catalog definitions** for Tidecrown Intrigue.\n- Live prebuilt uses the standardized **12-card Terramorpha package** aligned to Lake/Ocean → Island identity.\n- ArchSpirit costs normalized to **10 / 6+1 / 7+2**.\n\n## Key rewrites / compromises\n- Removed once-per-turn caps from **Harbor Testimony** and **Safe Passage Recognized**.\n- **Recall the Convoy**, **Reopen the Harbor Chain**, **Galecrest Rescue Rider**, and **Joren** use MP buffs instead of exact reposition.\n- **Drowned Archive Diver** is locked to the stronger Island branch (`draw 2, discard 1`).\n- **Storm Coast Interceptor** was rewritten from movement-into-Island logic into a simpler Island aura granting unblockable.\n- Tier 3 death-prevention text (**No Convoy Turned Away**) remains omitted from the live plan.\n- **Tidecrown Leviathan** keeps only the stable Island-wide +1/+1 rider.\n'''
return cards, manifest, issues
for stem, builder in [
('amberthrone_fields', amber),
('greenveil_reckoning', green),
('sunscar_caravans', sunscar),
('tidecrown_intrigue', tide),
]:
cards, manifest, issues = builder()
write_json(f'{stem}_card_plan.json', cards)
write_json(f'{stem}_prebuilt_manifest.json', manifest)
(BASE/f'{stem}_issue_log.md').write_text(issues)
print(stem, len(cards), sum(c['quantity'] for c in manifest['cards']))