Fix Beamsplitter Mage and Ivy interaction with Twinning Staff

This commit is contained in:
Alex W. Jackson 2022-09-14 08:23:48 -04:00
parent efa7b485b0
commit a301394dd8
2 changed files with 13 additions and 8 deletions

View file

@ -1,7 +1,6 @@
package mage.cards.b;
import mage.MageInt;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.AbilityImpl;
import mage.abilities.Mode;
@ -194,10 +193,10 @@ class BeamsplitterMagePredicate implements Predicate<Permanent> {
class BeamsplitterMageApplier implements StackObjectCopyApplier {
private final MageObjectReferencePredicate morPredicate;
private final Iterator<MageObjectReferencePredicate> predicate;
BeamsplitterMageApplier(Permanent permanent, Game game) {
this.morPredicate = new MageObjectReferencePredicate(permanent, game);
this.predicate = Arrays.asList(new MageObjectReferencePredicate(permanent, game)).iterator();
}
@Override
@ -206,6 +205,9 @@ class BeamsplitterMageApplier implements StackObjectCopyApplier {
@Override
public MageObjectReferencePredicate getNextNewTargetType() {
return morPredicate;
if (predicate.hasNext()) {
return predicate.next();
}
return null;
}
}

View file

@ -23,7 +23,7 @@ import mage.target.Target;
import mage.util.TargetAddress;
import mage.util.functions.StackObjectCopyApplier;
import java.util.UUID;
import java.util.*;
/**
* @author TheElk801
@ -97,10 +97,10 @@ class IvyGleefulSpellthiefEffect extends OneShotEffect {
private static final class IvyGleefulSpellthiefApplier implements StackObjectCopyApplier {
private final MageObjectReferencePredicate morPredicate;
private final Iterator<MageObjectReferencePredicate> predicate;
IvyGleefulSpellthiefApplier(Permanent permanent, Game game) {
this.morPredicate = new MageObjectReferencePredicate(permanent, game);
this.predicate = Arrays.asList(new MageObjectReferencePredicate(permanent, game)).iterator();
}
@Override
@ -109,7 +109,10 @@ class IvyGleefulSpellthiefEffect extends OneShotEffect {
@Override
public MageObjectReferencePredicate getNextNewTargetType() {
return morPredicate;
if (predicate.hasNext()) {
return predicate.next();
}
return null;
}
}