* Renegade Doppelganger - Fixed a bug that the copy effect did not end at end of turn and the copy was permanently renewed.

This commit is contained in:
LevelX2 2013-06-15 09:43:01 +02:00
parent eeca9a66ca
commit fb0d9c0f9d
4 changed files with 41 additions and 23 deletions

View file

@ -50,7 +50,11 @@ public class CopyEffect extends ContinuousEffectImpl<CopyEffect> {
private UUID sourceId;
public CopyEffect(Permanent target, UUID sourceId) {
super(Duration.Custom, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature);
this(Duration.Custom, target, sourceId);
}
public CopyEffect(Duration duration, Permanent target, UUID sourceId) {
super(duration, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature);
this.target = target;
this.sourceId = sourceId;
}

View file

@ -65,6 +65,7 @@ import mage.util.functions.ApplyToPermanent;
import java.io.Serializable;
import java.util.*;
import mage.Constants.Duration;
public interface Game extends MageItem, Serializable {
@ -189,6 +190,8 @@ public interface Game extends MageItem, Serializable {
* @param applier
*/
Permanent copyPermanent(Permanent copyFromPermanent, Permanent copyToPermanent, Ability source, ApplyToPermanent applier);
Permanent copyPermanent(Duration duration, Permanent copyFromPermanent, Permanent copyToPermanent, Ability source, ApplyToPermanent applier);
Card copyCard(Card cardToCopy, Ability source, UUID newController);

View file

@ -997,6 +997,11 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
@Override
public Permanent copyPermanent(Permanent copyFromPermanent, Permanent copyToPermanent, Ability source, ApplyToPermanent applier) {
return copyPermanent(Duration.Custom, copyFromPermanent, copyToPermanent, source, applier);
}
@Override
public Permanent copyPermanent(Duration duration, Permanent copyFromPermanent, Permanent copyToPermanent, Ability source, ApplyToPermanent applier) {
Permanent permanent = copyFromPermanent.copy();
//getState().addCard(permanent);
@ -1009,7 +1014,7 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
Ability newAbility = source.copy();
CopyEffect newEffect = new CopyEffect(permanent, copyToPermanent.getId());
CopyEffect newEffect = new CopyEffect(duration, permanent, copyToPermanent.getId());
newEffect.newId();
newEffect.setTimestamp();
newEffect.init(newAbility, this);