diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/CommanderReplacementEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/CommanderReplacementEffect.java index 94aa3197960..14cdf54c03f 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/CommanderReplacementEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/CommanderReplacementEffect.java @@ -1,5 +1,7 @@ package mage.abilities.effects.common.continuous; +import java.util.Locale; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.ReplacementEffectImpl; import mage.cards.Card; @@ -13,9 +15,6 @@ import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.players.Player; -import java.util.Locale; -import java.util.UUID; - /** * @author Plopman, JayDi85 */ @@ -40,12 +39,13 @@ public class CommanderReplacementEffect extends ReplacementEffectImpl { /** * * @param commanderId - * @param alsoHand is the replacement effect also applied if commander - * object goes to hand zone - * @param alsoLibrary is the replacement effect also applied if commander - * object goes to library zone - * @param forceToMove used for signature spell of Oathbreaker format (spell - * is mandatory moved to command zone instead) + * @param alsoHand is the replacement effect also applied if + * commander object goes to hand zone + * @param alsoLibrary is the replacement effect also applied if + * commander object goes to library zone + * @param forceToMove used for signature spell of Oathbreaker format + * (spell is mandatory moved to command zone + * instead) * @param commanderTypeName type of commander object to set the correct text */ public CommanderReplacementEffect(UUID commanderId, boolean alsoHand, boolean alsoLibrary, boolean forceToMove, String commanderTypeName) { @@ -118,7 +118,7 @@ public class CommanderReplacementEffect extends ReplacementEffectImpl { return true; } if (forceToMove) { - switch (zEvent.getToZone()) { + switch (zEvent.getToZone()) { // Normal commander movement is handled in state-based actions in GameImpl case BATTLEFIELD: case GRAVEYARD: return true; diff --git a/Mage/src/main/java/mage/game/GameState.java b/Mage/src/main/java/mage/game/GameState.java index 13b084f3f17..5f2259b11db 100644 --- a/Mage/src/main/java/mage/game/GameState.java +++ b/Mage/src/main/java/mage/game/GameState.java @@ -99,7 +99,7 @@ public class GameState implements Serializable, Copyable { private Map copiedCards = new HashMap<>(); private int permanentOrderNumber; private final Map usePowerInsteadOfToughnessForDamageLethalityFilters = new HashMap<>(); - private final Set commandersToStay = new HashSet<>(); + private Set commandersToStay = new HashSet<>(); // commanders that do not go back to command zone private int applyEffectsCounter; // Upcounting number of each applyEffects execution @@ -181,6 +181,7 @@ public class GameState implements Serializable, Copyable { this.applyEffectsCounter = state.applyEffectsCounter; state.usePowerInsteadOfToughnessForDamageLethalityFilters.forEach((uuid, filter) -> this.usePowerInsteadOfToughnessForDamageLethalityFilters.put(uuid, filter.copy())); + this.commandersToStay.addAll(state.commandersToStay); } public void restoreForRollBack(GameState state) { @@ -228,6 +229,7 @@ public class GameState implements Serializable, Copyable { this.applyEffectsCounter = state.applyEffectsCounter; state.usePowerInsteadOfToughnessForDamageLethalityFilters.forEach((uuid, filter) -> this.usePowerInsteadOfToughnessForDamageLethalityFilters.put(uuid, filter.copy())); + this.commandersToStay = state.commandersToStay; } @Override @@ -1028,7 +1030,7 @@ public class GameState implements Serializable, Copyable { * @param attachedTo * @param ability * @param copyAbility copies non MageSingleton abilities before adding to - * state + * state */ public void addOtherAbility(Card attachedTo, Ability ability, boolean copyAbility) { Ability newAbility;