diff --git a/Mage/src/mage/abilities/keyword/EchoAbility.java b/Mage/src/mage/abilities/keyword/EchoAbility.java index c4dc45d3e9..d8ed1b85b7 100644 --- a/Mage/src/mage/abilities/keyword/EchoAbility.java +++ b/Mage/src/mage/abilities/keyword/EchoAbility.java @@ -60,6 +60,7 @@ public class EchoAbility extends TriggeredAbilityImpl { super(Zone.BATTLEFIELD, new EchoEffect(new ManaCostsImpl(manaString)), false); this.echoPaid = false; this.echoCosts.add(new ManaCostsImpl(manaString)); + this.lastController = null; } public EchoAbility(Cost echoCost) { @@ -67,6 +68,7 @@ public class EchoAbility extends TriggeredAbilityImpl { this.echoPaid = false; this.echoCosts.add(echoCost); this.manaEcho = false; + this.lastController = null; } public EchoAbility(final EchoAbility ability) { @@ -74,6 +76,7 @@ public class EchoAbility extends TriggeredAbilityImpl { this.echoPaid = ability.echoPaid; this.echoCosts = ability.echoCosts.copy(); this.manaEcho = ability.manaEcho; + this.lastController = ability.lastController; } @Override @@ -83,21 +86,22 @@ public class EchoAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - EntersTheBattlefieldEvent zEvent = (EntersTheBattlefieldEvent)event; - if(zEvent.getFromZone() == null && this.echoPaid) { - this.echoPaid = false; - } + // reset the echo paid state back, if creature enteres the battlefield + if (event.getType().equals(GameEvent.EventType.ENTERS_THE_BATTLEFIELD) + && event.getTargetId().equals(this.getSourceId())) { + this.echoPaid = false; } - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { + if (event.getType().equals(GameEvent.EventType.UPKEEP_STEP_PRE)) { if(lastController != null){ if(!lastController.equals(this.controllerId)){ this.echoPaid = false; } } + // remember the last controller lastController = this.getControllerId(); } - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && + // if echo not paid yet, controller has to pay + if (event.getType().equals(GameEvent.EventType.UPKEEP_STEP_PRE) && event.getPlayerId().equals(this.controllerId) && lastController.equals(this.controllerId) && !this.echoPaid){ this.echoPaid = true; diff --git a/Mage/src/mage/abilities/keyword/SuspendAbility.java b/Mage/src/mage/abilities/keyword/SuspendAbility.java index f0e86aac83..bc168716f5 100644 --- a/Mage/src/mage/abilities/keyword/SuspendAbility.java +++ b/Mage/src/mage/abilities/keyword/SuspendAbility.java @@ -241,7 +241,7 @@ class SuspendExileEffect extends OneShotEffect { Card card = game.getCard(source.getSourceId()); Player controller = game.getPlayer(source.getControllerId()); if (card != null && controller != null) { - // check if the user really wants to suspend the card (only if spell can't be casted because else the choose ability dialog appears) + // check if the user really wants to suspend the card (only if the spell can't be casted because else the choose ability dialog appears) if (!card.getSpellAbility().canActivate(source.getControllerId(), game)) { if (!controller.chooseUse(outcome, new StringBuilder("Suspend ").append(card.getName()).append("?").toString(), game)) { return false; @@ -322,7 +322,7 @@ class SuspendPlayCardEffect extends OneShotEffect { Card card = game.getCard(source.getSourceId()); if (player != null && card != null) { // remove temporary suspend ability (used e.g. for Epochrasite) - List abilitiesToRemove = new ArrayList(); + List abilitiesToRemove = new ArrayList<>(); for (Ability ability : card.getAbilities()) { if (ability instanceof SuspendAbility) { if (((SuspendAbility)ability).isGainedTemporary()) {