Package mage.abilities.effects

Examples of mage.abilities.effects.Effect


    public UnblockableAbility() {
        this("");
    }

    public UnblockableAbility(String ruleText) {
        Effect effect = new UnblockableSourceEffect();
        if (ruleText != null && !ruleText.isEmpty()) {
            effect.setText(ruleText);
        }
        this.addEffect(effect);
    }
View Full Code Here


        Card cipherCard = game.getCard(cipherCardId);
        if (cipherCard != null) {
            Card copyCard = game.copyCard(cipherCard, source, controller.getId());
            SpellAbility ability = copyCard.getSpellAbility();
            // remove the cipher effect from the copy
            Effect cipherEffect = null;
            for (Effect effect :ability.getEffects()) {
                if (effect instanceof CipherEffect) {
                    cipherEffect = effect;
                }
            }
View Full Code Here

        this.color.setBlack(true);

        // Put target creature card from a graveyard onto the battlefield under your control. You lose life equal to its converted mana cost.
        getSpellAbility().addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard")));
        getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect())
        Effect effect = new LoseLifeSourceControllerEffect(new TargetConvertedManaCost());
        effect.setText("You lose life equal to its converted mana cost");
        getSpellAbility().addEffect(effect)
    }
View Full Code Here

        this.color.setGreen(true);
        this.power = new MageInt(3);
        this.toughness = new MageInt(3);

        // Whenever a land enters the battlefield under your control, put a 1/1 green Saproling creature token onto the battlefield.
        Effect effect = new CreateTokenEffect(new SaprolingToken());
        this.addAbility(new EntersBattlefieldControlledTriggeredAbility(effect, new FilterLandPermanent("a land")));
    }
View Full Code Here

    public SerratedArrows(UUID ownerId) {
        super(ownerId, 135, "Serrated Arrows", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{4}");
        this.expansionSetCode = "HML";

        // Serrated Arrows enters the battlefield with three arrowhead counters on it.
        Effect effect = new AddCountersSourceEffect(CounterType.ARROWHEAD.createInstance(4));
        effect.setText("with three arrowhead counters on it");
        this.addAbility(new EntersBattlefieldAbility(effect));
        // At the beginning of your upkeep, if there are no arrowhead counters on Serrated Arrows, sacrifice it.
        effect = new ConditionalOneShotEffect(new SacrificeSourceEffect(), new SourceHasCounterCondition(CounterType.ARROWHEAD, 0, 0),
                "if there are no arrowhead counters on {this}, sacrifice it");
        this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false, false));
View Full Code Here

        // Whenever you cast a creature spell, put a 3/3 green Beast creature token onto the battlefield.
        this.addAbility(new SpellCastControllerTriggeredAbility(new CreateTokenEffect(new BeastToken()), filterCreature, false));

        // Whenever you cast a noncreature spell, put three +1/+1 counters on target creature you control.
        Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(3));
        Ability ability = new SpellCastControllerTriggeredAbility(effect, filterNonCreature, false);
        ability.addTarget(new TargetControlledCreaturePermanent());
        this.addAbility(ability);

        // Whenever a land enters the battlefield under your control, you gain 3 life.
View Full Code Here

        this.toughness = new MageInt(1);

        // A deck can have any number of cards named Shadowborn Apostle.
        this.addInfo("rule", "A deck can have any number of cards named Shadowborn Apostle.");
        // {B}, Sacrifice six creatures named Shadowborn Apostle: Search your library for a Demon creature and put it onto the battlefield. Then shuffle your library.
        Effect effect = new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), false, true);
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{B}"));
        ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(6,6,filterApostle, false)));
        this.addAbility(ability);
    }
View Full Code Here

        this.color.setBlack(true);
        this.power = new MageInt(2);
        this.toughness = new MageInt(3);

        // Whenever you cast an enchantment spell, you may have target creature get -2/-2 until end of turn.
        Effect effect = new BoostTargetEffect(-2,-2, Duration.EndOfTurn);
        Ability ability = new SpellCastControllerTriggeredAbility(effect, filter, true);
        ability.addTarget(new TargetCreaturePermanent());
        this.addAbility(ability);

    }
View Full Code Here

        this.color.setBlack(true);
        this.power = new MageInt(1);
        this.toughness = new MageInt(1);

        // Whenever an artifact is put into a graveyard from the battlefield, you may have target opponent lose 1 life.
        Effect effect = new LoseLifeTargetEffect(1);
        effect.setText("you may have target opponent lose 1 life");
        Ability ability = new ZoneChangeAllTriggeredAbility(Zone.BATTLEFIELD, Zone.BATTLEFIELD, Zone.GRAVEYARD,
                effect, new FilterArtifactPermanent(),
                "Whenever an artifact is put into a graveyard from the battlefield, ", true);
        ability.addTarget(new TargetOpponent());
        this.addAbility(ability);
View Full Code Here

        this.color.setBlue(true);
        this.power = new MageInt(2);
        this.toughness = new MageInt(2);

        //Neurok Spy is unblockable as long as defending player controls an artifact.
        Effect effect = new ConditionalRestrictionEffect(
                new UnblockableSourceEffect(),
                new DefendingPlayerControlsCondition(new FilterArtifactPermanent()));
        effect.setText("{this} is unblockable as long as defending player controls an artifact");
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
    }
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.