Skip to content

Commit

Permalink
Favicon; Baby question for 1.2 save night events
Browse files Browse the repository at this point in the history
  • Loading branch information
MouseyPounds committed May 25, 2018
1 parent 9d4a63e commit e8e038b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
Binary file added EventB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This app simulates the random number generator used in Stardew Valley and makes
The app is written in Javascript and uses jQuery it is hosted on GitHub Pages at https://mouseypounds.github.io/stardew-checkup/ and the source code repository is https://github.com/MouseyPounds/stardew-checkup. It is released under the MIT license.

Changelog
* 24 May 2018 - v1.6 - Favicon; Baby question for 1.2 save night events
* 23 May 2018 - v1.5.1 - Clarification in Night event intro & disclaimer about 1.2
* 21 May 2018 - v1.5 - Night events added; list potential Winter Star gifts
* 7 May 2018 - v1.4 - Geode counter bugfix; additional multiplayer support
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,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>24 May 2018 - v1.6 - Favicon; Baby question for 1.2 save night events</li>
<li>23 May 2018 - v1.5.1 - Clarification in Night event intro & disclaimer about 1.2</li>
<li>21 May 2018 - v1.5 - Night events added; list potential Winter Star gifts.</li>
<li> 7 May 2018 - v1.4 - Geode counter bugfix; additional multiplayer support</li>
Expand Down
22 changes: 22 additions & 0 deletions stardew-predictor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1466,12 +1466,32 @@ window.onload = function () {
});
}
});
// Need to know if the baby question is possible. For now, only doing for 1.2
save.canHaveChildren = false;
if (!save.is1_3) {
var spouse = $(xmlDoc).find('player > spouse').text();
var child_count = 0;
if (typeof(spouse) !== 'undefined' && spouse !== '') {
$(xmlDoc).find('locations > GameLocation').each(function () {
$(this).find('characters > NPC').each(function () {
if ($(this).attr('xsi:type') === 'Child') {
child_count++;
}
});
});
if (child_count < 2) {
save.canHaveChildren = true;
}
}
}

} else if ($.QueryString.hasOwnProperty("id")) {
save.gameID = parseInt($.QueryString.id);
save.daysPlayed = 1;
save.year = 1;
save.geodesCracked = [0];
save.deepestMineLevel = 0;
save.canHaveChildren = false;
save.is1_3 = true;
output += '<span class="result">App run using supplied gameID ' + save.gameID + '.</span><br />' +
'<span class="result">No save information available so minimal progress assumed.</span><br />' +
Expand Down Expand Up @@ -2367,6 +2387,8 @@ window.onload = function () {
rng = new CSRandom(save.gameID / 2 + day + 1);
if (day === 30) {
thisEvent = '<img src="Train.png"><br />Earthquake';
} else if (!save.is1_3 && save.canHaveChildren && rng.NextDouble() < 0.05) {
thisEvent = '<img src="EventB.png"><br />"Want a Baby?"';
} else if (rng.NextDouble() < 0.01 && (month%4) < 3) {
thisEvent = '<img src="EventF.png"><br />Fairy';
} else if (rng.NextDouble() < 0.01) {
Expand Down

0 comments on commit e8e038b

Please sign in to comment.