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

@@ -126,6 +126,17 @@ Calculate hack percent for one thread. (Ex: 0.25 would steal 25% of the server's
Calculate hack time.
</td></tr>
<tr><td>
[weakenEffect(threads, cores)](./bitburner.hackingformulas.weakeneffect.md)
</td><td>
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 .
</td></tr>
<tr><td>

View File

@@ -0,0 +1,72 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HackingFormulas](./bitburner.hackingformulas.md) &gt; [weakenEffect](./bitburner.hackingformulas.weakeneffect.md)
## HackingFormulas.weakenEffect() method
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 .
**Signature:**
```typescript
weakenEffect(threads: number, cores?: number): number;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
threads
</td><td>
number
</td><td>
Number of threads running weaken.
</td></tr>
<tr><td>
cores
</td><td>
number
</td><td>
_(Optional)_ Number of cores on the host server. Default 1.
</td></tr>
</tbody></table>
**Returns:**
number
The security decrease amount.