Name:Haunting Echoes
ManaCost:3 B B
Types:Sorcery
A:SP$ ChangeZoneAll | Origin$ Graveyard | Destination$ Exile | ValidTgts$ Player | TgtPrompt$ Select target player | ChangeType$ Card.nonBasic | RememberChanged$ True | SubAbility$ DBRepeat | SpellDescription$ Exile all cards from target player's graveyard other than basic land cards. For each card exiled this way, search that player's library for all cards with the same name as that card and exile them. Then that player shuffles.
SVar:DBRepeat:DB$ ChangeZone | Origin$ Library | DefinedPlayer$ Targeted | Destination$ Exile | ChangeType$ Card.sharesNameWith Remembered | ChangeNum$ X | Chooser$ You | Shuffle$ True | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:NeedsToPlayVar:Z GE1
SVar:X:TargetedPlayer$CardsInLibrary
SVar:Z:SVar$Z1/Plus.Z2
SVar:Z1:Count$ValidGraveyard Card.nonLand+OppOwn
SVar:Z2:Count$ValidGraveyard Card.Land+nonBasic+OppOwn
Oracle:Exile all cards from target player's graveyard other than basic land cards. For each card exiled this way, search that player's library for all cards with the same name as that card and exile them. Then that player shuffles.
