Skip to content

Commit

Permalink
fix for geode predictions
Browse files Browse the repository at this point in the history
  • Loading branch information
MouseyPounds committed Dec 28, 2020
1 parent 51c89a2 commit a33f8a8
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

This app simulates the random number generator used in [Stardew Valley](http://stardewvalley.net/) and makes "predictions" about the game either from the Game ID or by reading the save file. Currently, the information predicted includes special mine levels (mushroom floor & infestations), items sold by the traveling merchant & Krobus, results from cracking geodes, the train schedule, and the gift exchange of the Feast of the Winter Star.

All changed & added content from version 1.3 should be supported; 1.3-specific features will only appear in the results if either the save is detected to be from that version or the app is launched with a URL id parameter. Please report any bugs, suggestions, or other feedback to the [topic in the official forums](https://community.playstarbound.com/threads/webapp-stardew-predictor-gaze-into-the-future-of-your-farm.141370/).
All changed & added content from version 1.3 should be supported; 1.3-specific features will only appear in the results if either the save is detected to be from that version or the app is launched with a URL id parameter. Please report any bugs, suggestions, or other feedback to the [topic in the Chucklefish forums](https://community.playstarbound.com/threads/webapp-stardew-predictor-gaze-into-the-future-of-your-farm.141370/).

The app is written in Javascript and uses [jQuery](https://jquery.com/) and [BigInteger.js](https://github.com/peterolson/BigInteger.js); it is hosted on GitHub Pages at https://mouseypounds.github.io/stardew-predictor/ and the source code repository is https://github.com/MouseyPounds/stardew-predictor. It is released under the MIT license.

## Changelog

* 28 Dec 2020 - v4.0.1 - Fixed geode predictions
* 22 Dec 2020 - v4.0 - Initial support for Stardew Valley 1.5
* 24 Jul 2020 - v3.1.3 - Updated forum link in footer
* 6 Mar 2020 - v3.1.2 - Fixed Krobus search
Expand Down
Binary file modified all_icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="./jquery-3.2.1.min.js"><\/script>')</script>
<script src="./cs-random.js"></script>
<script src="./stardew-predictor.js?v=4.0"></script>
<script src="./stardew-predictor.js?v=4.0.1"></script>
<script src="./BigInteger.min.js"></script>

</head>
Expand All @@ -40,7 +40,7 @@ <h2 id="sec_about">About</h2>
<p>Most changed &amp; added content from version 1.5 is supported. <span class="strong note">While the app tries to detect the version in the save and use
prediction logic specific to that version, it will spoil some new features regardless. You have been warned.</span> </p>
<p>The app is written in Javascript and uses <a href="https://jquery.com/">jQuery</a>, <a href="https://github.com/peterolson/BigInteger.js">BigInteger.js</a>, and <a href="https://github.com/substack/semver-compare">semver-compare</a>; it is hosted on GitHub Pages at <a href="https://mouseypounds.github.io/stardew-predictor/">https://mouseypounds.github.io/stardew-predictor/</a> and the source code repository is <a href="https://github.com/MouseyPounds/stardew-predictor">https://github.com/MouseyPounds/stardew-predictor</a>.
Please report any bugs, suggestions, or other feedback to <a href="https://community.playstarbound.com/threads/webapp-stardew-predictor-gaze-into-the-future-of-your-farm.141370/">the topic in the official forums.</a></p>
Please report any bugs, suggestions, or other feedback to <a href="https://community.playstarbound.com/threads/webapp-stardew-predictor-gaze-into-the-future-of-your-farm.141370/">the topic in the Chucklefish forums.</a></p>
</div>

<div id="input-container" class="panel">
Expand Down Expand Up @@ -221,6 +221,7 @@ <h3>Geode Processing</h3>
Note that in multiplayer, each player's geode count is tracked separately; the browse results are initially set and highlighted
based on the host's count.</p>
<p>In 1.5, the Golden Coconut is a new geode-type item with its own item pool. There is a small chance for a rolled item to be replaced with the Golden Helmet; browsing results will show this potential replacement, but the player will only actually receive the hat if they have not previously gotten one. Note that potential donations for the new Field Office are not currently checked, although only one donatable item (the Fossilized Skull) can be found this way.</p>
<p>Also in 1.5, if the Qi's Crop Challenge is active, all geode types may drop either 1 or 5 Qi Beans instead of their normal items. This situation is also shown on browsing results.</p>
<p class="note">Mod note: If you play with the <a href="https://www.nexusmods.com/stardewvalley/mods/2761">Artifact System Fixed</a> mod and enable its geode changes, the predictions listed here may not be accurate.</p>
<fieldset id="geode-search">
<input type="text" id="geode-search-text" class="search">
Expand Down Expand Up @@ -395,6 +396,7 @@ <h3>Feast of the Winter Star Gift Assignments</h3>
<noscript><span class="error">Javascript appears to be unsupported by or disabled in your browser. Stardew Predictor will not work without it.</span></noscript>
<h2 id="sec_changelog">Changelog</h2>
<ul>
<li>28 Dec 2020 - v4.0.1 - Fixed geode predictions</li>
<li>22 Dec 2020 - v4.0 - Initial support for Stardew Valley 1.5</li>
<li>24 Jul 2020 - v3.1.3 - Updated forum link in footer</li>
<li> 6 Mar 2020 - v3.1.2 - Fixed Krobus search</li>
Expand Down
3 changes: 3 additions & 0 deletions stardew-predictor.css
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ img#icon_d {
img#icon_h {
background-position: -96px -112px;
}
img#icon_b {
background-position: -112px -112px;
}
img#enchant_w {
background-position: 0px -128px;
}
Expand Down
25 changes: 22 additions & 3 deletions stardew-predictor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3770,6 +3770,8 @@ window.onload = function () {
g,
c,
couldBeHat,
couldBeBeans,
couldBeBeansTrove,
roll,
next,
tclass,
Expand Down Expand Up @@ -3848,6 +3850,9 @@ window.onload = function () {
rng.NextDouble();
rngTrove.NextDouble();
}
// The Qi Bean check.
couldBeBeans = (rng.NextDouble() < 0.1);
couldBeBeansTrove = (rngTrove.NextDouble() < 0.1);
// Rolling troves and coconuts now
c = rngTrove.NextDouble();
item.push(save.minerals[save.geodeContents[275][Math.floor(c*save.geodeContents[275].length)]]);
Expand Down Expand Up @@ -4071,6 +4076,9 @@ window.onload = function () {
rng.NextDouble();
rngTrove.NextDouble();
}
// The Qi Bean check.
couldBeBeans = (rng.NextDouble() < 0.1);
couldBeBeansTrove = (rngTrove.NextDouble() < 0.1);
// Rolling troves and coconuts now
c = rngTrove.NextDouble();
item.push(save.minerals[save.geodeContents[275][Math.floor(c*save.geodeContents[275].length)]]);
Expand Down Expand Up @@ -4199,18 +4207,29 @@ window.onload = function () {
if (couldBeHat) {
itemIcon = ' <span data-tooltip="Could be Golden Helmet"><img src="blank.png" class="icon" id="icon_h" alt="Could be Golden Helmet"></span>';
}

if (couldBeBeansTrove) {
itemIcon += ' <span data-tooltip="Could be Qi Beans"><img src="blank.png" class="icon" id="icon_b" alt="Could be Qi Beans"></span>';
}
} else {
if (!save.donatedItems.hasOwnProperty(item[c])) {
itemIcon = ' <span data-tooltip="Need to Donate"><img src="blank.png" class="icon" id="gunther" alt="Need to Donate"></span>';
}
}
if (c === 4) {
if (couldBeBeansTrove) {
itemIcon += ' <span data-tooltip="Could be Qi Beans"><img src="blank.png" class="icon" id="icon_b" alt="Could be Qi Beans"></span>';
}
} else {
if (couldBeBeans) {
itemIcon += ' <span data-tooltip="Could be Qi Beans"><img src="blank.png" class="icon" id="icon_b" alt="Could be Qi Beans"></span>';
}
}
}
output += '<td class="item">' + wikify(item[c]) + itemIcon + '</td><td>' + itemQty[c] + '</td>';
}
output += '</tr>';
}
}
output += '<tr><td colspan="' + (1 + 2*numColumns) + '" class="legend">Note: <img src="blank.png" class="icon" id="gunther" alt="Need to Donate"> denotes items ' + 'which need to be donated to the ' + wikify('Museum') + ' and <img src="blank.png" class="icon" id="icon_h" alt="Could be Golden Coconut Hat"> denotes items which will be replaced by the ' + wikify('Golden Helmet') + ' if applicable.</td></tr>';
output += '<tr><td colspan="' + (1 + 2*numColumns) + '" class="legend">Note: <img src="blank.png" class="icon" id="gunther" alt="Need to Donate"> denotes items ' + 'which need to be donated to the ' + wikify('Museum') + '<br /> <img src="blank.png" class="icon" id="icon_b" alt="Could be Qi Beans"> denotes items which will be replaced ' + wikify('Qi Beans') + ' and <img src="blank.png" class="icon" id="icon_h" alt="Could be Golden Coconut Hat"> denotes items which will be replaced by the ' + wikify('Golden Helmet') + ' if applicable.</td></tr>';
output += '</tbody></table>';
return output;
}
Expand Down

0 comments on commit a33f8a8

Please sign in to comment.