From af1e33a6c0b52a801cde98efa2ea66cdec6b94f9 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 3 Sep 2020 13:24:16 -0400 Subject: [PATCH] [ZNR] Implemented Goma Fada Vanguard --- .../src/mage/cards/g/GomaFadaVanguard.java | 70 +++++++++++++++++++ Mage.Sets/src/mage/sets/ZendikarRising.java | 1 + 2 files changed, 71 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/g/GomaFadaVanguard.java diff --git a/Mage.Sets/src/mage/cards/g/GomaFadaVanguard.java b/Mage.Sets/src/mage/cards/g/GomaFadaVanguard.java new file mode 100644 index 0000000000..f80c33f36b --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GomaFadaVanguard.java @@ -0,0 +1,70 @@ +package mage.cards.g; + +import java.util.UUID; + +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.combat.CantBlockTargetEffect; +import mage.cards.s.SpellstutterSprite; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.common.FilterOpponentsCreaturePermanent; +import mage.filter.predicate.ObjectSourcePlayer; +import mage.filter.predicate.ObjectSourcePlayerPredicate; +import mage.game.Game; +import mage.target.TargetPermanent; + +/** + * @author TheElk801 + */ +public final class GomaFadaVanguard extends CardImpl { + + private static final FilterPermanent filter = new FilterOpponentsCreaturePermanent( + "creature an opponent controls with power less than or equal to the number of Warriors you control" + ); + + static { + filter.add(GomaFadaVanguardPredicate.instance); + } + + public GomaFadaVanguard(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Goma Fada Vanguard attacks, target creature an opponent controls with power less than or equal to the number of Warriors you control can't block this turn. + Ability ability = new AttacksTriggeredAbility(new CantBlockTargetEffect(Duration.EndOfTurn), false); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + private GomaFadaVanguard(final GomaFadaVanguard card) { + super(card); + } + + @Override + public GomaFadaVanguard copy() { + return new GomaFadaVanguard(this); + } +} + +enum GomaFadaVanguardPredicate implements ObjectSourcePlayerPredicate> { + instance; + private static final FilterPermanent filter = new FilterPermanent(SubType.WARRIOR, ""); + + @Override + public boolean apply(ObjectSourcePlayer input, Game game) { + return input.getObject().getPower().getValue() <= + game.getBattlefield().countAll(filter, game.getControllerId(input.getSourceId()), game); + } +} diff --git a/Mage.Sets/src/mage/sets/ZendikarRising.java b/Mage.Sets/src/mage/sets/ZendikarRising.java index 6028af5fad..a105fa404e 100644 --- a/Mage.Sets/src/mage/sets/ZendikarRising.java +++ b/Mage.Sets/src/mage/sets/ZendikarRising.java @@ -103,6 +103,7 @@ public final class ZendikarRising extends ExpansionSet { cards.add(new SetCardInfo("Fissure Wizard", 140, Rarity.COMMON, mage.cards.f.FissureWizard.class)); cards.add(new SetCardInfo("Forest", 278, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Gnarlid Colony", 185, Rarity.COMMON, mage.cards.g.GnarlidColony.class)); + cards.add(new SetCardInfo("Goma Fada Vanguard", 141, Rarity.UNCOMMON, mage.cards.g.GomaFadaVanguard.class)); cards.add(new SetCardInfo("Grimclimb Pathway", 259, Rarity.RARE, mage.cards.g.GrimclimbPathway.class)); cards.add(new SetCardInfo("Grotag Bug-Catcher", 142, Rarity.COMMON, mage.cards.g.GrotagBugCatcher.class)); cards.add(new SetCardInfo("Highborn Vampire", 108, Rarity.COMMON, mage.cards.h.HighbornVampire.class));