mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
Readded randomness for lower values of chances
This commit is contained in:
parent
a1ff3a2058
commit
fd9bdb3b65
@ -262,9 +262,16 @@ const Engine: {
|
|||||||
// Generate coding contracts
|
// Generate coding contracts
|
||||||
if (Player.sourceFiles.length > 0) {
|
if (Player.sourceFiles.length > 0) {
|
||||||
let numContracts = 0;
|
let numContracts = 0;
|
||||||
if (contractChancesWhileOffline > 0) {
|
if (contractChancesWhileOffline > 100) {
|
||||||
numContracts += Math.floor(contractChancesWhileOffline * 0.25);
|
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++) {
|
for (let i = 0; i < numContracts; i++) {
|
||||||
generateRandomContract();
|
generateRandomContract();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user