MISC: Add formulas API for calculating share power and move UI of sharing RAM (#2126)

This commit is contained in:
catloversg
2025-05-11 09:14:15 +07:00
committed by GitHub
parent 22ee7fca2c
commit 849bcb2601
12 changed files with 77 additions and 23 deletions

View File

@@ -5277,6 +5277,15 @@ interface ReputationFormulas {
* @param player - Player info, typically from {@link NS.getPlayer | getPlayer}
*/
donationForRep(reputation: number, player: Person): number;
/**
* Calculate the share power if you call {@link NS.share | ns.share} with the specified number of threads on a server
* having the specified number of CPU cores.
* @param threads - Number of threads. Must be a positive integer.
* @param cpuCores - Number of CPU cores. Must be a positive integer. The default value is 1.
* @returns The calculated share power.
*/
sharePower(threads: number, cpuCores?: number): number;
}
/**
@@ -8355,7 +8364,8 @@ export interface NS {
flags(schema: [string, string | number | boolean | string[]][]): { [key: string]: ScriptArg | string[] };
/**
* Share the server's ram with your factions.
* Share the server's ram with your factions to increase the reputation gain rate of faction work. This boost is
* applied to all faction work of all factions.
* @remarks
* RAM cost: 2.4 GB
*
@@ -8365,8 +8375,8 @@ export interface NS {
share(): Promise<void>;
/**
* Share Power has a multiplicative effect on rep/second while doing work for a faction.
* Share Power increases incrementally for every thread of share running on your server network, but at a sharply decreasing rate.
* Share power has a multiplicative effect on rep/second while doing work for a faction.
* Share power increases incrementally for every thread of share running on your server network, but at a sharply decreasing rate.
* @remarks
* RAM cost: 0.2 GB
*/