bitburner-src/src/Infiltration/formulas/victory.ts

52 lines
1.7 KiB
TypeScript
Raw Normal View History

import { IPlayer } from "../../PersonObjects/IPlayer";
import { BitNodeMultipliers } from "../../BitNode/BitNodeMultipliers";
import { LocationsMetadata } from "../../Locations/data/LocationsMetadata";
2022-04-22 21:30:49 +02:00
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames";
import { Faction } from "../../Faction/Faction";
export function calculateSellInformationCashReward(
player: IPlayer,
reward: number,
maxLevel: number,
difficulty: number,
): number {
const levelBonus = maxLevel * Math.pow(1.01, maxLevel);
return (
Math.pow(reward + 1, 2) *
Math.pow(difficulty, 3) *
3e3 *
levelBonus *
2022-04-22 21:30:49 +02:00
(player.hasAugmentation(AugmentationNames.WKSharmonizer) ? 1.5 : 1) *
BitNodeMultipliers.InfiltrationMoney
);
}
export function calculateTradeInformationRepReward(
player: IPlayer,
reward: number,
maxLevel: number,
difficulty: number,
): number {
const levelBonus = maxLevel * Math.pow(1.01, maxLevel);
return (
Math.pow(reward + 1, 2) *
Math.pow(difficulty, 3) *
3e3 *
levelBonus *
2022-04-22 21:30:49 +02:00
(player.hasAugmentation(AugmentationNames.WKSharmonizer) ? 1.5 : 1) *
BitNodeMultipliers.InfiltrationMoney
);
}
2022-04-22 21:30:49 +02:00
export function calculateInfiltratorsRepReward(player: IPlayer, faction: Faction, difficulty: number): number {
const maxStartingSecurityLevel = LocationsMetadata.reduce((acc, data): number => {
const startingSecurityLevel = data.infiltrationData?.startingSecurityLevel || 0;
return acc > startingSecurityLevel ? acc : startingSecurityLevel;
}, 0);
2022-04-22 21:30:49 +02:00
const baseRepGain = (difficulty / maxStartingSecurityLevel) * 5000;
2022-04-22 21:30:49 +02:00
return baseRepGain * (player.hasAugmentation(AugmentationNames.WKSharmonizer) ? 2 : 1) * (1 + faction.favor / 100);
}