Add options to control how much extra credits are given for accumulated wins

This commit is contained in:
Seravy
2018-02-08 12:04:07 +01:00
committed by Seravy
parent 36917c0d18
commit 689e5eecc4
3 changed files with 25 additions and 2 deletions

View File

@@ -242,6 +242,16 @@ public enum VSubmenuQuestPrefs implements IVSubmenu<CSubmenuQuestPrefs> {
pnlRewards.add(new FLabel.Builder().text("Alternative Win").fontAlign(SwingConstants.RIGHT).build(), labelConstraints);
pnlRewards.add(new PrefInput(QPref.REWARDS_ALTERNATIVE, QuestPreferencesErrType.REWARDS), fieldConstraints);
FLabel WinMulti = new FLabel.Builder().text("Bonus Multiplier per Win").fontAlign(SwingConstants.RIGHT).build();
WinMulti.setToolTipText("Each previous win increases your reward by this much after winning a match.");
pnlRewards.add(WinMulti, labelConstraints);
pnlRewards.add(new PrefInput(QPref.REWARDS_WINS_MULTIPLIER, QuestPreferencesErrType.REWARDS), fieldConstraints);
FLabel WinMultiMax = new FLabel.Builder().text("Max Wins for Multiplier").fontAlign(SwingConstants.RIGHT).build();
WinMultiMax.setToolTipText("Reward stops increasing after you have this many wins.");
pnlRewards.add(WinMultiMax, labelConstraints);
pnlRewards.add(new PrefInput(QPref.REWARDS_WINS_MULTIPLIER_MAX, QuestPreferencesErrType.REWARDS), fieldConstraints);
pnlRewards.add(new FLabel.Builder().text("Win by Turn 15").fontAlign(SwingConstants.RIGHT).build(), labelConstraints);
pnlRewards.add(new PrefInput(QPref.REWARDS_TURN15, QuestPreferencesErrType.REWARDS), fieldConstraints);

View File

@@ -229,8 +229,17 @@ public class QuestWinLoseController {
sb.append(StringUtils.capitalize(qEvent.getDifficulty().getTitle()));
sb.append(" opponent: ").append(credBase).append(" credits.\n");
final int creditsForPreviousWins = (int) ((Double.parseDouble(FModel.getQuestPreferences()
.getPref(QPref.REWARDS_WINS_MULTIPLIER)) * qData.getAchievements().getWin()));
final int creditsForPreviousWins;
if (FModel.getQuestPreferences()
.getPrefInt(QPref.REWARDS_WINS_MULTIPLIER_MAX) > qData.getAchievements().getWin()) {
creditsForPreviousWins = (int) ((Double.parseDouble(FModel.getQuestPreferences()
.getPref(QPref.REWARDS_WINS_MULTIPLIER)) * qData.getAchievements().getWin()));
} else {
creditsForPreviousWins = (int) ((Double.parseDouble(FModel.getQuestPreferences()
.getPref(QPref.REWARDS_WINS_MULTIPLIER)) * FModel.getQuestPreferences()
.getPrefInt(QPref.REWARDS_WINS_MULTIPLIER_MAX)));
}
credBase += creditsForPreviousWins;
sb.append("Bonus for previous wins: ").append(creditsForPreviousWins).append(

View File

@@ -55,6 +55,8 @@ public class QuestPreferences extends PreferencesStore<QuestPreferences.QPref> i
// For each of your previous wins gain a small multiplier
// This is here to award long quests with more money for buying expensive cards
REWARDS_WINS_MULTIPLIER("0.3"),
// Rewards stop increasing after this many wins
REWARDS_WINS_MULTIPLIER_MAX("300"),
// Winning each game by other means "Poison", "Milling" or "Alternative" Win
REWARDS_POISON("50"),
@@ -311,6 +313,8 @@ public class QuestPreferences extends PreferencesStore<QuestPreferences.QPref> i
case STARTING_CREDITS_MEDIUM:
case STARTING_CREDITS_HARD:
case STARTING_CREDITS_EXPERT:
case REWARDS_WINS_MULTIPLIER:
case REWARDS_WINS_MULTIPLIER_MAX:
case REWARDS_MILLED:
case REWARDS_MULLIGAN0:
case REWARDS_ALTERNATIVE: