congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
PutCardIntoGraveFromAnywhereAllTriggeredAbility
Code IndexAdd Tabnine to your IDE (free)

How to use
PutCardIntoGraveFromAnywhereAllTriggeredAbility
in
mage.abilities.common

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

origin: magefree/mage

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) {
    Card card = game.getCard(event.getTargetId());
    if (card != null
        && !card.isCopy()
        && filter.match(card, getSourceId(), getControllerId(), game)) {
      switch (setTargetPointer) {
        case CARD:
          for (Effect effect : getEffects()) {
            effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
          }
          break;
        case PLAYER:
          for (Effect effect : getEffects()) {
            effect.setTargetPointer(new FixedTarget(card.getOwnerId(), 0));
          }
          break;
      }
      return true;
    }
  }
  return false;
}
origin: magefree/mage

public Compost(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}");
  // Whenever a black card is put into an opponent's graveyard from anywhere, you may draw a card.
  this.addAbility(new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
      new DrawCardSourceControllerEffect(1), true, filter, TargetController.OPPONENT));
}
origin: magefree/mage

public EnergyField(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}");
  // Prevent all damage that would be dealt to you by sources you don't control.
  this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new EnergyFieldEffect()));
  // When a card is put into your graveyard from anywhere, sacrifice Energy Field.
  this.addAbility(new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
      new SacrificeSourceEffect(), false, TargetController.YOU));
}
origin: magefree/mage

public VulturousZombie(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{G}");
  this.subtype.add(SubType.PLANT);
  this.subtype.add(SubType.ZOMBIE);
  this.power = new MageInt(3);
  this.toughness = new MageInt(3);
  // Flying
  this.addAbility(FlyingAbility.getInstance());
  // Whenever a card is put into an opponent's graveyard from anywhere, put a +1/+1 counter on Vulturous Zombie.
  this.addAbility(new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
      new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, TargetController.OPPONENT));
}
origin: magefree/mage

public Nihilith(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}{B}");
  this.subtype.add(SubType.HORROR);
  this.power = new MageInt(4);
  this.toughness = new MageInt(4);
  // Fear
  this.addAbility(FearAbility.getInstance());
  
  // Suspend 7-{1}{B}
  this.addAbility(new SuspendAbility(7, new ManaCostsImpl("{1}{B}"), this, false));
  
  // Whenever a card is put into an opponent's graveyard from anywhere, if Nihilith is suspended, you may remove a time counter from Nihilith.
  this.addAbility(new ConditionalInterveningIfTriggeredAbility(
      new PutCardIntoGraveFromAnywhereAllTriggeredAbility(Zone.EXILED, new RemoveCounterSourceEffect(CounterType.TIME.createInstance()), true, 
          new FilterCard(), TargetController.OPPONENT, SetTargetPointer.NONE),
      SuspendedCondition.instance,
      "Whenever a card is put into an opponent's graveyard from anywhere, if {this} is suspended, you may remove a time counter from {this}."
      ));        
  
}
origin: magefree/mage

  public TheDarkBaronyPlane() {
    this.setName("Plane - The Dark Barony");
    this.setExpansionSetCodeForImage("PCA");

    // Whenever a nonblack card is put into a player's graveyard from anywhere, that player loses 1 life
    Ability ability = new PutCardIntoGraveFromAnywhereAllTriggeredAbility(Zone.COMMAND,
        new LoseLifeTargetEffect(1), false, filter, TargetController.ANY, SetTargetPointer.PLAYER);
    this.getAbilities().add(ability);

    // Active player can roll the planar die: Whenever you roll {CHAOS}, each player dicards a card
    Effect chaosEffect = new DiscardEachPlayerEffect(TargetController.OPPONENT);
    Target chaosTarget = null;

    List<Effect> chaosEffects = new ArrayList<Effect>();
    chaosEffects.add(chaosEffect);
    List<Target> chaosTargets = new ArrayList<Target>();
    chaosTargets.add(chaosTarget);

    ActivateIfConditionActivatedAbility chaosAbility = new ActivateIfConditionActivatedAbility(Zone.COMMAND, new RollPlanarDieEffect(chaosEffects, chaosTargets), new GenericManaCost(0), MainPhaseStackEmptyCondition.instance);
    chaosAbility.addWatcher(new PlanarRollWatcher());
    this.getAbilities().add(chaosAbility);
    chaosAbility.setMayActivate(TargetController.ANY);
    this.getAbilities().add(new SimpleStaticAbility(Zone.ALL, new PlanarDieRollCostIncreasingEffect(chaosAbility.getOriginalId())));
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Permanent permanent, Ability source, UUID copyToObjectId) {
  Ability ability = new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
      new LazavDimirMastermindEffect(), true,
      new FilterCreatureCard("a creature card"),
      TargetController.OPPONENT, SetTargetPointer.CARD);
  permanent.getAbilities().add(ability);
  permanent.setName("Lazav, Dimir Mastermind");
  permanent.addSuperType(SuperType.LEGENDARY);
  permanent.getAbilities().add(HexproofAbility.getInstance());
  return true;
}
origin: magefree/mage

public BloodchiefAscension(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}");
  // At the beginning of each end step, if an opponent lost 2 or more life this turn, you may put a quest counter on Bloodchief Ascension. (Damage causes loss of life.)
  this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD,
      new AddCountersSourceEffect(CounterType.QUEST.createInstance(1), false),
      TargetController.ANY,
      new OpponentLostLifeCondition(ComparisonType.MORE_THAN, 1),
      true));
  // Whenever a card is put into an opponent's graveyard from anywhere, if Bloodchief Ascension has three or more quest counters on it, you may have that player lose 2 life. If you do, you gain 2 life.
  Ability ability = new ConditionalInterveningIfTriggeredAbility(
      new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
          new LoseLifeTargetEffect(2), true, new FilterCard("a card"), TargetController.OPPONENT, SetTargetPointer.PLAYER),
      new SourceHasCounterCondition(CounterType.QUEST, 3, Integer.MAX_VALUE),
      "Whenever a card is put into an opponent's graveyard from anywhere, if {this} has three or more quest counters on it, you may have that player lose 2 life. If you do, you gain 2 life");
  ability.addEffect(new GainLifeEffect(2));
  this.addAbility(ability);
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, MageObject mageObject, Ability source, UUID copyToObjectId) {
    Ability ability = new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
        new LazavDimirMastermindEffect(), true,
        new FilterCreatureCard("a creature card"),
        TargetController.OPPONENT, SetTargetPointer.CARD);
    mageObject.getAbilities().add(ability);
    mageObject.setName("Lazav, Dimir Mastermind");
    mageObject.addSuperType(SuperType.LEGENDARY);
    mageObject.getAbilities().add(HexproofAbility.getInstance());
    return true;
  }
}
origin: magefree/mage

public LazavDimirMastermind(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{U}{B}{B}");
  this.addSuperType(SuperType.LEGENDARY);
  this.subtype.add(SubType.SHAPESHIFTER);
  this.power = new MageInt(3);
  this.toughness = new MageInt(3);
  // Hexproof
  this.addAbility(HexproofAbility.getInstance());
  // Whenever a creature card is put into an opponent's graveyard from anywhere, you may have Lazav, Dimir Mastermind become a copy of that card except its name is Lazav, Dimir Mastermind, it's legendary in addition to its other types, and it has hexproof and this ability.
  this.addAbility(new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
      new LazavDimirMastermindEffect(), true,
      new FilterCreatureCard("a creature card"),
      TargetController.OPPONENT, SetTargetPointer.CARD));
}
origin: magefree/mage

  /**
   * Emblem with "You have no maximum hand size" and "Whenever a card is put
   * into your graveyard from anywhere, you may return it to your hand."
   */

  public TamiyoTheMoonSageEmblem() {
    this.setName("Emblem Tamiyo");
    Ability ability = new SimpleStaticAbility(Zone.COMMAND, new MaximumHandSizeControllerEffect(Integer.MAX_VALUE, Duration.EndOfGame, HandSizeModification.SET));
    this.getAbilities().add(ability);
    Effect effect = new ReturnToHandTargetEffect();
    effect.setText("return it to your hand");
    this.getAbilities().add(new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
        Zone.COMMAND, effect, true, new FilterCard("a card"), TargetController.YOU, SetTargetPointer.CARD));
  }
}
origin: magefree/mage

public MeasureOfWickedness(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{B}");
  // At the beginning of your end step, sacrifice Measure of Wickedness and you lose 8 life.        
  Ability ability = new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceEffect(), TargetController.YOU, null, false);
  Effect effect = new LoseLifeSourceControllerEffect(8);
  effect.setText("and you lose 8 life");
  ability.addEffect(effect);
  this.addAbility(ability);
  // Whenever another card is put into your graveyard from anywhere, target opponent gains control of Measure of Wickedness.
  ability = new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
      new MeasureOfWickednessControlSourceEffect(), false, filter, TargetController.YOU);
  ability.addTarget(new TargetOpponent());
  this.addAbility(ability);
}
origin: magefree/mage

public CountrysideCrusher(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
  this.subtype.add(SubType.GIANT);
  this.subtype.add(SubType.WARRIOR);
  this.power = new MageInt(3);
  this.toughness = new MageInt(3);
  // At the beginning of your upkeep, reveal the top card of your library. If it's a land card, put it into your graveyard and repeat this process.
  this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CountrysideCrusherEffect(), TargetController.YOU, false));
  // Whenever a land card is put into your graveyard from anywhere, put a +1/+1 counter on Countryside Crusher.
  this.addAbility(new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
      new AddCountersSourceEffect(CounterType.P1P1.createInstance()),
      false, new FilterLandCard("a land card"), TargetController.YOU
  ));
}
origin: magefree/mage

public QuestForAncientSecrets(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{U}");
  // Whenever a card is put into your graveyard from anywhere, you may put a quest counter on Quest for Ancient Secrets.
  this.addAbility(new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
      new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true, TargetController.YOU));
  // Remove five quest counters from Quest for Ancient Secrets and sacrifice it: Target player shuffles their graveyard into their library.
  Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
      new QuestForAncientSecretsEffect(),
      new RemoveCountersSourceCost(CounterType.QUEST.createInstance(5)));
  ability.addCost(new SacrificeSourceCost());
  ability.addTarget(new TargetPlayer());
  this.addAbility(ability);
}
origin: magefree/mage

public TheHauntOfHightower(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
  this.addSuperType(SuperType.LEGENDARY);
  this.subtype.add(SubType.VAMPIRE);
  this.power = new MageInt(3);
  this.toughness = new MageInt(3);
  // Flying
  this.addAbility(FlyingAbility.getInstance());
  // Lifelink
  this.addAbility(LifelinkAbility.getInstance());
  // Whenever The Haunt of Hightower attacks, defending player discards a card.
  this.addAbility(new AttacksTriggeredAbility(
      new DiscardTargetEffect(1), false,
      "Whenever {this} attacks, defending player discards a card", SetTargetPointer.PLAYER
  ));
  // Whenever a card is put into an opponent's graveyard from anywhere, put a +1/+1 counter on The Haunt of Hightower.
  this.addAbility(new PutCardIntoGraveFromAnywhereAllTriggeredAbility(
      new AddCountersSourceEffect(CounterType.P1P1.createInstance()),
      false, TargetController.OPPONENT
  ));
}
origin: magefree/mage

public CentaurVinecrasher(UUID ownerId, CardSetInfo setInfo) {
  super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}");
  this.subtype.add(SubType.PLANT);
  this.subtype.add(SubType.CENTAUR);
  this.power = new MageInt(1);
  this.toughness = new MageInt(1);
  // Trample
  this.addAbility(TrampleAbility.getInstance());
  // Centaur Vinecrasher enters the battlefield with a number of +1/+1 counters on it equal to the number of land cards in all graveyards.
  Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new CardsInAllGraveyardsCount(new FilterLandCard()), true);
  effect.setText("with a number of +1/+1 counters on it equal to the number of land cards in all graveyards");
  this.addAbility(new EntersBattlefieldAbility(effect));
  // Whenever a land card is put into a graveyard from anywhere, you may pay {G}{G}. If you do, return Centaur Vinecrasher from your graveyard to your hand.
  this.addAbility(new PutCardIntoGraveFromAnywhereAllTriggeredAbility(Zone.GRAVEYARD,
      new DoIfCostPaid(new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl<>("{G}{G}")),
      false, new FilterLandCard("a land card"), TargetController.ANY, SetTargetPointer.NONE
  ));
}
mage.abilities.commonPutCardIntoGraveFromAnywhereAllTriggeredAbility

Most used methods

  • <init>
  • getControllerId
  • getEffects
  • getSourceId

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSystemService (Context)
  • putExtra (Intent)
  • onCreateOptionsMenu (Activity)
  • String (java.lang)
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • PhpStorm for WordPress
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