Examples of addCounters()


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.M1M1.createInstance(), game);
        }
        used = true;
        return false;
    }
View Full Code Here

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

            int numberOfCounters = sourcePermanent.getCounters().getCount(CounterType.P1P1);
            if (numberOfCounters > 0) {
                Permanent targetCreature = game.getPermanent(targetPointer.getFirst(game, source));
                if (targetCreature != null) {
                    sourcePermanent.removeCounters(CounterType.P1P1.getName(), 1, game);
                    targetCreature.addCounters(CounterType.P1P1.createInstance(1), game);
                    StringBuilder sb = new StringBuilder("Moved one +1/+1 counter from ").append(sourcePermanent.getName()).append(" to ").append(targetCreature.getName());
                    game.informPlayers(sb.toString());
                    return true;
                }
            }
View Full Code Here

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

                Permanent permanent = game.getPermanent(chosen);
                if (permanent != null) {
                    if (permanent.getCounters().size() > 0) {
                        if (permanent.getCounters().size() == 1) {
                            for (Counter counter : permanent.getCounters().values()) {
                                permanent.addCounters(counter.getName(), 1, game);
                            }
                        } else {
                            Choice choice = new ChoiceImpl(true);
                            Set<String> choices = new HashSet<>();
                            for (Counter counter : permanent.getCounters().values()) {
View Full Code Here

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

                            choice.setChoices(choices);
                            choice.setMessage("Choose a counter to proliferate (" + permanent.getName() + ")");
                            controller.choose(Outcome.Benefit, choice, game);
                            for (Counter counter : permanent.getCounters().values()) {
                                if (counter.getName().equals(choice.getChoice())) {
                                    permanent.addCounters(counter.getName(), 1, game);
                                    break;
                                }
                            }
                        }
                    }
View Full Code Here

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

            enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
        }
        if (enchantment != null && enchantment.getAttachedTo() != null) {
            Permanent creature = game.getPermanent(enchantment.getAttachedTo());
            if (creature != null) {
                creature.addCounters(CounterType.P1P1.createInstance(amount), game);
            }
        }
        return true;
    }
View Full Code Here

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

            Card card = game.getCard(source.getSourceId());
            if (card != null) {
                if (card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId())) {
                    Permanent permanent = game.getPermanent(card.getId());
                    if (permanent != null) {
                        permanent.addCounters(CounterType.LUCK.createInstance(), game);
                        Cost cost = new ExileFromHandCost(new TargetCardInHand());
                        if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game)) {
                            cost.pay(source, game, source.getSourceId(), source.getControllerId(), true);
                        }
                    }
View Full Code Here

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

        Permanent enchantment = game.getPermanent(source.getSourceId());
        if (enchantment != null && enchantment.getAttachedTo() != null) {
            Permanent creature = game.getPermanent(enchantment.getAttachedTo());
            if (creature != null) {
                if ( creature.hasSubtype("Vampire") ) {
                    creature.addCounters(CounterType.P1P1.createInstance(2), game);
                }
                else {
                    creature.addCounters(CounterType.P1P1.createInstance(), game);
                }
            }
View Full Code Here

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

            if (creature != null) {
                if ( creature.hasSubtype("Vampire") ) {
                    creature.addCounters(CounterType.P1P1.createInstance(2), game);
                }
                else {
                    creature.addCounters(CounterType.P1P1.createInstance(), game);
                }
            }
        }
        return true;
    }
View Full Code Here

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

        Permanent triggeringCreature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
        if (triggeringCreature != null) {
            Permanent sourceCreature = game.getPermanent(source.getSourceId());
            if (sourceCreature != null && EvolveAbility.isPowerOrThoughnessGreater(sourceCreature, triggeringCreature)) {
                game.getState().setValue("EvolveAddCounterActive", Boolean.TRUE);
                sourceCreature.addCounters(CounterType.P1P1.createInstance(), game);
                game.getState().setValue("EvolveAddCounterActive", Boolean.FALSE);
            }
            return true;
        }
        return false;
View Full Code Here

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

    public boolean apply(Game game, Ability source) {
        Permanent magosi = game.getPermanent(source.getSourceId());
        Player player = game.getPlayer(source.getControllerId());
       
        if (magosi != null) {
            magosi.addCounters(CounterType.EON.createInstance(), game);
        }
        if (player != null) {
            game.getState().getTurnMods().add(new TurnMod(player.getId(), true));
        }
        return true;
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.