@Override public PutIntoGraveFromBattlefieldSourceTriggeredAbility copy() { return new PutIntoGraveFromBattlefieldSourceTriggeredAbility(this); }
@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; }
@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; }
public PutIntoGraveFromBattlefieldSourceTriggeredAbility(Effect effect, boolean optional, boolean onlyToControllerGraveyard) { super(Zone.ALL, effect, optional); setLeavesTheBattlefieldTrigger(true); this.onlyToControllerGraveyard = onlyToControllerGraveyard; }
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))); }
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)); }
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))); }
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))); }
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())); }
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())); }
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))); }
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); }
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)); }
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" )); }
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))); }
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))); }
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))); }
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))); }
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()))); }
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()))); }