forked from External/mage
A real fix for Glamer Spinners
This commit is contained in:
parent
94471f3126
commit
78281dbe69
1 changed files with 10 additions and 7 deletions
|
|
@ -82,11 +82,11 @@ class GlamerSpinnersEffect extends OneShotEffect {
|
||||||
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||||
if (targetPermanent == null
|
if (targetPermanent == null
|
||||||
|| targetPermanent
|
|| targetPermanent
|
||||||
.getAttachments()
|
.getAttachments()
|
||||||
.stream()
|
.stream()
|
||||||
.map(game::getPermanent)
|
.map(game::getPermanent)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.noneMatch(p -> p.hasSubtype(SubType.AURA, game))) {
|
.noneMatch(p -> p.hasSubtype(SubType.AURA, game))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
FilterPermanent filter = new FilterPermanent(
|
FilterPermanent filter = new FilterPermanent(
|
||||||
|
|
@ -95,7 +95,7 @@ class GlamerSpinnersEffect extends OneShotEffect {
|
||||||
.map(Controllable::getControllerId)
|
.map(Controllable::getControllerId)
|
||||||
.map(game::getPlayer)
|
.map(game::getPlayer)
|
||||||
.map(Player::getName)
|
.map(Player::getName)
|
||||||
.map(s -> " controlled by" + s)
|
.map(s -> " controlled by " + s)
|
||||||
.orElse("")
|
.orElse("")
|
||||||
);
|
);
|
||||||
filter.add(new ControllerIdPredicate(targetPermanent.getControllerId()));
|
filter.add(new ControllerIdPredicate(targetPermanent.getControllerId()));
|
||||||
|
|
@ -116,7 +116,10 @@ class GlamerSpinnersEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
// new list to avoid concurrent modification
|
// new list to avoid concurrent modification
|
||||||
for (UUID attachmentId : new LinkedList<>(targetPermanent.getAttachments())) {
|
for (UUID attachmentId : new LinkedList<>(targetPermanent.getAttachments())) {
|
||||||
permanent.addAttachment(attachmentId, source, game);
|
Permanent attachment = game.getPermanent(attachmentId);
|
||||||
|
if (attachment != null && attachment.hasSubtype(SubType.AURA, game)) {
|
||||||
|
permanent.addAttachment(attachmentId, source, game);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue