From 7f2815800599a40608fb38115750c82fffe5f8bf Mon Sep 17 00:00:00 2001 From: phyzical Date: Sun, 27 Mar 2022 12:26:43 +0800 Subject: [PATCH] moved over to player stats * added new augmentations --- src/Augmentation/Augmentation.tsx | 70 ++++++++++++++++++- src/Augmentation/AugmentationCreator.tsx | 49 +++++++++++-- src/Augmentation/data/AugmentationNames.ts | 7 +- src/Augmentation/ui/PlayerMultipliers.tsx | 43 ++++++++++++ src/Faction/ui/Info.tsx | 25 ++++--- src/Infiltration/ui/Game.tsx | 4 +- src/Infiltration/ui/GameTimer.tsx | 5 +- src/Infiltration/ui/Victory.tsx | 12 +--- src/NetscriptFunctions.ts | 6 ++ src/PersonObjects/IPlayer.ts | 6 ++ src/PersonObjects/Person.ts | 25 +++++++ src/PersonObjects/Player/PlayerObject.ts | 13 ++++ .../Player/PlayerObjectGeneralMethods.tsx | 7 ++ src/ui/CharacterStats.tsx | 20 ++++++ 14 files changed, 267 insertions(+), 25 deletions(-) diff --git a/src/Augmentation/Augmentation.tsx b/src/Augmentation/Augmentation.tsx index c8ffe730e..c0ee348a2 100644 --- a/src/Augmentation/Augmentation.tsx +++ b/src/Augmentation/Augmentation.tsx @@ -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, programs?: string[], star
+{f(mults.bladeburner_success_chance_mult - 1)} Bladeburner Contracts and Operations success chance ); + if (mults.infiltration_base_rep_increase) + desc = ( + <> + {desc} +
+{f(mults.infiltration_base_rep_increase)} Infiltration {FactionNames.Infiltrators} Reputation base reward + + ); + if (mults.infiltration_rep_mult) + desc = ( + <> + {desc} +
+{f((mults.infiltration_rep_mult - 1) * 100)}% Infiltration {FactionNames.Infiltrators} Reputation reward + + ); + if (mults.infiltration_trade_mult) + desc = ( + <> + {desc} +
+{f((mults.infiltration_trade_mult - 1) * 100)}% Infiltration Reputation for trading information + + ); + if (mults.infiltration_sell_mult) + desc = ( + <> + {desc} +
+{f((mults.infiltration_sell_mult - 1) * 100)}% Infiltration cash reward for selling information + + ); + if (mults.infiltration_timer_mult) + desc = ( + <> + {desc} +
+{f((mults.infiltration_timer_mult - 1) * 100)}% Infiltration time per minigame + + ); + if (mults.infiltration_health_reduction_mult) + desc = ( + <> + {desc} +
-{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; diff --git a/src/Augmentation/AugmentationCreator.tsx b/src/Augmentation/AugmentationCreator.tsx index 18c8061d2..cf145ce4c 100644 --- a/src/Augmentation/AugmentationCreator.tsx +++ b/src/Augmentation/AugmentationCreator.tsx @@ -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], }), ]; diff --git a/src/Augmentation/data/AugmentationNames.ts b/src/Augmentation/data/AugmentationNames.ts index 5b98a1a63..4a5898cae 100644 --- a/src/Augmentation/data/AugmentationNames.ts +++ b/src/Augmentation/data/AugmentationNames.ts @@ -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 diff --git a/src/Augmentation/ui/PlayerMultipliers.tsx b/src/Augmentation/ui/PlayerMultipliers.tsx index be2c1bf47..2fe6bd1a6 100644 --- a/src/Augmentation/ui/PlayerMultipliers.tsx +++ b/src/Augmentation/ui/PlayerMultipliers.tsx @@ -115,6 +115,48 @@ export function PlayerMultipliers(): React.ReactElement { ); } + function InfiltrationMults(): React.ReactElement { + return ( + <> + +
+ + ); + } + return ( <> Multipliers @@ -286,6 +328,7 @@ export function PlayerMultipliers(): React.ReactElement {
+ ); diff --git a/src/Faction/ui/Info.tsx b/src/Faction/ui/Info.tsx index dc3a07ac7..3fe6e8af2 100644 --- a/src/Faction/ui/Info.tsx +++ b/src/Faction/ui/Info.tsx @@ -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 ( <> {props.factionInfo.infoText} @@ -59,9 +65,7 @@ export function Info(props: IProps): React.ReactElement { {"\\(\\huge{r = \\text{total faction reputation}}\\)"} - { - "\\(\\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}\\)"} } @@ -86,7 +90,6 @@ export function Info(props: IProps): React.ReactElement { {"\\(\\huge{r = reputation}\\)"} {"\\(\\huge{\\Delta r = \\Delta r \\times \\frac{100+favor}{100}}\\)"} - } > @@ -98,10 +101,16 @@ export function Info(props: IProps): React.ReactElement { ------------------------- - 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. ); diff --git a/src/Infiltration/ui/Game.tsx b/src/Infiltration/ui/Game.tsx index b0daa37d4..eac6b45f0 100644 --- a/src/Infiltration/ui/Game.tsx +++ b/src/Infiltration/ui/Game.tsx @@ -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; diff --git a/src/Infiltration/ui/GameTimer.tsx b/src/Infiltration/ui/GameTimer.tsx index b7ee53c30..9755685e8 100644 --- a/src/Infiltration/ui/GameTimer.tsx +++ b/src/Infiltration/ui/GameTimer.tsx @@ -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 () => { diff --git a/src/Infiltration/ui/Victory.tsx b/src/Infiltration/ui/Victory.tsx index 4c2388f9b..c81fa3158 100644 --- a/src/Infiltration/ui/Victory.tsx +++ b/src/Infiltration/ui/Victory.tsx @@ -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 { diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index 65a4b3d2f..92b7d8efb 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -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, diff --git a/src/PersonObjects/IPlayer.ts b/src/PersonObjects/IPlayer.ts index db030c173..3de3c9d03 100644 --- a/src/PersonObjects/IPlayer.ts +++ b/src/PersonObjects/IPlayer.ts @@ -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; diff --git a/src/PersonObjects/Person.ts b/src/PersonObjects/Person.ts index 18c39a2ed..fab443bff 100644 --- a/src/PersonObjects/Person.ts +++ b/src/PersonObjects/Person.ts @@ -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; } /** diff --git a/src/PersonObjects/Player/PlayerObject.ts b/src/PersonObjects/Player/PlayerObject.ts index e61174be7..39b821841 100644 --- a/src/PersonObjects/Player/PlayerObject.ts +++ b/src/PersonObjects/Player/PlayerObject.ts @@ -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 = []; diff --git a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx index 69643361d..927a4b455 100644 --- a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx +++ b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx @@ -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 { diff --git a/src/ui/CharacterStats.tsx b/src/ui/CharacterStats.tsx index 0ee401d47..308451c9a 100644 --- a/src/ui/CharacterStats.tsx +++ b/src/ui/CharacterStats.tsx @@ -142,6 +142,25 @@ function BladeburnerMults(): React.ReactElement { ); } +function InfiltrationMults(): React.ReactElement { + const player = use.Player(); + return ( + <> + +
+ + ); +} + function CurrentBitNode(): React.ReactElement { const player = use.Player(); if (player.sourceFiles.length > 0) { @@ -483,6 +502,7 @@ export function CharacterStats(): React.ReactElement { />
+