moved over to player stats

* added new augmentations
This commit is contained in:
phyzical 2022-03-27 12:26:43 +08:00
parent e11cc1946e
commit 7f28158005
14 changed files with 267 additions and 25 deletions

@ -9,6 +9,7 @@ import { numeralWrapper } from "../ui/numeralFormat";
import { Money } from "../ui/React/Money";
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver";
import { FactionNames } from "../Faction/data/FactionNames";
export interface IConstructorParams {
info: string | JSX.Element;
@ -50,6 +51,12 @@ export interface IConstructorParams {
bladeburner_stamina_gain_mult?: number;
bladeburner_analysis_mult?: number;
bladeburner_success_chance_mult?: number;
infiltration_base_rep_increase?: number;
infiltration_rep_mult?: number;
infiltration_trade_mult?: number;
infiltration_sell_mult?: number;
infiltration_timer_mult?: number;
infiltration_health_reduction_mult?: number;
startingMoney?: number;
programs?: string[];
@ -338,6 +345,48 @@ function generateStatsDescription(mults: IMap<number>, programs?: string[], star
<br />+{f(mults.bladeburner_success_chance_mult - 1)} Bladeburner Contracts and Operations success chance
</>
);
if (mults.infiltration_base_rep_increase)
desc = (
<>
{desc}
<br />+{f(mults.infiltration_base_rep_increase)} Infiltration {FactionNames.Infiltrators} Reputation base reward
</>
);
if (mults.infiltration_rep_mult)
desc = (
<>
{desc}
<br />+{f((mults.infiltration_rep_mult - 1) * 100)}% Infiltration {FactionNames.Infiltrators} Reputation reward
</>
);
if (mults.infiltration_trade_mult)
desc = (
<>
{desc}
<br />+{f((mults.infiltration_trade_mult - 1) * 100)}% Infiltration Reputation for trading information
</>
);
if (mults.infiltration_sell_mult)
desc = (
<>
{desc}
<br />+{f((mults.infiltration_sell_mult - 1) * 100)}% Infiltration cash reward for selling information
</>
);
if (mults.infiltration_timer_mult)
desc = (
<>
{desc}
<br />+{f((mults.infiltration_timer_mult - 1) * 100)}% Infiltration time per minigame
</>
);
if (mults.infiltration_health_reduction_mult)
desc = (
<>
{desc}
<br />-{f((mults.infiltration_health_reduction_mult - 1) * 100)}% Infiltration health lost per failed minigame
</>
);
if (startingMoney)
desc = (
@ -395,7 +444,7 @@ export class Augmentation {
startingCost = 0;
// Initial rep requirement. Doesn't change when you purchase multiple Augmentation
startingRepRequirement = 0
startingRepRequirement = 0;
// Factions that offer this aug.
factions: string[] = [];
@ -517,6 +566,25 @@ export class Augmentation {
this.mults.bladeburner_success_chance_mult = params.bladeburner_success_chance_mult;
}
if (params.infiltration_base_rep_increase) {
this.mults.infiltration_base_rep_increase = params.infiltration_base_rep_increase;
}
if (params.infiltration_rep_mult) {
this.mults.infiltration_rep_mult = params.infiltration_rep_mult;
}
if (params.infiltration_trade_mult) {
this.mults.infiltration_trade_mult = params.infiltration_trade_mult;
}
if (params.infiltration_sell_mult) {
this.mults.infiltration_sell_mult = params.infiltration_sell_mult;
}
if (params.infiltration_timer_mult) {
this.mults.infiltration_timer_mult = params.infiltration_timer_mult;
}
if (params.infiltration_health_reduction_mult) {
this.mults.infiltration_health_reduction_mult = params.infiltration_health_reduction_mult;
}
if (params.stats === undefined)
this.stats = generateStatsDescription(this.mults, params.programs, params.startingMoney);
else this.stats = params.stats;

@ -5,6 +5,7 @@ import { Programs } from "../Programs/Programs";
import { WHRNG } from "../Casino/RNG";
import React from "react";
import { FactionNames } from "../Faction/data/FactionNames";
import { CityName } from "src/Locations/data/CityNames";
function getRandomBonus(): any {
const bonuses = [
@ -99,23 +100,63 @@ export const infiltratorsOtherAugmentations = [
name: AugmentationNames.BionicFingers,
repCost: 15e1,
moneyCost: 1e6,
infiltration_base_rep_increase: 5,
info:
"This state of the art augmentation removes the need for bones and tendons in your fingers, " +
"with this you will have the dexterity equal to the best rubik's cube player in the world. ",
stats: <>This augmentation increases the rep reward to {FactionNames.Infiltrators} by 5 per infiltration.</>,
factions: [FactionNames.Infiltrators],
}),
new Augmentation({
name: AugmentationNames.CorporationManagementImplant,
repCost: 25e1,
moneyCost: 1e6,
infiltration_rep_mult: 2.5,
info:
"As time went on corporations realized that managers were redundant if they could be replaced by AI chips " +
"implanted directly in the brain, and so the this implant was developed which could analyse the users brain " +
"to find the perfect tone and sounding voice to increase productivity of the user to maximum profits.",
stats: (
<>This augmentation multiplies the rep reward to {FactionNames.Infiltrators} by 2.5 per infiltration.</>
),
factions: [FactionNames.Infiltrators],
}),
new Augmentation({
name: AugmentationNames.TranslationCircuit,
repCost: 5e2,
moneyCost: 1e6,
infiltration_trade_mult: 1.5,
info:
"A state of the art circuit module that manipulates the users voice to suit the needs of the situation, " +
"allowing the people listening to feel more persuaded by whats said due to the voice being auto translated " +
"to the listeners accent and language.",
factions: [FactionNames.Infiltrators],
}),
new Augmentation({
name: AugmentationNames.GoldenSuiteCase,
repCost: 5e2,
moneyCost: 1e6,
infiltration_sell_mult: 1.5,
info:
"Some say too much money is a curse, those people clearly have never owned a golden suitcase. it might be " +
"a bit heavier but it sure does make anything inside it look a lot more valuable.",
factions: [FactionNames.Infiltrators],
}),
new Augmentation({
name: AugmentationNames.TimeDilationInjection,
repCost: 5e2,
moneyCost: 1e6,
infiltration_timer_mult: 1.3,
info:
"Injected directly into the user eyes, as the serum seeps into the brain via the optic nerves perception " +
"of time begins to slow down allowing you to take more time to do things than the average person",
factions: [FactionNames.Infiltrators],
}),
new Augmentation({
name: AugmentationNames.BitaniumArmorAlloy,
repCost: 5e2,
moneyCost: 1e6,
infiltration_health_reduction_mult: 0.7,
info:
`Deep in the mines of ${CityName.Ishima} miners found a strange new material, now known as bitanium after ` +
"many iterations of experimenting it was found to be exceptional at increasing ones amour at absorbing " +
"blunt damage when used as an alloy with almost any other metal you can think of.",
factions: [FactionNames.Infiltrators],
}),
];

@ -113,6 +113,7 @@ export enum AugmentationNames {
StaneksGift2 = "Stanek's Gift - Awakening",
StaneksGift3 = "Stanek's Gift - Serenity",
// Infiltrators MiniGames
BagOfSand = "A Bag of Sand",
IntellisenseModule = "Intellisense Module",
ReverseDictionary = "Reverse Dictionary",
@ -121,9 +122,13 @@ export enum AugmentationNames {
CyberDecoder = "Cyber Decoder",
MineDetector = "Mine Detector",
WireCuttingManual = "Wire Cutting Manual",
// Infiltrators general
BionicFingers = "Bionic Fingers",
CorporationManagementImplant = "Corporation Management Implant",
TranslationCircuit = "Translation Circuit",
GoldenSuiteCase = "Golden Suite Case",
TimeDilationInjection = "Time Dilation Injection",
BitaniumArmorAlloy = "Bitanium Armor Alloy",
//Wasteland Augs
//PepBoy: "P.E.P-Boy", Plasma Energy Projection System

@ -115,6 +115,48 @@ export function PlayerMultipliers(): React.ReactElement {
);
}
function InfiltrationMults(): React.ReactElement {
return (
<>
<MultiplierTable
rows={[
[
"Infiltrator Rep reward multiplier",
Player.infiltration_rep_mult,
Player.infiltration_rep_mult * mults.infiltration_rep_mult,
1,
],
[
"Infiltration sell multiplier",
Player.infiltration_sell_mult,
Player.infiltration_sell_mult * mults.infiltration_sell_mult,
1,
],
[
"Infiltration trade multiplier",
Player.infiltration_trade_mult,
Player.infiltration_trade_mult * mults.infiltration_trade_mult,
1,
],
[
"Infiltration minigame timer multiplier",
Player.infiltration_timer_mult,
Player.infiltration_timer_mult * mults.infiltration_timer_mult,
1,
],
[
"Infiltration minigame health reduction multiplier",
Player.infiltration_health_reduction_mult,
Player.infiltration_health_reduction_mult * mults.infiltration_health_reduction_mult,
1,
],
]}
/>
<br />
</>
);
}
return (
<>
<Typography variant="h4">Multipliers</Typography>
@ -286,6 +328,7 @@ export function PlayerMultipliers(): React.ReactElement {
<br />
<BladeburnerMults />
<InfiltrationMults />
</Box>
</>
);

@ -45,6 +45,12 @@ export function Info(props: IProps): React.ReactElement {
const classes = useStyles();
const favorGain = props.faction.getFavorGain();
const offersWork =
props.factionInfo.offerHackingMission ||
props.factionInfo.offerFieldWork ||
props.factionInfo.offerSecurityWork ||
props.factionInfo.offerHackingWork;
return (
<>
<Typography classes={{ root: classes.noformat }}>{props.factionInfo.infoText}</Typography>
@ -59,9 +65,7 @@ export function Info(props: IProps): React.ReactElement {
</Typography>
<MathJaxWrapper>{"\\(\\huge{r = \\text{total faction reputation}}\\)"}</MathJaxWrapper>
<MathJaxWrapper>
{
"\\(\\huge{favor=1+\\left\\lfloor\\log_{1.02}\\left(\\frac{r+25000}{25500}\\right)\\right\\rfloor}\\)"
}
{"\\(\\huge{favor=1+\\left\\lfloor\\log_{1.02}\\left(\\frac{r+25000}{25500}\\right)\\right\\rfloor}\\)"}
</MathJaxWrapper>
</>
}
@ -86,7 +90,6 @@ export function Info(props: IProps): React.ReactElement {
<MathJaxWrapper>{"\\(\\huge{r = reputation}\\)"}</MathJaxWrapper>
<MathJaxWrapper>{"\\(\\huge{\\Delta r = \\Delta r \\times \\frac{100+favor}{100}}\\)"}</MathJaxWrapper>
</>
}
>
@ -98,10 +101,16 @@ export function Info(props: IProps): React.ReactElement {
<Typography>-------------------------</Typography>
<Typography>
Perform work/carry out assignments for your faction to help further its cause! By doing so you will earn
reputation for your faction. You will also gain reputation passively over time, although at a very slow rate.
Earning reputation will allow you to purchase Augmentations through this faction, which are powerful upgrades
that enhance your abilities.
{offersWork ? (
<>
Perform work/carry out assignments for your faction to help further its cause! By doing so you will earn
reputation for your faction.{" "}
</>
) : (
<></>
)}
You will also gain reputation passively over time, although at a very slow rate. Earning reputation will allow
you to purchase Augmentations through this faction, which are powerful upgrades that enhance your abilities.
</Typography>
</>
);

@ -91,7 +91,9 @@ export function Game(props: IProps): React.ReactElement {
pushResult(false);
// Kill the player immediately if they use automation, so
// it's clear they're not meant to
const damage = options?.automated ? player.hp : props.StartingDifficulty * 3;
const damage = options?.automated
? player.hp
: props.StartingDifficulty * 3 * player.infiltration_health_reduction_mult;
if (player.takeDamage(damage)) {
router.toCity();
return;

@ -3,6 +3,7 @@ import React, { useState, useEffect } from "react";
import withStyles from "@mui/styles/withStyles";
import { Theme } from "@mui/material/styles";
import Grid from "@mui/material/Grid";
import { use } from "../../ui/Context";
const TimerProgress = withStyles((theme: Theme) => ({
root: {
@ -20,14 +21,16 @@ interface IProps {
}
export function GameTimer(props: IProps): React.ReactElement {
const player = use.Player();
const [v, setV] = useState(100);
const totalMillis = player.infiltration_timer_mult * props.millis;
const tick = 200;
useEffect(() => {
const intervalId = setInterval(() => {
setV((old) => {
if (old <= 0) props.onExpire();
return old - (tick / props.millis) * 100;
return old - (tick / totalMillis) * 100;
});
}, tick);
return () => {

@ -10,7 +10,6 @@ import Button from "@mui/material/Button";
import MenuItem from "@mui/material/MenuItem";
import Select, { SelectChangeEvent } from "@mui/material/Select";
import { FactionNames } from "../../Faction/data/FactionNames";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames";
import { LocationsMetadata } from "../../Locations/data/LocationsMetadata";
import { formatNumber } from "../../utils/StringHelperFunctions";
@ -38,6 +37,7 @@ export function Victory(props: IProps): React.ReactElement {
Math.pow(props.StartingDifficulty, 1.2) *
30 *
levelBonus *
player.infiltration_trade_mult *
BitNodeMultipliers.InfiltrationRep;
const infiltratorFaction = Factions[FactionNames.Infiltrators];
@ -48,23 +48,17 @@ export function Victory(props: IProps): React.ReactElement {
Math.pow(props.StartingDifficulty, 3) *
3e3 *
levelBonus *
player.infiltration_sell_mult *
BitNodeMultipliers.InfiltrationMoney;
function calculateInfiltratorsRepReward(): number {
const bionicFingersRepGain = player.hasAugmentation(AugmentationNames.BionicFingers, true) ? 5 : 0;
const CorporationManagementImplantRepMultiplier = player.hasAugmentation(
AugmentationNames.CorporationManagementImplant,
true,
)
? 2.5
: 1;
const maxStartingSecurityLevel = LocationsMetadata.reduce((acc, data): number => {
const startingSecurityLevel = data.infiltrationData?.startingSecurityLevel || 0;
return acc > startingSecurityLevel ? acc : startingSecurityLevel;
}, 0);
const baseRepGain = (props.StartingDifficulty / maxStartingSecurityLevel) * 10;
return (baseRepGain + bionicFingersRepGain) * CorporationManagementImplantRepMultiplier;
return (baseRepGain + player.infiltration_base_rep_increase) * player.infiltration_rep_mult;
}
function sell(): void {

@ -2306,6 +2306,12 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
bladeburner_stamina_gain_mult: Player.bladeburner_stamina_gain_mult,
bladeburner_analysis_mult: Player.bladeburner_analysis_mult,
bladeburner_success_chance_mult: Player.bladeburner_success_chance_mult,
infiltration_base_rep_increase: Player.infiltration_base_rep_increase,
infiltration_rep_mult: Player.infiltration_rep_mult,
infiltration_trade_mult: Player.infiltration_trade_mult,
infiltration_sell_mult: Player.infiltration_sell_mult,
infiltration_timer_mult: Player.infiltration_timer_mult,
infiltration_health_reduction_mult: Player.infiltration_health_reduction_mult,
bitNodeN: Player.bitNodeN,
totalPlaytime: Player.totalPlaytime,
playtimeSinceLastAug: Player.playtimeSinceLastAug,

@ -126,6 +126,12 @@ export interface IPlayer {
bladeburner_stamina_gain_mult: number;
bladeburner_analysis_mult: number;
bladeburner_success_chance_mult: number;
infiltration_base_rep_increase: number;
infiltration_rep_mult: number;
infiltration_trade_mult: number;
infiltration_sell_mult: number;
infiltration_timer_mult: number;
infiltration_health_reduction_mult: number;
createProgramReqLvl: number;
factionWorkType: string;

@ -97,6 +97,13 @@ export abstract class Person {
bladeburner_analysis_mult = 1;
bladeburner_success_chance_mult = 1;
infiltration_base_rep_increase = 0;
infiltration_rep_mult = 1;
infiltration_trade_mult = 1;
infiltration_sell_mult = 1;
infiltration_timer_mult = 1;
infiltration_health_reduction_mult = 1;
/**
* Augmentations
*/
@ -195,6 +202,24 @@ export abstract class Person {
this.crime_success_mult = 1;
this.work_money_mult = 1;
this.hacknet_node_money_mult = 1;
this.hacknet_node_purchase_cost_mult = 1;
this.hacknet_node_ram_cost_mult = 1;
this.hacknet_node_core_cost_mult = 1;
this.hacknet_node_level_cost_mult = 1;
this.bladeburner_max_stamina_mult = 1;
this.bladeburner_stamina_gain_mult = 1;
this.bladeburner_analysis_mult = 1;
this.bladeburner_success_chance_mult = 1;
this.infiltration_base_rep_increase = 0;
this.infiltration_rep_mult = 1;
this.infiltration_trade_mult = 1;
this.infiltration_sell_mult = 1;
this.infiltration_timer_mult = 1;
this.infiltration_health_reduction_mult = 1;
}
/**

@ -135,6 +135,12 @@ export class PlayerObject implements IPlayer {
bladeburner_stamina_gain_mult: number;
bladeburner_analysis_mult: number;
bladeburner_success_chance_mult: number;
infiltration_base_rep_increase: number;
infiltration_rep_mult: number;
infiltration_trade_mult: number;
infiltration_sell_mult: number;
infiltration_timer_mult: number;
infiltration_health_reduction_mult: number;
createProgramReqLvl: number;
factionWorkType: string;
@ -456,6 +462,13 @@ export class PlayerObject implements IPlayer {
this.bladeburner_analysis_mult = 1; //Field Analysis Onl;
this.bladeburner_success_chance_mult = 1;
this.infiltration_base_rep_increase = 0;
this.infiltration_rep_mult = 1;
this.infiltration_trade_mult = 1;
this.infiltration_sell_mult = 1;
this.infiltration_timer_mult = 1;
this.infiltration_health_reduction_mult = 1;
// Sleeves & Re-sleeving
this.sleeves = [];
this.resleeves = [];

@ -314,6 +314,13 @@ export function resetMultipliers(this: IPlayer): void {
this.bladeburner_stamina_gain_mult = 1;
this.bladeburner_analysis_mult = 1;
this.bladeburner_success_chance_mult = 1;
this.infiltration_base_rep_increase = 0;
this.infiltration_rep_mult = 1;
this.infiltration_trade_mult = 1;
this.infiltration_sell_mult = 1;
this.infiltration_timer_mult = 1;
this.infiltration_health_reduction_mult = 1;
}
export function hasProgram(this: IPlayer, programName: string): boolean {

@ -142,6 +142,25 @@ function BladeburnerMults(): React.ReactElement {
);
}
function InfiltrationMults(): React.ReactElement {
const player = use.Player();
return (
<>
<MultiplierTable
rows={[
["Infiltrator Base Rep increase", player.infiltration_rep_mult],
["Infiltrator Rep reward multiplier", player.infiltration_rep_mult],
["Infiltration sell multiplier", player.infiltration_sell_mult],
["Infiltration trade multiplier", player.infiltration_trade_mult],
["Infiltration minigame timer multiplier", player.infiltration_timer_mult],
["Infiltration minigame health reduction multiplier", player.infiltration_health_reduction_mult],
]}
/>
<br />
</>
);
}
function CurrentBitNode(): React.ReactElement {
const player = use.Player();
if (player.sourceFiles.length > 0) {
@ -483,6 +502,7 @@ export function CharacterStats(): React.ReactElement {
/>
<br />
<BladeburnerMults />
<InfiltrationMults />
</Box>
<br />