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

How to use
moveCardToLibraryWithInfo
method
in
mage.players.Player

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

origin: magefree/mage

  @Override
  public boolean replaceEvent(GameEvent event, Ability source, Game game) {
    Permanent permanent = ((ZoneChangeEvent) event).getTarget();
    Player controller = game.getPlayer(source.getControllerId());
    if (permanent != null && controller != null) {
      controller.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, false, true);
      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.getPermanent(source.getSourceId());
    if (card != null) {
      controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.STACK, toTop, true);
    }
    return true;
  }
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getFirstTarget());
    if (player != null) {
      for (Card card: player.getGraveyard().getCards(game)) {
        player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
      }                
      player.shuffleLibrary(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) {
      for (Card card : controller.getGraveyard().getCards(game)) {
        controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
      }
      controller.shuffleLibrary(source, game);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getFirstTarget());
    if (player != null) {
      for (Card card: player.getGraveyard().getCards(game)) {
        player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
      }                 
      player.shuffleLibrary(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) {
      for (Card card: controller.getGraveyard().getCards(game)) {
        controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
      }            
      controller.shuffleLibrary(source, game);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
    if (permanent != null) {
      Player owner = game.getPlayer(permanent.getOwnerId());
      if (owner != null) {
        owner.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, true, true);
        owner.shuffleLibrary(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) {
      for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), source.getSourceId(), game)) {
        controller.moveCardToLibraryWithInfo(creature, source.getSourceId(), game, Zone.BATTLEFIELD, false, true);
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

@Override
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) {
  Player controller = game.getPlayer(controllerId);
  TargetCardInHand targetCardInHand = new TargetCardInHand();
  targetCardInHand.setRequired(false);
  Card card;
  if (targetCardInHand.canChoose(controllerId, game)
      && controller.choose(Outcome.PreventDamage, targetCardInHand, sourceId, game)) {
    card = game.getCard(targetCardInHand.getFirstTarget());
    paid = card != null && controller.moveCardToLibraryWithInfo(card, sourceId, game, Zone.HAND, true, true);
  }
  return paid;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
    if (player != null) {
      for (Card card: player.getGraveyard().getCards(game)) {
        player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
      }              
      player.shuffleLibrary(source, game);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
    if (player != null) {
      for (Card card: player.getGraveyard().getCards(game)) {
        player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
      }            
      player.shuffleLibrary(source, game);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Card sourceCard = game.getCard(source.getSourceId());
    if (controller != null && sourceCard != null) {
      if (game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) {
        controller.moveCardToLibraryWithInfo(sourceCard, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  private boolean putOnLibrary(Player player, Ability source, Game game) {
    TargetCardInHand target = new TargetCardInHand();
    if (target.canChoose(source.getSourceId(), player.getId(), game)) {
      player.chooseTarget(Outcome.ReturnToHand, target, source, game);
      Card card = player.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
      }
    }
    return false;
  }
}
origin: magefree/mage

  private boolean putOnLibrary(Player player, Ability source, Game game) {
    TargetCardInHand target = new TargetCardInHand();
    if (target.canChoose(source.getSourceId(), player.getId(), game)) {
      player.chooseTarget(Outcome.ReturnToHand, target, source, game);
      Card card = player.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
      }
    }
    return false;
  }
}
origin: magefree/mage

  private boolean putOnLibrary(Player player, Ability source, Game game) {
    TargetCardInHand target = new TargetCardInHand();
    if (target.canChoose(source.getSourceId(), player.getId(), game)) {
      player.chooseTarget(Outcome.ReturnToHand, target, source, game);
      Card card = player.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
      }
    }
    return false;
  }
}
origin: magefree/mage

  private boolean putOnLibrary(Player player, Ability source, Game game) {
    TargetCardInHand target = new TargetCardInHand();
    if (target.canChoose(source.getSourceId(), player.getId(), game)) {
      player.chooseTarget(Outcome.ReturnToHand, target, source, game);
      Card card = player.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
      }
    }
    return false;
  }
}
origin: magefree/mage

  private boolean putOnLibrary(Player player, Ability source, Game game) {
    TargetCardInHand target = new TargetCardInHand();
    if (target.canChoose(source.getSourceId(), player.getId(), game)) {
      player.chooseTarget(Outcome.ReturnToHand, target, source, game);
      Card card = player.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
      }
    }
    return false;
  }
}
origin: magefree/mage

  private boolean putOnLibrary(Player player, Ability source, Game game) {
    TargetCardInHand target = new TargetCardInHand();
    if (target.canChoose(source.getSourceId(), player.getId(), game)) {
      player.chooseTarget(Outcome.ReturnToHand, target, source, game);
      Card card = player.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
      }
    }
    return false;
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  DynamicValue value = new CardsInControllerGraveyardCount();
  if (controller != null) {
    controller.gainLife(value.calculate(game, source, this) * 2, game, source);
    for (Card card: controller.getGraveyard().getCards(game)) {
      controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
    }            
    controller.shuffleLibrary(source, game);
    return true;
  }
  return false;
}
origin: magefree/mage

  private void chooseCardInHandAndPutOnTopOfLibrary(Game game, Ability source, Player you, Player targetPlayer) {
    if (!targetPlayer.getHand().isEmpty()) {
      TargetCard target = new TargetCard(Zone.HAND, new FilterCard("card to put on the top of library (last chosen will be on top)"));
      if (you.choose(Outcome.Benefit, targetPlayer.getHand(), target, game)) {
        Card card = targetPlayer.getHand().get(target.getFirstTarget(), game);
        if (card != null) {
          targetPlayer.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
        }
      }
    }
  }
}
mage.playersPlayermoveCardToLibraryWithInfo

Javadoc

Uses card.moveToZone and posts a inform message about moving the card to library into the game log

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

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • addToBackStack (FragmentTransaction)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • 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