- 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 {
if (sa.getTargetRestrictions().doesTarget()) {
boolean validTgtFound = false;
for (final Card tgt : sa.getTargets().getTargetCards()) {
if (tgt.isValid(this.mapParams.get("TargetsValid").split(","), this.getHostCard()
.getController(), this.getHostCard())) {
validTgtFound = true;
break;
while (sa != null && !validTgtFound) {
for (final Card tgt : sa.getTargets().getTargetCards()) {
if (tgt.isValid(this.mapParams.get("TargetsValid").split(","), this.getHostCard()
.getController(), this.getHostCard())) {
validTgtFound = true;
break;
}
}
}
for (final Player p : sa.getTargets().getTargetPlayers()) {
if (matchesValid(p, this.mapParams.get("TargetsValid").split(","), this.getHostCard())) {
validTgtFound = true;
break;
for (final Player p : sa.getTargets().getTargetPlayers()) {
if (matchesValid(p, this.mapParams.get("TargetsValid").split(","), this.getHostCard())) {
validTgtFound = true;
break;
}
}
sa = sa.getSubAbility();
}
if (!validTgtFound) {