- A closer approximation of foil chance in booster (16.67% for 1:6 ratio instead of just 16%).

This commit is contained in:
Agetian
2014-02-08 20:03:01 +00:00
parent f0464395ab
commit 686807b0d2
2 changed files with 2 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ public class BoosterGenerator {
List<PrintSheet> sheetsUsed = new ArrayList<PrintSheet>();
CardEdition edition = StaticData.instance().getEditions().get(template.getEdition());
boolean hasFoil = edition != null && MyRandom.getRandom().nextInt(100) <= edition.getFoilChanceInBooster() && edition.getFoilType() != FoilType.NOT_SUPPORTED;
boolean hasFoil = edition != null && MyRandom.getRandom().nextInt(10000) <= edition.getFoilChanceInBooster() && edition.getFoilType() != FoilType.NOT_SUPPORTED; // FoilChanceInBooster is given with 1/10000th precision for a closer 1:6 (16.67%) approximation.
String foilSlot = !hasFoil ? null : edition.getFoilAlwaysInCommonSlot() ? BoosterSlots.COMMON : Aggregates.random(template.getSlots()).getKey();
for(Pair<String, Integer> slot : template.getSlots()) {

View File

@@ -297,7 +297,7 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
res.foilType = FoilType.NOT_SUPPORTED;
break;
}
res.foilChanceInBooster = section.getInt("FoilChanceInBooster", 16);
res.foilChanceInBooster = section.getInt("FoilChanceInBooster", 1667);
res.foilAlwaysInCommonSlot = section.getBoolean("FoilAlwaysInCommonSlot", false);
return res;