congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Player.playCard
Code IndexAdd Tabnine to your IDE (free)

How to use
playCard
method
in
mage.players.Player

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

origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Card card = game.getCard(getTargetPointer().getFirst(game, source));
  if (controller != null && card != null) {
    if (controller.chooseUse(Outcome.PlayForFree, "Play " + card.getIdName() + " without paying its mana cost?", source, game)) {
      controller.playCard(card, game, true, true, new MageObjectReference(source.getSourceObject(game), game));
    }
    return true;
  }
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      Card card = game.getCard(getTargetPointer().getFirst(game, source));
      if (card != null && controller.chooseUse(outcome, "Play " + card.getName() + " from your graveyard for free?", source, game)) {
        controller.playCard(card, game, true, true, new MageObjectReference(source.getSourceObject(game), game));
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
  Spell spell = game.getStack().getSpell(event.getTargetId());
  Player controller = game.getPlayer(source.getControllerId());
  if (spell != null && controller != null) {
    controller.moveCards(spell, Zone.EXILED, source, game);
    if (!spell.isCopy()) {
      Card spellCard = spell.getCard();
      if (spellCard != null && controller.chooseUse(Outcome.PlayForFree, "Cast " + spellCard.getIdName() + " for free?", source, game)) {
        controller.playCard(spellCard, game, true, true, new MageObjectReference(source.getSourceObject(game), game));
      }
      return true;
    }
  }
  return false;
}
origin: magefree/mage

if (!controller.playCard(card, game, true, true, new MageObjectReference(source.getSourceObject(game), game))) {
  if (card.getZoneChangeCounter(game) == zcc) {
    card.setFaceDown(true, game);
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  MageObject sourceObject = game.getObject(source.getSourceId());
  if (controller != null && sourceObject != null && controller.getLibrary().hasCards()) {
    Card card = controller.getLibrary().getFromTop(game);
    Cards cards = new CardsImpl(card);
    controller.revealCards(sourceObject.getIdName(), cards, game);
    if (!controller.chooseUse(Outcome.PlayForFree, "Play " + card.getName() + " without paying its mana cost?", source, game)
        || !controller.playCard(card, game, true, true, new MageObjectReference(source.getSourceObject(game), game))) {
      controller.moveCards(card, Zone.EXILED, source, game);
    }
    return true;
  }
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      ExileZone exileZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
      if (exileZone != null && exileZone.count(new FilterInstantOrSorceryCard(), game) > 0) {
        if (controller.chooseUse(outcome, "Cast an instant or sorcery card from exile?", source, game)) {
          TargetCardInExile target = new TargetCardInExile(new FilterInstantOrSorceryCard(), CardUtil.getCardExileZoneId(game, source));
          if (controller.choose(Outcome.PlayForFree, exileZone, target, game)) {
            Card card = game.getCard(target.getFirstTarget());
            if (card != null) {
              return controller.playCard(card, game, true, false, new MageObjectReference(source.getSourceId(), game));
            }
          }
        }
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

Card card = selectedPile.get(targetExiledCard.getFirstTarget(), game);
controller.canPlayLand();
if (controller.playCard(card, game, true, true, new MageObjectReference(source.getSourceObject(game), game))) {
  selectedPileCards.remove(card);
  selectedPile.remove(card);
origin: magefree/mage

while (canPlay
    && targetPlayer.canRespond()
    && !targetPlayer.playCard(card, game, false, true, new MageObjectReference(source.getSourceObject(game), game))) {
  SpellAbility spellAbility = card.getSpellAbility();
  if (spellAbility != null) {
mage.playersPlayerplayCard

Javadoc

Plays a card if possible

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

  • Reactive rest calls using spring rest template
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top Vim plugins
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