Added Copy Enchantment.

This commit is contained in:
LevelX2 2014-08-06 12:21:05 +02:00
parent 336a6546dc
commit 6776b03bae

View file

@ -48,12 +48,13 @@ public class CopyPermanentEffect extends OneShotEffect {
private FilterPermanent filter;
private ApplyToPermanent applier;
private Permanent bluePrintPermanent;
public CopyPermanentEffect() {
this(new FilterCreaturePermanent());
}
public CopyPermanentEffect() {
this(new FilterCreaturePermanent());
}
public CopyPermanentEffect(ApplyToPermanent applier) {
public CopyPermanentEffect(ApplyToPermanent applier) {
this(new FilterCreaturePermanent(), applier);
}
@ -72,6 +73,7 @@ public class CopyPermanentEffect extends OneShotEffect {
super(effect);
this.filter = effect.filter.copy();
this.applier = effect.applier;
this.bluePrintPermanent = effect.bluePrintPermanent;
}
@Override
@ -84,8 +86,7 @@ public class CopyPermanentEffect extends OneShotEffect {
player.choose(Outcome.Copy, target, source.getSourceId(), game);
Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget());
if (copyFromPermanent != null) {
game.copyPermanent(copyFromPermanent, sourcePermanent, source, applier);
bluePrintPermanent = game.copyPermanent(copyFromPermanent, sourcePermanent, source, applier);
return true;
}
}
@ -93,6 +94,10 @@ public class CopyPermanentEffect extends OneShotEffect {
return false;
}
public Permanent getBluePrintPermanent() {
return bluePrintPermanent;
}
@Override
public CopyPermanentEffect copy() {
return new CopyPermanentEffect(this);