@Override public AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility copy() { return new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(this); }
@Override public boolean apply(Game game, Ability source) { //create delayed triggered ability Effect effect = new ReturnSourceFromGraveyardToBattlefieldEffect(true, true); effect.setText(staticText); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(effect); game.addDelayedTriggeredAbility(delayedAbility, source); return true; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { int xValue = source.getManaCostsToPay().getX(); FilterCreatureCard filter = new FilterCreatureCard(); filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xValue + 1)); Set<Card> cards = player.getGraveyard().getCards(filter, game); player.moveCards(cards, Zone.BATTLEFIELD, source, game); List<Permanent> toExile = new ArrayList<>(cards.size()); for (Card card : cards) { if (card != null) { Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { toExile.add(permanent); } } } Effect exileEffect = new ExileTargetEffect("Exile those creatures at the beginning of your next upkeep"); exileEffect.setTargetPointer(new FixedTargets(toExile, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(exileEffect); game.addDelayedTriggeredAbility(delayedAbility, source); return true; } return false; } }
public GiantSlug(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); this.subtype.add(SubType.SLUG); this.power = new MageInt(1); this.toughness = new MageInt(1); // {5}: At the beginning of your next upkeep, choose a basic land type. Giant Slug gains landwalk of the chosen type until the end of that turn. AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility ability = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(new GiantSlugEffect()); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateDelayedTriggeredAbilityEffect(ability), new ManaCostsImpl("{5}"))); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Permanent tomb = game.getPermanentOrLKIBattlefield(source.getSourceId()); // we need to set the correct source object DelayedTriggeredAbility ability = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(new CyclopeanTombEffect(), Duration.EndOfGame, false); ability.setControllerId(source.getControllerId()); ability.setSourceId(source.getSourceId()); game.addDelayedTriggeredAbility(ability); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Effect effect = new CreateTokenEffect(new HazezonTamarSandWarriorToken(), new PermanentsOnBattlefieldCount(new FilterControlledLandPermanent())); effect.setText("create X 1/1 Sand Warrior creature tokens that are red, green, and white, where X is the number of lands you control at that time"); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(effect); game.addDelayedTriggeredAbility(delayedAbility, source); return true; } return false; } }
effect.setTargetPointer(new FixedTarget(targetCreature.getId(), zcc + 1)); AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(effect); game.addDelayedTriggeredAbility(delayedAbility, source); effect.setTargetPointer(new FixedTarget(sourcePermanent.getId(), zcc + 1)); AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(effect); game.addDelayedTriggeredAbility(delayedAbility, source);
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), 0); Set<Card> topThreeCards = controller.getLibrary().getTopCards(game, 3); for (Card card : topThreeCards) { if (controller.moveCardsToExile(card, source, game, true, exileId, "Three Wishes")) { card.setFaceDown(true, game); ContinuousEffect effect = new ThreeWishesPlayFromExileEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); } } DelayedTriggeredAbility delayed = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(new ThreeWishesPutIntoGraveyardEffect()); game.addDelayedTriggeredAbility(delayed, source); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { StackObject stackObject = game.getStack().getStackObject(source.getId()); Spell spell = (Spell) stackObject; if (spell == null) { return false; } spell = spell.copySpell(source.getControllerId()); // Remove Epic effect from the spell Effect epicEffect = null; for (Effect effect : spell.getSpellAbility().getEffects()) { if (effect instanceof EpicEffect) { epicEffect = effect; break; } } spell.getSpellAbility().getEffects().remove(epicEffect); DelayedTriggeredAbility ability = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(new EpicPushEffect(spell, rule), Duration.EndOfGame, false); game.addDelayedTriggeredAbility(ability, source); game.addEffect(new EpicReplacementEffect(), source); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getFirstTarget()); Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && permanent != null && sourceObject != null) { if (controller.moveCardsToExile(permanent, source, game, true, source.getSourceId(), sourceObject.getIdName())) { controller.drawCards(permanent.getPower().getValue(), game); ExileZone exile = game.getExile().getExileZone(source.getSourceId()); // only if permanent is in exile (tokens would be stop to exist) if (exile != null && !exile.isEmpty()) { //create delayed triggered ability Effect effect = new VanishIntoMemoryReturnFromExileEffect(); effect.setTargetPointer(new FixedTargets(exile, game)); game.addDelayedTriggeredAbility(new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(effect), source); } return true; } } return false; }