- Added the condition "AllTargetsLegal" (untested).

This commit is contained in:
Sloth
2013-03-03 11:54:53 +00:00
parent f409a66f01
commit cd5c3bfa69
2 changed files with 29 additions and 0 deletions

View File

@@ -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;

View File

@@ -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();
@@ -137,6 +138,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>.