Search in sources :

Example 1 with DragonTokenGold

use of mage.game.permanent.token.DragonTokenGold in project mage by magefree.

the class SwordOfDungeonsAndDragonsEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        int count = 1;
        int amount = controller.rollDice(outcome, source, game, 20);
        while (amount == 20) {
            count += 1;
            amount = controller.rollDice(outcome, source, game, 20);
        }
        return new CreateTokenEffect(new DragonTokenGold(), count).apply(game, source);
    }
    return false;
}
Also used : Player(mage.players.Player) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect) DragonTokenGold(mage.game.permanent.token.DragonTokenGold)

Aggregations

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