Examples of addCounters()


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

        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

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

        if (controller != null && 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);
                    game.informPlayers(new StringBuilder(controller.getName()).append(" puts ").append(multiTarget.getTargetAmount(target)).append(" ").append(CounterType.P1P1.getName().toLowerCase()).append(" counter on ").append(permanent.getName()).toString());
                }
            }
            return true;
        }
View Full Code Here

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

                setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null);
                SpellAbility spellAbility = (SpellAbility) obj;
                if (spellAbility.getSourceId().equals(source.getSourceId())) { // put into play by normal cast
                    int amount = spellAbility.getManaCostsToPay().getX();
                    if (amount > 0) {
                        permanent.addCounters(CounterType.P1P1.createInstance(amount), game);
                    }
                }
            }
        }
        return true;
View Full Code Here

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

            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.CHARGE.createInstance(amount), game);
                }
            }
        }
        return true;
    }
View Full Code Here

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

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

        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

Examples of mage.game.stack.Spell.addCounters()

    @Override
    public boolean apply(Game game, Ability source) {
        Spell spell = game.getStack().getSpell(source.getSourceId());
        if (spell != null) {
            spell.addCounters(CounterType.CHARGE.createInstance(2), game);
            return spell.chooseNewTargets(game, source.getControllerId(), false, false);
        }
        return false;
    }
}
View Full Code Here

Examples of mage.players.Player.addCounters()

                return false;
            }
        }
        Player player = game.getPlayer(uuid);
        if (player != null) {
            player.addCounters(counter, game);
            return true;
        }
        return false;
    }
View Full Code Here

Examples of mage.players.Player.addCounters()

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

Examples of mage.players.Player.addCounters()

                                choice.setMessage("Choose a counter to proliferate (" + player.getName() + ")");
                                controller.choose(Outcome.Benefit, choice, game);
                                for (Counter counter : player.getCounters().values()) {
                                    if (counter.getName().equals(choice.getChoice())) {
                                        Counter newCounter = new Counter(counter.getName());
                                        player.addCounters(newCounter, game);
                                        break;
                                    }
                                }
                            }
                        }
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.