ENUMS: Initial Enum Helper rework + Reorganization (#596)

This commit is contained in:
Snarling 2023-06-12 00:34:20 -04:00 committed by GitHub
parent 6ed8ea9796
commit 6732549196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
224 changed files with 2126 additions and 2171 deletions

@ -12,6 +12,7 @@ module.exports = {
"\\.(css|less)$": "<rootDir>/test/__mocks__/styleMock.js", "\\.(css|less)$": "<rootDir>/test/__mocks__/styleMock.js",
"\\!!raw-loader!.*$": "<rootDir>/test/__mocks__/rawLoader.js", "\\!!raw-loader!.*$": "<rootDir>/test/__mocks__/rawLoader.js",
"@player": "<rootDir>/src/Player", "@player": "<rootDir>/src/Player",
"@enums": "<rootDir>/src/Enums",
"@nsdefs": "<rootDir>/src/ScriptEditor/NetscriptDefinitions", "@nsdefs": "<rootDir>/src/ScriptEditor/NetscriptDefinitions",
"^monaco-editor$": "<rootDir>/test/__mocks__/monacoMock.js", "^monaco-editor$": "<rootDir>/test/__mocks__/monacoMock.js",
"^monaco-vim$": "<rootDir>/test/__mocks__/monacoMock.js", "^monaco-vim$": "<rootDir>/test/__mocks__/monacoMock.js",

@ -1,8 +1,17 @@
import { AugmentationNames } from "../Augmentation/data/AugmentationNames"; import type { PlayerObject } from "../PersonObjects/Player/PlayerObject";
import {
AugmentationName,
BlackOperationName,
CityName,
CompletedProgramName,
CorpUnlockName,
FactionName,
IndustryType,
} from "@enums";
import { SkillNames } from "../Bladeburner/data/SkillNames"; import { SkillNames } from "../Bladeburner/data/SkillNames";
import { Skills } from "../Bladeburner/Skills"; import { Skills } from "../Bladeburner/Skills";
import { CONSTANTS } from "../Constants"; import { CONSTANTS } from "../Constants";
import { CorpUnlockName, IndustryType } from "../Corporation/data/Enums";
import { Exploit } from "../Exploits/Exploit"; import { Exploit } from "../Exploits/Exploit";
import { Factions } from "../Faction/Factions"; import { Factions } from "../Faction/Factions";
import { AllGangs } from "../Gang/AllGangs"; import { AllGangs } from "../Gang/AllGangs";
@ -11,22 +20,17 @@ import { HacknetNodeConstants, HacknetServerConstants } from "../Hacknet/data/Co
import { hasHacknetServers } from "../Hacknet/HacknetHelpers"; import { hasHacknetServers } from "../Hacknet/HacknetHelpers";
import { HacknetNode } from "../Hacknet/HacknetNode"; import { HacknetNode } from "../Hacknet/HacknetNode";
import { HacknetServer } from "../Hacknet/HacknetServer"; import { HacknetServer } from "../Hacknet/HacknetServer";
import { CityName } from "../Enums";
import { Player } from "@player"; import { Player } from "@player";
import { CompletedProgramName } from "../Programs/Programs";
import { GetAllServers, GetServer } from "../Server/AllServers"; import { GetAllServers, GetServer } from "../Server/AllServers";
import { SpecialServers } from "../Server/data/SpecialServers"; import { SpecialServers } from "../Server/data/SpecialServers";
import { Server } from "../Server/Server"; import { Server } from "../Server/Server";
import { Router } from "../ui/GameRoot"; import { Router } from "../ui/GameRoot";
import { Page } from "../ui/Router"; import { Page } from "../ui/Router";
import data from "./AchievementData.json"; import data from "./AchievementData.json";
import { FactionNames } from "../Faction/data/FactionNames";
import { BlackOperationNames } from "../Bladeburner/data/BlackOperationNames";
import { isClassWork } from "../Work/ClassWork"; import { isClassWork } from "../Work/ClassWork";
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
import { workerScripts } from "../Netscript/WorkerScripts"; import { workerScripts } from "../Netscript/WorkerScripts";
import type { PlayerObject } from "../PersonObjects/Player/PlayerObject";
import { getRecordValues } from "../Types/Record"; import { getRecordValues } from "../Types/Record";
// Unable to correctly cast the JSON data into AchievementDataJson type otherwise... // Unable to correctly cast the JSON data into AchievementDataJson type otherwise...
@ -62,7 +66,7 @@ function bitNodeFinishedState(): boolean {
const wd = GetServer(SpecialServers.WorldDaemon); const wd = GetServer(SpecialServers.WorldDaemon);
if (!(wd instanceof Server)) return false; if (!(wd instanceof Server)) return false;
if (wd.backdoorInstalled) return true; if (wd.backdoorInstalled) return true;
return Player.bladeburner !== null && BlackOperationNames.OperationDaedalus in Player.bladeburner.blackops; return Player.bladeburner !== null && BlackOperationName.OperationDaedalus in Player.bladeburner.blackops;
} }
function hasAccessToSF(player: PlayerObject, bn: number): boolean { function hasAccessToSF(player: PlayerObject, bn: number): boolean {
@ -88,40 +92,40 @@ function sfAchievement(): Achievement[] {
} }
export const achievements: Record<string, Achievement> = { export const achievements: Record<string, Achievement> = {
[FactionNames.CyberSec.toUpperCase()]: { [FactionName.CyberSec.toUpperCase()]: {
...achievementData[FactionNames.CyberSec.toUpperCase()], ...achievementData[FactionName.CyberSec.toUpperCase()],
Icon: "CSEC", Icon: "CSEC",
Condition: () => Player.factions.includes(FactionNames.CyberSec), Condition: () => Player.factions.includes(FactionName.CyberSec),
}, },
[FactionNames.NiteSec.toUpperCase()]: { [FactionName.NiteSec.toUpperCase()]: {
...achievementData[FactionNames.NiteSec.toUpperCase()], ...achievementData[FactionName.NiteSec.toUpperCase()],
Icon: FactionNames.NiteSec, Icon: FactionName.NiteSec,
Condition: () => Player.factions.includes(FactionNames.NiteSec), Condition: () => Player.factions.includes(FactionName.NiteSec),
}, },
THE_BLACK_HAND: { THE_BLACK_HAND: {
...achievementData.THE_BLACK_HAND, ...achievementData.THE_BLACK_HAND,
Icon: "TBH", Icon: "TBH",
Condition: () => Player.factions.includes(FactionNames.TheBlackHand), Condition: () => Player.factions.includes(FactionName.TheBlackHand),
}, },
[FactionNames.BitRunners.toUpperCase()]: { [FactionName.BitRunners.toUpperCase()]: {
...achievementData[FactionNames.BitRunners.toUpperCase()], ...achievementData[FactionName.BitRunners.toUpperCase()],
Icon: FactionNames.BitRunners.toLowerCase(), Icon: FactionName.BitRunners.toLowerCase(),
Condition: () => Player.factions.includes(FactionNames.BitRunners), Condition: () => Player.factions.includes(FactionName.BitRunners),
}, },
[FactionNames.Daedalus.toUpperCase()]: { [FactionName.Daedalus.toUpperCase()]: {
...achievementData[FactionNames.Daedalus.toUpperCase()], ...achievementData[FactionName.Daedalus.toUpperCase()],
Icon: FactionNames.Daedalus.toLowerCase(), Icon: FactionName.Daedalus.toLowerCase(),
Condition: () => Player.factions.includes(FactionNames.Daedalus), Condition: () => Player.factions.includes(FactionName.Daedalus),
}, },
THE_COVENANT: { THE_COVENANT: {
...achievementData.THE_COVENANT, ...achievementData.THE_COVENANT,
Icon: FactionNames.TheCovenant.toLowerCase().replace(/ /g, ""), Icon: FactionName.TheCovenant.toLowerCase().replace(/ /g, ""),
Condition: () => Player.factions.includes(FactionNames.TheCovenant), Condition: () => Player.factions.includes(FactionName.TheCovenant),
}, },
[FactionNames.Illuminati.toUpperCase()]: { [FactionName.Illuminati.toUpperCase()]: {
...achievementData[FactionNames.Illuminati.toUpperCase()], ...achievementData[FactionName.Illuminati.toUpperCase()],
Icon: FactionNames.Illuminati.toLowerCase(), Icon: FactionName.Illuminati.toLowerCase(),
Condition: () => Player.factions.includes(FactionNames.Illuminati), Condition: () => Player.factions.includes(FactionName.Illuminati),
}, },
"BRUTESSH.EXE": { "BRUTESSH.EXE": {
...achievementData["BRUTESSH.EXE"], ...achievementData["BRUTESSH.EXE"],
@ -269,7 +273,7 @@ export const achievements: Record<string, Achievement> = {
NEUROFLUX_255: { NEUROFLUX_255: {
...achievementData.NEUROFLUX_255, ...achievementData.NEUROFLUX_255,
Icon: "nf255", Icon: "nf255",
Condition: () => Player.augmentations.some((a) => a.name === AugmentationNames.NeuroFluxGovernor && a.level >= 255), Condition: () => Player.augmentations.some((a) => a.name === AugmentationName.NeuroFluxGovernor && a.level >= 255),
}, },
NS2: { NS2: {
...achievementData.NS2, ...achievementData.NS2,
@ -730,7 +734,7 @@ export const achievements: Record<string, Achievement> = {
Condition: () => Condition: () =>
Player.bitNodeN === 13 && Player.bitNodeN === 13 &&
bitNodeFinishedState() && bitNodeFinishedState() &&
!Player.augmentations.some((a) => a.name === AugmentationNames.StaneksGift1), !Player.augmentations.some((a) => a.name === AugmentationName.StaneksGift1),
}, },
DEVMENU: { DEVMENU: {
...achievementData.DEVMENU, ...achievementData.DEVMENU,

@ -1,16 +1,14 @@
// Class definition for a single Augmentation object // Class definition for a single Augmentation object
import * as React from "react"; import * as React from "react";
import type { CompletedProgramName } from "../Programs/Programs"; import { AugmentationName, CompletedProgramName, FactionName } from "@enums";
import { Faction } from "../Faction/Faction"; import { Faction } from "../Faction/Faction";
import { Factions } from "../Faction/Factions"; import { Factions } from "../Faction/Factions";
import { formatPercent } from "../ui/formatNumber"; import { formatPercent } from "../ui/formatNumber";
import { Money } from "../ui/React/Money"; import { Money } from "../ui/React/Money";
import { Generic_fromJSON, Generic_toJSON, IReviverValue, constructorsForReviver } from "../utils/JSONReviver"; import { Generic_fromJSON, Generic_toJSON, IReviverValue, constructorsForReviver } from "../utils/JSONReviver";
import { FactionNames } from "../Faction/data/FactionNames";
import { Player } from "@player"; import { Player } from "@player";
import { AugmentationNames } from "./data/AugmentationNames";
import { CONSTANTS } from "../Constants"; import { CONSTANTS } from "../Constants";
import { StaticAugmentations } from "./StaticAugmentations"; import { StaticAugmentations } from "./StaticAugmentations";
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
@ -532,7 +530,7 @@ export class Augmentation {
let moneyCost = augmentationReference.baseCost; let moneyCost = augmentationReference.baseCost;
let repCost = augmentationReference.baseRepRequirement; let repCost = augmentationReference.baseRepRequirement;
if (augmentationReference.name === AugmentationNames.NeuroFluxGovernor) { if (augmentationReference.name === AugmentationName.NeuroFluxGovernor) {
let nextLevel = this.getLevel(); let nextLevel = this.getLevel();
--nextLevel; --nextLevel;
const multiplier = Math.pow(CONSTANTS.NeuroFluxGovernorLevelMult, nextLevel); const multiplier = Math.pow(CONSTANTS.NeuroFluxGovernorLevelMult, nextLevel);
@ -542,7 +540,7 @@ export class Augmentation {
for (let i = 0; i < Player.queuedAugmentations.length; ++i) { for (let i = 0; i < Player.queuedAugmentations.length; ++i) {
moneyCost *= getBaseAugmentationPriceMultiplier(); moneyCost *= getBaseAugmentationPriceMultiplier();
} }
} else if (augmentationReference.factions.includes(FactionNames.ShadowsOfAnarchy)) { } else if (augmentationReference.factions.includes(FactionName.ShadowsOfAnarchy)) {
const soaAugmentationNames = initSoAAugmentations().map((augmentation) => augmentation.name); const soaAugmentationNames = initSoAAugmentations().map((augmentation) => augmentation.name);
const soaAugCount = soaAugmentationNames.filter((augmentationName) => const soaAugCount = soaAugmentationNames.filter((augmentationName) =>
Player.hasAugmentation(augmentationName), Player.hasAugmentation(augmentationName),
@ -563,17 +561,17 @@ export class Augmentation {
getLevel(): number { getLevel(): number {
// Get current Neuroflux level based on Player's augmentations // Get current Neuroflux level based on Player's augmentations
if (this.name === AugmentationNames.NeuroFluxGovernor) { if (this.name === AugmentationName.NeuroFluxGovernor) {
let currLevel = 0; let currLevel = 0;
for (let i = 0; i < Player.augmentations.length; ++i) { for (let i = 0; i < Player.augmentations.length; ++i) {
if (Player.augmentations[i].name === AugmentationNames.NeuroFluxGovernor) { if (Player.augmentations[i].name === AugmentationName.NeuroFluxGovernor) {
currLevel = Player.augmentations[i].level; currLevel = Player.augmentations[i].level;
} }
} }
// Account for purchased but uninstalled Augmentations // Account for purchased but uninstalled Augmentations
for (let i = 0; i < Player.queuedAugmentations.length; ++i) { for (let i = 0; i < Player.queuedAugmentations.length; ++i) {
if (Player.queuedAugmentations[i].name == AugmentationNames.NeuroFluxGovernor) { if (Player.queuedAugmentations[i].name == AugmentationName.NeuroFluxGovernor) {
++currLevel; ++currLevel;
} }
} }

@ -1,7 +1,7 @@
import { Augmentation } from "./Augmentation"; import { Augmentation } from "./Augmentation";
import { StaticAugmentations } from "./StaticAugmentations"; import { StaticAugmentations } from "./StaticAugmentations";
import { PlayerOwnedAugmentation } from "./PlayerOwnedAugmentation"; import { PlayerOwnedAugmentation } from "./PlayerOwnedAugmentation";
import { AugmentationNames } from "./data/AugmentationNames"; import { AugmentationName, FactionName } from "@enums";
import { CONSTANTS } from "../Constants"; import { CONSTANTS } from "../Constants";
import { Factions, factionExists } from "../Faction/Factions"; import { Factions, factionExists } from "../Faction/Factions";
@ -10,7 +10,6 @@ import { prestigeAugmentation } from "../Prestige";
import { dialogBoxCreate } from "../ui/React/DialogBox"; import { dialogBoxCreate } from "../ui/React/DialogBox";
import { FactionNames } from "../Faction/data/FactionNames";
import { import {
initBladeburnerAugmentations, initBladeburnerAugmentations,
initChurchOfTheMachineGodAugmentations, initChurchOfTheMachineGodAugmentations,
@ -34,8 +33,8 @@ function createAugmentations(): void {
initUnstableCircadianModulator(), initUnstableCircadianModulator(),
...initGeneralAugmentations(), ...initGeneralAugmentations(),
...initSoAAugmentations(), ...initSoAAugmentations(),
...(factionExists(FactionNames.Bladeburners) ? initBladeburnerAugmentations() : []), ...(factionExists(FactionName.Bladeburners) ? initBladeburnerAugmentations() : []),
...(factionExists(FactionNames.ChurchOfTheMachineGod) ? initChurchOfTheMachineGodAugmentations() : []), ...(factionExists(FactionName.ChurchOfTheMachineGod) ? initChurchOfTheMachineGodAugmentations() : []),
].map(resetAugmentation); ].map(resetAugmentation);
} }
@ -74,14 +73,14 @@ function applyAugmentation(aug: PlayerOwnedAugmentation, reapply = false): void
Player.mults = mergeMultipliers(Player.mults, staticAugmentation.mults); Player.mults = mergeMultipliers(Player.mults, staticAugmentation.mults);
// Special logic for Congruity Implant // Special logic for Congruity Implant
if (aug.name === AugmentationNames.CongruityImplant && !reapply) { if (aug.name === AugmentationName.CongruityImplant && !reapply) {
Player.entropy = 0; Player.entropy = 0;
Player.applyEntropy(Player.entropy); Player.applyEntropy(Player.entropy);
} }
// Special logic for NeuroFlux Governor // Special logic for NeuroFlux Governor
const ownedNfg = Player.augmentations.find((pAug) => pAug.name === AugmentationNames.NeuroFluxGovernor); const ownedNfg = Player.augmentations.find((pAug) => pAug.name === AugmentationName.NeuroFluxGovernor);
if (aug.name === AugmentationNames.NeuroFluxGovernor && !reapply && ownedNfg) { if (aug.name === AugmentationName.NeuroFluxGovernor && !reapply && ownedNfg) {
ownedNfg.level = aug.level; ownedNfg.level = aug.level;
return; return;
} }
@ -102,7 +101,7 @@ function installAugmentations(force?: boolean): boolean {
let augmentationList = ""; let augmentationList = "";
let nfgIndex = -1; let nfgIndex = -1;
for (let i = Player.queuedAugmentations.length - 1; i >= 0; i--) { for (let i = Player.queuedAugmentations.length - 1; i >= 0; i--) {
if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) { if (Player.queuedAugmentations[i].name === AugmentationName.NeuroFluxGovernor) {
nfgIndex = i; nfgIndex = i;
break; break;
} }
@ -116,10 +115,10 @@ function installAugmentations(force?: boolean): boolean {
} }
applyAugmentation(Player.queuedAugmentations[i]); applyAugmentation(Player.queuedAugmentations[i]);
if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex) continue; if (ownedAug.name === AugmentationName.NeuroFluxGovernor && i !== nfgIndex) continue;
let level = ""; let level = "";
if (ownedAug.name === AugmentationNames.NeuroFluxGovernor) { if (ownedAug.name === AugmentationName.NeuroFluxGovernor) {
level = ` - ${ownedAug.level}`; level = ` - ${ownedAug.level}`;
} }
augmentationList += aug.name + level + "\n"; augmentationList += aug.name + level + "\n";
@ -144,7 +143,7 @@ function augmentationExists(name: string): boolean {
export function isRepeatableAug(aug: Augmentation | string): boolean { export function isRepeatableAug(aug: Augmentation | string): boolean {
const augName = typeof aug === "string" ? aug : aug.name; const augName = typeof aug === "string" ? aug : aug.name;
return augName === AugmentationNames.NeuroFluxGovernor; return augName === AugmentationName.NeuroFluxGovernor;
} }
export { installAugmentations, initAugmentations, applyAugmentation, augmentationExists }; export { installAugmentations, initAugmentations, applyAugmentation, augmentationExists };

@ -1,4 +1,4 @@
export enum AugmentationNames { export enum AugmentationName {
Targeting1 = "Augmented Targeting I", Targeting1 = "Augmented Targeting I",
Targeting2 = "Augmented Targeting II", Targeting2 = "Augmented Targeting II",
Targeting3 = "Augmented Targeting III", Targeting3 = "Augmented Targeting III",

File diff suppressed because it is too large Load Diff

@ -19,7 +19,7 @@ import Container from "@mui/material/Container";
import { Settings } from "../../Settings/Settings"; import { Settings } from "../../Settings/Settings";
import { ConfirmationModal } from "../../ui/React/ConfirmationModal"; import { ConfirmationModal } from "../../ui/React/ConfirmationModal";
import { Player } from "@player"; import { Player } from "@player";
import { AugmentationNames } from "../data/AugmentationNames"; import { AugmentationName } from "@enums";
import { StaticAugmentations } from "../StaticAugmentations"; import { StaticAugmentations } from "../StaticAugmentations";
import { CONSTANTS } from "../../Constants"; import { CONSTANTS } from "../../Constants";
import { formatNumberNoSuffix } from "../../ui/formatNumber"; import { formatNumberNoSuffix } from "../../ui/formatNumber";
@ -29,7 +29,7 @@ import { AlertEvents } from "../../ui/React/AlertManager";
import { useRerender } from "../../ui/React/hooks"; import { useRerender } from "../../ui/React/hooks";
const NeuroFluxDisplay = (): React.ReactElement => { const NeuroFluxDisplay = (): React.ReactElement => {
const level = Player.augmentations.find((e) => e.name === AugmentationNames.NeuroFluxGovernor)?.level ?? 0; const level = Player.augmentations.find((e) => e.name === AugmentationName.NeuroFluxGovernor)?.level ?? 0;
const openBloodDonation = () => { const openBloodDonation = () => {
AlertEvents.emit( AlertEvents.emit(
@ -50,10 +50,10 @@ const NeuroFluxDisplay = (): React.ReactElement => {
NeuroFlux Governor - Level {level} NeuroFlux Governor - Level {level}
</Typography> </Typography>
<Typography color={Settings.theme.info}> <Typography color={Settings.theme.info}>
{StaticAugmentations[AugmentationNames.NeuroFluxGovernor].stats} {StaticAugmentations[AugmentationName.NeuroFluxGovernor].stats}
</Typography> </Typography>
<Typography color={Settings.theme.info}> <Typography color={Settings.theme.info}>
The power of {AugmentationNames.NeuroFluxGovernor} increases with blood donations from players in real life. The power of {AugmentationName.NeuroFluxGovernor} increases with blood donations from players in real life.
Learn more <Link onClick={openBloodDonation}>here</Link> Learn more <Link onClick={openBloodDonation}>here</Link>
</Typography> </Typography>
</Paper> </Paper>
@ -199,7 +199,7 @@ export function AugmentationsRoot(props: IProps): React.ReactElement {
my: 1, my: 1,
display: "grid", display: "grid",
gridTemplateColumns: `repeat(${ gridTemplateColumns: `repeat(${
+!!((Player.augmentations.find((e) => e.name === AugmentationNames.NeuroFluxGovernor)?.level ?? 0) > 0) + +!!((Player.augmentations.find((e) => e.name === AugmentationName.NeuroFluxGovernor)?.level ?? 0) > 0) +
+!!(Player.entropy > 0) +!!(Player.entropy > 0)
}, 1fr)`, }, 1fr)`,
gap: 1, gap: 1,

@ -14,12 +14,12 @@ import { OwnedAugmentationsOrderSetting } from "../../Settings/SettingEnums";
import { Settings } from "../../Settings/Settings"; import { Settings } from "../../Settings/Settings";
import { Player } from "@player"; import { Player } from "@player";
import { StaticAugmentations } from "../StaticAugmentations"; import { StaticAugmentations } from "../StaticAugmentations";
import { AugmentationNames } from "../data/AugmentationNames"; import { AugmentationName } from "@enums";
import { useRerender } from "../../ui/React/hooks"; import { useRerender } from "../../ui/React/hooks";
export function InstalledAugmentations(): React.ReactElement { export function InstalledAugmentations(): React.ReactElement {
const rerender = useRerender(); const rerender = useRerender();
const sourceAugs = Player.augmentations.slice().filter((aug) => aug.name !== AugmentationNames.NeuroFluxGovernor); const sourceAugs = Player.augmentations.slice().filter((aug) => aug.name !== AugmentationName.NeuroFluxGovernor);
const [selectedAug, setSelectedAug] = useState(sourceAugs[0]); const [selectedAug, setSelectedAug] = useState(sourceAugs[0]);

@ -10,10 +10,9 @@ import { Player } from "@player";
import { Settings } from "../../Settings/Settings"; import { Settings } from "../../Settings/Settings";
import { formatMoney, formatReputation } from "../../ui/formatNumber"; import { formatMoney, formatReputation } from "../../ui/formatNumber";
import { Augmentation } from "../Augmentation"; import { Augmentation } from "../Augmentation";
import { AugmentationNames } from "../data/AugmentationNames"; import { AugmentationName, FactionName } from "@enums";
import { StaticAugmentations } from "../StaticAugmentations"; import { StaticAugmentations } from "../StaticAugmentations";
import { PurchaseAugmentationModal } from "./PurchaseAugmentationModal"; import { PurchaseAugmentationModal } from "./PurchaseAugmentationModal";
import { FactionNames } from "../../Faction/data/FactionNames";
interface IPreReqsProps { interface IPreReqsProps {
aug: Augmentation; aug: Augmentation;
@ -90,8 +89,8 @@ const Exclusive = (props: IExclusiveProps): React.ReactElement => {
</li> </li>
)} )}
{Player.canAccessGrafting() && {Player.canAccessGrafting() &&
(!props.aug.isSpecial || props.aug.factions.includes(FactionNames.Bladeburners)) && (!props.aug.isSpecial || props.aug.factions.includes(FactionName.Bladeburners)) &&
props.aug.name !== AugmentationNames.TheRedPill && ( props.aug.name !== AugmentationName.TheRedPill && (
<li> <li>
<b>Grafting</b> <b>Grafting</b>
</li> </li>
@ -210,7 +209,7 @@ export function PurchasableAugmentation(props: IPurchasableAugProps): React.Reac
<> <>
<Typography variant="h5"> <Typography variant="h5">
{props.augName} {props.augName}
{props.augName === AugmentationNames.NeuroFluxGovernor && ` - Level ${aug.getLevel()}`} {props.augName === AugmentationName.NeuroFluxGovernor && ` - Level ${aug.getLevel()}`}
</Typography> </Typography>
<Typography>{description}</Typography> <Typography>{description}</Typography>
</> </>
@ -227,7 +226,7 @@ export function PurchasableAugmentation(props: IPurchasableAugProps): React.Reac
}} }}
> >
{aug.name} {aug.name}
{aug.name === AugmentationNames.NeuroFluxGovernor && ` - Level ${aug.getLevel()}`} {aug.name === AugmentationName.NeuroFluxGovernor && ` - Level ${aug.getLevel()}`}
</Typography> </Typography>
</Tooltip> </Tooltip>

@ -6,14 +6,14 @@ import { List, ListItemText, Paper, Tooltip, Typography } from "@mui/material";
import * as React from "react"; import * as React from "react";
import { Player } from "@player"; import { Player } from "@player";
import { StaticAugmentations } from "../StaticAugmentations"; import { StaticAugmentations } from "../StaticAugmentations";
import { AugmentationNames } from "../data/AugmentationNames"; import { AugmentationName } from "@enums";
export function PurchasedAugmentations(): React.ReactElement { export function PurchasedAugmentations(): React.ReactElement {
const augs: React.ReactElement[] = []; const augs: React.ReactElement[] = [];
// Only render the last NeuroFlux (there are no findLastIndex btw) // Only render the last NeuroFlux (there are no findLastIndex btw)
let nfgIndex = -1; let nfgIndex = -1;
for (let i = Player.queuedAugmentations.length - 1; i >= 0; i--) { for (let i = Player.queuedAugmentations.length - 1; i >= 0; i--) {
if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) { if (Player.queuedAugmentations[i].name === AugmentationName.NeuroFluxGovernor) {
nfgIndex = i; nfgIndex = i;
break; break;
} }
@ -22,11 +22,11 @@ export function PurchasedAugmentations(): React.ReactElement {
const ownedAug = Player.queuedAugmentations[i]; const ownedAug = Player.queuedAugmentations[i];
let displayName = ownedAug.name; let displayName = ownedAug.name;
if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex) continue; if (ownedAug.name === AugmentationName.NeuroFluxGovernor && i !== nfgIndex) continue;
const aug = StaticAugmentations[ownedAug.name]; const aug = StaticAugmentations[ownedAug.name];
let level = null; let level = null;
if (ownedAug.name === AugmentationNames.NeuroFluxGovernor) { if (ownedAug.name === AugmentationName.NeuroFluxGovernor) {
level = ownedAug.level; level = ownedAug.level;
displayName += ` - Level ${level}`; displayName += ` - Level ${level}`;
} }

@ -48,7 +48,7 @@ export function SourceFileMinus1(): React.ReactElement {
<Typography>You have found the following exploits:</Typography> <Typography>You have found the following exploits:</Typography>
<Box mx={2}> <Box mx={2}>
{exploits.map((c: Exploit) => ( {exploits.map((c) => (
<Typography key={c}>* {ExploitName(c)}</Typography> <Typography key={c}>* {ExploitName(c)}</Typography>
))} ))}
</Box> </Box>

@ -31,7 +31,7 @@ const safeGetSf = (sfNum: number): SourceFile | SfMinus1 | null => {
You have found the following exploits: You have found the following exploits:
<br /> <br />
<br /> <br />
{Player.exploits.map((c: Exploit) => ( {Player.exploits.map((c) => (
<React.Fragment key={c}> <React.Fragment key={c}>
* {ExploitName(c)} * {ExploitName(c)}
<br /> <br />

@ -1,8 +1,7 @@
import React from "react"; import React from "react";
import { Player } from "@player"; import { Player } from "@player";
import { BitNodeMultipliers, IBitNodeMultipliers } from "./BitNodeMultipliers"; import { BitNodeMultipliers, IBitNodeMultipliers } from "./BitNodeMultipliers";
import { FactionNames } from "../Faction/data/FactionNames"; import { CityName, FactionName } from "@enums";
import { CityName } from "../Enums";
class BitNode { class BitNode {
// A short description, or tagline, about the BitNode // A short description, or tagline, about the BitNode
@ -72,9 +71,8 @@ export function initBitNodes() {
and savagery. The organized crime factions quickly rose to the top of the modern world. and savagery. The organized crime factions quickly rose to the top of the modern world.
<br /> <br />
<br /> <br />
Certain Factions ({FactionNames.SlumSnakes}, {FactionNames.Tetrads}, {FactionNames.TheSyndicate},{" "} Certain Factions ({FactionName.SlumSnakes}, {FactionName.Tetrads}, {FactionName.TheSyndicate},{" "}
{FactionNames.TheDarkArmy}, {FactionNames.SpeakersForTheDead}, {FactionNames.NiteSec},{" "} {FactionName.TheDarkArmy}, {FactionName.SpeakersForTheDead}, {FactionName.NiteSec}, {FactionName.TheBlackHand}
{FactionNames.TheBlackHand}
) give the player the ability to form and manage their own gangs. These gangs will earn the player money and ) give the player the ability to form and manage their own gangs. These gangs will earn the player money and
reputation with the corresponding Faction reputation with the corresponding Faction
<br /> <br />
@ -188,23 +186,23 @@ export function initBitNodes() {
BitNodes.BitNode6 = new BitNode( BitNodes.BitNode6 = new BitNode(
6, 6,
1, 1,
FactionNames.Bladeburners, FactionName.Bladeburners,
"Like Tears in Rain", "Like Tears in Rain",
( (
<> <>
In the middle of the 21st century, {FactionNames.OmniTekIncorporated} began designing and manufacturing advanced In the middle of the 21st century, {FactionName.OmniTekIncorporated} began designing and manufacturing advanced
synthetic androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth synthetic androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth
generation of their Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was generation of their Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was
the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more
intelligent than the humans that had created them. intelligent than the humans that had created them.
<br /> <br />
<br /> <br />
In this BitNode you will be able to access the {FactionNames.Bladeburners} Division at the NSA, which provides a In this BitNode you will be able to access the {FactionName.Bladeburners} Division at the NSA, which provides a
new mechanic for progression. new mechanic for progression.
<br /> <br />
<br /> <br />
Destroying this BitNode will give you Source-File 6, or if you already have this Source-File it will upgrade its Destroying this BitNode will give you Source-File 6, or if you already have this Source-File it will upgrade its
level up to a maximum of 3. This Source-File allows you to access the NSA's {FactionNames.Bladeburners} Division level up to a maximum of 3. This Source-File allows you to access the NSA's {FactionName.Bladeburners} Division
in other BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your in other BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your
combat stats by: combat stats by:
<br /> <br />
@ -220,24 +218,24 @@ export function initBitNodes() {
BitNodes.BitNode7 = new BitNode( BitNodes.BitNode7 = new BitNode(
7, 7,
2, 2,
`${FactionNames.Bladeburners} 2079`, `${FactionName.Bladeburners} 2079`,
"More human than humans", "More human than humans",
( (
<> <>
In the middle of the 21st century, you were doing cutting-edge work at {FactionNames.OmniTekIncorporated} as In the middle of the 21st century, you were doing cutting-edge work at {FactionName.OmniTekIncorporated} as part
part of the AI design team for advanced synthetic androids, or Synthoids for short. You helped achieve a major of the AI design team for advanced synthetic androids, or Synthoids for short. You helped achieve a major
technological breakthrough in the sixth generation of the company's Synthoid design, called MK-VI, by developing technological breakthrough in the sixth generation of the company's Synthoid design, called MK-VI, by developing
a hyperintelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid a hyperintelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid
models that were stronger, faster, and more intelligent than the humans that had created them. models that were stronger, faster, and more intelligent than the humans that had created them.
<br /> <br />
<br /> <br />
In this BitNode you will be able to access the {FactionNames.Bladeburners} API, which allows you to access{" "} In this BitNode you will be able to access the {FactionName.Bladeburners} API, which allows you to access{" "}
{FactionNames.Bladeburners} functionality through Netscript. {FactionName.Bladeburners} functionality through Netscript.
<br /> <br />
<br /> <br />
Destroying this BitNode will give you Source-File 7, or if you already have this Source-File it will upgrade its Destroying this BitNode will give you Source-File 7, or if you already have this Source-File it will upgrade its
level up to a maximum of 3. This Source-File allows you to access the {FactionNames.Bladeburners} Netscript API level up to a maximum of 3. This Source-File allows you to access the {FactionName.Bladeburners} Netscript API
in other BitNodes. In addition, this Source-File will increase all of your {FactionNames.Bladeburners}{" "} in other BitNodes. In addition, this Source-File will increase all of your {FactionName.Bladeburners}{" "}
multipliers by: multipliers by:
<br /> <br />
<br /> <br />
@ -297,9 +295,9 @@ export function initBitNodes() {
"Hacknet Unleashed", "Hacknet Unleashed",
( (
<> <>
When {FactionNames.FulcrumSecretTechnologies} released their open-source Linux distro Chapeau, it quickly became When {FactionName.FulcrumSecretTechnologies} released their open-source Linux distro Chapeau, it quickly became
the OS of choice for the underground hacking community. Chapeau became especially notorious for powering the the OS of choice for the underground hacking community. Chapeau became especially notorious for powering the
Hacknet, a global, decentralized network used for nefarious purposes. {FactionNames.FulcrumSecretTechnologies}{" "} Hacknet, a global, decentralized network used for nefarious purposes. {FactionName.FulcrumSecretTechnologies}{" "}
quickly abandoned the project and dissociated themselves from it. quickly abandoned the project and dissociated themselves from it.
<br /> <br />
<br /> <br />
@ -431,7 +429,7 @@ export function initBitNodes() {
( (
<> <>
With the invention of Augmentations in the 2040s a religious group known as the{" "} With the invention of Augmentations in the 2040s a religious group known as the{" "}
{FactionNames.ChurchOfTheMachineGod} has rallied far more support than anyone would have hoped. {FactionName.ChurchOfTheMachineGod} has rallied far more support than anyone would have hoped.
<br /> <br />
<br /> <br />
Their leader, Allison "Mother" Stanek is said to have created her own Augmentation whose power goes beyond any Their leader, Allison "Mother" Stanek is said to have created her own Augmentation whose power goes beyond any
@ -439,7 +437,7 @@ export function initBitNodes() {
<br /> <br />
<br /> <br />
Destroying this BitNode will give you Source-File 13, or if you already have this Source-File it will upgrade Destroying this BitNode will give you Source-File 13, or if you already have this Source-File it will upgrade
its level up to a maximum of 3. This Source-File lets the {FactionNames.ChurchOfTheMachineGod} appear in other its level up to a maximum of 3. This Source-File lets the {FactionName.ChurchOfTheMachineGod} appear in other
BitNodes. BitNodes.
<br /> <br />
<br /> <br />

@ -1,11 +1,11 @@
import { BlackOperation } from "./BlackOperation"; import { BlackOperation } from "./BlackOperation";
import { BlackOperationNames } from "./data/BlackOperationNames"; import { BlackOperationName } from "@enums";
export const BlackOperations: Record<string, BlackOperation> = {}; export const BlackOperations: Record<string, BlackOperation> = {};
(function () { (function () {
BlackOperations[BlackOperationNames.OperationTyphoon] = new BlackOperation({ BlackOperations[BlackOperationName.OperationTyphoon] = new BlackOperation({
name: BlackOperationNames.OperationTyphoon, name: BlackOperationName.OperationTyphoon,
baseDifficulty: 2000, baseDifficulty: 2000,
reqdRank: 2.5e3, reqdRank: 2.5e3,
rankGain: 50, rankGain: 50,
@ -31,8 +31,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationZero] = new BlackOperation({ BlackOperations[BlackOperationName.OperationZero] = new BlackOperation({
name: BlackOperationNames.OperationZero, name: BlackOperationName.OperationZero,
baseDifficulty: 2500, baseDifficulty: 2500,
reqdRank: 5e3, reqdRank: 5e3,
rankGain: 60, rankGain: 60,
@ -58,8 +58,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isStealth: true, isStealth: true,
}); });
BlackOperations[BlackOperationNames.OperationX] = new BlackOperation({ BlackOperations[BlackOperationName.OperationX] = new BlackOperation({
name: BlackOperationNames.OperationX, name: BlackOperationName.OperationX,
baseDifficulty: 3000, baseDifficulty: 3000,
reqdRank: 7.5e3, reqdRank: 7.5e3,
rankGain: 75, rankGain: 75,
@ -85,8 +85,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationTitan] = new BlackOperation({ BlackOperations[BlackOperationName.OperationTitan] = new BlackOperation({
name: BlackOperationNames.OperationTitan, name: BlackOperationName.OperationTitan,
baseDifficulty: 4000, baseDifficulty: 4000,
reqdRank: 10e3, reqdRank: 10e3,
rankGain: 100, rankGain: 100,
@ -112,8 +112,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationAres] = new BlackOperation({ BlackOperations[BlackOperationName.OperationAres] = new BlackOperation({
name: BlackOperationNames.OperationAres, name: BlackOperationName.OperationAres,
baseDifficulty: 5000, baseDifficulty: 5000,
reqdRank: 12.5e3, reqdRank: 12.5e3,
rankGain: 125, rankGain: 125,
@ -139,8 +139,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationArchangel] = new BlackOperation({ BlackOperations[BlackOperationName.OperationArchangel] = new BlackOperation({
name: BlackOperationNames.OperationArchangel, name: BlackOperationName.OperationArchangel,
baseDifficulty: 7500, baseDifficulty: 7500,
reqdRank: 15e3, reqdRank: 15e3,
rankGain: 200, rankGain: 200,
@ -166,8 +166,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationJuggernaut] = new BlackOperation({ BlackOperations[BlackOperationName.OperationJuggernaut] = new BlackOperation({
name: BlackOperationNames.OperationJuggernaut, name: BlackOperationName.OperationJuggernaut,
baseDifficulty: 10e3, baseDifficulty: 10e3,
reqdRank: 20e3, reqdRank: 20e3,
rankGain: 300, rankGain: 300,
@ -193,8 +193,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationRedDragon] = new BlackOperation({ BlackOperations[BlackOperationName.OperationRedDragon] = new BlackOperation({
name: BlackOperationNames.OperationRedDragon, name: BlackOperationName.OperationRedDragon,
baseDifficulty: 12.5e3, baseDifficulty: 12.5e3,
reqdRank: 25e3, reqdRank: 25e3,
rankGain: 500, rankGain: 500,
@ -220,8 +220,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationK] = new BlackOperation({ BlackOperations[BlackOperationName.OperationK] = new BlackOperation({
name: BlackOperationNames.OperationK, name: BlackOperationName.OperationK,
baseDifficulty: 15e3, baseDifficulty: 15e3,
reqdRank: 30e3, reqdRank: 30e3,
rankGain: 750, rankGain: 750,
@ -247,8 +247,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationDeckard] = new BlackOperation({ BlackOperations[BlackOperationName.OperationDeckard] = new BlackOperation({
name: BlackOperationNames.OperationDeckard, name: BlackOperationName.OperationDeckard,
baseDifficulty: 20e3, baseDifficulty: 20e3,
reqdRank: 40e3, reqdRank: 40e3,
rankGain: 1e3, rankGain: 1e3,
@ -274,8 +274,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationTyrell] = new BlackOperation({ BlackOperations[BlackOperationName.OperationTyrell] = new BlackOperation({
name: BlackOperationNames.OperationTyrell, name: BlackOperationName.OperationTyrell,
baseDifficulty: 25e3, baseDifficulty: 25e3,
reqdRank: 50e3, reqdRank: 50e3,
rankGain: 1.5e3, rankGain: 1.5e3,
@ -301,8 +301,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationWallace] = new BlackOperation({ BlackOperations[BlackOperationName.OperationWallace] = new BlackOperation({
name: BlackOperationNames.OperationWallace, name: BlackOperationName.OperationWallace,
baseDifficulty: 30e3, baseDifficulty: 30e3,
reqdRank: 75e3, reqdRank: 75e3,
rankGain: 2e3, rankGain: 2e3,
@ -328,8 +328,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationShoulderOfOrion] = new BlackOperation({ BlackOperations[BlackOperationName.OperationShoulderOfOrion] = new BlackOperation({
name: BlackOperationNames.OperationShoulderOfOrion, name: BlackOperationName.OperationShoulderOfOrion,
baseDifficulty: 35e3, baseDifficulty: 35e3,
reqdRank: 100e3, reqdRank: 100e3,
rankGain: 2.5e3, rankGain: 2.5e3,
@ -355,8 +355,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isStealth: true, isStealth: true,
}); });
BlackOperations[BlackOperationNames.OperationHyron] = new BlackOperation({ BlackOperations[BlackOperationName.OperationHyron] = new BlackOperation({
name: BlackOperationNames.OperationHyron, name: BlackOperationName.OperationHyron,
baseDifficulty: 40e3, baseDifficulty: 40e3,
reqdRank: 125e3, reqdRank: 125e3,
rankGain: 3e3, rankGain: 3e3,
@ -382,8 +382,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationMorpheus] = new BlackOperation({ BlackOperations[BlackOperationName.OperationMorpheus] = new BlackOperation({
name: BlackOperationNames.OperationMorpheus, name: BlackOperationName.OperationMorpheus,
baseDifficulty: 45e3, baseDifficulty: 45e3,
reqdRank: 150e3, reqdRank: 150e3,
rankGain: 4e3, rankGain: 4e3,
@ -409,8 +409,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isStealth: true, isStealth: true,
}); });
BlackOperations[BlackOperationNames.OperationIonStorm] = new BlackOperation({ BlackOperations[BlackOperationName.OperationIonStorm] = new BlackOperation({
name: BlackOperationNames.OperationIonStorm, name: BlackOperationName.OperationIonStorm,
baseDifficulty: 50e3, baseDifficulty: 50e3,
reqdRank: 175e3, reqdRank: 175e3,
rankGain: 5e3, rankGain: 5e3,
@ -436,8 +436,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationAnnihilus] = new BlackOperation({ BlackOperations[BlackOperationName.OperationAnnihilus] = new BlackOperation({
name: BlackOperationNames.OperationAnnihilus, name: BlackOperationName.OperationAnnihilus,
baseDifficulty: 55e3, baseDifficulty: 55e3,
reqdRank: 200e3, reqdRank: 200e3,
rankGain: 7.5e3, rankGain: 7.5e3,
@ -463,8 +463,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationUltron] = new BlackOperation({ BlackOperations[BlackOperationName.OperationUltron] = new BlackOperation({
name: BlackOperationNames.OperationUltron, name: BlackOperationName.OperationUltron,
baseDifficulty: 60e3, baseDifficulty: 60e3,
reqdRank: 250e3, reqdRank: 250e3,
rankGain: 10e3, rankGain: 10e3,
@ -490,8 +490,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
}, },
isKill: true, isKill: true,
}); });
BlackOperations[BlackOperationNames.OperationCenturion] = new BlackOperation({ BlackOperations[BlackOperationName.OperationCenturion] = new BlackOperation({
name: BlackOperationNames.OperationCenturion, name: BlackOperationName.OperationCenturion,
baseDifficulty: 70e3, baseDifficulty: 70e3,
reqdRank: 300e3, reqdRank: 300e3,
rankGain: 15e3, rankGain: 15e3,
@ -516,8 +516,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
int: 0.75, int: 0.75,
}, },
}); });
BlackOperations[BlackOperationNames.OperationVindictus] = new BlackOperation({ BlackOperations[BlackOperationName.OperationVindictus] = new BlackOperation({
name: BlackOperationNames.OperationVindictus, name: BlackOperationName.OperationVindictus,
baseDifficulty: 75e3, baseDifficulty: 75e3,
reqdRank: 350e3, reqdRank: 350e3,
rankGain: 20e3, rankGain: 20e3,
@ -542,8 +542,8 @@ export const BlackOperations: Record<string, BlackOperation> = {};
int: 0.75, int: 0.75,
}, },
}); });
BlackOperations[BlackOperationNames.OperationDaedalus] = new BlackOperation({ BlackOperations[BlackOperationName.OperationDaedalus] = new BlackOperation({
name: BlackOperationNames.OperationDaedalus, name: BlackOperationName.OperationDaedalus,
baseDifficulty: 80e3, baseDifficulty: 80e3,
reqdRank: 400e3, reqdRank: 400e3,
rankGain: 40e3, rankGain: 40e3,

@ -1,3 +1,4 @@
import { AugmentationName, CityName, FactionName } from "@enums";
import { constructorsForReviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from "../utils/JSONReviver"; import { constructorsForReviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from "../utils/JSONReviver";
import { ActionIdentifier } from "./ActionIdentifier"; import { ActionIdentifier } from "./ActionIdentifier";
import { ActionTypes } from "./data/ActionTypes"; import { ActionTypes } from "./data/ActionTypes";
@ -26,17 +27,14 @@ import { Factions, factionExists } from "../Faction/Factions";
import { calculateHospitalizationCost } from "../Hospital/Hospital"; import { calculateHospitalizationCost } from "../Hospital/Hospital";
import { dialogBoxCreate } from "../ui/React/DialogBox"; import { dialogBoxCreate } from "../ui/React/DialogBox";
import { Settings } from "../Settings/Settings"; import { Settings } from "../Settings/Settings";
import { AugmentationNames } from "../Augmentation/data/AugmentationNames";
import { getTimestamp } from "../utils/helpers/getTimestamp"; import { getTimestamp } from "../utils/helpers/getTimestamp";
import { joinFaction } from "../Faction/FactionHelpers"; import { joinFaction } from "../Faction/FactionHelpers";
import { WorkerScript } from "../Netscript/WorkerScript"; import { WorkerScript } from "../Netscript/WorkerScript";
import { FactionNames } from "../Faction/data/FactionNames";
import { KEY } from "../utils/helpers/keyCodes"; import { KEY } from "../utils/helpers/keyCodes";
import { isSleeveInfiltrateWork } from "../PersonObjects/Sleeve/Work/SleeveInfiltrateWork"; import { isSleeveInfiltrateWork } from "../PersonObjects/Sleeve/Work/SleeveInfiltrateWork";
import { isSleeveSupportWork } from "../PersonObjects/Sleeve/Work/SleeveSupportWork"; import { isSleeveSupportWork } from "../PersonObjects/Sleeve/Work/SleeveSupportWork";
import { WorkStats, newWorkStats } from "../Work/WorkStats"; import { WorkStats, newWorkStats } from "../Work/WorkStats";
import { CityName } from "../Enums"; import { getEnumHelper } from "../utils/EnumHelper";
import { getRandomMember } from "../utils/helpers/enum";
import { createEnumKeyedRecord } from "../Types/Record"; import { createEnumKeyedRecord } from "../Types/Record";
export interface BlackOpsAttempt { export interface BlackOpsAttempt {
@ -293,7 +291,7 @@ export class Bladeburner {
prestige(): void { prestige(): void {
this.resetAction(); this.resetAction();
const bladeburnerFac = Factions[FactionNames.Bladeburners]; const bladeburnerFac = Factions[FactionName.Bladeburners];
if (this.rank >= BladeburnerConstants.RankNeededForFaction) { if (this.rank >= BladeburnerConstants.RankNeededForFaction) {
joinFaction(bladeburnerFac); joinFaction(bladeburnerFac);
} }
@ -849,8 +847,9 @@ export class Bladeburner {
} }
triggerMigration(sourceCityName: CityName): void { triggerMigration(sourceCityName: CityName): void {
let destCityName = getRandomMember(CityName); const cityHelper = getEnumHelper("CityName");
while (destCityName === sourceCityName) destCityName = getRandomMember(CityName); let destCityName = cityHelper.random();
while (destCityName === sourceCityName) destCityName = cityHelper.random();
const destCity = this.cities[destCityName]; const destCity = this.cities[destCityName];
const sourceCity = this.cities[sourceCityName]; const sourceCity = this.cities[sourceCityName];
@ -883,13 +882,14 @@ export class Bladeburner {
randomEvent(): void { randomEvent(): void {
const chance = Math.random(); const chance = Math.random();
const cityHelper = getEnumHelper("CityName");
// Choose random source/destination city for events // Choose random source/destination city for events
const sourceCityName = getRandomMember(CityName); const sourceCityName = cityHelper.random();
const sourceCity = this.cities[sourceCityName]; const sourceCity = this.cities[sourceCityName];
let destCityName = getRandomMember(CityName); let destCityName = cityHelper.random();
while (destCityName === sourceCityName) destCityName = getRandomMember(CityName); while (destCityName === sourceCityName) destCityName = cityHelper.random();
const destCity = this.cities[destCityName]; const destCity = this.cities[destCityName];
if (chance <= 0.05) { if (chance <= 0.05) {
@ -1607,12 +1607,12 @@ export class Bladeburner {
} }
this.maxRank = Math.max(this.rank, this.maxRank); this.maxRank = Math.max(this.rank, this.maxRank);
const bladeburnersFactionName = FactionNames.Bladeburners; const bladeburnersFactionName = FactionName.Bladeburners;
if (factionExists(bladeburnersFactionName)) { if (factionExists(bladeburnersFactionName)) {
const bladeburnerFac = Factions[bladeburnersFactionName]; const bladeburnerFac = Factions[bladeburnersFactionName];
if (!bladeburnerFac) { if (!bladeburnerFac) {
throw new Error( throw new Error(
`Could not properly get ${FactionNames.Bladeburners} Faction object in ${FactionNames.Bladeburners} UI Overview Faction button`, `Could not properly get ${FactionName.Bladeburners} Faction object in ${FactionName.Bladeburners} UI Overview Faction button`,
); );
} }
if (bladeburnerFac.isMember) { if (bladeburnerFac.isMember) {
@ -1959,7 +1959,7 @@ export class Bladeburner {
if (!Router.isInitialized) return; if (!Router.isInitialized) return;
// If the Player starts doing some other actions, set action to idle and alert // If the Player starts doing some other actions, set action to idle and alert
if (!Player.hasAugmentation(AugmentationNames.BladesSimulacrum, true) && Player.currentWork) { if (!Player.hasAugmentation(AugmentationName.BladesSimulacrum, true) && Player.currentWork) {
if (this.action.type !== ActionTypes.Idle) { if (this.action.type !== ActionTypes.Idle) {
let msg = "Your Bladeburner action was cancelled because you started doing something else."; let msg = "Your Bladeburner action was cancelled because you started doing something else.";
if (this.automateEnabled) { if (this.automateEnabled) {
@ -2360,12 +2360,12 @@ export class Bladeburner {
} }
joinBladeburnerFactionNetscriptFn(workerScript: WorkerScript): boolean { joinBladeburnerFactionNetscriptFn(workerScript: WorkerScript): boolean {
const bladeburnerFac = Factions[FactionNames.Bladeburners]; const bladeburnerFac = Factions[FactionName.Bladeburners];
if (bladeburnerFac.isMember) { if (bladeburnerFac.isMember) {
return true; return true;
} else if (this.rank >= BladeburnerConstants.RankNeededForFaction) { } else if (this.rank >= BladeburnerConstants.RankNeededForFaction) {
joinFaction(bladeburnerFac); joinFaction(bladeburnerFac);
workerScript.log("bladeburner.joinBladeburnerFaction", () => `Joined ${FactionNames.Bladeburners} faction.`); workerScript.log("bladeburner.joinBladeburnerFaction", () => `Joined ${FactionName.Bladeburners} faction.`);
return true; return true;
} else { } else {
workerScript.log( workerScript.log(

@ -2,7 +2,7 @@ import { BladeburnerConstants } from "./data/Constants";
import { getRandomInt } from "../utils/helpers/getRandomInt"; import { getRandomInt } from "../utils/helpers/getRandomInt";
import { Generic_fromJSON, Generic_toJSON, IReviverValue, constructorsForReviver } from "../utils/JSONReviver"; import { Generic_fromJSON, Generic_toJSON, IReviverValue, constructorsForReviver } from "../utils/JSONReviver";
import { addOffset } from "../utils/helpers/addOffset"; import { addOffset } from "../utils/helpers/addOffset";
import { CityName } from "../Enums"; import { CityName } from "@enums";
interface IChangePopulationByCountParams { interface IChangePopulationByCountParams {
/** How much the estimate should change by. */ /** How much the estimate should change by. */

@ -1,4 +1,4 @@
export enum BlackOperationNames { export enum BlackOperationName {
OperationTyphoon = "Operation Typhoon", OperationTyphoon = "Operation Typhoon",
OperationZero = "Operation Zero", OperationZero = "Operation Zero",
OperationX = "Operation X", OperationX = "Operation X",

@ -1,41 +1,39 @@
import React from "react"; import React from "react";
import { FactionNames } from "../../Faction/data/FactionNames"; import { BlackOperationName, CityName, FactionName } from "@enums";
import { CityName } from "../../Enums";
import { BlackOperationNames } from "./BlackOperationNames";
interface IBlackOp { interface IBlackOp {
desc: JSX.Element; desc: JSX.Element;
} }
export const BlackOperations: Record<string, IBlackOp | undefined> = { export const BlackOperations: Record<string, IBlackOp | undefined> = {
[BlackOperationNames.OperationTyphoon]: { [BlackOperationName.OperationTyphoon]: {
desc: ( desc: (
<> <>
Obadiah Zenyatta is the leader of a RedWater PMC. It has long been known among the intelligence community that Obadiah Zenyatta is the leader of a RedWater PMC. It has long been known among the intelligence community that
Zenyatta, along with the rest of the PMC, is a Synthoid. Zenyatta, along with the rest of the PMC, is a Synthoid.
<br /> <br />
<br /> <br />
The goal of {BlackOperationNames.OperationTyphoon} is to find and eliminate Zenyatta and RedWater by any means The goal of {BlackOperationName.OperationTyphoon} is to find and eliminate Zenyatta and RedWater by any means
necessary. After the task is completed, the actions must be covered up from the general public. necessary. After the task is completed, the actions must be covered up from the general public.
</> </>
), ),
}, },
[BlackOperationNames.OperationZero]: { [BlackOperationName.OperationZero]: {
desc: ( desc: (
<> <>
AeroCorp is one of the world's largest defense contractors. Its leader, Steve Watataki, is thought to be a AeroCorp is one of the world's largest defense contractors. Its leader, Steve Watataki, is thought to be a
supporter of Synthoid rights. He must be removed. supporter of Synthoid rights. He must be removed.
<br /> <br />
<br /> <br />
The goal of {BlackOperationNames.OperationZero} is to covertly infiltrate AeroCorp and uncover any incriminating The goal of {BlackOperationName.OperationZero} is to covertly infiltrate AeroCorp and uncover any incriminating
evidence or information against Watataki that will cause him to be removed from his position at AeroCorp. evidence or information against Watataki that will cause him to be removed from his position at AeroCorp.
Incriminating evidence can be fabricated as a last resort. Be warned that AeroCorp has some of the most advanced Incriminating evidence can be fabricated as a last resort. Be warned that AeroCorp has some of the most advanced
security measures in the world. security measures in the world.
</> </>
), ),
}, },
[BlackOperationNames.OperationX]: { [BlackOperationName.OperationX]: {
desc: ( desc: (
<> <>
We have recently discovered an underground publication group called Samizdat. Even though most of their We have recently discovered an underground publication group called Samizdat. Even though most of their
@ -50,7 +48,7 @@ export const BlackOperations: Record<string, IBlackOp | undefined> = {
</> </>
), ),
}, },
[BlackOperationNames.OperationTitan]: { [BlackOperationName.OperationTitan]: {
desc: ( desc: (
<> <>
Several months ago Titan Laboratories' Bioengineering department was infiltrated by Synthoids. As far as we Several months ago Titan Laboratories' Bioengineering department was infiltrated by Synthoids. As far as we
@ -65,7 +63,7 @@ export const BlackOperations: Record<string, IBlackOp | undefined> = {
</> </>
), ),
}, },
[BlackOperationNames.OperationAres]: { [BlackOperationName.OperationAres]: {
desc: ( desc: (
<> <>
One of our undercover agents, Agent Carter, has informed us of a massive weapons deal going down in Dubai One of our undercover agents, Agent Carter, has informed us of a massive weapons deal going down in Dubai
@ -77,7 +75,7 @@ export const BlackOperations: Record<string, IBlackOp | undefined> = {
</> </>
), ),
}, },
[BlackOperationNames.OperationArchangel]: { [BlackOperationName.OperationArchangel]: {
desc: ( desc: (
<> <>
Our analysts have discovered that the popular Red Rabbit brothel in Amsterdam is run and 'staffed' by MK-VI Our analysts have discovered that the popular Red Rabbit brothel in Amsterdam is run and 'staffed' by MK-VI
@ -90,7 +88,7 @@ export const BlackOperations: Record<string, IBlackOp | undefined> = {
</> </>
), ),
}, },
[BlackOperationNames.OperationJuggernaut]: { [BlackOperationName.OperationJuggernaut]: {
desc: ( desc: (
<> <>
The CIA has just encountered a new security threat. A new criminal group, lead by a shadowy operative who calls The CIA has just encountered a new security threat. A new criminal group, lead by a shadowy operative who calls
@ -104,20 +102,20 @@ export const BlackOperations: Record<string, IBlackOp | undefined> = {
</> </>
), ),
}, },
[BlackOperationNames.OperationRedDragon]: { [BlackOperationName.OperationRedDragon]: {
desc: ( desc: (
<> <>
The {FactionNames.Tetrads} criminal organization is suspected of reverse-engineering the MK-VI Synthoid design. The {FactionName.Tetrads} criminal organization is suspected of reverse-engineering the MK-VI Synthoid design.
We believe they altered and possibly improved the design and began manufacturing their own Synthoid models in We believe they altered and possibly improved the design and began manufacturing their own Synthoid models in
order to bolster their criminal activities. order to bolster their criminal activities.
<br /> <br />
<br /> <br />
Your task is to infiltrate and destroy the {FactionNames.Tetrads}' base of operations in Los Angeles. Your task is to infiltrate and destroy the {FactionName.Tetrads}' base of operations in Los Angeles.
Intelligence tells us that their base houses one of their Synthoid manufacturing units. Intelligence tells us that their base houses one of their Synthoid manufacturing units.
</> </>
), ),
}, },
[BlackOperationNames.OperationK]: { [BlackOperationName.OperationK]: {
desc: ( desc: (
<> <>
CODE RED SITUATION. Our intelligence tells us that VitaLife has discovered a new android cloning technology. CODE RED SITUATION. Our intelligence tells us that VitaLife has discovered a new android cloning technology.
@ -133,52 +131,51 @@ export const BlackOperations: Record<string, IBlackOp | undefined> = {
</> </>
), ),
}, },
[BlackOperationNames.OperationDeckard]: { [BlackOperationName.OperationDeckard]: {
desc: ( desc: (
<> <>
Despite your success in eliminating VitaLife's new android-replicating technology in{" "} Despite your success in eliminating VitaLife's new android-replicating technology in{" "}
{BlackOperationNames.OperationK}, we've discovered that a small group of MK-VI Synthoids were able to make off {BlackOperationName.OperationK}, we've discovered that a small group of MK-VI Synthoids were able to make off
with the schematics and design of the technology before the Operation. It is almost a certainty that these with the schematics and design of the technology before the Operation. It is almost a certainty that these
Synthoids are some of the rogue MK-VI ones from the Synthoid Uprising. Synthoids are some of the rogue MK-VI ones from the Synthoid Uprising.
<br /> <br />
<br /> <br />
The goal of {BlackOperationNames.OperationDeckard} is to hunt down these Synthoids and retire them. I don't need The goal of {BlackOperationName.OperationDeckard} is to hunt down these Synthoids and retire them. I don't need
to tell you how critical this mission is. to tell you how critical this mission is.
</> </>
), ),
}, },
[BlackOperationNames.OperationTyrell]: { [BlackOperationName.OperationTyrell]: {
desc: ( desc: (
<> <>
A week ago {FactionNames.BladeIndustries} reported a small break-in at one of their {CityName.Aevum}{" "} A week ago {FactionName.BladeIndustries} reported a small break-in at one of their {CityName.Aevum} Augmentation
Augmentation storage facilities. We figured out that {FactionNames.TheDarkArmy} was behind the heist, and didn't storage facilities. We figured out that {FactionName.TheDarkArmy} was behind the heist, and didn't think any
think any more of it. However, we've just discovered that several known MK-VI Synthoids were part of that more of it. However, we've just discovered that several known MK-VI Synthoids were part of that break-in group.
break-in group.
<br /> <br />
<br /> <br />
We cannot have Synthoids upgrading their already-enhanced abilities with Augmentations. Your task is to hunt We cannot have Synthoids upgrading their already-enhanced abilities with Augmentations. Your task is to hunt
down associated {FactionNames.TheDarkArmy} members and eliminate them. down associated {FactionName.TheDarkArmy} members and eliminate them.
</> </>
), ),
}, },
[BlackOperationNames.OperationWallace]: { [BlackOperationName.OperationWallace]: {
desc: ( desc: (
<> <>
Based on information gathered from {BlackOperationNames.OperationTyrell}, we've discovered that{" "} Based on information gathered from {BlackOperationName.OperationTyrell}, we've discovered that{" "}
{FactionNames.TheDarkArmy} was well aware that there were Synthoids amongst their ranks. Even worse, we believe {FactionName.TheDarkArmy} was well aware that there were Synthoids amongst their ranks. Even worse, we believe
that {FactionNames.TheDarkArmy} is working together with other criminal organizations such as{" "} that {FactionName.TheDarkArmy} is working together with other criminal organizations such as{" "}
{FactionNames.TheSyndicate} and that they are planning some sort of large-scale takeover of multiple major {FactionName.TheSyndicate} and that they are planning some sort of large-scale takeover of multiple major
cities, most notably {CityName.Aevum}. We suspect that Synthoids have infiltrated the ranks of these criminal cities, most notably {CityName.Aevum}. We suspect that Synthoids have infiltrated the ranks of these criminal
factions and are trying to stage another Synthoid uprising. factions and are trying to stage another Synthoid uprising.
<br /> <br />
<br /> <br />
The best way to deal with this is to prevent it before it even happens. The goal of{" "} The best way to deal with this is to prevent it before it even happens. The goal of{" "}
{BlackOperationNames.OperationWallace} is to destroy {FactionNames.TheDarkArmy} and Syndicate factions in{" "} {BlackOperationName.OperationWallace} is to destroy {FactionName.TheDarkArmy} and Syndicate factions in{" "}
{CityName.Aevum} immediately. Leave no survivors. {CityName.Aevum} immediately. Leave no survivors.
</> </>
), ),
}, },
[BlackOperationNames.OperationShoulderOfOrion]: { [BlackOperationName.OperationShoulderOfOrion]: {
desc: ( desc: (
<> <>
China's Solaris Space Systems is secretly launching the first manned spacecraft in over a decade using China's Solaris Space Systems is secretly launching the first manned spacecraft in over a decade using
@ -191,10 +188,10 @@ export const BlackOperations: Record<string, IBlackOp | undefined> = {
</> </>
), ),
}, },
[BlackOperationNames.OperationHyron]: { [BlackOperationName.OperationHyron]: {
desc: ( desc: (
<> <>
Our intelligence tells us that {FactionNames.FulcrumSecretTechnologies} is developing a quantum supercomputer Our intelligence tells us that {FactionName.FulcrumSecretTechnologies} is developing a quantum supercomputer
using human brains as core processors. This supercomputer is rumored to be able to store vast amounts of data using human brains as core processors. This supercomputer is rumored to be able to store vast amounts of data
and perform computations unmatched by any other supercomputer on the planet. But more importantly, the use of and perform computations unmatched by any other supercomputer on the planet. But more importantly, the use of
organic human brains means that the supercomputer may be able to reason abstractly and become self-aware. organic human brains means that the supercomputer may be able to reason abstractly and become self-aware.
@ -203,13 +200,13 @@ export const BlackOperations: Record<string, IBlackOp | undefined> = {
I do not need to remind you why sentient-level AIs pose a serious threat to all of mankind. I do not need to remind you why sentient-level AIs pose a serious threat to all of mankind.
<br /> <br />
<br /> <br />
The research for this project is being conducted at one of {FactionNames.FulcrumSecretTechnologies} secret The research for this project is being conducted at one of {FactionName.FulcrumSecretTechnologies} secret
facilities in {CityName.Aevum}, codenamed 'Alpha Ranch'. Infiltrate the compound, delete and destroy the work, facilities in {CityName.Aevum}, codenamed 'Alpha Ranch'. Infiltrate the compound, delete and destroy the work,
and then find and kill the project lead. and then find and kill the project lead.
</> </>
), ),
}, },
[BlackOperationNames.OperationMorpheus]: { [BlackOperationName.OperationMorpheus]: {
desc: ( desc: (
<> <>
DreamSense Technologies is an advertising company that uses special technology to transmit their ads into the DreamSense Technologies is an advertising company that uses special technology to transmit their ads into the
@ -222,7 +219,7 @@ export const BlackOperations: Record<string, IBlackOp | undefined> = {
</> </>
), ),
}, },
[BlackOperationNames.OperationIonStorm]: { [BlackOperationName.OperationIonStorm]: {
desc: ( desc: (
<> <>
Our analysts have uncovered a gathering of MK-VI Synthoids that have taken up residence in the{" "} Our analysts have uncovered a gathering of MK-VI Synthoids that have taken up residence in the{" "}
@ -235,26 +232,26 @@ export const BlackOperations: Record<string, IBlackOp | undefined> = {
</> </>
), ),
}, },
[BlackOperationNames.OperationAnnihilus]: { [BlackOperationName.OperationAnnihilus]: {
desc: ( desc: (
<> <>
Our superiors have ordered us to eradicate everything and everyone in an underground facility located in{" "} Our superiors have ordered us to eradicate everything and everyone in an underground facility located in{" "}
{CityName.Aevum}. They tell us that the facility houses many dangerous Synthoids and belongs to a terrorist {CityName.Aevum}. They tell us that the facility houses many dangerous Synthoids and belongs to a terrorist
organization called '{FactionNames.TheCovenant}'. We have no prior intelligence about this organization, so you organization called '{FactionName.TheCovenant}'. We have no prior intelligence about this organization, so you
are going in blind. are going in blind.
</> </>
), ),
}, },
[BlackOperationNames.OperationUltron]: { [BlackOperationName.OperationUltron]: {
desc: ( desc: (
<> <>
{FactionNames.OmniTekIncorporated}, the original designer and manufacturer of Synthoids, has notified us of a {FactionName.OmniTekIncorporated}, the original designer and manufacturer of Synthoids, has notified us of a
malfunction in their AI design. This malfunction, when triggered, causes MK-VI Synthoids to become radicalized malfunction in their AI design. This malfunction, when triggered, causes MK-VI Synthoids to become radicalized
and seek out the destruction of humanity. They say that this bug affects all MK-VI Synthoids, not just the rogue and seek out the destruction of humanity. They say that this bug affects all MK-VI Synthoids, not just the rogue
ones from the Uprising. ones from the Uprising.
<br /> <br />
<br /> <br />
{FactionNames.OmniTekIncorporated} has also told us they believe someone has triggered this malfunction in a {FactionName.OmniTekIncorporated} has also told us they believe someone has triggered this malfunction in a
large group of MK-VI Synthoids, and that these newly-radicalized Synthoids are now amassing in{" "} large group of MK-VI Synthoids, and that these newly-radicalized Synthoids are now amassing in{" "}
{CityName.Volhaven} to form a terrorist group called Ultron. {CityName.Volhaven} to form a terrorist group called Ultron.
<br /> <br />
@ -267,7 +264,7 @@ export const BlackOperations: Record<string, IBlackOp | undefined> = {
</> </>
), ),
}, },
[BlackOperationNames.OperationCenturion]: { [BlackOperationName.OperationCenturion]: {
desc: ( desc: (
<> <>
{"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)"} {"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)"}
@ -285,7 +282,7 @@ export const BlackOperations: Record<string, IBlackOp | undefined> = {
</> </>
), ),
}, },
[BlackOperationNames.OperationVindictus]: { [BlackOperationName.OperationVindictus]: {
desc: ( desc: (
<> <>
{"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)"} {"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)"}
@ -299,7 +296,7 @@ export const BlackOperations: Record<string, IBlackOp | undefined> = {
</> </>
), ),
}, },
[BlackOperationNames.OperationDaedalus]: { [BlackOperationName.OperationDaedalus]: {
desc: <> Yesterday we obeyed kings and bent our neck to emperors. Today we kneel only to truth.</>, desc: <> Yesterday we obeyed kings and bent our neck to emperors. Today we kneel only to truth.</>,
}, },
}; };

@ -1,11 +1,9 @@
import * as React from "react"; import * as React from "react";
import { Button, Typography } from "@mui/material";
import { BlackOperationName, FactionName } from "@enums";
import { BlackOpList } from "./BlackOpList"; import { BlackOpList } from "./BlackOpList";
import { Bladeburner } from "../Bladeburner"; import { Bladeburner } from "../Bladeburner";
import Typography from "@mui/material/Typography";
import { FactionNames } from "../../Faction/data/FactionNames";
import { Router } from "../../ui/GameRoot"; import { Router } from "../../ui/GameRoot";
import { BlackOperationNames } from "../data/BlackOperationNames";
import { Button } from "@mui/material";
import { CorruptableText } from "../../ui/React/CorruptableText"; import { CorruptableText } from "../../ui/React/CorruptableText";
interface IProps { interface IProps {
@ -21,7 +19,7 @@ export function BlackOpPage(props: IProps): React.ReactElement {
<br /> <br />
<br /> <br />
<b> <b>
Your ultimate goal to climb through the ranks of {FactionNames.Bladeburners} is to complete all of the Black Your ultimate goal to climb through the ranks of {FactionName.Bladeburners} is to complete all of the Black
Ops. Ops.
</b> </b>
<br /> <br />
@ -29,7 +27,7 @@ export function BlackOpPage(props: IProps): React.ReactElement {
Like normal operations, you may use a team for Black Ops. Failing a black op will incur heavy HP and rank Like normal operations, you may use a team for Black Ops. Failing a black op will incur heavy HP and rank
losses. losses.
</Typography> </Typography>
{props.bladeburner.blackops[BlackOperationNames.OperationDaedalus] ? ( {props.bladeburner.blackops[BlackOperationName.OperationDaedalus] ? (
<Button sx={{ my: 1, p: 1 }} onClick={() => Router.toBitVerse(false, false)}> <Button sx={{ my: 1, p: 1 }} onClick={() => Router.toBitVerse(false, false)}>
<CorruptableText content="Destroy w0rld_d34mon"></CorruptableText> <CorruptableText content="Destroy w0rld_d34mon"></CorruptableText>
</Button> </Button>

@ -1,5 +1,5 @@
import React from "react"; import React from "react";
import { FactionNames } from "../../Faction/data/FactionNames"; import { FactionName } from "@enums";
import { Router } from "../../ui/GameRoot"; import { Router } from "../../ui/GameRoot";
import { Page } from "../../ui/Router"; import { Page } from "../../ui/Router";
import { CinematicText } from "../../ui/React/CinematicText"; import { CinematicText } from "../../ui/React/CinematicText";
@ -9,14 +9,14 @@ export function BladeburnerCinematic(): React.ReactElement {
return ( return (
<CinematicText <CinematicText
lines={[ lines={[
`In the middle of the 21st century, ${FactionNames.OmniTekIncorporated} advanced robot evolution `, `In the middle of the 21st century, ${FactionName.OmniTekIncorporated} advanced robot evolution `,
"with their Synthoids (synthetic androids), a being virtually identical to a human.", "with their Synthoids (synthetic androids), a being virtually identical to a human.",
"------", "------",
"Their sixth-generation Synthoids, called MK-VI, were stronger, faster, and more ", "Their sixth-generation Synthoids, called MK-VI, were stronger, faster, and more ",
"intelligent than humans. Many argued that the MK-VI Synthoids were the first ", "intelligent than humans. Many argued that the MK-VI Synthoids were the first ",
"example of sentient AI.", "example of sentient AI.",
"------", "------",
`Unfortunately, in 2070 a terrorist group called Ascendis Totalis hacked into ${FactionNames.OmniTekIncorporated} and `, `Unfortunately, in 2070 a terrorist group called Ascendis Totalis hacked into ${FactionName.OmniTekIncorporated} and `,
"uploaded a rogue AI into their Synthoid manufacturing facilities.", "uploaded a rogue AI into their Synthoid manufacturing facilities.",
"------", "------",
"The MK-VI Synthoids infected by the rogue AI turned hostile toward humanity, initiating ", "The MK-VI Synthoids infected by the rogue AI turned hostile toward humanity, initiating ",
@ -28,13 +28,13 @@ export function BladeburnerCinematic(): React.ReactElement {
"------", "------",
"The intelligence community believes that not all of the rogue MK-VI Synthoids from the Uprising were ", "The intelligence community believes that not all of the rogue MK-VI Synthoids from the Uprising were ",
"found and destroyed, and that many of them are blending in as normal humans in society today. ", "found and destroyed, and that many of them are blending in as normal humans in society today. ",
`As a result, many nations have created ${FactionNames.Bladeburners} divisions, special units that are tasked with `, `As a result, many nations have created ${FactionName.Bladeburners} divisions, special units that are tasked with `,
"investigating and dealing with Synthoid threats.", "investigating and dealing with Synthoid threats.",
]} ]}
onDone={() => { onDone={() => {
Router.toPage(Page.Terminal); Router.toPage(Page.Terminal);
dialogBoxCreate( dialogBoxCreate(
`Visit the National Security Agency (NSA) to apply for their ${FactionNames.Bladeburners} ` + `Visit the National Security Agency (NSA) to apply for their ${FactionName.Bladeburners} ` +
"division! You will need 100 of each combat stat before doing this.", "division! You will need 100 of each combat stat before doing this.",
); );
}} }}

@ -4,7 +4,7 @@ import { Bladeburner } from "../Bladeburner";
import { BlackOperation } from "../BlackOperation"; import { BlackOperation } from "../BlackOperation";
import { Player } from "@player"; import { Player } from "@player";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { AugmentationName } from "@enums";
import { ActionIdentifier } from "../ActionIdentifier"; import { ActionIdentifier } from "../ActionIdentifier";
interface IProps { interface IProps {
@ -33,7 +33,7 @@ export function StartButton(props: IProps): React.ReactElement {
if (disabled) return; if (disabled) return;
props.bladeburner.action.type = props.type; props.bladeburner.action.type = props.type;
props.bladeburner.action.name = props.name; props.bladeburner.action.name = props.name;
if (!Player.hasAugmentation(AugmentationNames.BladesSimulacrum, true)) Player.finishWork(true); if (!Player.hasAugmentation(AugmentationName.BladesSimulacrum, true)) Player.finishWork(true);
props.bladeburner.startAction(props.bladeburner.action); props.bladeburner.startAction(props.bladeburner.action);
props.rerender(); props.rerender();
} }

@ -1,7 +1,9 @@
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import { Box, Button, Paper, Tooltip, Typography } from "@mui/material";
import { Player } from "@player";
import { FactionName } from "@enums";
import { convertTimeMsToTimeElapsedString } from "../../utils/StringHelperFunctions"; import { convertTimeMsToTimeElapsedString } from "../../utils/StringHelperFunctions";
import { BladeburnerConstants } from "../data/Constants"; import { BladeburnerConstants } from "../data/Constants";
import { Player } from "@player";
import { Money } from "../../ui/React/Money"; import { Money } from "../../ui/React/Money";
import { formatNumberNoSuffix, formatPopulation, formatBigNumber } from "../../ui/formatNumber"; import { formatNumberNoSuffix, formatPopulation, formatBigNumber } from "../../ui/formatNumber";
import { Factions } from "../../Faction/Factions"; import { Factions } from "../../Faction/Factions";
@ -10,12 +12,6 @@ import { joinFaction } from "../../Faction/FactionHelpers";
import { Bladeburner } from "../Bladeburner"; import { Bladeburner } from "../Bladeburner";
import { TravelModal } from "./TravelModal"; import { TravelModal } from "./TravelModal";
import Typography from "@mui/material/Typography";
import Tooltip from "@mui/material/Tooltip";
import Box from "@mui/material/Box";
import Button from "@mui/material/Button";
import Paper from "@mui/material/Paper";
import { FactionNames } from "../../Faction/data/FactionNames";
interface IProps { interface IProps {
bladeburner: Bladeburner; bladeburner: Bladeburner;
@ -33,7 +29,7 @@ export function Stats(props: IProps): React.ReactElement {
function openFaction(): void { function openFaction(): void {
if (!inFaction) return; if (!inFaction) return;
const faction = Factions[FactionNames.Bladeburners]; const faction = Factions[FactionName.Bladeburners];
if (!faction.isMember) { if (!faction.isMember) {
joinFaction(faction); joinFaction(faction);
} }

@ -1,11 +1,10 @@
import React from "react"; import React from "react";
import { Button, Typography } from "@mui/material";
import { CityName } from "@enums";
import { Bladeburner } from "../Bladeburner"; import { Bladeburner } from "../Bladeburner";
import { WorldMap } from "../../ui/React/WorldMap"; import { WorldMap } from "../../ui/React/WorldMap";
import { Modal } from "../../ui/React/Modal"; import { Modal } from "../../ui/React/Modal";
import { CityName } from "../../Enums";
import { Settings } from "../../Settings/Settings"; import { Settings } from "../../Settings/Settings";
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";
interface IProps { interface IProps {
bladeburner: Bladeburner; bladeburner: Bladeburner;

@ -1,3 +1,4 @@
// No enum helper needed, does not need to be in an Enums.ts
// Enum values are lowercased to match css classes // Enum values are lowercased to match css classes
export enum Suit { export enum Suit {
Clubs = "clubs", Clubs = "clubs",

@ -55,6 +55,7 @@ for (const md of codingContractTypesMetadata) {
); );
} }
// Numeric enum
/** Enum representing the different types of rewards a Coding Contract can give */ /** Enum representing the different types of rewards a Coding Contract can give */
export enum CodingContractRewardType { export enum CodingContractRewardType {
FactionReputation, FactionReputation,
@ -63,6 +64,7 @@ export enum CodingContractRewardType {
Money, // This must always be the last reward type Money, // This must always be the last reward type
} }
// Numeric enum
/** Enum representing the result when trying to solve the Contract */ /** Enum representing the result when trying to solve the Contract */
export enum CodingContractResult { export enum CodingContractResult {
Success, Success,

@ -1,7 +1,7 @@
import { Person as IPerson } from "@nsdefs"; import { Person as IPerson } from "@nsdefs";
import { CONSTANTS } from "../Constants"; import { CONSTANTS } from "../Constants";
import * as names from "./data/JobTracks"; import * as names from "./data/JobTracks";
import { JobName } from "../Enums"; import { JobName } from "@enums";
export interface IConstructorParams { export interface IConstructorParams {
name: JobName; name: JobName;

@ -1,8 +1,9 @@
import * as posNames from "./JobTracks"; import * as posNames from "./JobTracks";
import { IConstructorParams } from "../Company"; import { IConstructorParams } from "../Company";
import { LocationName } from "../../Enums"; import { LocationName } from "@enums";
// These are grossly typed, need to address
// Create Objects containing Company Positions by category // Create Objects containing Company Positions by category
// Will help in metadata construction later // Will help in metadata construction later
const AllSoftwarePositions: Record<string, boolean> = {}; const AllSoftwarePositions: Record<string, boolean> = {};

@ -1,4 +1,6 @@
import { JobName } from "../../Enums"; import { JobName } from "@enums";
// This entire file can be reworked to
export const SoftwareCompanyPositions: JobName[] = [ export const SoftwareCompanyPositions: JobName[] = [
JobName.software0, JobName.software0,
JobName.software1, JobName.software1,

@ -12,10 +12,10 @@ import { OfficeSpace } from "./OfficeSpace";
import { Material } from "./Material"; import { Material } from "./Material";
import { Product } from "./Product"; import { Product } from "./Product";
import { Warehouse } from "./Warehouse"; import { Warehouse } from "./Warehouse";
import { IndustryType } from "./data/Enums"; import { IndustryType } from "@enums";
import { ResearchMap } from "./ResearchMap"; import { ResearchMap } from "./ResearchMap";
import { isRelevantMaterial } from "./ui/Helpers"; import { isRelevantMaterial } from "./ui/Helpers";
import { CityName } from "../Enums"; import { CityName } from "@enums";
import { getRandomInt } from "../utils/helpers/getRandomInt"; import { getRandomInt } from "../utils/helpers/getRandomInt";
import { getRecordValues } from "../Types/Record"; import { getRecordValues } from "../Types/Record";

@ -1,3 +1,5 @@
import { Player } from "@player";
import { CorpUnlockName, CorpUpgradeName, LiteratureName } from "@enums";
import { CorporationState } from "./CorporationState"; import { CorporationState } from "./CorporationState";
import { CorpUnlocks } from "./data/CorporationUnlocks"; import { CorpUnlocks } from "./data/CorporationUnlocks";
import { CorpUpgrades } from "./data/CorporationUpgrades"; import { CorpUpgrades } from "./data/CorporationUpgrades";
@ -6,15 +8,12 @@ import { Division } from "./Division";
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
import { showLiterature } from "../Literature/LiteratureHelpers"; import { showLiterature } from "../Literature/LiteratureHelpers";
import { LiteratureName } from "../Literature/data/LiteratureNames";
import { Player } from "@player";
import { dialogBoxCreate } from "../ui/React/DialogBox"; import { dialogBoxCreate } from "../ui/React/DialogBox";
import { constructorsForReviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from "../utils/JSONReviver"; import { constructorsForReviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from "../utils/JSONReviver";
import { CorpStateName } from "@nsdefs"; import { CorpStateName } from "@nsdefs";
import { calculateUpgradeCost } from "./helpers"; import { calculateUpgradeCost } from "./helpers";
import { JSONMap, JSONSet } from "../Types/Jsonable"; import { JSONMap, JSONSet } from "../Types/Jsonable";
import { CorpUnlockName, CorpUpgradeName } from "./data/Enums";
import { formatMoney } from "../ui/formatNumber"; import { formatMoney } from "../ui/formatNumber";
import { isPositiveInteger } from "../types"; import { isPositiveInteger } from "../types";
import { createEnumKeyedRecord, getRecordValues } from "../Types/Record"; import { createEnumKeyedRecord, getRecordValues } from "../Types/Record";

@ -1,8 +1,8 @@
import { CorpMaterialName, CorpResearchName, CorpStateName } from "@nsdefs";
import { CityName, CorpEmployeeJob, IndustryType } from "@enums";
import { constructorsForReviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from "../utils/JSONReviver"; import { constructorsForReviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from "../utils/JSONReviver";
import { CityName } from "../Enums";
import { IndustryResearchTrees, IndustriesData } from "./data/IndustryData"; import { IndustryResearchTrees, IndustriesData } from "./data/IndustryData";
import * as corpConstants from "./data/Constants"; import * as corpConstants from "./data/Constants";
import { CorpEmployeeJob, IndustryType } from "./data/Enums";
import { getRandomInt } from "../utils/helpers/getRandomInt"; import { getRandomInt } from "../utils/helpers/getRandomInt";
import { calculateEffectWithFactors } from "../utils/calculateEffectWithFactors"; import { calculateEffectWithFactors } from "../utils/calculateEffectWithFactors";
import { OfficeSpace } from "./OfficeSpace"; import { OfficeSpace } from "./OfficeSpace";
@ -12,7 +12,6 @@ import { isString } from "../utils/helpers/string";
import { MaterialInfo } from "./MaterialInfo"; import { MaterialInfo } from "./MaterialInfo";
import { Warehouse } from "./Warehouse"; import { Warehouse } from "./Warehouse";
import { Corporation } from "./Corporation"; import { Corporation } from "./Corporation";
import { CorpMaterialName, CorpResearchName, CorpStateName } from "@nsdefs";
import { JSONMap, JSONSet } from "../Types/Jsonable"; import { JSONMap, JSONSet } from "../Types/Jsonable";
import { PartialRecord, getRecordEntries, getRecordKeys, getRecordValues } from "../Types/Record"; import { PartialRecord, getRecordEntries, getRecordKeys, getRecordValues } from "../Types/Record";
import { Material } from "./Material"; import { Material } from "./Material";

111
src/Corporation/Enums.ts Normal file

@ -0,0 +1,111 @@
import { Member } from "src/types";
export enum IndustryType {
Water = "Water Utilities",
Spring = "Spring Water",
Agriculture = "Agriculture",
Fishing = "Fishing",
Mining = "Mining",
Refinery = "Refinery",
Restaurant = "Restaurant",
Tobacco = "Tobacco",
Chemical = "Chemical",
Pharmaceutical = "Pharmaceutical",
Computers = "Computer Hardware",
Robotics = "Robotics",
Software = "Software",
Healthcare = "Healthcare",
RealEstate = "Real Estate",
}
export enum CorpEmployeeJob {
Operations = "Operations",
Engineer = "Engineer",
Business = "Business",
Management = "Management",
RandD = "Research & Development",
Intern = "Intern",
Unassigned = "Unassigned",
}
export enum CorpUnlockName {
Export = "Export",
SmartSupply = "Smart Supply",
MarketResearchDemand = "Market Research - Demand",
MarketDataCompetition = "Market Data - Competition",
VeChain = "VeChain",
ShadyAccounting = "Shady Accounting",
GovernmentPartnership = "Government Partnership",
WarehouseAPI = "Warehouse API",
OfficeAPI = "Office API",
}
export enum CorpUpgradeName {
SmartFactories = "Smart Factories",
SmartStorage = "Smart Storage",
DreamSense = "DreamSense",
WilsonAnalytics = "Wilson Analytics",
NuoptimalNootropicInjectorImplants = "Nuoptimal Nootropic Injector Implants",
SpeechProcessorImplants = "Speech Processor Implants",
NeuralAccelerators = "Neural Accelerators",
FocusWires = "FocusWires",
ABCSalesBots = "ABC SalesBots",
ProjectInsight = "Project Insight",
}
// As const + type for now, convert to enum later
export const CorpMaterialName = {
Water: "Water",
Ore: "Ore",
Minerals: "Minerals",
Food: "Food",
Plants: "Plants",
Metal: "Metal",
Hardware: "Hardware",
Chemicals: "Chemicals",
Drugs: "Drugs",
Robots: "Robots",
AiCores: "AI Cores",
RealEstate: "Real Estate",
} as const;
export type CorpMaterialName = Member<typeof CorpMaterialName>;
// As const + type for now, convert to enum later
export const SmartSupplyOption = {
leftovers: "leftovers",
imports: "imports",
none: "none",
} as const;
export type SmartSupplyOption = Member<typeof SmartSupplyOption>;
// As const + type for now, convert to enum later
export const CorpBaseResearchName = {
Lab: "Hi-Tech R&D Laboratory",
AutoBrew: "AutoBrew",
AutoParty: "AutoPartyManager",
AutoDrug: "Automatic Drug Administration",
CPH4Inject: "CPH4 Injections",
Drones: "Drones",
DronesAssembly: "Drones - Assembly",
DronesTransport: "Drones - Transport",
GoJuice: "Go-Juice",
RecruitHR: "HRBuddy-Recruitment",
TrainingHR: "HRBuddy-Training",
MarketTa1: "Market-TA.I",
MarketTa2: "Market-TA.II",
Overclock: "Overclock",
SelfCorrectAssemblers: "Self-Correcting Assemblers",
Stimu: "Sti.mu",
} as const;
export type CorpBaseResearchName = Member<typeof CorpBaseResearchName>;
export const CorpProductResearchName = {
Capacity1: "uPgrade: Capacity.I",
Capacity2: "uPgrade: Capacity.II",
Dashboard: "uPgrade: Dashboard",
Fulcrum: "uPgrade: Fulcrum",
} as const;
export type CorpProductResearchName = Member<typeof CorpProductResearchName>;
export const CorpResearchName = { ...CorpProductResearchName, ...CorpBaseResearchName };
export type CorpResearchName = Member<typeof CorpResearchName>;

@ -1,4 +1,4 @@
import { CityName } from "../Enums"; import type { CityName } from "@enums";
export interface Export { export interface Export {
division: string; division: string;

@ -1,10 +1,9 @@
import { CorpEmployeeJob } from "./data/Enums"; import { CityName, CorpEmployeeJob } from "@enums";
import * as corpConstants from "./data/Constants"; import * as corpConstants from "./data/Constants";
import { Generic_fromJSON, Generic_toJSON, IReviverValue, constructorsForReviver } from "../utils/JSONReviver"; import { Generic_fromJSON, Generic_toJSON, IReviverValue, constructorsForReviver } from "../utils/JSONReviver";
import { Division } from "./Division"; import { Division } from "./Division";
import { Corporation } from "./Corporation"; import { Corporation } from "./Corporation";
import { getRandomInt } from "../utils/helpers/getRandomInt"; import { getRandomInt } from "../utils/helpers/getRandomInt";
import { CityName } from "../Enums";
import { createEnumKeyedRecord, getRecordKeys } from "../Types/Record"; import { createEnumKeyedRecord, getRecordKeys } from "../Types/Record";
interface IParams { interface IParams {

@ -1,12 +1,12 @@
import { CorpEmployeeJob } from "./data/Enums"; import type { Division } from "./Division";
import { CorpMaterialName } from "@nsdefs";
import { CityName, CorpEmployeeJob } from "@enums";
import { IndustriesData } from "./data/IndustryData"; import { IndustriesData } from "./data/IndustryData";
import { MaterialInfo } from "./MaterialInfo"; import { MaterialInfo } from "./MaterialInfo";
import { Division } from "./Division";
import { Generic_fromJSON, Generic_toJSON, IReviverValue, constructorsForReviver } from "../utils/JSONReviver"; import { Generic_fromJSON, Generic_toJSON, IReviverValue, constructorsForReviver } from "../utils/JSONReviver";
import { getRandomInt } from "../utils/helpers/getRandomInt"; import { getRandomInt } from "../utils/helpers/getRandomInt";
import { CityName } from "../Enums";
import { CorpMaterialName } from "@nsdefs";
import { PartialRecord, createEnumKeyedRecord, getRecordEntries, getRecordKeys } from "../Types/Record"; import { PartialRecord, createEnumKeyedRecord, getRecordEntries, getRecordKeys } from "../Types/Record";
interface IConstructorParams { interface IConstructorParams {

@ -1,15 +1,14 @@
import type { Corporation } from "./Corporation";
import type { Division } from "./Division";
import { Player } from "@player"; import { Player } from "@player";
import { CorpMaterialName, CorpSmartSupplyOption } from "@nsdefs"; import { CorpMaterialName, CorpSmartSupplyOption } from "@nsdefs";
import { CityName, CorpUnlockName } from "@enums";
import { Material } from "./Material"; import { Material } from "./Material";
import { Corporation } from "./Corporation";
import { Division } from "./Division";
import { MaterialInfo } from "./MaterialInfo"; import { MaterialInfo } from "./MaterialInfo";
import { Generic_fromJSON, Generic_toJSON, IReviverValue, constructorsForReviver } from "../utils/JSONReviver"; import { Generic_fromJSON, Generic_toJSON, IReviverValue, constructorsForReviver } from "../utils/JSONReviver";
import { CityName } from "../Enums";
import { materialNames } from "./data/Constants"; import { materialNames } from "./data/Constants";
import { createFullRecordFromEntries, getRecordEntries } from "../Types/Record"; import { createFullRecordFromEntries, getRecordEntries } from "../Types/Record";
import { CorpUnlockName } from "./data/Enums";
interface IConstructorParams { interface IConstructorParams {
division: Division; division: Division;

@ -1,21 +1,26 @@
import { import {
CorpEmployeePosition, CorpEmployeePosition,
CorpIndustryName, CorpIndustryName,
CorpMaterialName, CorpMaterialName as APIMaterialName,
CorpResearchName, CorpResearchName,
CorpSmartSupplyOption, CorpSmartSupplyOption,
CorpStateName, CorpStateName,
CorpUnlockName, CorpUnlockName as APIUnlockName,
CorpUpgradeName, CorpUpgradeName as APIUpgradeName,
} from "@nsdefs"; } from "@nsdefs";
import { CONSTANTS } from "../../Constants"; import { CONSTANTS } from "../../Constants";
import { IndustryType, CorpEmployeeJob } from "./Enums"; import {
IndustryType,
CorpEmployeeJob,
CorpMaterialName,
CorpUnlockName,
CorpUpgradeName,
SmartSupplyOption,
CorpBaseResearchName,
CorpProductResearchName,
} from "@enums";
import { PositiveInteger } from "../../types"; import { PositiveInteger } from "../../types";
// For typed strings, we need runtime objects to do API typechecking against.
// This structure + import * as corpConstants allows easier type definitions for individual properties.
/** Names of all corporation game states */ /** Names of all corporation game states */
export const stateNames: CorpStateName[] = ["START", "PURCHASE", "PRODUCTION", "EXPORT", "SALE"], export const stateNames: CorpStateName[] = ["START", "PURCHASE", "PRODUCTION", "EXPORT", "SALE"],
// TODO: remove IndustryType and EmployeePositions enums and just use the typed strings. // TODO: remove IndustryType and EmployeePositions enums and just use the typed strings.
@ -24,70 +29,14 @@ export const stateNames: CorpStateName[] = ["START", "PURCHASE", "PRODUCTION", "
/** Names of all industries. */ /** Names of all industries. */
industryNames: CorpIndustryName[] = Object.values(IndustryType), industryNames: CorpIndustryName[] = Object.values(IndustryType),
/** Names of all materials */ /** Names of all materials */
materialNames: CorpMaterialName[] = [ materialNames: APIMaterialName[] = Object.values(CorpMaterialName),
"Water",
"Ore",
"Minerals",
"Food",
"Plants",
"Metal",
"Hardware",
"Chemicals",
"Drugs",
"Robots",
"AI Cores",
"Real Estate",
],
/** Names of all one-time corporation-wide unlocks */ /** Names of all one-time corporation-wide unlocks */
unlockNames: CorpUnlockName[] = [ unlockNames: APIUnlockName[] = Object.values(CorpUnlockName),
"Export", upgradeNames: APIUpgradeName[] = Object.values(CorpUpgradeName),
"Smart Supply",
"Market Research - Demand",
"Market Data - Competition",
"VeChain",
"Shady Accounting",
"Government Partnership",
"Warehouse API",
"Office API",
],
upgradeNames: CorpUpgradeName[] = [
"Smart Factories",
"Smart Storage",
"DreamSense",
"Wilson Analytics",
"Nuoptimal Nootropic Injector Implants",
"Speech Processor Implants",
"Neural Accelerators",
"FocusWires",
"ABC SalesBots",
"Project Insight",
],
/** Names of all reasearches common to all industries */ /** Names of all reasearches common to all industries */
researchNamesBase: CorpResearchName[] = [ researchNamesBase: CorpResearchName[] = Object.values(CorpBaseResearchName),
"Hi-Tech R&D Laboratory",
"AutoBrew",
"AutoPartyManager",
"Automatic Drug Administration",
"CPH4 Injections",
"Drones",
"Drones - Assembly",
"Drones - Transport",
"Go-Juice",
"HRBuddy-Recruitment",
"HRBuddy-Training",
"Market-TA.I",
"Market-TA.II",
"Overclock",
"Self-Correcting Assemblers",
"Sti.mu",
],
/** Names of all researches only available to product industries */ /** Names of all researches only available to product industries */
researchNamesProductOnly: CorpResearchName[] = [ researchNamesProductOnly: CorpResearchName[] = Object.values(CorpProductResearchName),
"uPgrade: Capacity.I",
"uPgrade: Capacity.II",
"uPgrade: Dashboard",
"uPgrade: Fulcrum",
],
/** Names of all researches */ /** Names of all researches */
researchNames: CorpResearchName[] = [...researchNamesBase, ...researchNamesProductOnly], researchNames: CorpResearchName[] = [...researchNamesBase, ...researchNamesProductOnly],
initialShares = 1e9, initialShares = 1e9,
@ -123,7 +72,7 @@ export const stateNames: CorpStateName[] = ["START", "PURCHASE", "PRODUCTION", "
/** Minimum decay value for employee morale/energy */ /** Minimum decay value for employee morale/energy */
minEmployeeDecay = 10, minEmployeeDecay = 10,
/** smart supply options */ /** smart supply options */
smartSupplyOptions: CorpSmartSupplyOption[] = ["leftovers", "imports", "none"], smartSupplyOptions: CorpSmartSupplyOption[] = Object.values(SmartSupplyOption),
PurchaseMultipliers = { PurchaseMultipliers = {
x1: 1 as PositiveInteger, x1: 1 as PositiveInteger,
x5: 5 as PositiveInteger, x5: 5 as PositiveInteger,

@ -1,4 +1,4 @@
import { CorpUnlockName } from "./Enums"; import { CorpUnlockName } from "@enums";
export interface CorpUnlock { export interface CorpUnlock {
name: CorpUnlockName; name: CorpUnlockName;

@ -1,4 +1,4 @@
import { CorpUpgradeName } from "./Enums"; import { CorpUpgradeName } from "@enums";
export interface CorpUpgrade { export interface CorpUpgrade {
name: CorpUpgradeName; name: CorpUpgradeName;

@ -1,52 +0,0 @@
export enum IndustryType {
Water = "Water Utilities",
Spring = "Spring Water",
Agriculture = "Agriculture",
Fishing = "Fishing",
Mining = "Mining",
Refinery = "Refinery",
Restaurant = "Restaurant",
Tobacco = "Tobacco",
Chemical = "Chemical",
Pharmaceutical = "Pharmaceutical",
Computers = "Computer Hardware",
Robotics = "Robotics",
Software = "Software",
Healthcare = "Healthcare",
RealEstate = "Real Estate",
}
export enum CorpEmployeeJob {
Operations = "Operations",
Engineer = "Engineer",
Business = "Business",
Management = "Management",
RandD = "Research & Development",
Intern = "Intern",
Unassigned = "Unassigned",
}
export enum CorpUnlockName {
Export = "Export",
SmartSupply = "Smart Supply",
MarketResearchDemand = "Market Research - Demand",
MarketDataCompetition = "Market Data - Competition",
VeChain = "VeChain",
ShadyAccounting = "Shady Accounting",
GovernmentPartnership = "Government Partnership",
WarehouseAPI = "Warehouse API",
OfficeAPI = "Office API",
}
export enum CorpUpgradeName {
SmartFactories = "Smart Factories",
SmartStorage = "Smart Storage",
DreamSense = "DreamSense",
WilsonAnalytics = "Wilson Analytics",
NuoptimalNootropicInjectorImplants = "Nuoptimal Nootropic Injector Implants",
SpeechProcessorImplants = "Speech Processor Implants",
NeuralAccelerators = "Neural Accelerators",
FocusWires = "FocusWires",
ABCSalesBots = "ABC SalesBots",
ProjectInsight = "Project Insight",
}

@ -1,7 +1,7 @@
import { CorpIndustryData } from "@nsdefs"; import { CorpIndustryData } from "@nsdefs";
import { createFullRecordFromEntries } from "../../Types/Record"; import { createFullRecordFromEntries } from "../../Types/Record";
import { IndustryType } from "./Enums"; import { IndustryType } from "@enums";
import { getBaseResearchTreeCopy, getProductIndustryResearchTreeCopy } from "./BaseResearchTree"; import { getBaseResearchTreeCopy, getProductIndustryResearchTreeCopy } from "./BaseResearchTree";
export const IndustriesData: Record<IndustryType, CorpIndustryData> = { export const IndustriesData: Record<IndustryType, CorpIndustryData> = {

@ -1,13 +1,13 @@
// React Components for the Corporation UI's City navigation tabs // React Components for the Corporation UI's City navigation tabs
// These allow player to navigate between different cities for each industry // These allow player to navigate between different cities for each industry
import type { OfficeSpace } from "../OfficeSpace";
import React, { useState } from "react"; import React, { useState } from "react";
import { OfficeSpace } from "../OfficeSpace"; import { Tab, Tabs } from "@mui/material";
import { CityName } from "@enums";
import { Division } from "./Division"; import { Division } from "./Division";
import { ExpandNewCity } from "./ExpandNewCity"; import { ExpandNewCity } from "./ExpandNewCity";
import { useDivision } from "./Context"; import { useDivision } from "./Context";
import Tabs from "@mui/material/Tabs";
import Tab from "@mui/material/Tab";
import { CityName } from "../../Enums";
import { getRecordKeys } from "../../Types/Record"; import { getRecordKeys } from "../../Types/Record";
interface IProps { interface IProps {

@ -1,15 +1,14 @@
// React Component for managing the Corporation's Industry UI // React Component for managing the Corporation's Industry UI
// This Industry component does NOT include the city tabs at the top // This Industry component does NOT include the city tabs at the top
import React from "react"; import React from "react";
import { Box } from "@mui/material";
import { CityName } from "@enums";
import { DivisionOffice } from "./DivisionOffice"; import { DivisionOffice } from "./DivisionOffice";
import { DivisionOverview } from "./DivisionOverview"; import { DivisionOverview } from "./DivisionOverview";
import { DivisionWarehouse } from "./DivisionWarehouse"; import { DivisionWarehouse } from "./DivisionWarehouse";
import { Warehouse } from "../Warehouse"; import { Warehouse } from "../Warehouse";
import { OfficeSpace } from "../OfficeSpace"; import { OfficeSpace } from "../OfficeSpace";
import { useCorporation, useDivision } from "./Context"; import { useCorporation, useDivision } from "./Context";
import Box from "@mui/material/Box";
import { CityName } from "../../Enums";
interface IProps { interface IProps {
city: CityName; city: CityName;

@ -3,7 +3,7 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { OfficeSpace } from "../OfficeSpace"; import { OfficeSpace } from "../OfficeSpace";
import { CorpUnlockName, CorpEmployeeJob } from "../data/Enums"; import { CorpUnlockName, CorpEmployeeJob } from "@enums";
import { BuyTea } from "../Actions"; import { BuyTea } from "../Actions";
import { MoneyCost } from "./MoneyCost"; import { MoneyCost } from "./MoneyCost";

@ -2,7 +2,7 @@
// (top-left panel in the Division UI) // (top-left panel in the Division UI)
import React, { useState } from "react"; import React, { useState } from "react";
import { CorpUnlockName, IndustryType } from "../data/Enums"; import { CorpUnlockName, IndustryType } from "@enums";
import { HireAdVert } from "../Actions"; import { HireAdVert } from "../Actions";
import { formatBigNumber } from "../../ui/formatNumber"; import { formatBigNumber } from "../../ui/formatNumber";
import { createProgressBarText } from "../../utils/helpers/createProgressBarText"; import { createProgressBarText } from "../../utils/helpers/createProgressBarText";

@ -1,8 +1,10 @@
// React Component for displaying an Industry's warehouse information // React Component for displaying an Industry's warehouse information
// (right-side panel in the Industry UI) // (right-side panel in the Industry UI)
import React, { useState } from "react"; import React, { useState } from "react";
import { createStyles, makeStyles } from "@mui/styles";
import { Box, Button, Paper, Tooltip, Typography } from "@mui/material";
import * as corpConstants from "../data/Constants"; import * as corpConstants from "../data/Constants";
import { CityName, CorpUnlockName } from "@enums";
import { Warehouse } from "../Warehouse"; import { Warehouse } from "../Warehouse";
import { SmartSupplyModal } from "./modals/SmartSupplyModal"; import { SmartSupplyModal } from "./modals/SmartSupplyModal";
import { ProductElem } from "./ProductElem"; import { ProductElem } from "./ProductElem";
@ -19,16 +21,7 @@ import { IndustryProductEquation } from "./IndustryProductEquation";
import { purchaseWarehouse } from "../Actions"; import { purchaseWarehouse } from "../Actions";
import { useCorporation, useDivision } from "./Context"; import { useCorporation, useDivision } from "./Context";
import Typography from "@mui/material/Typography";
import Tooltip from "@mui/material/Tooltip";
import Paper from "@mui/material/Paper";
import { ButtonWithTooltip } from "../../ui/Components/ButtonWithTooltip"; import { ButtonWithTooltip } from "../../ui/Components/ButtonWithTooltip";
import Button from "@mui/material/Button";
import Box from "@mui/material/Box";
import makeStyles from "@mui/styles/makeStyles";
import createStyles from "@mui/styles/createStyles";
import { CityName } from "../../Enums";
import { CorpUnlockName } from "../data/Enums";
interface WarehouseProps { interface WarehouseProps {
corp: Corporation; corp: Corporation;

@ -1,5 +1,6 @@
import React, { useState } from "react"; import React, { useState } from "react";
import * as corpConstants from "../data/Constants"; import * as corpConstants from "../data/Constants";
import { CityName } from "@enums";
import { dialogBoxCreate } from "../../ui/React/DialogBox"; import { dialogBoxCreate } from "../../ui/React/DialogBox";
import { purchaseOffice } from "../Actions"; import { purchaseOffice } from "../Actions";
import { MoneyCost } from "./MoneyCost"; import { MoneyCost } from "./MoneyCost";
@ -8,7 +9,6 @@ import Typography from "@mui/material/Typography";
import MenuItem from "@mui/material/MenuItem"; import MenuItem from "@mui/material/MenuItem";
import Select, { SelectChangeEvent } from "@mui/material/Select"; import Select, { SelectChangeEvent } from "@mui/material/Select";
import { ButtonWithTooltip } from "../../ui/Components/ButtonWithTooltip"; import { ButtonWithTooltip } from "../../ui/Components/ButtonWithTooltip";
import { CityName } from "../../Enums";
interface IProps { interface IProps {
cityStateSetter: (city: CityName | "Expand") => void; cityStateSetter: (city: CityName | "Expand") => void;

@ -4,7 +4,7 @@ import Typography from "@mui/material/Typography";
import { MoneyCost } from "./MoneyCost"; import { MoneyCost } from "./MoneyCost";
import { Corporation } from "../Corporation"; import { Corporation } from "../Corporation";
import { IndustryType } from "../data/Enums"; import { IndustryType } from "@enums";
import { IndustriesData } from "../data/IndustryData"; import { IndustriesData } from "../data/IndustryData";
interface IProps { interface IProps {

@ -11,7 +11,7 @@ import { ButtonWithTooltip } from "../../ui/Components/ButtonWithTooltip";
import Box from "@mui/material/Box"; import Box from "@mui/material/Box";
import Grid from "@mui/material/Grid"; import Grid from "@mui/material/Grid";
import { calculateMaxAffordableUpgrade, calculateUpgradeCost } from "../helpers"; import { calculateMaxAffordableUpgrade, calculateUpgradeCost } from "../helpers";
import { CorpUpgradeName } from "../data/Enums"; import { CorpUpgradeName } from "@enums";
import { PositiveInteger } from "../../types"; import { PositiveInteger } from "../../types";
interface IProps { interface IProps {

@ -6,7 +6,7 @@ import React from "react";
import { CityTabs } from "./CityTabs"; import { CityTabs } from "./CityTabs";
import { Context, useCorporation } from "./Context"; import { Context, useCorporation } from "./Context";
import { CityName } from "../../Enums"; import { CityName } from "@enums";
interface IProps { interface IProps {
divisionName: string; divisionName: string;

@ -1,28 +1,19 @@
// React Component for displaying an Industry's warehouse information // React Component for displaying an Industry's warehouse information
// (right-side panel in the Industry UI) // (right-side panel in the Industry UI)
import React, { useState } from "react"; import React, { useState } from "react";
import { Box, Button, Paper, Tooltip, Typography } from "@mui/material";
import { CityName, CorpUnlockName } from "@enums";
import { Material } from "../Material"; import { Material } from "../Material";
import { Warehouse } from "../Warehouse"; import { Warehouse } from "../Warehouse";
import { ExportModal } from "./modals/ExportModal"; import { ExportModal } from "./modals/ExportModal";
import { MaterialMarketTaModal } from "./modals/MaterialMarketTaModal"; import { MaterialMarketTaModal } from "./modals/MaterialMarketTaModal";
import { SellMaterialModal } from "./modals/SellMaterialModal"; import { SellMaterialModal } from "./modals/SellMaterialModal";
import { PurchaseMaterialModal } from "./modals/PurchaseMaterialModal"; import { PurchaseMaterialModal } from "./modals/PurchaseMaterialModal";
import { formatBigNumber, formatCorpStat, formatMoney, formatQuality } from "../../ui/formatNumber"; import { formatBigNumber, formatCorpStat, formatMoney, formatQuality } from "../../ui/formatNumber";
import { isString } from "../../utils/helpers/string"; import { isString } from "../../utils/helpers/string";
import { Money } from "../../ui/React/Money"; import { Money } from "../../ui/React/Money";
import { useCorporation, useDivision } from "./Context"; import { useCorporation, useDivision } from "./Context";
import Typography from "@mui/material/Typography";
import Tooltip from "@mui/material/Tooltip";
import Paper from "@mui/material/Paper";
import Button from "@mui/material/Button";
import Box from "@mui/material/Box";
import { LimitMaterialProductionModal } from "./modals/LimitMaterialProductionModal"; import { LimitMaterialProductionModal } from "./modals/LimitMaterialProductionModal";
import { CityName } from "../../Enums";
import { CorpUnlockName } from "../data/Enums";
interface IMaterialProps { interface IMaterialProps {
warehouse: Warehouse; warehouse: Warehouse;

@ -8,7 +8,7 @@ import Typography from "@mui/material/Typography";
import { dialogBoxCreate } from "../../ui/React/DialogBox"; import { dialogBoxCreate } from "../../ui/React/DialogBox";
import { IndustriesData } from "../data/IndustryData"; import { IndustriesData } from "../data/IndustryData";
import { IndustryType } from "../data/Enums"; import { IndustryType } from "@enums";
import { useCorporation } from "./Context"; import { useCorporation } from "./Context";
import { NewDivision } from "../Actions"; import { NewDivision } from "../Actions";

@ -1,6 +1,6 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { Box, Button, Paper, Tooltip, Typography } from "@mui/material";
import type { CityName } from "src/Enums"; import { CityName, CorpUnlockName } from "@enums";
import * as corpConstants from "../data/Constants"; import * as corpConstants from "../data/Constants";
import { Product } from "../Product"; import { Product } from "../Product";
import { DiscontinueProductModal } from "./modals/DiscontinueProductModal"; import { DiscontinueProductModal } from "./modals/DiscontinueProductModal";
@ -15,13 +15,6 @@ import { isString } from "../../utils/helpers/string";
import { Money } from "../../ui/React/Money"; import { Money } from "../../ui/React/Money";
import { useCorporation, useDivision } from "./Context"; import { useCorporation, useDivision } from "./Context";
import Typography from "@mui/material/Typography";
import Tooltip from "@mui/material/Tooltip";
import Paper from "@mui/material/Paper";
import Button from "@mui/material/Button";
import Box from "@mui/material/Box";
import { CorpUnlockName } from "../data/Enums";
interface IProductProps { interface IProductProps {
city: CityName; city: CityName;
product: Product; product: Product;

@ -9,7 +9,7 @@ import Tooltip from "@mui/material/Tooltip";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import Box from "@mui/material/Box"; import Box from "@mui/material/Box";
import Grid from "@mui/material/Grid"; import Grid from "@mui/material/Grid";
import { CorpUnlockName } from "../data/Enums"; import { CorpUnlockName } from "@enums";
import { dialogBoxCreate } from "../../ui/React/DialogBox"; import { dialogBoxCreate } from "../../ui/React/DialogBox";
interface UnlockProps { interface UnlockProps {

@ -1,4 +1,5 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { CityName } from "@enums";
import { dialogBoxCreate } from "../../../ui/React/DialogBox"; import { dialogBoxCreate } from "../../../ui/React/DialogBox";
import { Material } from "../../Material"; import { Material } from "../../Material";
import { Export } from "../../Export"; import { Export } from "../../Export";
@ -13,7 +14,6 @@ import Button from "@mui/material/Button";
import Box from "@mui/material/Box"; import Box from "@mui/material/Box";
import MenuItem from "@mui/material/MenuItem"; import MenuItem from "@mui/material/MenuItem";
import Select, { SelectChangeEvent } from "@mui/material/Select"; import Select, { SelectChangeEvent } from "@mui/material/Select";
import { CityName } from "../../../Enums";
import { useRerender } from "../../../ui/React/hooks"; import { useRerender } from "../../../ui/React/hooks";
import { getRecordKeys } from "../../../Types/Record"; import { getRecordKeys } from "../../../Types/Record";

@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import type { CityName } from "../../../Enums"; import type { CityName } from "@enums";
import type { Product } from "../../Product"; import type { Product } from "../../Product";
import { LimitProductProduction } from "../../Actions"; import { LimitProductProduction } from "../../Actions";
import { Modal } from "../../../ui/React/Modal"; import { Modal } from "../../../ui/React/Modal";

@ -2,7 +2,7 @@ import React, { useState } from "react";
import { dialogBoxCreate } from "../../../ui/React/DialogBox"; import { dialogBoxCreate } from "../../../ui/React/DialogBox";
import { Modal } from "../../../ui/React/Modal"; import { Modal } from "../../../ui/React/Modal";
import { IndustriesData } from "../../data/IndustryData"; import { IndustriesData } from "../../data/IndustryData";
import { IndustryType } from "../../data/Enums"; import { IndustryType } from "@enums";
import { MakeProduct } from "../../Actions"; import { MakeProduct } from "../../Actions";
import { useCorporation, useDivision } from "../Context"; import { useCorporation, useDivision } from "../Context";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
@ -12,7 +12,7 @@ import MenuItem from "@mui/material/MenuItem";
import Select, { SelectChangeEvent } from "@mui/material/Select"; import Select, { SelectChangeEvent } from "@mui/material/Select";
import { KEY } from "../../../utils/helpers/keyCodes"; import { KEY } from "../../../utils/helpers/keyCodes";
import { NumberInput } from "../../../ui/React/NumberInput"; import { NumberInput } from "../../../ui/React/NumberInput";
import { CityName } from "../../../Enums"; import { CityName } from "@enums";
import { getRecordKeys } from "../../../Types/Record"; import { getRecordKeys } from "../../../Types/Record";
interface IProps { interface IProps {

@ -6,7 +6,7 @@ import Button from "@mui/material/Button";
import MenuItem from "@mui/material/MenuItem"; import MenuItem from "@mui/material/MenuItem";
import Select, { SelectChangeEvent } from "@mui/material/Select"; import Select, { SelectChangeEvent } from "@mui/material/Select";
import { useCorporation } from "../../ui/Context"; import { useCorporation } from "../../ui/Context";
import { CityName } from "../../../Enums"; import { CityName } from "@enums";
import * as corpConstants from "../../data/Constants"; import * as corpConstants from "../../data/Constants";
import { formatMoney } from "../../../ui/formatNumber"; import { formatMoney } from "../../../ui/formatNumber";
import { removeDivision as removeDivision } from "../../Actions"; import { removeDivision as removeDivision } from "../../Actions";

@ -10,7 +10,7 @@ import Button from "@mui/material/Button";
import FormControlLabel from "@mui/material/FormControlLabel"; import FormControlLabel from "@mui/material/FormControlLabel";
import Switch from "@mui/material/Switch"; import Switch from "@mui/material/Switch";
import { KEY } from "../../../utils/helpers/keyCodes"; import { KEY } from "../../../utils/helpers/keyCodes";
import { CityName } from "../../../Enums"; import { CityName } from "@enums";
function initialPrice(product: Product, city: CityName): string { function initialPrice(product: Product, city: CityName): string {
let val = String(product.cityData[city].desiredSellPrice || ""); let val = String(product.cityData[city].desiredSellPrice || "");

@ -1,3 +1,4 @@
// Numeric enum
export enum FragmentType { export enum FragmentType {
// Special fragments for the UI // Special fragments for the UI
None, None,

@ -1,4 +1,5 @@
import { FactionNames } from "../Faction/data/FactionNames"; import { Player } from "@player";
import { AugmentationName, FactionName } from "@enums";
import { Fragment } from "./Fragment"; import { Fragment } from "./Fragment";
import { ActiveFragment } from "./ActiveFragment"; import { ActiveFragment } from "./ActiveFragment";
import { FragmentType } from "./FragmentType"; import { FragmentType } from "./FragmentType";
@ -9,8 +10,6 @@ import { StaneksGiftEvents } from "./StaneksGiftEvents";
import { Generic_fromJSON, Generic_toJSON, IReviverValue, constructorsForReviver } from "../utils/JSONReviver"; import { Generic_fromJSON, Generic_toJSON, IReviverValue, constructorsForReviver } from "../utils/JSONReviver";
import { StanekConstants } from "./data/Constants"; import { StanekConstants } from "./data/Constants";
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
import { Player } from "@player";
import { AugmentationNames } from "../Augmentation/data/AugmentationNames";
import { defaultMultipliers, mergeMultipliers, Multipliers, scaleMultipliers } from "../PersonObjects/Multipliers"; import { defaultMultipliers, mergeMultipliers, Multipliers, scaleMultipliers } from "../PersonObjects/Multipliers";
import { StaticAugmentations } from "../Augmentation/StaticAugmentations"; import { StaticAugmentations } from "../Augmentation/StaticAugmentations";
import { getKeyList } from "../utils/helpers/getKeyList"; import { getKeyList } from "../utils/helpers/getKeyList";
@ -42,7 +41,7 @@ export class StaneksGift extends BaseGift {
af.numCharge += threads / af.highestCharge; af.numCharge += threads / af.highestCharge;
} }
const cotmg = Factions[FactionNames.ChurchOfTheMachineGod]; const cotmg = Factions[FactionName.ChurchOfTheMachineGod];
cotmg.playerReputation += (Player.mults.faction_rep * (Math.pow(threads, 0.95) * (cotmg.favor + 100))) / 1000; cotmg.playerReputation += (Player.mults.faction_rep * (Math.pow(threads, 0.95) * (cotmg.favor + 100))) / 1000;
this.justCharged = true; this.justCharged = true;
} }
@ -52,7 +51,7 @@ export class StaneksGift extends BaseGift {
} }
process(numCycles = 1): void { process(numCycles = 1): void {
if (!Player.hasAugmentation(AugmentationNames.StaneksGift1)) return; if (!Player.hasAugmentation(AugmentationName.StaneksGift1)) return;
this.storedCycles += numCycles; this.storedCycles += numCycles;
const usedCycles = this.isBonusCharging ? 5 : 1; const usedCycles = this.isBonusCharging ? 5 : 1;
this.isBonusCharging = false; this.isBonusCharging = false;
@ -217,13 +216,13 @@ export class StaneksGift extends BaseGift {
const mults = this.calculateMults(); const mults = this.calculateMults();
Player.mults = mergeMultipliers(Player.mults, mults); Player.mults = mergeMultipliers(Player.mults, mults);
Player.updateSkillLevels(); Player.updateSkillLevels();
const zoeAmt = Player.sleeves.reduce((n, sleeve) => n + (sleeve.hasAugmentation(AugmentationNames.ZOE) ? 1 : 0), 0); const zoeAmt = Player.sleeves.reduce((n, sleeve) => n + (sleeve.hasAugmentation(AugmentationName.ZOE) ? 1 : 0), 0);
if (zoeAmt === 0) return; if (zoeAmt === 0) return;
// Less powerful for each copy. // Less powerful for each copy.
const scaling = 3 / (zoeAmt + 2); const scaling = 3 / (zoeAmt + 2);
const sleeveMults = scaleMultipliers(mults, scaling); const sleeveMults = scaleMultipliers(mults, scaling);
for (const sleeve of Player.sleeves) { for (const sleeve of Player.sleeves) {
if (!sleeve.hasAugmentation(AugmentationNames.ZOE)) continue; if (!sleeve.hasAugmentation(AugmentationName.ZOE)) continue;
sleeve.resetMultipliers(); sleeve.resetMultipliers();
//reapplying augmentation's multiplier //reapplying augmentation's multiplier
for (let i = 0; i < sleeve.augmentations.length; ++i) { for (let i = 0; i < sleeve.augmentations.length; ++i) {

@ -2,7 +2,7 @@ import { CONSTANTS } from "../Constants";
import { Player } from "@player"; import { Player } from "@player";
import { Person as IPerson } from "@nsdefs"; import { Person as IPerson } from "@nsdefs";
import { WorkerScript } from "../Netscript/WorkerScript"; import { WorkerScript } from "../Netscript/WorkerScript";
import { CrimeType } from "../Enums"; import { CrimeType } from "@enums";
import { CrimeWork } from "../Work/CrimeWork"; import { CrimeWork } from "../Work/CrimeWork";
import { calculateIntelligenceBonus } from "../PersonObjects/formulas/intelligence"; import { calculateIntelligenceBonus } from "../PersonObjects/formulas/intelligence";

@ -2,23 +2,22 @@ import { Crimes } from "./Crimes";
import { Crime } from "./Crime"; import { Crime } from "./Crime";
import { Player } from "@player"; import { Player } from "@player";
import { dialogBoxCreate } from "../ui/React/DialogBox"; import { getEnumHelper } from "../utils/EnumHelper";
import { checkEnum } from "../utils/helpers/enum"; import { CrimeType } from "@enums";
import { CrimeType } from "../Enums";
//This is only used for the player //This is only used for the player
export function determineCrimeSuccess(type: string): boolean { export function determineCrimeSuccess(type: CrimeType): boolean {
if (!checkEnum(CrimeType, type)) {
dialogBoxCreate(`ERR: Unrecognized crime type: ${type} This is probably a bug please contact the developer`);
return false;
}
const crime = Crimes[type]; const crime = Crimes[type];
const chance = crime.successRate(Player); const chance = crime.successRate(Player);
return Math.random() <= chance; return Math.random() <= chance;
} }
export function findCrime(roughName: string): Crime | null { export function findCrime(roughName: string): Crime | null {
if (checkEnum(CrimeType, roughName)) return Crimes[roughName]; const helper = getEnumHelper("CrimeType");
if (helper.isMember(roughName)) return Crimes[roughName];
const fuzzMatch = getEnumHelper("CrimeType").fuzzyGetMember(roughName);
if (fuzzMatch) return Crimes[fuzzMatch];
// This can probably all be removed
roughName = roughName.toLowerCase(); roughName = roughName.toLowerCase();
if (roughName.includes("shoplift")) return Crimes[CrimeType.shoplift]; if (roughName.includes("shoplift")) return Crimes[CrimeType.shoplift];
else if (roughName.includes("rob") && roughName.includes("store")) return Crimes[CrimeType.robStore]; else if (roughName.includes("rob") && roughName.includes("store")) return Crimes[CrimeType.robStore];
@ -33,5 +32,6 @@ export function findCrime(roughName: string): Crime | null {
else if (roughName.includes("kidnap")) return Crimes[CrimeType.kidnap]; else if (roughName.includes("kidnap")) return Crimes[CrimeType.kidnap];
else if (roughName.includes("assassin")) return Crimes[CrimeType.assassination]; else if (roughName.includes("assassin")) return Crimes[CrimeType.assassination];
else if (roughName.includes("heist")) return Crimes[CrimeType.heist]; else if (roughName.includes("heist")) return Crimes[CrimeType.heist];
//
return null; return null;
} }

@ -1,6 +1,6 @@
import { Crime } from "./Crime"; import { Crime } from "./Crime";
import { CONSTANTS } from "../Constants"; import { CONSTANTS } from "../Constants";
import { CrimeType } from "../Enums"; import { CrimeType } from "@enums";
export const Crimes: Record<CrimeType, Crime> = { export const Crimes: Record<CrimeType, Crime> = {
[CrimeType.shoplift]: new Crime( [CrimeType.shoplift]: new Crime(

14
src/Crime/Enums.ts Normal file

@ -0,0 +1,14 @@
export enum CrimeType {
shoplift = "Shoplift",
robStore = "Rob Store",
mug = "Mug",
larceny = "Larceny",
dealDrugs = "Deal Drugs",
bondForgery = "Bond Forgery",
traffickArms = "Traffick Arms",
homicide = "Homicide",
grandTheftAuto = "Grand Theft Auto",
kidnap = "Kidnap",
assassination = "Assassination",
heist = "Heist",
}

@ -1,4 +1,4 @@
import type { CompletedProgramName } from "../Programs/Programs"; import type { CompletedProgramName } from "@enums";
export class DarkWebItem { export class DarkWebItem {
program: CompletedProgramName; program: CompletedProgramName;

@ -1,5 +1,5 @@
import { DarkWebItem } from "./DarkWebItem"; import { DarkWebItem } from "./DarkWebItem";
import { CompletedProgramName } from "../Programs/Programs"; import { CompletedProgramName } from "@enums";
export const DarkWebItems = { export const DarkWebItems = {
BruteSSHProgram: new DarkWebItem(CompletedProgramName.bruteSsh, 500e3, "Opens up SSH Ports."), BruteSSHProgram: new DarkWebItem(CompletedProgramName.bruteSsh, 500e3, "Opens up SSH Ports."),

@ -1,5 +1,5 @@
import { Player } from "@player"; import { Player } from "@player";
import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; import { AugmentationName } from "@enums";
import React, { useEffect } from "react"; import React, { useEffect } from "react";
@ -52,7 +52,7 @@ export function DevMenuRoot(): React.ReactElement {
{Player.hasWseAccount && <StockMarket />} {Player.hasWseAccount && <StockMarket />}
{Player.sleeves.length > 0 && <Sleeves />} {Player.sleeves.length > 0 && <Sleeves />}
{Player.augmentations.some((aug) => aug.name === AugmentationNames.StaneksGift1) && <Stanek />} {Player.augmentations.some((aug) => aug.name === AugmentationName.StaneksGift1) && <Stanek />}
<TimeSkip /> <TimeSkip />
<Achievements /> <Achievements />

@ -1,3 +1,5 @@
import { Player } from "@player";
import React, { useState } from "react";
import { Clear, ExpandMore, Reply, ReplyAll } from "@mui/icons-material"; import { Clear, ExpandMore, Reply, ReplyAll } from "@mui/icons-material";
import { import {
Accordion, Accordion,
@ -10,9 +12,7 @@ import {
SelectChangeEvent, SelectChangeEvent,
Typography, Typography,
} from "@mui/material"; } from "@mui/material";
import React, { useState } from "react"; import { AugmentationName } from "@enums";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames";
import { Player } from "@player";
export function Augmentations(): React.ReactElement { export function Augmentations(): React.ReactElement {
const [augmentation, setAugmentation] = useState("Augmented Targeting I"); const [augmentation, setAugmentation] = useState("Augmented Targeting I");
@ -25,7 +25,7 @@ export function Augmentations(): React.ReactElement {
} }
function queueAllAugs(): void { function queueAllAugs(): void {
for (const augName of Object.values(AugmentationNames)) { for (const augName of Object.values(AugmentationName)) {
Player.queueAugmentation(augName); Player.queueAugmentation(augName);
} }
} }
@ -65,7 +65,7 @@ export function Augmentations(): React.ReactElement {
</> </>
} }
> >
{Object.values(AugmentationNames).map((aug) => ( {Object.values(AugmentationName).map((aug) => (
<MenuItem key={aug} value={aug}> <MenuItem key={aug} value={aug}>
{aug} {aug}
</MenuItem> </MenuItem>

@ -15,7 +15,7 @@ import Select, { SelectChangeEvent } from "@mui/material/Select";
import DeleteIcon from "@mui/icons-material/Delete"; import DeleteIcon from "@mui/icons-material/Delete";
import { Adjuster } from "./Adjuster"; import { Adjuster } from "./Adjuster";
import { Player } from "@player"; import { Player } from "@player";
import { CityName } from "../../Enums"; import { CityName } from "@enums";
import { Skills as AllSkills } from "../../Bladeburner/Skills"; import { Skills as AllSkills } from "../../Bladeburner/Skills";
import { SkillNames } from "../../Bladeburner/data/SkillNames"; import { SkillNames } from "../../Bladeburner/data/SkillNames";

@ -4,19 +4,19 @@ import Accordion from "@mui/material/Accordion";
import AccordionSummary from "@mui/material/AccordionSummary"; import AccordionSummary from "@mui/material/AccordionSummary";
import AccordionDetails from "@mui/material/AccordionDetails"; import AccordionDetails from "@mui/material/AccordionDetails";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import Select, { SelectChangeEvent } from "@mui/material/Select"; import Select, { SelectChangeEvent } from "@mui/material/Select";
import { Companies as AllCompanies } from "../../Company/Companies";
import MenuItem from "@mui/material/MenuItem"; import MenuItem from "@mui/material/MenuItem";
import { FactionName } from "@enums";
import { Companies as AllCompanies } from "../../Company/Companies";
import { Adjuster } from "./Adjuster"; import { Adjuster } from "./Adjuster";
import { FactionNames } from "../../Faction/data/FactionNames";
const bigNumber = 1e12; const bigNumber = 1e12;
export function Companies(): React.ReactElement { export function Companies(): React.ReactElement {
const [company, setCompany] = useState(FactionNames.ECorp as string); const [company, setCompany] = useState(FactionName.ECorp as string);
function setCompanyDropdown(event: SelectChangeEvent): void { function setCompanyDropdown(event: SelectChangeEvent): void {
setCompany(event.target.value); setCompany(event.target.value);
} }

@ -1,28 +1,30 @@
import React, { useState } from "react"; import React, { useState } from "react";
import Accordion from "@mui/material/Accordion"; import { Player } from "@player";
import AccordionSummary from "@mui/material/AccordionSummary"; import { FactionName } from "@enums";
import AccordionDetails from "@mui/material/AccordionDetails"; import {
Accordion,
AccordionSummary,
AccordionDetails,
Button,
FormControl,
IconButton,
InputLabel,
MenuItem,
Typography,
} from "@mui/material";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";
import Select, { SelectChangeEvent } from "@mui/material/Select"; import Select, { SelectChangeEvent } from "@mui/material/Select";
import { Adjuster } from "./Adjuster"; import { Adjuster } from "./Adjuster";
import { Player } from "@player";
import { Factions as AllFaction } from "../../Faction/Factions"; import { Factions as AllFaction } from "../../Faction/Factions";
import FormControl from "@mui/material/FormControl";
import MenuItem from "@mui/material/MenuItem";
import IconButton from "@mui/material/IconButton";
import ReplyAllIcon from "@mui/icons-material/ReplyAll"; import ReplyAllIcon from "@mui/icons-material/ReplyAll";
import ReplyIcon from "@mui/icons-material/Reply"; import ReplyIcon from "@mui/icons-material/Reply";
import InputLabel from "@mui/material/InputLabel";
import { FactionNames } from "../../Faction/data/FactionNames";
const bigNumber = 1e12; const bigNumber = 1e12;
export function Factions(): React.ReactElement { export function Factions(): React.ReactElement {
const [faction, setFaction] = useState(FactionNames.Illuminati as string); const [faction, setFaction] = useState(FactionName.Illuminati as string);
function setFactionDropdown(event: SelectChangeEvent): void { function setFactionDropdown(event: SelectChangeEvent): void {
setFaction(event.target.value); setFaction(event.target.value);
@ -33,7 +35,7 @@ export function Factions(): React.ReactElement {
} }
function receiveAllInvites(): void { function receiveAllInvites(): void {
Object.values(FactionNames).forEach((faction) => Player.receiveInvite(faction)); Object.values(FactionName).forEach((faction) => Player.receiveInvite(faction));
} }
function modifyFactionRep(modifier: number): (x: number) => void { function modifyFactionRep(modifier: number): (x: number) => void {

@ -11,7 +11,7 @@ import { Router } from "../../ui/GameRoot";
import { MenuItem, SelectChangeEvent, TextField, Select } from "@mui/material"; import { MenuItem, SelectChangeEvent, TextField, Select } from "@mui/material";
import { Bladeburner } from "../../Bladeburner/Bladeburner"; import { Bladeburner } from "../../Bladeburner/Bladeburner";
import { GangConstants } from "../../Gang/data/Constants"; import { GangConstants } from "../../Gang/data/Constants";
import { FactionNames } from "../../Faction/data/FactionNames"; import { FactionName } from "@enums";
import { checkForMessagesToSend } from "../../Message/MessageHelpers"; import { checkForMessagesToSend } from "../../Message/MessageHelpers";
import { ThemeEvents } from "../../Themes/ui/Theme"; import { ThemeEvents } from "../../Themes/ui/Theme";
@ -61,7 +61,7 @@ export function General(): React.ReactElement {
// Gang functions // Gang functions
const startGang = () => { const startGang = () => {
const isHacking = gangFaction === FactionNames.NiteSec || gangFaction === FactionNames.TheBlackHand; const isHacking = gangFaction === FactionName.NiteSec || gangFaction === FactionName.TheBlackHand;
Player.startGang(gangFaction, isHacking); Player.startGang(gangFaction, isHacking);
// Rerender so the gang menu option will show up immediately on the devmenu page selection // Rerender so the gang menu option will show up immediately on the devmenu page selection
ThemeEvents.emit(); ThemeEvents.emit();

@ -10,7 +10,7 @@ import Button from "@mui/material/Button";
import Select, { SelectChangeEvent } from "@mui/material/Select"; import Select, { SelectChangeEvent } from "@mui/material/Select";
import { Player } from "@player"; import { Player } from "@player";
import MenuItem from "@mui/material/MenuItem"; import MenuItem from "@mui/material/MenuItem";
import { CompletedProgramName } from "../../Programs/Programs"; import { CompletedProgramName } from "@enums";
export function Programs(): React.ReactElement { export function Programs(): React.ReactElement {
const [program, setProgram] = useState(CompletedProgramName.bruteSsh); const [program, setProgram] = useState(CompletedProgramName.bruteSsh);

@ -7,7 +7,8 @@ import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import { saveObject } from "../../SaveObject"; import { saveObject } from "../../SaveObject";
import { SnackbarEvents, ToastVariant } from "../../ui/React/Snackbar"; import { SnackbarEvents } from "../../ui/React/Snackbar";
import { ToastVariant } from "@enums";
import { Upload } from "@mui/icons-material"; import { Upload } from "@mui/icons-material";
import { Button } from "@mui/material"; import { Button } from "@mui/material";
import { OptionSwitch } from "../../ui/React/OptionSwitch"; import { OptionSwitch } from "../../ui/React/OptionSwitch";

@ -1,7 +1,8 @@
import { Player } from "@player"; import { Player } from "@player";
import { Router } from "./ui/GameRoot"; import { Router } from "./ui/GameRoot";
import { Terminal } from "./Terminal"; import { Terminal } from "./Terminal";
import { SnackbarEvents, ToastVariant } from "./ui/React/Snackbar"; import { SnackbarEvents } from "./ui/React/Snackbar";
import { ToastVariant } from "@enums";
import { IReturnStatus } from "./types"; import { IReturnStatus } from "./types";
import { GetServer } from "./Server/AllServers"; import { GetServer } from "./Server/AllServers";
import { ImportPlayerData, SaveData, saveObject } from "./SaveObject"; import { ImportPlayerData, SaveData, saveObject } from "./SaveObject";

@ -1,157 +1,14 @@
/** Job for company work */ // Using this file makes importing enums easier, and also verifies that no enums have the same name as each other
export enum JobName {
software0 = "Software Engineering Intern",
software1 = "Junior Software Engineer",
software2 = "Senior Software Engineer",
software3 = "Lead Software Developer",
software4 = "Head of Software",
software5 = "Head of Engineering",
software6 = "Vice President of Technology",
software7 = "Chief Technology Officer",
IT0 = "IT Intern",
IT1 = "IT Analyst",
IT2 = "IT Manager",
IT3 = "Systems Administrator",
securityEng = "Security Engineer",
networkEng0 = "Network Engineer",
networkEng1 = "Network Administrator",
business0 = "Business Intern",
business1 = "Business Analyst",
business2 = "Business Manager",
business3 = "Operations Manager",
business4 = "Chief Financial Officer",
business5 = "Chief Executive Officer",
security0 = "Police Officer",
security1 = "Police Chief",
security2 = "Security Guard",
security3 = "Security Officer",
security4 = "Security Supervisor",
security5 = "Head of Security",
agent0 = "Field Agent",
agent1 = "Secret Agent",
agent2 = "Special Operative",
waiter = "Waiter",
employee = "Employee",
softwareConsult0 = "Software Consultant",
softwareConsult1 = "Senior Software Consultant",
businessConsult0 = "Business Consultant",
businessConsult1 = "Senior Business Consultant",
waiterPT = "Part-time Waiter",
employeePT = "Part-time Employee",
}
/** Crime names */ export * from "./Augmentation/Enums";
export enum CrimeType { export * from "./Bladeburner/Enums";
shoplift = "Shoplift", export * from "./Corporation/Enums";
robStore = "Rob Store", export * from "./Crime/Enums";
mug = "Mug", export * from "./Faction/Enums";
larceny = "Larceny", export * from "./Literature/Enums";
dealDrugs = "Deal Drugs", export * from "./Locations/Enums";
bondForgery = "Bond Forgery", export * from "./Message/Enums";
traffickArms = "Traffick Arms", export * from "./Programs/Enums";
homicide = "Homicide", export * from "./StockMarket/Enums";
grandTheftAuto = "Grand Theft Auto", export * from "./ui/Enums";
kidnap = "Kidnap", export * from "./Work/Enums";
assassination = "Assassination",
heist = "Heist",
}
export enum FactionWorkType {
hacking = "hacking",
field = "field",
security = "security",
}
export enum UniversityClassType {
computerScience = "Computer Science",
dataStructures = "Data Structures",
networks = "Networks",
algorithms = "Algorithms",
management = "Management",
leadership = "Leadership",
}
//Uses skill short codes to allow easier fuzzy matching with player input
export enum GymType {
strength = "str",
defense = "def",
dexterity = "dex",
agility = "agi",
}
/** Names of all cities */
export enum CityName {
Aevum = "Aevum",
Chongqing = "Chongqing",
Sector12 = "Sector-12",
NewTokyo = "New Tokyo",
Ishima = "Ishima",
Volhaven = "Volhaven",
}
/** Names of all locations */
export enum LocationName {
AevumAeroCorp = "AeroCorp",
AevumBachmanAndAssociates = "Bachman & Associates",
AevumClarkeIncorporated = "Clarke Incorporated",
AevumCrushFitnessGym = "Crush Fitness Gym",
AevumECorp = "ECorp",
AevumFulcrumTechnologies = "Fulcrum Technologies",
AevumGalacticCybersystems = "Galactic Cybersystems",
AevumNetLinkTechnologies = "NetLink Technologies",
AevumPolice = "Aevum Police Headquarters",
AevumRhoConstruction = "Rho Construction",
AevumSnapFitnessGym = "Snap Fitness Gym",
AevumSummitUniversity = "Summit University",
AevumWatchdogSecurity = "Watchdog Security",
AevumCasino = "Iker Molina Casino",
ChongqingKuaiGongInternational = "KuaiGong International",
ChongqingSolarisSpaceSystems = "Solaris Space Systems",
ChongqingChurchOfTheMachineGod = "Church of the Machine God",
Sector12AlphaEnterprises = "Alpha Enterprises",
Sector12BladeIndustries = "Blade Industries",
Sector12CIA = "Central Intelligence Agency",
Sector12CarmichaelSecurity = "Carmichael Security",
Sector12CityHall = "Sector-12 City Hall",
Sector12DeltaOne = "DeltaOne",
Sector12FoodNStuff = "FoodNStuff",
Sector12FourSigma = "Four Sigma",
Sector12IcarusMicrosystems = "Icarus Microsystems",
Sector12IronGym = "Iron Gym",
Sector12JoesGuns = "Joe's Guns",
Sector12MegaCorp = "MegaCorp",
Sector12NSA = "National Security Agency",
Sector12PowerhouseGym = "Powerhouse Gym",
Sector12RothmanUniversity = "Rothman University",
Sector12UniversalEnergy = "Universal Energy",
NewTokyoDefComm = "DefComm",
NewTokyoGlobalPharmaceuticals = "Global Pharmaceuticals",
NewTokyoNoodleBar = "Noodle Bar",
NewTokyoVitaLife = "VitaLife",
NewTokyoArcade = "Arcade",
IshimaNovaMedical = "Nova Medical",
IshimaOmegaSoftware = "Omega Software",
IshimaStormTechnologies = "Storm Technologies",
IshimaGlitch = "0x6C1",
VolhavenCompuTek = "CompuTek",
VolhavenHeliosLabs = "Helios Labs",
VolhavenLexoCorp = "LexoCorp",
VolhavenMilleniumFitnessGym = "Millenium Fitness Gym",
VolhavenNWO = "NWO",
VolhavenOmniTekIncorporated = "OmniTek Incorporated",
VolhavenOmniaCybersystems = "Omnia Cybersystems",
VolhavenSysCoreSecurities = "SysCore Securities",
VolhavenZBInstituteOfTechnology = "ZB Institute of Technology",
Hospital = "Hospital",
Slums = "The Slums",
TravelAgency = "Travel Agency",
WorldStockExchange = "World Stock Exchange",
Void = "The Void",
}

@ -10,6 +10,7 @@ hacking game is very much in the spirit of the game.
Source-File minus 1 is extremely weak because it can be fully level up quickly. Source-File minus 1 is extremely weak because it can be fully level up quickly.
*/ */
// Exploits don't need an enum helper so they are not in an enums file
export enum Exploit { export enum Exploit {
Bypass = "Bypass", Bypass = "Bypass",
PrototypeTampering = "PrototypeTampering", PrototypeTampering = "PrototypeTampering",
@ -27,7 +28,7 @@ export enum Exploit {
EditSaveFile = "EditSaveFile", EditSaveFile = "EditSaveFile",
} }
const names: Record<string, string> = { const names: Record<Exploit, string> = {
Bypass: "by circumventing the ram cost of document.", Bypass: "by circumventing the ram cost of document.",
EditSaveFile: "by editing your save file.", EditSaveFile: "by editing your save file.",
PrototypeTampering: "by tampering with Numbers prototype.", PrototypeTampering: "by tampering with Numbers prototype.",
@ -41,11 +42,12 @@ const names: Record<string, string> = {
INeedARainbow: "by using the power of the rainbow.", INeedARainbow: "by using the power of the rainbow.",
}; };
export function ExploitName(exploit: string): string { export function ExploitName(exploit: Exploit): string {
return names[exploit]; return names[exploit];
} }
// Needed in case player edits save file poorly
export function sanitizeExploits(exploits: Exploit[]): Exploit[] { export function sanitizeExploits(exploits: Exploit[]): Exploit[] {
exploits = exploits.filter((e: Exploit) => Object.keys(Exploit).includes(e)); exploits = exploits.filter((e: Exploit) => Object.values(Exploit).includes(e));
return [...new Set(exploits)]; return [...new Set(exploits)];
} }

@ -1,4 +1,4 @@
export enum FactionNames { export enum FactionName {
Illuminati = "Illuminati", Illuminati = "Illuminati",
Daedalus = "Daedalus", Daedalus = "Daedalus",
TheCovenant = "The Covenant", TheCovenant = "The Covenant",

@ -1,7 +1,7 @@
import { StaticAugmentations } from "../Augmentation/StaticAugmentations"; import { StaticAugmentations } from "../Augmentation/StaticAugmentations";
import { Augmentation } from "../Augmentation/Augmentation"; import { Augmentation } from "../Augmentation/Augmentation";
import { PlayerOwnedAugmentation } from "../Augmentation/PlayerOwnedAugmentation"; import { PlayerOwnedAugmentation } from "../Augmentation/PlayerOwnedAugmentation";
import { AugmentationNames } from "../Augmentation/data/AugmentationNames"; import { AugmentationName, FactionName } from "@enums";
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
import { Faction } from "./Faction"; import { Faction } from "./Faction";
@ -16,7 +16,6 @@ import {
import { dialogBoxCreate } from "../ui/React/DialogBox"; import { dialogBoxCreate } from "../ui/React/DialogBox";
import { InvitationEvent } from "./ui/InvitationModal"; import { InvitationEvent } from "./ui/InvitationModal";
import { FactionNames } from "./data/FactionNames";
import { SFC32RNG } from "../Casino/RNG"; import { SFC32RNG } from "../Casino/RNG";
import { isFactionWork } from "../Work/FactionWork"; import { isFactionWork } from "../Work/FactionWork";
@ -32,7 +31,7 @@ export function joinFaction(faction: Faction): void {
if (faction.isMember) return; if (faction.isMember) return;
faction.isMember = true; faction.isMember = true;
Player.factions.push(faction.name); Player.factions.push(faction.name);
const allFactions = Object.values(FactionNames).map((faction) => faction as string); const allFactions = Object.values(FactionName).map((faction) => faction as string);
Player.factions.sort((a, b) => allFactions.indexOf(a) - allFactions.indexOf(b)); Player.factions.sort((a, b) => allFactions.indexOf(a) - allFactions.indexOf(b));
const factionInfo = faction.getInfo(); const factionInfo = faction.getInfo();
@ -80,7 +79,7 @@ export function purchaseAugmentation(aug: Augmentation, fac: Faction, sing = fal
dialogBoxCreate(txt); dialogBoxCreate(txt);
} else if (augCosts.moneyCost === 0 || Player.money >= augCosts.moneyCost) { } else if (augCosts.moneyCost === 0 || Player.money >= augCosts.moneyCost) {
const queuedAugmentation = new PlayerOwnedAugmentation(aug.name); const queuedAugmentation = new PlayerOwnedAugmentation(aug.name);
if (aug.name == AugmentationNames.NeuroFluxGovernor) { if (aug.name == AugmentationName.NeuroFluxGovernor) {
queuedAugmentation.level = aug.getLevel(); queuedAugmentation.level = aug.getLevel();
} }
Player.queuedAugmentations.push(queuedAugmentation); Player.queuedAugmentations.push(queuedAugmentation);
@ -138,11 +137,11 @@ export const getFactionAugmentationsFiltered = (faction: Faction): string[] => {
let augs = Object.values(StaticAugmentations); let augs = Object.values(StaticAugmentations);
// Remove special augs // Remove special augs
augs = augs.filter((a) => !a.isSpecial && a.name !== AugmentationNames.CongruityImplant); augs = augs.filter((a) => !a.isSpecial && a.name !== AugmentationName.CongruityImplant);
if (Player.bitNodeN === 2) { if (Player.bitNodeN === 2) {
// TRP is not available outside of BN2 for Gangs // TRP is not available outside of BN2 for Gangs
augs.push(StaticAugmentations[AugmentationNames.TheRedPill]); augs.push(StaticAugmentations[AugmentationName.TheRedPill]);
} }
const rng = SFC32RNG(`BN${Player.bitNodeN}.${Player.sourceFileLvl(Player.bitNodeN)}`); const rng = SFC32RNG(`BN${Player.bitNodeN}.${Player.sourceFileLvl(Player.bitNodeN)}`);

@ -1,5 +1,5 @@
import React from "react"; import React from "react";
import { FactionNames } from "./data/FactionNames"; import { FactionName } from "@enums";
import { Router } from "../ui/GameRoot"; import { Router } from "../ui/GameRoot";
import { Page } from "../ui/Router"; import { Page } from "../ui/Router";
import { Option } from "./ui/Option"; import { Option } from "./ui/Option";
@ -62,7 +62,7 @@ export class FactionInfo {
/** A map of all factions and associated info to them. */ /** A map of all factions and associated info to them. */
export const FactionInfos: Record<string, FactionInfo> = { export const FactionInfos: Record<string, FactionInfo> = {
// Endgame // Endgame
[FactionNames.Illuminati]: new FactionInfo({ [FactionName.Illuminati]: new FactionInfo({
infoText: ( infoText: (
<> <>
Humanity never changes. No matter how civilized society becomes, it will eventually fall back into chaos. And Humanity never changes. No matter how civilized society becomes, it will eventually fall back into chaos. And
@ -73,13 +73,13 @@ export const FactionInfos: Record<string, FactionInfo> = {
offerFieldWork: true, offerFieldWork: true,
}), }),
[FactionNames.Daedalus]: new FactionInfo({ [FactionName.Daedalus]: new FactionInfo({
infoText: <>Yesterday we obeyed kings and bent our necks to emperors. Today we kneel only to truth.</>, infoText: <>Yesterday we obeyed kings and bent our necks to emperors. Today we kneel only to truth.</>,
offerHackingWork: true, offerHackingWork: true,
offerFieldWork: true, offerFieldWork: true,
}), }),
[FactionNames.TheCovenant]: new FactionInfo({ [FactionName.TheCovenant]: new FactionInfo({
infoText: ( infoText: (
<> <>
Surrender yourself. Give up your empty individuality to become part of something great, something eternal. Surrender yourself. Give up your empty individuality to become part of something great, something eternal.
@ -94,11 +94,11 @@ export const FactionInfos: Record<string, FactionInfo> = {
}), }),
// Megacorporations, each forms its own faction // Megacorporations, each forms its own faction
[FactionNames.ECorp]: new FactionInfo({ [FactionName.ECorp]: new FactionInfo({
infoText: ( infoText: (
<> <>
{FactionNames.ECorp}'s mission is simple: to connect the world of today with the technology of tomorrow. With {FactionName.ECorp}'s mission is simple: to connect the world of today with the technology of tomorrow. With our
our wide range of Internet-related software and commercial hardware, {FactionNames.ECorp} makes the world's wide range of Internet-related software and commercial hardware, {FactionName.ECorp} makes the world's
information universally accessible. information universally accessible.
</> </>
), ),
@ -108,15 +108,15 @@ export const FactionInfos: Record<string, FactionInfo> = {
keepOnInstall: true, keepOnInstall: true,
}), }),
[FactionNames.MegaCorp]: new FactionInfo({ [FactionName.MegaCorp]: new FactionInfo({
infoText: ( infoText: (
<> <>
{FactionNames.MegaCorp} does what no other dares to do. We imagine. We create. We invent. We create what others {FactionName.MegaCorp} does what no other dares to do. We imagine. We create. We invent. We create what others
have never even dreamed of. Our work fills the world's needs for food, water, power, and transportation on an have never even dreamed of. Our work fills the world's needs for food, water, power, and transportation on an
unprecedented scale, in ways that no other company can. unprecedented scale, in ways that no other company can.
<br /> <br />
<br /> <br />
In our labs and factories and on the ground with customers, {FactionNames.MegaCorp} is ushering in a new era for In our labs and factories and on the ground with customers, {FactionName.MegaCorp} is ushering in a new era for
the world. the world.
</> </>
), ),
@ -126,7 +126,7 @@ export const FactionInfos: Record<string, FactionInfo> = {
keepOnInstall: true, keepOnInstall: true,
}), }),
[FactionNames.BachmanAssociates]: new FactionInfo({ [FactionName.BachmanAssociates]: new FactionInfo({
infoText: ( infoText: (
<> <>
Where Law and Business meet - that's where we are. Where Law and Business meet - that's where we are.
@ -141,7 +141,7 @@ export const FactionInfos: Record<string, FactionInfo> = {
keepOnInstall: true, keepOnInstall: true,
}), }),
[FactionNames.BladeIndustries]: new FactionInfo({ [FactionName.BladeIndustries]: new FactionInfo({
infoText: <>Augmentation is Salvation.</>, infoText: <>Augmentation is Salvation.</>,
offerHackingWork: true, offerHackingWork: true,
offerFieldWork: true, offerFieldWork: true,
@ -149,7 +149,7 @@ export const FactionInfos: Record<string, FactionInfo> = {
keepOnInstall: true, keepOnInstall: true,
}), }),
[FactionNames.NWO]: new FactionInfo({ [FactionName.NWO]: new FactionInfo({
infoText: ( infoText: (
<> <>
Humans don't truly desire freedom. They want to be observed, understood, and judged. They want to be given Humans don't truly desire freedom. They want to be observed, understood, and judged. They want to be given
@ -163,7 +163,7 @@ export const FactionInfos: Record<string, FactionInfo> = {
keepOnInstall: true, keepOnInstall: true,
}), }),
[FactionNames.ClarkeIncorporated]: new FactionInfo({ [FactionName.ClarkeIncorporated]: new FactionInfo({
infoText: <>The Power of the Genome - Unlocked.</>, infoText: <>The Power of the Genome - Unlocked.</>,
offerHackingWork: true, offerHackingWork: true,
offerFieldWork: true, offerFieldWork: true,
@ -171,7 +171,7 @@ export const FactionInfos: Record<string, FactionInfo> = {
keepOnInstall: true, keepOnInstall: true,
}), }),
[FactionNames.OmniTekIncorporated]: new FactionInfo({ [FactionName.OmniTekIncorporated]: new FactionInfo({
infoText: <>Simply put, our mission is to design and build robots that make a difference.</>, infoText: <>Simply put, our mission is to design and build robots that make a difference.</>,
offerHackingWork: true, offerHackingWork: true,
offerFieldWork: true, offerFieldWork: true,
@ -179,11 +179,11 @@ export const FactionInfos: Record<string, FactionInfo> = {
keepOnInstall: true, keepOnInstall: true,
}), }),
[FactionNames.FourSigma]: new FactionInfo({ [FactionName.FourSigma]: new FactionInfo({
infoText: ( infoText: (
<> <>
The scientific method is the best way to approach investing. Big strategies backed up with big data. Driven by The scientific method is the best way to approach investing. Big strategies backed up with big data. Driven by
deep learning and innovative ideas. And improved by iteration. That's {FactionNames.FourSigma}. deep learning and innovative ideas. And improved by iteration. That's {FactionName.FourSigma}.
</> </>
), ),
offerHackingWork: true, offerHackingWork: true,
@ -192,7 +192,7 @@ export const FactionInfos: Record<string, FactionInfo> = {
keepOnInstall: true, keepOnInstall: true,
}), }),
[FactionNames.KuaiGongInternational]: new FactionInfo({ [FactionName.KuaiGongInternational]: new FactionInfo({
infoText: <>Dream big. Work hard. Make history.</>, infoText: <>Dream big. Work hard. Make history.</>,
offerHackingWork: true, offerHackingWork: true,
offerFieldWork: true, offerFieldWork: true,
@ -201,7 +201,7 @@ export const FactionInfos: Record<string, FactionInfo> = {
}), }),
// Other Corporations // Other Corporations
[FactionNames.FulcrumSecretTechnologies]: new FactionInfo({ [FactionName.FulcrumSecretTechnologies]: new FactionInfo({
infoText: ( infoText: (
<> <>
The human organism has an innate desire to worship. That is why they created gods. If there were no gods, it The human organism has an innate desire to worship. That is why they created gods. If there were no gods, it
@ -214,7 +214,7 @@ export const FactionInfos: Record<string, FactionInfo> = {
}), }),
// Hacker groups // Hacker groups
[FactionNames.BitRunners]: new FactionInfo({ [FactionName.BitRunners]: new FactionInfo({
infoText: ( infoText: (
<> <>
Our entire lives are controlled by bits. All of our actions, our thoughts, our personal information. It's all Our entire lives are controlled by bits. All of our actions, our thoughts, our personal information. It's all
@ -230,7 +230,7 @@ export const FactionInfos: Record<string, FactionInfo> = {
offerHackingWork: true, offerHackingWork: true,
}), }),
[FactionNames.TheBlackHand]: new FactionInfo({ [FactionName.TheBlackHand]: new FactionInfo({
infoText: ( infoText: (
<> <>
The world, so afraid of strong government, now has no government. Only power - Digital power. Financial power. The world, so afraid of strong government, now has no government. Only power - Digital power. Financial power.
@ -246,7 +246,7 @@ export const FactionInfos: Record<string, FactionInfo> = {
}), }),
// prettier-ignore // prettier-ignore
[FactionNames.NiteSec]: new FactionInfo({ [FactionName.NiteSec]: new FactionInfo({
infoText:(<> infoText:(<>
{" __..__ "}<br /> {" __..__ "}<br />
{" _.nITESECNIt. "}<br /> {" _.nITESECNIt. "}<br />
@ -291,77 +291,71 @@ export const FactionInfos: Record<string, FactionInfo> = {
}), }),
// City factions, essentially governments // City factions, essentially governments
[FactionNames.Aevum]: new FactionInfo({ [FactionName.Aevum]: new FactionInfo({
infoText: <>The Silicon City.</>, infoText: <>The Silicon City.</>,
enemies: [FactionNames.Chongqing, FactionNames.NewTokyo, FactionNames.Ishima, FactionNames.Volhaven], enemies: [FactionName.Chongqing, FactionName.NewTokyo, FactionName.Ishima, FactionName.Volhaven],
offerHackingWork: true, offerHackingWork: true,
offerFieldWork: true, offerFieldWork: true,
offerSecurityWork: true, offerSecurityWork: true,
}), }),
[FactionNames.Chongqing]: new FactionInfo({ [FactionName.Chongqing]: new FactionInfo({
infoText: <>Serve the People.</>, infoText: <>Serve the People.</>,
enemies: [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven], enemies: [FactionName.Sector12, FactionName.Aevum, FactionName.Volhaven],
offerHackingWork: true, offerHackingWork: true,
offerFieldWork: true, offerFieldWork: true,
offerSecurityWork: true, offerSecurityWork: true,
}), }),
[FactionNames.Ishima]: new FactionInfo({ [FactionName.Ishima]: new FactionInfo({
infoText: <>The East Asian Order of the Future.</>, infoText: <>The East Asian Order of the Future.</>,
enemies: [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven], enemies: [FactionName.Sector12, FactionName.Aevum, FactionName.Volhaven],
offerHackingWork: true, offerHackingWork: true,
offerFieldWork: true, offerFieldWork: true,
offerSecurityWork: true, offerSecurityWork: true,
}), }),
[FactionNames.NewTokyo]: new FactionInfo({ [FactionName.NewTokyo]: new FactionInfo({
infoText: <>Asia's World City.</>, infoText: <>Asia's World City.</>,
enemies: [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven], enemies: [FactionName.Sector12, FactionName.Aevum, FactionName.Volhaven],
offerHackingWork: true, offerHackingWork: true,
offerFieldWork: true, offerFieldWork: true,
offerSecurityWork: true, offerSecurityWork: true,
}), }),
[FactionNames.Sector12]: new FactionInfo({ [FactionName.Sector12]: new FactionInfo({
infoText: <>The City of the Future.</>, infoText: <>The City of the Future.</>,
enemies: [FactionNames.Chongqing, FactionNames.NewTokyo, FactionNames.Ishima, FactionNames.Volhaven], enemies: [FactionName.Chongqing, FactionName.NewTokyo, FactionName.Ishima, FactionName.Volhaven],
offerHackingWork: true, offerHackingWork: true,
offerFieldWork: true, offerFieldWork: true,
offerSecurityWork: true, offerSecurityWork: true,
}), }),
[FactionNames.Volhaven]: new FactionInfo({ [FactionName.Volhaven]: new FactionInfo({
infoText: <>Benefit, Honor, and Glory.</>, infoText: <>Benefit, Honor, and Glory.</>,
enemies: [ enemies: [FactionName.Chongqing, FactionName.Sector12, FactionName.NewTokyo, FactionName.Aevum, FactionName.Ishima],
FactionNames.Chongqing,
FactionNames.Sector12,
FactionNames.NewTokyo,
FactionNames.Aevum,
FactionNames.Ishima,
],
offerHackingWork: true, offerHackingWork: true,
offerFieldWork: true, offerFieldWork: true,
offerSecurityWork: true, offerSecurityWork: true,
}), }),
// Criminal Organizations/Gangs // Criminal Organizations/Gangs
[FactionNames.SpeakersForTheDead]: new FactionInfo({ [FactionName.SpeakersForTheDead]: new FactionInfo({
infoText: <>It is better to reign in Hell than to serve in Heaven.</>, infoText: <>It is better to reign in Hell than to serve in Heaven.</>,
offerHackingWork: true, offerHackingWork: true,
offerFieldWork: true, offerFieldWork: true,
offerSecurityWork: true, offerSecurityWork: true,
}), }),
[FactionNames.TheDarkArmy]: new FactionInfo({ [FactionName.TheDarkArmy]: new FactionInfo({
infoText: <>The World doesn't care about right or wrong. It only cares about power.</>, infoText: <>The World doesn't care about right or wrong. It only cares about power.</>,
offerHackingWork: true, offerHackingWork: true,
offerFieldWork: true, offerFieldWork: true,
}), }),
[FactionNames.TheSyndicate]: new FactionInfo({ [FactionName.TheSyndicate]: new FactionInfo({
infoText: <>Honor holds you back.</>, infoText: <>Honor holds you back.</>,
offerHackingWork: true, offerHackingWork: true,
offerFieldWork: true, offerFieldWork: true,
offerSecurityWork: true, offerSecurityWork: true,
}), }),
[FactionNames.Silhouette]: new FactionInfo({ [FactionName.Silhouette]: new FactionInfo({
infoText: ( infoText: (
<> <>
Corporations have filled the void of power left behind by the collapse of Western government. The issue is Corporations have filled the void of power left behind by the collapse of Western government. The issue is
@ -376,34 +370,34 @@ export const FactionInfos: Record<string, FactionInfo> = {
offerFieldWork: true, offerFieldWork: true,
}), }),
[FactionNames.Tetrads]: new FactionInfo({ [FactionName.Tetrads]: new FactionInfo({
infoText: <>Following the mandate of Heaven and carrying out the way.</>, infoText: <>Following the mandate of Heaven and carrying out the way.</>,
offerFieldWork: true, offerFieldWork: true,
offerSecurityWork: true, offerSecurityWork: true,
}), }),
[FactionNames.SlumSnakes]: new FactionInfo({ [FactionName.SlumSnakes]: new FactionInfo({
infoText: <>{FactionNames.SlumSnakes} rule!</>, infoText: <>{FactionName.SlumSnakes} rule!</>,
offerFieldWork: true, offerFieldWork: true,
offerSecurityWork: true, offerSecurityWork: true,
}), }),
// Early game factions - factions the player will prestige with early on that don't belong in other categories. // Early game factions - factions the player will prestige with early on that don't belong in other categories.
[FactionNames.Netburners]: new FactionInfo({ [FactionName.Netburners]: new FactionInfo({
infoText: <>{"~~//*>H4CK||3T 8URN3R5**>?>\\~~"}</>, infoText: <>{"~~//*>H4CK||3T 8URN3R5**>?>\\~~"}</>,
offerHackingWork: true, offerHackingWork: true,
}), }),
[FactionNames.TianDiHui]: new FactionInfo({ [FactionName.TianDiHui]: new FactionInfo({
infoText: <>Obey Heaven and work righteously.</>, infoText: <>Obey Heaven and work righteously.</>,
offerHackingWork: true, offerHackingWork: true,
offerSecurityWork: true, offerSecurityWork: true,
}), }),
[FactionNames.CyberSec]: new FactionInfo({ [FactionName.CyberSec]: new FactionInfo({
infoText: ( infoText: (
<> <>
The Internet is the first thing that was built that we don't fully understand, the largest experiment in anarchy The Internet is the first thing that was built that we don't fully understand, the largest experiment in anarchy
@ -415,14 +409,14 @@ export const FactionInfos: Record<string, FactionInfo> = {
}), }),
// Special Factions // Special Factions
[FactionNames.Bladeburners]: new FactionInfo({ [FactionName.Bladeburners]: new FactionInfo({
infoText: ( infoText: (
<> <>
It's too bad they won't live. But then again, who does? It's too bad they won't live. But then again, who does?
<br /> <br />
<br /> <br />
Note that for this faction, reputation can only be gained through {FactionNames.Bladeburners} actions.{" "} Note that for this faction, reputation can only be gained through {FactionName.Bladeburners} actions. Completing{" "}
Completing {FactionNames.Bladeburners} contracts/operations will increase your reputation. {FactionName.Bladeburners} contracts/operations will increase your reputation.
</> </>
), ),
@ -438,7 +432,7 @@ export const FactionInfos: Record<string, FactionInfo> = {
}, },
}), }),
[FactionNames.ChurchOfTheMachineGod]: new FactionInfo({ [FactionName.ChurchOfTheMachineGod]: new FactionInfo({
// prettier-ignore // prettier-ignore
infoText:(<> infoText:(<>
{" `` "}<br /> {" `` "}<br />
@ -489,7 +483,7 @@ export const FactionInfos: Record<string, FactionInfo> = {
); );
}, },
}), }),
[FactionNames.ShadowsOfAnarchy]: new FactionInfo({ [FactionName.ShadowsOfAnarchy]: new FactionInfo({
infoText: ( infoText: (
<> <>
The government is ruled by the corporations that we have allowed to consume it. To release the world from its The government is ruled by the corporations that we have allowed to consume it. To release the world from its
@ -499,7 +493,7 @@ export const FactionInfos: Record<string, FactionInfo> = {
special: true, special: true,
keepOnInstall: true, keepOnInstall: true,
assignment: (): React.ReactElement => { assignment: (): React.ReactElement => {
return <Typography>{FactionNames.ShadowsOfAnarchy} can only gain reputation by infiltrating.</Typography>; return <Typography>{FactionName.ShadowsOfAnarchy} can only gain reputation by infiltrating.</Typography>;
}, },
}), }),
}; };

@ -3,7 +3,7 @@ import React from "react";
import { StaticAugmentations } from "../../Augmentation/StaticAugmentations"; import { StaticAugmentations } from "../../Augmentation/StaticAugmentations";
import { getGenericAugmentationPriceMultiplier } from "../../Augmentation/AugmentationHelpers"; import { getGenericAugmentationPriceMultiplier } from "../../Augmentation/AugmentationHelpers";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { AugmentationName, FactionName } from "@enums";
import { PurchasableAugmentations } from "../../Augmentation/ui/PurchasableAugmentations"; import { PurchasableAugmentations } from "../../Augmentation/ui/PurchasableAugmentations";
import { PurchaseAugmentationsOrderSetting } from "../../Settings/SettingEnums"; import { PurchaseAugmentationsOrderSetting } from "../../Settings/SettingEnums";
import { Settings } from "../../Settings/Settings"; import { Settings } from "../../Settings/Settings";
@ -11,7 +11,6 @@ import { Player } from "@player";
import { formatBigNumber } from "../../ui/formatNumber"; import { formatBigNumber } from "../../ui/formatNumber";
import { Favor } from "../../ui/React/Favor"; import { Favor } from "../../ui/React/Favor";
import { Reputation } from "../../ui/React/Reputation"; import { Reputation } from "../../ui/React/Reputation";
import { FactionNames } from "../data/FactionNames";
import { Faction } from "../Faction"; import { Faction } from "../Faction";
import { getFactionAugmentationsFiltered, hasAugmentationPrereqs, purchaseAugmentation } from "../FactionHelpers"; import { getFactionAugmentationsFiltered, hasAugmentationPrereqs, purchaseAugmentation } from "../FactionHelpers";
import { CONSTANTS } from "../../Constants"; import { CONSTANTS } from "../../Constants";
@ -121,13 +120,13 @@ export function AugmentationsPage(props: IProps): React.ReactElement {
const augs = getAugsSorted(); const augs = getAugsSorted();
const purchasable = augs.filter( const purchasable = augs.filter(
(aug: string) => (aug: string) =>
aug === AugmentationNames.NeuroFluxGovernor || aug === AugmentationName.NeuroFluxGovernor ||
(!Player.augmentations.some((a) => a.name === aug) && !Player.queuedAugmentations.some((a) => a.name === aug)), (!Player.augmentations.some((a) => a.name === aug) && !Player.queuedAugmentations.some((a) => a.name === aug)),
); );
const owned = augs.filter((aug: string) => !purchasable.includes(aug)); const owned = augs.filter((aug: string) => !purchasable.includes(aug));
const multiplierComponent = const multiplierComponent =
props.faction.name !== FactionNames.ShadowsOfAnarchy ? ( props.faction.name !== FactionName.ShadowsOfAnarchy ? (
<Tooltip <Tooltip
title={ title={
<Typography> <Typography>
@ -144,7 +143,7 @@ export function AugmentationsPage(props: IProps): React.ReactElement {
<Tooltip <Tooltip
title={ title={
<Typography> <Typography>
This price multiplier increases for each {FactionNames.ShadowsOfAnarchy} augmentation already purchased. The This price multiplier increases for each {FactionName.ShadowsOfAnarchy} augmentation already purchased. The
multiplier is NOT reset when installing augmentations. multiplier is NOT reset when installing augmentations.
</Typography> </Typography>
} }
@ -183,7 +182,7 @@ export function AugmentationsPage(props: IProps): React.ReactElement {
<Box <Box
sx={{ sx={{
display: "grid", display: "grid",
gridTemplateColumns: `repeat(${props.faction.name === FactionNames.ShadowsOfAnarchy ? "2" : "3"}, 1fr)`, gridTemplateColumns: `repeat(${props.faction.name === FactionName.ShadowsOfAnarchy ? "2" : "3"}, 1fr)`,
justifyItems: "center", justifyItems: "center",
my: 1, my: 1,
}} }}

@ -6,7 +6,7 @@ import { Player } from "@player";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import { KEY } from "../../utils/helpers/keyCodes"; import { KEY } from "../../utils/helpers/keyCodes";
import { FactionNames } from "../data/FactionNames"; import { FactionName } from "@enums";
interface IProps { interface IProps {
open: boolean; open: boolean;
@ -27,7 +27,7 @@ export function CreateGangModal(props: IProps): React.ReactElement {
"is not as important."; "is not as important.";
function isHacking(): boolean { function isHacking(): boolean {
return [FactionNames.NiteSec as string, FactionNames.TheBlackHand as string].includes(props.facName); return [FactionName.NiteSec as string, FactionName.TheBlackHand as string].includes(props.facName);
} }
function createGang(): void { function createGang(): void {

@ -21,10 +21,9 @@ import { Player } from "@player";
import { Typography, Button } from "@mui/material"; import { Typography, Button } from "@mui/material";
import { CovenantPurchasesRoot } from "../../PersonObjects/Sleeve/ui/CovenantPurchasesRoot"; import { CovenantPurchasesRoot } from "../../PersonObjects/Sleeve/ui/CovenantPurchasesRoot";
import { FactionNames } from "../data/FactionNames"; import { FactionName, FactionWorkType } from "@enums";
import { GangButton } from "./GangButton"; import { GangButton } from "./GangButton";
import { FactionWork } from "../../Work/FactionWork"; import { FactionWork } from "../../Work/FactionWork";
import { FactionWorkType } from "../../Enums";
import { useRerender } from "../../ui/React/hooks"; import { useRerender } from "../../ui/React/hooks";
interface IProps { interface IProps {
@ -111,7 +110,7 @@ function MainPage({ faction, rerender, onAugmentations }: IMainProps): React.Rea
const favorToDonate = Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction); const favorToDonate = Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);
const canDonate = faction.favor >= favorToDonate; const canDonate = faction.favor >= favorToDonate;
const canPurchaseSleeves = faction.name === FactionNames.TheCovenant && Player.bitNodeN === 10; const canPurchaseSleeves = faction.name === FactionName.TheCovenant && Player.bitNodeN === 10;
return ( return (
<> <>

@ -5,7 +5,7 @@ import { Player } from "@player";
import { Settings } from "../../Settings/Settings"; import { Settings } from "../../Settings/Settings";
import { formatFavor, formatReputation } from "../../ui/formatNumber"; import { formatFavor, formatReputation } from "../../ui/formatNumber";
import { Router } from "../../ui/GameRoot"; import { Router } from "../../ui/GameRoot";
import { FactionNames } from "../data/FactionNames"; import { FactionName } from "@enums";
import { Faction } from "../Faction"; import { Faction } from "../Faction";
import { getFactionAugmentationsFiltered, joinFaction } from "../FactionHelpers"; import { getFactionAugmentationsFiltered, joinFaction } from "../FactionHelpers";
import { Factions } from "../Factions"; import { Factions } from "../Factions";
@ -175,7 +175,7 @@ export function FactionsRoot(): React.ReactElement {
}); });
}, []); }, []);
const allFactions = Object.values(FactionNames).map((faction) => faction as string); const allFactions = Object.values(FactionName).map((faction) => faction as string);
const allJoinedFactions = [...Player.factions]; const allJoinedFactions = [...Player.factions];
allJoinedFactions.sort((a, b) => allFactions.indexOf(a) - allFactions.indexOf(b)); allJoinedFactions.sort((a, b) => allFactions.indexOf(a) - allFactions.indexOf(b));
const invitations = Player.factionInvitations; const invitations = Player.factionInvitations;

@ -18,7 +18,8 @@ import { StyleEditorButton } from "../../Themes/ui/StyleEditorButton";
import { ThemeEditorButton } from "../../Themes/ui/ThemeEditorButton"; import { ThemeEditorButton } from "../../Themes/ui/ThemeEditorButton";
import { ConfirmationModal } from "../../ui/React/ConfirmationModal"; import { ConfirmationModal } from "../../ui/React/ConfirmationModal";
import { DeleteGameButton } from "../../ui/React/DeleteGameButton"; import { DeleteGameButton } from "../../ui/React/DeleteGameButton";
import { SnackbarEvents, ToastVariant } from "../../ui/React/Snackbar"; import { SnackbarEvents } from "../../ui/React/Snackbar";
import { ToastVariant } from "@enums";
import { SoftResetButton } from "../../ui/React/SoftResetButton"; import { SoftResetButton } from "../../ui/React/SoftResetButton";
import { Router } from "../../ui/GameRoot"; import { Router } from "../../ui/GameRoot";
import { Page } from "../../ui/Router"; import { Page } from "../../ui/Router";

@ -1,4 +1,4 @@
import { FactionNames } from "../Faction/data/FactionNames"; import { FactionName } from "@enums";
import { Reviver } from "../utils/JSONReviver"; import { Reviver } from "../utils/JSONReviver";
interface GangTerritory { interface GangTerritory {
@ -7,31 +7,31 @@ interface GangTerritory {
} }
export let AllGangs: Record<string, GangTerritory> = { export let AllGangs: Record<string, GangTerritory> = {
[FactionNames.SlumSnakes]: { [FactionName.SlumSnakes]: {
power: 1, power: 1,
territory: 1 / 7, territory: 1 / 7,
}, },
[FactionNames.Tetrads]: { [FactionName.Tetrads]: {
power: 1, power: 1,
territory: 1 / 7, territory: 1 / 7,
}, },
[FactionNames.TheSyndicate]: { [FactionName.TheSyndicate]: {
power: 1, power: 1,
territory: 1 / 7, territory: 1 / 7,
}, },
[FactionNames.TheDarkArmy]: { [FactionName.TheDarkArmy]: {
power: 1, power: 1,
territory: 1 / 7, territory: 1 / 7,
}, },
[FactionNames.SpeakersForTheDead]: { [FactionName.SpeakersForTheDead]: {
power: 1, power: 1,
territory: 1 / 7, territory: 1 / 7,
}, },
[FactionNames.NiteSec]: { [FactionName.NiteSec]: {
power: 1, power: 1,
territory: 1 / 7, territory: 1 / 7,
}, },
[FactionNames.TheBlackHand]: { [FactionName.TheBlackHand]: {
power: 1, power: 1,
territory: 1 / 7, territory: 1 / 7,
}, },
@ -39,31 +39,31 @@ export let AllGangs: Record<string, GangTerritory> = {
export function resetGangs(): void { export function resetGangs(): void {
AllGangs = { AllGangs = {
[FactionNames.SlumSnakes]: { [FactionName.SlumSnakes]: {
power: 1, power: 1,
territory: 1 / 7, territory: 1 / 7,
}, },
[FactionNames.Tetrads]: { [FactionName.Tetrads]: {
power: 1, power: 1,
territory: 1 / 7, territory: 1 / 7,
}, },
[FactionNames.TheSyndicate]: { [FactionName.TheSyndicate]: {
power: 1, power: 1,
territory: 1 / 7, territory: 1 / 7,
}, },
[FactionNames.TheDarkArmy]: { [FactionName.TheDarkArmy]: {
power: 1, power: 1,
territory: 1 / 7, territory: 1 / 7,
}, },
[FactionNames.SpeakersForTheDead]: { [FactionName.SpeakersForTheDead]: {
power: 1, power: 1,
territory: 1 / 7, territory: 1 / 7,
}, },
[FactionNames.NiteSec]: { [FactionName.NiteSec]: {
power: 1, power: 1,
territory: 1 / 7, territory: 1 / 7,
}, },
[FactionNames.TheBlackHand]: { [FactionName.TheBlackHand]: {
power: 1, power: 1,
territory: 1 / 7, territory: 1 / 7,
}, },

@ -1,5 +1,5 @@
import { CONSTANTS } from "../../Constants"; import { CONSTANTS } from "../../Constants";
import { FactionNames } from "../../Faction/data/FactionNames"; import { FactionName } from "@enums";
export const GangConstants = { export const GangConstants = {
// Respect is divided by this to get rep gain // Respect is divided by this to get rep gain
@ -10,13 +10,13 @@ export const GangConstants = {
AscensionMultiplierRatio: 0.15, AscensionMultiplierRatio: 0.15,
// Names of possible Gangs // Names of possible Gangs
Names: [ Names: [
FactionNames.SlumSnakes, FactionName.SlumSnakes,
FactionNames.Tetrads, FactionName.Tetrads,
FactionNames.TheSyndicate, FactionName.TheSyndicate,
FactionNames.TheDarkArmy, FactionName.TheDarkArmy,
FactionNames.SpeakersForTheDead, FactionName.SpeakersForTheDead,
FactionNames.NiteSec, FactionName.NiteSec,
FactionNames.TheBlackHand, FactionName.TheBlackHand,
] as string[], ] as string[],
GangKarmaRequirement: -54000, GangKarmaRequirement: -54000,
/** Normal number of game cycles processed at once (2 seconds) */ /** Normal number of game cycles processed at once (2 seconds) */

@ -1,10 +1,10 @@
import { FactionNames } from "../../Faction/data/FactionNames"; import { FactionName } from "@enums";
export const PowerMultiplier: Record<string, number | undefined> = { export const PowerMultiplier: Record<string, number | undefined> = {
[FactionNames.SlumSnakes]: 1, [FactionName.SlumSnakes]: 1,
[FactionNames.Tetrads]: 2, [FactionName.Tetrads]: 2,
[FactionNames.TheSyndicate]: 2, [FactionName.TheSyndicate]: 2,
[FactionNames.TheDarkArmy]: 2, [FactionName.TheDarkArmy]: 2,
[FactionNames.SpeakersForTheDead]: 5, [FactionName.SpeakersForTheDead]: 5,
[FactionNames.NiteSec]: 2, [FactionName.NiteSec]: 2,
[FactionNames.TheBlackHand]: 5, [FactionName.TheBlackHand]: 5,
}; };

@ -7,6 +7,7 @@ export interface IMults {
cha?: number; cha?: number;
} }
// Does not need an enum helper, not in an enums file
export enum UpgradeType { export enum UpgradeType {
Weapon = "w", Weapon = "w",
Armor = "a", Armor = "a",

@ -15,7 +15,7 @@ import Typography from "@mui/material/Typography";
import Paper from "@mui/material/Paper"; import Paper from "@mui/material/Paper";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import { SelectChangeEvent } from "@mui/material/Select"; import { SelectChangeEvent } from "@mui/material/Select";
import { FactionNames } from "../../Faction/data/FactionNames"; import { FactionName } from "@enums";
import { companiesMetadata } from "../../Company/data/CompaniesMetadata"; import { companiesMetadata } from "../../Company/data/CompaniesMetadata";
interface IProps { interface IProps {
@ -29,7 +29,7 @@ const companiesMap: Record<string, string> = {};
export function HacknetUpgradeElem(props: IProps): React.ReactElement { export function HacknetUpgradeElem(props: IProps): React.ReactElement {
const [selectedServer, setSelectedServer] = useState( const [selectedServer, setSelectedServer] = useState(
serversMap[props.upg.name] ? serversMap[props.upg.name] : FactionNames.ECorp.toLowerCase(), serversMap[props.upg.name] ? serversMap[props.upg.name] : FactionName.ECorp.toLowerCase(),
); );
function changeTargetServer(event: SelectChangeEvent): void { function changeTargetServer(event: SelectChangeEvent): void {
setSelectedServer(event.target.value); setSelectedServer(event.target.value);

@ -1,7 +1,7 @@
import { Player } from "@player"; import { Player } from "@player";
import { BitNodeMultipliers } from "../../BitNode/BitNodeMultipliers"; import { BitNodeMultipliers } from "../../BitNode/BitNodeMultipliers";
import { LocationsMetadata } from "../../Locations/data/LocationsMetadata"; import { LocationsMetadata } from "../../Locations/data/LocationsMetadata";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { AugmentationName } from "@enums";
import { Faction } from "../../Faction/Faction"; import { Faction } from "../../Faction/Faction";
export function calculateSellInformationCashReward(reward: number, maxLevel: number, difficulty: number): number { export function calculateSellInformationCashReward(reward: number, maxLevel: number, difficulty: number): number {
@ -12,7 +12,7 @@ export function calculateSellInformationCashReward(reward: number, maxLevel: num
Math.pow(difficulty, 3) * Math.pow(difficulty, 3) *
3e3 * 3e3 *
levelBonus * levelBonus *
(Player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.5 : 1) * (Player.hasAugmentation(AugmentationName.WKSharmonizer, true) ? 1.5 : 1) *
BitNodeMultipliers.InfiltrationMoney BitNodeMultipliers.InfiltrationMoney
); );
} }
@ -25,7 +25,7 @@ export function calculateTradeInformationRepReward(reward: number, maxLevel: num
Math.pow(difficulty, 1.2) * Math.pow(difficulty, 1.2) *
30 * 30 *
levelBonus * levelBonus *
(Player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.5 : 1) * (Player.hasAugmentation(AugmentationName.WKSharmonizer, true) ? 1.5 : 1) *
BitNodeMultipliers.InfiltrationRep BitNodeMultipliers.InfiltrationRep
); );
} }
@ -38,6 +38,6 @@ export function calculateInfiltratorsRepReward(faction: Faction, difficulty: num
const baseRepGain = (difficulty / maxStartingSecurityLevel) * 5000; const baseRepGain = (difficulty / maxStartingSecurityLevel) * 5000;
return ( return (
baseRepGain * (Player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 2 : 1) * (1 + faction.favor / 100) baseRepGain * (Player.hasAugmentation(AugmentationName.WKSharmonizer, true) ? 2 : 1) * (1 + faction.favor / 100)
); );
} }

@ -1,6 +1,6 @@
import { Paper, Typography } from "@mui/material"; import { Paper, Typography } from "@mui/material";
import React, { useState } from "react"; import React, { useState } from "react";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { AugmentationName } from "@enums";
import { Player } from "@player"; import { Player } from "@player";
import { KEY } from "../../utils/helpers/keyCodes"; import { KEY } from "../../utils/helpers/keyCodes";
import { random } from "../utils"; import { random } from "../utils";
@ -35,7 +35,7 @@ export function BackwardGame(props: IMinigameProps): React.ReactElement {
const timer = difficulty.timer; const timer = difficulty.timer;
const [answer] = useState(makeAnswer(difficulty)); const [answer] = useState(makeAnswer(difficulty));
const [guess, setGuess] = useState(""); const [guess, setGuess] = useState("");
const hasAugment = Player.hasAugmentation(AugmentationNames.ChaosOfDionysus, true); const hasAugment = Player.hasAugmentation(AugmentationName.ChaosOfDionysus, true);
function ignorableKeyboardEvent(event: KeyboardEvent): boolean { function ignorableKeyboardEvent(event: KeyboardEvent): boolean {
return event.key === KEY.BACKSPACE || (event.shiftKey && event.key === "Shift") || event.ctrlKey || event.altKey; return event.key === KEY.BACKSPACE || (event.shiftKey && event.key === "Shift") || event.ctrlKey || event.altKey;

@ -1,6 +1,6 @@
import { Paper, Typography } from "@mui/material"; import { Paper, Typography } from "@mui/material";
import React, { useState } from "react"; import React, { useState } from "react";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { AugmentationName } from "@enums";
import { Player } from "@player"; import { Player } from "@player";
import { KEY } from "../../utils/helpers/keyCodes"; import { KEY } from "../../utils/helpers/keyCodes";
import { random } from "../utils"; import { random } from "../utils";
@ -32,7 +32,7 @@ const difficulties: {
function generateLeftSide(difficulty: Difficulty): string { function generateLeftSide(difficulty: Difficulty): string {
let str = ""; let str = "";
const options = [KEY.OPEN_BRACKET, KEY.LESS_THAN, KEY.OPEN_PARENTHESIS, KEY.OPEN_BRACE]; const options = [KEY.OPEN_BRACKET, KEY.LESS_THAN, KEY.OPEN_PARENTHESIS, KEY.OPEN_BRACE];
if (Player.hasAugmentation(AugmentationNames.WisdomOfAthena, true)) { if (Player.hasAugmentation(AugmentationName.WisdomOfAthena, true)) {
options.splice(0, 1); options.splice(0, 1);
} }
const length = random(difficulty.min, difficulty.max); const length = random(difficulty.min, difficulty.max);

@ -1,6 +1,6 @@
import { Paper, Typography } from "@mui/material"; import { Paper, Typography } from "@mui/material";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { AugmentationName } from "@enums";
import { Player } from "@player"; import { Player } from "@player";
import { Settings } from "../../Settings/Settings"; import { Settings } from "../../Settings/Settings";
import { KEY } from "../../utils/helpers/keyCodes"; import { KEY } from "../../utils/helpers/keyCodes";
@ -46,7 +46,7 @@ export function BribeGame(props: IMinigameProps): React.ReactElement {
let upColor = defaultColor; let upColor = defaultColor;
let downColor = defaultColor; let downColor = defaultColor;
let choiceColor = defaultColor; let choiceColor = defaultColor;
const hasAugment = Player.hasAugmentation(AugmentationNames.BeautyOfAphrodite, true); const hasAugment = Player.hasAugmentation(AugmentationName.BeautyOfAphrodite, true);
if (hasAugment) { if (hasAugment) {
const upIndex = index + 1 >= choices.length ? 0 : index + 1; const upIndex = index + 1 >= choices.length ? 0 : index + 1;

@ -1,6 +1,6 @@
import { Paper, Typography } from "@mui/material"; import { Paper, Typography } from "@mui/material";
import React, { useState } from "react"; import React, { useState } from "react";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { AugmentationName } from "@enums";
import { Player } from "@player"; import { Player } from "@player";
import { import {
downArrowSymbol, downArrowSymbol,
@ -41,7 +41,7 @@ export function CheatCodeGame(props: IMinigameProps): React.ReactElement {
const timer = difficulty.timer; const timer = difficulty.timer;
const [code] = useState(generateCode(difficulty)); const [code] = useState(generateCode(difficulty));
const [index, setIndex] = useState(0); const [index, setIndex] = useState(0);
const hasAugment = Player.hasAugmentation(AugmentationNames.TrickeryOfHermes, true); const hasAugment = Player.hasAugmentation(AugmentationName.TrickeryOfHermes, true);
function press(this: Document, event: KeyboardEvent): void { function press(this: Document, event: KeyboardEvent): void {
event.preventDefault(); event.preventDefault();

@ -1,6 +1,6 @@
import { Paper, Typography, Box } from "@mui/material"; import { Paper, Typography, Box } from "@mui/material";
import React, { useState } from "react"; import React, { useState } from "react";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { AugmentationName } from "@enums";
import { Player } from "@player"; import { Player } from "@player";
import { Settings } from "../../Settings/Settings"; import { Settings } from "../../Settings/Settings";
import { KEY } from "../../utils/helpers/keyCodes"; import { KEY } from "../../utils/helpers/keyCodes";
@ -45,7 +45,7 @@ export function Cyberpunk2077Game(props: IMinigameProps): React.ReactElement {
const [currentAnswerIndex, setCurrentAnswerIndex] = useState(0); const [currentAnswerIndex, setCurrentAnswerIndex] = useState(0);
const [pos, setPos] = useState([0, 0]); const [pos, setPos] = useState([0, 0]);
const hasAugment = Player.hasAugmentation(AugmentationNames.FloodOfPoseidon, true); const hasAugment = Player.hasAugmentation(AugmentationName.FloodOfPoseidon, true);
function press(this: Document, event: KeyboardEvent): void { function press(this: Document, event: KeyboardEvent): void {
event.preventDefault(); event.preventDefault();
const move = [0, 0]; const move = [0, 0];

@ -1,6 +1,6 @@
import { Button, Container, Paper, Typography } from "@mui/material"; import { Button, Container, Paper, Typography } from "@mui/material";
import React, { useState } from "react"; import React, { useState } from "react";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { AugmentationName } from "@enums";
import { Router } from "../../ui/GameRoot"; import { Router } from "../../ui/GameRoot";
import { Page } from "../../ui/Router"; import { Page } from "../../ui/Router";
import { Player } from "@player"; import { Player } from "@player";
@ -92,7 +92,7 @@ export function Game(props: IProps): React.ReactElement {
// it's clear they're not meant to // it's clear they're not meant to
const damage = options?.automated const damage = options?.automated
? Player.hp.current ? Player.hp.current
: props.StartingDifficulty * 3 * (Player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 0.5 : 1); : props.StartingDifficulty * 3 * (Player.hasAugmentation(AugmentationName.WKSharmonizer, true) ? 0.5 : 1);
if (Player.takeDamage(damage)) { if (Player.takeDamage(damage)) {
Router.toPage(Page.City); Router.toPage(Page.City);
return; return;

@ -1,6 +1,6 @@
import { Paper } from "@mui/material"; import { Paper } from "@mui/material";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { AugmentationName } from "@enums";
import { Player } from "@player"; import { Player } from "@player";
import { ProgressBar } from "../../ui/React/Progress"; import { ProgressBar } from "../../ui/React/Progress";
@ -14,7 +14,7 @@ interface IProps {
export function GameTimer(props: IProps): React.ReactElement { export function GameTimer(props: IProps): React.ReactElement {
const [v, setV] = useState(100); const [v, setV] = useState(100);
const totalMillis = const totalMillis =
(!props.ignoreAugment_WKSharmonizer && Player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.3 : 1) * (!props.ignoreAugment_WKSharmonizer && Player.hasAugmentation(AugmentationName.WKSharmonizer, true) ? 1.3 : 1) *
props.millis; props.millis;
const tick = 200; const tick = 200;

@ -2,7 +2,7 @@ import { Close, Flag, Report } from "@mui/icons-material";
import { Box, Paper, Typography } from "@mui/material"; import { Box, Paper, Typography } from "@mui/material";
import { uniqueId } from "lodash"; import { uniqueId } from "lodash";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { AugmentationName } from "@enums";
import { Player } from "@player"; import { Player } from "@player";
import { Settings } from "../../Settings/Settings"; import { Settings } from "../../Settings/Settings";
import { KEY } from "../../utils/helpers/keyCodes"; import { KEY } from "../../utils/helpers/keyCodes";
@ -40,7 +40,7 @@ export function MinesweeperGame(props: IMinigameProps): React.ReactElement {
const [answer, setAnswer] = useState(generateEmptyField(difficulty)); const [answer, setAnswer] = useState(generateEmptyField(difficulty));
const [pos, setPos] = useState([0, 0]); const [pos, setPos] = useState([0, 0]);
const [memoryPhase, setMemoryPhase] = useState(true); const [memoryPhase, setMemoryPhase] = useState(true);
const hasAugment = Player.hasAugmentation(AugmentationNames.HuntOfArtemis, true); const hasAugment = Player.hasAugmentation(AugmentationName.HuntOfArtemis, true);
function press(this: Document, event: KeyboardEvent): void { function press(this: Document, event: KeyboardEvent): void {
event.preventDefault(); event.preventDefault();
if (memoryPhase) return; if (memoryPhase) return;

Some files were not shown because too many files have changed in this diff Show More