Package mage.game.permanent

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


            if (card != null) {
                if (filter.match(card, game) && player.chooseUse(outcome, new StringBuilder("Put ").append(card.getName()).append("onto battlefield?").toString(), game)) {
                    card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
                    Permanent permanent = game.getPermanent(card.getId());
                    if (permanent != null) {
                        permanent.addCounters(new Counter("Manifestation"), game);
                        ContinuousEffect effect = new AddCardTypeTargetEffect(CardType.ENCHANTMENT, Duration.Custom);
                        effect.setTargetPointer(new FixedTarget(permanent.getId()));
                        game.addEffect(effect, source);
                    }
                }
View Full Code Here


            // add counters now
            if (prevented > 0) {
                Permanent targetPermanent = game.getPermanent(source.getTargets().getFirstTarget());
                if (targetPermanent != null) {
                    targetPermanent.addCounters(CounterType.P1P1.createInstance(prevented), game);
                    game.informPlayers(new StringBuilder("Test of Faith: Prevented ").append(prevented).append(" damage ").toString());
                    game.informPlayers("Test of Faith: Adding " + prevented + " +1/+1 counters to " + targetPermanent.getName());
                }
            }
        }
View Full Code Here

        int i = 0;
        for (UUID targetId : getTargetPointer().getTargets(game, source)) {
            i++;
            Permanent creature = game.getPermanent(targetId);
            if (creature != null) {
                creature.addCounters(CounterType.M1M1.createInstance(i), game);
            }
        }
        return false;
    }
}
View Full Code Here

        if (permanent != null && !permanent.isFaceDown()) {
            Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
            if (obj != null && obj instanceof SpellAbility) {
                int amount = ((SpellAbility) obj).getManaCostsToPay().getX();
                if (amount > 0) {
                    permanent.addCounters(CounterType.P1P1.createInstance(amount), game);
                }
            }
        }
        return true;
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
        if (permanent != null) {
            if (counter != null) {
                if (permanent.hasSubtype("Human")) {
                    permanent.addCounters(counter2.copy(), game);
                } else {
                    permanent.addCounters(counter.copy(), game);
                }
                return true;
            }
View Full Code Here

        if (permanent != null) {
            if (counter != null) {
                if (permanent.hasSubtype("Human")) {
                    permanent.addCounters(counter2.copy(), game);
                } else {
                    permanent.addCounters(counter.copy(), game);
                }
                return true;
            }
        }
        return false;
View Full Code Here

        if (source.getTargets().size() > 0) {
            Target multiTarget = source.getTargets().get(0);
            for (UUID target : multiTarget.getTargets()) {
                Permanent permanent = game.getPermanent(target);
                if (permanent != null) {
                    permanent.addCounters(CounterType.P1P1.createInstance(multiTarget.getTargetAmount(target)), game);
                }
            }
        }
        return true;
    }
View Full Code Here

            StringBuilder sb = new StringBuilder();
            sb.append("Put a +1/+1 counter on Talus Paladin?");
            if (!player.chooseUse(Outcome.Benefit, sb.toString(), game)) {
                return false;
            }
            taluspPaladin.addCounters(CounterType.P1P1.createInstance(), game);
        }
        return false;
    }
   
    @Override
View Full Code Here

        int amount = source.getManaCostsToPay().getX() + 1;
        Counter counter = CounterType.P1P1.createInstance(amount);
        for (UUID uuid : targetPointer.getTargets(game, source)) {
            Permanent permanent = game.getPermanent(uuid);
            if (permanent != null) {
                permanent.addCounters(counter.copy(), game);
                affectedTargets ++;
            }
        }
        return affectedTargets > 0;
    }
View Full Code Here

            if (obj != null && obj instanceof SpellAbility) {
                // delete to prevent using it again if put into battlefield from other effect
                setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null);
                int amount = ((SpellAbility)obj).getManaCostsToPay().getX();
                if (amount > 0) {
                    permanent.addCounters(CounterType.P1P1.createInstance(amount), game);
                }
            }
        }
        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.