Package mage.util.functions

Examples of mage.util.functions.EmptyApplyToPermanent


    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
        if (permanent != null) {
            // handle copies of copies
            Permanent copyFromPermanent = permanent;
            ApplyToPermanent applier = new EmptyApplyToPermanent();
            for (Effect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) {
                if (effect instanceof CopyEffect) {
                    CopyEffect copyEffect = (CopyEffect) effect;
                    // there is another copy effect that our targetPermanent copies stats from
                    if (copyEffect.getSourceId().equals(permanent.getId())) {
View Full Code Here


    public CopyPermanentEffect(ApplyToPermanent applier) {
        this(new FilterCreaturePermanent(), applier);
    }

    public CopyPermanentEffect(FilterPermanent filter) {
        this(filter, new EmptyApplyToPermanent());
    }
View Full Code Here

            Permanent copyFromCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
            if (copyFromCreature != null) {
                for (UUID copyToId: source.getTargets().get(1).getTargets()) {
                    Permanent copyToCreature = game.getPermanent(copyToId);
                    if (copyToCreature != null) {
                        game.copyPermanent(Duration.EndOfTurn, copyFromCreature, copyToCreature, source, new EmptyApplyToPermanent());
                    }
                }
            }
            return true;
        }
View Full Code Here

        if (sourcePermanent != null && sourcePermanent.getAttachedTo() != null) {
            Permanent toCopyFromPermanent = game.getPermanent(sourcePermanent.getAttachedTo());
            if (toCopyFromPermanent != null) {
                for (Permanent toCopyToPermanent: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
                    if (!toCopyToPermanent.equals(toCopyFromPermanent) && !(toCopyToPermanent instanceof PermanentToken)) {
                        game.copyPermanent(toCopyFromPermanent, toCopyToPermanent, source, new EmptyApplyToPermanent());
                    }
                }
                return true;
            }
        }
View Full Code Here

        Permanent toCopyToPermanent = game.getPermanent(event.getTargetId());
        Permanent sourcePermanent = game.getPermanent(source.getSourceId());
        if (sourcePermanent != null && toCopyToPermanent != null && sourcePermanent.getAttachedTo() != null) {
            Permanent toCopyFromPermanent = game.getPermanent(sourcePermanent.getAttachedTo());
            if (toCopyFromPermanent != null) {
                game.copyPermanent(toCopyFromPermanent, toCopyToPermanent, source, new EmptyApplyToPermanent());
            }
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent sourcePermanent = game.getPermanent(source.getSourceId());
        Permanent copyFromPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
        if (sourcePermanent != null && copyFromPermanent != null) {
            Permanent newPermanent = game.copyPermanent(copyFromPermanent, sourcePermanent, source, new EmptyApplyToPermanent());
            Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ThespiansStageCopyEffect(), new GenericManaCost(2));
            ability.addCost(new TapSourceCost());
            ability.addTarget(new TargetLandPermanent());
            newPermanent.addAbility(ability, source.getSourceId(), game);
            return true;
View Full Code Here

}

class CopyEnchantmentEffect extends CopyPermanentEffect {

    public CopyEnchantmentEffect(FilterPermanent filter) {
        super(filter, new EmptyApplyToPermanent());
    }
View Full Code Here

        }
        if (targetCreature == null || permanent == null) {
            return false;
        }

        game.copyPermanent(Duration.EndOfTurn, targetCreature, permanent, source, new EmptyApplyToPermanent());
        return false;
    }
View Full Code Here

TOP

Related Classes of mage.util.functions.EmptyApplyToPermanent

Copyright © 2018 www.massapicom. 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.