Tabnine Logo
PhaseOutAllEffect.<init>
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using mage.abilities.effects.common.PhaseOutAllEffect.<init> (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<init>

Popular methods of PhaseOutAllEffect

  • apply

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • getSupportFragmentManager (FragmentActivity)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top 12 Jupyter Notebook extensions
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