From 2a5cbe5e3bddcaa2f9636389f90e0a59c026f3b8 Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Sat, 30 Oct 2021 09:02:36 -0500 Subject: [PATCH] [VOW] Implemented Dominating Vampire --- .../src/mage/cards/d/DominatingVampire.java | 76 +++++++++++++++++++ .../src/mage/sets/InnistradCrimsonVow.java | 1 + 2 files changed, 77 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/d/DominatingVampire.java diff --git a/Mage.Sets/src/mage/cards/d/DominatingVampire.java b/Mage.Sets/src/mage/cards/d/DominatingVampire.java new file mode 100644 index 0000000000..08825f5daf --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DominatingVampire.java @@ -0,0 +1,76 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.ObjectSourcePlayer; +import mage.filter.predicate.ObjectSourcePlayerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author weirddan455 + */ +public final class DominatingVampire extends CardImpl { + + private static final FilterCreaturePermanent filter + = new FilterCreaturePermanent("creature with mana value less than or equal to the number of Vampires you control"); + + static { + filter.add(DominatingVampirePredicate.instance); + } + + public DominatingVampire(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + + this.subtype.add(SubType.VAMPIRE); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Dominating Vampire enters the battlefield, gain control of target creature with mana value less than or equal to the number of Vampires you control until end of turn. + // Untap that creature. It gains haste until end of turn. + Ability ability = new EntersBattlefieldTriggeredAbility(new GainControlTargetEffect(Duration.EndOfTurn)); + ability.addEffect(new UntapTargetEffect().setText("Untap that creature")); + ability.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn, "It gains haste until end of turn")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + private DominatingVampire(final DominatingVampire card) { + super(card); + } + + @Override + public DominatingVampire copy() { + return new DominatingVampire(this); + } +} + +enum DominatingVampirePredicate implements ObjectSourcePlayerPredicate { + instance; + + @Override + public boolean apply(ObjectSourcePlayer input, Game game) { + int vampires = 0; + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(input.getPlayerId())) { + if (permanent.hasSubtype(SubType.VAMPIRE, game)) { + vampires++; + } + } + return input.getObject().getManaValue() <= vampires; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index d2df027de2..202c0f83ed 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -41,6 +41,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Demonic Bargain", 103, Rarity.RARE, mage.cards.d.DemonicBargain.class)); cards.add(new SetCardInfo("Dig Up", 197, Rarity.RARE, mage.cards.d.DigUp.class)); cards.add(new SetCardInfo("Dire-Strain Anarchist", 181, Rarity.MYTHIC, mage.cards.d.DireStrainAnarchist.class)); + cards.add(new SetCardInfo("Dominating Vampire", 154, Rarity.RARE, mage.cards.d.DominatingVampire.class)); cards.add(new SetCardInfo("Dreamroot Cascade", 262, Rarity.RARE, mage.cards.d.DreamrootCascade.class)); cards.add(new SetCardInfo("Fell Stinger", 112, Rarity.UNCOMMON, mage.cards.f.FellStinger.class)); cards.add(new SetCardInfo("Forest", 276, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS));