}
applier.apply(this, permanent);
Ability newAbility = source.copy();
CopyEffect newEffect = new CopyEffect(duration, permanent, copyToPermanent.getId());
newEffect.newId();
newEffect.setTimestamp();
newEffect.setApplier(applier);
newEffect.init(newAbility, this);
// handle copies of copies
for (Effect effect : getState().getContinuousEffects().getLayeredEffects(this)) {
if (effect instanceof CopyEffect) {
CopyEffect copyEffect = (CopyEffect) effect;
// there is another copy effect that our targetPermanent copies stats from
if (copyEffect.getSourceId().equals(copyFromPermanent.getId())) {
MageObject object = ((CopyEffect) effect).getTarget();
if (object instanceof Permanent) {
// so we will use original card instead of target
Permanent original = (Permanent)object;
// copy it and apply changes we need