mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Fix Dour Port-Mage (#5651)
This commit is contained in:
@@ -130,9 +130,9 @@ public class CardZoneTable extends ForwardingTable<ZoneType, ZoneType, CardColle
|
||||
}
|
||||
}
|
||||
|
||||
public CardCollection filterCards(Iterable<ZoneType> origin, ZoneType destination, String valid, Card host, CardTraitBase sa) {
|
||||
public CardCollection filterCards(Iterable<ZoneType> origin, Iterable<ZoneType> destination, String valid, Card host, CardTraitBase sa) {
|
||||
CardCollection allCards = new CardCollection();
|
||||
if (destination != null && !containsColumn(destination)) {
|
||||
if (destination != null && !Iterables.any(destination, d -> columnKeySet().contains(d))) {
|
||||
return allCards;
|
||||
}
|
||||
if (origin != null) {
|
||||
@@ -147,9 +147,11 @@ public class CardZoneTable extends ForwardingTable<ZoneType, ZoneType, CardColle
|
||||
lkiLookup = lastStateGraveyard;
|
||||
}
|
||||
if (destination != null) {
|
||||
if (row(z).containsKey(destination)) {
|
||||
for (Card c : row(z).get(destination)) {
|
||||
allCards.add(lkiLookup.get(c));
|
||||
for (ZoneType zt : destination) {
|
||||
if (row(z).containsKey(zt)) {
|
||||
for (Card c : row(z).get(zt)) {
|
||||
allCards.add(lkiLookup.get(c));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -162,8 +164,10 @@ public class CardZoneTable extends ForwardingTable<ZoneType, ZoneType, CardColle
|
||||
}
|
||||
}
|
||||
} else if (destination != null) {
|
||||
for (CardCollection c : column(destination).values()) {
|
||||
allCards.addAll(c);
|
||||
for (ZoneType zt : destination) {
|
||||
for (CardCollection c : column(zt).values()) {
|
||||
allCards.addAll(c);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (CardCollection c : values()) {
|
||||
|
||||
@@ -123,16 +123,16 @@ public class StaticAbilityPanharmonicon {
|
||||
}
|
||||
|
||||
List<ZoneType> trigOrigin = null;
|
||||
ZoneType trigDestination = null;
|
||||
List<ZoneType> trigDestination = null;
|
||||
if (trigger.hasParam("Destination") && !trigger.getParam("Destination").equals("Any")) {
|
||||
trigDestination = ZoneType.valueOf(trigger.getParam("Destination"));
|
||||
trigDestination = ZoneType.listValueOf(trigger.getParam("Destination"));
|
||||
}
|
||||
if (trigger.hasParam("Origin") && !trigger.getParam("Origin").equals("Any")) {
|
||||
trigOrigin = ZoneType.listValueOf(trigger.getParam("Origin"));
|
||||
}
|
||||
CardCollection causesForTrigger = table.filterCards(trigOrigin, trigDestination, trigger.getParam("ValidCards"), trigger.getHostCard(), trigger);
|
||||
|
||||
CardCollection causesForStatic = table.filterCards(origin == null ? null : ImmutableList.of(ZoneType.smartValueOf(origin)), ZoneType.smartValueOf(destination), stAb.getParam("ValidCause"), host, stAb);
|
||||
CardCollection causesForStatic = table.filterCards(origin == null ? null : ImmutableList.of(ZoneType.smartValueOf(origin)), destination == null ? null : ZoneType.listValueOf(destination), stAb.getParam("ValidCause"), host, stAb);
|
||||
|
||||
// check that whatever caused the trigger to fire is also a cause the static applies for
|
||||
if (Collections.disjoint(causesForTrigger, causesForStatic)) {
|
||||
|
||||
@@ -74,11 +74,11 @@ public class TriggerChangesZoneAll extends Trigger {
|
||||
}
|
||||
|
||||
private CardCollection filterCards(CardZoneTable table) {
|
||||
ZoneType destination = null;
|
||||
List<ZoneType> destination = null;
|
||||
List<ZoneType> origin = null;
|
||||
|
||||
if (hasParam("Destination") && !getParam("Destination").equals("Any")) {
|
||||
destination = ZoneType.valueOf(getParam("Destination"));
|
||||
destination = ZoneType.listValueOf(getParam("Destination"));
|
||||
}
|
||||
|
||||
if (hasParam("Origin") && !getParam("Origin").equals("Any")) {
|
||||
|
||||
Reference in New Issue
Block a user