mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 20:11:59 -08:00
- Little fix Triumph of Ferocity.
This commit is contained in:
parent
515261920d
commit
06887c6093
1 changed files with 5 additions and 7 deletions
|
|
@ -32,9 +32,6 @@ import mage.abilities.condition.Condition;
|
|||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
|
@ -55,13 +52,14 @@ public class ControlsBiggestOrTiedCreatureCondition implements Condition {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Set<UUID> controllers = new HashSet<UUID>();
|
||||
UUID controller = null;
|
||||
int maxPower = -1;
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents()) {
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) {
|
||||
if (maxPower == -1 || permanent.getPower().getValue() >= maxPower) {
|
||||
controllers.add(permanent.getControllerId());
|
||||
maxPower = permanent.getPower().getValue();
|
||||
controller = (permanent.getControllerId());
|
||||
}
|
||||
}
|
||||
return controllers.contains(source.getControllerId());
|
||||
return controller.equals(source.getControllerId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue