mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 22:12:03 -08:00
[BRO] Implemented Gix's Command
This commit is contained in:
parent
2d6884c635
commit
867fa64156
3 changed files with 111 additions and 6 deletions
|
|
@ -14,12 +14,10 @@ public enum GreatestPowerControlledPredicate implements ObjectSourcePlayerPredic
|
|||
|
||||
@Override
|
||||
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
||||
Permanent creatureWithGreatestPower = input.getObject();
|
||||
for (Permanent p : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CONTROLLED_CREATURE, input.getObject().getControllerId(), game)) {
|
||||
if (p.getPower().getValue() >= creatureWithGreatestPower.getPower().getValue()) {
|
||||
creatureWithGreatestPower = p;
|
||||
}
|
||||
int greatestPower = Integer.MIN_VALUE;
|
||||
for (Permanent p : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CONTROLLED_CREATURE, input.getPlayerId(), input.getSource(), game)) {
|
||||
greatestPower = Math.max(greatestPower, p.getPower().getValue());
|
||||
}
|
||||
return (creatureWithGreatestPower == input.getObject());
|
||||
return input.getObject().getPower().getValue() == greatestPower;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue