Codota Logo
Player.isTopCardRevealed
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
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

  • Making http post requests using okhttp
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now