Search in sources :

Example 1 with RabidSheepToken

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;
}
Also used : Player(mage.players.Player) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) RabidSheepToken(mage.game.permanent.token.RabidSheepToken)

Aggregations

CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)1 RabidSheepToken (mage.game.permanent.token.RabidSheepToken)1 Player (mage.players.Player)1