From b4a615b1883f2b64a1be094d7b88e77aa990ae10 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 20 Sep 2019 07:41:49 -0400 Subject: [PATCH] Implemented Gingerbread Cabin --- .../src/mage/cards/g/GingerbreadCabin.java | 64 +++++++++++++++++++ Mage.Sets/src/mage/sets/ThroneOfEldraine.java | 1 + 2 files changed, 65 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/g/GingerbreadCabin.java diff --git a/Mage.Sets/src/mage/cards/g/GingerbreadCabin.java b/Mage.Sets/src/mage/cards/g/GingerbreadCabin.java new file mode 100644 index 00000000000..a6d6295fbb6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GingerbreadCabin.java @@ -0,0 +1,64 @@ +package mage.cards.g; + +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.EntersBattlefieldUntappedTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.GreenManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.permanent.token.FoodToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GingerbreadCabin extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledPermanent(SubType.FOREST); + + static { + filter.add(AnotherPredicate.instance); + } + + private static final Condition condition + = new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.FEWER_THAN, 3); + + public GingerbreadCabin(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); + + this.subtype.add(SubType.FOREST); + + // ({T}: Add {G}.) + this.addAbility(new GreenManaAbility()); + + // Gingerbread Cabin enters the battlefield tapped unless you control three or more other Forests. + this.addAbility(new EntersBattlefieldAbility( + new ConditionalOneShotEffect(new TapSourceEffect(), condition), + "tapped unless you control three or more other Forests" + )); + + // When Gingerbread Cabin enters the battlefield untapped, create a Food token. + this.addAbility(new EntersBattlefieldUntappedTriggeredAbility(new CreateTokenEffect(new FoodToken()), false)); + } + + private GingerbreadCabin(final GingerbreadCabin card) { + super(card); + } + + @Override + public GingerbreadCabin copy() { + return new GingerbreadCabin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index ff8a6520cc9..daed3c10570 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -115,6 +115,7 @@ public final class ThroneOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Giant Opportunity", 159, Rarity.UNCOMMON, mage.cards.g.GiantOpportunity.class)); cards.add(new SetCardInfo("Giant's Skewer", 91, Rarity.COMMON, mage.cards.g.GiantsSkewer.class)); cards.add(new SetCardInfo("Gilded Goose", 160, Rarity.RARE, mage.cards.g.GildedGoose.class)); + cards.add(new SetCardInfo("Gingerbread Cabin", 245, Rarity.COMMON, mage.cards.g.GingerbreadCabin.class)); cards.add(new SetCardInfo("Gingerbrute", 219, Rarity.COMMON, mage.cards.g.Gingerbrute.class)); cards.add(new SetCardInfo("Glass Casket", 15, Rarity.UNCOMMON, mage.cards.g.GlassCasket.class)); cards.add(new SetCardInfo("Gluttonous Troll", 327, Rarity.RARE, mage.cards.g.GluttonousTroll.class));