support for OrActivationCardsInHand param

This commit is contained in:
Northmoc
2021-04-03 13:10:09 -04:00
parent b52d22fd76
commit 09334d2043
2 changed files with 19 additions and 1 deletions

View File

@@ -141,6 +141,9 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
if (params.containsKey("ActivationCardsInHand")) { if (params.containsKey("ActivationCardsInHand")) {
this.setActivateCardsInHand(Integer.parseInt(params.get("ActivationCardsInHand"))); this.setActivateCardsInHand(Integer.parseInt(params.get("ActivationCardsInHand")));
} }
if (params.containsKey("OrActivationCardsInHand")) {
this.setActivateCardsInHand2(Integer.parseInt(params.get("OrActivationCardsInHand")));
}
if (params.containsKey("ActivationChosenColor")) { if (params.containsKey("ActivationChosenColor")) {
this.setColorToCheck(params.get("ActivationChosenColor")); this.setColorToCheck(params.get("ActivationChosenColor"));
@@ -356,7 +359,12 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
} }
if (getCardsInHand() != -1) { if (getCardsInHand() != -1) {
if (activator.getCardsIn(ZoneType.Hand).size() != getCardsInHand()) { int h = activator.getCardsIn(ZoneType.Hand).size();
if (getCardsInHand2() != -1) {
if (h != getCardsInHand() && h != getCardsInHand2()) {
return false;
}
} else if (h != getCardsInHand()) {
return false; return false;
} }
} }

View File

@@ -134,6 +134,7 @@ public class SpellAbilityVariables implements Cloneable {
/** The n cards in hand. */ /** The n cards in hand. */
private int cardsInHand = -1; private int cardsInHand = -1;
private int cardsInHand2 = -1;
// Conditional States for Cards // Conditional States for Cards
private boolean threshold = false; private boolean threshold = false;
@@ -384,6 +385,9 @@ public class SpellAbilityVariables implements Cloneable {
public final void setActivateCardsInHand(final int cards) { public final void setActivateCardsInHand(final int cards) {
this.setCardsInHand(cards); this.setCardsInHand(cards);
} }
public final void setActivateCardsInHand2(final int cards) {
this.setCardsInHand2(cards);
}
public final void setHellbent(final boolean bHellbent) { public final void setHellbent(final boolean bHellbent) {
@@ -830,6 +834,9 @@ public class SpellAbilityVariables implements Cloneable {
public final int getCardsInHand() { public final int getCardsInHand() {
return this.cardsInHand; return this.cardsInHand;
} }
public final int getCardsInHand2() {
return this.cardsInHand2;
}
/** /**
* Sets the cards in hand. * Sets the cards in hand.
@@ -840,6 +847,9 @@ public class SpellAbilityVariables implements Cloneable {
public final void setCardsInHand(final int cardsInHand0) { public final void setCardsInHand(final int cardsInHand0) {
this.cardsInHand = cardsInHand0; this.cardsInHand = cardsInHand0;
} }
public final void setCardsInHand2(final int cardsInHand0) {
this.cardsInHand2 = cardsInHand0;
}
/** /**
* Gets the checks if is present. * Gets the checks if is present.