- Adding a Minimum amount of Packs Field for Quest mode.

- Slight increase to Quest Packs available in the Spell Shop
This commit is contained in:
Sol
2014-09-08 23:55:28 +00:00
parent f921a2e44e
commit 9725fd30ee
4 changed files with 12 additions and 4 deletions

View File

@@ -213,6 +213,9 @@ public class QuestPreferencesHandler extends SkinnedPanel {
pnlShop.add(new FLabel.Builder().text("Maximum Packs").build(), constraints2);
pnlShop.add(new PrefInput(QPref.SHOP_MAX_PACKS, ErrType.SHOP), constraints1);
pnlShop.add(new FLabel.Builder().text("Minimum Packs").build(), constraints2);
pnlShop.add(new PrefInput(QPref.SHOP_MIN_PACKS, ErrType.SHOP), constraints1);
pnlShop.add(new FLabel.Builder().text("Starting Packs").build(), constraints2);
pnlShop.add(new PrefInput(QPref.SHOP_STARTING_PACKS, ErrType.SHOP), constraints1);

View File

@@ -351,6 +351,9 @@ public enum VSubmenuQuestPrefs implements IVSubmenu<CSubmenuQuestPrefs> {
pnlShop.add(new FLabel.Builder().text("Maximum Packs").fontAlign(SwingConstants.RIGHT).build(), constraints2);
pnlShop.add(new PrefInput(QPref.SHOP_MAX_PACKS, QuestPreferencesErrType.SHOP), constraints1);
pnlShop.add(new FLabel.Builder().text("Minimum Packs").fontAlign(SwingConstants.RIGHT).build(), constraints2);
pnlShop.add(new PrefInput(QPref.SHOP_MIN_PACKS, QuestPreferencesErrType.SHOP), constraints1);
pnlShop.add(new FLabel.Builder().text("Starting Packs").fontAlign(SwingConstants.RIGHT).build(), constraints2);
pnlShop.add(new PrefInput(QPref.SHOP_STARTING_PACKS, QuestPreferencesErrType.SHOP), constraints1);

View File

@@ -665,11 +665,12 @@ public final class QuestUtilCards {
final int startPacks = this.qpref.getPrefInt(QPref.SHOP_STARTING_PACKS);
final int winsForPack = this.qpref.getPrefInt(QPref.SHOP_WINS_FOR_ADDITIONAL_PACK);
final int maxPacks = this.qpref.getPrefInt(QPref.SHOP_MAX_PACKS);
final int minPacks = this.qpref.getPrefInt(QPref.SHOP_MIN_PACKS);
int level = this.qc.getAchievements().getLevel();
final int levelPacks = level > 0 ? startPacks / level : startPacks;
final int winPacks = this.qc.getAchievements().getWin() / winsForPack;
final int totalPacks = Math.min(levelPacks + winPacks, maxPacks);
final int totalPacks = Math.min(Math.max(levelPacks + winPacks, minPacks), maxPacks);
SealedProduct.Template tpl = getShopBoosterTemplate();

View File

@@ -135,7 +135,8 @@ public class QuestPreferences extends PreferencesStore<QuestPreferences.QPref> i
WINS_UNLOCK_SET("20"),
// Maximum amount of "Packs" opened by the Shop and available as singles
SHOP_MAX_PACKS("6"),
SHOP_MAX_PACKS("7"),
SHOP_MIN_PACKS("3"),
// Rarity distribution of Singles in an Opened Shop Pack
SHOP_SINGLES_COMMON("7"),
@@ -145,7 +146,7 @@ public class QuestPreferences extends PreferencesStore<QuestPreferences.QPref> i
// How many wins it takes to open an additional pack in the shop
SHOP_WINS_FOR_ADDITIONAL_PACK("10"),
// How many packs the shop start with.
SHOP_STARTING_PACKS("4");
SHOP_STARTING_PACKS("5");
private final String strDefaultVal;
@@ -313,7 +314,7 @@ public class QuestPreferences extends PreferencesStore<QuestPreferences.QPref> i
return "Value too large (maximum 15).";
}
break;
case SHOP_WINS_FOR_ADDITIONAL_PACK: case SHOP_MAX_PACKS:
case SHOP_WINS_FOR_ADDITIONAL_PACK: case SHOP_MAX_PACKS: case SHOP_MIN_PACKS:
if (val < 1) {
return "Value too small (minimum 1).";
} else if (val > 25) {