@Override public AtTheBeginOfNextCleanupDelayedTriggeredAbility copy() { return new AtTheBeginOfNextCleanupDelayedTriggeredAbility(this); }
public SacrificeIfCastAtInstantTimeTriggeredAbility() { super(Zone.STACK, new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextCleanupDelayedTriggeredAbility(new SacrificeSourceEffect()))); }
@Override public boolean apply(Game game, Ability source) { Permanent cunning = game.getPermanent(source.getSourceId()); if (cunning != null) { DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextCleanupDelayedTriggeredAbility( new SacrificeSourceEffect()); game.addDelayedTriggeredAbility(delayedAbility, source); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Token token = new WaylayToken(); token.putOntoBattlefield(3, game, source.getSourceId(), source.getControllerId()); List<Permanent> toExile = new ArrayList<>(); for (UUID tokenId : token.getLastAddedTokenIds()) { Permanent tokenPermanent = game.getPermanent(tokenId); if (tokenPermanent != null) { toExile.add(tokenPermanent); } } Effect effect = new ExileTargetEffect(); effect.setTargetPointer(new FixedTargets(toExile, game)); game.addDelayedTriggeredAbility(new AtTheBeginOfNextCleanupDelayedTriggeredAbility(effect), source); return true; } }
public ThawingGlaciers(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.LAND},""); // Thawing Glaciers enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); // {1}, {tap}: Search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library. Return Thawing Glaciers to its owner's hand at the beginning of the next cleanup step. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true, Outcome.PutLandInPlay), new GenericManaCost(1)); ability.addCost(new TapSourceCost()); ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextCleanupDelayedTriggeredAbility(new ReturnToHandSourceEffect(true)))); this.addAbility(ability); }
@Override public boolean apply(Game game, Ability source) { if (!source.getTargets().isEmpty()) { Target multiTarget = source.getTargets().get(0); for (UUID target : multiTarget.getTargets()) { Permanent permanent = game.getPermanent(target); if (permanent != null) { permanent.addCounters(counterType.createInstance(multiTarget.getTargetAmount(target)), source, game); } } if (removeAtEndOfTurn) { DelayedTriggeredAbility ability = new AtTheBeginOfNextCleanupDelayedTriggeredAbility( new RemoveCountersAtEndOfTurn(counterType)); ability.getTargets().addAll(source.getTargets()); game.addDelayedTriggeredAbility(ability, source); } return true; } return false; }