Package mage.game.permanent

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


        Permanent HamletbackGoliath = game.getPermanent(source.getSourceId());
        if (creature == null) {
            creature = (Permanent) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.BATTLEFIELD);
        }
        if (creature != null) {
           HamletbackGoliath.addCounters(CounterType.P1P1.createInstance(creature.getPower().getValue()), game);
            return true;
        }
        return false;
    }
View Full Code Here


    @Override
    public boolean apply(Game game, Ability source) {
        Permanent targetCreature = game.getPermanent(source.getFirstTarget());
        if (targetCreature != null) {
            Player controller = game.getPlayer(targetCreature.getControllerId());
            targetCreature.addCounters(CounterType.BRIBERY.createInstance(), game);
            if (controller != null) {
                controller.drawCards(1, 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.CHARGE.createInstance(amount), game);
                }
            }
        }
        return true;
    }
View Full Code Here

        Permanent sourceCreature = game.getPermanent(source.getSourceId());
        Permanent creature = game.getPermanent(event.getTargetId());
        if (sourceCreature != null && creature != null) {
            int power = sourceCreature.getPower().getValue();
            if (power > 0) {
                creature.addCounters(CounterType.P1P1.createInstance(power), game);
            }
            ContinuousEffect effect = new AddCardSubTypeTargetEffect("Mutant", Duration.WhileOnBattlefield);
            effect.setTargetPointer(new FixedTarget(creature.getId()));
            game.addEffect(effect, source);
        }
View Full Code Here

        Player player = game.getPlayer(source.getControllerId());
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (permanent != null && player != null) {
            int amount = player.getGraveyard().count(filter, game);
            if (amount > 0) {
                permanent.addCounters(CounterType.P1P1.createInstance(amount), game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

            game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), damage));
            retValue = true;
        }
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (permanent != null) {
            permanent.addCounters(CounterType.M1M1.createInstance(damage), game);
        }
        return retValue;
    }

    @Override
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getFirstTarget());
        if (permanent != null) {
            int count = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
            if (count > 0) {
                permanent.addCounters(CounterType.P1P1.createInstance(count), 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;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        // targetPointer can't be used because target moved from graveyard to battlefield
        Permanent permanent = game.getPermanent(source.getFirstTarget());
        if (permanent != null) {
                permanent.addCounters(CounterType.P1P1.createInstance(), game);
        }
        return false;
    }
}
View Full Code Here

            Integer zoneChanges = (Integer) getValue("zoneChanges");
            if (card.getZoneChangeCounter() == zoneChanges) {
                Zone currentZone = game.getState().getZone(card.getId());
                if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId())) {
                    Permanent creature = game.getPermanent(card.getId());
                    creature.addCounters(CounterType.P1P1.createInstance(), game);
                    ContinuousEffect effect = new GraveBetrayalContiniousEffect();
                    effect.setTargetPointer(new FixedTarget(creature.getId()));
                    game.addEffect(effect, source);
                    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.