magefree / mage

Magic Another Game Engine
http://xmage.today
MIT License
1.81k stars 748 forks source link

Karn Liberated restarting the game ability doesn't un-transform deafeated battles before making library #11401

Open e314 opened 8 months ago

e314 commented 8 months ago

[[Karn Liberated]] -14 ability will shuffle a defated [[invasion of Tolvada]] as an uncastable double-face The Broken Sky on both sides. Card in hand

github-actions[bot] commented 8 months ago

Karn Liberated - (Gatherer) (Scryfall) (EDHREC)

{7} Legendary Planeswalker — Karn 6 +4: Target player exiles a card from their hand. −3: Exile target permanent. −14: Restart the game, leaving in exile all non-Aura permanent cards exiled with Karn Liberated. Then put those cards onto the battlefield under your control.

Invasion of Tolvada // The Broken Sky - (Gatherer) (Scryfall) (EDHREC)

{3}{W}{B} Battle — Siege (As a Siege enters, choose an opponent to protect it. You and others can attack it. When it's defeated, exile it, then cast it transformed.) When Invasion of Tolvada enters the battlefield, return target nonbattle permanent card from your graveyard to the battlefield. :arrows_counterclockwise: Enchantment Creature tokens you control get +1/+0 and have lifelink. At the beginning of your end step, create a 1/1 white and black Spirit creature token with flying.

JayDi85 commented 8 months ago

For info: I look at karn’s game restart code few days ago and found many potential problems with it. Thats workaround to simulate a game restart must be reworked to use a real new game instead cleaning and preparing existing one (some data keeps between karn’s restarts and it can cause potential bugs).

xenohedron commented 8 months ago

Agree that a full rework could be more robust, but maybe it's possible to do some additional data cleaning with the current workaround? For example, looping through all permanents on the battlefield to setTransformed(false) right before clearing battlefield.