mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 21:42:07 -08:00
- fixed Szat's Will.
This commit is contained in:
parent
221681eaf0
commit
08da78d184
2 changed files with 31 additions and 33 deletions
|
|
@ -0,0 +1,25 @@
|
|||
package mage.filter.predicate.permanent;
|
||||
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public enum GreatestPowerControlledPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Permanent>> {
|
||||
instance;
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
return (creatureWithGreatestPower == input.getObject());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue