Name:Invasive Surgery
ManaCost:U
Types:Instant
A:SP$ Counter | TargetType$ Spell | ValidTgts$ Sorcery | SubAbility$ ExileYard | SpellDescription$ Counter target sorcery spell. Delirium — If there are four or more card types amongst cards in your graveyard, search the graveyard, hand, and library of that spell's controller for cards with the same name as that spell, exile those cards, then that player shuffles their library.
SVar:ExileYard:DB$ ChangeZone | Condition$ Delirium | Origin$ Graveyard | Destination$ Exile | DefinedPlayer$ TargetedController | ChangeType$ TargetedCard.sameName | ChangeNum$ NumInYard | Chooser$ You | Hidden$ True | SubAbility$ ExileHand | StackDescription$ None
SVar:ExileHand:DB$ ChangeZone | Condition$ Delirium | Origin$ Hand | Destination$ Exile | DefinedPlayer$ TargetedController | ChangeType$ TargetedCard.sameName | ChangeNum$ NumInHand | Chooser$ You | SubAbility$ ExileLib | StackDescription$ None
SVar:ExileLib:DB$ ChangeZone | Condition$ Delirium | Origin$ Library | Destination$ Exile | DefinedPlayer$ TargetedController | ChangeType$ TargetedCard.sameName | ChangeNum$ NumInLib | Chooser$ You | Shuffle$ True | StackDescription$ None
SVar:NumInLib:TargetedController$CardsInLibrary
SVar:NumInHand:TargetedController$CardsInHand
SVar:NumInYard:TargetedController$CardsInGraveyard
DeckHints:Ability$Graveyard|Discard
DeckHas:Ability$Delirium
Oracle:Counter target sorcery spell.\nDelirium — If there are four or more card types among cards in your graveyard, search the graveyard, hand, and library of that spell's controller for any number of cards with the same name as that spell, exile those cards, then that player shuffles.
