Name:Part in Friendship
ManaCost:4 G
Types:Enchantment
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.YouCtrl+!token | TriggerZones$ Battlefield | Execute$ TrigDigUntil | ActivationLimit$ 1 | TriggerDescription$ Whenever a nontoken creature you control dies, reveal cards from the top of your library until you reveal a creature card. If its mana value is less than or equal to the number of lands you control, put it onto the battlefield. Otherwise, put it into your hand. Put the rest on the bottom of your library in a random order. This ability triggers only once each turn.
SVar:TrigDigUntil:DB$ DigUntil | Valid$ Creature | ValidDescription$ creature | NoMoveRevealed$ True | ImprintRevealed$ True | FoundDestination$ Library | FoundLibraryPosition$ 0 | RememberFound$ True | SubAbility$ DBBranch
SVar:DBBranch:DB$ Branch | BranchConditionSVar$ X | TrueSubAbility$ ToBattlefield | FalseSubAbility$ ToHand | SubAbility$ DBRestRandomOrder
SVar:ToBattlefield:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Battlefield
SVar:ToHand:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Hand
SVar:DBRestRandomOrder:DB$ ChangeZoneAll | ChangeType$ Card.IsImprinted | Origin$ Library | Destination$ Library | LibraryPosition$ -1 | RandomOrder$ True | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | ClearImprinted$ True
SVar:X:Remembered$Valid Card.cmcLEY
SVar:Y:Count$Valid Land.YouCtrl
SVar:PlayMain1:TRUE
Oracle:Whenever a nontoken creature you control dies, reveal cards from the top of your library until you reveal a creature card. If its mana value is less than or equal to the number of lands you control, put it onto the battlefield. Otherwise, put it into your hand. Put the rest on the bottom of your library in a random order. This ability triggers only once each turn.
