- FlipOntoBattlefieldEffect: checking for the controller of the aura is not reliable, since auras are visualized differently in different UIs. So allow all attachments to be hit.

This commit is contained in:
Michael Kamensky
2021-11-02 07:21:19 +03:00
parent 440877c764
commit 45d7068bd9

View File

@@ -101,13 +101,13 @@ public class FlipOntoBattlefieldEffect extends SpellAbilityEffect {
// Currently gets the nearest (in zone order) card to the left or to the right of the designated one by type,
// as well as cards attachments by the same controller that are visually located next to the requested card.
Player controller = c.getController();
ArrayList<Card> ownAttachments = Lists.newArrayList();
ArrayList<Card> attachments = Lists.newArrayList();
ArrayList<Card> cardsOTB = Lists.newArrayList(CardLists.filter(
controller.getCardsIn(ZoneType.Battlefield), new Predicate<Card>() {
@Override
public boolean apply(Card card) {
if (card.isAttachedToEntity(c) && card.getController() == controller) {
ownAttachments.add(card);
if (card.isAttachedToEntity(c)) {
attachments.add(card);
return true;
} else if (c.isCreature()) {
return card.isCreature();
@@ -125,8 +125,8 @@ public class FlipOntoBattlefieldEffect extends SpellAbilityEffect {
// Chance to hit an attachment
float hitAttachment = 0.50f;
if (!ownAttachments.isEmpty() && direction < 0 && MyRandom.getRandom().nextFloat() <= hitAttachment) {
return Aggregates.random(ownAttachments);
if (!attachments.isEmpty() && direction < 0 && MyRandom.getRandom().nextFloat() <= hitAttachment) {
return Aggregates.random(attachments);
}
int loc = cardsOTB.indexOf(c);