Examples of removeCounters()


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

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

    public boolean apply(Game game, Ability source) {
        Permanent target = game.getPermanent(source.getFirstTarget());
        Player you = game.getPlayer(source.getControllerId());
        if (target != null) {
            numberCountersOriginal = target.getCounters().getCount(CounterType.M1M1);
            target.removeCounters(CounterType.M1M1.createInstance(), game);
            numberCountersAfter = target.getCounters().getCount(CounterType.M1M1);
            if (numberCountersAfter < numberCountersOriginal && you != null) {
                you.gainLife(2, game);
                return true;
            }
View Full Code Here

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

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (player != null && permanent != null) {
            int numCounters = permanent.getCounters().getCount(CounterType.DELAY);
            permanent.removeCounters(CounterType.DELAY.createInstance(), game);
            for (int i = numCounters; i > 0; i--) {
                if (player.chooseUse(Outcome.Benefit, "Pay {1}{W}? (" + i + " counters left to pay)", game)) {
                    Cost cost = new ManaCostsImpl<>("{1}{W}");
                    if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                        continue;
View Full Code Here

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

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getSourceId());
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null && permanent != null && permanent.getCounters().getCount(CounterType.P1P1) > 0) {
            permanent.removeCounters(CounterType.P1P1.createInstance(), game);
            Target target = new TargetCreatureOrPlayer();
            if (controller.chooseTarget(outcome, target, source, game)) {
                Effect effect = new DamageTargetEffect(1);
                effect.setTargetPointer(new FixedTarget(target.getFirstTarget()));
                return effect.apply(game, source);
View Full Code Here

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

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
        if (permanent != null) {
            permanent.removeCounters(CounterType.TIME.getName(), 2,  game);
            return true;
        }
        Card card = game.getCard(this.getTargetPointer().getFirst(game, source));
        if (card != null) {
            card.removeCounters(CounterType.TIME.getName(), 2,  game);
View Full Code Here

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

    public boolean apply(Game game, Ability source) {
        Permanent sourcePermanent = game.getPermanent(source.getSourceId());
        Player player = game.getPlayer(source.getControllerId());
        if (sourcePermanent != null && player != null) {
            int chargeCounters = sourcePermanent.getCounters().getCount(CounterType.CHARGE);
            sourcePermanent.removeCounters(CounterType.CHARGE.createInstance(chargeCounters), game);
            Mana mana = new Mana();
            ChoiceColor choice = new ChoiceColor();
            for (int i = 0; i < chargeCounters; i++) {
                while (!choice.isChosen()) {
                    if (!player.isInGame()) {
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

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()

    public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
        Permanent equipment = game.getPermanent(this.effectGivingEquipmentId);
                if (equipment != null ) {
                    this.removedCounters = equipment.getCounters().getCount(CounterType.AIM);
                    if (this.removedCounters > 0) {
                            equipment.removeCounters("aim", 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.