mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Fix NumLoyaltyAct counting limit and additional wrong together
This commit is contained in:
@@ -324,6 +324,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
private SpellAbility[] basicLandAbilities = new SpellAbility[MagicColor.WUBRG.length];
|
private SpellAbility[] basicLandAbilities = new SpellAbility[MagicColor.WUBRG.length];
|
||||||
|
|
||||||
private int planeswalkerAbilityActivated;
|
private int planeswalkerAbilityActivated;
|
||||||
|
private boolean planeswalkerActivationLimitUsed;
|
||||||
|
|
||||||
private final ActivationTable numberTurnActivations = new ActivationTable();
|
private final ActivationTable numberTurnActivations = new ActivationTable();
|
||||||
private final ActivationTable numberGameActivations = new ActivationTable();
|
private final ActivationTable numberGameActivations = new ActivationTable();
|
||||||
@@ -7149,11 +7150,19 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addPlaneswalkerAbilityActivated() {
|
public void addPlaneswalkerAbilityActivated() {
|
||||||
planeswalkerAbilityActivated++;
|
// track if increased limit was used for activation because if there are also additional ones they can count on top
|
||||||
|
if (++planeswalkerAbilityActivated == 2 && StaticAbilityNumLoyaltyAct.limitIncrease(this)) {
|
||||||
|
planeswalkerActivationLimitUsed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean planeswalkerActivationLimitUsed() {
|
||||||
|
return planeswalkerActivationLimitUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetActivationsPerTurn() {
|
public void resetActivationsPerTurn() {
|
||||||
planeswalkerAbilityActivated = 0;
|
planeswalkerAbilityActivated = 0;
|
||||||
|
planeswalkerActivationLimitUsed = false;
|
||||||
numberTurnActivations.clear();
|
numberTurnActivations.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -475,14 +475,17 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sa.isPwAbility()) {
|
if (sa.isPwAbility()) {
|
||||||
final int initialLimit = StaticAbilityNumLoyaltyAct.limitIncrease(c) ? 1 : 0;
|
|
||||||
final int limit = StaticAbilityNumLoyaltyAct.additionalActivations(c, sa) + initialLimit;
|
|
||||||
|
|
||||||
int numActivates = c.getPlaneswalkerAbilityActivated();
|
int numActivates = c.getPlaneswalkerAbilityActivated();
|
||||||
if (numActivates > limit) {
|
int limit = StaticAbilityNumLoyaltyAct.limitIncrease(c) ? 2 : 1;
|
||||||
|
|
||||||
|
if (numActivates >= limit) {
|
||||||
|
// increased limit only counts if it's been used already
|
||||||
|
limit += StaticAbilityNumLoyaltyAct.additionalActivations(c, sa) - (limit == 1 || c.planeswalkerActivationLimitUsed() ? 0 : 1);
|
||||||
|
if (numActivates >= limit) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 702.36e
|
// 702.36e
|
||||||
// If the permanent wouldn’t have a morph cost if it were face up, it can’t be turned face up this way.
|
// If the permanent wouldn’t have a morph cost if it were face up, it can’t be turned face up this way.
|
||||||
|
|||||||
Reference in New Issue
Block a user