- Fixed #8376 and #8285. There is still a pre-existing issue with the attacking trigger on the Fractal Harness, though. It runs through the apply twice so the counters are four times as many instead of two.

This commit is contained in:
Jeff Wadsworth 2021-10-06 16:28:27 -05:00
parent bce88bd399
commit 19eb9f7122
2 changed files with 14 additions and 8 deletions

View file

@ -56,8 +56,8 @@ class FractalHarnessTokenEffect extends OneShotEffect {
FractalHarnessTokenEffect() {
super(Outcome.Benefit);
staticText = "create a 0/0 green and blue Fractal creature token. " +
"Put X +1/+1 counters on it and attach {this} to it";
staticText = "create a 0/0 green and blue Fractal creature token. "
+ "Put X +1/+1 counters on it and attach {this} to it";
}
private FractalHarnessTokenEffect(final FractalHarnessTokenEffect effect) {
@ -80,7 +80,8 @@ class FractalHarnessTokenEffect extends OneShotEffect {
if (permanent == null) {
continue;
}
if (flag && permanent.addAttachment(tokenId, source, game)) {
if (flag
&& permanent.addAttachment(source.getSourceId(), source, game)) {
flag = false;
}
permanent.addCounters(CounterType.P1P1.createInstance(xValue), source.getControllerId(), source, game);
@ -108,8 +109,13 @@ class FractalHarnessDoubleEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = (Permanent) getValue("attachedPermanent");
return permanent != null && permanent.addCounters(CounterType.P1P1.createInstance(
permanent.getCounters(game).getCount(CounterType.P1P1)
), source.getControllerId(), source, game);
if (permanent == null) {
return false;
}
// BUG : changed this to a integer due to the trigger firing twice
final int addedCounters = permanent.getCounters(game).getCount(CounterType.P1P1);
// BUG : this oneShotEffect is being run twice for some reason, so the number of counters is four times as many
return permanent.addCounters(CounterType.P1P1.createInstance(addedCounters),
source.getControllerId(), source, game);
}
}

View file

@ -20,8 +20,8 @@ import mage.game.permanent.token.WhiteBlackSpiritToken;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
import mage.filter.common.FilterCreatureCard;
import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES;
/**
* @author LevelX2
@ -41,7 +41,7 @@ public final class TeysaEnvoyOfGhosts extends CardImpl {
this.addAbility(VigilanceAbility.getInstance());
// protection from creatures
this.addAbility(new ProtectionAbility(FILTER_PERMANENT_CREATURES));
this.addAbility(new ProtectionAbility(new FilterCreatureCard("creatures")));
// Whenever a creature deals combat damage to you, destroy that creature. Create a 1/1 white and black Spirit creature token with flying.
this.addAbility(new TeysaEnvoyOfGhostsTriggeredAbility());