[DSK] Implement Abandoned Campground

This commit is contained in:
theelk801 2024-09-02 13:03:37 -04:00
parent 8266d2788b
commit 343e0d5179
3 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,32 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game;
import mage.players.Player;
import java.util.Objects;
/**
* @author TheElk801
*/
public enum APlayerHas13LifeCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return game
.getState()
.getPlayersInRange(source.getControllerId(), game)
.stream()
.map(game::getPlayer)
.filter(Objects::nonNull)
.mapToInt(Player::getLife)
.anyMatch(x -> x <= 13);
}
@Override
public String toString() {
return "a player has 13 or less life";
}
}