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

How to use
moveCardsToExile
method
in
mage.players.Player

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

origin: magefree/mage

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
  Player controller = game.getPlayer(source.getControllerId());
  Card card = game.getCard(this.cardId);
  if (controller != null && card != null) {
    controller.moveCardsToExile(card, source, game, true, null, "");
    return true;
  }
  return false;
}
origin: magefree/mage

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null) {
    Card card = game.getCard(event.getTargetId());
    if (card != null) {
      controller.moveCardsToExile(card, source, game, true, null, null);
    }
    return true;
  }
  return false;
}
origin: magefree/mage

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null) {
    Card card = game.getCard(event.getTargetId());
    if (card != null) {
      controller.moveCardsToExile(card, source, game, true, null, null);
    }
    return true;
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player player = game.getPlayer(targetPointer.getFirst(game, source));
  if (player != null) {
    Card card = player.getLibrary().getFromTop(game);
    if (card != null) {
      player.moveCardsToExile(card, source, game, true, CardUtil.getCardExileZoneId(game, source), CardUtil.createObjectRealtedWindowTitle(source, game, null));
      return true;
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Permanent permanent = game.getPermanent(source.getSourceId());
  //If the permanent leaves the battlefield before the ability resolves, artifacts won't be exiled.
  if (permanent == null || controller == null) return false;
  Set<Card> toExile = new LinkedHashSet<>();
  for (Permanent artifact : game.getBattlefield().getActivePermanents(filter, controller.getId(), game)) {
    toExile.add(artifact);
  }
  if (!toExile.isEmpty()) {
    controller.moveCardsToExile(toExile, source, game, true, CardUtil.getCardExileZoneId(game, source), permanent.getIdName());
    new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()).apply(game, source);
  }
  return true;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  MageObject sourceObject = source.getSourceObject(game);
  if (controller != null) {
    UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
    if (exileId != null) {
      Set<Card> cardsToExile = new LinkedHashSet<>();
      cardsToExile.addAll(game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game));
      controller.moveCardsToExile(cardsToExile, source, game, true, exileId, sourceObject.getIdName());
      return true;
    }
  }
  return false;
}
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) {
      return false;
    }
    return player.moveCardsToExile(
        card, source, game, true, CardUtil.getCardExileZoneId(game, source),
        CardUtil.createObjectRealtedWindowTitle(source, game, null)
    );
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId());
    if (controller != null && enchantment != null && enchantment.getAttachedTo() != null) {
      Permanent creature = game.getPermanent(enchantment.getAttachedTo());
      if (creature != null) {
        controller.moveCardsToExile(creature, source, game, true, null, "");
      }
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId());
    if (controller != null && enchantment != null && enchantment.getAttachedTo() != null) {
      Permanent creature = game.getPermanent(enchantment.getAttachedTo());
      if (creature != null) {
        controller.moveCardsToExile(creature, source, game, true, null, "");
      }
    }
    return false;
  }
}
origin: magefree/mage

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
  Player controller = game.getPlayer(source.getControllerId());
  MageObject sourceObject = source.getSourceObject(game);
  if (controller != null && sourceObject != null) {
    if (((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) {
      Permanent permanent = ((ZoneChangeEvent) event).getTarget();
      if (permanent != null) {
        UUID exileZoneId = CardUtil.getCardExileZoneId(game, source);
        if (controller.moveCardsToExile(permanent, source, game, false, exileZoneId, sourceObject.getIdName())) {
          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 (controller != null && sourceObject != null) {
      if (controller.searchLibrary(target, game)) {
        UUID exileZone = CardUtil.getCardExileZoneId(game, source);
        if (!target.getTargets().isEmpty()) {
          controller.moveCardsToExile(new CardsImpl(target.getTargets()).getCards(game), source, game, true, exileZone, sourceObject.getIdName());
        }
      }
      controller.shuffleLibrary(source, game);
      return true;

    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    MageObject sourceObject = source.getSourceObject(game);
    if (controller != null && sourceObject != null) {
      Card card = controller.getLibrary().getFromTop(game);
      if (card != null) {
        UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
        controller.moveCardsToExile(card, source, game, true, exileId, sourceObject.getIdName());
      }
      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 = controller.getLibrary().getFromTop(game);
      if (card != null) {
        controller.moveCardsToExile(card, source, game, true, source.getSourceId(),
            CardUtil.createObjectRealtedWindowTitle(source, game, "<this card may be played the turn it was exiled>"));
        game.addEffect(new OraclesVaultPlayEffect(new MageObjectReference(card, game)), source);
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player sourceController = game.getPlayer(source.getControllerId());
  UUID exileId = CardUtil.getCardExileZoneId(game, source);
  MageObject sourceObject = source.getSourceObject(game);
  Card card = game.getCard(this.getTargetPointer().getFirst(game, source));
  if (sourceController != null && exileId != null && sourceObject != null && card != null) {
    if (game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
      sourceController.moveCardsToExile(card, source, game, true, exileId, sourceObject.getIdName());
    }
    return true;
  }
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    MageObject sourceObject = source.getSourceObject(game);
    if (controller != null && sourceObject != null) {
      Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source));
      if (spell != null) {
        UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
        return controller.moveCardsToExile(spell, source, game, true, exileId, sourceObject.getIdName());
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    MageObject sourceObject = source.getSourceObject(game);
    if (controller != null && sourceObject != null) {
      Card card = controller.getLibrary().getFromTop(game);
      if (card != null) {
        UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
        card.setFaceDown(true, game);
        controller.moveCardsToExile(card, source, game, false, exileZoneId, sourceObject.getIdName());
        card.setFaceDown(true, 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 = controller.getLibrary().getFromTop(game);
      if (card != null) {
        controller.moveCardsToExile(card, source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, null));
        ContinuousEffect effect = new ElkinBottleCastFromExileEffect();
        effect.setTargetPointer(new FixedTarget(card.getId()));
        game.addEffect(effect, source);
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player opponent = game.getPlayer(this.getTargetPointer().getFirst(game, source));
    Player controller = game.getPlayer(source.getControllerId());
    MageObject sourceObject = source.getSourceObject(game);
    if (sourceObject != null && opponent != null && controller != null) {
      UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
      if (exileZone != null) {
        controller.moveCardsToExile(opponent.getLibrary().getTopCards(game, 3), source, game, true, exileZone, sourceObject.getIdName());
        return true;
      }
    }
    return false;
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null) {
    Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, amount.calculate(game, source, this)));
    if (!cards.isEmpty()) {
      controller.moveCardsToExile(cards.getCards(game), source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, ""));
      ContinuousEffect effect = new FlamesOfRemembranceMayPlayExiledEffect();
      effect.setTargetPointer(new FixedTargets(cards, game));
      game.addEffect(effect, source);
    }
    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 (controller == null || sourceObject == null) {
    return false;
  }
  for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
    Player player = game.getPlayer(playerId);
    if (player != null) {
      player.moveCardsToExile(player.getLibrary().getTopCards(game, 3), source, game, true,
          CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()),
          sourceObject.getIdName() + " (" + sourceObject.getZoneChangeCounter(game) + ')');
    }
  }
  return true;
}
mage.playersPlayermoveCardsToExile

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
  • requestLocationUpdates (LocationManager)
  • getExternalFilesDir (Context)
  • setRequestProperty (URLConnection)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Github Copilot alternatives
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