use of mage.game.permanent.token.WalkerToken in project mage by magefree.
the class LucilleEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent equipment = game.getPermanent(source.getSourceId());
if (equipment == null) {
return false;
}
Player player = game.getPlayer(game.getCombat().getDefendingPlayerId(equipment.getAttachedTo(), game));
if (player == null) {
return false;
}
TargetPermanent target = new TargetControlledCreaturePermanent();
target.setNotTarget(true);
if (!target.canChoose(source.getSourceId(), player.getId(), game)) {
return false;
}
player.choose(outcome, target, source.getSourceId(), game);
Permanent permanent = game.getPermanent(target.getFirstTarget());
return permanent.sacrifice(source, game) && new WalkerToken().putOntoBattlefield(1, game, source, source.getControllerId());
}
Aggregations