congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
EntersBattlefieldWithXCountersEffect.apply
Code IndexAdd Tabnine to your IDE (free)

How to use
apply
method
in
mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect

Best Java code snippets using mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect.apply (Showing top 3 results out of 315)

origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Permanent permanent = game.getPermanentEntering(source.getSourceId());
  if (permanent != null) {
    // except only takes place if something was copied
    if (permanent.isCopy()) {
      return super.apply(game, source);
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Permanent permanent = game.getPermanentEntering(source.getSourceId());
  if (controller != null && permanent != null) {
    int amount = controller.rollDice(game, 6);
    ArrayList<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects"); // the basic event is the EntersBattlefieldEvent, so use already applied replacement effects from that event
    permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game, appliedEffects);
    return super.apply(game, source);
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Permanent permanent = game.getPermanentEntering(source.getSourceId());
  if (controller != null && permanent != null) {
    int amount = controller.rollDice(game, 6);
    ArrayList<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects"); // the basic event is the EntersBattlefieldEvent, so use already applied replacement effects from that event
    permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game, appliedEffects);
    return super.apply(game, source);
  }
  return false;
}
mage.abilities.effects.commonEntersBattlefieldWithXCountersEffectapply

Popular methods of EntersBattlefieldWithXCountersEffect

  • <init>
  • getValue

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • getResourceAsStream (ClassLoader)
  • setScale (BigDecimal)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top plugins for Android Studio
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