mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Pia's Revolution - Fixed that it wrongly triggered for artifacts from other players.
This commit is contained in:
parent
1de210ab74
commit
3c0ee90663
1 changed files with 9 additions and 6 deletions
|
@ -36,9 +36,11 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterArtifactPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.other.OwnerPredicate;
|
||||
import mage.filter.predicate.permanent.TokenPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
@ -97,15 +99,15 @@ class PiasRevolutionReturnEffect extends OneShotEffect {
|
|||
if (permanent != null) {
|
||||
Player opponent = game.getPlayer(source.getFirstTarget());
|
||||
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)) {
|
||||
opponent.damage(3, source.getId(), game, false, true);
|
||||
} else {
|
||||
if (game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) {
|
||||
if (opponent.chooseUse(outcome,
|
||||
"Have Pia's Revolution deal 3 damage to you to prevent that " + permanent.getIdName() + " returns to " + controller.getName() + "'s hand?",
|
||||
source, game)) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -118,6 +120,7 @@ class PiasRevolutionTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
static {
|
||||
filter.add(Predicates.not(new TokenPredicate()));
|
||||
filter.add(new OwnerPredicate(TargetController.YOU));
|
||||
}
|
||||
|
||||
public PiasRevolutionTriggeredAbility() {
|
||||
|
|
Loading…
Reference in a new issue