Name:The Day of the Doctor
ManaCost:3 R W
Types:Enchantment Saga
K:Chapter:4:DBDig,DBDig,DBDig,DBChoose
SVar:DBDig:DB$ DigUntil | Defined$ You | Valid$ Card.Legendary | FoundDestination$ Exile | RevealedDestination$ Exile | RememberRevealed$ True | ImprintFound$ True | SubAbility$ DBEffect | SpellDescription$ Exile cards from the top of your library until you exile a legendary card. You may play that card for as long as CARDNAME remains on the battlefield. Put the rest of those exiled cards on the bottom of your library in a random order.
SVar:DBEffect:DB$ Effect | StaticAbilities$ MayPlay | RememberObjects$ Imprinted | Duration$ UntilHostLeavesPlay | ForgetOnMoved$ Exile | SubAbility$ DBRestRandomOrder
SVar:MayPlay:Mode$ Continuous | Affected$ Card.IsRemembered | MayPlay$ True | EffectZone$ Command | AffectedZone$ Exile | Description$ You may play that card for as long as CARDNAME remains on the battlefield.
SVar:DBRestRandomOrder:DB$ ChangeZoneAll | ChangeType$ Card.IsRemembered+IsNotImprinted | Origin$ Exile | Destination$ Library | LibraryPosition$ -1 | RandomOrder$ True | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | ClearImprinted$ True
SVar:DBChoose:DB$ ChooseCard | Defined$ You | MinAmount$ 0 | Amount$ 3 | Choices$ Doctor | ChoiceTitle$ Choose up to three Doctors | SubAbility$ DBGenericChoice | SpellDescription$ Choose up to three Doctors. You may exile all other creatures. If you do, CARDNAME deals 13 damage to you.
SVar:DBGenericChoice:DB$ GenericChoice | Choices$ DBExileAll,DBCleanupBis
SVar:DBExileAll:DB$ ChangeZoneAll | ChangeType$ Creature.nonChosenCard | Origin$ Battlefield | Destination$ Exile | SubAbility$ DBDamage | SpellDescription$ Exile all other creatures. If you do, CARDNAME deals 13 damage to you.
SVar:DBDamage:DB$ DealDamage | Defined$ You | NumDmg$ 13 | SubAbility$ DBCleanupBis
SVar:DBCleanupBis:DB$ Cleanup | ClearChosenCard$ True | SpellDescription$ Don't exile all other creatures.
AI:RemoveDeck:Random
DeckNeeds:Type$Doctor|Legendary
Oracle:I, II, III — Exile cards from the top of your library until you exile a legendary card. You may play that card for as long as The Day of the Doctor remains on the battlefield. Put the rest of those exiled cards on the bottom of your library in a random order.\nIV — Choose up to three Doctors. You may exile all other creatures. If you do, The Day of the Doctor deals 13 damage to you.
