mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 17:53:55 +01:00
Add calculateFavorToRep and calculateRepToFavor to Formulas.exe
The favorToRep and repToFavor formulas are displayed to the player in the factions pages but were not available in Formulas.exe. This change adds a FactionsFormulas interface with the calculateFavorToRep and calculateRepToFavor as new functions.
This commit is contained in:
parent
d04e05eac8
commit
a0333d36a5
@ -37,6 +37,10 @@ import {
|
|||||||
calculateAscensionMult,
|
calculateAscensionMult,
|
||||||
calculateAscensionPointsGain,
|
calculateAscensionPointsGain,
|
||||||
} from "../Gang/formulas/formulas";
|
} from "../Gang/formulas/formulas";
|
||||||
|
import {
|
||||||
|
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 {
|
||||||
@ -45,6 +49,18 @@ export function NetscriptFormulas(player: IPlayer, workerScript: WorkerScript, h
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
|
factions: {
|
||||||
|
calculateFavorToRep: function (_favor: unknown): number {
|
||||||
|
const favor = helper.number("calculateFavorToRep", "favor", _favor);
|
||||||
|
checkFormulasAccess("factions.calculateFavorToRep");
|
||||||
|
return calculateFavorToRep(favor);
|
||||||
|
},
|
||||||
|
calculateRepToFavor: function (_rep: unknown): number {
|
||||||
|
const rep = helper.number("calculateRepToFavor", "rep", _rep);
|
||||||
|
checkFormulasAccess("factions.calculateRepToFavor");
|
||||||
|
return calculateRepToFavor(rep);
|
||||||
|
},
|
||||||
|
},
|
||||||
skills: {
|
skills: {
|
||||||
calculateSkill: function (_exp: unknown, _mult: unknown = 1): number {
|
calculateSkill: function (_exp: unknown, _mult: unknown = 1): number {
|
||||||
const exp = helper.number("calculateSkill", "exp", _exp);
|
const exp = helper.number("calculateSkill", "exp", _exp);
|
||||||
|
Loading…
Reference in New Issue
Block a user