use of mage.game.permanent.token.GolemToken in project mage by magefree.
the class CavalierOfDawnEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
Player player = game.getPlayer(permanent.getControllerId());
permanent.destroy(source, game, false);
if (player == null) {
return false;
}
Effect effect = new CreateTokenTargetEffect(new GolemToken());
effect.setTargetPointer(new FixedTarget(player.getId(), game));
return effect.apply(game, source);
}
Aggregations