mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-29 20:37:05 +02:00
Merge branch 'dev' into bugfix/corp-updates
This commit is contained in:
@@ -353,7 +353,8 @@ export function NetscriptBladeburner(
|
||||
checkBladeburnerCity("switchCity", cityName);
|
||||
const bladeburner = player.bladeburner;
|
||||
if (bladeburner === null) throw new Error("Should not be called without Bladeburner");
|
||||
return bladeburner.city === cityName;
|
||||
bladeburner.city = cityName;
|
||||
return true;
|
||||
},
|
||||
getStamina: function (): [number, number] {
|
||||
helper.updateDynamicRam("getStamina", getRamCost(player, "bladeburner", "getStamina"));
|
||||
|
||||
@@ -37,6 +37,7 @@ import {
|
||||
calculateAscensionMult,
|
||||
calculateAscensionPointsGain,
|
||||
} 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 {
|
||||
const checkFormulasAccess = function (func: string): void {
|
||||
@@ -45,6 +46,18 @@ export function NetscriptFormulas(player: IPlayer, workerScript: WorkerScript, h
|
||||
}
|
||||
};
|
||||
return {
|
||||
reputation: {
|
||||
calculateFavorToRep: function (_favor: unknown): number {
|
||||
const favor = helper.number("calculateFavorToRep", "favor", _favor);
|
||||
checkFormulasAccess("reputation.calculateFavorToRep");
|
||||
return calculateFavorToRep(favor);
|
||||
},
|
||||
calculateRepToFavor: function (_rep: unknown): number {
|
||||
const rep = helper.number("calculateRepToFavor", "rep", _rep);
|
||||
checkFormulasAccess("reputation.calculateRepToFavor");
|
||||
return calculateRepToFavor(rep);
|
||||
},
|
||||
},
|
||||
skills: {
|
||||
calculateSkill: function (_exp: unknown, _mult: unknown = 1): number {
|
||||
const exp = helper.number("calculateSkill", "exp", _exp);
|
||||
|
||||
@@ -3,7 +3,7 @@ import { BaseServer } from "../Server/BaseServer";
|
||||
|
||||
export interface INetscriptHelper {
|
||||
updateDynamicRam(functionName: string, ram: number): void;
|
||||
makeRuntimeErrorMsg(functionName: string, message: string): void;
|
||||
makeRuntimeErrorMsg(functionName: string, message: string): string;
|
||||
string(funcName: string, argName: string, v: unknown): string;
|
||||
number(funcName: string, argName: string, v: unknown): number;
|
||||
city(funcName: string, argName: string, v: unknown): CityName;
|
||||
|
||||
Reference in New Issue
Block a user