diff --git a/Mage.Sets/src/mage/cards/a/ArborealAlliance.java b/Mage.Sets/src/mage/cards/a/ArborealAlliance.java new file mode 100644 index 00000000000..1697b52e705 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/ArborealAlliance.java @@ -0,0 +1,72 @@ +package mage.cards.a; + +import mage.abilities.Ability; +import mage.abilities.common.AttacksWithCreaturesTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.PopulateEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.game.permanent.token.SylvanOfferingTreefolkToken; + +import java.util.UUID; + +/** + * @author Susucr + */ +public final class ArborealAlliance extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent(SubType.ELF, "Elves"); + + public ArborealAlliance(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{X}{G}{G}"); + + // When Arboreal Alliance enters the battlefield, create an X/X green Treefolk creature token. + this.addAbility(new EntersBattlefieldTriggeredAbility(new ArborealAllianceEffect())); + + // Whenever you attack with one or more Elves, populate. + this.addAbility(new AttacksWithCreaturesTriggeredAbility( + new PopulateEffect(), 1, filter + )); + } + + private ArborealAlliance(final ArborealAlliance card) { + super(card); + } + + @Override + public ArborealAlliance copy() { + return new ArborealAlliance(this); + } +} + +class ArborealAllianceEffect extends OneShotEffect { + + ArborealAllianceEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "create an X/X green Treefolk creature token"; + } + + private ArborealAllianceEffect(final ArborealAllianceEffect effect) { + super(effect); + } + + @Override + public ArborealAllianceEffect copy() { + return new ArborealAllianceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return new CreateTokenEffect( + new SylvanOfferingTreefolkToken(ManacostVariableValue.ETB.calculate(game, source, this)) + ).apply(game, source); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java b/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java index d93d07a41a0..b5613502991 100644 --- a/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java +++ b/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java @@ -22,6 +22,7 @@ public final class TalesOfMiddleEarthCommander extends ExpansionSet { cards.add(new SetCardInfo("Anguished Unmaking", 265, Rarity.RARE, mage.cards.a.AnguishedUnmaking.class)); cards.add(new SetCardInfo("Aragorn, King of Gondor", 5, Rarity.MYTHIC, mage.cards.a.AragornKingOfGondor.class)); cards.add(new SetCardInfo("Arbor Elf", 232, Rarity.COMMON, mage.cards.a.ArborElf.class)); + cards.add(new SetCardInfo("Arboreal Alliance", 497, Rarity.RARE, mage.cards.a.ArborealAlliance.class)); cards.add(new SetCardInfo("Arcane Denial", 184, Rarity.COMMON, mage.cards.a.ArcaneDenial.class)); cards.add(new SetCardInfo("Arcane Signet", 273, Rarity.COMMON, mage.cards.a.ArcaneSignet.class)); cards.add(new SetCardInfo("Archivist of Gondor", 18, Rarity.RARE, mage.cards.a.ArchivistOfGondor.class));