diff --git a/Mage.Sets/src/mage/cards/d/DwarvenMine.java b/Mage.Sets/src/mage/cards/d/DwarvenMine.java new file mode 100644 index 00000000000..bf26b0e4b4f --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DwarvenMine.java @@ -0,0 +1,64 @@ +package mage.cards.d; + +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.RedManaAbility; +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.DwarfToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DwarvenMine extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledPermanent(SubType.MOUNTAIN); + + static { + filter.add(AnotherPredicate.instance); + } + + private static final Condition condition + = new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.FEWER_THAN, 3); + + public DwarvenMine(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); + + this.subtype.add(SubType.MOUNTAIN); + + // ({T}: Add {R}.) + this.addAbility(new RedManaAbility()); + + // Dwarven Mine enters the battlefield tapped unless you control three or more other Mountains. + this.addAbility(new EntersBattlefieldAbility( + new ConditionalOneShotEffect(new TapSourceEffect(), condition), + "tapped unless you control three or more other Mountains" + )); + + // When Dwarven Mine enters the battlefield untapped, create a 1/1 red Dwarf creature token. + this.addAbility(new EntersBattlefieldUntappedTriggeredAbility(new CreateTokenEffect(new DwarfToken()), false)); + } + + private DwarvenMine(final DwarvenMine card) { + super(card); + } + + @Override + public DwarvenMine copy() { + return new DwarvenMine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java index 83b34904677..716e411a2ce 100644 --- a/Mage.Sets/src/mage/sets/ThroneOfEldraine.java +++ b/Mage.Sets/src/mage/sets/ThroneOfEldraine.java @@ -76,6 +76,7 @@ public final class ThroneOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Didn't Say Please", 42, Rarity.COMMON, mage.cards.d.DidntSayPlease.class)); cards.add(new SetCardInfo("Doom Foretold", 187, Rarity.RARE, mage.cards.d.DoomForetold.class)); cards.add(new SetCardInfo("Drown in the Loch", 188, Rarity.UNCOMMON, mage.cards.d.DrownInTheLoch.class)); + cards.add(new SetCardInfo("Dwarven Mine", 243, Rarity.COMMON, mage.cards.d.DwarvenMine.class)); cards.add(new SetCardInfo("Edgewall Innkeeper", 151, Rarity.UNCOMMON, mage.cards.e.EdgewallInnkeeper.class)); cards.add(new SetCardInfo("Elite Headhunter", 209, Rarity.UNCOMMON, mage.cards.e.EliteHeadhunter.class)); cards.add(new SetCardInfo("Embercleave", 120, Rarity.MYTHIC, mage.cards.e.Embercleave.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/DwarfToken.java b/Mage/src/main/java/mage/game/permanent/token/DwarfToken.java new file mode 100644 index 00000000000..861d0bad56e --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/DwarfToken.java @@ -0,0 +1,28 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.constants.CardType; +import mage.constants.SubType; + +/** + * @author TheElk801 + */ +public final class DwarfToken extends TokenImpl { + + public DwarfToken() { + super("Dwarf", "1/1 red Dwarf creature token"); + cardType.add(CardType.CREATURE); + color.setRed(true); + subtype.add(SubType.DWARF); + power = new MageInt(1); + toughness = new MageInt(1); + } + + private DwarfToken(final DwarfToken token) { + super(token); + } + + public DwarfToken copy() { + return new DwarfToken(this); + } +}