Package mage.abilities.effects

Examples of mage.abilities.effects.ContinuousEffect


    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            if (FerociousCondition.getInstance().apply(game, source)) {
                ContinuousEffect effect = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn);
                effect.setTargetPointer(getTargetPointer());
                game.addEffect(effect, source);
            }
            return true;
        }
        return false;
View Full Code Here


        // {tap}: Add {1} to your mana pool.
        this.addAbility(new ColorlessManaAbility());
        // As long as Riftstone Portal is in your graveyard, lands you control have "{tap}: Add {G} or {W} to your mana pool."
        ContinuousEffect effect = new GainAbilityControlledEffect(new GreenManaAbility(),
                Duration.WhileOnBattlefield, new FilterControlledLandPermanent());
        effect.setText("As long as Riftstone Portal is in your graveyard, lands you control have \"{tap}: Add {G} or {W} to your mana pool.\"");
        Ability ability = new SimpleStaticAbility(Zone.GRAVEYARD, effect);
        effect = new GainAbilityControlledEffect(new WhiteManaAbility(),
                Duration.WhileOnBattlefield, new FilterControlledLandPermanent());
        effect.setText("");
        ability.addEffect(effect);
        this.addAbility(ability);
    }
View Full Code Here

        // Trample
        this.addAbility(TrampleAbility.getInstance());

        // As long as Brawn is in your graveyard and you control a Forest, creatures you control have trample
        ContinuousEffect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(),
                Duration.WhileOnBattlefield, new FilterCreaturePermanent());
        ConditionalContinousEffect brawnEffect = new ConditionalContinousEffect(effect,
                new PermanentsOnTheBattlefieldCondition(filter), ruleText);
        this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, brawnEffect));
    }
View Full Code Here

        Player controller = game.getPlayer(source.getControllerId());
        String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
        if (controller != null && cardName != null && !cardName.isEmpty()) {           
            FilterObject filter = new FilterObject("the name [" + cardName + "]");
            filter.add(new NamePredicate(cardName));           
            ContinuousEffect effect = new GainAbilityControllerEffect(new ProtectionAbility(filter), Duration.Custom);
            game.addEffect(effect, source);
            return true;
        }
        return false;
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Card card = game.getCard(targetPointer.getFirst(game, source));
        if (card != null) {
            Zone currentZone = game.getState().getZone(card.getId());
            if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId())) {
                ContinuousEffect effect = new DreadSlaverContiniousEffect();
                effect.setTargetPointer(new FixedTarget(card.getId()));
                game.addEffect(effect, source);
                return true;
            }
        }
        return false;
View Full Code Here

    }

    @Override
    public boolean apply(Game game, Ability source) {
        boolean result = false;
        ContinuousEffect gainControl = new GainControlTargetEffect(Duration.EndOfTurn);
        ContinuousEffect gainHaste = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
        for (Permanent creature : game.getBattlefield().getAllActivePermanents(CardType.CREATURE)) {
            creature.untap(game);
            gainControl.setTargetPointer(new FixedTarget(creature.getId()));
            gainHaste.setTargetPointer(new FixedTarget(creature.getId()));
            game.addEffect(gainControl, source);
            game.addEffect(gainHaste, source);
            result = true;
        }
        return result;
View Full Code Here

            Library library = controller.getLibrary();
            Card card = library.removeFromTop(game);
            if (card != null) {
                String exileName = new StringBuilder(sourcePermanent.getName()).append(" <this card may be played the turn it was exiled>").toString();
                controller.moveCardToExileWithInfo(card, source.getSourceId(), exileName, source.getSourceId(), game, Zone.LIBRARY);
                ContinuousEffect effect = new PropheticFlamespeakerCastFromExileEffect();
                effect.setTargetPointer(new FixedTarget(card.getId()));
                game.addEffect(effect, source);
            }
            return true;
        }
        return false;
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getFirstTarget());
        if (player != null) {
            for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) {
                ContinuousEffect effect = new SkipNextUntapTargetEffect();
                effect.setTargetPointer(new FixedTarget(permanent.getId()));
                game.addEffect(effect, source);                     
            }
            return true;
        }
        return false;
View Full Code Here

        if (controller.searchLibrary(target, game, damagedPlayer.getId())) {
            if (target.getTargets().size() > 0) {
                Card card = damagedPlayer.getLibrary().remove(target.getFirstTarget(), game);
                if (card != null) {
                    controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getLogName(), source.getSourceId(), game, Zone.LIBRARY);
                    ContinuousEffect effect = new ThadaAdelPlayFromExileEffect();
                    effect.setTargetPointer(new FixedTarget(card.getId()));
                    game.addEffect(effect, source);
                }
            }
        }
        damagedPlayer.shuffleLibrary(game);
View Full Code Here

            // and chooses new targets
            spell.chooseNewTargets(game, controller.getId());
            game.informPlayers(new StringBuilder(controller.getName()).append(" got control of ").append(spell.getName()).append(" spell.").toString());
            // and spell controller get control of Perplexing Chimera
            if (spellCaster != null) {
                ContinuousEffect effect = new PerplexingChimeraControlEffect();
                effect.setTargetPointer(new FixedTarget(spellCaster.getId()));
                game.addEffect(effect, source);
            }
        }

        return false;
View Full Code Here

TOP

Related Classes of mage.abilities.effects.ContinuousEffect

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.