Package mage.abilities

Examples of mage.abilities.DelayedTriggeredAbility


    state.addTriggeredAbility(newAbility);
  }
 
  @Override
  public void addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility) {
    DelayedTriggeredAbility newAbility = (DelayedTriggeredAbility) delayedAbility.copy();
    newAbility.newId();
    state.addDelayedTriggeredAbility(newAbility);
  }
View Full Code Here


    return new CreateDelayedTriggeredAbilityEffect(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());
    game.addDelayedTriggeredAbility(delayedAbility);
    return true;
  }
View Full Code Here

        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

                    epicEffect = effect;
                    break;
                }
            }
            spell.getSpellAbility().getEffects().remove(epicEffect);
            DelayedTriggeredAbility ability = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(new EpicPushEffect(spell, rule), Duration.EndOfGame, false);
            ability.setSourceId(source.getSourceId());
            ability.setControllerId(source.getControllerId());
            game.addDelayedTriggeredAbility(ability);
            game.addEffect(new EpicReplacementEffect(), source);
            return true;
        }
        return false;
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

        return new CreateDelayedTriggeredAbilityEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        DelayedTriggeredAbility delayedAbility = ability.copy();
        delayedAbility.setSourceId(source.getSourceId());
        delayedAbility.setControllerId(source.getControllerId());
        if (this.copyTargets) {
            delayedAbility.getTargets().addAll(source.getTargets());
            for(Effect effect : delayedAbility.getEffects()) {
                effect.getTargetPointer().init(game, source);
            }
        }
        game.addDelayedTriggeredAbility(delayedAbility);
        return true;
View Full Code Here

            Player player = game.getPlayer(playerId);
            if (!player.hasLeft()&& !player.hasLost()) {
                player.setGameUnderYourControl(false);
                player.setTurnControlledBy(this.getId());
            }
            DelayedTriggeredAbility ability = new AtTheEndOfTurnStepPostDelayedTriggeredAbility(new LoseControlOnOtherPlayersControllerEffect());
            ability.setSourceId(getId());
            ability.setControllerId(getId());
            game.addDelayedTriggeredAbility(ability);
        }
    }
View Full Code Here

        }
    }

    @Override
    public void addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility) {
        DelayedTriggeredAbility newAbility = delayedAbility.copy();
        newAbility.newId();
        newAbility.init(this);
        state.addDelayedTriggeredAbility(newAbility);
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        CreateTokenEffect effect =  new CreateTokenEffect(new TatsumaDragonToken());
        effect.apply(game, source);
        FixedTarget fixedTarget = new FixedTarget(effect.getLastAddedTokenId());
        DelayedTriggeredAbility delayedAbility = new TatsumaTheDragonsFangTriggeredAbility(fixedTarget);
        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

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.