mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
New formula for unlock prices, minor checkstyle.
This commit is contained in:
@@ -66,7 +66,8 @@ public class QuestUtilUnlockSets {
|
||||
for (CardEdition ed : getUnlockableEditions(qData)) {
|
||||
int price = 7500;
|
||||
if (mapPrices.containsKey(ed.getName() + " Booster Pack")) {
|
||||
price = Math.max( 50 * mapPrices.get(ed.getName() + " Booster Pack"), 7500 );
|
||||
price = Math.max(new Double(60 * Math.pow(Math.sqrt(mapPrices.get(ed.getName()
|
||||
+ " Booster Pack")), 1.65)).intValue(), 7500);
|
||||
}
|
||||
setPrices.add(ImmutablePair.of(ed, price));
|
||||
}
|
||||
@@ -82,13 +83,11 @@ public class QuestUtilUnlockSets {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
ImmutablePair<CardEdition, Integer> toBuy = setPrices.get(index);
|
||||
|
||||
int price = toBuy.right;
|
||||
CardEdition choosenEdition = toBuy.left;
|
||||
|
||||
|
||||
if (qData.getAssets().getCredits() < price) {
|
||||
JOptionPane.showMessageDialog(null, "Unfortunately, you cannot afford that set yet.\n"
|
||||
+ "To unlock " + choosenEdition.getName() + ", you need " + price + " credits.\n"
|
||||
@@ -140,9 +139,10 @@ public class QuestUtilUnlockSets {
|
||||
int distance = Integer.MAX_VALUE;
|
||||
for (CardEdition in : allowedSets) {
|
||||
int d = Math.abs(ex.getIndex() - in.getIndex());
|
||||
if ( d < distance )
|
||||
if (d < distance) {
|
||||
distance = d;
|
||||
}
|
||||
}
|
||||
excludedWithDistances.add(ImmutablePair.of(ex, distance));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user