Update PlaneswalkEffect.java (#4315)

Fixes an issue where planeswalk replacements were being applied before confirmation for optional planeswalks, thus making it so that one couldn't choose not to planeswalk with TARDIS's attack trigger if one also controls Susan Foreman
This commit is contained in:
Klisz
2023-12-06 23:58:16 -07:00
committed by GitHub
parent 88990491a4
commit 4dbe4f1599

View File

@@ -24,6 +24,11 @@ public class PlaneswalkEffect extends SpellAbilityEffect {
return; return;
} }
if (sa.hasParam("Optional") && !sa.getActivatingPlayer().getController().confirmAction(sa, null,
Localizer.getInstance().getMessage("lblWouldYouLikeToPlaneswalk"), null)) {
return;
}
final Map<AbilityKey, Object> repParams = AbilityKey.mapFromAffected(activator); final Map<AbilityKey, Object> repParams = AbilityKey.mapFromAffected(activator);
Object cause = sa.hasParam("Cause") ? sa.getParam("Cause") : sa; Object cause = sa.hasParam("Cause") ? sa.getParam("Cause") : sa;
repParams.put(AbilityKey.Cause, cause); repParams.put(AbilityKey.Cause, cause);
@@ -31,11 +36,6 @@ public class PlaneswalkEffect extends SpellAbilityEffect {
return; return;
} }
if (sa.hasParam("Optional") && !sa.getActivatingPlayer().getController().confirmAction(sa, null,
Localizer.getInstance().getMessage("lblWouldYouLikeToPlaneswalk"), null)) {
return;
}
if (!sa.hasParam("DontPlaneswalkAway")) { if (!sa.hasParam("DontPlaneswalkAway")) {
for (Player p : game.getPlayers()) { for (Player p : game.getPlayers()) {
p.leaveCurrentPlane(); p.leaveCurrentPlane();