Examples of removeCounters()


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

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (permanent != null) {
            //Remove all +1/+1 counters
            permanent.removeCounters(permanent.getCounters().get(CounterType.P1P1.getName()), game);
            //put X +1/+1 counters
            permanent.addCounters(CounterType.P1P1.createInstance(source.getManaCostsToPay().getX()), game);
            return true;
        }
        return false;
View Full Code Here

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

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

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) {
            this.amount = permanent.getCounters().getCount(name);
            permanent.removeCounters(name, amount, game);
            this.paid = true;
        }
        else
        {
            this.amount = 0;
View Full Code Here

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

            }
            info.activations++;
            if (info.activations == 3) {
                int damage = sourcePermanent.getCounters().getCount(CounterType.P1P1);
                if (damage > 0) {
                    sourcePermanent.removeCounters(CounterType.P1P1.getName(), damage, game);
                    return new DamageEverythingEffect(damage, new FilterCreaturePermanent()).apply(game, source);
                }
            }
            return true;
        }
View Full Code Here

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

                                }
                            }
                        }
                    }
                    if (counterName != null) {
                        permanent.removeCounters(counterName, 1, game);
                        if (permanent.getCounters().getCount(counterName) == 0 ){
                            permanent.getCounters().removeCounter(counterName);
                        }
                        result |= true;
                        game.informPlayers(new StringBuilder(controller.getName()).append(" removes a ").append(counterName).append(" counter from ").append(permanent.getName()).toString());
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(damage), 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.EYEBALL);
            if (this.removedCounters > 0) {
                permanent.removeCounters(CounterType.EYEBALL.createInstance(this.removedCounters), game);
            }
        }
        this.paid = true;
        return true;
    }
View Full Code Here

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

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
        if (creature != null) {
            creature.removeCounters(CounterType.FUSE.getName(), creature.getCounters().getCount(CounterType.FUSE), game);
            creature.destroy(source.getSourceId(), game, false);
        }
        if (creature == null) {
            creature = (Permanent) game.getLastKnownInformation(this.getTargetPointer().getFirst(game, source), Zone.BATTLEFIELD);
        }
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.