mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 14:59:16 +02:00
52 lines
1.7 KiB
TypeScript
52 lines
1.7 KiB
TypeScript
import { Player } from "@player";
|
|
import { currentNodeMults } from "../../BitNode/BitNodeMultipliers";
|
|
import { LocationsMetadata } from "../../Locations/data/LocationsMetadata";
|
|
import { AugmentationName } from "@enums";
|
|
import { Faction } from "../../Faction/Faction";
|
|
|
|
export function calculateSellInformationCashReward(
|
|
reward: number,
|
|
maxLevel: number,
|
|
startingSecurityLevel: number,
|
|
): number {
|
|
const levelBonus = maxLevel * Math.pow(1.01, maxLevel);
|
|
|
|
return (
|
|
Math.pow(reward + 1, 2) *
|
|
Math.pow(startingSecurityLevel, 3) *
|
|
3e3 *
|
|
levelBonus *
|
|
(Player.hasAugmentation(AugmentationName.WKSharmonizer, true) ? 1.5 : 1) *
|
|
currentNodeMults.InfiltrationMoney
|
|
);
|
|
}
|
|
|
|
export function calculateTradeInformationRepReward(
|
|
reward: number,
|
|
maxLevel: number,
|
|
startingSecurityLevel: number,
|
|
): number {
|
|
const levelBonus = maxLevel * Math.pow(1.01, maxLevel);
|
|
|
|
return (
|
|
Math.pow(reward + 1, 1.1) *
|
|
Math.pow(startingSecurityLevel, 1.2) *
|
|
30 *
|
|
levelBonus *
|
|
(Player.hasAugmentation(AugmentationName.WKSharmonizer, true) ? 1.5 : 1) *
|
|
currentNodeMults.InfiltrationRep
|
|
);
|
|
}
|
|
|
|
export function calculateInfiltratorsRepReward(faction: Faction, startingSecurityLevel: number): number {
|
|
const maxStartingSecurityLevel = LocationsMetadata.reduce((acc, data): number => {
|
|
const startingSecurityLevel = data.infiltrationData?.startingSecurityLevel || 0;
|
|
return acc > startingSecurityLevel ? acc : startingSecurityLevel;
|
|
}, 0);
|
|
const baseRepGain = (startingSecurityLevel / maxStartingSecurityLevel) * 5000;
|
|
|
|
return (
|
|
baseRepGain * (Player.hasAugmentation(AugmentationName.WKSharmonizer, true) ? 2 : 1) * (1 + faction.favor / 100)
|
|
);
|
|
}
|