mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Added quest preference for number of wins per set unlock.
This commit is contained in:
@@ -219,6 +219,9 @@ public class QuestPreferencesHandler extends SkinnedPanel {
|
|||||||
pnlShop.add(new FLabel.Builder().text("Wins for Pack").build(), constraints2);
|
pnlShop.add(new FLabel.Builder().text("Wins for Pack").build(), constraints2);
|
||||||
pnlShop.add(new PrefInput(QPref.SHOP_WINS_FOR_ADDITIONAL_PACK, ErrType.SHOP), constraints1);
|
pnlShop.add(new PrefInput(QPref.SHOP_WINS_FOR_ADDITIONAL_PACK, ErrType.SHOP), constraints1);
|
||||||
|
|
||||||
|
pnlShop.add(new FLabel.Builder().text("Wins per Set Unlock").build(), constraints2);
|
||||||
|
pnlShop.add(new PrefInput(QPref.WINS_UNLOCK_SET, ErrType.SHOP), constraints1);
|
||||||
|
|
||||||
pnlShop.add(new FLabel.Builder().text("Common Singles").build(), constraints2);
|
pnlShop.add(new FLabel.Builder().text("Common Singles").build(), constraints2);
|
||||||
pnlShop.add(new PrefInput(QPref.SHOP_SINGLES_COMMON, ErrType.SHOP), constraints1);
|
pnlShop.add(new PrefInput(QPref.SHOP_SINGLES_COMMON, ErrType.SHOP), constraints1);
|
||||||
|
|
||||||
@@ -353,6 +356,7 @@ public class QuestPreferencesHandler extends SkinnedPanel {
|
|||||||
case STARTING_CREDITS_HARD: case STARTING_CREDITS_EXPERT:
|
case STARTING_CREDITS_HARD: case STARTING_CREDITS_EXPERT:
|
||||||
case REWARDS_MILLED: case REWARDS_MULLIGAN0:
|
case REWARDS_MILLED: case REWARDS_MULLIGAN0:
|
||||||
case REWARDS_ALTERNATIVE: case REWARDS_TURN5:
|
case REWARDS_ALTERNATIVE: case REWARDS_TURN5:
|
||||||
|
case WINS_UNLOCK_SET:
|
||||||
if (val > 500) {
|
if (val > 500) {
|
||||||
return "Value too large (maximum 500).";
|
return "Value too large (maximum 500).";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -356,6 +356,9 @@ public enum VSubmenuQuestPrefs implements IVSubmenu<CSubmenuQuestPrefs> {
|
|||||||
pnlShop.add(new FLabel.Builder().text("Wins for Pack").build(), constraints2);
|
pnlShop.add(new FLabel.Builder().text("Wins for Pack").build(), constraints2);
|
||||||
pnlShop.add(new PrefInput(QPref.SHOP_WINS_FOR_ADDITIONAL_PACK, QuestPreferencesErrType.SHOP), constraints1);
|
pnlShop.add(new PrefInput(QPref.SHOP_WINS_FOR_ADDITIONAL_PACK, QuestPreferencesErrType.SHOP), constraints1);
|
||||||
|
|
||||||
|
pnlShop.add(new FLabel.Builder().text("Wins per Set Unlock").build(), constraints2);
|
||||||
|
pnlShop.add(new PrefInput(QPref.WINS_UNLOCK_SET, QuestPreferencesErrType.SHOP), constraints1);
|
||||||
|
|
||||||
pnlShop.add(new FLabel.Builder().text("Common Singles").build(), constraints2);
|
pnlShop.add(new FLabel.Builder().text("Common Singles").build(), constraints2);
|
||||||
pnlShop.add(new PrefInput(QPref.SHOP_SINGLES_COMMON, QuestPreferencesErrType.SHOP), constraints1);
|
pnlShop.add(new PrefInput(QPref.SHOP_SINGLES_COMMON, QuestPreferencesErrType.SHOP), constraints1);
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import forge.quest.data.QuestAchievements;
|
|||||||
import forge.quest.data.QuestAssets;
|
import forge.quest.data.QuestAssets;
|
||||||
import forge.quest.data.QuestData;
|
import forge.quest.data.QuestData;
|
||||||
import forge.quest.data.QuestPreferences.DifficultyPrefs;
|
import forge.quest.data.QuestPreferences.DifficultyPrefs;
|
||||||
|
import forge.quest.data.QuestPreferences.QPref;
|
||||||
import forge.quest.io.QuestChallengeReader;
|
import forge.quest.io.QuestChallengeReader;
|
||||||
import forge.util.storage.IStorage;
|
import forge.util.storage.IStorage;
|
||||||
import forge.util.storage.StorageBase;
|
import forge.util.storage.StorageBase;
|
||||||
@@ -436,7 +437,7 @@ public class QuestController {
|
|||||||
final int wins = this.model.getAchievements().getWin();
|
final int wins = this.model.getAchievements().getWin();
|
||||||
|
|
||||||
int cntLocked = this.questFormat.getLockedSets().size();
|
int cntLocked = this.questFormat.getLockedSets().size();
|
||||||
int unlocksAvaliable = wins / 20;
|
int unlocksAvaliable = wins / FModel.getQuestPreferences().getPrefInt(QPref.WINS_UNLOCK_SET);
|
||||||
int unlocksSpent = this.questFormat.getUnlocksUsed();
|
int unlocksSpent = this.questFormat.getUnlocksUsed();
|
||||||
|
|
||||||
return unlocksAvaliable > unlocksSpent ? Math.min(unlocksAvaliable - unlocksSpent, cntLocked) : 0;
|
return unlocksAvaliable > unlocksSpent ? Math.min(unlocksAvaliable - unlocksSpent, cntLocked) : 0;
|
||||||
|
|||||||
@@ -128,6 +128,8 @@ public class QuestPreferences extends PreferencesStore<QuestPreferences.QPref> i
|
|||||||
WINS_EXPERTAI_HARD("32"),
|
WINS_EXPERTAI_HARD("32"),
|
||||||
WINS_EXPERTAI_EXPERT("28"),
|
WINS_EXPERTAI_EXPERT("28"),
|
||||||
|
|
||||||
|
WINS_UNLOCK_SET("20"),
|
||||||
|
|
||||||
// Maximum amount of "Packs" opened by the Shop and available as singles
|
// Maximum amount of "Packs" opened by the Shop and available as singles
|
||||||
SHOP_MAX_PACKS("6"),
|
SHOP_MAX_PACKS("6"),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user