Name:Bazaar of Wonders
ManaCost:3 U U
Types:World Enchantment
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ExileAll | TriggerDescription$ When CARDNAME enters, exile all graveyards.
SVar:ExileAll:DB$ ChangeZoneAll | Origin$ Graveyard | Destination$ Exile | ChangeType$ Card
T:Mode$ SpellCast | ValidCard$ Card | Execute$ TrigCounterSameGrave | TriggerZones$ Battlefield | TriggerDescription$ Whenever a player casts a spell, counter it if a card with the same name is in a graveyard or a nontoken permanent with the same name is on the battlefield.
SVar:TrigCounterSameGrave:DB$ Counter | Defined$ TriggeredSpellAbility | SubAbility$ DBCounterSamePermanent | ConditionCheckSVar$ SharesNameGrave | ConditionSVarCompare$ GE1
SVar:DBCounterSamePermanent:DB$ Counter | Defined$ TriggeredSpellAbility | ConditionCheckSVar$ SharesNameBattlefield | ConditionSVarCompare$ GE1
SVar:SharesNameGrave:TriggeredCard$Valid Card.sharesNameWith Graveyard
SVar:SharesNameBattlefield:TriggeredCard$Valid Card.sharesNameWith NonToken
SVar:AICurseEffect:BazaarOfWonders
AI:RemoveDeck:Random
Oracle:When Bazaar of Wonders enters, exile all graveyards.\nWhenever a player casts a spell, counter it if a card with the same name is in a graveyard or a nontoken permanent with the same name is on the battlefield.
