[LTC] Implement Arboreal Alliance (#11222)

This commit is contained in:
Susucre 2023-09-29 00:49:54 +02:00 committed by GitHub
parent cb14c6286a
commit 6b95b31019
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 73 additions and 0 deletions

View file

@ -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);
}
}

View file

@ -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));