Tabnine Logo
SacrificeTargetEffect.setTargetPointer
Code IndexAdd Tabnine to your IDE (free)

How to use
setTargetPointer
method
in
mage.abilities.effects.common.SacrificeTargetEffect

Best Java code snippets using mage.abilities.effects.common.SacrificeTargetEffect.setTargetPointer (Showing top 20 results out of 315)

origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    ThatcherHumanToken token = new ThatcherHumanToken();
    token.putOntoBattlefield(3, game, source.getSourceId(), source.getControllerId());
    List<Permanent> toSacrifice = new ArrayList<>();
    for (UUID tokenId : token.getLastAddedTokenIds()) {
      Permanent tokenPermanent = game.getPermanent(tokenId);
      if (tokenPermanent != null) {
        toSacrifice.add(tokenPermanent);
      }
    }
    SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect();
    sacrificeEffect.setTargetPointer(new FixedTargets(toSacrifice, game));
    game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect), source);
    return true;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent targetCreature = game.getPermanent(source.getFirstTarget());
    if (targetCreature != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId());
      sacrificeEffect.setTargetPointer(new FixedTarget(targetCreature, game));
      DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
      game.addDelayedTriggeredAbility(delayedAbility, source);
    }
    return true;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent sourcePermanent = game.getPermanent(source.getSourceId());
    if (sourcePermanent != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice {this}");
      sacrificeEffect.setTargetPointer(new FixedTarget(sourcePermanent.getId()));
      game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect), source);
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent targetCreature = game.getPermanent(source.getFirstTarget());
    if (targetCreature != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId());
      sacrificeEffect.setTargetPointer(new FixedTarget(targetCreature, game));
      DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
      game.addDelayedTriggeredAbility(delayedAbility, source);
    }
    return true;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId());
      sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
      DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
      game.addDelayedTriggeredAbility(delayedAbility, source);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId());
      sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
      DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
      game.addDelayedTriggeredAbility(delayedAbility, source);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
    if (permanent != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId());
      sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
      DelayedTriggeredAbility delayedAbility = new AngrathTheFlameChainedDelayedTriggeredAbility(sacrificeEffect);
      game.addDelayedTriggeredAbility(delayedAbility, source);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
    if (creature != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice boosted " + creature.getName(), source.getControllerId());
      sacrificeEffect.setTargetPointer(new FixedTarget(creature, game));
      DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
      game.addDelayedTriggeredAbility(delayedAbility, source);
    }
    return true;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent creature = game.getPermanent(source.getFirstTarget());
    if (creature != null) {
      SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice boosted " + creature.getName(), source.getControllerId());
      sacrificeEffect.setTargetPointer(new FixedTarget(creature, game));
      DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
      game.addDelayedTriggeredAbility(delayedAbility, source);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Token token = new TidalWaveWallToken();
    if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) {
      for (UUID tokenId : token.getLastAddedTokenIds()) {
        Permanent tokenPermanent = game.getPermanent(tokenId);
        if (tokenPermanent != null) {
          SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect();
          sacrificeEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
          game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect), source);
        }
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    CreateTokenEffect effect = new CreateTokenEffect(new BalduvianToken());
    effect.apply(game, source);
    for (UUID tokenId : effect.getLastAddedTokenIds()) {
      Permanent tokenPermanent = game.getPermanent(tokenId);
      if (tokenPermanent != null) {
        SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice the token at the beginning of the next end step", source.getControllerId());
        sacrificeEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
        DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
        game.addDelayedTriggeredAbility(delayedAbility, source);
      }
    }
    return true;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
    if (permanent != null) {
      CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, true);
      effect.setTargetPointer(new FixedTarget(permanent, game));
      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.getId()));
        game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect), source);
      }
      return true;
    }

    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Card card = game.getCard(getTargetPointer().getFirst(game, source));
    if (card != null) {
      CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(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;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Card card = game.getCard(this.getTargetPointer().getFirst(game, source));
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null && card != null) {
      if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
        Permanent creature = game.getPermanent(card.getId());
        if (creature != null) {
          // Gains haste
          ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
          effect.setTargetPointer(new FixedTarget(creature, game));
          game.addEffect(effect, source);

          // Sacrifice at beginning of next end step
          SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice the creature", source.getControllerId());
          sacrificeEffect.setTargetPointer(new FixedTarget(creature, game));
          DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
          game.addDelayedTriggeredAbility(delayedAbility, source);
        }
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Permanent permanent = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
  if (permanent != null) { 
    permanent.destroy(source.getSourceId(), game, true);
    CreateTokenEffect effect = new CreateTokenEffect(new BrokenVisageSpiritToken(permanent.getPower().getValue(), permanent.getToughness().getValue()));
    effect.apply(game, source);
    for (UUID tokenId : effect.getLastAddedTokenIds()) {
      Permanent tokenPermanent = game.getPermanent(tokenId);
      if (tokenPermanent != null) {
        SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice the token at the beginning of the next end step", source.getControllerId());
        sacrificeEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
        DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
        game.addDelayedTriggeredAbility(delayedAbility, source);
      }
    }
  }
  return true;
}
origin: magefree/mage

game.addEffect(effect, source);
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName(), source.getControllerId());
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
game.addDelayedTriggeredAbility(delayedAbility, source);
origin: magefree/mage

sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
game.addDelayedTriggeredAbility(delayedAbility, source);
origin: magefree/mage

sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
game.addDelayedTriggeredAbility(delayedAbility, source);
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      if (controller.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) {
        FilterCard filter = new FilterCreatureCard();
        filter.add(new SubtypePredicate((SubType.ELEMENTAL)));
        TargetCardInHand target = new TargetCardInHand(filter);
        if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
          Card card = game.getCard(target.getFirstTarget());
          if (card != null) {
            if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
              Permanent permanent = game.getPermanent(card.getId());
              if (permanent != null) {
                ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
                effect.setTargetPointer(new FixedTarget(permanent, game));
                game.addEffect(effect, source);
                SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName(), source.getControllerId());
                sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
                game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect), source);
              }
            }
          }
        }
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

game.addEffect(effect, source);
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("", source.getControllerId());
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
game.addDelayedTriggeredAbility(delayedAbility, source);
mage.abilities.effects.commonSacrificeTargetEffectsetTargetPointer

Popular methods of SacrificeTargetEffect

  • <init>

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSystemService (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Option (scala)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now