Tabnine Logo
Player.won
Code IndexAdd Tabnine to your IDE (free)

How to use
won
method
in
mage.players.Player

Best Java code snippets using mage.players.Player.won (Showing top 13 results out of 315)

origin: magefree/mage

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
  Player player = game.getPlayer(event.getPlayerId());
  if (player != null) {
    player.won(game);
  }
  return true;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player != null) {
      player.won(game);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

@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;
}
origin: magefree/mage

Player winner = game.getPlayer(highestLifePlayers.iterator().next());
if (winner != null) {
  winner.won(game);
origin: magefree/mage

@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;
}
origin: magefree/mage

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;
origin: magefree/mage

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;
}
origin: magefree/mage

if (!player.hasLeft() && !player.hasLost()) {
  logger.debug("Player " + player.getName() + " has won gameId: " + this.getId());
  player.won(this);
origin: magefree/mage

@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;
}
origin: magefree/mage

  @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;

  }
}
origin: magefree/mage

  @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;
  }
}
origin: magefree/mage

    && spell.getFromZone() == Zone.HAND) {
  controller.won(game);
} else {
origin: magefree/mage

filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 19));
if (game.getState().getBattlefield().countAll(filter, controller.getId(), game) > 0) {
  controller.won(game);
mage.playersPlayerwon

Popular methods of Player

  • getId
  • getHand
  • getName
  • getLife
  • getLibrary
  • hasLeft
  • hasWon
  • getCounters
  • hasLost
  • copy
  • damage
  • declareAttacker
  • damage,
  • declareAttacker,
  • getGraveyard,
  • getPlayersUnderYourControl,
  • activateAbility,
  • canLose,
  • choose,
  • declareBlocker,
  • gainLife,
  • getAttachments

Popular in Java

  • Reading from database using SQL prepared statement
  • getSystemService (Context)
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Notification (javax.management)
  • JList (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now