mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-30 21:07:04 +02:00
INFIL: Add stat requirements; Add market consequences for spamming infiltration (#2210)
The primary parts are changing the way stats affect infiltration difficulty, to make rewards more intuitive and balanced, and adding a "market demand" mechanism, which kicks in when doing lots of infils quickly. With current parameters, market demand shouldn't affect manual play at all, and won't affect most auto-infil terribly (it depends how they're implemented). This was a complex change, see PR #2210 for the full context
This commit is contained in:
committed by
GitHub
parent
fdafa191ac
commit
dd128842af
@@ -72,3 +72,20 @@ export function assertArray(v: unknown): asserts v is unknown[] {
|
||||
throw new TypeAssertionError(`The value is not an array. Its type is ${type}.`, type);
|
||||
}
|
||||
}
|
||||
|
||||
export function assertNumberArray(unknownData: unknown, assertFinite = false): asserts unknownData is number[] {
|
||||
assertArray(unknownData);
|
||||
for (const value of unknownData) {
|
||||
if (assertFinite) {
|
||||
if (!Number.isFinite(value)) {
|
||||
console.error("The array contains a value that is not a finite number. Array:", unknownData);
|
||||
throw new Error(`${value} is not a number.`);
|
||||
}
|
||||
} else {
|
||||
if (typeof value !== "number") {
|
||||
console.error("The array contains a value that is not a number. Array:", unknownData);
|
||||
throw new Error(`${value} is not a number.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user