2022-03-27 09:53:13 +02:00
|
|
|
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";
|
2022-03-27 09:53:13 +02:00
|
|
|
|
|
|
|
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) *
|
2022-03-27 09:53:13 +02:00
|
|
|
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) *
|
2022-03-27 09:53:13 +02:00
|
|
|
BitNodeMultipliers.InfiltrationMoney
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2022-04-22 21:30:49 +02:00
|
|
|
export function calculateInfiltratorsRepReward(player: IPlayer, faction: Faction, difficulty: number): number {
|
2022-03-27 09:53:13 +02:00
|
|
|
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-03-27 09:53:13 +02:00
|
|
|
|
2022-04-22 21:30:49 +02:00
|
|
|
return baseRepGain * (player.hasAugmentation(AugmentationNames.WKSharmonizer) ? 2 : 1) * (1 + faction.favor / 100);
|
2022-03-27 09:53:13 +02:00
|
|
|
}
|