rework effects which increase loyalty abilities (closes #9626)

This commit is contained in:
Evan Kranzler 2022-10-10 18:01:58 -04:00
parent 3fd3cb27e2
commit 09797d4cf6
9 changed files with 59 additions and 98 deletions

View file

@ -467,7 +467,14 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
@Override
public void incrementLoyaltyActivationsAvailable() {
this.loyaltyActivationsAvailable++;
this.incrementLoyaltyActivationsAvailable(Integer.MAX_VALUE);
}
@Override
public void incrementLoyaltyActivationsAvailable(int max) {
if (this.loyaltyActivationsAvailable < max) {
this.loyaltyActivationsAvailable++;
}
}
@Override
@ -479,7 +486,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
public boolean canLoyaltyBeUsed(Game game) {
Player controller = game.getPlayer(controllerId);
if (controller != null) {
return Math.max(controller.getLoyaltyUsePerTurn(), loyaltyActivationsAvailable) > timesLoyaltyUsed;
return loyaltyActivationsAvailable > timesLoyaltyUsed;
}
return false;
}