mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 14:59:16 +02:00
rename factions formulas to reputation
This commit is contained in:
@@ -37,10 +37,7 @@ import {
|
|||||||
calculateAscensionMult,
|
calculateAscensionMult,
|
||||||
calculateAscensionPointsGain,
|
calculateAscensionPointsGain,
|
||||||
} from "../Gang/formulas/formulas";
|
} from "../Gang/formulas/formulas";
|
||||||
import {
|
import { favorToRep as calculateFavorToRep, repToFavor as calculateRepToFavor } from "../Faction/formulas/favor";
|
||||||
favorToRep as calculateFavorToRep,
|
|
||||||
repToFavor as calculateRepToFavor,
|
|
||||||
} from "../Faction/formulas/favor";
|
|
||||||
|
|
||||||
export function NetscriptFormulas(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): IFormulas {
|
export function NetscriptFormulas(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): IFormulas {
|
||||||
const checkFormulasAccess = function (func: string): void {
|
const checkFormulasAccess = function (func: string): void {
|
||||||
@@ -49,15 +46,15 @@ export function NetscriptFormulas(player: IPlayer, workerScript: WorkerScript, h
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
factions: {
|
reputation: {
|
||||||
calculateFavorToRep: function (_favor: unknown): number {
|
calculateFavorToRep: function (_favor: unknown): number {
|
||||||
const favor = helper.number("calculateFavorToRep", "favor", _favor);
|
const favor = helper.number("calculateFavorToRep", "favor", _favor);
|
||||||
checkFormulasAccess("factions.calculateFavorToRep");
|
checkFormulasAccess("reputation.calculateFavorToRep");
|
||||||
return calculateFavorToRep(favor);
|
return calculateFavorToRep(favor);
|
||||||
},
|
},
|
||||||
calculateRepToFavor: function (_rep: unknown): number {
|
calculateRepToFavor: function (_rep: unknown): number {
|
||||||
const rep = helper.number("calculateRepToFavor", "rep", _rep);
|
const rep = helper.number("calculateRepToFavor", "rep", _rep);
|
||||||
checkFormulasAccess("factions.calculateRepToFavor");
|
checkFormulasAccess("reputation.calculateRepToFavor");
|
||||||
return calculateRepToFavor(rep);
|
return calculateRepToFavor(rep);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
12
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
12
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@@ -3798,23 +3798,23 @@ interface SkillsFormulas {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factions formulas
|
* Reputation formulas
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
interface FactionsFormulas {
|
interface ReputationFormulas {
|
||||||
/**
|
/**
|
||||||
* Calculate the total required amount of faction reputation to reach a target favor.
|
* Calculate the total required amount of faction reputation to reach a target favor.
|
||||||
* @param favor - target faction favor.
|
* @param favor - target faction favor.
|
||||||
* @returns The calculated faction reputation required.
|
* @returns The calculated faction reputation required.
|
||||||
*/
|
*/
|
||||||
calculateFavorToRep(favor: number): number;
|
calculateFavorToRep(favor: number): number;
|
||||||
/**
|
/**
|
||||||
* Calculate the resulting faction favor of a total amount of reputation.
|
* Calculate the resulting faction favor of a total amount of reputation.
|
||||||
* (Faction favor is gained whenever you install an Augmentation.)
|
* (Faction favor is gained whenever you install an Augmentation.)
|
||||||
* @param rep - amount of reputation.
|
* @param rep - amount of reputation.
|
||||||
* @returns The calculated faction favor.
|
* @returns The calculated faction favor.
|
||||||
*/
|
*/
|
||||||
calculateRepToFavor(rep: number): number;
|
calculateRepToFavor(rep: number): number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -4059,8 +4059,8 @@ interface GangFormulas {
|
|||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
export interface Formulas {
|
export interface Formulas {
|
||||||
/** Factions formulas */
|
/** Reputation formulas */
|
||||||
factions: FactionsFormulas;
|
reputation: ReputationFormulas;
|
||||||
/** Skills formulas */
|
/** Skills formulas */
|
||||||
skills: SkillsFormulas;
|
skills: SkillsFormulas;
|
||||||
/** Hacking formulas */
|
/** Hacking formulas */
|
||||||
|
|||||||
Reference in New Issue
Block a user