use of mage.game.permanent.token.TidalWaveWallToken in project mage by magefree.
the class TidalWaveEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Token token = new TidalWaveWallToken();
if (token.putOntoBattlefield(1, game, source, 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;
}
Aggregations