Tabnine Logo
PhaseOutAllEffect
Code IndexAdd Tabnine to your IDE (free)

How to use
PhaseOutAllEffect
in
mage.abilities.effects.common

Best Java code snippets using mage.abilities.effects.common.PhaseOutAllEffect (Showing top 5 results out of 315)

origin: magefree/mage

@Override
public PhaseOutAllEffect copy() {
  return new PhaseOutAllEffect(this);
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      List<UUID> permIds = new ArrayList<>();
      for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CONTROLLED_PERMANENT, controller.getId(), game)) {
        permIds.add(permanent.getId());
      }
      return new PhaseOutAllEffect(permIds).apply(game, source);
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      List<UUID> permIds = new ArrayList<>();
      for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterControlledLandPermanent(), controller.getId(), game)) {
        permIds.add(permanent.getId());
      }
      return new PhaseOutAllEffect(permIds).apply(game, source);
    }
    return false;
  }
}
origin: magefree/mage

  private void phaseOutCardType(Player controller, Player targetPlayer, CardType cardType, Ability source, Game game) {
    FilterPermanent filter = new FilterControlledPermanent();
    filter.add(new CardTypePredicate(cardType));
    int numberController = game.getBattlefield().count(filter, source.getSourceId(), controller.getId(), game);
    int numberTargetPlayer = game.getBattlefield().count(filter, source.getSourceId(), targetPlayer.getId(), game);
    int excess = numberTargetPlayer - numberController;
    if (excess > 0) {
      FilterPermanent filterChoose = new FilterPermanent(cardType.toString().toLowerCase(Locale.ENGLISH) + (excess > 1 ? "s" : "") + " of target player");
      filterChoose.add(new ControllerIdPredicate(targetPlayer.getId()));
      filterChoose.add(new CardTypePredicate(cardType));
      Target target = new TargetPermanent(excess, excess, filterChoose, true);
      controller.chooseTarget(outcome, target, source, game);
      new PhaseOutAllEffect(target.getTargets()).apply(game, source);
    }
  }
}
origin: magefree/mage

  permIds.add(permanent.getId());
return new PhaseOutAllEffect(permIds).apply(game, source);
mage.abilities.effects.commonPhaseOutAllEffect

Javadoc

This class should only be used within the application of another effect

Most used methods

  • <init>
  • apply

Popular in Java

  • Updating database using SQL prepared statement
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setRequestProperty (URLConnection)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Top Sublime Text 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