Package mage.abilities.effects

Examples of mage.abilities.effects.Effect


        // Any player may play creature cards with converted mana cost 3 or less without paying their mana cost
        Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new AlurenRuleEffect());
        // and as though they had flash.
        // TODO: This as thought effect may only be used if the creature is cast by the aluren effect
        Effect effect = new CastAsThoughItHadFlashEffect(Duration.WhileOnBattlefield, filter, true);
        effect.setText("and as though they had flash");
        ability.addEffect(effect);
        this.addAbility(ability);
    }
View Full Code Here


    }

    @Override
    public void addEffect(Effect effect) {
        if (!getEffects().isEmpty()) {
            Effect entersEffect = this.getEffects().get(0);
            if (entersEffect instanceof EntersBattlefieldEffect) {
                ((EntersBattlefieldEffect) entersEffect).addEffect(effect);
                return;
            }
        }
View Full Code Here

        // Target opponent loses half his or her life, rounded up.
        this.getSpellAbility().addTarget(new TargetOpponent());
        this.getSpellAbility().addEffect(new BloodTributeLoseLifeEffect());
        
        // If Blood Tribute was kicked, you gain life equal to the life lost this way.
        Effect effect = new ConditionalOneShotEffect(
                new BloodTributeGainLifeEffect(),
                KickedCondition.getInstance(),
                "If Blood Tribute was kicked, you gain life equal to the life lost this way");
        this.getSpellAbility().addEffect(effect);
    }
View Full Code Here

            Spell spell = (Spell) stackObject;
            spell = spell.copySpell();
            spell.setCopiedSpell(true);
            spell.setControllerId(source.getControllerId());
            // Remove Epic effect from the spell
            Effect epicEffect = null;
            for (Effect effect : spell.getSpellAbility().getEffects()) {
                if (effect instanceof EpicEffect) {
                    epicEffect = effect;
                    break;
                }
View Full Code Here

            if (target.canChoose(source.getControllerId(), game)) {
                player.choose(Outcome.Copy, target, source.getSourceId(), game);
                Permanent tokenToCopy = game.getPermanent(target.getFirstTarget());
                if (tokenToCopy != null) {
                    game.informPlayers("Token selected for populate: " + tokenToCopy.getLogName());
                    Effect effect = new PutTokenOntoBattlefieldCopyTargetEffect();
                    effect.setTargetPointer(new FixedTarget(target.getFirstTarget()));
                    return effect.apply(game, source);
                }
            }
        }
        return false;
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Card card = game.getCard(source.getSourceId());
        if (card != null) {
            int count = card.getPower().getValue();
            if (count > 0) {
                Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(count));
                effect.setTargetPointer(getTargetPointer());
                return effect.apply(game, source);
            }
        }

        return false;
    }
View Full Code Here

        // For as long as that land has a blaze counter on it, it has "At the beginning
        // of your upkeep, this land deals 1 damage to you." (The land continues to burn
        // after Obsidian Fireheart has left the battlefield.)
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.BLAZE.createInstance()),new ManaCostsImpl("{1}{R}{R}"));
        ability.addTarget(new TargetLandPermanent(filter));
        Effect effect = new ObsidianFireheartGainAbilityEffect(
                new BeginningOfUpkeepTriggeredAbility(
                    new DamageControllerEffect(1),
                    TargetController.YOU,
                    false),
                Duration.Custom, rule);
View Full Code Here

        this.expansionSetCode = "ZEN";

        // Creatures you control get +1/+1, have flying, and are indestructible.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false)));
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent())));
        Effect effect = new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent("Creatures you control"), false);
        effect.setText("Creatures you control are indestructible");
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
        // At the beginning of your upkeep, sacrifice a creature. If you can't, sacrifice Eldrazi Monument.
        this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new EldraziMonumentEffect()));
    }
View Full Code Here

        this.expansionSetCode = "EXO";

        this.color.setWhite(true);

        // At the beginning of each player's upkeep, that player chooses target player who controls more lands than he or she does and is his or her opponent. The first player may search his or her library for a basic land card, put that card onto the battlefield, then shuffle his or her library.
        Effect effect = new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterBasicLandCard()), false, Outcome.PutLandInPlay);
        effect.setText("that player chooses target player who controls more lands than he or she does and is his or her opponent. The first player may search his or her library for a basic land card, put that card onto the battlefield, then shuffle his or her library");
        Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, true);
        ability.addTarget(new TargetPlayer(1, 1, false, filter));
        this.addAbility(ability);
    }
View Full Code Here

        //Only 'install' the effect on a successfully cast spell otherwise the user
        //may cancel before paying its costs and potentially having two copies rebound
        if (event.getType() == EventType.SPELL_CAST && this.installReboundEffect) {
            Spell spell = game.getStack().getSpell(event.getTargetId());
            if (spell != null && spell.getSourceId().equals(this.getSourceId())) {
                Effect reboundEffect = new ReboundEffect();
                boolean found = false;
                for (Effect effect : spell.getSpellAbility().getEffects()) {
                    if (effect instanceof ReboundEffect) {
                        found = true;
                        break;
View Full Code Here

TOP

Related Classes of mage.abilities.effects.Effect

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.