Name:Builder's Bane
ManaCost:X X R
Types:Sorcery
A:SP$ Destroy | ValidTgts$ Artifact | TargetMin$ 0 | TargetMax$ MaxTgt | RememberTargets$ True | SubAbility$ DBRepeat | StackDescription$ SpellDescription | SpellDescription$ Destroy X target artifacts. CARDNAME deals damage to each player equal to the number of artifacts they controlled that were put into a graveyard this way.
SVar:MaxTgt:Count$Valid Artifact
SVar:X:TargetedObjects$Amount
SVar:DBRepeat:DB$ RepeatEach | RepeatPlayers$ Player | RepeatSubAbility$ DBDmg | SubAbility$ DBCleanup | DamageMap$ True
SVar:DBDmg:DB$ DealDamage | Defined$ Player.IsRemembered | NumDmg$ Y
SVar:Y:Count$ValidGraveyard Artifact.IsRemembered+RememberedPlayerCtrl
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
Oracle:Destroy X target artifacts. Builder's Bane deals damage to each player equal to the number of artifacts they controlled that were put into a graveyard this way.
