This commit is contained in:
Alex W. Jackson 2022-09-14 03:08:23 -04:00
parent 48245f4a23
commit c401b35b63
3 changed files with 8 additions and 12 deletions

View file

@ -194,12 +194,10 @@ class BeamsplitterMagePredicate implements Predicate<Permanent> {
class BeamsplitterMageApplier implements StackObjectCopyApplier {
private final Iterator<MageObjectReferencePredicate> predicate;
private final MageObjectReferencePredicate morPredicate;
BeamsplitterMageApplier(Permanent permanent, Game game) {
this.predicate = Arrays.asList(new MageObjectReferencePredicate(
new MageObjectReference(permanent, game)
)).iterator();
this.morPredicate = new MageObjectReferencePredicate(permanent, game);
}
@Override
@ -208,9 +206,6 @@ class BeamsplitterMageApplier implements StackObjectCopyApplier {
@Override
public MageObjectReferencePredicate getNextNewTargetType(int copyNumber) {
if (predicate.hasNext()) {
return predicate.next();
}
return null;
return morPredicate;
}
}

View file

@ -109,7 +109,7 @@ class IvyGleefulSpellthiefEffect extends OneShotEffect {
@Override
public MageObjectReferencePredicate getNextNewTargetType(int copyNumber) {
return copyNumber == 0 ? morPredicate : null;
return morPredicate;
}
}

View file

@ -298,9 +298,10 @@ public abstract class TokenImpl extends MageObjectImpl implements Token {
game.addSimultaneousEvent(new CreatedTokenEvent(source, (PermanentToken) permanent));
}
// handle auras coming into the battlefield
// code refactored from CopyPermanentEffect
if (permanent.getSubtype().contains(SubType.AURA)) {
// if token was created (not a spell copy) handle auras coming into the battlefield
// code blindly copied from CopyPermanentEffect
// TODO: clean this up -- half the comments make no sense in the context of creating a token
if (created && permanent.getSubtype().contains(SubType.AURA)) {
Outcome auraOutcome = Outcome.BoostCreature;
Target auraTarget = null;