Name:Juxtapose
ManaCost:3 U
Types:Sorcery
A:SP$ ChooseCard | ValidTgts$ Player | Choices$ Creature.cmcEQY | TargetControls$ True | Mandatory$ True | AILogic$ WorstCard | RememberChosen$ True | SubAbility$ DBChooseCreatureYou | SpellDescription$ You and target player exchange control of the creature you each control with the highest mana value. Then exchange control of artifacts the same way. If two or more permanents a player controls are tied for highest, their controller chooses one of them.
SVar:DBChooseCreatureYou:DB$ ChooseCard | Choices$ Creature.YouCtrl+cmcEQX | Mandatory$ True | RememberChosen$ True | SubAbility$ DBExchangeCreature
SVar:DBExchangeCreature:DB$ ExchangeControl | Defined$ Remembered | SubAbility$ DBCleanCreature
SVar:DBCleanCreature:DB$ Cleanup | ClearRemembered$ True | SubAbility$ DBChooseArtifactYou
SVar:DBChooseArtifactYou:DB$ ChooseCard | Choices$ Artifact.YouCtrl+cmcEQZ | Mandatory$ True | RememberChosen$ True | SubAbility$ DBChooseArtifactOpp
SVar:DBChooseArtifactOpp:DB$ ChooseCard | Defined$ ParentTarget | Choices$ Artifact.cmcEQW | TargetControls$ True | Mandatory$ True | AILogic$ WorstCard | RememberChosen$ True | SubAbility$ DBExchangeArtifact
SVar:DBExchangeArtifact:DB$ ExchangeControl | Defined$ Remembered | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Count$Valid Creature.YouCtrl$GreatestCMC
SVar:Y:Count$Valid Creature.TargetedPlayerCtrl$GreatestCMC
SVar:Z:Count$Valid Artifact.YouCtrl$GreatestCMC
SVar:W:Count$Valid Artifact.TargetedPlayerCtrl$GreatestCMC
AI:RemoveDeck:All
Oracle:You and target player exchange control of the creature you each control with the highest mana value. Then exchange control of artifacts the same way. If two or more permanents a player controls are tied for highest, their controller chooses one of them.
