Package mage.abilities.common.delayed

Examples of mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility


        FixedTarget fixedTarget = new FixedTarget(token.getLastAddedToken());
        source.getEffects().get(1).setTargetPointer(fixedTarget);

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

        return true;
    }
View Full Code Here


        ElementalToken token = new ElementalToken();
        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

                        effect.setTargetPointer(new FixedTarget(permanent.getId()));
                        game.addEffect(effect, source);
                        // Exile it at end of turn
                        Effect exileEffect = new ExileTargetEffect(new StringBuilder("Exile ").append(permanent.getName()).append(" at the beginning of the next end step").toString());
                        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

            RedHumanToken token = new RedHumanToken();
            token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());

            SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this token");
            sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
            DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
            delayedAbility.setSourceId(source.getSourceId());
            delayedAbility.setControllerId(source.getControllerId());
            game.addDelayedTriggeredAbility(delayedAbility);
        }
        return true;
    }
View Full Code Here

            PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(null, CardType.ENCHANTMENT, true);
            effect.setTargetPointer(getTargetPointer());
            if (effect.apply(game, source) && effect.getAddedPermanent() != null) {
                ExileTargetEffect exileEffect = new ExileTargetEffect();
                exileEffect.setTargetPointer(new FixedTarget(effect.getAddedPermanent().getId()));
                DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
                delayedAbility.setSourceId(source.getSourceId());
                delayedAbility.setControllerId(source.getControllerId());
                game.addDelayedTriggeredAbility(delayedAbility);

                return true;
            }
        }
View Full Code Here

                    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);
                    delayedAbility.setSourceId(source.getSourceId());
                    delayedAbility.setControllerId(source.getControllerId());
                    game.addDelayedTriggeredAbility(delayedAbility);
                }
            }
            return true;
        }
View Full Code Here

                        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());
                        delayedAbility.setControllerId(source.getControllerId());
                        game.addDelayedTriggeredAbility(delayedAbility);
                        result = true;
                    }
                }
            }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getFirstTarget());
        if (permanent != null) {
            if (permanent.moveToExile(source.getSourceId(), "Mistmeadow Witch 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

        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            //create delayed triggered ability
            Effect effect = new BerserkDelayedDestroyEffect();
            effect.setTargetPointer(new FixedTarget(this.getTargetPointer().getFirst(game, source)));
            AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(effect);
            delayedAbility.setSourceId(source.getSourceId());
            delayedAbility.setControllerId(source.getControllerId());
            game.addDelayedTriggeredAbility(delayedAbility);
            return true;
        }
        return false;
    }
View Full Code Here

            for (int i = 0; i < power; i++) {
                ElementalToken token = new ElementalToken();
                token.putOntoBattlefield(1, game, creatureAttached.getId(), creatureAttached.getControllerId());
                ExileTargetEffect exileEffect = new ExileTargetEffect("exile the token");
                exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
                DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
                delayedAbility.setSourceId(creatureAttached.getId());
                delayedAbility.setControllerId(creatureAttached.getControllerId());
                game.addDelayedTriggeredAbility(delayedAbility);
            }
            return true;
        }
        return false;
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.