use of mage.game.permanent.token.RabidSheepToken in project mage by magefree.
the class FlockOfRabidSheepEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int repeat = source.getManaCostsToPay().getX();
int wonCount = 0;
for (int i = 1; i <= repeat; i++) {
if (controller.flipCoin(source, game, true)) {
wonCount++;
}
}
new CreateTokenEffect(new RabidSheepToken(), wonCount).apply(game, source);
return true;
}
return false;
}
Aggregations