From 00dedb359a4cc33e63c435624d378825818752a6 Mon Sep 17 00:00:00 2001 From: jmharmon <37360760+jmharmon@users.noreply.github.com> Date: Tue, 3 Sep 2019 23:30:41 -0700 Subject: [PATCH] Implement GildedGoose --- Mage.Sets/src/mage/cards/GildedGoose.java | 71 +++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/GildedGoose.java diff --git a/Mage.Sets/src/mage/cards/GildedGoose.java b/Mage.Sets/src/mage/cards/GildedGoose.java new file mode 100644 index 00000000000..e733ac281e2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/GildedGoose.java @@ -0,0 +1,71 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.mana.ActivatedManaAbilityImpl; +import mage.abilities.mana.AnyColorManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.custom.FoodToken; +import mage.target.common.TargetControlledPermanent; + +import java.util.UUID; + +/** + * + * @author jmharmon + */ + +public final class GildedGoose extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Food"); + + static { + filter.add(new SubtypePredicate(SubType.FOOD)); + } + + public GildedGoose(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}"); + this.subtype.add(SubType.BIRD); + + this.power = new MageInt(0); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Gilded Goose enters the battlefield, create a Food token. (It’s an artifact with “{2}, {T}, Sacrifice this artifact: You gain 3 life.”) + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new FoodToken()), false)); + + // {1}{G}, {T}: Create a Food token. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new FoodToken()), new ManaCostsImpl("{1}{G}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {T}, Sacrifice a Food: Add one mana of any color. + ActivatedManaAbilityImpl ability1 = new AnyColorManaAbility(new TapSourceCost()); + ability1.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + this.addAbility(ability1); + } + + public GildedGoose(final GildedGoose card) { + super(card); + } + + @Override + public GildedGoose copy() { + return new GildedGoose(this); + } +}