Name:Barrowgoyf
ManaCost:2 B
Types:Creature Lhurgoyf
PT:*/1+*
K:Deathtouch
K:Lifelink
S:Mode$ Continuous | EffectZone$ All | CharacteristicDefining$ True | SetPower$ X | SetToughness$ Y | Description$ CARDNAME's power is equal to the number of card types among cards in all graveyards and its toughness is equal to that number plus 1.
SVar:X:Count$ValidGraveyard Card$CardTypes
SVar:Y:SVar$X/Plus.1
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | OptionalDecider$ You | Execute$ TrigMill | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, you may mill that many cards. If you do, you may put a creature card from among them into your hand.
SVar:TrigMill:DB$ Mill | Defined$ You | NumCards$ Z | RememberMilled$ True | SubAbility$ DBChangeZone
SVar:DBChangeZone:DB$ ChangeZone | Hidden$ True | Origin$ Graveyard,Exile | Destination$ Hand | ChangeType$ Creature.IsRemembered | SelectPrompt$ You may select a creature card among the cards milled this way | Optional$ True | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:Z:TriggerCount$DamageAmount
DeckHas:Ability$Mill|Graveyard|LifeGain
DeckHints:Ability$Mill|Graveyard
Oracle:Deathtouch, lifelink\nBarrowgoyf's power is equal to the number of card types among cards in all graveyards and its toughness is equal to that number plus 1.\nWhenever Barrowgoyf deals combat damage to a player, you may mill that many cards. If you do, you may put a creature card from among them into your hand.
