[FRF] Fixed ETB replacement and triggered abilities for manifested cards.

This commit is contained in:
LevelX2 2015-01-17 15:30:00 +01:00
parent 5b04f40a66
commit 79ceae999a
5 changed files with 88 additions and 2 deletions

View file

@ -410,6 +410,13 @@ public class ContinuousEffects implements Serializable {
exists = permanent.getCard().getAbilities().contains(ability);
}
}
} else {
if (object instanceof PermanentCard) {
PermanentCard permanent = (PermanentCard)object;
if (permanent.isFaceDown() && !ability.getWorksFaceDown()) {
return false;
}
}
}
return exists;
}

View file

@ -62,6 +62,7 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen
protected int zoneChangeCounter;
protected Ability turnFaceUpAbility = null;
protected boolean useTargetPointer;
protected boolean foundPermanent;
public BecomesFaceDownCreatureEffect(Costs<Cost> morphCosts) {
@ -84,6 +85,7 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen
this.turnFaceUpAbility = new TurnFaceUpAbility(morphCosts);
}
staticText = "{this} becomes a 2/2 face-down creature, with no text, no name, no subtypes, and no mana cost";
foundPermanent = false;
}
@ -94,6 +96,7 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen
this.turnFaceUpAbility = effect.turnFaceUpAbility.copy();
}
this.useTargetPointer = effect.useTargetPointer;
this.foundPermanent = effect.foundPermanent;
}
@Override
@ -120,6 +123,7 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen
}
if (permanent != null && permanent.isFaceDown()) {
foundPermanent = true;
switch (layer) {
case TypeChangingEffects_4:
permanent.setName("");
@ -164,7 +168,7 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen
}
}
} else {
if (duration.equals(Duration.Custom)) {
if (duration.equals(Duration.Custom) && foundPermanent == true) {
discard();
}
}

View file

@ -86,6 +86,7 @@ public class ManifestEffect extends OneShotEffect {
ContinuousEffect effect = new BecomesFaceDownCreatureEffect(manaCosts, true, Duration.Custom);
effect.setTargetPointer(new FixedTarget(card.getId()));
game.addEffect(effect, source);
game.applyEffects(); // to apply nefore ETB triggered or replace Effects are executed
}
return true;
}