From 814bb081a74057d1719a29842151eec7946af06e Mon Sep 17 00:00:00 2001 From: Plopman Date: Mon, 19 Nov 2012 11:38:05 +0100 Subject: [PATCH] Revert "Fix copy effect and gain triggerAbility effect" This reverts commit bfd3bcaf7865c01ca94ed050f08400b3c15452c4. --- Mage/src/mage/abilities/AbilitiesImpl.java | 2 +- .../abilities/effects/ContinuousEffects.java | 7 ---- .../abilities/effects/common/CopyEffect.java | 33 +------------------ Mage/src/mage/game/GameImpl.java | 4 +-- 4 files changed, 4 insertions(+), 42 deletions(-) diff --git a/Mage/src/mage/abilities/AbilitiesImpl.java b/Mage/src/mage/abilities/AbilitiesImpl.java index 7a678196c37..b557cc3f970 100644 --- a/Mage/src/mage/abilities/AbilitiesImpl.java +++ b/Mage/src/mage/abilities/AbilitiesImpl.java @@ -239,7 +239,7 @@ public class AbilitiesImpl extends ArrayList implements Ab @Override public boolean contains(T ability) { for (T test: this) { - if (ability.getId().equals(test.getId())/* || ability.getRule().equals(test.getRule())*/) { + if (ability.getId().equals(test.getId()) || ability.getRule().equals(test.getRule())) { return true; } } diff --git a/Mage/src/mage/abilities/effects/ContinuousEffects.java b/Mage/src/mage/abilities/effects/ContinuousEffects.java index 09e813879ad..998e33847f7 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffects.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffects.java @@ -371,10 +371,6 @@ public class ContinuousEffects implements Serializable { for (ContinuousEffect effect: layer) { effect.apply(Layer.CopyEffects_1, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); } - - //Reload layerEffect - layerEffects = getLayeredEffects(game); - layer = filterLayeredEffects(layerEffects, Layer.ControlChangingEffects_2); for (ContinuousEffect effect: layer) { effect.apply(Layer.ControlChangingEffects_2, SubLayer.NA, layeredEffects.getAbility(effect.getId()), game); @@ -399,9 +395,6 @@ public class ContinuousEffects implements Serializable { } } - //Reload layerEffect - layerEffects = getLayeredEffects(game); - layer = filterLayeredEffects(layerEffects, Layer.PTChangingEffects_7); for (ContinuousEffect effect: layer) { effect.apply(Layer.PTChangingEffects_7, SubLayer.SetPT_7b, layeredEffects.getAbility(effect.getId()), game); diff --git a/Mage/src/mage/abilities/effects/common/CopyEffect.java b/Mage/src/mage/abilities/effects/common/CopyEffect.java index 3429ed6e8be..c688b4c45dc 100644 --- a/Mage/src/mage/abilities/effects/common/CopyEffect.java +++ b/Mage/src/mage/abilities/effects/common/CopyEffect.java @@ -36,7 +36,6 @@ import mage.game.Game; import mage.game.permanent.Permanent; import java.util.UUID; -import mage.cards.Card; /** * @@ -49,36 +48,19 @@ public class CopyEffect extends ContinuousEffectImpl { */ private MageObject target; private UUID sourceId; - private int zoneChangeCounter; public CopyEffect(Permanent target, UUID sourceId) { - super(Duration.Custom, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature); + super(Duration.WhileOnBattlefield, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature); this.target = target; this.sourceId = sourceId; - this.zoneChangeCounter = 0; } public CopyEffect(final CopyEffect effect) { super(effect); this.target = effect.target.copy(); this.sourceId = effect.sourceId; - this.zoneChangeCounter = effect.zoneChangeCounter; } - @Override - public void init(Ability source, Game game) { - super.init(source, game); - Permanent permanent = game.getPermanent(this.sourceId); - if(permanent != null) { - Card card = game.getCard(this.sourceId); - if(card != null) - { - this.zoneChangeCounter = card.getZoneChangeCounter(); - } - } - } - - @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(this.sourceId); @@ -133,17 +115,4 @@ public class CopyEffect extends ContinuousEffectImpl { public UUID getSourceId() { return sourceId; } - - @Override - public boolean isInactive(Ability source, Game game) { - Permanent permanent = game.getPermanent(this.sourceId); - if(permanent != null) { - Card card = game.getCard(this.sourceId); - if(card != null) - { - return this.zoneChangeCounter != card.getZoneChangeCounter(); - } - } - return true; - } } diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index a7b6333fbbd..f18c422cf9a 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -852,7 +852,7 @@ public abstract class GameImpl> implements Game, Serializa if (effect instanceof CopyEffect) { CopyEffect copyEffect = (CopyEffect) effect; // there is another copy effect that our targetPermanent copies stats from - if (!copyEffect.isInactive(null, this) && copyEffect.getSourceId().equals(copyFromPermanent.getId())) { + if (copyEffect.getSourceId().equals(copyFromPermanent.getId())) { MageObject object = ((CopyEffect) effect).getTarget(); if (object instanceof Permanent) { // so we will use original card instead of target @@ -866,7 +866,7 @@ public abstract class GameImpl> implements Game, Serializa } } - state.addEffect(newEffect, copyToPermanent.getId(), newAbility); + state.addEffect(newEffect, newAbility); } @Override