Package mage.abilities

Examples of mage.abilities.DelayedTriggeredAbility


                }               
                token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());

                ExileTargetEffect exileEffect = new ExileTargetEffect();
                exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
                DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
                delayedAbility.setSourceId(source.getSourceId());
                delayedAbility.setControllerId(source.getControllerId());
                game.addDelayedTriggeredAbility(delayedAbility);
            }

            return true;
        }
View Full Code Here


        }
        if (controller != null) {
            Effect effect = new DrawCardTargetEffect(new StaticValue(2), false, true);
            effect.setTargetPointer(new FixedTarget(controller.getId()));
            effect.setText("Its controller may draw up to two cards");
            DelayedTriggeredAbility ability = new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(effect);
            ability.setSourceId(source.getSourceId());
            ability.setControllerId(controller.getId());
            game.addDelayedTriggeredAbility(ability);
        }
        return countered;
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            Effect effect = new CreateTokenEffect(new HazezonTamarSandWarrior(), new PermanentsOnBattlefieldCount(new FilterControlledLandPermanent()));
            effect.setText("put X 1/1 Sand Warrior creature tokens that are red, green, and white onto the battlefield, where X is the number of lands you control at that time");
            DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(effect);
            delayedAbility.setSourceId(source.getSourceId());
            delayedAbility.setControllerId(source.getControllerId());
            game.addDelayedTriggeredAbility(delayedAbility);
            return true;
        }
        return false;
    }
View Full Code Here

        return new VirulentWoundEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        DelayedTriggeredAbility delayedAbility = new VirulentWoundDelayedTriggeredAbility(source.getFirstTarget());
        delayedAbility.setSourceId(source.getSourceId());
        delayedAbility.setControllerId(source.getControllerId());
        game.addDelayedTriggeredAbility(delayedAbility);
        return true;
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent creature = game.getPermanent(source.getFirstTarget());
        if (creature != null) {
            SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice boosted " + creature.getName());
            sacrificeEffect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
            DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
            delayedAbility.setSourceId(source.getSourceId());
            delayedAbility.setControllerId(source.getControllerId());
            game.addDelayedTriggeredAbility(delayedAbility);
            return true;
        }
        return false;
    }
View Full Code Here

        staticText = "When you cast that card this turn, {this} gains all activated abilities of that card until end of turn";
    }

    @Override
    public boolean apply(Game game, Ability source) {
        DelayedTriggeredAbility ability = new HavengulLichDelayedTriggeredAbility(targetPointer.getFirst(game, source));
        ability.setSourceId(source.getSourceId());
        ability.setControllerId(source.getControllerId());
        game.addDelayedTriggeredAbility(ability);
        return true;
    }
View Full Code Here

        return new RescueFromTheUnderworldCreateDelayedTriggeredAbilityEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        DelayedTriggeredAbility delayedAbility = (DelayedTriggeredAbility) ability.copy();
        delayedAbility.setSourceId(source.getSourceId());
        delayedAbility.setControllerId(source.getControllerId());
        delayedAbility.getTargets().addAll(source.getTargets());
        for(Effect effect : delayedAbility.getEffects()) {
            effect.getTargetPointer().init(game, source);
        }
        // add the sacrificed creature as target
        for (Cost cost :source.getCosts()) {
            if (cost instanceof SacrificeTargetCost) {
                SacrificeTargetCost sacCost = (SacrificeTargetCost) cost;
                TargetCardInGraveyard target = new TargetCardInGraveyard();
                for(Permanent permanent : sacCost.getPermanents()) {
                    target.add(permanent.getId(), game);
                    delayedAbility.getTargets().add(target);
                }
            }
        }

        game.addDelayedTriggeredAbility(delayedAbility);
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
        if (creature != null) {
            DelayedTriggeredAbility ability = new TimeToFeedDiesTriggeredAbility(creature.getId(), creature.getZoneChangeCounter());
            new CreateDelayedTriggeredAbilityEffect(ability, false).apply(game, source);
        }

        return true;
    }
View Full Code Here

            card.addAbility(HasteAbility.getInstance());
            card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());

            ExileTargetEffect exileEffect = new ExileTargetEffect();
            exileEffect.setTargetPointer(new FixedTarget(card.getId()));
            DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
            delayedAbility.setSourceId(source.getSourceId());
            delayedAbility.setControllerId(source.getControllerId());
            game.addDelayedTriggeredAbility(delayedAbility);

            return true;
        }
View Full Code Here

TOP

Related Classes of mage.abilities.DelayedTriggeredAbility

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.