GameInvariants checks card counts, unique instance ids and damage. The CLI stress command runs random legal bot games and fails on the first violation. It exposed a real bug: an optional OnGuard ability that could not be paid (or was declined) reset the step from Guard to None while the battle was still open. OfferAbility now reports Skipped/Paused/Resolved and callers continue only when needed. 1000/1000 games finish with no errors.
Normal units can no longer attack the back row; Wyvern Strike, Tejas attacks the back row of its own column. Demonic Dragon Berserker, Yaksha rides itself from hand when an opponent's rear-guard is retired during the main phase. Match replay: CommandCodec, MatchRecord, MatchRecorder, ReplayRunner and an FNV event hash; a JSON round-trip replays a full bot game bit-for-bit. Three tests; 116 total.
GameEngine.LegalCommands returns every meaningful command for the current phase, pending trigger, ability, order or choice. A random bot plays 50 deterministic games and checks that each player always has 50 cards across zones, instance ids stay unique and damage never exceeds six. Fixes found by the bot: search-to-call no longer loses a card when there is no empty circle (InTransit), a stand trigger with no rear-guards can resolve, unpayable optional abilities no longer stall the order, and legal intents skip impossible retire-self and repeated intercept commands.
New triggers: OnBoostedHit, OnRetireFromRC, OnOpponentRetire, OnGuard; activated abilities from hand and drop zone; superior ride from drop. Cards: Voidmaster, Hagakure, Dreadmaster, Monster Frank, Blightops, Llew, Dragon Knight Aleph, Gancelot hand effect, Deathrex second effect, Brigitte, Bors, Tristan, Starlight Unicorn, Goku, Berserk Dragon, Aermo, Joka, Rakshasa. Four tests; 111 total.
Asura Kaiser reacts to grade 3 Nova Grappler drive checks; Rock the Wall and Redshoe Milly move from the guardian circle to soul; Juggernaut and Brakki return to deck after battle; Lozenge and Battleraizer return at end of turn; Guiding Zombie puts itself into soul and mills three. Four tests; 102 total.
Two files were rewritten with Get-Content/Set-Content and lost their UTF-8 encoding. Restored the clean versions and re-applied the changes with an encoding-safe editor.
AskUnitMultiChoice asks one target at a time, offers Done once the minimum is met and resolves automatically at the maximum. CardRestriction models cannot-stand/attack/boost/intercept with source, effect id and duration, including UntilOwnerNextStand. Restraint can be overridden by effects. OnAttackHit now fires when the attack hits a rear-guard. Five tests.
StatModifier stores value, source card, effect id and duration (battle / turn / permanent), so a specific effect can be removed without touching others. GrantedAbility lets effects add abilities that are not printed on the card; the engine merges printed and granted abilities. Boost and trigger bonuses now use modifiers. Three tests.
AskHandCardChoice pauses on the hand and returns the chosen card, so abilities can pay discard costs interactively. Knight of Rose, Morgana implemented: on attack, optionally discard a card for +4000 until end of turn. Test covers the full pause chain and the return to the guard step.
OnAttackHit now fires after the damage check and after the card enters the damage zone, with a continuation when damage triggers pause. Added a resolution queue: triggers raised while an effect is resolving are stored and played back strictly one after another (depth counter on ResolveAbility and Choose). New test asserts damage exists before the hit effect is offered.
Added a command guard while an ability resolves, a continuation mechanism for mid-battle pauses, and TriggerAll for scanning the field. Cards: Demon Eater (soul charge at main phase start), Tyrant Deathrex (+5000 when attacking), Maiden of Libra (Counter Blast 2 and draw on hit). Three tests.
LookTopAndReorder asks top or bottom without revealing the deck. SearchDeckToCall and SearchDeckToRide wrap the search primitive; Alfred searches a Royal Paladin grade 2 or lower and calls it, Cocoa looks at the top card. Five tests.
SearchDeck hides the deck and returns matches only: none -> SearchFailedEvent and shuffle, one -> straight to the effect, several -> PendingChoice. Different arts are separate results, labelled with the printing id. Wired into Conroe, which pays Counter Blast 1 and retires itself. Four tests.
PendingChoice/ChooseCommand let effects ask the player to pick a unit. Added Counter Blast and Soul Blast cost helpers. Blaster Blade implemented for both zones with its CB2 cost and rear-guard target. Activated abilities pay rest-self and discard; Lake Maiden Lien, Gojo and Shout draw a card. Seven tests.
CardScript model with Triggered and Continuous abilities. Check Timing collects triggered abilities, orders them (turn player first, player picks the order via SelectTriggerCommand), and pauses on optional abilities (ResolveAbilityCommand). Continuous effects are recomputed on demand in EffectivePower. Scripts: Barcgal (optional call from soul), Wingal (+4000 when boosting Blaster Blade), Alfred (+2000 per Royal Paladin rear-guard). Six tests.
Grade 0-2 vanguard performs one check, grade 3+ performs two, rear-guards perform none by default. CardInstance.DriveChecksOverride lets effects remove Twin Drive or grant checks to a rear-guard. Added DriveCheckedEvent for the log. Five tests.
MoveCommand(from, to) in the Main phase. Only 0-3 (left) and 2-4 (right) are valid pairs; the center back row has no partner. Rested state stays with the card. Five tests.