Skip to content

Commit

Permalink
[LTC] Implement Galadhrim Ambush
Browse files Browse the repository at this point in the history
  • Loading branch information
theelk801 committed Jun 19, 2023
1 parent ad0e0bf commit ae94db9
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
51 changes: 51 additions & 0 deletions Mage.Sets/src/mage/cards/g/GaladhrimAmbush.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ private TalesOfMiddleEarthCommander() {
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));
Expand Down

0 comments on commit ae94db9

Please sign in to comment.