mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Revert "Fix copy effect and gain triggerAbility effect"
This reverts commit bfd3bcaf78
.
This commit is contained in:
parent
bfd3bcaf78
commit
814bb081a7
4 changed files with 4 additions and 42 deletions
|
@ -239,7 +239,7 @@ public class AbilitiesImpl<T extends Ability> extends ArrayList<T> 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<CopyEffect> {
|
|||
*/
|
||||
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<CopyEffect> {
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -852,7 +852,7 @@ public abstract class GameImpl<T extends GameImpl<T>> 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<T extends GameImpl<T>> implements Game, Serializa
|
|||
}
|
||||
}
|
||||
|
||||
state.addEffect(newEffect, copyToPermanent.getId(), newAbility);
|
||||
state.addEffect(newEffect, newAbility);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue