Package mage.game.permanent

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


    @Override
    public boolean apply(Game game, Ability source) {
        int affectedTargets = 0;
        Permanent permanent = game.getPermanent(source.getTargets().get(0).getFirstTarget());
        if (permanent != null) {
            permanent.addCounters(CounterType.P1P1.createInstance(1), game);
            affectedTargets ++;
        }
        permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
        if (permanent != null) {
            permanent.addCounters(CounterType.P1P1.createInstance(1), game);
View Full Code Here


        public boolean apply(Game game, Ability source) {
            Integer damageAmount = (Integer) this.getValue("damageAmount");
            if (damageAmount != null) {
                Permanent permanent = game.getPermanent(source.getSourceId());
                if (permanent != null) {
                    permanent.addCounters(CounterType.THEFT.createInstance(damageAmount), game);
                    return true;
                }
            }
            return false;
        }
View Full Code Here

                // 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) {
                    if (amount < 5) {
                        permanent.addCounters(CounterType.P1P1.createInstance(amount), game);
                    } else {
                        permanent.addCounters(CounterType.P1P1.createInstance(amount * 2), game);
                    }
                }
            }
View Full Code Here

                int amount = ((SpellAbility)obj).getManaCostsToPay().getX();
                if (amount > 0) {
                    if (amount < 5) {
                        permanent.addCounters(CounterType.P1P1.createInstance(amount), game);
                    } else {
                        permanent.addCounters(CounterType.P1P1.createInstance(amount * 2), game);
                    }
                }
            }
            return true;
        }
View Full Code Here

            if (spell.getFromZone() == Zone.GRAVEYARD) {
                amount = 10;
            }
            Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
            if (permanent != null) {
                permanent.addCounters(CounterType.P1P1.createInstance(amount), game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (permanent != null) {
            permanent.addCounters(new Counter("filibuster"), game);
            if (permanent.getCounters().getCount("filibuster") > 4) {
                Player player = game.getPlayer(permanent.getControllerId());
                if (player != null) {
                    player.won(game);
                }
View Full Code Here

        for (Cost cost : source.getCosts()) {
            if (cost instanceof SacrificeTargetCost) {
                Permanent sacrificedCreature = ((SacrificeTargetCost) cost).getPermanents().get(0);
                Permanent sourceCreature = game.getPermanent(source.getSourceId());
                if (sacrificedCreature.hasSubtype("Human") && sourceCreature != null) {
                    sourceCreature.addCounters(CounterType.P1P1.createInstance(), game);
                    return true;
                }
            }
        }
        return false;
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.CHARGE.createInstance(amount), game);
                    return true;
                }
            }
        }
        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.CHARGE.createInstance(amount), game);
                }
            }
        }
        return true;
    }
View Full Code Here

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Permanent p = game.getPermanent(event.getTargetId());
        if (p != null) {
            p.addCounters(CounterType.P1P1.createInstance(event.getAmount()*2), game, event.getAppliedEffects());
        }
        return true;
    }

    @Override
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.