mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Merge branch 'master' into 'master'
Generalize SweepCreatures logic (By Invitation Only) See merge request core-developers/forge!5711
This commit is contained in:
@@ -1923,11 +1923,12 @@ public class AiController {
|
|||||||
} else if ("Vermin".equals(logic)) {
|
} else if ("Vermin".equals(logic)) {
|
||||||
return MyRandom.getRandom().nextInt(Math.max(player.getLife() - 5, 0));
|
return MyRandom.getRandom().nextInt(Math.max(player.getLife() - 5, 0));
|
||||||
} else if ("SweepCreatures".equals(logic)) {
|
} else if ("SweepCreatures".equals(logic)) {
|
||||||
|
int choiceLimit = AbilityUtils.calculateAmount(source, sa.getParam("Max"), sa);
|
||||||
int maxCreatures = 0;
|
int maxCreatures = 0;
|
||||||
for (Player opp : player.getOpponents()) {
|
for (Player opp : player.getOpponents()) {
|
||||||
maxCreatures = Math.max(maxCreatures, opp.getCreaturesInPlay().size());
|
maxCreatures = Math.max(maxCreatures, opp.getCreaturesInPlay().size());
|
||||||
}
|
}
|
||||||
return Math.min(13, maxCreatures);
|
return Math.min(choiceLimit, maxCreatures);
|
||||||
}
|
}
|
||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user