Package mage.game.permanent

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


        choice.setChoices(possibleChoices);
        you.choose(Outcome.Neutral, choice, game);
        String chosen = choice.getChoice();
        if (fromPermanent.getCounters().containsKey(chosen)) {
            fromPermanent.removeCounters(chosen, 1, game);
            toPermanent.addCounters(chosen, 1, game);
        }
        return true;
    }
}
View Full Code Here


        if (bitingTether == null) {
            return false;
        }
        Permanent enchantedCreature = game.getPermanent(bitingTether.getAttachedTo());
        if (enchantedCreature != null) {
            enchantedCreature.addCounters(CounterType.M1M1.createInstance(), game);
            return true;
        }
        return false;
    }
}
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent creature = game.getPermanent(source.getFirstTarget());
        if (creature != null) {
            creature.addCounters(CounterType.M1M1.createInstance(), game);
            return true;
        }
        return false;
    }
View Full Code Here

        if (permanent != null) {
            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(new Counter("gem", amount), game);
                }
            }
        }
        return true;
    }
View Full Code Here

            if (card.getCardType().contains(CardType.CREATURE)) {
                if (controller.chooseUse(Outcome.DrawCard, "Do you wish to reveal the creature card at the top of the library?", game)) {
                    controller.revealCards(sourcePermanent.getName(), cards, game);
                    Permanent questForUlasTemple = game.getPermanent(source.getSourceId());
                    if (questForUlasTemple != null) {
                        questForUlasTemple.addCounters(CounterType.QUEST.createInstance(), game);
                        return true;
                    }
                }
            }
        }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent thoughtGorger = game.getPermanent(source.getSourceId());
        if (player != null && player.getHand().size() > 0 && thoughtGorger != null ) {
            int cardsInHand = player.getHand().size();
            thoughtGorger.addCounters(CounterType.P1P1.createInstance(cardsInHand), game);
            player.discard(cardsInHand, source, game);
            return true;
        }
        return false;
    }
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.P1P1.createInstance(i), game);
            }
        }
        return false;
    }
}
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent sourcePermanent = game.getPermanent(source.getSourceId());
        if (sourcePermanent != null) {
            sourcePermanent.addCounters(CounterType.CHARGE.createInstance(), game);
            int amount = sourcePermanent.getCounters().getCount(CounterType.CHARGE);

            Permanent permanent = game.getPermanent(source.getFirstTarget());
            if (permanent != null) {
                permanent.damage(amount, source.getSourceId(), game, false, true);
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent enchantment = game.getPermanent(source.getSourceId());
        if (enchantment != null && enchantment.getAttachedTo() != null) {
            Permanent creature = game.getPermanent(enchantment.getAttachedTo());
            if (creature != null) {
                creature.addCounters(CounterType.M1M1.createInstance(), game);
            }
        }
        return true;
    }
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.