some chagens

This commit is contained in:
Olivier Gagnon 2022-01-15 17:52:50 -05:00
parent 59100e33e0
commit de64777c75
3 changed files with 2 additions and 15 deletions

@ -1,6 +1,6 @@
import { CompanyPosition } from "./CompanyPosition"; import { CompanyPosition } from "./CompanyPosition";
import * as posNames from "./data/companypositionnames"; import * as posNames from "./data/companypositionnames";
import { favorToRep, repToFavor } from "./formulas/favor"; import { favorToRep, repToFavor } from "../Faction/formulas/favor";
import { IMap } from "../types"; import { IMap } from "../types";

@ -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.
}

@ -1320,7 +1320,7 @@ export interface TIX {
/** /**
* Singularity API * Singularity API
* @remarks * @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 * @public
*/ */
export interface Singularity { export interface Singularity {