From d8a3a408dfeebed0906a78d7e2c52891b8f30c10 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 16 Jul 2018 10:47:28 -0400 Subject: [PATCH 1/4] fixed Vivien Reid's first ability not putting cards back in a random order --- Mage.Sets/src/mage/cards/v/VivienReid.java | 8 ++++++-- .../common/LookLibraryAndPickControllerEffect.java | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/v/VivienReid.java b/Mage.Sets/src/mage/cards/v/VivienReid.java index 2e3468420a7..219a8c5a3cd 100644 --- a/Mage.Sets/src/mage/cards/v/VivienReid.java +++ b/Mage.Sets/src/mage/cards/v/VivienReid.java @@ -14,6 +14,7 @@ import mage.constants.SuperType; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; @@ -56,8 +57,11 @@ public final class VivienReid extends CardImpl { // +1: Look at the top four cards of your library. You may reveal a creature or land card from among them and put it into your hand. Put the rest on the bottom of your library in any order. this.addAbility(new LoyaltyAbility( new LookLibraryAndPickControllerEffect( - new StaticValue(4), false, new StaticValue(1), filter, false - ), 1 + new StaticValue(4), false, new StaticValue(1), filter, + Zone.LIBRARY, false, true, false, Zone.HAND, true, false, false) + .setBackInRandomOrder(true) + .setText("Look at the top four cards of your library. You may reveal a creature or land card from among them" + + " and put it into your hand. Put the rest on the bottom of your library in a random order."), 1 )); // -3: Destroy target artifact, enchantment, or creature with flying. diff --git a/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java index d27e8f43208..285dd2b9fa8 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java @@ -61,6 +61,7 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff private boolean putOnTopSelected; private boolean anyOrder; + //TODO: These constructors are a mess public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, DynamicValue numberToPick, FilterCard pickFilter, boolean putOnTop) { From 36aad539f145fb2207f4ebe71c53f63d4e643c2b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 16 Jul 2018 10:49:04 -0400 Subject: [PATCH 2/4] fixed Virtus's Maneuver allowing players to get back noncreature cards --- Mage.Sets/src/mage/cards/v/VirtussManeuver.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/v/VirtussManeuver.java b/Mage.Sets/src/mage/cards/v/VirtussManeuver.java index 0d02a30405f..70880e200f5 100644 --- a/Mage.Sets/src/mage/cards/v/VirtussManeuver.java +++ b/Mage.Sets/src/mage/cards/v/VirtussManeuver.java @@ -16,6 +16,7 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.StaticFilters; +import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.other.OwnerIdPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -76,7 +77,7 @@ class VirtussManeuverEffect extends OneShotEffect { if (player == null) { continue; } - FilterCard filter = new FilterCard("card in your graveyard"); + FilterCard filter = new FilterCreatureCard("creature card in your graveyard"); filter.add(new OwnerIdPredicate(player.getId())); TargetCardInGraveyard target = new TargetCardInGraveyard(filter); getBackMap.put(player.getId(), null); From 765ccf63a6e70addeb737649ee8f04c04fc40661 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 16 Jul 2018 10:52:57 -0400 Subject: [PATCH 3/4] fixed Dread Wanderer text to correctly describe when it can be activated --- Mage.Sets/src/mage/cards/d/DreadWanderer.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/d/DreadWanderer.java b/Mage.Sets/src/mage/cards/d/DreadWanderer.java index 9bc5b6c82ad..87b9d1b7682 100644 --- a/Mage.Sets/src/mage/cards/d/DreadWanderer.java +++ b/Mage.Sets/src/mage/cards/d/DreadWanderer.java @@ -1,4 +1,3 @@ - package mage.cards.d; import java.util.UUID; @@ -34,7 +33,15 @@ public final class DreadWanderer extends CardImpl { // {2}{B}: Return Dread Wanderer from your graveyard to the battlefield. // Activate this ability only any time you could cast a sorcery and only if you have one or fewer cards in hand. - ConditionalActivatedAbility ability = new ConditionalActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), new ManaCostsImpl("{2}{B}"), HeckbentCondition.instance); + ConditionalActivatedAbility ability = new ConditionalActivatedAbility( + Zone.GRAVEYARD, + new ReturnSourceFromGraveyardToBattlefieldEffect(), + new ManaCostsImpl("{2}{B}"), + HeckbentCondition.instance, + "{2}{B}: Return {this} from your graveyard to the battlefield. " + + "Activate this ability only any time you could cast a sorcery " + + "and only if you have one or fewer cards in hand." + ); ability.setTiming(TimingRule.SORCERY); addAbility(ability); } From 57a5ee8f4edbf564fc9d442514c8b88e587d7acb Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 16 Jul 2018 11:10:24 -0400 Subject: [PATCH 4/4] reworked Heart-Piercer Manticore's reflexive triggered ability --- .../mage/cards/h/HeartPiercerManticore.java | 61 ++++++++----------- 1 file changed, 26 insertions(+), 35 deletions(-) diff --git a/Mage.Sets/src/mage/cards/h/HeartPiercerManticore.java b/Mage.Sets/src/mage/cards/h/HeartPiercerManticore.java index aab2013c72f..ecf355dea2d 100644 --- a/Mage.Sets/src/mage/cards/h/HeartPiercerManticore.java +++ b/Mage.Sets/src/mage/cards/h/HeartPiercerManticore.java @@ -1,27 +1,24 @@ - package mage.cards.h; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.effects.common.InfoEffect; import mage.abilities.effects.common.SendOptionUsedEventEffect; import mage.abilities.keyword.EmbalmAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.Duration; import mage.constants.SubType; import mage.constants.Outcome; -import mage.constants.Zone; import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; @@ -41,13 +38,11 @@ public final class HeartPiercerManticore extends CardImpl { this.power = new MageInt(4); this.toughness = new MageInt(3); - // When Heart-Piercer Manticore enters the battlefield, you may sacrifice another creature. - Ability firstAbility = new EntersBattlefieldTriggeredAbility(new HeartPiercerManticoreSacrificeEffect(), true); - this.addAbility(firstAbility); - // When you do, Heart-Piercer Manticore deals damage equal to that creature's power to any target. - Ability secondAbility = new HeartPiercerManticoreSacrificeTriggeredAbility(firstAbility.getOriginalId()); - secondAbility.addTarget(new TargetAnyTarget()); - this.addAbility(secondAbility); + // When Heart-Piercer Manticore enters the battlefield, you may sacrifice another creature. When you do, Heart-Piercer Manticore deals damage equal to that creature's power to any target. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new HeartPiercerManticoreSacrificeEffect(), true + )); + // Embalm {5}{R} this.addAbility(new EmbalmAbility(new ManaCostsImpl("{5}{R}"), this)); @@ -67,7 +62,8 @@ class HeartPiercerManticoreSacrificeEffect extends OneShotEffect { public HeartPiercerManticoreSacrificeEffect() { super(Outcome.Damage); - this.staticText = "you may sacrifice another creature"; + this.staticText = "sacrifice another creature. When you do, " + + "{this} deals damage equal to that creature's power to any target"; } public HeartPiercerManticoreSacrificeEffect(final HeartPiercerManticoreSacrificeEffect effect) { @@ -87,8 +83,11 @@ class HeartPiercerManticoreSacrificeEffect extends OneShotEffect { if (controller.choose(outcome, target, source.getSourceId(), game)) { Permanent toSacrifice = game.getPermanent(target.getFirstTarget()); if (toSacrifice != null) { - toSacrifice.sacrifice(source.getSourceId(), game); - return new SendOptionUsedEventEffect(toSacrifice.getPower().getValue()).apply(game, source); + DelayedTriggeredAbility trigger = new HeartPiercerManticoreReflexiveTriggeredAbility(toSacrifice.getPower().getValue()); + if (toSacrifice.sacrifice(source.getSourceId(), game)) { + game.addDelayedTriggeredAbility(trigger, source); + return new SendOptionUsedEventEffect().apply(game, source); + } } } return true; @@ -97,44 +96,36 @@ class HeartPiercerManticoreSacrificeEffect extends OneShotEffect { } } -class HeartPiercerManticoreSacrificeTriggeredAbility extends TriggeredAbilityImpl { +class HeartPiercerManticoreReflexiveTriggeredAbility extends DelayedTriggeredAbility { - private final UUID relatedTriggerdAbilityOriginalId; - - public HeartPiercerManticoreSacrificeTriggeredAbility(UUID relatedTriggerdAbilityOriginalId) { - super(Zone.BATTLEFIELD, new InfoEffect("{this} deals damage equal to that creature's power to any target")); - this.relatedTriggerdAbilityOriginalId = relatedTriggerdAbilityOriginalId; + public HeartPiercerManticoreReflexiveTriggeredAbility(int damage) { + super(new DamageTargetEffect(damage), Duration.OneUse, true); + this.addTarget(new TargetAnyTarget()); } - public HeartPiercerManticoreSacrificeTriggeredAbility(final HeartPiercerManticoreSacrificeTriggeredAbility ability) { + public HeartPiercerManticoreReflexiveTriggeredAbility(final HeartPiercerManticoreReflexiveTriggeredAbility ability) { super(ability); - this.relatedTriggerdAbilityOriginalId = ability.relatedTriggerdAbilityOriginalId; } @Override - public HeartPiercerManticoreSacrificeTriggeredAbility copy() { - return new HeartPiercerManticoreSacrificeTriggeredAbility(this); + public HeartPiercerManticoreReflexiveTriggeredAbility copy() { + return new HeartPiercerManticoreReflexiveTriggeredAbility(this); } @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.OPTION_USED; + return event.getType() == GameEvent.EventType.OPTION_USED; } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getPlayerId().equals(this.getControllerId()) - && event.getTargetId().equals(relatedTriggerdAbilityOriginalId) - && event.getSourceId().equals(getSourceId())) { - getEffects().clear(); - getEffects().add(new DamageTargetEffect(event.getAmount())); - return true; - } - return false; + return event.getPlayerId().equals(this.getControllerId()) + && event.getSourceId().equals(this.getSourceId()); } @Override public String getRule() { - return "When you do, {this} deals damage equal to that creature's power to any target."; + return "When you sacrifice a creature to {this}'s ability, " + + "{this} deals damage equal to that creature's power to any target"; } }