mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +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.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() {
|
||||||
|
|
Loading…
Reference in a new issue