congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Player.lookAtCards
Code IndexAdd Tabnine to your IDE (free)

How to use
lookAtCards
method
in
mage.players.Player

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

origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Player player = game.getPlayer(targetPointer.getFirst(game, source));
  if (player != null && controller != null) {
    controller.lookAtCards("Walker of Secret Ways", player.getHand(), game);
  }
  return true;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null) {
    Card topCard = controller.getLibrary().getFromTop(game);
    if (topCard != null) {
      MageObject vizierOfTheMenagerie = source.getSourceObject(game);
      if (vizierOfTheMenagerie != null) {
        controller.lookAtCards("Top card of " + vizierOfTheMenagerie.getIdName() + " controller's library", topCard, game);
      }
    }
  }
  return true;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null) {
    Card topCard = controller.getLibrary().getFromTop(game);
    if (topCard != null) {
      MageObject precognitionField = source.getSourceObject(game);
      if (precognitionField != null) {
        controller.lookAtCards("Top card of " + precognitionField.getIdName() + " controller's library", topCard, game);
      }
    }
  }
  return true;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player == null) {
      return false;
    }

    Card card = player.getLibrary().getFromTop(game);
    if (card != null) {
      Cards cards = new CardsImpl();
      cards.add(card);
      player.lookAtCards("Sphinx of Jwar Isle", cards, game);
    } else {
      return false;
    }

    return true;
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller == null) {
    return true;
  }
  Card topCard = controller.getLibrary().getFromTop(game);
  if (topCard == null) {
    return true;
  }
  MageObject obj = source.getSourceObject(game);
  if (obj == null) {
    return true;
  }
  controller.lookAtCards("Top card of " + obj.getIdName() + " controller's library", topCard, game);
  return true;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player player = game.getPlayer(source.getControllerId());
  Card target = (Card) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.STACK);
  if (target != null) {
    Player controller = game.getPlayer(target.getOwnerId());
    if (controller != null && player != null) {
      player.lookAtCards("Lay Bare", controller.getHand(), game);
      return true;
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player you = game.getPlayer(source.getControllerId());
  Player targetPlayer = game.getPlayer(source.getFirstTarget());
  MageObject sourceObject = game.getObject(source.getSourceId());
  if (you != null && targetPlayer != null) {
    you.lookAtCards(sourceObject != null ? sourceObject.getIdName() : null, targetPlayer.getHand(), game);
    return true;
  }
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Player targetPlayer = game.getPlayer(source.getFirstTarget());
    if (targetPlayer == null || controller == null) {
      return false;
    }
    Cards cards = new CardsImpl(targetPlayer.getLibrary().getTopCards(game, 3));
    controller.lookAtCards(source, null, cards, game);
    controller.putCardsOnTopOfLibrary(cards, game, source, true);
    return true;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Player player = game.getPlayer(source.getFirstTarget());
    if (player == null || controller == null) {
      return false;
    }
    Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 5));
    controller.lookAtCards(source, null, cards, game);
    controller.putCardsOnTopOfLibrary(cards, game, source, true);
    return true;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Player targetPlayer = game.getPlayer(source.getFirstTarget());
    if (targetPlayer == null
        || controller == null) {
      return false;
    }
    Cards cards = new CardsImpl(targetPlayer.getLibrary().getTopCards(game, 3));
    controller.lookAtCards(source, null, cards, game);
    controller.putCardsOnTopOfLibrary(cards, game, source, true);
    return true;
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player you = game.getPlayer(source.getControllerId());
  Player targetPlayer = game.getPlayer(source.getFirstTarget());
  MageObject sourceObject = game.getObject(source.getSourceId());
  if (you != null && targetPlayer != null) {
    you.lookAtCards("Hand of " + targetPlayer.getName() + " (" + (sourceObject != null ? sourceObject.getIdName() : null) + ')', targetPlayer.getHand(), game);
    return true;
  }
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Player targetPlayer = game.getPlayer(source.getFirstTarget());
    if (targetPlayer == null || controller == null) {
      return false;
    }
    Cards cards = new CardsImpl(targetPlayer.getLibrary().getTopCards(game, 3));
    controller.lookAtCards(source, null, cards, game);
    controller.putCardsOnTopOfLibrary(cards, game, source, true);
    if (controller.chooseUse(Outcome.Neutral, "You may have that player shuffle their library", source, game)) {
      targetPlayer.shuffleLibrary(source, game);
    }
    return true;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
    if (player == null || controller == null) {
      return false;
    }
    Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 3));
    controller.lookAtCards(source, null, cards, game);
    controller.putCardsOnTopOfLibrary(cards, game, source, true);
    if (controller.chooseUse(Outcome.Neutral, "You may have that player shuffle their library", source, game)) {
      player.shuffleLibrary(source, game);
    }
    return true;
  }
}
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

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null) {
    Card card = controller.getLibrary().getFromTop(game);
    if (card != null) {
      controller.lookAtCards(source, null, new CardsImpl(card), game);
      if (card.isInstant() || card.isSorcery()) {
        if (controller.chooseUse(Outcome.PlayForFree, "Cast " + card.getName() + " without paying its mana cost?", source, game)) {
          controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game));
        }
      }
    }
    return true;
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player you = game.getPlayer(source.getControllerId());
  Player targetPlayer = game.getPlayer(source.getFirstTarget());
  MageObject sourceObject = game.getObject(source.getSourceId());
  if (you != null && targetPlayer != null && sourceObject != null) {
    if(!targetPlayer.getHand().isEmpty())
    {
      Cards randomCard = new CardsImpl();
      Card card = targetPlayer.getHand().getRandom(game);
      randomCard.add(card);
      you.lookAtCards(sourceObject.getName(), randomCard, game);
    }
    return true;
  }
  return false;
}

origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  MageObject sourceObject = game.getObject(source.getSourceId());
  if (sourceObject == null || controller == null) {
    return false;
  }
  if (!controller.getLibrary().isEmptyDraw()) {
    Card card = controller.getLibrary().getFromTop(game);
    if (card == null) {
      return false;
    }
    controller.lookAtCards(sourceObject.getName(), new CardsImpl(card), game);
    boolean toBottom = controller.chooseUse(outcome, "Put card on the bottom of your library?", source, game);
    return controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, !toBottom, false);
  }
  return true;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player != null) {
      TargetOpponent target = new TargetOpponent(true);
      if (player.choose(Outcome.Benefit, target, source.getSourceId(), game)) {
        Player opponent = game.getPlayer(target.getFirstTarget());
        if (opponent != null) {
          MageObject sourceObject = game.getObject(source.getSourceId());
          player.lookAtCards(sourceObject != null ? sourceObject.getIdName() : null, opponent.getHand(), game);
          player.chooseUse(Outcome.Benefit, "Press ok to name a card", "You won't be able to resize the window once you do", "Ok", " ", source, game);
        }
      }
    }
    return super.apply(game, source);
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player targetPlayer = game.getPlayer(source.getFirstTarget());
  Player you = game.getPlayer(source.getControllerId());
  if (targetPlayer != null && you != null) {
    you.lookAtCards("Discard", targetPlayer.getHand(), game);
    TargetCard target = new TargetCard(Zone.HAND, new FilterCard());
    target.setNotTarget(true);
    if (you.choose(Outcome.Benefit, targetPlayer.getHand(), target, game)) {
      Card card = targetPlayer.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        return targetPlayer.discard(card, source, game);
      }
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player targetPlayer = game.getPlayer(source.getFirstTarget());
  Player you = game.getPlayer(source.getControllerId());
  if (targetPlayer != null && you != null) {
    you.lookAtCards("Discard", targetPlayer.getHand(), game);
    TargetCard target = new TargetCard(0, 2, Zone.HAND, new FilterCard());
    target.setNotTarget(true);
    if (you.choose(Outcome.Benefit, targetPlayer.getHand(), target, game)) {
      Card card = targetPlayer.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        return targetPlayer.discard(card, source, game);
      }
    }
  }
  return false;
}
mage.playersPlayerlookAtCards

Javadoc

Adds the cards to the look window and adds the source object's id name to the title bar of the lookedAt window

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

  • Finding current android device location
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • onCreateOptionsMenu (Activity)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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