- Optimized the generation of basic lands with random art for the quest mode card pool and quest shop.

- Better name for a function to split a value into a predefined number of random groups.
This commit is contained in:
Agetian
2014-01-15 15:59:57 +00:00
parent f4263e943d
commit f131aafa44
3 changed files with 7 additions and 6 deletions

View File

@@ -125,10 +125,11 @@ public final class QuestUtilCards {
}
for (String landName : MagicColor.Constant.BASIC_LANDS) {
for (int i=0; i<nBasic; i++) {
// we have to add lands one at a time here because ItemPool<PaperCard> can't handle art index
// randomization internally when adding cards in a batch (all cards end up with the same art)
pool.add(db.getCard(landName, landCode, -1), 1);
int artCount = db.getArtCount(landName, landCode);
int artGroups[] = MyRandom.splitIntoRandomGroups(nBasic, artCount);
for (int i=0; i<artGroups.length; i++) {
pool.add(db.getCard(landName, landCode, i), artGroups[i]);
}
}