forked from External/mage
* Commander state-based action -Fixed that commander movement did not always work correctly after rollback (#6866).
This commit is contained in:
parent
f7b3e33f92
commit
d721c0bea3
2 changed files with 14 additions and 12 deletions
|
|
@ -99,7 +99,7 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
private Map<UUID, Card> copiedCards = new HashMap<>();
|
||||
private int permanentOrderNumber;
|
||||
private final Map<UUID, FilterCreaturePermanent> usePowerInsteadOfToughnessForDamageLethalityFilters = new HashMap<>();
|
||||
private final Set<MageObjectReference> commandersToStay = new HashSet<>();
|
||||
private Set<MageObjectReference> 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<GameState> {
|
|||
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<GameState> {
|
|||
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<GameState> {
|
|||
* @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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue