use of mage.game.permanent.token.SplinterToken in project mage by magefree.
the class SplinteringWindDelayedTriggeredAbility method apply.
@Override
public boolean apply(Game game, Ability source) {
Player sourceController = game.getPlayer(source.getControllerId());
Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (sourceController != null && sourceObject != null) {
CreateTokenEffect effect = new CreateTokenEffect(new SplinterToken());
effect.apply(game, source);
game.getState().setValue(source.getSourceId() + "_token", effect.getLastAddedTokenIds());
for (UUID addedTokenId : effect.getLastAddedTokenIds()) {
game.addDelayedTriggeredAbility(new SplinteringWindDelayedTriggeredAbility(addedTokenId), source);
}
return true;
}
return false;
}
Aggregations