use of mage.game.permanent.token.ZombieArmyToken in project mage by magefree.
the class AmassEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int xValue = amassNumber.calculate(game, source, this);
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
if (!game.getBattlefield().containsControlled(filter, source, game, 1)) {
new CreateTokenEffect(new ZombieArmyToken()).apply(game, source);
}
Target target = new TargetPermanent(filter);
target.setNotTarget(true);
if (!player.choose(outcome, target, source.getSourceId(), game)) {
return false;
}
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent == null) {
return false;
}
permanent.addCounters(CounterType.P1P1.createInstance(xValue), source.getControllerId(), source, game);
this.amassedCreatureId = permanent.getId();
return true;
}
Aggregations