-
Notifications
You must be signed in to change notification settings - Fork 787
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters