From 2da8bbad5c643baad9172624e983d4f84c7356e8 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 5 Sep 2019 20:05:51 -0400 Subject: [PATCH] Implemented Gluttonous Troll --- .../src/mage/cards/g/GluttonousTroll.java | 71 +++++++++++++++++++ Mage.Sets/src/mage/sets/ThroneOfEldraine.java | 1 + 2 files changed, 72 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/g/GluttonousTroll.java diff --git a/Mage.Sets/src/mage/cards/g/GluttonousTroll.java b/Mage.Sets/src/mage/cards/g/GluttonousTroll.java new file mode 100644 index 0000000000..1e5ca339cd --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GluttonousTroll.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.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.OpponentsCount; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.permanent.token.FoodToken; +import mage.target.common.TargetControlledPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GluttonousTroll extends CardImpl { + + private static final FilterControlledPermanent filter + = new FilterControlledPermanent("another nonland permanent"); + + static { + filter.add(Predicates.not(new CardTypePredicate(CardType.LAND))); + filter.add(AnotherPredicate.instance); + } + + public GluttonousTroll(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{G}"); + + this.subtype.add(SubType.TROLL); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // When Gluttonous Troll enters the battlefield, create a number of Food tokens equal to the number of opponents you have. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect( + new FoodToken(), OpponentsCount.instance + ).setText("create a number of Food tokens equal to the number of opponents you have"))); + + // {1}{G}, Sacrifice another nonland permanent: Gluttonous Troll gets +2/+2 until end of turn. + Ability ability = new SimpleActivatedAbility( + new BoostSourceEffect(2, 2, Duration.EndOfTurn), new ManaCostsImpl("{1}{G}") + ); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + this.addAbility(ability); + } + + private GluttonousTroll(final GluttonousTroll card) { + super(card); + } + + @Override + public GluttonousTroll copy() { + return new GluttonousTroll(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index b6a9c4c9c2..763b3428a0 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -45,6 +45,7 @@ public final class ThroneOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Fireborn Knight", 210, Rarity.UNCOMMON, mage.cards.f.FirebornKnight.class)); cards.add(new SetCardInfo("Garruk, Cursed Huntsman", 270, Rarity.MYTHIC, mage.cards.g.GarrukCursedHuntsman.class)); cards.add(new SetCardInfo("Gilded Goose", 160, Rarity.RARE, mage.cards.g.GildedGoose.class)); + cards.add(new SetCardInfo("Gluttonous Troll", 327, Rarity.RARE, mage.cards.g.GluttonousTroll.class)); cards.add(new SetCardInfo("Golden Egg", 220, Rarity.COMMON, mage.cards.g.GoldenEgg.class)); cards.add(new SetCardInfo("Heraldic Banner", 222, Rarity.UNCOMMON, mage.cards.h.HeraldicBanner.class)); cards.add(new SetCardInfo("Inspiring Veteran", 194, Rarity.UNCOMMON, mage.cards.i.InspiringVeteran.class));