- TargetsValid should find targets in the subabilities

This commit is contained in:
swordshine
2013-09-22 00:38:44 +00:00
parent bb4f967353
commit ffcfd24781

View File

@@ -125,19 +125,22 @@ public class TriggerSpellAbilityCast extends Trigger {
} else { } else {
if (sa.getTargetRestrictions().doesTarget()) { if (sa.getTargetRestrictions().doesTarget()) {
boolean validTgtFound = false; boolean validTgtFound = false;
for (final Card tgt : sa.getTargets().getTargetCards()) { while (sa != null && !validTgtFound) {
if (tgt.isValid(this.mapParams.get("TargetsValid").split(","), this.getHostCard() for (final Card tgt : sa.getTargets().getTargetCards()) {
.getController(), this.getHostCard())) { if (tgt.isValid(this.mapParams.get("TargetsValid").split(","), this.getHostCard()
validTgtFound = true; .getController(), this.getHostCard())) {
break; validTgtFound = true;
break;
}
} }
}
for (final Player p : sa.getTargets().getTargetPlayers()) { for (final Player p : sa.getTargets().getTargetPlayers()) {
if (matchesValid(p, this.mapParams.get("TargetsValid").split(","), this.getHostCard())) { if (matchesValid(p, this.mapParams.get("TargetsValid").split(","), this.getHostCard())) {
validTgtFound = true; validTgtFound = true;
break; break;
}
} }
sa = sa.getSubAbility();
} }
if (!validTgtFound) { if (!validTgtFound) {