From fd08db3b2baae40c58fd82a73dc3a012eaa79a83 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 20 Jul 2015 17:43:20 +0200 Subject: [PATCH] * Rally the Ancestors - Fixed that the delayed exile effect still did move the card if it left the battlefield meanwhile. --- .../sets/fatereforged/RallyTheAncestors.java | 27 ++++++++++--------- .../mage/sets/gatecrash/HellkiteTyrant.java | 6 ++--- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Mage.Sets/src/mage/sets/fatereforged/RallyTheAncestors.java b/Mage.Sets/src/mage/sets/fatereforged/RallyTheAncestors.java index bd820c79eb..100549a277 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/RallyTheAncestors.java +++ b/Mage.Sets/src/mage/sets/fatereforged/RallyTheAncestors.java @@ -34,8 +34,8 @@ import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.common.ExileTargetEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; @@ -76,21 +76,21 @@ public class RallyTheAncestors extends CardImpl { } class RallyTheAncestorsEffect extends OneShotEffect { - + RallyTheAncestorsEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "Return each creature card with converted mana cost X or less from your graveyard to the battlefield. Exile those creatures at the beginning of your next upkeep"; } - + RallyTheAncestorsEffect(final RallyTheAncestorsEffect effect) { super(effect); } - + @Override public RallyTheAncestorsEffect copy() { return new RallyTheAncestorsEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); @@ -101,14 +101,15 @@ class RallyTheAncestorsEffect extends OneShotEffect { Set cards = player.getGraveyard().getCards(filter, game); for (Card card : cards) { if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); - Effect exileEffect = new ExileTargetEffect("Exile those creatures at the beginning of your next upkeep"); - exileEffect.setTargetPointer(new FixedTarget(card.getId())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + if (player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId())) { + Effect exileEffect = new ExileTargetEffect("Exile those creatures at the beginning of your next upkeep"); + exileEffect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } } } return true; diff --git a/Mage.Sets/src/mage/sets/gatecrash/HellkiteTyrant.java b/Mage.Sets/src/mage/sets/gatecrash/HellkiteTyrant.java index 20a1c1781f..ff32625bf7 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/HellkiteTyrant.java +++ b/Mage.Sets/src/mage/sets/gatecrash/HellkiteTyrant.java @@ -77,13 +77,13 @@ public class HellkiteTyrant extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); // Whenever Hellkite Tyrant deals combat damage to a player, gain control of all artifacts that player controls. - this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new HellkiteTyrantEffect(),false, true)); + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new HellkiteTyrantEffect(), false, true)); // At the beginning of your upkeep, if you control twenty or more artifacts, you win the game. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect(), TargetController.YOU, false); this.addAbility(new ConditionalTriggeredAbility( ability, - new PermanentsOnTheBattlefieldCondition(new FilterArtifactPermanent(), PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN,19), + new PermanentsOnTheBattlefieldCondition(new FilterArtifactPermanent(), PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 19), "At the beginning of your upkeep, if you control twenty or more artifacts, you win the game.")); } @@ -123,7 +123,7 @@ class HellkiteTyrantEffect extends OneShotEffect { FilterPermanent filter = new FilterArtifactPermanent(); filter.add(new ControllerIdPredicate(player.getId())); - List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId() , game); + List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game); for (Permanent permanent : permanents) { ContinuousEffect effect = new HellkiteTyrantControlEffect(source.getControllerId()); effect.setTargetPointer(new FixedTarget(permanent.getId()));