Examples of removeCounters()


Examples of mage.game.permanent.Permanent.removeCounters()

    @Override
    public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
        Permanent permanent = game.getPermanent(sourceId);
        if (permanent != null && permanent.getCounters().getCount(name) >= amount) {
            permanent.removeCounters(name, amount, game);
            this.paid = true;
        }
        return paid;
    }
View Full Code Here

Examples of mage.game.permanent.Permanent.removeCounters()

        Permanent permanent = game.getPermanent(target.getFirstTarget());

        if (permanent != null) {
            for(Counter counter : permanent.getCounters().values()){
                permanent.removeCounters(counter, game);
            }

            return true;
        }
View Full Code Here

Examples of mage.game.permanent.Permanent.removeCounters()

                                int numberOfCountersSelected = 1;
                                if (countersLeft > 1 && countersOnPermanent > 1) {
                                    numberOfCountersSelected = controller.getAmount(1, Math.min(countersLeft, countersOnPermanent),
                                            new StringBuilder("Remove how many counters from ").append(permanent.getLogName()).toString(),  game);
                                }
                                permanent.removeCounters(counterName, numberOfCountersSelected, game);
                                if (permanent.getCounters().getCount(counterName) == 0 ){
                                    permanent.getCounters().removeCounter(counterName);
                                }
                                countersRemoved += numberOfCountersSelected;
                                game.informPlayers(new StringBuilder(controller.getName())
View Full Code Here

Examples of mage.game.permanent.Permanent.removeCounters()

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent p = game.getPermanent(targetPointer.getFirst(game, source));
        if (p != null && p.getCounters().getCount(counter.getName()) >= counter.getCount()) {
            p.removeCounters(counter.getName(), counter.getCount(), game);
            game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(" ").append(counter.getName())
                    .append(" counter from ").append(p.getName()).toString());
            return true;
        }
        Card c = game.getCard(targetPointer.getFirst(game, source));
View Full Code Here

Examples of mage.game.permanent.Permanent.removeCounters()

                int amount = 0;
                if (player.choose(Outcome.Detriment, choice, game)) {
                    amount = Integer.parseInt(choice.getChoice());
                }

                permanent.removeCounters(CounterType.CHARGE.getName(), amount, game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

Examples of mage.game.permanent.Permanent.removeCounters()

    public boolean apply(Game game, Ability source) {
        Permanent creature = game.getPermanent(targetPointer.getFirst(game, source));
        if (creature != null) {
            int numberCounters = creature.getCounters().getCount(CounterType.P1P1);
            if (numberCounters > 0) {
                creature.removeCounters(CounterType.P1P1.getName(), numberCounters, game);
                Player controller = game.getPlayer(source.getControllerId());
                if (controller != null) {
                    controller.drawCards(numberCounters, game);
                } else {
                    throw new UnsupportedOperationException("Controller missing");
View Full Code Here

Examples of mage.game.permanent.Permanent.removeCounters()

    public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
        Permanent permanent = game.getPermanent(ability.getSourceId());
        if (permanent != null) {
            this.removedCounters = permanent.getCounters().getCount(CounterType.P1P1);
            if (this.removedCounters > 0) {
                permanent.removeCounters(CounterType.P1P1.createInstance(this.removedCounters), game);
            }
        }
        this.paid = true;
        return true;
    }
View Full Code Here

Examples of mage.game.permanent.Permanent.removeCounters()

            game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), damage));
            retValue = true;
        }
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (permanent != null) {
            permanent.removeCounters(CounterType.P1P1.createInstance(), game);
        }
        return retValue;
    }

    @Override
View Full Code Here

Examples of mage.game.permanent.Permanent.removeCounters()

    public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
        Permanent permanent = game.getPermanent(ability.getSourceId());
        if (permanent != null) {
            this.removedCounters = permanent.getCounters().getCount(CounterType.PAIN);
            if (this.removedCounters > 0) {
                permanent.removeCounters(CounterType.PAIN.createInstance(this.removedCounters), game);
            }
        }
        this.paid = true;
        return true;
    }
View Full Code Here

Examples of mage.game.permanent.Permanent.removeCounters()

                }
            }

            if(removeCounter && permanent.getCounters().containsKey(CounterType.P1P1)) {
                StringBuilder sb = new StringBuilder(permanent.getName()).append(": ");
                permanent.removeCounters(CounterType.P1P1.createInstance(), game);
                sb.append("Removed a +1/+1 counter ");
                game.informPlayers(sb.toString());
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.