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

How to use
isTopCardRevealed
method
in
mage.players.Player

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

origin: magefree/mage

  @Override
  public List<Mana> getNetMana(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      if (controller.isTopCardRevealed()) {
        Card card = controller.getLibrary().getFromTop(game);
        if (card != null) {
          List<Mana> netMana = card.getManaCost().getManaOptions();
          for (Mana mana : netMana) {
            mana.setColorless(0);
            mana.setGeneric(0);
          }
          return netMana;
        }
      }
    }
    return null;
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller == null) {
    return false;
  }
  // take cards from library and look at them
  boolean topCardRevealed = controller.isTopCardRevealed();
  controller.setTopCardRevealed(false);
  Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, this.numberOfCards.calculate(game, source, this)));
  controller.lookAtCards(source, null, cards, game);
  this.actionWithSelectedCards(cards, game, source);
  this.putCardsBack(source, controller, cards, game);
  controller.setTopCardRevealed(topCardRevealed);
  this.mayShuffle(controller, source, game);
  return true;
}
origin: magefree/mage

this.alternativeSourceCosts.addAll(player.getAlternativeSourceCosts());
this.topCardRevealed = player.isTopCardRevealed();
this.playersUnderYourControl.clear();
this.playersUnderYourControl.addAll(player.getPlayersUnderYourControl());
origin: magefree/mage

/**
 * Draw a card if possible (there is no replacement effect that prevent us
 * from drawing). Fire event about card drawn.
 *
 * @param game
 * @return
 */
protected int drawCard(Game game) {
  GameEvent event = GameEvent.getEvent(GameEvent.EventType.DRAW_CARD, player.getId(), player.getId());
  event.addAppliedEffects(appliedEffects);
  if (!game.replaceEvent(event)) {
    Card card = player.getLibrary().removeFromTop(game);
    if (card != null) {
      drawnCards.add(card);
      card.moveToZone(Zone.HAND, null, game, false);
      if (player.isTopCardRevealed()) {
        game.fireInformEvent(player.getLogName() + " draws a revealed card  (" + card.getLogName() + ')');
      }
      game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DREW_CARD, card.getId(), player.getId()));
      return ArtificialScoringSystem.inst.getCardScore(card);
    }
  }
  return NEGATIVE_VALUE;
}
origin: magefree/mage

Card cardOnTop = (player.isTopCardRevealed() && player.getLibrary().hasCards())
    ? player.getLibrary().getFromTop(game) : null;
this.topCard = cardOnTop != null ? new CardView(cardOnTop) : null;
origin: magefree/mage

  score += value;
if (!player.isTopCardRevealed() && numDrawn > 0) {
  game.fireInformEvent(player.getLogName() + " draws " + CardUtil.numberToText(numDrawn, "a") + " card" + (numDrawn > 1 ? "s" : ""));
origin: magefree/mage

  return false;
boolean revealed = opponent.isTopCardRevealed(); // by looking at the cards with fateseal you have not to reveal the next card
opponent.setTopCardRevealed(false);
Cards cards = new CardsImpl();
mage.playersPlayerisTopCardRevealed

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
  • putExtra (Intent)
  • getSystemService (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JComboBox (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top 12 Jupyter Notebook extensions
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