@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player player = game.getPlayer(event.getPlayerId()); if (player != null) { player.won(game); } return true; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { player.won(game); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { List<String> names = new ArrayList<>(); for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { if (permanent.hasSubtype(SubType.GATE, game)) { if (!names.contains(permanent.getName())) { names.add(permanent.getName()); } } } if (names.size() >= 10) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { controller.won(game); } } return false; }
Player winner = game.getPlayer(highestLifePlayers.iterator().next()); if (winner != null) { winner.won(game);
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { permanent.addCounters(CounterType.FILIBUSTER.createInstance(), source, game); if (permanent.getCounters(game).getCount(CounterType.FILIBUSTER) > 4) { Player player = game.getPlayer(permanent.getControllerId()); if (player != null) { player.won(game); } } return true; } return false; }
if (controller != null) { game.informPlayers(controller.getLogName() + " controls eight or more artifacts with the same name as one another (" + entry.getKey() + ")."); controller.won(game); return true;
protected UUID findWinnersAndLosers() { UUID winnerIdFound = null; for (Player player : state.getPlayers().values()) { if (player.hasWon()) { logger.debug(player.getName() + " has won gameId: " + getId()); winnerIdFound = player.getId(); break; } if (!player.hasLost() && !player.hasLeft()) { logger.debug(player.getName() + " has not lost so he won gameId: " + this.getId()); player.won(this); winnerIdFound = player.getId(); break; } } for (Player player : state.getPlayers().values()) { if (winnerIdFound != null && !player.getId().equals(winnerIdFound) && !player.hasLost()) { player.lost(this); } } return winnerIdFound; }
if (!player.hasLeft() && !player.hasLost()) { logger.debug("Player " + player.getName() + " has won gameId: " + this.getId()); player.won(this);
@Override public boolean applies(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { if (controller.getHand().isEmpty()) { int numberPerms = new PermanentsOnBattlefieldCount(new FilterControlledPermanent()).calculate(game, source, this); if (numberPerms == 1) { if (game.getBattlefield().contains(filter, source.getControllerId(), 1, game)) { if (!wonAlready) { wonAlready = true; controller.won(game); } } } } } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (controller != null && permanent != null) { if (getValue("rolled") != null) { int amount = (Integer) getValue("rolled"); permanent.addCounters(new Counter("luck", amount), source, game); if (permanent.getCounters(game).getCount("luck") >= 100) { Player player = game.getPlayer(permanent.getControllerId()); if (player != null) { player.won(game); } } return true; } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null) { Cards cardsToReveal = new CardsImpl(); controller.revealCards(sourceObject.getIdName(), cardsToReveal, game); // Check battlefield if (!game.getBattlefield().contains(filterPermanent, source.getControllerId(), game, 1)) { return true; } if (controller.getHand().getCards(filterCard, source.getSourceId(), controller.getId(), game).isEmpty()) { return true; } if (controller.getGraveyard().getCards(filterCard, source.getSourceId(), controller.getId(), game).isEmpty()) { return true; } Cards cardsToCheck = new CardsImpl(); cardsToCheck.addAll(game.getExile().getAllCards(game)); if (cardsToCheck.count(filterCard, source.getSourceId(), controller.getId(), game) == 0) { return true; } controller.won(game); return true; } return false; } }
&& spell.getFromZone() == Zone.HAND) { controller.won(game); } else {
filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 19)); if (game.getState().getBattlefield().countAll(filter, controller.getId(), game) > 0) { controller.won(game);