mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Added two new quest preferences for controlling the number of cards to keep before selling extras.
This commit is contained in:
@@ -379,6 +379,16 @@ public enum VSubmenuQuestPrefs implements IVSubmenu<CSubmenuQuestPrefs> {
|
|||||||
pnlShop.add(new FLabel.Builder().text("Wins to Uncap Sale Price").fontAlign(SwingConstants.RIGHT).build(), labelConstraints);
|
pnlShop.add(new FLabel.Builder().text("Wins to Uncap Sale Price").fontAlign(SwingConstants.RIGHT).build(), labelConstraints);
|
||||||
pnlShop.add(new PrefInput(QPref.SHOP_WINS_FOR_NO_SELL_LIMIT, QuestPreferencesErrType.SHOP), fieldConstraints);
|
pnlShop.add(new PrefInput(QPref.SHOP_WINS_FOR_NO_SELL_LIMIT, QuestPreferencesErrType.SHOP), fieldConstraints);
|
||||||
|
|
||||||
|
FLabel extraCardsToKeep = new FLabel.Builder().text("Copies of Cards to Keep").fontAlign(SwingConstants.RIGHT).build();
|
||||||
|
extraCardsToKeep.setToolTipText("The number of copies of cards to keep before selling extras.");
|
||||||
|
pnlShop.add(extraCardsToKeep, labelConstraints);
|
||||||
|
pnlShop.add(new PrefInput(QPref.SHOP_EXTRAS_TO_KEEP, QuestPreferencesErrType.DIFFICULTY), fieldConstraints + ", wrap");
|
||||||
|
|
||||||
|
FLabel extraLandsToKeep = new FLabel.Builder().text("Copies of Basic Lands to Keep").fontAlign(SwingConstants.RIGHT).build();
|
||||||
|
extraLandsToKeep.setToolTipText("The number of copies of basic lands to keep before selling extras.");
|
||||||
|
pnlShop.add(extraLandsToKeep, labelConstraints);
|
||||||
|
pnlShop.add(new PrefInput(QPref.SHOP_EXTRA_BASIC_LANDS_TO_KEEP, QuestPreferencesErrType.DIFFICULTY), fieldConstraints + ", wrap");
|
||||||
|
|
||||||
pnlShop.add(new FLabel.Builder().text("Item Level Restriction").fontAlign(SwingConstants.RIGHT).build(), labelConstraints);
|
pnlShop.add(new FLabel.Builder().text("Item Level Restriction").fontAlign(SwingConstants.RIGHT).build(), labelConstraints);
|
||||||
pnlShop.add(new PrefInput(QPref.ITEM_LEVEL_RESTRICTION, QuestPreferencesErrType.SHOP), fieldConstraints);
|
pnlShop.add(new PrefInput(QPref.ITEM_LEVEL_RESTRICTION, QuestPreferencesErrType.SHOP), fieldConstraints);
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ public class QuestPrefsScreen extends FScreen {
|
|||||||
scroller.add(new PrefsOption("Common Singles", QPref.SHOP_SINGLES_COMMON, PrefsGroup.SHOP));
|
scroller.add(new PrefsOption("Common Singles", QPref.SHOP_SINGLES_COMMON, PrefsGroup.SHOP));
|
||||||
scroller.add(new PrefsOption("Uncommon Singles", QPref.SHOP_SINGLES_UNCOMMON, PrefsGroup.SHOP));
|
scroller.add(new PrefsOption("Uncommon Singles", QPref.SHOP_SINGLES_UNCOMMON, PrefsGroup.SHOP));
|
||||||
scroller.add(new PrefsOption("Rare Singles", QPref.SHOP_SINGLES_RARE, PrefsGroup.SHOP));
|
scroller.add(new PrefsOption("Rare Singles", QPref.SHOP_SINGLES_RARE, PrefsGroup.SHOP));
|
||||||
|
scroller.add(new PrefsOption("Copies of Cards to Keep", QPref.SHOP_EXTRAS_TO_KEEP, PrefsGroup.SHOP));
|
||||||
|
scroller.add(new PrefsOption("Copies of Basic Lands to Keep", QPref.SHOP_EXTRA_BASIC_LANDS_TO_KEEP, PrefsGroup.SHOP));
|
||||||
|
|
||||||
//Difficulty Adjustments (All)
|
//Difficulty Adjustments (All)
|
||||||
scroller.add(new PrefsHeader("Difficulty Adjustments (All)", FSkinImage.QUEST_NOTES, PrefsGroup.DIFFICULTY_ALL));
|
scroller.add(new PrefsHeader("Difficulty Adjustments (All)", FSkinImage.QUEST_NOTES, PrefsGroup.DIFFICULTY_ALL));
|
||||||
|
|||||||
@@ -13,25 +13,25 @@ public class BooleanExpression {
|
|||||||
|
|
||||||
private Stack<Operator> operators = new Stack<>();
|
private Stack<Operator> operators = new Stack<>();
|
||||||
private Stack<Predicate<CardRules>> operands = new Stack<>();
|
private Stack<Predicate<CardRules>> operands = new Stack<>();
|
||||||
|
|
||||||
private StringTokenizer expression;
|
private StringTokenizer expression;
|
||||||
|
|
||||||
private boolean inName, inType, inText, inCost;
|
private boolean inName, inType, inText, inCost;
|
||||||
|
|
||||||
private static enum Operator {
|
private enum Operator {
|
||||||
|
|
||||||
AND("&", 0), OR("|", 0), NOT("!", 1), OPEN_PAREN("(", 2), CLOSE_PAREN(")", 2), ESCAPE("\\", -1);
|
AND("&", 0), OR("|", 0), NOT("!", 1), OPEN_PAREN("(", 2), CLOSE_PAREN(")", 2), ESCAPE("\\", -1);
|
||||||
|
|
||||||
private final String token;
|
private final String token;
|
||||||
private final int precedence;
|
private final int precedence;
|
||||||
|
|
||||||
private Operator(final String token, final int precedence) {
|
Operator(final String token, final int precedence) {
|
||||||
this.token = token;
|
this.token = token;
|
||||||
this.precedence = precedence;
|
this.precedence = precedence;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BooleanExpression(final String expression, final boolean inName, final boolean inType, final boolean inText, final boolean inCost) {
|
public BooleanExpression(final String expression, final boolean inName, final boolean inType, final boolean inText, final boolean inCost) {
|
||||||
this.expression = new StringTokenizer(expression);
|
this.expression = new StringTokenizer(expression);
|
||||||
this.inName = inName;
|
this.inName = inName;
|
||||||
@@ -39,7 +39,7 @@ public class BooleanExpression {
|
|||||||
this.inText = inText;
|
this.inText = inText;
|
||||||
this.inCost = inCost;
|
this.inCost = inCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Predicate<CardRules> evaluate() {
|
public Predicate<CardRules> evaluate() {
|
||||||
|
|
||||||
String currentValue = "";
|
String currentValue = "";
|
||||||
@@ -68,17 +68,17 @@ public class BooleanExpression {
|
|||||||
if (operator == null) {
|
if (operator == null) {
|
||||||
currentValue += token;
|
currentValue += token;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (escapeNext) {
|
if (escapeNext) {
|
||||||
escapeNext = false;
|
escapeNext = false;
|
||||||
currentValue += token;
|
currentValue += token;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!currentValue.trim().isEmpty()) {
|
if (!currentValue.trim().isEmpty()) {
|
||||||
operands.push(valueOf(currentValue.trim()));
|
operands.push(valueOf(currentValue.trim()));
|
||||||
}
|
}
|
||||||
|
|
||||||
currentValue = "";
|
currentValue = "";
|
||||||
|
|
||||||
if (!operators.isEmpty() && operator.precedence < operators.peek().precedence) {
|
if (!operators.isEmpty() && operator.precedence < operators.peek().precedence) {
|
||||||
@@ -88,11 +88,11 @@ public class BooleanExpression {
|
|||||||
while (!operators.isEmpty() && operators.peek() != Operator.OPEN_PAREN) {
|
while (!operators.isEmpty() && operators.peek() != Operator.OPEN_PAREN) {
|
||||||
resolve(true);
|
resolve(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
operators.push(operator);
|
operators.push(operator);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -101,14 +101,14 @@ public class BooleanExpression {
|
|||||||
operands.push(valueOf(currentValue.trim()));
|
operands.push(valueOf(currentValue.trim()));
|
||||||
}
|
}
|
||||||
|
|
||||||
while (operators.size() > 0) {
|
while (!operators.isEmpty()) {
|
||||||
resolve(true);
|
resolve(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return operands.get(0);
|
return operands.get(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resolve(final boolean alwaysPopOperator) {
|
private void resolve(final boolean alwaysPopOperator) {
|
||||||
|
|
||||||
Predicate<CardRules> right;
|
Predicate<CardRules> right;
|
||||||
@@ -138,11 +138,11 @@ public class BooleanExpression {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Predicate<CardRules> valueOf(final String value) {
|
private Predicate<CardRules> valueOf(final String value) {
|
||||||
|
|
||||||
List<Predicate<CardRules>> predicates = new ArrayList<>();
|
List<Predicate<CardRules>> predicates = new ArrayList<>();
|
||||||
if (inName) {
|
if (inName) {
|
||||||
predicates.add(CardRulesPredicates.name(StringOp.CONTAINS_IC, value));
|
predicates.add(CardRulesPredicates.name(StringOp.CONTAINS_IC, value));
|
||||||
@@ -156,15 +156,15 @@ public class BooleanExpression {
|
|||||||
if (inCost) {
|
if (inCost) {
|
||||||
predicates.add(CardRulesPredicates.cost(StringOp.CONTAINS_IC, value));
|
predicates.add(CardRulesPredicates.cost(StringOp.CONTAINS_IC, value));
|
||||||
}
|
}
|
||||||
if (predicates.size() > 0) {
|
if (!predicates.isEmpty()) {
|
||||||
return Predicates.or(predicates);
|
return Predicates.or(predicates);
|
||||||
}
|
}
|
||||||
return Predicates.alwaysTrue();
|
return Predicates.alwaysTrue();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isExpression(final String string) {
|
public static boolean isExpression(final String string) {
|
||||||
return string.contains(Operator.AND.token) || string.contains(Operator.OR.token) || string.trim().startsWith(Operator.NOT.token);
|
return string.contains(Operator.AND.token) || string.contains(Operator.OR.token) || string.trim().startsWith(Operator.NOT.token);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import forge.itemmanager.IItemManager;
|
|||||||
import forge.itemmanager.SItemManagerUtil;
|
import forge.itemmanager.SItemManagerUtil;
|
||||||
import forge.model.FModel;
|
import forge.model.FModel;
|
||||||
import forge.properties.ForgePreferences.FPref;
|
import forge.properties.ForgePreferences.FPref;
|
||||||
|
import forge.quest.data.QuestPreferences.QPref;
|
||||||
import forge.quest.io.ReadPriceList;
|
import forge.quest.io.ReadPriceList;
|
||||||
import forge.util.ItemPool;
|
import forge.util.ItemPool;
|
||||||
import forge.util.gui.SOptionPane;
|
import forge.util.gui.SOptionPane;
|
||||||
@@ -27,10 +28,10 @@ public class QuestSpellShop {
|
|||||||
private static ItemPool<InventoryItem> decksUsingMyCards;
|
private static ItemPool<InventoryItem> decksUsingMyCards;
|
||||||
|
|
||||||
public static Integer getCardValue(final InventoryItem card) {
|
public static Integer getCardValue(final InventoryItem card) {
|
||||||
String ns = null;
|
String ns;
|
||||||
int value = 1337; // previously this was the returned default
|
int value = 1337; // previously this was the returned default
|
||||||
boolean foil = false;
|
boolean foil = false;
|
||||||
int foilMultiplier = 1;
|
int foilMultiplier;
|
||||||
|
|
||||||
if (card instanceof PaperCard) {
|
if (card instanceof PaperCard) {
|
||||||
ns = card.getName() + "|" + ((PaperCard) card).getEdition();
|
ns = card.getName() + "|" + ((PaperCard) card).getEdition();
|
||||||
@@ -104,7 +105,7 @@ public class QuestSpellShop {
|
|||||||
value *= foilMultiplier;
|
value *= foilMultiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Integer.valueOf(value);
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Function<Entry<InventoryItem, Integer>, Comparable<?>> fnPriceCompare = new Function<Entry<InventoryItem, Integer>, Comparable<?>>() {
|
public static final Function<Entry<InventoryItem, Integer>, Comparable<?>> fnPriceCompare = new Function<Entry<InventoryItem, Integer>, Comparable<?>>() {
|
||||||
@@ -128,21 +129,20 @@ public class QuestSpellShop {
|
|||||||
public static final Function<Entry<InventoryItem, Integer>, Comparable<?>> fnDeckCompare = new Function<Entry<InventoryItem, Integer>, Comparable<?>>() {
|
public static final Function<Entry<InventoryItem, Integer>, Comparable<?>> fnDeckCompare = new Function<Entry<InventoryItem, Integer>, Comparable<?>>() {
|
||||||
@Override
|
@Override
|
||||||
public Comparable<?> apply(final Entry<InventoryItem, Integer> from) {
|
public Comparable<?> apply(final Entry<InventoryItem, Integer> from) {
|
||||||
final Integer iValue = decksUsingMyCards.count(from.getKey());
|
return decksUsingMyCards.count(from.getKey());
|
||||||
return iValue == null ? Integer.valueOf(0) : iValue;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
public static final Function<Entry<? extends InventoryItem, Integer>, Object> fnDeckGet = new Function<Entry<? extends InventoryItem, Integer>, Object>() {
|
public static final Function<Entry<? extends InventoryItem, Integer>, Object> fnDeckGet = new Function<Entry<? extends InventoryItem, Integer>, Object>() {
|
||||||
@Override
|
@Override
|
||||||
public Object apply(final Entry<? extends InventoryItem, Integer> from) {
|
public Object apply(final Entry<? extends InventoryItem, Integer> from) {
|
||||||
final Integer iValue = decksUsingMyCards.count(from.getKey());
|
final Integer iValue = decksUsingMyCards.count(from.getKey());
|
||||||
return iValue == null ? "" : iValue.toString();
|
return iValue.toString();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static void buy(Iterable<Entry<InventoryItem, Integer>> items, IItemManager<InventoryItem> shopManager, IItemManager<InventoryItem> inventoryManager, boolean confirmPurchase) {
|
public static void buy(Iterable<Entry<InventoryItem, Integer>> items, IItemManager<InventoryItem> shopManager, IItemManager<InventoryItem> inventoryManager, boolean confirmPurchase) {
|
||||||
long totalCost = 0;
|
long totalCost = 0;
|
||||||
ItemPool<InventoryItem> itemsToBuy = new ItemPool<InventoryItem>(InventoryItem.class);
|
ItemPool<InventoryItem> itemsToBuy = new ItemPool<>(InventoryItem.class);
|
||||||
for (Entry<InventoryItem, Integer> itemEntry : items) {
|
for (Entry<InventoryItem, Integer> itemEntry : items) {
|
||||||
final InventoryItem item = itemEntry.getKey();
|
final InventoryItem item = itemEntry.getKey();
|
||||||
if (item instanceof PaperCard || item instanceof SealedProduct || item instanceof PreconDeck) {
|
if (item instanceof PaperCard || item instanceof SealedProduct || item instanceof PreconDeck) {
|
||||||
@@ -169,7 +169,7 @@ public class QuestSpellShop {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemPool<InventoryItem> itemsToAdd = new ItemPool<InventoryItem>(InventoryItem.class);
|
ItemPool<InventoryItem> itemsToAdd = new ItemPool<>(InventoryItem.class);
|
||||||
|
|
||||||
for (Entry<InventoryItem, Integer> itemEntry : itemsToBuy) {
|
for (Entry<InventoryItem, Integer> itemEntry : itemsToBuy) {
|
||||||
final InventoryItem item = itemEntry.getKey();
|
final InventoryItem item = itemEntry.getKey();
|
||||||
@@ -197,6 +197,7 @@ public class QuestSpellShop {
|
|||||||
booster = (BoosterBox) ((BoosterBox) item).clone();
|
booster = (BoosterBox) ((BoosterBox) item).clone();
|
||||||
}
|
}
|
||||||
FModel.getQuest().getCards().buyPack(booster, value);
|
FModel.getQuest().getCards().buyPack(booster, value);
|
||||||
|
assert booster != null;
|
||||||
final List<PaperCard> newCards = booster.getCards();
|
final List<PaperCard> newCards = booster.getCards();
|
||||||
|
|
||||||
itemsToAdd.addAllFlat(newCards);
|
itemsToAdd.addAllFlat(newCards);
|
||||||
@@ -219,7 +220,7 @@ public class QuestSpellShop {
|
|||||||
|
|
||||||
remainingCards.addAll(((BoxedProduct) booster).getExtraCards());
|
remainingCards.addAll(((BoxedProduct) booster).getExtraCards());
|
||||||
|
|
||||||
if (remainingCards.size() > 0) {
|
if (!remainingCards.isEmpty()) {
|
||||||
GuiBase.getInterface().showCardList(booster.getName(), "You have found the following cards inside:", remainingCards);
|
GuiBase.getInterface().showCardList(booster.getName(), "You have found the following cards inside:", remainingCards);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,7 +253,7 @@ public class QuestSpellShop {
|
|||||||
|
|
||||||
public static void sell(Iterable<Entry<InventoryItem, Integer>> items, IItemManager<InventoryItem> shopManager, IItemManager<InventoryItem> inventoryManager, boolean confirmSale) {
|
public static void sell(Iterable<Entry<InventoryItem, Integer>> items, IItemManager<InventoryItem> shopManager, IItemManager<InventoryItem> inventoryManager, boolean confirmSale) {
|
||||||
long totalReceived = 0;
|
long totalReceived = 0;
|
||||||
ItemPool<InventoryItem> itemsToSell = new ItemPool<InventoryItem>(InventoryItem.class);
|
ItemPool<InventoryItem> itemsToSell = new ItemPool<>(InventoryItem.class);
|
||||||
for (Entry<InventoryItem, Integer> itemEntry : items) {
|
for (Entry<InventoryItem, Integer> itemEntry : items) {
|
||||||
final InventoryItem item = itemEntry.getKey();
|
final InventoryItem item = itemEntry.getKey();
|
||||||
if (item instanceof PaperCard) {
|
if (item instanceof PaperCard) {
|
||||||
@@ -288,10 +289,11 @@ public class QuestSpellShop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void sellExtras(IItemManager<InventoryItem> shopManager, IItemManager<InventoryItem> inventoryManager) {
|
public static void sellExtras(IItemManager<InventoryItem> shopManager, IItemManager<InventoryItem> inventoryManager) {
|
||||||
List<Entry<InventoryItem, Integer>> cardsToRemove = new LinkedList<Map.Entry<InventoryItem,Integer>>();
|
List<Entry<InventoryItem, Integer>> cardsToRemove = new LinkedList<>();
|
||||||
for (Entry<InventoryItem, Integer> item : inventoryManager.getPool()) {
|
for (Entry<InventoryItem, Integer> item : inventoryManager.getPool()) {
|
||||||
PaperCard card = (PaperCard)item.getKey();
|
PaperCard card = (PaperCard)item.getKey();
|
||||||
int numToKeep = card.getRules().getType().isBasic() ? 50 : 4;
|
int numToKeep = card.getRules().getType().isBasic() ?
|
||||||
|
FModel.getQuestPreferences().getPrefInt(QPref.SHOP_EXTRA_BASIC_LANDS_TO_KEEP) : FModel.getQuestPreferences().getPrefInt(QPref.SHOP_EXTRAS_TO_KEEP);
|
||||||
if ("Relentless Rats".equals(card.getName()) || "Shadowborn Apostle".equals(card.getName())) {
|
if ("Relentless Rats".equals(card.getName()) || "Shadowborn Apostle".equals(card.getName())) {
|
||||||
numToKeep = Integer.MAX_VALUE;
|
numToKeep = Integer.MAX_VALUE;
|
||||||
}
|
}
|
||||||
@@ -316,7 +318,7 @@ public class QuestSpellShop {
|
|||||||
|
|
||||||
// fills number of decks using each card
|
// fills number of decks using each card
|
||||||
public static void updateDecksForEachCard() {
|
public static void updateDecksForEachCard() {
|
||||||
decksUsingMyCards = new ItemPool<InventoryItem>(InventoryItem.class);
|
decksUsingMyCards = new ItemPool<>(InventoryItem.class);
|
||||||
for (final Deck deck : FModel.getQuest().getMyDecks()) {
|
for (final Deck deck : FModel.getQuest().getMyDecks()) {
|
||||||
CardPool main = deck.getMain();
|
CardPool main = deck.getMain();
|
||||||
for (final Entry<PaperCard, Integer> e : main) {
|
for (final Entry<PaperCard, Integer> e : main) {
|
||||||
|
|||||||
@@ -154,6 +154,10 @@ public class QuestPreferences extends PreferencesStore<QuestPreferences.QPref> i
|
|||||||
// Wins until the selling price limit is removed
|
// Wins until the selling price limit is removed
|
||||||
SHOP_WINS_FOR_NO_SELL_LIMIT("50"),
|
SHOP_WINS_FOR_NO_SELL_LIMIT("50"),
|
||||||
|
|
||||||
|
//The number of cards to keep before selling
|
||||||
|
SHOP_EXTRAS_TO_KEEP("4"),
|
||||||
|
SHOP_EXTRA_BASIC_LANDS_TO_KEEP("50"),
|
||||||
|
|
||||||
ITEM_LEVEL_RESTRICTION("1");
|
ITEM_LEVEL_RESTRICTION("1");
|
||||||
|
|
||||||
private final String strDefaultVal;
|
private final String strDefaultVal;
|
||||||
@@ -250,54 +254,61 @@ public class QuestPreferences extends PreferencesStore<QuestPreferences.QPref> i
|
|||||||
|
|
||||||
public String validatePreference(final QPref qpref, final int val) {
|
public String validatePreference(final QPref qpref, final int val) {
|
||||||
switch (qpref) {
|
switch (qpref) {
|
||||||
case STARTING_POOL_COLOR_BIAS:
|
case STARTING_POOL_COLOR_BIAS:
|
||||||
if (val < 1) {
|
if (val < 1) {
|
||||||
return "Bias value too small (minimum 1).";
|
return "Bias value too small (minimum 1).";
|
||||||
} else if (val > 100) {
|
} else if (val > 100) {
|
||||||
return "Bias value too large (maximum 100).";
|
return "Bias value too large (maximum 100).";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_LEVEL_RESTRICTION:
|
case ITEM_LEVEL_RESTRICTION:
|
||||||
if (val != 0 && val != 1) {
|
if (val != 0 && val != 1) {
|
||||||
return "Only values 0 or 1 are acceptable; 1 for enabled, 0 for disabled.";
|
return "Only values 0 or 1 are acceptable; 1 for enabled, 0 for disabled.";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SHOP_MAX_PACKS:
|
case SHOP_EXTRA_BASIC_LANDS_TO_KEEP:
|
||||||
case SHOP_MAX_SELLING_PRICE:
|
if (val < 10) {
|
||||||
case SHOP_WINS_FOR_ADDITIONAL_PACK:
|
return "Value too small (minimum 10).";
|
||||||
case WINS_NEW_DRAFT:
|
}
|
||||||
case WINS_ROTATE_DRAFT:
|
break;
|
||||||
case WINS_UNLOCK_SET:
|
|
||||||
if (val < 1) {
|
|
||||||
return "Value too small (minimum 1).";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BOOSTER_COMMONS:
|
case SHOP_MAX_PACKS:
|
||||||
case BOOSTER_UNCOMMONS:
|
case SHOP_MAX_SELLING_PRICE:
|
||||||
case BOOSTER_RARES:
|
case SHOP_WINS_FOR_ADDITIONAL_PACK:
|
||||||
case STARTING_CREDITS_EASY:
|
case SHOP_EXTRAS_TO_KEEP:
|
||||||
case STARTING_CREDITS_MEDIUM:
|
case WINS_NEW_DRAFT:
|
||||||
case STARTING_CREDITS_HARD:
|
case WINS_ROTATE_DRAFT:
|
||||||
case STARTING_CREDITS_EXPERT:
|
case WINS_UNLOCK_SET:
|
||||||
case REWARDS_MILLED:
|
if (val < 1) {
|
||||||
case REWARDS_MULLIGAN0:
|
return "Value too small (minimum 1).";
|
||||||
case REWARDS_ALTERNATIVE:
|
}
|
||||||
case REWARDS_TURN5:
|
break;
|
||||||
case REWARDS_TURN1:
|
|
||||||
case SHOP_MIN_PACKS:
|
case BOOSTER_COMMONS:
|
||||||
case SHOP_STARTING_PACKS:
|
case BOOSTER_UNCOMMONS:
|
||||||
case SHOP_SINGLES_COMMON:
|
case BOOSTER_RARES:
|
||||||
case SHOP_SINGLES_UNCOMMON:
|
case STARTING_CREDITS_EASY:
|
||||||
case SHOP_SINGLES_RARE:
|
case STARTING_CREDITS_MEDIUM:
|
||||||
case SHOP_WINS_FOR_NO_SELL_LIMIT:
|
case STARTING_CREDITS_HARD:
|
||||||
default:
|
case STARTING_CREDITS_EXPERT:
|
||||||
if (val < 0) {
|
case REWARDS_MILLED:
|
||||||
return "Value too small (minimum 0).";
|
case REWARDS_MULLIGAN0:
|
||||||
}
|
case REWARDS_ALTERNATIVE:
|
||||||
break;
|
case REWARDS_TURN5:
|
||||||
|
case REWARDS_TURN1:
|
||||||
|
case SHOP_MIN_PACKS:
|
||||||
|
case SHOP_STARTING_PACKS:
|
||||||
|
case SHOP_SINGLES_COMMON:
|
||||||
|
case SHOP_SINGLES_UNCOMMON:
|
||||||
|
case SHOP_SINGLES_RARE:
|
||||||
|
case SHOP_WINS_FOR_NO_SELL_LIMIT:
|
||||||
|
default:
|
||||||
|
if (val < 0) {
|
||||||
|
return "Value too small (minimum 0).";
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user