Package mage.abilities.effects.common

Examples of mage.abilities.effects.common.CopyEffect


    this.color.setBlue(true);
    this.subtype.add("Shapeshifter");
    this.power = new MageInt(0);
    this.toughness = new MageInt(0);

    Ability ability = new EntersBattlefieldAbility(new CopyEffect(), "You may have Clone enter the battlefield as a copy of any creature on the battlefield");
    ability.addTarget(new TargetCreaturePermanent());
    this.addAbility(ability);
  }
View Full Code Here


        }
        applier.apply(this, permanent);

        Ability newAbility = source.copy();

        CopyEffect newEffect = new CopyEffect(duration, permanent, copyToPermanent.getId());
        newEffect.newId();
        newEffect.setTimestamp();
        newEffect.setApplier(applier);
        newEffect.init(newAbility, this);
       
        // handle copies of copies
        for (Effect effect : getState().getContinuousEffects().getLayeredEffects(this)) {
            if (effect instanceof CopyEffect) {
                CopyEffect copyEffect = (CopyEffect) effect;
                // there is another copy effect that our targetPermanent copies stats from
                if (copyEffect.getSourceId().equals(copyFromPermanent.getId())) {
                    MageObject object = ((CopyEffect) effect).getTarget();
                    if (object instanceof Permanent) {
                        // so we will use original card instead of target
                        Permanent original = (Permanent)object;
                        // copy it and apply changes we need
View Full Code Here

            target.setNotTarget(true);
            if (target.canChoose(source.getControllerId(), game)) {
                player.choose(outcome, target, source.getSourceId(), game);
                Card copyFromCard = game.getCard(target.getFirstTarget());
                if (copyFromCard != null) {
                    CopyEffect copyEffect = new CopyEffect(Duration.Custom, copyFromCard, source.getSourceId());
                    game.addEffect(copyEffect, source);
                }
            }
            return true;
        }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent copyFromPermanent = null;
        // retrieve the copied permanent of Progenitor Mimic
        for (Effect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) {
            if (effect instanceof CopyEffect) {
                CopyEffect copyEffect = (CopyEffect) effect;
                // take the exiting copy effect of Progenitor Mimic
                if (copyEffect.getSourceId().equals(source.getSourceId())) {
                    MageObject object = ((CopyEffect) effect).getTarget();
                    if (object instanceof Permanent) {
                        copyFromPermanent = (Permanent)object;
                    }
                }
View Full Code Here

                            player.moveCardToExileWithInfo(cardToCopy, null, "", source.getSourceId(), game, Zone.GRAVEYARD);
                            if (player.choose(Outcome.Copy, targetCounters, source.getSourceId(), game)) {
                                Card cardForCounters = game.getCard(targetCounters.getFirstTarget());
                                if (cardForCounters != null) {
                                    player.moveCardToExileWithInfo(cardForCounters, null, "", source.getSourceId(), game, Zone.GRAVEYARD);
                                    CopyEffect copyEffect = new CopyEffect(Duration.Custom, cardToCopy, source.getSourceId());
                                    game.addEffect(copyEffect, source);
                                    permanent.addCounters(CounterType.P1P1.createInstance(cardForCounters.getPower().getValue()), game);
                                    return true;
                                }
                            }
View Full Code Here

TOP

Related Classes of mage.abilities.effects.common.CopyEffect

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.