Refactor effects which disable the "legend rule" (#9662)

This commit is contained in:
Evan Kranzler 2022-10-28 18:04:23 -04:00 committed by GitHub
parent 1fece87819
commit 3ed26a2b1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 243 additions and 211 deletions

View file

@ -106,6 +106,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
protected int transformCount = 0;
protected Map<String, String> info;
protected int createOrder;
protected boolean legendRuleApplies = true;
private static final List<UUID> emptyList = Collections.unmodifiableList(new ArrayList<UUID>());
@ -171,6 +172,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
this.bandedCards.addAll(permanent.bandedCards);
this.timesLoyaltyUsed = permanent.timesLoyaltyUsed;
this.loyaltyActivationsAvailable = permanent.loyaltyActivationsAvailable;
this.legendRuleApplies = permanent.legendRuleApplies;
this.transformCount = permanent.transformCount;
this.morphed = permanent.morphed;
@ -214,6 +216,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
this.copy = false;
this.goadingPlayers.clear();
this.loyaltyActivationsAvailable = 1;
this.legendRuleApplies = true;
}
@Override
@ -491,6 +494,16 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
return false;
}
@Override
public void setLegendRuleApplies(boolean legendRuleApplies) {
this.legendRuleApplies = legendRuleApplies;
}
@Override
public boolean legendRuleApplies() {
return this.legendRuleApplies;
}
@Override
public boolean isTapped() {
return tapped;