mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Simplified the code
This commit is contained in:
@@ -91,9 +91,9 @@ public class ChooseCardEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
} else if (sa.hasParam("WithTotalPower")){
|
} else if (sa.hasParam("WithTotalPower")){
|
||||||
final int totP = AbilityUtils.calculateAmount(host, sa.getParam("WithTotalPower"), sa);
|
final int totP = AbilityUtils.calculateAmount(host, sa.getParam("WithTotalPower"), sa);
|
||||||
CardCollection negativeCreats = new CardCollection(CardLists.getValidCards(p.getCreaturesInPlay(), "Card.powerLT0", host.getController(), host));
|
CardCollection negativeCreats = CardLists.filterLEPower(p.getCreaturesInPlay(), -1);
|
||||||
int negativeNum = Aggregates.sum(negativeCreats, CardPredicates.Accessors.fnGetNetPower);
|
int negativeNum = Aggregates.sum(negativeCreats, CardPredicates.Accessors.fnGetNetPower);
|
||||||
CardCollection creature = new CardCollection(CardLists.filterLEPower(p.getCreaturesInPlay(), totP - negativeNum));
|
CardCollection creature = CardLists.filterLEPower(p.getCreaturesInPlay(), totP - negativeNum);
|
||||||
CardCollection chosenPool = new CardCollection();
|
CardCollection chosenPool = new CardCollection();
|
||||||
int chosenP = 0;
|
int chosenP = 0;
|
||||||
while (!creature.isEmpty()) {
|
while (!creature.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user