congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
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

  • Start an intent from android
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • onCreateOptionsMenu (Activity)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • PhpStorm for WordPress
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