Beispiel #1
0
 @Override
 public boolean apply(Game game, Ability source) {
   DelayedTriggeredAbility delayedAbility =
       new ReincarnationDelayedTriggeredAbility(targetPointer.getFirst(game, source));
   game.addDelayedTriggeredAbility(delayedAbility, source);
   return true;
 }
  @Override
  public boolean apply(Game game, Ability source) {
    Card card = game.getCard(getTargetPointer().getFirst(game, source));
    if (card != null) {
      PutTokenOntoBattlefieldCopyTargetEffect effect =
          new PutTokenOntoBattlefieldCopyTargetEffect(
              source.getControllerId(), CardType.ARTIFACT, true);
      effect.setTargetPointer(
          new FixedTarget(card.getId(), game.getState().getZoneChangeCounter(card.getId())));
      effect.apply(game, source);
      for (Permanent addedToken : effect.getAddedPermanent()) {
        SacrificeTargetEffect sacrificeEffect =
            new SacrificeTargetEffect(
                "Sacrifice the token at the beginning of the next end step",
                source.getControllerId());
        sacrificeEffect.setTargetPointer(new FixedTarget(addedToken, game));
        DelayedTriggeredAbility delayedAbility =
            new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
        game.addDelayedTriggeredAbility(delayedAbility, source);
      }
      return true;
    }

    return false;
  }
 @Override
 public boolean apply(Game game, Ability source) {
   DelayedTriggeredAbility delayedAbility =
       new JaceArchitectOfThoughtDelayedTriggeredAbility(game.getTurnNum());
   game.addDelayedTriggeredAbility(delayedAbility, source);
   return true;
 }
Beispiel #4
0
 @Override
 public boolean apply(Game game, Ability source) {
   Permanent permanent = game.getPermanent(source.getFirstTarget());
   Player controller = game.getPlayer(source.getControllerId());
   Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
   if (controller != null && permanent != null && sourcePermanent != null) {
     CopyEffect copyEffect = new CopyEffect(Duration.EndOfTurn, permanent, source.getSourceId());
     if (controller.moveCardToExileWithInfo(
         permanent,
         source.getSourceId(),
         sourcePermanent.getIdName(),
         source.getSourceId(),
         game,
         Zone.BATTLEFIELD,
         true)) {
       // Copy exiled permanent
       game.addEffect(copyEffect, source);
       // Create delayed triggered ability
       AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility =
           new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
               new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, false));
       delayedAbility.setSourceId(source.getSourceId());
       delayedAbility.setControllerId(source.getControllerId());
       delayedAbility.setSourceObject(source.getSourceObject(game), game);
       game.addDelayedTriggeredAbility(delayedAbility);
       return true;
     }
   }
   return false;
 }
 @Override
 public boolean apply(Game game, Ability source) {
   DelayedTriggeredAbility delayedAbility =
       new SaffiEriksdotterDelayedTriggeredAbility(
           new FixedTarget(this.getTargetPointer().getFirst(game, source)));
   delayedAbility.setSourceId(source.getSourceId());
   delayedAbility.setControllerId(source.getControllerId());
   delayedAbility.setSourceObject(source.getSourceObject(game), game);
   game.addDelayedTriggeredAbility(delayedAbility);
   return false;
 }
Beispiel #6
0
 @Override
 public boolean apply(Game game, Ability source) {
   Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
   if (targetCreature != null) {
     AtTheEndOfCombatDelayedTriggeredAbility delayedAbility =
         new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect());
     delayedAbility.setSourceId(source.getSourceId());
     delayedAbility.setControllerId(source.getControllerId());
     delayedAbility.setSourceObject(source.getSourceObject(game), game);
     delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId()));
     game.addDelayedTriggeredAbility(delayedAbility);
     return true;
   }
   return false;
 }
 @Override
 public boolean apply(Game game, Ability source) {
   Permanent permanent = game.getPermanent(source.getSourceId());
   if (permanent != null) {
     if (permanent.moveToExile(
         source.getSourceId(), " Ghost Council of Orzhova Exile", source.getId(), 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;
 }
Beispiel #8
0
  @Override
  public boolean apply(Game game, Ability source) {
    Card card = game.getCard(source.getFirstTarget());
    if (card != null) {
      card.addAbility(HasteAbility.getInstance());
      card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), 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;
    }

    return false;
  }