Examples of addCounters()


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

        Permanent targetArtifact = game.getPermanent(targetPointer.getFirst(game, source));
        Player player = game.getPlayer(source.getControllerId());
        if (sourcePermanent != null && targetArtifact != null && player != null) {
            int numberOfCounters = sourcePermanent.getCounters().getCount(CounterType.P1P1);
            if (numberOfCounters > 0) {
                targetArtifact.addCounters(CounterType.P1P1.createInstance(numberOfCounters), game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

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

        if (player != null) {
            BloodthirstWatcher watcher = (BloodthirstWatcher) game.getState().getWatchers().get("DamagedOpponents", source.getControllerId());
            if (watcher != null && watcher.conditionMet()) {
                Permanent p = game.getPermanent(source.getSourceId());
                if (p != null) {
                    p.addCounters(CounterType.P1P1.createInstance(amount), game);

                }
            }
            return true;
        }
View Full Code Here

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

        Permanent creature = game.getPermanent(event.getTargetId());
        Player controller = game.getPlayer(source.getControllerId());
        if (creature != null && controller != null) {
            if (controller.chooseUse(outcome, "Unleash "+ creature.getName() +"?", game)) {
                game.informPlayers(controller.getName() + " unleashes " + creature.getName());
                creature.addCounters(CounterType.P1P1.createInstance(), game);
            }
        }
        return false;
    }
View Full Code Here

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

    @Override
    public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
        Permanent permanent = game.getPermanent(sourceId);
        if (permanent != null) {
            permanent.addCounters(counter, game);
            this.paid = true;
        }
        return paid;
    }
View Full Code Here

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

                    if (countersToAdd > 0 && newCounter.getCount() == 1) {
                        countersToAdd--;
                    }
                    newCounter.add(countersToAdd);
                    int before = permanent.getCounters().getCount(newCounter.getName());
                    permanent.addCounters(newCounter, game);
                    int amountAdded = permanent.getCounters().getCount(newCounter.getName()) - before;
                    if (informPlayers) {
                        Player player = game.getPlayer(source.getControllerId());
                        if (player != null) {
                            game.informPlayers(player.getName()+" puts "+amountAdded+" "+newCounter.getName().toLowerCase()+" counter on "+permanent.getLogName());
View Full Code Here

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

        if (permanent != null && permanent.getAttachedTo() != null) {
            Permanent attachedTo = game.getPermanent(permanent.getAttachedTo());
            if (attachedTo != null && counter != null) {
                Counter newCounter = counter.copy();
                newCounter.add(amount.calculate(game, source, this));
                attachedTo.addCounters(newCounter, game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

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

                if (permanent != null) {
                    if (counter != null) {
                        Counter newCounter = counter.copy();
                        newCounter.add(amount.calculate(game, source, this));
                        int before = permanent.getCounters().getCount(counter.getName());
                        permanent.addCounters(newCounter, game);
                        int numberAdded = permanent.getCounters().getCount(counter.getName()) - before;
                        affectedTargets ++;
                        game.informPlayers(sourceObject.getLogName() +": "+ controller.getName()+ " puts " +
                                numberAdded + " " + counter.getName().toLowerCase() + " counter on " + permanent.getLogName());
                    }
View Full Code Here

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

        Permanent vessel = game.getPermanent(source.getSourceId());
        Player you = game.getPlayer(source.getControllerId());
        if (vessel != null && you != null) {
            int amount = you.getLife();
            if (amount > 0) {
                vessel.addCounters(CounterType.CHARGE.createInstance(amount), game);
                return true;
            }
        }
        return true;
    }
View Full Code Here

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

            else{
                counter = CounterType.CHARGE.createInstance(amount.calculate(game, source, this));
            }
            if (counter != null) {
              
                permanent.addCounters(counter, game);
               
                Player player = game.getPlayer(source.getControllerId());
                if (player != null) {
                    game.informPlayers(player.getName()+ " puts " + counter.getCount() + " " + counter.getName() + " counter on " + permanent.getName());
                }
View Full Code Here

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

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Permanent permanent = game.getPermanent(event.getTargetId());
        if (permanent != null) {
            permanent.addCounters(CounterType.P1P1.createInstance(), game);
        }
        used = true;
        return false;
    }
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.