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

How to use
setGameUnderYourControl
method
in
mage.players.Player

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

origin: magefree/mage

@Override
public void endStep(Game game, UUID activePlayerId) {
  Player activePlayer = game.getPlayer(activePlayerId);
  activePlayer.setGameUnderYourControl(true);
  super.endStep(game, activePlayerId);         
}
origin: magefree/mage

@Override
public void resetControlAfterSpellResolve(UUID topId) {
  // for Word of Command
  Spell spell = getSpellOrLKIStack(topId);
  if (spell != null) {
    if (spell.getCommandedBy() != null) {
      UUID commandedBy = spell.getCommandedBy();
      UUID spellControllerId = null;
      if (commandedBy.equals(spell.getControllerId())) {
        spellControllerId = spell.getSpellAbility().getFirstTarget(); // i.e. resolved spell is Word of Command
      } else {
        spellControllerId = spell.getControllerId(); // i.e. resolved spell is the target opponent's spell
      }
      if (spellControllerId != null) {
        Player turnController = getPlayer(commandedBy);
        if (turnController != null) {
          Player targetPlayer = getPlayer(spellControllerId);
          if (targetPlayer != null) {
            targetPlayer.setGameUnderYourControl(true, false);
            informPlayers(turnController.getLogName() + " lost control over " + targetPlayer.getLogName());
            if (targetPlayer.getTurnControlledBy().equals(turnController.getId())) {
              turnController.getPlayersUnderYourControl().remove(targetPlayer.getId());
            }
          }
        }
      }
      spell.setCommandedBy(null);
    }
  }
}
origin: magefree/mage

@Override
public void controlPlayersTurn(Game game, UUID playerId) {
  Player player = game.getPlayer(playerId);
  player.setTurnControlledBy(this.getId());
  game.informPlayers(getLogName() + " controls the turn of " + player.getLogName());
  if (!playerId.equals(this.getId())) {
    this.playersUnderYourControl.add(playerId);
    if (!player.hasLeft() && !player.hasLost()) {
      player.setGameUnderYourControl(false);
    }
    DelayedTriggeredAbility ability = new AtTheEndOfTurnStepPostDelayedTriggeredAbility(new LoseControlOnOtherPlayersControllerEffect(this.getLogName(), player.getLogName()));
    ability.setSourceId(getId());
    ability.setControllerId(getId());
    game.addDelayedTriggeredAbility(ability);
  }
}
origin: magefree/mage

targetPlayer.setGameUnderYourControl(true, false);
if (!targetPlayer.getTurnControlledBy().equals(controller.getId())) {
  controller.getPlayersUnderYourControl().remove(targetPlayer.getId());
mage.playersPlayersetGameUnderYourControl

Javadoc

Returns false in case you don't control the game.

Note: For effects like "You control target player during that player's next turn".

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
  • runOnUiThread (Activity)
  • getApplicationContext (Context)
  • getResourceAsStream (ClassLoader)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Top 15 Vim Plugins
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