[LTC] Implement Galadhrim Ambush

This commit is contained in:
theelk801 2023-06-19 16:28:53 -04:00
parent ad0e0bf06b
commit ae94db9644
2 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,51 @@
package mage.cards.g;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.AttackingCreatureCount;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.PreventAllDamageByAllPermanentsEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.game.permanent.token.ElfWarriorToken;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class GaladhrimAmbush extends CardImpl {
private static final DynamicValue xValue = new AttackingCreatureCount();
private static final FilterPermanent filter = new FilterCreaturePermanent("non-Elf creaetures");
static {
filter.add(Predicates.not(SubType.ELF.getPredicate()));
}
public GaladhrimAmbush(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}");
// Create X 1/1 green Elf Warrior creature tokens, where X is the number of attacking creatures.
this.getSpellAbility().addEffect(new CreateTokenEffect(new ElfWarriorToken(), xValue));
// Prevent all combat damage that would be dealt this turn by non-Elf creatures.
this.getSpellAbility().addEffect(new PreventAllDamageByAllPermanentsEffect(
filter, Duration.EndOfTurn, true
));
}
private GaladhrimAmbush(final GaladhrimAmbush card) {
super(card);
}
@Override
public GaladhrimAmbush copy() {
return new GaladhrimAmbush(this);
}
}

View file

@ -104,6 +104,7 @@ public final class TalesOfMiddleEarthCommander extends ExpansionSet {
cards.add(new SetCardInfo("Frostboil Snarl", 312, Rarity.RARE, mage.cards.f.FrostboilSnarl.class));
cards.add(new SetCardInfo("Fumigate", 170, Rarity.RARE, mage.cards.f.Fumigate.class));
cards.add(new SetCardInfo("Furycalm Snarl", 313, Rarity.RARE, mage.cards.f.FurycalmSnarl.class));
cards.add(new SetCardInfo("Galadhrim Ambush", 38, Rarity.RARE, mage.cards.g.GaladhrimAmbush.class));
cards.add(new SetCardInfo("Gemstone Caverns", 364, Rarity.MYTHIC, mage.cards.g.GemstoneCaverns.class));
cards.add(new SetCardInfo("Genesis Wave", 245, Rarity.RARE, mage.cards.g.GenesisWave.class));
cards.add(new SetCardInfo("Ghost Quarter", 314, Rarity.UNCOMMON, mage.cards.g.GhostQuarter.class));