Package mage.abilities.effects.common.continious

Examples of mage.abilities.effects.common.continious.GainAbilityTargetEffect


            }
            if (lastCreatureCard != null) {
                if (controller.putOntoBattlefieldWithInfo(lastCreatureCard, game, Zone.GRAVEYARD, source.getSourceId())) {
                    FixedTarget fixedTarget = new FixedTarget(lastCreatureCard.getId());
                    // Gains Haste
                    ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
                    hasteEffect.setTargetPointer(fixedTarget);
                    game.addEffect(hasteEffect, source);
                    // Exile it at end of turn
                    ExileTargetEffect exileEffect = new ExileTargetEffect(null,"",Zone.BATTLEFIELD);
                    exileEffect.setTargetPointer(fixedTarget);
                    DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
View Full Code Here


       
        // Any number of target creatures each get +1/+1 and gain indestructible until end of turn.
        Effect effect = new BoostTargetEffect(1,1,Duration.EndOfTurn);
        effect.setText("Any number of target creatures each get +1/+1");
        this.getSpellAbility().addEffect(effect);
        effect = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn);
        effect.setText("and gain indestructible until end of turn");
        this.getSpellAbility().addEffect(effect);
        this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE));
    }
View Full Code Here

        // Target creature you control gets +1/+1 and gains hexproof until end of turn.
        this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
        Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn);
        effect.setText("Target creature you control gets +1/+1");
        this.getSpellAbility().addEffect(effect);
        effect = new GainAbilityTargetEffect(HexproofAbility.getInstance(), Duration.EndOfTurn);
        effect.setText("and gains hexproof until end of turn");
        this.getSpellAbility().addEffect(effect);
    }
View Full Code Here

    public GarrukApexPredatorEmblem() {
        setName("EMBLEM: Garruk, Apex Predator");
        Effect effect = new BoostTargetEffect(5,5,Duration.EndOfTurn);
        effect.setText("it gets +5/+5");
        Ability ability = new AttackedByCreatureTriggeredAbility(Zone.COMMAND, effect, false, true);
        effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn,
                "and gains trample until end of turn");
        ability.addEffect(effect);
        this.getAbilities().add(ability);
    }
View Full Code Here

        // At the beginning of combat on your turn, if you control each creature on the battlefield with the greatest power, gain control
        // of target creature an opponent controls until end of turn. Untap that creature. It gains haste until end of turn.
        TriggeredAbility gainControlAbility = new BeginningOfCombatTriggeredAbility(new GainControlTargetEffect(Duration.EndOfTurn), TargetController.YOU, false);
        gainControlAbility.addEffect(new UntapTargetEffect());
        gainControlAbility.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn));
        gainControlAbility.addTarget(new TargetCreaturePermanent(filter));
        Ability conditionalAbility = new ConditionalTriggeredAbility(gainControlAbility, ControlsEachCreatureWithGreatestPowerCondition.getInstance(), ruleText);
        this.addAbility(conditionalAbility);
    }
View Full Code Here

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

        // Sacrifice an artifact: Target artifact is indestructible this turn.
        Effect effect = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn);
        effect.setText("Target artifact is indestructible this turn");
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
                effect, new SacrificeTargetCost(new TargetControlledPermanent(filterControlled)));
        ability.addTarget(new TargetPermanent(filter));
        this.addAbility(ability);
    }
View Full Code Here

            Player you = game.getPlayer(source.getControllerId());
            if (you != null) {
                if (you.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId())) {
                    Permanent permanent = game.getPermanent(card.getId());
                    if (permanent != null) {
                        ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
                        hasteEffect.setTargetPointer(new FixedTarget(permanent.getId()));
                        game.addEffect(hasteEffect, source);
                        ExileTargetEffect exileEffect = new ExileTargetEffect(new StringBuilder("exile ").append(permanent.getName()).toString());
                        exileEffect.setTargetPointer(new FixedTarget(card.getId()));
                        DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect, TargetController.YOU);
                        delayedAbility.setSourceId(source.getSourceId());
View Full Code Here

                new ConditionalContinousEffect(new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield),
                new PermanentsOnTheBattlefieldCondition(filter), rule)));

        // {1}{B}: Target creature gains lifelink until end of turn.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
                new GainAbilityTargetEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{1}{B}"));
        ability.addTarget(new TargetCreaturePermanent());
        this.addAbility(ability);

    }
View Full Code Here

        // Other red creatures you control get +1/+1.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filterCreatures, true)));
       
        // {R}, {T}: Another target red creature you control gains haste until end of turn.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{R}"));
        ability.addCost(new TapSourceCost());
        ability.addTarget(new TargetControlledCreaturePermanent(filterCreature));
        this.addAbility(ability);
    }
View Full Code Here

            Permanent blockingCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
            if (blockingCreature != null) {
                for (CombatGroup combatGroup : game.getCombat().getGroups()) {
                    if (combatGroup.getBlockers().contains(blockingCreature.getId())) {
                        for (UUID attackerId: combatGroup.getAttackers()) {
                            ContinuousEffect effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);
                            effect.setTargetPointer(new FixedTarget(attackerId));
                            game.addEffect(effect, source);
                        }
                        break;
                    }
                }
View Full Code Here

TOP

Related Classes of mage.abilities.effects.common.continious.GainAbilityTargetEffect

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.