-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
I noticed in the fandom page that Borehole will give 1-3 alien alloys for the first visit with some probability. Are the chances of getting either 1, 2 or 3 alien alloys intended to be equal? If yes, the code does not seem to confirm to that.
To elaborate, loot calculation is handled by the following code in events.js:927
var num = Math.floor(Math.random() * (loot.max - loot.min)) + loot.min;
Math.random() returns x, a float, where 0 <= x < 1
Since loot.max = 3 and loot.min = 1 for boreholes, we get Math.floor(y) where 0 <= y < 2.
So, num will always be either 1 or 2.
This applies to loot calculation in the entire game.
IMHO, the correct implementation should have been
var num = Math.floor(Math.random() * (loot.max + 1 - loot.min)) + loot.min;
And I could be completely wrong and the game is designed to give only 1-2 alien alloy on the undiscovered visits. :)