congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
PutIntoGraveFromBattlefieldSourceTriggeredAbility
Code IndexAdd Tabnine to your IDE (free)

How to use
PutIntoGraveFromBattlefieldSourceTriggeredAbility
in
mage.abilities.common

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

origin: magefree/mage

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  if (super.checkTrigger(event, game)) {
    Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
    if (!permanent.getCounters(game).containsKey(CounterType.TIME) || permanent.getCounters(game).getCount(CounterType.TIME) == 0) {
      return true;
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  if (event.getTargetId().equals(getSourceId())) {
    ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
    Permanent permanent = zEvent.getTarget();
    if (permanent != null
        && zEvent.getToZone() == Zone.GRAVEYARD
        && zEvent.getFromZone() == Zone.BATTLEFIELD) {
      return !onlyToControllerGraveyard || this.isControlledBy(game.getOwnerId(zEvent.getTargetId()));
    }
  }
  return false;
}
origin: magefree/mage

public PutIntoGraveFromBattlefieldSourceTriggeredAbility(Effect effect, boolean optional, boolean onlyToControllerGraveyard) {
  super(Zone.ALL, effect, optional);
  setLeavesTheBattlefieldTrigger(true);
  this.onlyToControllerGraveyard = onlyToControllerGraveyard;
}
origin: magefree/mage

public HatchingPlans(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}");
  // When Hatching Plans is put into a graveyard from the battlefield, draw three cards.
  this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DrawCardSourceControllerEffect(3)));
}
origin: magefree/mage

public BroodOfCockroaches(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
  this.subtype.add(SubType.INSECT);
  this.power = new MageInt(1);
  this.toughness = new MageInt(1);
  // When Brood of Cockroaches is put into your graveyard from the battlefield,
  // at the beginning of the next end step,
  // you lose 1 life
  // and return Brood of Cockroaches to your hand.
  this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new BroodOfCockroachesEffect(), false, true));
}
origin: magefree/mage

public IchorWellspring(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
  // When Ichor Wellspring enters the battlefield or is put into a graveyard from the battlefield, draw a card.
  this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)));
  this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DrawCardSourceControllerEffect(1)));
}
origin: magefree/mage

public DunesOfTheDead(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
  this.subtype.add(SubType.DESERT);
  // {T}: Add {C}.
  addAbility(new ColorlessManaAbility());
  // When Dunes of the Dead is put into a graveyard from the battlefield, create a 2/2 black Zombie creature token.
  this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new CreateTokenEffect(new ZombieToken(), 1)));
}
origin: magefree/mage

public SpineOfIshSah(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{7}");
  // When Spine of Ish Sah enters the battlefield, destroy target permanent.        
  EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect());
  ability.addTarget(new TargetPermanent());
  this.addAbility(ability);
  
  // When Spine of Ish Sah is put into a graveyard from the battlefield, return Spine of Ish Sah to its owner's hand
  this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new ReturnToHandSourceEffect()));
}
origin: magefree/mage

public InducedAmnesia(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
  // When Induced Amnesia enters the battlefield, target player exiles all the cards in their hand face down, then draws that many cards.
  Ability ability = new EntersBattlefieldTriggeredAbility(new InducedAmnesiaExileEffect(), false);
  ability.addTarget(new TargetPlayer());
  this.addAbility(ability);
  // When Induced Amnesia is put into a graveyard from the battlefield, return the exiled cards to their owner's hand.
  this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new InducedAmnesiaReturnEffect()));
}
origin: magefree/mage

public GodsEyeGateToTheReikai(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
  addSuperType(SuperType.LEGENDARY);
  // {tap}: Add {C}.
  this.addAbility(new ColorlessManaAbility());
  // When Gods' Eye, Gate to the Reikai is put into a graveyard from the battlefield, create a 1/1 colorless Spirit creature token.
  this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new CreateTokenEffect(new SpiritToken(), 1)));
}
origin: magefree/mage

public GoblinBoomKeg(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
  // At the beginning of your upkeep, sacrifice Goblin Boom Keg.
  this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceEffect(), TargetController.YOU, false));
  // When Goblin Boom Keg is put into a graveyard from the battlefield, it deals 3 damage to any target.
  Ability ability = new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DamageTargetEffect(3, "it"));
  ability.addTarget(new TargetAnyTarget());
  this.addAbility(ability);
}
origin: magefree/mage

public FlagstonesOfTrokair(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
  addSuperType(SuperType.LEGENDARY);
  // {tap}: Add {W}.
  this.addAbility(new WhiteManaAbility());
  // When Flagstones of Trokair is put into a graveyard from the battlefield, you may search your library for a Plains card and put it onto the battlefield tapped. If you do, shuffle your library.
  this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(FILTER), true, false), true, false));
}
origin: magefree/mage

public WeatherseedTotem(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
  // {tap}: Add {G}.
  this.addAbility(new GreenManaAbility());
  // {2}{G}{G}{G}: Weatherseed Totem becomes a 5/3 green Treefolk artifact creature with trample until end of turn.
  this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new WeatherseedTotemToken(), "", Duration.EndOfTurn), new ManaCostsImpl<>("{2}{G}{G}{G}")));
  // When Weatherseed Totem is put into a graveyard from the battlefield, if it was a creature, return this card to its owner's hand.
  this.addAbility(new ConditionalInterveningIfTriggeredAbility(
      new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new ReturnToHandSourceEffect()),
      new WeatherseedTotemCondition(),
      "When {this} is put into a graveyard from the battlefield, "
      + "if it was a creature, return this card to its owner's hand"
  ));
}
origin: magefree/mage

public ChromaticStar(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}");
  
  // {1}, {T}, Sacrifice Chromatic Star: Add one mana of any color.        
  Ability ability = new AnyColorManaAbility(new GenericManaCost(1));
  ability.addCost(new TapSourceCost());
  ability.addCost(new SacrificeSourceCost());
  this.addAbility(ability);
  
  // When Chromatic Star is put into a graveyard from the battlefield, draw a card.
  this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DrawCardSourceControllerEffect(1)));
}
origin: magefree/mage

public ImplementOfExamination(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
  // {U}, Sacrifice Implement of Examination: Draw a card.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{U}"));
  ability.addCost(new SacrificeSourceCost());
  this.addAbility(ability);
  // When Implement of Examination is put into a graveard from the battleifeld, draw a card.
  this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DrawCardSourceControllerEffect(1)));
}
origin: magefree/mage

public ImplementOfImprovement(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
  // {W}, Sacrifice Implement of Improvement: You gain 2 life.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(2), new ManaCostsImpl("{W}"));
  ability.addCost(new SacrificeSourceCost());
  this.addAbility(ability);
  // When Implement of Improvement is put into a graveyard from the battlefield, draw a card.
  this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DrawCardSourceControllerEffect(1)));
}
origin: magefree/mage

public ImplementOfCombustion(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
  // {R}, Sacrifice Implement of Combustion: It deals 1 damage to target player.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1, "It"), new ManaCostsImpl("{R}"));
  ability.addCost(new SacrificeSourceCost());
  ability.addTarget(new TargetPlayerOrPlaneswalker());
  this.addAbility(ability);
  // When Implement of Combustion is put into a graveyard from the battlefield, draw a card.
  this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DrawCardSourceControllerEffect(1)));
}
origin: magefree/mage

public Ringskipper(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
  this.subtype.add(SubType.FAERIE);
  this.subtype.add(SubType.WIZARD);
  this.power = new MageInt(1);
  this.toughness = new MageInt(1);
  // Flying
  this.addAbility(FlyingAbility.getInstance());
  // When {this} is put into graveyard from play, clash with an opponent. If you win return {this} to its owner's hand
  this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DoIfClashWonEffect(new ReturnToHandSourceEffect())));
}
origin: magefree/mage

public ServoSchematic(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
  // When Servo Schematic enters the battlefield or is put into a graveyard from the battlefield, create a 1/1 colorless Servo artifact creature token.
  this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ServoToken())));
  this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new CreateTokenEffect(new ServoToken())));
}
mage.abilities.commonPutIntoGraveFromBattlefieldSourceTriggeredAbility

Most used methods

  • <init>
  • checkTrigger
  • getSourceId
  • isControlledBy
  • setLeavesTheBattlefieldTrigger

Popular in Java

  • Reactive rest calls using spring rest template
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • addToBackStack (FragmentTransaction)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now