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

How to use
getGraveyard
method
in
mage.players.Player

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

origin: magefree/mage

@Override
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
  Player controller = game.getPlayer(controllerId);
  if(controller == null) {
    return false;
  }
  return controller.getGraveyard().size() >= amount;
}
origin: magefree/mage

@Override
public Set<UUID> possibleTargets(UUID sourceControllerId, Cards cards, Game game) {
  Set<UUID> possibleTargets = new HashSet<>();
  Player player = game.getPlayer(sourceControllerId);
  for (Card card : cards.getCards(filter, game)) {
    if (player.getGraveyard().getCards(game).contains(card)) {
      possibleTargets.add(card.getId());
    }
  }
  return possibleTargets;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    return player != null && player.getGraveyard().count(filter, game) > 0;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {  
    Player player = game.getPlayer(source.getControllerId());
    return player != null && player.getGraveyard().count(filter, game) >= 20;    
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player player = game.getPlayer(source.getControllerId());
  if (filter != null) {
    return player != null && player.getGraveyard().count(filter, source.getSourceId(), source.getControllerId(), game) >= value;
  }
  return player != null && player.getGraveyard().size() >= value;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    return player != null && player.getGraveyard().count(filter, game) > 0;
  }
}
origin: magefree/mage

@Override
public void init(Ability source, Game game) {
  super.init(source, game);
  if (this.affectedObjectsSet) {
    Player player = game.getPlayer(source.getControllerId());
    if (player != null) {
      player.getGraveyard().stream().map((cardId) -> game.getCard(cardId)).filter((card) -> (card.isInstant() || card.isSorcery())).forEachOrdered((card) -> {
        affectedObjectList.add(new MageObjectReference(card, game));
      });
    }
  }
}
origin: magefree/mage

@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
  Player player = game.getPlayer(effect.getTargetPointer().getFirst(game, sourceAbility));
  if (player != null) {
    if (filter == null) {
      return player.getGraveyard().size();
    } else {
      return player.getGraveyard().count(filter, sourceAbility.getControllerId(), sourceAbility.getSourceId(), game);
    }
  }
  return 0;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player != null) {
      Set<Card> cards = player.getGraveyard().getCards(filter2orLess, game);
      player.moveCards(cards, Zone.HAND, source, game);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source, Ability abilityToModify) {
  Player player = game.getPlayer(source.getControllerId());
  if (player != null) {
    int reductionAmount = player.getGraveyard().count(filter, game);
    CardUtil.reduceCost(abilityToModify, reductionAmount);
    return true;
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source, Ability abilityToModify) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null) {
    CardUtil.reduceCost(abilityToModify, controller.getGraveyard().count(StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, game));
  }
  return true;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player p = game.getPlayer(source.getControllerId());
    if (p != null && p.getGraveyard().count(new FilterInstantOrSorceryCard(), game) >= value) {
      return true;
    }
    return false;
  }
}
origin: magefree/mage

@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
  int amount = 0;
  Player player = game.getPlayer(sourceAbility.getControllerId());
  if (player != null) {
    amount += player.getGraveyard().count(
        filter, sourceAbility.getSourceId(),
        sourceAbility.getControllerId(), game
    );
  }
  return amount + 2;
}
origin: magefree/mage

@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
  int count = 0;
  for (UUID playerId : game.getState().getPlayersInRange(sourceAbility.getControllerId(), game)) {
    Player player = game.getPlayer(playerId);
    if (player != null) {
      count += player.getGraveyard().size();
    }
  }
  return count;
}
origin: magefree/mage

@Override
public int calculate(Game game, Ability source, Effect effect) {
  int amount = 0;
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null) {
      amount += controller.getGraveyard().count(filter, source.getSourceId(), source.getControllerId(), game);
    }
  return amount + 2;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
  if (targetPlayer != null) {
    for (Card card : targetPlayer.getGraveyard().getCards(filter, game)) {
      card.moveToExile(null, "", source.getSourceId(), game);
    }
    return true;
  } 
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
      Player player = game.getPlayer(playerId);
      if (player != null) {
        player.moveCards(player.getGraveyard().getCards(StaticFilters.FILTER_CARD_ARTIFACT, game), Zone.BATTLEFIELD, source, game);
      }
    }
    return true;
  }
}
origin: magefree/mage

@Override
public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) {
  if (super.canTarget(controllerId, id, source, game)) {
    Permanent target = game.getPermanent(id);
    if (target != null) {
      return target.getPower().getValue() < game.getPlayer(source.getControllerId()).getGraveyard().size();
    }
    return false;
  }
  return false;
}
origin: magefree/mage

@Override
public boolean canTarget(UUID id, Ability source, Game game) {
  Card card = game.getCard(id);
  if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
    UUID firstTarget = source.getFirstTarget();
    if (firstTarget != null && game.getPlayer(firstTarget).getGraveyard().contains(id)) {
      return filter.match(card, game);
    }
  }
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      controller.moveCards(controller.getLibrary().getTopCards(game, 2), Zone.GRAVEYARD, source, game);
      if (controller.getGraveyard().count(filter, source.getSourceId(), source.getControllerId(), game) >= 1) {
        return new TransformSourceEffect(true).apply(game, source);
      }
    }
    return false;
  }
}
mage.playersPlayergetGraveyard

Popular methods of Player

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

Popular in Java

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • setScale (BigDecimal)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top plugins for Android Studio
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