Readded randomness for lower values of chances

This commit is contained in:
G4mingJon4s 2022-09-26 19:19:03 +02:00
parent a1ff3a2058
commit fd9bdb3b65

@ -262,9 +262,16 @@ const Engine: {
// Generate coding contracts
if (Player.sourceFiles.length > 0) {
let numContracts = 0;
if (contractChancesWhileOffline > 0) {
if (contractChancesWhileOffline > 100) {
numContracts += Math.floor(contractChancesWhileOffline * 0.25);
}
if (contractChancesWhileOffline > 0 && contractChancesWhileOffline <= 100) {
for (let i = 0; i < contractChancesWhileOffline; ++i) {
if (Math.random() <= 0.25) {
numContracts++;
}
}
}
for (let i = 0; i < numContracts; i++) {
generateRandomContract();
}