use of mage.abilities.effects.common.CreateTokenCopyTargetEffect in project mage by magefree.
the class HateMirageEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
source.getTargets().stream().map(Target::getTargets).flatMap(Collection::stream).forEach(uuid -> {
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, true);
effect.setTargetPointer(new FixedTarget(uuid, game));
effect.apply(game, source);
effect.exileTokensCreatedAtNextEndStep(game, source);
});
return true;
}
use of mage.abilities.effects.common.CreateTokenCopyTargetEffect in project mage by magefree.
the class KrothussLordOfTheDeepEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
int count = permanent.hasSubtype(SubType.KRAKEN, game) || permanent.hasSubtype(SubType.LEVIATHAN, game) || permanent.hasSubtype(SubType.OCTOPUS, game) || permanent.hasSubtype(SubType.SERPENT, game) ? 2 : 1;
return new CreateTokenCopyTargetEffect(null, null, false, count, true, true).apply(game, source);
}
use of mage.abilities.effects.common.CreateTokenCopyTargetEffect in project mage by magefree.
the class DollhouseOfHorrorsEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (card == null) {
return false;
}
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), CardType.ARTIFACT, false, 1, false, false, null, 0, 0, false);
effect.setSavedPermanent(new PermanentCard(card, source.getControllerId(), game));
effect.setAdditionalSubType(SubType.CONSTRUCT);
effect.addAdditionalAbilities(new SimpleStaticAbility(new BoostSourceEffect(ArtifactYouControlCount.instance, ArtifactYouControlCount.instance, Duration.WhileOnBattlefield).setText("This creature gets +1/+1 for each artifact you control")));
effect.apply(game, source);
game.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setTargetPointer(new FixedTargets(effect.getAddedPermanents(), game)), source);
return true;
}
use of mage.abilities.effects.common.CreateTokenCopyTargetEffect in project mage by magefree.
the class HeatShimmerEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
if (controller != null && permanent != null) {
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, true);
effect.setTargetPointer(new FixedTarget(permanent, game));
effect.apply(game, source);
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(effect.getAddedPermanents().get(0), game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
game.addDelayedTriggeredAbility(delayedAbility, source);
return true;
}
return false;
}
use of mage.abilities.effects.common.CreateTokenCopyTargetEffect in project mage by magefree.
the class RhysTheRedeemedEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) {
if (permanent.isControlledBy(source.getControllerId())) {
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect();
effect.setTargetPointer(new FixedTarget(permanent, game));
effect.apply(game, source);
}
}
return true;
}
return false;
}
Aggregations