From 8b47c12f9416dc33b6fcc6beb27ad88a77894d7f Mon Sep 17 00:00:00 2001 From: MouseyPounds Date: Thu, 4 Apr 2024 03:22:15 -0400 Subject: [PATCH] 5.0.4 bugfix 4 Apr 2024 - v5.0.4 - Bugfixes for Prize Tickets, first 10 mystery boxes, and Calico Jack dealer draws --- README.md | 1 + index.html | 7 +++++-- stardew-predictor.js | 24 ++++++++++++++++++++++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index decd11f..231e808 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Please report any bugs, suggestions, or other feedback to [the topic in the Star ## Changelog +* 4 Apr 2024 - v5.0.4 - Bugfixes for Prize Tickets, first 10 mystery boxes, and Calico Jack dealer draws * 30 Mar 2024 - v5.0.3 - Finally added slightly more friendly error-handling * 28 Mar 2024 - v5.0.2 - Fixed precision loss bug in enchantment code * 27 Mar 2024 - v5.0.1 - Update cart item lists for 1.6.3 patch diff --git a/index.html b/index.html index 9a347be..8890247 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,7 @@ - + @@ -68,7 +68,8 @@

Advanced Usage

gameIDidIntegerSets the game seed daysPlayeddpIntegerSets days played which changes where calendar views start dayAdjustdaIntegerOffsets days played by the given amount to deal with old multiplayer bugs -dailyLuckdlFloatSets daily luck for garbage checks; will be forced into range [-0.1, 0.1] +dailyLuckdlFloatSets daily luck for garbage checks; will be forced into range [-0.1, 0.1]
Note, this is raw luck before special charm is taken into account +luckLevelllIntegerSets luck buff level (from food, rings, etc.) geodesCrackedgcIntegerSets number of geodes cracked by the host mysteryBoxesOpenedmbIntegerSets number of mystery boxes opened by the host ticketPrizesClaimedptIntegerSets number of prize ticket rewards claimed by the host @@ -184,6 +185,7 @@

Bookseller

CalicoJack

Predicted results from playing the Blackjack-like card game at the Oasis Casino. The results tell you what actions to take to win the game if possible. The game does not keep a cumulative counts of plays in the save, but instead uses a fresh counter every play session. As a result, the layout of this tab is a little different with two sets of navigation buttons. The top set lets you change the day of prediction, and the bottom set changes number of games played in the current session.

Since one can bet "Double or Nothing" following a win, coins can be quickly accumulated during long win streaks although one must be careful to avoid overflowing their coin count into the negatives. If starting from nothing, overflow would happen on the 22nd consecutive win.

+

Stardew 1.6 added a very rare chance for the dealer to draw a card worth 999 and results in the player winning 3 times their bet. Predictor should indicate when this is likely to happen (the roll is modified by both daily luck and luck buffs) but it does not currently attempt to search out this result.

@@ -636,6 +638,7 @@

Feast of the Winter Star Gift Assignments

Changelog

    +
  • 4 Apr 2024 - v5.0.4 - Bugfixes for Prize Tickets, first 10 mystery boxes, and Calico Jack dealer draws
  • 30 Mar 2024 - v5.0.3 - Finally added slightly more friendly error-handling
  • 28 Mar 2024 - v5.0.2 - Fixed precision loss bug in enchantment code
  • 27 Mar 2024 - v5.0.1 - Update cart item lists for 1.6.3 patch
  • diff --git a/stardew-predictor.js b/stardew-predictor.js index 2207c3c..f5de612 100644 --- a/stardew-predictor.js +++ b/stardew-predictor.js @@ -3377,6 +3377,7 @@ window.onload = function () { save.deepestMineLevel = 0; save.timesFedRaccoons = 0; save.dailyLuck = -.1; + save.luckLevel = 0; save.canHaveChildren = false; save.quarryUnlocked = false; save.desertUnlocked = false; @@ -3758,6 +3759,7 @@ window.onload = function () { wasChanged.timesFedRaccoons = overrideSaveData("timesFedRaccoons", "timesFedRaccoons", "tfr", "int"); wasChanged.visitsUntilY1Guarantee = overrideSaveData("visitsUntilY1Guarantee", "visitsUntilY1Guarantee", "vg", "int"); wasChanged.dailyLuck = overrideSaveData("dailyLuck", "dailyLuck", "dl", "num"); + wasChanged.luckLevel = overrideSaveData("luckLevel", "luckLevel", "ll", "int"); wasChanged.canHaveChildren = overrideSaveData("canHaveChildren", "canHaveChildren", "chc", "bool"); wasChanged.quarryUnlocked = overrideSaveData("quarryUnlocked", "quarryUnlocked", "qu", "bool"); wasChanged.desertUnlocked = overrideSaveData("desertUnlocked", "desertUnlocked", "du", "bool"); @@ -3790,7 +3792,7 @@ window.onload = function () { save.dailyLuck = Math.min(0.1, Math.max(-0.1, save.dailyLuck)); // Add share URL. dayAdjust and all boolean options only included if non-default var share_URL = window.location.protocol + '//' + window.location.host + window.location.pathname + "?id=" + save.gameID + - "&v=" + save.version + "&dp=" + save.daysPlayed + "&dl=" + save.dailyLuck + + "&v=" + save.version + "&dp=" + save.daysPlayed + "&dl=" + save.dailyLuck + "&ll=" + save.luckLevel + "&dml=" + save.deepestMineLevel + "&vg=" + save.visitsUntilY1Guarantee + "&gc=" + save.geodesCracked[0] + "&mb=" + save.mysteryBoxesOpened[0] + "&te=" + save.timesEnchanted[0] + "&tc=" + save.trashCansChecked[0] + "&pt=" + save.ticketPrizesClaimed[0] + "&tfr=" + save.timesFedRaccoons + @@ -3889,6 +3891,7 @@ window.onload = function () { } output += '
    '; output += '' + (wasChanged.dailyLuck ? "*":'') + 'Daily Luck is assumed to be ' + save.dailyLuck + '
    '; + output += '' + (wasChanged.luckLevel ? "*":'') + 'Luck buffs are assumed to be ' + save.luckLevel + '
    '; output += ''; output += '' + (wasChanged.useLegacyRandom ? "*":'') + 'Legacy RNG Seeding is ' + (save.useLegacyRandom ? "on" : "off") + @@ -8131,6 +8134,7 @@ Object.keys(test).forEach(function(key, index) { if (test[key].s > 0 && test[key playerTotal = choice[i].t; r = choice[i].r; var dealerTotal = dealerStart; + var superBust = ''; // playerTotal is guaranteed to be <= 21 here so the conditional is // simplified from what the game does while (dealerTotal < 18 || dealerTotal < playerTotal) { @@ -8143,7 +8147,22 @@ Object.keys(test).forEach(function(key, index) { if (test[key].s > 0 && test[key case 18: autoBust = roll[r++] < .1; break; default: // always keep original draw } - dealerTotal += autoBust ? Math.floor(distance + 3 * roll[r++] + 1) : next; + // We need to calculate the autoBust now even though it might get superseded later + if (autoBust) { + next = Math.floor(distance + 3 * roll[r++] + 1); + } + // The superBust (my term) is luck-based + var minRoll = 0.0005; + var chance = Math.max(0.0005, 0.001 + save.dailyLuck/20 + save.luckLevel*.002); + var sbRoll = roll[r++]; + if (sbRoll < minRoll) { + next = 999; + superBust = "
    Guaranteed super bust with 3x winnings"; + } else if (sbRoll < chance) { + next = 999; + superBust = "
    Probable super bust with 3x winnings"; + } + dealerTotal += next; } if (dealerTotal > 21) { if (choice[i].h === 0) { @@ -8157,6 +8176,7 @@ Object.keys(test).forEach(function(key, index) { if (test[key].s > 0 && test[key havePush = true; advice = "TIE: Hit " + choice[i].h + " time" + (choice[i].h == 1 ? '' : 's') + " and stand at " + playerTotal; } + advice += superBust; } }