Package mage.game.permanent

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


            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

        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

            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

        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

    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

        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

        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

        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

    @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

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.