Search in sources :

Example 1 with EntersBattlefieldAllTriggeredAbility

use of mage.abilities.common.EntersBattlefieldAllTriggeredAbility in project mage by magefree.

the class UnstableShapeshifterEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getSourceId());
    Permanent targetCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
    if (targetCreature != null && permanent != null) {
        Permanent blueprintPermanent = game.copyPermanent(Duration.Custom, targetCreature, permanent.getId(), source, new EmptyCopyApplier());
        blueprintPermanent.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new UnstableShapeshifterEffect(), filterAnotherCreature, false, SetTargetPointer.PERMANENT, ""), source.getSourceId(), game);
        return true;
    }
    return false;
}
Also used : Permanent(mage.game.permanent.Permanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) EmptyCopyApplier(mage.util.functions.EmptyCopyApplier) EntersBattlefieldAllTriggeredAbility(mage.abilities.common.EntersBattlefieldAllTriggeredAbility)

Aggregations

EntersBattlefieldAllTriggeredAbility (mage.abilities.common.EntersBattlefieldAllTriggeredAbility)1 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)1 Permanent (mage.game.permanent.Permanent)1 EmptyCopyApplier (mage.util.functions.EmptyCopyApplier)1