use of mage.abilities.common.DiesCreatureTriggeredAbility in project mage by magefree.
the class CemeteryPucaEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent copyToCreature = game.getPermanent(source.getSourceId());
if (copyToCreature != null) {
Permanent copyFromCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
if (copyFromCreature != null) {
game.copyPermanent(Duration.WhileOnBattlefield, copyFromCreature, copyToCreature.getId(), source, new EmptyCopyApplier());
ContinuousEffect effect = new GainAbilityTargetEffect(new DiesCreatureTriggeredAbility(new DoIfCostPaid(new CemeteryPucaEffect(), new ManaCostsImpl("{1}")), false, StaticFilters.FILTER_PERMANENT_A_CREATURE, true), Duration.WhileOnBattlefield);
effect.setTargetPointer(new FixedTarget(copyToCreature.getId(), game));
game.addEffect(effect, source);
return true;
}
}
return false;
}
Aggregations