Search in sources :

Example 1 with GoblinSoldierToken

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

the class RiseOfTheHobgoblinsEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player you = game.getPlayer(source.getControllerId());
    ManaCosts<ManaCost> cost = new ManaCostsImpl<>("{X}");
    if (you != null && you.chooseUse(Outcome.Neutral, "Do you want to to pay {X}?", source, game)) {
        int costX = you.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
        cost.add(new GenericManaCost(costX));
        if (cost.pay(source, game, source, source.getControllerId(), false, null)) {
            Token token = new GoblinSoldierToken();
            return token.putOntoBattlefield(costX, game, source, source.getControllerId());
        }
    }
    return false;
}
Also used : GoblinSoldierToken(mage.game.permanent.token.GoblinSoldierToken) Player(mage.players.Player) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) GenericManaCost(mage.abilities.costs.mana.GenericManaCost) ManaCost(mage.abilities.costs.mana.ManaCost) GoblinSoldierToken(mage.game.permanent.token.GoblinSoldierToken) Token(mage.game.permanent.token.Token) ManaCostsImpl(mage.abilities.costs.mana.ManaCostsImpl)

Aggregations

GenericManaCost (mage.abilities.costs.mana.GenericManaCost)1 ManaCost (mage.abilities.costs.mana.ManaCost)1 ManaCostsImpl (mage.abilities.costs.mana.ManaCostsImpl)1 GoblinSoldierToken (mage.game.permanent.token.GoblinSoldierToken)1 Token (mage.game.permanent.token.Token)1 Player (mage.players.Player)1