- Move TargetsWithRelatedProperty to canTarget

This commit is contained in:
swordshine
2014-03-12 04:42:59 +00:00
parent 96e03e5fcf
commit 3fce6a5f2c
4 changed files with 21 additions and 48 deletions

View File

@@ -178,35 +178,6 @@ public class TargetSelection {
});
}
}
// If second target has properties related to the first
if (tgt.getRelatedProperty() != null && !targetedObjects.isEmpty()) {
final List<Card> list = new ArrayList<Card>();
final String related = tgt.getRelatedProperty();
for (final Object o : targetedObjects) {
if (o instanceof Card) {
list.add((Card) o);
}
}
if (!list.isEmpty()) {
final Card card = list.get(0);
if ("LEPower".equals(related)) {
choices = CardLists.filter(choices, new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
return c.getNetAttack() <= card.getNetAttack();
}
});
}
if ("LECMC".equals(related)) {
choices = CardLists.filter(choices, new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
return c.getCMC() <= card.getCMC();
}
});
}
}
}
// If all cards must be from the same zone
if (tgt.isSingleZone() && !targeted.isEmpty()) {
choices = CardLists.filterControlledBy(choices, targeted.get(0).getController());