mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Merge pull request #2408 from jjayers99/master
Correction to Adventure Mode edition filter
This commit is contained in:
@@ -57,8 +57,18 @@ public class CardUtil {
|
|||||||
public boolean apply(final PaperCard card) {
|
public boolean apply(final PaperCard card) {
|
||||||
if(!this.rarities.isEmpty()&&!this.rarities.contains(card.getRarity()))
|
if(!this.rarities.isEmpty()&&!this.rarities.contains(card.getRarity()))
|
||||||
return !this.shouldBeEqual;
|
return !this.shouldBeEqual;
|
||||||
if(!this.editions.isEmpty()&&!this.editions.contains(card.getEdition()))
|
if(!this.editions.isEmpty()&&!this.editions.contains(card.getEdition())) {
|
||||||
return !this.shouldBeEqual;
|
boolean found = false;
|
||||||
|
List<PaperCard> allPrintings = FModel.getMagicDb().getCommonCards().getAllCards(card.getCardName());
|
||||||
|
for (PaperCard c : allPrintings){
|
||||||
|
if (this.editions.contains(c.getEdition())) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
return !this.shouldBeEqual;
|
||||||
|
}
|
||||||
if(!this.manaCosts.isEmpty()&&!this.manaCosts.contains(card.getRules().getManaCost().getCMC()))
|
if(!this.manaCosts.isEmpty()&&!this.manaCosts.contains(card.getRules().getManaCost().getCMC()))
|
||||||
return !this.shouldBeEqual;
|
return !this.shouldBeEqual;
|
||||||
if(this.text!=null&& !this.text.matcher(card.getRules().getOracleText()).find())
|
if(this.text!=null&& !this.text.matcher(card.getRules().getOracleText()).find())
|
||||||
|
|||||||
Reference in New Issue
Block a user