mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
Fixed long-standing quest draft bug in which hundreds of booster packs would be awarded for old sets. The names of booster packs are now correctly formatted and a reasonable number of packs are now awarded. Also, the amount of leeway for determining the number of packs to award is now a percentage instead of a flat value. If there's 10% or less of the price of a booster pack needed to award another, it will be awarded anyway.
This commit is contained in:
@@ -306,7 +306,7 @@ public class QuestEventDraft {
|
||||
|
||||
int value;
|
||||
String boosterName = FModel.getMagicDb().getEditions().get(boosterSet).getName() + " Booster Pack";
|
||||
|
||||
|
||||
if (MAP_PRICES.containsKey(boosterName)) {
|
||||
value = MAP_PRICES.get(boosterName);
|
||||
} else {
|
||||
@@ -316,7 +316,7 @@ public class QuestEventDraft {
|
||||
boosterPrices += value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
prizePool -= boosterPrices * 8;
|
||||
|
||||
QuestDraftPrizes prizes = null;
|
||||
@@ -373,7 +373,7 @@ public class QuestEventDraft {
|
||||
while (true) {
|
||||
BoosterPack pack = getBoosterPack();
|
||||
int price = getBoosterPrice(pack);
|
||||
if (price > creditsForPacks + 150) { //Add a little room for near-same price packs.
|
||||
if (price > creditsForPacks + creditsForPacks * 0.1f) { //Add a little room for near-same price packs.
|
||||
break;
|
||||
}
|
||||
creditsForPacks -= price;
|
||||
@@ -405,7 +405,7 @@ public class QuestEventDraft {
|
||||
while (true) {
|
||||
BoosterPack pack = getBoosterPack();
|
||||
int price = getBoosterPrice(pack);
|
||||
if (price > creditsForPacks + 50) { //Add a little room for near-same price packs.
|
||||
if (price > creditsForPacks + creditsForPacks * 0.1f) { //Add a little room for near-same price packs.
|
||||
break;
|
||||
}
|
||||
creditsForPacks -= price;
|
||||
@@ -533,8 +533,9 @@ public class QuestEventDraft {
|
||||
private int getBoosterPrice(final BoosterPack booster) {
|
||||
|
||||
int value;
|
||||
String boosterName = booster.getName() + " Booster Pack";
|
||||
|
||||
String boosterName = booster.getName();
|
||||
|
||||
if (MAP_PRICES.containsKey(boosterName)) {
|
||||
value = MAP_PRICES.get(boosterName);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user