From b4bd05671418b0f295d42fbf904f936bc6cc595b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 8 Sep 2018 11:38:26 -0400 Subject: [PATCH] Implemented Vraska, Regal Gorgon --- .../src/mage/cards/v/VraskaRegalGorgon.java | 99 +++++++++++++++++++ Mage.Sets/src/mage/sets/GuildsOfRavnica.java | 1 + 2 files changed, 100 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/v/VraskaRegalGorgon.java diff --git a/Mage.Sets/src/mage/cards/v/VraskaRegalGorgon.java b/Mage.Sets/src/mage/cards/v/VraskaRegalGorgon.java new file mode 100644 index 00000000000..c3ae5c81cab --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VraskaRegalGorgon.java @@ -0,0 +1,99 @@ +package mage.cards.v; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class VraskaRegalGorgon extends CardImpl { + + public VraskaRegalGorgon(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{5}{B}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.VRASKA); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + + // +2: Put a +1/+1 counter on up to one target creature. That creature gains menace until end of turn. + Ability ability = new LoyaltyAbility(new AddCountersTargetEffect( + CounterType.P1P1.createInstance() + ).setText("Put a +1/+1 counter on up to one target creature."), 2); + ability.addEffect(new GainAbilityTargetEffect( + new MenaceAbility(), Duration.EndOfTurn + ).setText("That creature gains menace until end of turn.")); + ability.addTarget(new TargetCreaturePermanent(0, 1)); + this.addAbility(ability); + + // -3: Destroy target creature. + ability = new LoyaltyAbility(new DestroyTargetEffect(), -3); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // -10: For each creature card in your graveyard, put a +1/+1 counter on each creature you control. + this.addAbility(new LoyaltyAbility(new VraskaRegalGorgonEffect(), -10)); + } + + public VraskaRegalGorgon(final VraskaRegalGorgon card) { + super(card); + } + + @Override + public VraskaRegalGorgon copy() { + return new VraskaRegalGorgon(this); + } +} + +class VraskaRegalGorgonEffect extends OneShotEffect { + + public VraskaRegalGorgonEffect() { + super(Outcome.Benefit); + this.staticText = "For each creature card in your graveyard, " + + "put a +1/+1 counter on each creature you control."; + } + + public VraskaRegalGorgonEffect(final VraskaRegalGorgonEffect effect) { + super(effect); + } + + @Override + public VraskaRegalGorgonEffect copy() { + return new VraskaRegalGorgonEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + int count = player.getGraveyard().count( + StaticFilters.FILTER_CARD_CREATURE, game + ); + return new AddCountersAllEffect( + CounterType.P1P1.createInstance(count), + StaticFilters.FILTER_CONTROLLED_CREATURE + ).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java index 4fdd8c90b8e..d0504d945ba 100644 --- a/Mage.Sets/src/mage/sets/GuildsOfRavnica.java +++ b/Mage.Sets/src/mage/sets/GuildsOfRavnica.java @@ -64,6 +64,7 @@ public final class GuildsOfRavnica extends ExpansionSet { cards.add(new SetCardInfo("Underrealm Lich", 211, Rarity.MYTHIC, mage.cards.u.UnderrealmLich.class)); cards.add(new SetCardInfo("Unexplained Disappearance", 56, Rarity.COMMON, mage.cards.u.UnexplainedDisappearance.class)); cards.add(new SetCardInfo("Vraska's Stoneglare", 272, Rarity.RARE, mage.cards.v.VraskasStoneglare.class)); + cards.add(new SetCardInfo("Vraska, Regal Gorgon", 269, Rarity.MYTHIC, mage.cards.v.VraskaRegalGorgon.class)); cards.add(new SetCardInfo("Wary Okapi", 149, Rarity.COMMON, mage.cards.w.WaryOkapi.class)); cards.add(new SetCardInfo("Watery Grave", 259, Rarity.RARE, mage.cards.w.WateryGrave.class)); }