Added quest preference for number of wins per set unlock.

This commit is contained in:
Krazy
2014-04-21 04:14:36 +00:00
parent 40483b9437
commit b1d4b53c55
4 changed files with 11 additions and 1 deletions

View File

@@ -38,6 +38,7 @@ import forge.quest.data.QuestAchievements;
import forge.quest.data.QuestAssets;
import forge.quest.data.QuestData;
import forge.quest.data.QuestPreferences.DifficultyPrefs;
import forge.quest.data.QuestPreferences.QPref;
import forge.quest.io.QuestChallengeReader;
import forge.util.storage.IStorage;
import forge.util.storage.StorageBase;
@@ -436,7 +437,7 @@ public class QuestController {
final int wins = this.model.getAchievements().getWin();
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();
return unlocksAvaliable > unlocksSpent ? Math.min(unlocksAvaliable - unlocksSpent, cntLocked) : 0;

View File

@@ -127,6 +127,8 @@ public class QuestPreferences extends PreferencesStore<QuestPreferences.QPref> i
WINS_EXPERTAI_MEDIUM("36"),
WINS_EXPERTAI_HARD("32"),
WINS_EXPERTAI_EXPERT("28"),
WINS_UNLOCK_SET("20"),
// Maximum amount of "Packs" opened by the Shop and available as singles
SHOP_MAX_PACKS("6"),