use of mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility in project mage by magefree.
the class DorotheasRetributionEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Token token = new DorotheasRetributionSpiritToken();
token.putOntoBattlefield(1, game, source, source.getControllerId(), true, true);
game.addDelayedTriggeredAbility(new AtTheEndOfCombatDelayedTriggeredAbility(new SacrificeTargetEffect().setTargetPointer(new FixedTargets(token, game)).setText("sacrifce that token")), source);
return true;
}
use of mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility in project mage by magefree.
the class CreateTokenCopyTargetEffect method removeTokensCreatedAtEndOf.
private void removeTokensCreatedAtEndOf(Game game, Ability source, PhaseStep phaseStepToExileCards, boolean exile) {
Effect effect;
if (exile) {
effect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD).setText("exile the token copies");
} else {
effect = new SacrificeTargetEffect("sacrifice the token copies");
}
effect.setTargetPointer(new FixedTargets(addedTokenPermanents, game));
DelayedTriggeredAbility exileAbility;
switch(phaseStepToExileCards) {
case END_TURN:
exileAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
break;
case END_COMBAT:
exileAbility = new AtTheEndOfCombatDelayedTriggeredAbility(effect);
break;
default:
return;
}
game.addDelayedTriggeredAbility(exileAbility, source);
}
use of mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility in project mage by magefree.
the class ClockworkCondorEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent p = game.getPermanent(source.getSourceId());
if (p != null) {
AtTheEndOfCombatDelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P1.createInstance()));
game.addDelayedTriggeredAbility(ability, source);
}
return false;
}
use of mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility in project mage by magefree.
the class ClockworkBeetleEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
Effect effect = new RemoveCounterTargetEffect(CounterType.P1P1.createInstance());
effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
game.addDelayedTriggeredAbility(new AtTheEndOfCombatDelayedTriggeredAbility(effect), source);
return true;
}
return false;
}
use of mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility in project mage by magefree.
the class ClockworkVorracEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent p = game.getPermanent(source.getSourceId());
if (p != null) {
AtTheEndOfCombatDelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P1.createInstance()));
game.addDelayedTriggeredAbility(ability, source);
}
return false;
}
Aggregations