@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 SacrificeTargetEffect copy() { return new SacrificeTargetEffect(this); }
public LingeringDeathAbility() { super(Zone.BATTLEFIELD, new SacrificeTargetEffect()); }
@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) { return new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility( new SacrificeTargetEffect("sacrifice it", source.getControllerId()) )).apply(game, source); } }
@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; } }
public AshlingTheExtinguisherTriggeredAbility() { super(Zone.BATTLEFIELD, new SacrificeTargetEffect()); this.addTarget(new TargetCreaturePermanent()); }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getFirstTarget()); if (permanent != null) { SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId()); sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); game.addDelayedTriggeredAbility(delayedAbility, source); return true; } return false; } }
public CelestialSword(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{6}"); // {3}, {tap}: Target creature you control gets +3/+3 until end of turn. Its controller sacrifices it at the beginning of the next end step. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(3, 3, Duration.EndOfTurn), new GenericManaCost(3)); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetControlledCreaturePermanent()); ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeTargetEffect()))); this.addAbility(ability); }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getFirstTarget()); if (permanent != null) { SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId()); sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); game.addDelayedTriggeredAbility(delayedAbility, source); return true; } return false; } }
public GraftedWargear(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); this.subtype.add(SubType.EQUIPMENT); // Equipped creature gets +3/+2. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 2))); // Whenever Grafted Wargear becomes unattached from a permanent, sacrifice that permanent. this.addAbility(new UnattachedTriggeredAbility(new SacrificeTargetEffect(), false)); // Equip {0} this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(0))); }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null) { SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId()); sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game)); DelayedTriggeredAbility delayedAbility = new AngrathTheFlameChainedDelayedTriggeredAbility(sacrificeEffect); game.addDelayedTriggeredAbility(delayedAbility, source); return true; } return false; } }
public MercyKilling(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G/W}"); // Target creature's controller sacrifices it, then creates X 1/1 green and white Elf Warrior creature tokens, where X is that creature's power. this.getSpellAbility().addEffect(new SacrificeTargetEffect("Target creature's controller sacrifices it")); this.getSpellAbility().addEffect(new MercyKillingTokenEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); }
@Override public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanent(source.getFirstTarget()); 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; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Cards cards = new CardsImpl(getTargetPointer().getTargets(game, source)); controller.moveCards(cards, Zone.BATTLEFIELD, source, game); List<Permanent> toSacrifice = new ArrayList<>(cards.size()); for (UUID targetId : cards) { Permanent creature = game.getPermanent(targetId); if (creature != null) { toSacrifice.add(creature); } } Effect effect = new SacrificeTargetEffect("Sacrifice those creatures at the beginning of the next end step", source.getControllerId()); effect.setTargetPointer(new FixedTargets(toSacrifice, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect); game.addDelayedTriggeredAbility(delayedAbility, source); return true; } return false; }
@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; }
@Override public boolean apply(Game game, Ability source) { ThatcherHumanToken token = new ThatcherHumanToken(); token.putOntoBattlefield(3, game, source.getSourceId(), source.getControllerId()); List<Permanent> toSacrifice = new ArrayList<>(); for (UUID tokenId : token.getLastAddedTokenIds()) { Permanent tokenPermanent = game.getPermanent(tokenId); if (tokenPermanent != null) { toSacrifice.add(tokenPermanent); } } SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect(); sacrificeEffect.setTargetPointer(new FixedTargets(toSacrifice, game)); game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect), source); return true; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent krovikanVampire = game.getPermanent(source.getSourceId()); creaturesAffected = (Set<UUID>) game.getState().getValue(source.getSourceId() + "creatureToGainControl"); if (creaturesAffected != null && controller != null && krovikanVampire != null) { for (UUID creatureId : creaturesAffected) { controller.moveCards(game.getCard(creatureId), Zone.BATTLEFIELD, source, game, false, false, false, null); OneShotEffect effect = new SacrificeTargetEffect(); effect.setText("Sacrifice this if Krovikan Vampire leaves the battlefield or its current controller loses control of it."); effect.setTargetPointer(new FixedTarget(creatureId)); KrovikanVampireDelayedTriggeredAbility dTA = new KrovikanVampireDelayedTriggeredAbility(effect, krovikanVampire.getId()); game.addDelayedTriggeredAbility(dTA, source); } creaturesAffected.clear(); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Token token = new TidalWaveWallToken(); if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) { for (UUID tokenId : token.getLastAddedTokenIds()) { Permanent tokenPermanent = game.getPermanent(tokenId); if (tokenPermanent != null) { SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect(); sacrificeEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect), source); } } return true; } return false; } }