mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-03 06:17:04 +02:00
See description
Reverted ToastVariant back to an enum internally. Still exposed to player as just possible strings. Changed all 1-line documentation comments to actually be 1-line. Moved some because they were not providing documentation for the thing they were trying to.
This commit is contained in:
+4
-12
@@ -3,9 +3,7 @@ import { Person } from "./PersonObjects/Person";
|
||||
import { calculateIntelligenceBonus } from "./PersonObjects/formulas/intelligence";
|
||||
import { Server } from "./Server/Server";
|
||||
|
||||
/**
|
||||
* Returns the chance the person has to successfully hack a server
|
||||
*/
|
||||
/** Returns the chance the person has to successfully hack a server */
|
||||
export function calculateHackingChance(server: Server, person: Person): number {
|
||||
const hackFactor = 1.75;
|
||||
const difficultyMult = (100 - server.hackDifficulty) / 100;
|
||||
@@ -64,9 +62,7 @@ export function calculatePercentMoneyHacked(server: Server, person: Person): num
|
||||
return percentMoneyHacked;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns time it takes to complete a hack on a server, in seconds
|
||||
*/
|
||||
/** Returns time it takes to complete a hack on a server, in seconds */
|
||||
export function calculateHackingTime(server: Server, person: Person): number {
|
||||
const difficultyMult = server.requiredHackingSkill * server.hackDifficulty;
|
||||
|
||||
@@ -85,18 +81,14 @@ export function calculateHackingTime(server: Server, person: Person): number {
|
||||
return hackingTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns time it takes to complete a grow operation on a server, in seconds
|
||||
*/
|
||||
/** Returns time it takes to complete a grow operation on a server, in seconds */
|
||||
export function calculateGrowTime(server: Server, person: Person): number {
|
||||
const growTimeMultiplier = 3.2; // Relative to hacking time. 16/5 = 3.2
|
||||
|
||||
return growTimeMultiplier * calculateHackingTime(server, person);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns time it takes to complete a weaken operation on a server, in seconds
|
||||
*/
|
||||
/** Returns time it takes to complete a weaken operation on a server, in seconds */
|
||||
export function calculateWeakenTime(server: Server, person: Person): number {
|
||||
const weakenTimeMultiplier = 4; // Relative to hacking time
|
||||
|
||||
|
||||
Reference in New Issue
Block a user