@Override public boolean apply(Game game, Ability source) { return new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility( new SacrificeTargetEffect("sacrifice it", source.getControllerId()) )).apply(game, source); } }
public PrizedAmalgam(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{B}"); this.subtype.add(SubType.ZOMBIE); this.power = new MageInt(3); this.toughness = new MageInt(3); // Whenever a creature enters the battlefield, if it entered from your graveyard or you cast it from your graveyard, return Prized Amalgam from your graveyard to the battlefield tapped at the beginning of the next end step. Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect(true); effect.setText("return {this} from your graveyard to the battlefield tapped at the beginning of the next end step"); this.addAbility(new PrizedAmalgamTriggerdAbility(new CreateDelayedTriggeredAbilityEffect( new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect)), filter), new CastFromGraveyardWatcher()); }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new OpponentGainControlEffect()), source); return true; } return false; }
public IdeasUnbound(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{U}{U}"); this.subtype.add(SubType.ARCANE); // Draw three cards. Discard three cards at the beginning of the next end step. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3)); this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new DiscardControllerEffect(3)))); }
public ChimericCoils(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}"); // {X}{1}: Chimeric Coils becomes an X/X Construct artifact creature. Sacrifice it at the beginning of thhe next end step. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChimericCoilsEffect(), new ManaCostsImpl("{X}{1}")); ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeSourceEffect()))); this.addAbility(ability); }
public void exileTokensCreatedAtNextEndStep(Game game, Ability source) { for (UUID tokenId : this.getLastAddedTokenIds()) { Permanent tokenPermanent = game.getPermanent(tokenId); if (tokenPermanent != null) { ExileTargetEffect exileEffect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD); exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source); } } }
public Rakalite(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{6}"); // {2}: Prevent the next 1 damage that would be dealt to any target this turn. Return Rakalite to its owner's hand at the beginning of the next end step. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1, false), new GenericManaCost(2)); ability.addTarget(new TargetAnyTarget()); ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnToHandSourceEffect(true)))); this.addAbility(ability); }
@Override public boolean apply(Game game, Ability source) { Permanent targetCreature = game.getPermanent(source.getFirstTarget()); if (targetCreature != null) { SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId()); sacrificeEffect.setTargetPointer(new FixedTarget(targetCreature, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); game.addDelayedTriggeredAbility(delayedAbility, source); } return true; } }
@Override public boolean apply(Game game, Ability source) { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (sourcePermanent != null) { SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice {this}"); sacrificeEffect.setTargetPointer(new FixedTarget(sourcePermanent.getId())); game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect), source); } return false; } }
@Override public boolean apply(Game game, Ability source) { // Create delayed triggered ability Effect effect = new ReturnToHandTargetEffect(); effect.setText("return {this} to its owner's hand"); effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getSourceObjectZoneChangeCounter())); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect); game.addDelayedTriggeredAbility(delayedAbility, source); return true; }
@Override public boolean apply(Game game, Ability source) { // Create delayed triggered ability Effect effect = new ReturnToHandTargetEffect(); effect.setText("return {this} to its owner's hand"); effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getSourceObjectZoneChangeCounter())); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect); game.addDelayedTriggeredAbility(delayedAbility, source); return true; }
@Override public boolean apply(Game game, Ability source) { Permanent targetCreature = game.getPermanent(source.getFirstTarget()); if (targetCreature != null) { SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId()); sacrificeEffect.setTargetPointer(new FixedTarget(targetCreature, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); game.addDelayedTriggeredAbility(delayedAbility, source); } return true; } }
@Override public boolean apply(Game game, Ability source) { // Create delayed triggered ability Effect effect = new ReturnToHandTargetEffect(); effect.setText("return {this} to its owner's hand"); effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getSourceObjectZoneChangeCounter())); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect); game.addDelayedTriggeredAbility(delayedAbility, source); return true; }
public PyricSalamander(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); this.subtype.add(SubType.SALAMANDER); this.power = new MageInt(1); this.toughness = new MageInt(1); // {R}: Pyric Salamander gets +1/+0 until end of turn. Sacrifice Pyric Salamander at the beginning of the next end step. Ability ability = new SimpleActivatedAbility(new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")); ability.addEffect(new CreateDelayedTriggeredAbilityEffect( new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeSourceEffect()) ).setText("Sacrifice {this} at the beginning of the next end step")); this.addAbility(ability); }
public SirensCall(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}"); // Cast Siren's Call only during an opponent's turn, before attackers are declared. this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(null, null, new CompoundCondition(OnOpponentsTurnCondition.instance, BeforeAttackersAreDeclaredCondition.instance), "Cast this spell only during an opponent's turn, before attackers are declared")); // Creatures the active player controls attack this turn if able. this.getSpellAbility().addEffect(new SirensCallMustAttackEffect()); // At the beginning of the next end step, destroy all non-Wall creatures that player controls that didn't attack this turn. Ignore this effect for each creature the player didn't control continuously since the beginning of the turn. this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SirensCallDestroyEffect()))); this.getSpellAbility().addWatcher(new AttackedThisTurnWatcher()); }
@Override public boolean apply(Game game, Ability source) { ActivationInfo activationInfo = ActivationInfo.getInstance(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); activationInfo.addActivation(game); if (activationInfo.getActivationCounter() >= 4) { DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeSourceEffect()); game.addDelayedTriggeredAbility(delayedAbility, source); } return true; }
@Override public boolean apply(Game game, Ability source) { ActivationInfo activationInfo = ActivationInfo.getInstance(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); activationInfo.addActivation(game); if (activationInfo.getActivationCounter() == 4) { DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeSourceEffect()); game.addDelayedTriggeredAbility(delayedAbility, source); } return true; }
@Override public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (creature != null) { SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice boosted " + creature.getName(), source.getControllerId()); sacrificeEffect.setTargetPointer(new FixedTarget(creature, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); game.addDelayedTriggeredAbility(delayedAbility, source); } return true; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Effect effect = new SacrificeTargetEffect("Sacrifice those creatures at the beginning of the next end step", source.getControllerId()); effect.setTargetPointer(new FixedTargets(game.getBattlefield().getAllActivePermanents(new FilterAttackingCreature(), controller.getId(), game), game)); game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect), source); return true; } return false; }
public EndlessWhispers(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); // Each creature has "When this creature dies, choose target opponent. That player puts this card from its owner's graveyard onto the battlefield under their control at the beginning of the next end step." DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnSourceToBattlefieldEffect()); Effect effect = new CreateDelayedTriggeredAbilityEffect(delayedAbility, true); effect.setText("choose target opponent. That player puts this card from its owner's graveyard onto the battlefield under their control at the beginning of the next end step"); Ability gainAbility = new DiesTriggeredAbility(effect); gainAbility.addTarget(new TargetOpponent()); effect = new GainAbilityAllEffect(gainAbility, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Each creature")); effect.setText("Each creature has \"When this creature dies, choose target opponent. That player puts this card from its owner's graveyard onto the battlefield under their control at the beginning of the next end step.\""); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); }