From de64777c75316fdb845d9148352fb10dfea29e36 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Sat, 15 Jan 2022 17:52:50 -0500 Subject: [PATCH] some chagens --- src/Company/Company.ts | 2 +- src/Company/formulas/favor.ts | 13 ------------- src/ScriptEditor/NetscriptDefinitions.d.ts | 2 +- 3 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 src/Company/formulas/favor.ts diff --git a/src/Company/Company.ts b/src/Company/Company.ts index 43f6fa855..9569964e6 100644 --- a/src/Company/Company.ts +++ b/src/Company/Company.ts @@ -1,6 +1,6 @@ import { CompanyPosition } from "./CompanyPosition"; import * as posNames from "./data/companypositionnames"; -import { favorToRep, repToFavor } from "./formulas/favor"; +import { favorToRep, repToFavor } from "../Faction/formulas/favor"; import { IMap } from "../types"; diff --git a/src/Company/formulas/favor.ts b/src/Company/formulas/favor.ts deleted file mode 100644 index 73790544b..000000000 --- a/src/Company/formulas/favor.ts +++ /dev/null @@ -1,13 +0,0 @@ -// The initial formulas was sum 0 to f of 500*1.02^f. -// see https://en.wikipedia.org/wiki/Geometric_series#Closed-form_formula -// for information on how to calculate this - -export function favorToRep(f: number): number { - const raw = 25000 * (Math.pow(1.02, f) - 1); - return Math.round(raw * 10000) / 10000; // round to make things easier. -} - -export function repToFavor(r: number): number { - const raw = Math.log(r / 25000 + 1) / Math.log(1.02); - return Math.round(raw * 10000) / 10000; // round to make things easier. -} diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index b5630b1fd..cc33b1ec0 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -1320,7 +1320,7 @@ export interface TIX { /** * Singularity API * @remarks - * This API requires Source-File 4 level 1 to use. The RAM cost of all these functions is multiplied by 16/4/1 based on Source-File 4 levels. + * This API requires Source-File 4 to use. The RAM cost of all these functions is multiplied by 16/4/1 based on Source-File 4 levels. * @public */ export interface Singularity {