Package mage.abilities.common.delayed

Examples of mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility


    public boolean apply(Game game, Ability source) {
        StoneTrapIdolToken token = new StoneTrapIdolToken();
        token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
        ExileTargetEffect exileEffect = new ExileTargetEffect("exile the token");
        exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
        DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect, TargetController.YOU);
        delayedAbility.setSourceId(source.getSourceId());
        delayedAbility.setControllerId(source.getControllerId());
        game.addDelayedTriggeredAbility(delayedAbility);
       
        return true;
    }
View Full Code Here


        if (controller != null) {
            Permanent permanent = game.getPermanent(source.getSourceId());
            if (permanent != null) {
                if (controller.moveCardToExileWithInfo(permanent, source.getSourceId(), permanent.getName(), source.getSourceId(), game, Zone.BATTLEFIELD)) {
                    //create delayed triggered ability
                    AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(
                            new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
                    delayedAbility.setSourceId(source.getSourceId());
                    delayedAbility.setControllerId(source.getControllerId());
                    game.addDelayedTriggeredAbility(delayedAbility);
                }
            }
            return true;
        }
View Full Code Here

                token.addAbility(HasteAbility.getInstance());
                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

    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (permanent != null) {
            if (permanent.moveToExile(source.getSourceId(), "Argent Sphinx Exile", source.getSourceId(), game)) {
                //create delayed triggered ability
                AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
                delayedAbility.setSourceId(source.getSourceId());
                delayedAbility.setControllerId(source.getControllerId());
                game.addDelayedTriggeredAbility(delayedAbility);
                return true;
            }
        }
        return false;
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Card card = game.getCard(this.getTargetPointer().getFirst(game, source));
        if (card != null) {
            Effect effect = new ReturnToBattlefieldUnderYourControlTargetEffect();
            effect.setText("return that card to the battlefield under your control at the beginning of the next end step");
            DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(effect);
            delayedAbility.setSourceId(source.getSourceId());
            delayedAbility.setControllerId(source.getControllerId());
            delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(card.getId()));
            game.addDelayedTriggeredAbility(delayedAbility);
            return true;
        }
        return false;
    }
View Full Code Here

                                ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
                                effect.setTargetPointer(new FixedTarget(permanent.getId()));
                                game.addEffect(effect, source);
                                SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName());
                                sacrificeEffect.setTargetPointer(new FixedTarget(card.getId()));
                                DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
                                delayedAbility.setSourceId(source.getSourceId());
                                delayedAbility.setControllerId(source.getControllerId());
                                game.addDelayedTriggeredAbility(delayedAbility);
                                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

                Zone currentZone = game.getState().getZone(card.getId());
                if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), card.getOwnerId())) {
                    //create delayed triggered ability
                    Effect effect = new GiftOfImmortalityReturnEnchantmentEffect();
                    effect.setTargetPointer(new FixedTarget(card.getId()));
                    AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(effect);
                    delayedAbility.setSourceId(source.getSourceId());
                    delayedAbility.setControllerId(source.getControllerId());
                    game.addDelayedTriggeredAbility(delayedAbility);
                }
                return true;
            }
        }
View Full Code Here

                    Effect effect = new GraveBetrayalEffect();
                    effect.setTargetPointer(new FixedTarget(card.getId()));
                    Integer zoneChanges = new Integer(card.getZoneChangeCounter());
                    effect.setValue("zoneChanges", zoneChanges);

                    DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(effect);
                    delayedAbility.setSourceId(this.getSourceId());
                    delayedAbility.setControllerId(this.getControllerId());
                    game.addDelayedTriggeredAbility(delayedAbility);
                    return true;
                }
            }
        }
View Full Code Here

        // {3}, {tap}: Target creature you control gets +2/+2 until end of turn. Return it to its owner's hand at the beginning of the next end step.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new GenericManaCost(3));
        ability.addCost(new TapSourceCost());
        ability.addTarget(new TargetControlledCreaturePermanent());
        Effect returnEffect = new CreateDelayedTriggeredAbilityEffect(new AtEndOfTurnDelayedTriggeredAbility(new ReturnToHandTargetEffect()));
        returnEffect.setText("Return it to its owner's hand at the beginning of the next end step");
        ability.addEffect(returnEffect);
        this.addAbility(ability);
    }
View Full Code Here

TOP

Related Classes of mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility

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.