mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- A closer approximation of foil chance in booster (16.67% for 1:6 ratio instead of just 16%).
This commit is contained in:
@@ -70,7 +70,7 @@ public class BoosterGenerator {
|
|||||||
List<PrintSheet> sheetsUsed = new ArrayList<PrintSheet>();
|
List<PrintSheet> sheetsUsed = new ArrayList<PrintSheet>();
|
||||||
|
|
||||||
CardEdition edition = StaticData.instance().getEditions().get(template.getEdition());
|
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();
|
String foilSlot = !hasFoil ? null : edition.getFoilAlwaysInCommonSlot() ? BoosterSlots.COMMON : Aggregates.random(template.getSlots()).getKey();
|
||||||
|
|
||||||
for(Pair<String, Integer> slot : template.getSlots()) {
|
for(Pair<String, Integer> slot : template.getSlots()) {
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
|
|||||||
res.foilType = FoilType.NOT_SUPPORTED;
|
res.foilType = FoilType.NOT_SUPPORTED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
res.foilChanceInBooster = section.getInt("FoilChanceInBooster", 16);
|
res.foilChanceInBooster = section.getInt("FoilChanceInBooster", 1667);
|
||||||
res.foilAlwaysInCommonSlot = section.getBoolean("FoilAlwaysInCommonSlot", false);
|
res.foilAlwaysInCommonSlot = section.getBoolean("FoilAlwaysInCommonSlot", false);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
Reference in New Issue
Block a user