use of mage.target.targetpointer.FixedTargets in project mage by magefree.
the class ForceOfRageEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Token token = new AkoumStonewakerElementalToken();
token.putOntoBattlefield(2, game, source, source.getControllerId());
List<Permanent> permanentList = new ArrayList();
for (UUID permId : token.getLastAddedTokenIds()) {
permanentList.add(game.getPermanent(permId));
}
Effect effect = new SacrificeTargetEffect("sacrifice those tokens");
effect.setTargetPointer(new FixedTargets(permanentList, game));
game.addDelayedTriggeredAbility(new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(effect), source);
return true;
}
use of mage.target.targetpointer.FixedTargets in project mage by magefree.
the class GrimoireOfTheDeadEffect2 method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
Set<Card> creatureCards = new LinkedHashSet<>();
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
Player player = game.getPlayer(playerId);
if (player == null) {
continue;
}
creatureCards.addAll(player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game));
}
controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game);
game.addEffect(new GrimoireOfTheDeadEffect2().setTargetPointer(new FixedTargets(creatureCards, game)), source);
return true;
}
use of mage.target.targetpointer.FixedTargets in project mage by magefree.
the class HuntingWildsToken method apply.
@Override
public boolean apply(Game game, Ability source) {
for (Effect sourceEffect : source.getEffects()) {
if (sourceEffect instanceof SearchLibraryPutInPlayEffect) {
Cards foundCards = new CardsImpl(((SearchLibraryPutInPlayEffect) sourceEffect).getTargets());
if (!foundCards.isEmpty()) {
FixedTargets fixedTargets = new FixedTargets(foundCards, game);
UntapTargetEffect untapEffect = new UntapTargetEffect();
untapEffect.setTargetPointer(fixedTargets);
untapEffect.apply(game, source);
BecomesCreatureTargetEffect becomesCreatureEffect = new BecomesCreatureTargetEffect(new HuntingWildsToken(), false, true, Duration.Custom);
becomesCreatureEffect.setTargetPointer(fixedTargets);
game.addEffect(becomesCreatureEffect, source);
}
return true;
}
}
return false;
}
use of mage.target.targetpointer.FixedTargets in project mage by magefree.
the class HungryForMoreEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Token token = new HungryForMoreVampireToken();
token.putOntoBattlefield(1, game, source, source.getControllerId());
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeTargetEffect().setTargetPointer(new FixedTargets(token.getLastAddedTokenIds().stream().map(game::getPermanent).collect(Collectors.toList()), game)).setText("sacrifice that token")), source);
return true;
}
use of mage.target.targetpointer.FixedTargets in project mage by magefree.
the class NightcreepCreatureEffect method init.
@Override
public void init(Ability source, Game game) {
super.init(source, game);
List<Permanent> targets = new ArrayList<>(game.getBattlefield().getActivePermanents(StaticFilters.FILTER_LAND, source.getControllerId(), source.getSourceId(), game));
this.setTargetPointer(new FixedTargets(targets, game));
}
Aggregations