mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
merge
This commit is contained in:
parent
e11e0a10cf
commit
ae38095c58
1 changed files with 6 additions and 4 deletions
|
@ -50,17 +50,19 @@ public class CardsInAnyLibraryCondition implements Condition {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final boolean apply(Game game, Ability source) {
|
public final boolean apply(Game game, Ability source) {
|
||||||
|
|
||||||
|
boolean libraryWith20OrFewerCards = false;
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||||
Player player = game.getPlayer(playerId);
|
Player player = game.getPlayer(playerId);
|
||||||
if (player != null) {
|
if (player != null && ComparisonType.compare(player.getLibrary().size(), type, value)) {
|
||||||
return ComparisonType.compare(player.getLibrary().size(), type, value);
|
libraryWith20OrFewerCards = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return libraryWith20OrFewerCards;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue