Pia's Revolution - Fixed that it wrongly triggered for artifacts from other players.

This commit is contained in:
LevelX2 2016-12-18 23:14:11 +01:00
parent 1de210ab74
commit 3c0ee90663

View file

@ -36,9 +36,11 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterArtifactPermanent; import mage.filter.common.FilterArtifactPermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.other.OwnerPredicate;
import mage.filter.predicate.permanent.TokenPredicate; import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
@ -97,15 +99,15 @@ class PiasRevolutionReturnEffect extends OneShotEffect {
if (permanent != null) { if (permanent != null) {
Player opponent = game.getPlayer(source.getFirstTarget()); Player opponent = game.getPlayer(source.getFirstTarget());
if (opponent != null) { if (opponent != null) {
if (opponent.chooseUse(outcome, new StringBuilder("Have Pia's Revolution deal 3 damage to you to prevent that ").append(permanent.getLogName()).append(" returns to ").append(controller.getLogName()).append("'s hand?").toString(), source, game)) { if (opponent.chooseUse(outcome,
opponent.damage(3, source.getId(), game, false, true); "Have Pia's Revolution deal 3 damage to you to prevent that " + permanent.getIdName() + " returns to " + controller.getName() + "'s hand?",
} else { source, game)) {
if (game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) { opponent.damage(3, source.getSourceId(), game, false, true);
} else if (game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) {
controller.moveCards(game.getCard(permanentId), Zone.HAND, source, game); controller.moveCards(game.getCard(permanentId), Zone.HAND, source, game);
} }
} }
} }
}
return true; return true;
} }
return false; return false;
@ -118,6 +120,7 @@ class PiasRevolutionTriggeredAbility extends TriggeredAbilityImpl {
static { static {
filter.add(Predicates.not(new TokenPredicate())); filter.add(Predicates.not(new TokenPredicate()));
filter.add(new OwnerPredicate(TargetController.YOU));
} }
public PiasRevolutionTriggeredAbility() { public PiasRevolutionTriggeredAbility() {