API: Add weakenEffect to formulas.hacking namespace (#2626)

This commit is contained in:
Lee Stutzman
2026-04-11 00:36:45 +01:00
committed by GitHub
parent 8cbd6ff9e1
commit fb3fa00b3d
7 changed files with 135 additions and 1 deletions

View File

@@ -6299,6 +6299,16 @@ interface HackingFormulas {
* @returns The calculated weaken time, in milliseconds.
*/
weakenTime(server: Server, player: Person): number;
/**
* Calculate the security decrease from a weaken operation.
* Unlike other hacking formulas, weaken effect depends only on thread count and
* core count, not on server or player properties. The core bonus formula is
* {@code 1 + (cores - 1) / 16}.
* @param threads - Number of threads running weaken.
* @param cores - Number of cores on the host server. Default 1.
* @returns The security decrease amount.
*/
weakenEffect(threads: number, cores?: number): number;
}
/**