use of mage.game.permanent.token.SamuraiToken in project mage by magefree.
the class EiganjoUprisingEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int amount = source.getManaCostsToPay().getX();
if (amount < 1) {
return false;
}
Token token = new SamuraiToken();
token.putOntoBattlefield(amount, game, source);
game.addEffect(new GainAbilityTargetEffect(new MenaceAbility(false)).setTargetPointer(new FixedTargets(token, game)), source);
game.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance()).setTargetPointer(new FixedTargets(token, game)), source);
if (amount < 2) {
return true;
}
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
token.putOntoBattlefield(amount - 1, game, source, opponentId);
}
return true;
}
Aggregations