mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
will generate 80 lands out of 20 avaliable in print run correctly
This commit is contained in:
@@ -78,6 +78,15 @@ public class PrintSheet {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If they ask for 40 unique basic lands (to make a fatpack) out of 20 distinct possible, add the whole print run N times.
|
||||||
|
int uniqueCards = cardsWithWeights.countDistinct();
|
||||||
|
while ( number >= uniqueCards ) {
|
||||||
|
for(Entry<CardPrinted, Integer> kv : cardsWithWeights) {
|
||||||
|
result.add(kv.getKey());
|
||||||
|
}
|
||||||
|
number -= uniqueCards;
|
||||||
|
}
|
||||||
|
|
||||||
for(int iC = 0; iC < number; iC++) {
|
for(int iC = 0; iC < number; iC++) {
|
||||||
int index = MyRandom.getRandom().nextInt(totalWeight);
|
int index = MyRandom.getRandom().nextInt(totalWeight);
|
||||||
CardPrinted toAdd = fetchRoulette(0, index, wantUnique ? result : null);
|
CardPrinted toAdd = fetchRoulette(0, index, wantUnique ? result : null);
|
||||||
@@ -98,4 +107,5 @@ public class PrintSheet {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user