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:
Michael Ficocelli
2025-07-20 14:01:47 -04:00
committed by GitHub
parent fdafa191ac
commit dd128842af
19 changed files with 311 additions and 124 deletions
+17
View File
@@ -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.`);
}
}
}
}