mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
more problems with art indices solved
This commit is contained in:
@@ -183,8 +183,8 @@ public final class CardDb implements ICardDatabase {
|
||||
CardRequest request = CardRequest.fromString(cardName);
|
||||
if(setName != null)
|
||||
request.edition = setName;
|
||||
if(artIndex >= 0)
|
||||
request.artIndex = artIndex;
|
||||
if(artIndex > 0)
|
||||
request.artIndex = artIndex - 1;
|
||||
return tryGetCard(request);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,8 +74,13 @@ public class CardPool extends ItemPool<PaperCard> {
|
||||
// random art index specified, make sure we get different groups of cards with different art
|
||||
int[] artGroups = MyRandom.splitIntoRandomGroups(amount, artCount);
|
||||
for (int i = 1; i <= artGroups.length; i++) {
|
||||
PaperCard cp_random = isCommonCard ? StaticData.instance().getCommonCards().getCard(cardName, setCode, i) : StaticData.instance().getVariantCards().getCard(cardName, setCode, i);
|
||||
this.add(cp_random, artGroups[i]);
|
||||
int cnt = artGroups[i-1];
|
||||
if (cnt <= 0)
|
||||
continue;
|
||||
PaperCard cp_random = isCommonCard
|
||||
? StaticData.instance().getCommonCards().getCard(cardName, setCode, i)
|
||||
: StaticData.instance().getVariantCards().getCard(cardName, setCode, i);
|
||||
this.add(cp_random, cnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,7 +245,9 @@ public class Deck extends DeckBase implements Iterable<Entry<DeckSection, CardPo
|
||||
|
||||
PaperCard c = StaticData.instance().getCommonCards().getCardFromEdition(cardName, dayAfterNewestSetRelease, SetPreference.LatestCoreExp, artIndex);
|
||||
if( null == c ) {
|
||||
c = StaticData.instance().getCommonCards().getCardFromEdition(cardName, dayAfterNewestSetRelease, SetPreference.Latest, -1);
|
||||
c = StaticData.instance().getCommonCards().getCardFromEdition(cardName, dayAfterNewestSetRelease, SetPreference.LatestCoreExp, -1);
|
||||
if( c == null)
|
||||
c = StaticData.instance().getCommonCards().getCardFromEdition(cardName, dayAfterNewestSetRelease, SetPreference.Latest, -1);
|
||||
// this is to randomize art of all those cards
|
||||
newPool.add(cardName, c.getEdition(), cp.getValue());
|
||||
} else
|
||||
|
||||
Reference in New Issue
Block a user