Package mage.game.permanent.token

Examples of mage.game.permanent.token.Token


                value = ((SacrificeTargetCost)cost).getPermanents().get(0).getPower().getValue();
            }
        }
        ArrayList<String> list = new ArrayList<>();
        list.add("Ooze");
        Token token = new Token("Ooze", "X/X green Ooze creature token onto the battlefield, where X is the sacrificed creature's power", ObjectColor.GREEN, list, value, value, new AbilitiesImpl()) {
          
     
        };
        token.getAbilities().newId(); // neccessary if token has ability like DevourAbility()
        token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
        return true;
    }
View Full Code Here


    }

    @Override
    public boolean apply(Game game, Ability source) {
        for (UUID opponentId: game.getOpponents(source.getControllerId())) {
            Token token = new AkroanHorseSoldierToken();
            token.putOntoBattlefield(1, game, source.getSourceId(), opponentId);
        }
        return true;
    }
View Full Code Here

        ManaCosts cost = new ManaCostsImpl("{X}");
        if (you != null && you.chooseUse(Outcome.Neutral, "Do you want to to pay {X}?", 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.getSourceId(), source.getControllerId(), false)) {
                Token token = new GoblinSoldierToken();
                return token.putOntoBattlefield(costX, game, source.getSourceId(), source.getControllerId());
            }
        }
        return false;
    }
View Full Code Here

    }
   
    @Override
    public boolean apply(Game game, Ability source) {
        int xValue = game.getBattlefield().countAll(filter, source.getControllerId(), game);
        Token token = new BaruFistOfKrosaToken(xValue);
        token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
        return true;
    }
View Full Code Here

        if (spell != null) {
            spellCMC = spell.getConvertedManaCost();
            spellControllerID = spell.getControllerId();
            game.getStack().counter(spell.getId(), source.getSourceId(), game);
        }
        Token token = new DovescapeToken();
        token.putOntoBattlefield(spellCMC, game, source.getSourceId(), spellControllerID);
        return true;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            for (UUID playerId : controller.getInRange()) {
                Token token = new CatToken();
                int amount = game.getBattlefield().getAllActivePermanents(filter, playerId, game).size();
                token.putOntoBattlefield(amount, game, source.getSourceId(), playerId);
            }
            return true;
        }
        return false;
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        int xValue = source.getManaCostsToPay().getX();
        if (controller != null && xValue > 0) {

            Token tokenCopy = new TemptWithVengeanceElementalToken();
            tokenCopy.putOntoBattlefield(xValue, game, source.getSourceId(), source.getControllerId(), false, false);

            int opponentsAddedTokens = 0;
            for (UUID playerId : game.getOpponents(controller.getId())) {
                Player opponent = game.getPlayer(playerId);
                if (opponent != null) {
                    if (opponent.chooseUse(outcome, "Put " + xValue + " Elemental Tokens onto the battlefield?", game)) {
                        opponentsAddedTokens += xValue;
                        tokenCopy.putOntoBattlefield(xValue, game, source.getSourceId(), playerId, false, false);
                    }
                }
            }
            if (opponentsAddedTokens > 0) {
                tokenCopy.putOntoBattlefield(opponentsAddedTokens, game, source.getSourceId(), source.getControllerId(), false, false);
            }
            return true;
        }

        return false;
View Full Code Here

            Permanent permanent = game.getPermanent(target.getFirstTarget());
            if (permanent != null) {
                permanent.sacrifice(source.getSourceId(), game);
                if (filterGoblin.match(permanent, game)) {
                    for (int i = 0; i < 2; i++) {
                        Token token = new WarrenWeirdingBlackGoblinRogueToken();
                        Effect effect = new CreateTokenTargetEffect(token);
                        effect.setTargetPointer(new FixedTarget(player.getId()));
                        if (effect.apply(game, source)) {
                            Permanent tokenPermanent = game.getPermanent(token.getLastAddedToken());
                            if (tokenPermanent != null) {
                                ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
                                hasteEffect.setTargetPointer(new FixedTarget(tokenPermanent.getId()));
                                game.addEffect(hasteEffect, source);
                            }
View Full Code Here

TOP

Related Classes of mage.game.permanent.token.Token

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.