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

How to use
LeavesBattlefieldAllTriggeredAbility
in
mage.abilities.common

Best Java code snippets using mage.abilities.common.LeavesBattlefieldAllTriggeredAbility (Showing top 6 results out of 315)

origin: magefree/mage

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
  if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
    UUID targetId = event.getTargetId();
    Permanent permanent = game.getPermanentOrLKIBattlefield(targetId);
    if (permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game)) {
      if (setTargetPointer != SetTargetPointer.NONE) {
        for (Effect effect : this.getEffects()) {
          switch (setTargetPointer) {
            case PERMANENT:
              effect.setTargetPointer(new FixedTarget(permanent.getId()));
              break;
            case PLAYER:
              effect.setTargetPointer(new FixedTarget(permanent.getControllerId()));
              break;
          }
        }
      }
      return true;
    }
  }
  return false;
}
origin: magefree/mage

  public AurraSingBaneOfJediEmblem() {
    this.setName("Emblem Aurra Sing, Bane of Jedi");
    getAbilities().add(new LeavesBattlefieldAllTriggeredAbility(Zone.COMMAND, new DiscardControllerEffect(1), filter, false));
  }
}
origin: magefree/mage

public DualNature(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{G}{G}");
  // Whenever a nontoken creature enters the battlefield, its controller creates a token that's a copy of that creature.
  this.addAbility(new EntersBattlefieldAllTriggeredAbility(
      Zone.BATTLEFIELD, new DualNatureCreateTokenEffect(), filter, false, SetTargetPointer.PERMANENT,
      "Whenever a nontoken creature enters the battlefield, its controller creates a token that's a copy of that creature."
  ));
  // Whenever a nontoken creature leaves the battlefield, exile all tokens with the same name as that creature.
  this.addAbility(new LeavesBattlefieldAllTriggeredAbility(
      Zone.BATTLEFIELD, new DualNatureCreatureLeavesEffect(), filter, false, SetTargetPointer.PERMANENT
  ));
  // When Dual Nature leaves the battlefield, exile all tokens created with Dual Nature.
  this.addAbility(new DualNatureLeavesBattlefieldTriggeredAbility());
}
origin: magefree/mage

public ExtractorDemon(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
  this.subtype.add(SubType.DEMON);
  this.power = new MageInt(5);
  this.toughness = new MageInt(5);
  // Flying
  this.addAbility(FlyingAbility.getInstance());
  // Whenever another creature leaves the battlefield, you may have target player put the top two cards of their library into their graveyard.
  Ability ability = new LeavesBattlefieldAllTriggeredAbility(new PutLibraryIntoGraveTargetEffect(2), filter, true);
  ability.addTarget(new TargetPlayer());
  this.addAbility(ability);
  // Unearth {2}{B}
  this.addAbility(new UnearthAbility(new ManaCostsImpl("{2}{B}")));
}
origin: magefree/mage

public TwilightDrover(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}");
  this.subtype.add(SubType.SPIRIT);
  this.power = new MageInt(1);
  this.toughness = new MageInt(1);
  // Whenever a creature token leaves the battlefield, put a +1/+1 counter on Twilight Drover.
  this.addAbility(new LeavesBattlefieldAllTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter));
  // {2}{W}, Remove a +1/+1 counter from Twilight Drover: Create two 1/1 white Spirit creature tokens with flying.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SpiritWhiteToken("RAV"), 2), new ManaCostsImpl<>("{2}{W}"));
  ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance()));
  this.addAbility(ability);
}
mage.abilities.commonLeavesBattlefieldAllTriggeredAbility

Most used methods

  • <init>
  • getControllerId
  • getEffects
  • getSourceId

Popular in Java

  • Creating JSON documents from java classes using gson
  • setRequestProperty (URLConnection)
  • runOnUiThread (Activity)
  • onRequestPermissionsResult (Fragment)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • 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