Update RewardData

- exclude Online and Funny Card for Adventure Rewards
This commit is contained in:
Anthony Calosa
2022-04-19 21:54:14 +08:00
parent b7c0d60edc
commit 527997f5b2
2 changed files with 19 additions and 2 deletions

View File

@@ -872,6 +872,23 @@ public final class CardDb implements ICardDatabase, IDeckGenPool {
}));
}
public Collection<PaperCard> getUniqueCardsNoAltNoOnline() {
return Lists.newArrayList(Iterables.filter(getUniqueCardsNoAlt(), new Predicate<PaperCard>() {
@Override
public boolean apply(final PaperCard paperCard) {
CardEdition edition = null;
try {
edition = editions.getEditionByCodeOrThrow(paperCard.getEdition());
if (edition.getType() == Type.ONLINE||edition.getType() == Type.FUNNY)
return false;
} catch (Exception ex) {
return false;
}
return true;
}
}));
}
public Collection<PaperCard> getAllNonPromosNonReprintsNoAlt() {
return Lists.newArrayList(Iterables.filter(getAllCardsNoAlt(), new Predicate<PaperCard>() {
@Override

View File

@@ -78,11 +78,11 @@ public class RewardData {
RewardData legals=Config.instance().getConfigData().legalCards;
if(legals==null)
{
allCards = FModel.getMagicDb().getCommonCards().getUniqueCardsNoAlt();
allCards = FModel.getMagicDb().getCommonCards().getUniqueCardsNoAltNoOnline();
}
else
{
allCards = Iterables.filter(FModel.getMagicDb().getCommonCards().getUniqueCardsNoAlt(), new CardUtil.CardPredicate(legals, true));
allCards = Iterables.filter(FModel.getMagicDb().getCommonCards().getUniqueCardsNoAltNoOnline(), new CardUtil.CardPredicate(legals, true));
}
allEnemyCards=Iterables.filter(allCards, new Predicate<PaperCard>() {
@Override