mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
add TargetsWithDifferentCMC param
This commit is contained in:
@@ -189,7 +189,7 @@ public final class InputSelectTargets extends InputSyncronizedBase {
|
||||
}
|
||||
}
|
||||
|
||||
// If all cards must have different controllers
|
||||
// If all cards must have same controllers
|
||||
if (tgt.isSameController()) {
|
||||
final List<Player> targetedControllers = new ArrayList<>();
|
||||
for (final GameObject o : targetDepth.keySet()) {
|
||||
@@ -219,6 +219,21 @@ public final class InputSelectTargets extends InputSyncronizedBase {
|
||||
}
|
||||
}
|
||||
|
||||
// If all cards must have different CMC
|
||||
if (tgt.isDifferentCMC()) {
|
||||
final List<Integer> targetedCMCs = new ArrayList<>();
|
||||
for (final GameObject o : targetDepth.keySet()) {
|
||||
if (o instanceof Card) {
|
||||
final Integer cmc = ((Card) o).getCMC();
|
||||
targetedCMCs.add(cmc);
|
||||
}
|
||||
}
|
||||
if (targetedCMCs.contains(card.getCMC())) {
|
||||
showMessage(sa.getHostCard() + " - Cannot target this card (must have different CMC)");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!choices.contains(card)) {
|
||||
showMessage(sa.getHostCard() + " - The selected card is not a valid choice to be targeted.");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user