Name:Valakut Exploration
ManaCost:2 R
Types:Enchantment
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Land.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigExile | TriggerDescription$ Landfall — Whenever a land you control enters, exile the top card of your library. You may play that card for as long as it remains exiled.
SVar:TrigExile:DB$ Dig | Defined$ You | DigNum$ 1 | ChangeNum$ All | DestinationZone$ Exile | RememberChanged$ True | SubAbility$ DBEffect
SVar:DBEffect:DB$ Effect | StaticAbilities$ MayPlay | Duration$ Permanent | ForgetOnMoved$ Exile | RememberObjects$ Remembered | SubAbility$ DBCleanup
SVar:MayPlay:Mode$ Continuous | MayPlay$ True | Affected$ Card.IsRemembered | EffectZone$ Command | AffectedZone$ Exile | Description$ You may play this card for as long as it remains exiled.
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | Execute$ TrigGraveyard | CheckSVar$ Y | SVarCompare$ GT0 | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your end step, if there are cards exiled with CARDNAME, put them into their owner's graveyard, then CARDNAME deals that much damage to each opponent.
SVar:TrigGraveyard:DB$ ChangeZoneAll | ChangeType$ Card.ExiledWithSource | Origin$ Exile | Destination$ Graveyard | RememberChanged$ True | SubAbility$ DBDamageAll
SVar:DBDamageAll:DB$ DamageAll | ValidPlayers$ Player.Opponent | NumDmg$ X | SubAbility$ DBCleanup
SVar:X:Remembered$Amount
SVar:Y:Count$ValidExile Card.ExiledWithSource
SVar:BuffedBy:Land
DeckHas:Ability$Graveyard
Oracle:Landfall — Whenever a land you control enters, exile the top card of your library. You may play that card for as long as it remains exiled.\nAt the beginning of your end step, if there are cards exiled with Valakut Exploration, put them into their owner's graveyard, then Valakut Exploration deals that much damage to each opponent.
