mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Added the condition "AllTargetsLegal" (untested).
This commit is contained in:
@@ -81,6 +81,9 @@ public class SpellAbilityCondition extends SpellAbilityVariables {
|
||||
if (value.equals("Kicked")) {
|
||||
this.setKicked(true);
|
||||
}
|
||||
if (value.equals("AllTargetsLegal")) {
|
||||
this.setAllTargetsLegal(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (params.containsKey("ConditionZone")) {
|
||||
@@ -196,6 +199,14 @@ public class SpellAbilityCondition extends SpellAbilityVariables {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (this.isAllTargetsLegal()) {
|
||||
SpellAbility root = sa.getRootAbility();
|
||||
for (Card c : root.getTarget().getTargetCards()) {
|
||||
if (!CardFactoryUtil.isTargetStillValid(sa, c)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isSorcerySpeed() && !activator.canCastSorcery()) {
|
||||
return false;
|
||||
|
||||
@@ -69,6 +69,7 @@ public class SpellAbilityVariables {
|
||||
this.threshold = sav.isThreshold();
|
||||
this.metalcraft = sav.isThreshold();
|
||||
this.hellbent = sav.isHellbent();
|
||||
this.allTargetsLegal = sav.isAllTargetsLegal();
|
||||
this.prowl = new ArrayList<String>(sav.getProwl());
|
||||
this.isPresent = sav.getIsPresent();
|
||||
this.presentCompare = sav.getPresentCompare();
|
||||
@@ -136,6 +137,8 @@ public class SpellAbilityVariables {
|
||||
|
||||
/** The Kicked. */
|
||||
private boolean kicked = false;
|
||||
|
||||
private boolean allTargetsLegal = false;
|
||||
|
||||
/** The prowl. */
|
||||
private ArrayList<String> prowl = new ArrayList<String>();
|
||||
@@ -519,6 +522,21 @@ public class SpellAbilityVariables {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the allTargetsLegal
|
||||
*/
|
||||
public boolean isAllTargetsLegal() {
|
||||
return allTargetsLegal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param allTargetsLegal0 the allTargetsLegal to set
|
||||
*/
|
||||
public void setAllTargetsLegal(boolean allTargets) {
|
||||
this.allTargetsLegal = allTargets;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Setter for the field <code>prowl</code>.
|
||||
|
||||
Reference in New Issue
Block a user