use of mage.game.permanent.token.HornetToken in project mage by magefree.
the class HornetCannonEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Token hornetToken = new HornetToken();
hornetToken.putOntoBattlefield(1, game, source, source.getControllerId());
for (UUID tokenId : hornetToken.getLastAddedTokenIds()) {
Permanent tokenPermanent = game.getPermanent(tokenId);
if (tokenPermanent != null) {
DestroyTargetEffect destroyEffect = new DestroyTargetEffect(false);
destroyEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(destroyEffect), source);
}
}
return true;
}
Aggregations