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