Garden Probability Bug Fixes (#1245)

* Fix icons for locked plants in garden not showing

* Fix NaNs for weed mult edge case

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix ESLint issue caused by pre-commit

---------

Co-authored-by: srs42006 <45675882+srs42006@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
srs42006
2025-11-12 03:39:01 -05:00
committed by GitHub
parent 38636f6323
commit acd0fbbaf5
6 changed files with 11 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -43,18 +43,22 @@ export default function CalculateAllPlotChances(minigame, auraMult) {
switch (id) { switch (id) {
case 7: case 7:
ageMult = 1.03; ageMult = 1.03;
weedMult = 1;
range = 1; range = 1;
break; break;
case 31: case 31:
ageMult = 1;
weedMult = 0; weedMult = 0;
range = 2; range = 2;
break; break;
case 32: case 32:
ageMult = 1;
weedMult = 0; weedMult = 0;
range = 1; range = 1;
break; break;
case 33: case 33:
ageMult = 0.5; ageMult = 0.5;
weedMult = 1;
range = 1; range = 1;
break; break;
default: default:

View File

@@ -71,14 +71,11 @@ export default function GardenPlots() {
const showIcon = []; const showIcon = [];
for (const id in minigame.plantsById) { for (const id in minigame.plantsById) {
showIcon[id] = false; showIcon[id] = minigame.plantsById[id].unlocked !== 0;
if (minigame.plantsById[id].unlocked !== 0) {
showIcon[id] = true;
continue; // eslint-disable-line no-continue
}
for (let y = 0; y < 6 && !showIcon[id]; y++) { for (let y = 0; y < 6 && !showIcon[id]; y++) {
for (let x = 0; x < 6; x++) { for (let x = 0; x < 6; x++) {
if (minigame.plot[y][x][0] - 1 === id) { // eslint-disable-next-line eqeqeq
if (minigame.plot[y][x][0] - 1 == id) {
showIcon[id] = true; showIcon[id] = true;
break; break;
} }