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:
Snarling
2022-10-04 06:40:10 -04:00
parent 50f14b4f58
commit aa80cf6451
109 changed files with 400 additions and 1096 deletions
+4 -12
View File
@@ -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