From 44ea4790433d73476de5d06c0294216dc470fd6c Mon Sep 17 00:00:00 2001 From: phyzical Date: Sat, 19 Mar 2022 16:09:59 +0800 Subject: [PATCH] update constants * added OperationNames * added faction names * used citynames where appropriate --- src/Achievements/Achievements.ts | 98 ++-- src/Augmentation/AugmentationHelpers.tsx | 474 ++++++++++-------- src/BitNode/BitNode.tsx | 37 +- src/Bladeburner/BlackOperations.tsx | 85 ++-- src/Bladeburner/Bladeburner.tsx | 91 ++-- src/Bladeburner/data/BlackOperationNames.ts | 23 + src/Bladeburner/data/BlackOperations.tsx | 101 ++-- src/Bladeburner/data/Constants.ts | 3 +- src/Bladeburner/ui/BlackOpPage.tsx | 3 +- src/Bladeburner/ui/BladeburnerCinematic.tsx | 11 +- src/Bladeburner/ui/Stats.tsx | 3 +- src/Corporation/data/Constants.ts | 3 +- src/CotMG/StaneksGift.ts | 3 +- src/DevMenu/ui/Companies.tsx | 3 +- src/DevMenu/ui/Factions.tsx | 7 +- src/Faction/FactionHelpers.tsx | 58 +-- src/Faction/FactionInfo.tsx | 165 +++--- src/Faction/data/FactionNames.ts | 35 ++ src/Faction/ui/CreateGangModal.tsx | 3 +- src/Faction/ui/FactionRoot.tsx | 16 +- src/Gang/AllGangs.ts | 29 +- src/Gang/data/Constants.ts | 16 +- src/Gang/data/power.ts | 15 +- src/Hacknet/ui/HacknetUpgradeElem.tsx | 5 +- src/Literature/Literatures.ts | 62 +-- src/Locations/data/LocationNames.ts | 8 - src/Locations/ui/SpecialLocation.tsx | 67 +-- src/Message/MessageHelpers.ts | 71 +-- src/Milestones/Milestones.ts | 29 +- src/NetscriptFunctions/Gang.ts | 16 +- src/NetscriptFunctions/Singularity.ts | 167 +++--- .../Player/PlayerObjectGeneralMethods.tsx | 159 +++--- src/PersonObjects/Sleeve/SleeveHelpers.ts | 5 +- .../Sleeve/ui/CovenantPurchasesRoot.tsx | 3 +- src/PersonObjects/Sleeve/ui/FAQModal.tsx | 5 +- src/PersonObjects/Sleeve/ui/TaskSelector.tsx | 3 +- src/Prestige.ts | 10 +- src/Programs/data/ProgramsMetadata.ts | 3 +- src/Server/data/servers.ts | 23 +- src/StockMarket/ui/InfoAndPurchases.tsx | 5 +- ...neAllPossibilitiesForTabCompletion.test.ts | 3 +- 41 files changed, 1007 insertions(+), 919 deletions(-) create mode 100644 src/Bladeburner/data/BlackOperationNames.ts create mode 100644 src/Faction/data/FactionNames.ts diff --git a/src/Achievements/Achievements.ts b/src/Achievements/Achievements.ts index d11db4cbb..66057f147 100644 --- a/src/Achievements/Achievements.ts +++ b/src/Achievements/Achievements.ts @@ -22,6 +22,8 @@ import { Router } from "../ui/GameRoot"; import { Page } from "../ui/Router"; import { IMap } from "../types"; import * as data from "./AchievementData.json"; +import { FactionNames } from "../Faction/data/FactionNames"; +import { BlackOperationNames } from "../Bladeburner/data/BlackOperationNames"; // Unable to correctly cast the JSON data into AchievementDataJson type otherwise... const achievementData = ((data)).achievements; @@ -56,7 +58,7 @@ function bitNodeFinishedState(): boolean { const wd = GetServer(SpecialServers.WorldDaemon); if (!(wd instanceof Server)) return false; if (wd.backdoorInstalled) return true; - return Player.bladeburner !== null && Player.bladeburner.blackops.hasOwnProperty("Operation Daedalus"); + return Player.bladeburner !== null && Player.bladeburner.blackops.hasOwnProperty(BlackOperationNames.OperationDaedalus); } function hasAccessToSF(player: PlayerObject, bn: number): boolean { @@ -82,40 +84,40 @@ function sfAchievement(): Achievement[] { } export const achievements: IMap = { - CYBERSEC: { - ...achievementData["CYBERSEC"], + [FactionNames.CyberSec.toUpperCase()]: { + ...achievementData[FactionNames.CyberSec.toUpperCase()], Icon: "CSEC", - Condition: () => Player.factions.includes("CyberSec"), + Condition: () => Player.factions.includes(FactionNames.CyberSec), }, - NITESEC: { - ...achievementData["NITESEC"], - Icon: "NiteSec", - Condition: () => Player.factions.includes("NiteSec"), + [FactionNames.NiteSec.toUpperCase()]: { + ...achievementData[FactionNames.NiteSec.toUpperCase()], + Icon: FactionNames.NiteSec, + Condition: () => Player.factions.includes(FactionNames.NiteSec), }, THE_BLACK_HAND: { ...achievementData["THE_BLACK_HAND"], Icon: "TBH", - Condition: () => Player.factions.includes("The Black Hand"), + Condition: () => Player.factions.includes(FactionNames.TheBlackHand), }, - BITRUNNERS: { - ...achievementData["BITRUNNERS"], - Icon: "bitrunners", - Condition: () => Player.factions.includes("BitRunners"), + [FactionNames.BitRunners.toUpperCase()]: { + ...achievementData[FactionNames.BitRunners.toUpperCase()], + Icon: FactionNames.BitRunners.toLowerCase(), + Condition: () => Player.factions.includes(FactionNames.BitRunners), }, - DAEDALUS: { - ...achievementData["DAEDALUS"], - Icon: "daedalus", - Condition: () => Player.factions.includes("Daedalus"), + [FactionNames.Daedalus.toUpperCase()]: { + ...achievementData[FactionNames.Daedalus.toUpperCase()], + Icon: FactionNames.Daedalus.toLowerCase(), + Condition: () => Player.factions.includes(FactionNames.Daedalus), }, THE_COVENANT: { ...achievementData["THE_COVENANT"], - Icon: "thecovenant", - Condition: () => Player.factions.includes("The Covenant"), + Icon: FactionNames.TheCovenant.toLowerCase(), + Condition: () => Player.factions.includes(FactionNames.TheCovenant), }, - ILLUMINATI: { - ...achievementData["ILLUMINATI"], - Icon: "illuminati", - Condition: () => Player.factions.includes("Illuminati"), + [FactionNames.Illuminati.toUpperCase()]: { + ...achievementData[FactionNames.Illuminati.toUpperCase()], + Icon: FactionNames.Illuminati.toLowerCase(), + Condition: () => Player.factions.includes(FactionNames.Illuminati), }, "BRUTESSH.EXE": { ...achievementData["BRUTESSH.EXE"], @@ -745,31 +747,31 @@ export const achievements: IMap = { }; // Steam has a limit of 100 achievement. So these were planned but commented for now. -// { ID: "ECORP", Condition: () => Player.factions.includes("ECorp") }, -// { ID: "MEGACORP", Condition: () => Player.factions.includes("MegaCorp") }, -// { ID: "BACHMAN_&_ASSOCIATES", Condition: () => Player.factions.includes("Bachman & Associates") }, -// { ID: "BLADE_INDUSTRIES", Condition: () => Player.factions.includes("Blade Industries") }, -// { ID: "NWO", Condition: () => Player.factions.includes("NWO") }, -// { ID: "CLARKE_INCORPORATED", Condition: () => Player.factions.includes("Clarke Incorporated") }, -// { ID: "OMNITEK_INCORPORATED", Condition: () => Player.factions.includes("OmniTek Incorporated") }, -// { ID: "FOUR_SIGMA", Condition: () => Player.factions.includes("Four Sigma") }, -// { ID: "KUAIGONG_INTERNATIONAL", Condition: () => Player.factions.includes("KuaiGong International") }, -// { ID: "FULCRUM_SECRET_TECHNOLOGIES", Condition: () => Player.factions.includes("Fulcrum Secret Technologies") }, -// { ID: "AEVUM", Condition: () => Player.factions.includes("Aevum") }, -// { ID: "CHONGQING", Condition: () => Player.factions.includes("Chongqing") }, -// { ID: "ISHIMA", Condition: () => Player.factions.includes("Ishima") }, -// { ID: "NEW_TOKYO", Condition: () => Player.factions.includes("New Tokyo") }, -// { ID: "SECTOR-12", Condition: () => Player.factions.includes("Sector-12") }, -// { ID: "VOLHAVEN", Condition: () => Player.factions.includes("Volhaven") }, -// { ID: "SPEAKERS_FOR_THE_DEAD", Condition: () => Player.factions.includes("Speakers for the Dead") }, -// { ID: "THE_DARK_ARMY", Condition: () => Player.factions.includes("The Dark Army") }, -// { ID: "THE_SYNDICATE", Condition: () => Player.factions.includes("The Syndicate") }, -// { ID: "SILHOUETTE", Condition: () => Player.factions.includes("Silhouette") }, -// { ID: "TETRADS", Condition: () => Player.factions.includes("Tetrads") }, -// { ID: "SLUM_SNAKES", Condition: () => Player.factions.includes("Slum Snakes") }, -// { ID: "NETBURNERS", Condition: () => Player.factions.includes("Netburners") }, -// { ID: "TIAN_DI_HUI", Condition: () => Player.factions.includes("Tian Di Hui") }, -// { ID: "BLADEBURNERS", Condition: () => Player.factions.includes("Bladeburners") }, +// { ID: FactionNames.ECorp.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.ECorp) }, +// { ID: FactionNames.MegaCorp.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.MegaCorp) }, +// { ID: "BACHMAN_&_ASSOCIATES", Condition: () => Player.factions.includes(FactionNames.BachmanAssociates) }, +// { ID: "BLADE_INDUSTRIES", Condition: () => Player.factions.includes(FactionNames.BladeIndustries) }, +// { ID: FactionNames.NWO.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.NWO) }, +// { ID: "CLARKE_INCORPORATED", Condition: () => Player.factions.includes(FactionNames.ClarkeIncorporated) }, +// { ID: "OMNITEK_INCORPORATED", Condition: () => Player.factions.includes(FactionNames.OmniTekIncorporated) }, +// { ID: "FOUR_SIGMA", Condition: () => Player.factions.includes(FactionNames.FourSigma) }, +// { ID: "KUAIGONG_INTERNATIONAL", Condition: () => Player.factions.includes(FactionNames.KuaiGongInternational) }, +// { ID: "FULCRUM_SECRET_TECHNOLOGIES", Condition: () => Player.factions.includes(FactionNames.FulcrumSecretTechnologies) }, +// { ID: FactionNames.Aevum.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Aevum) }, +// { ID: FactionNames.Chongqing.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Chongqing) }, +// { ID: FactionNames.Ishima.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Ishima) }, +// { ID: "NEW_TOKYO", Condition: () => Player.factions.includes(FactionNames.NewTokyo) }, +// { ID: "SECTOR-12", Condition: () => Player.factions.includes(FactionNames.Sector12) }, +// { ID: FactionNames.Volhaven.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Volhaven) }, +// { ID: "SPEAKERS_FOR_THE_DEAD", Condition: () => Player.factions.includes(FactionNames.SpeakersForTheDead) }, +// { ID: "THE_DARK_ARMY", Condition: () => Player.factions.includes(FactionNames.TheDarkArmy) }, +// { ID: "THE_SYNDICATE", Condition: () => Player.factions.includes(FactionNames.TheSyndicate) }, +// { ID: FactionNames.Silhouette.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Silhouette) }, +// { ID: FactionNames.Tetrads.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Tetrads) }, +// { ID: "SLUM_SNAKES", Condition: () => Player.factions.includes(FactionNames.SlumSnakes) }, +// { ID: FactionNames.Netburners.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Netburners) }, +// { ID: "TIAN_DI_HUI", Condition: () => Player.factions.includes(FactionNames.TianDiHui) }, +// { ID: FactionNames.Bladeburners.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Bladeburners) }, // { ID: "DEEPSCANV1.EXE", Condition: () => Player.getHomeComputer().programs.includes(Programs.DeepscanV1.name) }, // { ID: "DEEPSCANV2.EXE", Condition: () => Player.getHomeComputer().programs.includes(Programs.DeepscanV2.name) }, // { diff --git a/src/Augmentation/AugmentationHelpers.tsx b/src/Augmentation/AugmentationHelpers.tsx index 5cbcd8ddd..fc32ac02c 100644 --- a/src/Augmentation/AugmentationHelpers.tsx +++ b/src/Augmentation/AugmentationHelpers.tsx @@ -17,6 +17,7 @@ import { clearObject } from "../utils/helpers/clearObject"; import { WHRNG } from "../Casino/RNG"; import React from "react"; +import { FactionNames } from "../Faction/data/FactionNames"; function AddToAugmentations(aug: Augmentation): void { const name = aug.name; @@ -131,7 +132,7 @@ function initAugmentations(): void { info: "An experimental nanobot injection. Its unstable nature leads to " + "unpredictable results based on your circadian rhythm.", - factions: ["Speakers for the Dead"], + factions: [FactionNames.SpeakersForTheDead], }; Object.keys(randomBonuses.bonuses).forEach( (key) => ((UnstableCircadianModulatorParams as any)[key] = randomBonuses.bonuses[key]), @@ -149,7 +150,11 @@ function initAugmentations(): void { defense_mult: 1.08, agility_mult: 1.08, dexterity_mult: 1.08, - factions: ["Tetrads", "The Dark Army", "The Syndicate"], + factions: [ + FactionNames.Tetrads, + FactionNames.TheDarkArmy, + FactionNames.TheSyndicate, + ], }); resetAugmentation(HemoRecirculator); @@ -162,14 +167,14 @@ function initAugmentations(): void { "and enhances balance and hand-eye coordination.", dexterity_mult: 1.1, factions: [ - "Slum Snakes", - "The Dark Army", - "The Syndicate", - "Sector-12", - "Ishima", - "OmniTek Incorporated", - "KuaiGong International", - "Blade Industries", + FactionNames.SlumSnakes, + FactionNames.TheDarkArmy, + FactionNames.TheSyndicate, + FactionNames.Sector12, + FactionNames.Ishima, + FactionNames.OmniTekIncorporated, + FactionNames.KuaiGongInternational, + FactionNames.BladeIndustries, ], }); resetAugmentation(Targeting1); @@ -184,12 +189,12 @@ function initAugmentations(): void { prereqs: [AugmentationNames.Targeting1], dexterity_mult: 1.2, factions: [ - "The Dark Army", - "The Syndicate", - "Sector-12", - "OmniTek Incorporated", - "KuaiGong International", - "Blade Industries", + FactionNames.TheDarkArmy, + FactionNames.TheSyndicate, + FactionNames.Sector12, + FactionNames.OmniTekIncorporated, + FactionNames.KuaiGongInternational, + FactionNames.BladeIndustries, ], }); resetAugmentation(Targeting2); @@ -202,12 +207,12 @@ function initAugmentations(): void { prereqs: [AugmentationNames.Targeting2], dexterity_mult: 1.3, factions: [ - "The Dark Army", - "The Syndicate", - "OmniTek Incorporated", - "KuaiGong International", - "Blade Industries", - "The Covenant", + FactionNames.TheDarkArmy, + FactionNames.TheSyndicate, + FactionNames.OmniTekIncorporated, + FactionNames.KuaiGongInternational, + FactionNames.BladeIndustries, + FactionNames.TheCovenant, ], }); resetAugmentation(Targeting3); @@ -222,13 +227,13 @@ function initAugmentations(): void { agility_mult: 1.5, strength_mult: 1.5, factions: [ - "KuaiGong International", - "Fulcrum Secret Technologies", - "Speakers for the Dead", - "NWO", - "The Covenant", - "Daedalus", - "Illuminati", + FactionNames.KuaiGongInternational, + FactionNames.FulcrumSecretTechnologies, + FactionNames.SpeakersForTheDead, + FactionNames.NWO, + FactionNames.TheCovenant, + FactionNames.Daedalus, + FactionNames.Illuminati, ], }); resetAugmentation(SyntheticHeart); @@ -244,14 +249,14 @@ function initAugmentations(): void { strength_mult: 1.3, defense_mult: 1.3, factions: [ - "KuaiGong International", - "Fulcrum Secret Technologies", - "Speakers for the Dead", - "NWO", - "The Covenant", - "Daedalus", - "Illuminati", - "Blade Industries", + FactionNames.KuaiGongInternational, + FactionNames.FulcrumSecretTechnologies, + FactionNames.SpeakersForTheDead, + FactionNames.NWO, + FactionNames.TheCovenant, + FactionNames.Daedalus, + FactionNames.Illuminati, + FactionNames.BladeIndustries, ], }); resetAugmentation(SynfibrilMuscle); @@ -266,14 +271,14 @@ function initAugmentations(): void { strength_mult: 1.1, defense_mult: 1.1, factions: [ - "Slum Snakes", - "The Dark Army", - "The Syndicate", - "Volhaven", - "Ishima", - "OmniTek Incorporated", - "KuaiGong International", - "Blade Industries", + FactionNames.SlumSnakes, + FactionNames.TheDarkArmy, + FactionNames.TheSyndicate, + FactionNames.Volhaven, + FactionNames.Ishima, + FactionNames.OmniTekIncorporated, + FactionNames.KuaiGongInternational, + FactionNames.BladeIndustries, ], }); resetAugmentation(CombatRib1); @@ -289,12 +294,12 @@ function initAugmentations(): void { strength_mult: 1.14, defense_mult: 1.14, factions: [ - "The Dark Army", - "The Syndicate", - "Volhaven", - "OmniTek Incorporated", - "KuaiGong International", - "Blade Industries", + FactionNames.TheDarkArmy, + FactionNames.TheSyndicate, + FactionNames.Volhaven, + FactionNames.OmniTekIncorporated, + FactionNames.KuaiGongInternational, + FactionNames.BladeIndustries, ], }); resetAugmentation(CombatRib2); @@ -310,12 +315,12 @@ function initAugmentations(): void { strength_mult: 1.18, defense_mult: 1.18, factions: [ - "The Dark Army", - "The Syndicate", - "OmniTek Incorporated", - "KuaiGong International", - "Blade Industries", - "The Covenant", + FactionNames.TheDarkArmy, + FactionNames.TheSyndicate, + FactionNames.OmniTekIncorporated, + FactionNames.KuaiGongInternational, + FactionNames.BladeIndustries, + FactionNames.TheCovenant, ], }); resetAugmentation(CombatRib3); @@ -330,13 +335,13 @@ function initAugmentations(): void { strength_mult: 1.2, defense_mult: 1.2, factions: [ - "Tian Di Hui", - "The Syndicate", - "The Dark Army", - "Speakers for the Dead", - "Blade Industries", - "Fulcrum Secret Technologies", - "OmniTek Incorporated", + FactionNames.TheDarkArmy, + FactionNames.TheSyndicate, + FactionNames.OmniTekIncorporated, + FactionNames.BladeIndustries, + FactionNames.TianDiHui, + FactionNames.SpeakersForTheDead, + FactionNames.FulcrumSecretTechnologies, ], }); resetAugmentation(NanofiberWeave); @@ -352,7 +357,13 @@ function initAugmentations(): void { "at stopping piercing blows and reducing blunt trauma. The properties of graphene allow the plating to " + "mitigate damage from any fire or electrical traumas.", defense_mult: 2.2, - factions: ["The Syndicate", "Fulcrum Secret Technologies", "Illuminati", "Daedalus", "The Covenant"], + factions: [ + FactionNames.TheSyndicate, + FactionNames.FulcrumSecretTechnologies, + FactionNames.Illuminati, + FactionNames.Daedalus, + FactionNames.TheCovenant, + ], }); resetAugmentation(SubdermalArmor); @@ -366,15 +377,15 @@ function initAugmentations(): void { agility_mult: 1.05, dexterity_mult: 1.05, factions: [ - "Tian Di Hui", - "Slum Snakes", - "Sector-12", - "Volhaven", - "Aevum", - "Ishima", - "The Syndicate", - "The Dark Army", - "Speakers for the Dead", + FactionNames.TianDiHui, + FactionNames.SlumSnakes, + FactionNames.Sector12, + FactionNames.Volhaven, + FactionNames.Aevum, + FactionNames.Ishima, + FactionNames.TheSyndicate, + FactionNames.TheDarkArmy, + FactionNames.SpeakersForTheDead, ], }); resetAugmentation(WiredReflexes); @@ -386,7 +397,7 @@ function initAugmentations(): void { info: "Graphene is grafted and fused into the skeletal structure, enhancing bone density and tensile strength.", strength_mult: 1.7, defense_mult: 1.7, - factions: ["Fulcrum Secret Technologies", "The Covenant"], + factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.TheCovenant], }); resetAugmentation(GrapheneBoneLacings); @@ -404,11 +415,11 @@ function initAugmentations(): void { agility_mult: 1.15, dexterity_mult: 1.15, factions: [ - "Speakers for the Dead", - "The Syndicate", - "KuaiGong International", - "OmniTek Incorporated", - "Blade Industries", + FactionNames.SpeakersForTheDead, + FactionNames.TheSyndicate, + FactionNames.KuaiGongInternational, + FactionNames.OmniTekIncorporated, + FactionNames.BladeIndustries, ], }); resetAugmentation(BionicSpine); @@ -425,7 +436,7 @@ function initAugmentations(): void { defense_mult: 1.6, agility_mult: 1.6, dexterity_mult: 1.6, - factions: ["Fulcrum Secret Technologies", "ECorp"], + factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.ECorp], }); resetAugmentation(GrapheneBionicSpine); @@ -436,11 +447,11 @@ function initAugmentations(): void { info: "Cybernetic legs, created from plasteel and carbon fibers, enhance running speed.", agility_mult: 1.6, factions: [ - "Speakers for the Dead", - "The Syndicate", - "KuaiGong International", - "OmniTek Incorporated", - "Blade Industries", + FactionNames.SpeakersForTheDead, + FactionNames.TheSyndicate, + FactionNames.KuaiGongInternational, + FactionNames.OmniTekIncorporated, + FactionNames.BladeIndustries, ], }); resetAugmentation(BionicLegs); @@ -454,7 +465,7 @@ function initAugmentations(): void { "with graphene, greatly enhancing jumping ability.", prereqs: [AugmentationNames.BionicLegs], agility_mult: 2.5, - factions: ["MegaCorp", "ECorp", "Fulcrum Secret Technologies"], + factions: [FactionNames.MegaCorp, FactionNames.ECorp, FactionNames.FulcrumSecretTechnologies], }); resetAugmentation(GrapheneBionicLegs); @@ -468,7 +479,16 @@ function initAugmentations(): void { "The embedded computer processes characteristics of incoming speech, such as tone " + "and inflection, to pick up on subtle cues and aid in social interactions.", charisma_mult: 1.2, - factions: ["Tian Di Hui", "Chongqing", "Sector-12", "New Tokyo", "Aevum", "Ishima", "Volhaven", "Silhouette"], + factions: [ + FactionNames.TianDiHui, + FactionNames.Chongqing, + FactionNames.Sector12, + FactionNames.NewTokyo, + FactionNames.Aevum, + FactionNames.Ishima, + FactionNames.Volhaven, + FactionNames.Silhouette, + ], }); resetAugmentation(SpeechProcessor); @@ -482,7 +502,7 @@ function initAugmentations(): void { "outgoing and socialable.", charisma_mult: 1.15, charisma_exp_mult: 1.15, - factions: ["Silhouette"], + factions: [FactionNames.Silhouette], }); resetAugmentation(TITN41Injection); @@ -498,7 +518,13 @@ function initAugmentations(): void { "patterns and how to best respond.", charisma_mult: 1.6, charisma_exp_mult: 1.6, - factions: ["Bachman & Associates", "NWO", "Clarke Incorporated", "OmniTek Incorporated", "Four Sigma"], + factions: [ + FactionNames.BachmanAssociates, + FactionNames.NWO, + FactionNames.ClarkeIncorporated, + FactionNames.OmniTekIncorporated, + FactionNames.FourSigma, + ], }); resetAugmentation(EnhancedSocialInteractionImplant); @@ -511,7 +537,7 @@ function initAugmentations(): void { "A small brain implant embedded in the cerebrum. This regulates and improves the brain's computing " + "capabilities.", hacking_mult: 1.05, - factions: ["CyberSec", "NiteSec"], + factions: [FactionNames.CyberSec, FactionNames.NiteSec], }); resetAugmentation(BitWire); @@ -528,7 +554,7 @@ function initAugmentations(): void { hacking_speed_mult: 1.03, hacking_money_mult: 1.15, hacking_mult: 1.12, - factions: ["BitRunners", "Fulcrum Secret Technologies"], + factions: [FactionNames.BitRunners, FactionNames.FulcrumSecretTechnologies], }); resetAugmentation(ArtificialBioNeuralNetwork); @@ -542,7 +568,7 @@ function initAugmentations(): void { hacking_speed_mult: 1.02, hacking_chance_mult: 1.05, hacking_exp_mult: 1.05, - factions: ["The Black Hand", "NiteSec"], + factions: [FactionNames.TheBlackHand, FactionNames.NiteSec], }); resetAugmentation(ArtificialSynapticPotentiation); @@ -558,7 +584,7 @@ function initAugmentations(): void { hacking_speed_mult: 1.03, hacking_exp_mult: 1.1, hacking_mult: 1.08, - factions: ["Fulcrum Secret Technologies", "BitRunners", "The Black Hand"], + factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.BitRunners, FactionNames.TheBlackHand], }); resetAugmentation(EnhancedMyelinSheathing); @@ -570,7 +596,7 @@ function initAugmentations(): void { "A small cranial implant that continuously uses weak electrical signals to stimulate the brain and " + "induce stronger synaptic activity. This improves the user's cognitive abilities.", hacking_speed_mult: 1.03, - factions: ["CyberSec", "Aevum"], + factions: [FactionNames.CyberSec, FactionNames.Aevum], }); resetAugmentation(SynapticEnhancement); @@ -582,7 +608,7 @@ function initAugmentations(): void { "Chemical injections are used to permanently alter and strengthen the brain's neuronal " + "circuits, strengthening the ability to retain information.", hacking_exp_mult: 1.25, - factions: ["NiteSec"], + factions: [FactionNames.NiteSec], }); resetAugmentation(NeuralRetentionEnhancement); @@ -595,7 +621,7 @@ function initAugmentations(): void { "memory and the mind. This implant allows the user to not only access a computer's memory, but also alter " + "and delete it.", hacking_money_mult: 1.25, - factions: ["BitRunners", "The Black Hand", "NiteSec", "Chongqing", "New Tokyo"], + factions: [FactionNames.BitRunners, FactionNames.TheBlackHand, FactionNames.NiteSec, FactionNames.Chongqing, FactionNames.NewTokyo], }); resetAugmentation(DataJack); @@ -611,14 +637,14 @@ function initAugmentations(): void { "control the traffic on a network.", hacking_mult: 1.08, factions: [ - "BitRunners", - "The Black Hand", - "NiteSec", - "ECorp", - "MegaCorp", - "Fulcrum Secret Technologies", - "NWO", - "Blade Industries", + FactionNames.BitRunners, + FactionNames.TheBlackHand, + FactionNames.NiteSec, + FactionNames.ECorp, + FactionNames.MegaCorp, + FactionNames.FulcrumSecretTechnologies, + FactionNames.NWO, + FactionNames.BladeIndustries, ], }); resetAugmentation(ENM); @@ -637,13 +663,13 @@ function initAugmentations(): void { hacking_exp_mult: 1.07, hacking_mult: 1.07, factions: [ - "BitRunners", - "The Black Hand", - "ECorp", - "MegaCorp", - "Fulcrum Secret Technologies", - "NWO", - "Blade Industries", + FactionNames.BitRunners, + FactionNames.TheBlackHand, + FactionNames.ECorp, + FactionNames.MegaCorp, + FactionNames.FulcrumSecretTechnologies, + FactionNames.NWO, + FactionNames.BladeIndustries, ], }); resetAugmentation(ENMCore); @@ -664,14 +690,14 @@ function initAugmentations(): void { hacking_exp_mult: 1.15, hacking_mult: 1.08, factions: [ - "BitRunners", - "ECorp", - "MegaCorp", - "Fulcrum Secret Technologies", - "NWO", - "Blade Industries", - "OmniTek Incorporated", - "KuaiGong International", + FactionNames.BitRunners, + FactionNames.ECorp, + FactionNames.MegaCorp, + FactionNames.FulcrumSecretTechnologies, + FactionNames.NWO, + FactionNames.BladeIndustries, + FactionNames.OmniTekIncorporated, + FactionNames.KuaiGongInternational, ], }); resetAugmentation(ENMCoreV2); @@ -690,7 +716,15 @@ function initAugmentations(): void { hacking_chance_mult: 1.1, hacking_exp_mult: 1.25, hacking_mult: 1.1, - factions: ["ECorp", "MegaCorp", "Fulcrum Secret Technologies", "NWO", "Daedalus", "The Covenant", "Illuminati"], + factions: [ + FactionNames.ECorp, + FactionNames.MegaCorp, + FactionNames.FulcrumSecretTechnologies, + FactionNames.NWO, + FactionNames.Daedalus, + FactionNames.TheCovenant, + FactionNames.Illuminati, + ], }); resetAugmentation(ENMCoreV3); @@ -703,7 +737,15 @@ function initAugmentations(): void { "that vastly outperforms the Netburner Module's native single-core processor.", prereqs: [AugmentationNames.ENM], hacking_speed_mult: 1.1, - factions: ["ECorp", "MegaCorp", "Fulcrum Secret Technologies", "NWO", "Daedalus", "The Covenant", "Illuminati"], + factions: [ + FactionNames.ECorp, + FactionNames.MegaCorp, + FactionNames.FulcrumSecretTechnologies, + FactionNames.NWO, + FactionNames.Daedalus, + FactionNames.TheCovenant, + FactionNames.Illuminati, + ], }); resetAugmentation(ENMAnalyzeEngine); @@ -718,7 +760,15 @@ function initAugmentations(): void { prereqs: [AugmentationNames.ENM], hacking_money_mult: 1.4, hacking_chance_mult: 1.2, - factions: ["ECorp", "MegaCorp", "Fulcrum Secret Technologies", "NWO", "Daedalus", "The Covenant", "Illuminati"], + factions: [ + FactionNames.ECorp, + FactionNames.MegaCorp, + FactionNames.FulcrumSecretTechnologies, + FactionNames.NWO, + FactionNames.Daedalus, + FactionNames.TheCovenant, + FactionNames.Illuminati, + ], }); resetAugmentation(ENMDMA); @@ -733,16 +783,16 @@ function initAugmentations(): void { hacking_chance_mult: 1.1, hacking_exp_mult: 1.12, factions: [ - "The Black Hand", - "Chongqing", - "Sector-12", - "New Tokyo", - "Aevum", - "Ishima", - "Volhaven", - "Bachman & Associates", - "Clarke Incorporated", - "Four Sigma", + FactionNames.TheBlackHand, + FactionNames.Chongqing, + FactionNames.Sector12, + FactionNames.NewTokyo, + FactionNames.Aevum, + FactionNames.Ishima, + FactionNames.Volhaven, + FactionNames.BachmanAssociates, + FactionNames.ClarkeIncorporated, + FactionNames.FourSigma, ], }); resetAugmentation(Neuralstimulator); @@ -757,7 +807,7 @@ function initAugmentations(): void { hacking_mult: 1.1, hacking_exp_mult: 1.15, hacking_money_mult: 1.2, - factions: ["BitRunners"], + factions: [FactionNames.BitRunners], }); resetAugmentation(NeuralAccelerator); @@ -772,7 +822,7 @@ function initAugmentations(): void { "so that the brain doesn't have to.", hacking_speed_mult: 1.01, hacking_mult: 1.05, - factions: ["CyberSec"], + factions: [FactionNames.CyberSec], }); resetAugmentation(CranialSignalProcessorsG1); @@ -789,7 +839,7 @@ function initAugmentations(): void { hacking_speed_mult: 1.02, hacking_chance_mult: 1.05, hacking_mult: 1.07, - factions: ["CyberSec", "NiteSec"], + factions: [FactionNames.CyberSec, FactionNames.NiteSec], }); resetAugmentation(CranialSignalProcessorsG2); @@ -806,7 +856,7 @@ function initAugmentations(): void { hacking_speed_mult: 1.02, hacking_money_mult: 1.15, hacking_mult: 1.09, - factions: ["NiteSec", "The Black Hand", "BitRunners"], + factions: [FactionNames.NiteSec, FactionNames.TheBlackHand, FactionNames.BitRunners], }); resetAugmentation(CranialSignalProcessorsG3); @@ -823,7 +873,7 @@ function initAugmentations(): void { hacking_speed_mult: 1.02, hacking_money_mult: 1.2, hacking_grow_mult: 1.25, - factions: ["The Black Hand", "BitRunners"], + factions: [FactionNames.TheBlackHand, FactionNames.BitRunners], }); resetAugmentation(CranialSignalProcessorsG4); @@ -840,7 +890,7 @@ function initAugmentations(): void { hacking_mult: 1.3, hacking_money_mult: 1.25, hacking_grow_mult: 1.75, - factions: ["BitRunners"], + factions: [FactionNames.BitRunners], }); resetAugmentation(CranialSignalProcessorsG5); @@ -855,7 +905,7 @@ function initAugmentations(): void { hacking_mult: 1.15, hacking_exp_mult: 1.1, hacking_speed_mult: 1.03, - factions: ["Clarke Incorporated"], + factions: [FactionNames.ClarkeIncorporated], }); resetAugmentation(NeuronalDensification); @@ -870,13 +920,13 @@ function initAugmentations(): void { "cognitive enhancements.", company_rep_mult: 1.2, factions: [ - "Tian Di Hui", - "Volhaven", - "New Tokyo", - "Chongqing", - "Clarke Incorporated", - "Four Sigma", - "Bachman & Associates", + FactionNames.TianDiHui, + FactionNames.Volhaven, + FactionNames.NewTokyo, + FactionNames.Chongqing, + FactionNames.ClarkeIncorporated, + FactionNames.FourSigma, + FactionNames.BachmanAssociates, ], }); resetAugmentation(NuoptimalInjectorImplant); @@ -892,12 +942,12 @@ function initAugmentations(): void { company_rep_mult: 1.1, charisma_mult: 1.1, factions: [ - "Tian Di Hui", - "Speakers for the Dead", - "Four Sigma", - "KuaiGong International", - "Clarke Incorporated", - "Bachman & Associates", + FactionNames.TianDiHui, + FactionNames.SpeakersForTheDead, + FactionNames.FourSigma, + FactionNames.KuaiGongInternational, + FactionNames.ClarkeIncorporated, + FactionNames.BachmanAssociates, ], }); resetAugmentation(SpeechEnhancement); @@ -915,7 +965,7 @@ function initAugmentations(): void { charisma_exp_mult: 1.05, company_rep_mult: 1.1, work_money_mult: 1.2, - factions: ["Bachman & Associates", "Clarke Incorporated", "Four Sigma", "KuaiGong International"], + factions: [FactionNames.BachmanAssociates, FactionNames.ClarkeIncorporated, FactionNames.FourSigma, FactionNames.KuaiGongInternational], }); resetAugmentation(FocusWire); @@ -929,7 +979,7 @@ function initAugmentations(): void { "it using the brain's electrochemical signals.", company_rep_mult: 1.3, hacking_mult: 1.08, - factions: ["Four Sigma", "OmniTek Incorporated", "ECorp", "Blade Industries"], + factions: [FactionNames.FourSigma, FactionNames.OmniTekIncorporated, FactionNames.ECorp, FactionNames.BladeIndustries], }); resetAugmentation(PCDNI); @@ -944,7 +994,7 @@ function initAugmentations(): void { prereqs: [AugmentationNames.PCDNI], company_rep_mult: 1.75, hacking_mult: 1.1, - factions: ["Fulcrum Secret Technologies", "ECorp", "Blade Industries"], + factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.ECorp, FactionNames.BladeIndustries], }); resetAugmentation(PCDNIOptimizer); @@ -961,7 +1011,7 @@ function initAugmentations(): void { company_rep_mult: 2, hacking_mult: 1.1, hacking_speed_mult: 1.05, - factions: ["Fulcrum Secret Technologies"], + factions: [FactionNames.FulcrumSecretTechnologies], }); resetAugmentation(PCDNINeuralNetwork); @@ -975,7 +1025,7 @@ function initAugmentations(): void { "triggers feelings of admiration and approval in other people.", company_rep_mult: 1.1, faction_rep_mult: 1.1, - factions: ["Tian Di Hui", "The Syndicate", "NWO", "MegaCorp", "Four Sigma"], + factions: [FactionNames.TianDiHui, FactionNames.TheSyndicate, FactionNames.NWO, FactionNames.MegaCorp, FactionNames.FourSigma], }); resetAugmentation(ADRPheromone1); @@ -989,7 +1039,7 @@ function initAugmentations(): void { "triggers feelings of admiration, approval, and respect in others.", company_rep_mult: 1.2, faction_rep_mult: 1.2, - factions: ["Silhouette", "Four Sigma", "Bachman & Associates", "Clarke Incorporated"], + factions: [FactionNames.Silhouette, FactionNames.FourSigma, FactionNames.BachmanAssociates, FactionNames.ClarkeIncorporated], }); resetAugmentation(ADRPheromone2); @@ -1005,7 +1055,11 @@ function initAugmentations(): void { "espionage and surveillance work.", company_rep_mult: 1.15, faction_rep_mult: 1.15, - factions: ["The Syndicate", "The Dark Army", "Speakers for the Dead"], + factions: [ + FactionNames.TheSyndicate, + FactionNames.TheDarkArmy, + FactionNames.SpeakersForTheDead + ], }); resetAugmentation(ShadowsSimulacrum); @@ -1020,7 +1074,7 @@ function initAugmentations(): void { "for the Hacknet Node that provides better performance.", hacknet_node_money_mult: 1.15, hacknet_node_purchase_cost_mult: 0.85, - factions: ["Netburners"], + factions: [FactionNames.Netburners], }); resetAugmentation(HacknetNodeCPUUpload); @@ -1034,7 +1088,7 @@ function initAugmentations(): void { "Hacknet Node that offers better performance.", hacknet_node_money_mult: 1.1, hacknet_node_level_cost_mult: 0.85, - factions: ["Netburners"], + factions: [FactionNames.Netburners], }); resetAugmentation(HacknetNodeCacheUpload); @@ -1048,7 +1102,7 @@ function initAugmentations(): void { "offers better performance.", hacknet_node_money_mult: 1.1, hacknet_node_purchase_cost_mult: 0.9, - factions: ["Netburners"], + factions: [FactionNames.Netburners], }); resetAugmentation(HacknetNodeNICUpload); @@ -1061,7 +1115,7 @@ function initAugmentations(): void { "Hacknet Node. This lets the user access and manipulate the Node's kernel using " + "electrochemical signals.", hacknet_node_money_mult: 1.25, - factions: ["Netburners"], + factions: [FactionNames.Netburners], }); resetAugmentation(HacknetNodeKernelDNI); @@ -1074,7 +1128,7 @@ function initAugmentations(): void { "to a Hacknet Node. This lets the user access and manipulate the Node's processing logic using " + "electrochemical signals.", hacknet_node_money_mult: 1.45, - factions: ["Netburners"], + factions: [FactionNames.Netburners], }); resetAugmentation(HacknetNodeCoreDNI); @@ -1164,7 +1218,7 @@ function initAugmentations(): void { dexterity_exp_mult: 1.1, agility_exp_mult: 1.1, charisma_exp_mult: 1.1, - factions: ["CyberSec", "Aevum"], + factions: [FactionNames.CyberSec, FactionNames.Aevum], }); resetAugmentation(Neurotrainer1); @@ -1182,7 +1236,7 @@ function initAugmentations(): void { dexterity_exp_mult: 1.15, agility_exp_mult: 1.15, charisma_exp_mult: 1.15, - factions: ["BitRunners", "NiteSec"], + factions: [FactionNames.BitRunners, FactionNames.NiteSec], }); resetAugmentation(Neurotrainer2); @@ -1200,7 +1254,7 @@ function initAugmentations(): void { dexterity_exp_mult: 1.2, agility_exp_mult: 1.2, charisma_exp_mult: 1.2, - factions: ["NWO", "Four Sigma"], + factions: [FactionNames.NWO, FactionNames.FourSigma], }); resetAugmentation(Neurotrainer3); @@ -1215,7 +1269,7 @@ function initAugmentations(): void { dexterity_mult: 1.4, hacking_speed_mult: 1.03, hacking_money_mult: 1.1, - factions: ["Blade Industries", "KuaiGong International"], + factions: [FactionNames.BladeIndustries, FactionNames.KuaiGongInternational], }); resetAugmentation(Hypersight); @@ -1229,7 +1283,7 @@ function initAugmentations(): void { "around the skin, making the user much harder to see to the naked eye.", agility_mult: 1.05, crime_money_mult: 1.1, - factions: ["Slum Snakes", "Tetrads"], + factions: [FactionNames.SlumSnakes, FactionNames.Tetrads], }); resetAugmentation(LuminCloaking1); @@ -1246,7 +1300,7 @@ function initAugmentations(): void { agility_mult: 1.1, defense_mult: 1.1, crime_money_mult: 1.25, - factions: ["Slum Snakes", "Tetrads"], + factions: [FactionNames.SlumSnakes, FactionNames.Tetrads], }); resetAugmentation(LuminCloaking2); @@ -1258,7 +1312,7 @@ function initAugmentations(): void { dexterity_mult: 1.1, dexterity_exp_mult: 1.15, crime_money_mult: 1.25, - factions: ["Slum Snakes"], + factions: [FactionNames.SlumSnakes], }); resetAugmentation(SmartSonar); @@ -1282,7 +1336,7 @@ function initAugmentations(): void { dexterity_exp_mult: 1.1, agility_exp_mult: 1.1, charisma_exp_mult: 1.1, - factions: ["Tetrads", "The Dark Army", "The Syndicate", "NWO"], + factions: [FactionNames.Tetrads, FactionNames.TheDarkArmy, FactionNames.TheSyndicate, FactionNames.NWO], }); resetAugmentation(PowerRecirculator); @@ -1297,14 +1351,14 @@ function initAugmentations(): void { repCost: 1.875e6, moneyCost: 2.5e13, info: - "A brain implant that wirelessly connects you to the Illuminati's " + + `A brain implant that wirelessly connects you to the ${FactionNames.Illuminati}'s ` + "quantum supercomputer, allowing you to access and use its incredible " + "computing power.", hacking_mult: 1.75, hacking_speed_mult: 2, hacking_chance_mult: 2.5, hacking_money_mult: 4, - factions: ["Illuminati"], + factions: [FactionNames.Illuminati], }); resetAugmentation(QLink); @@ -1315,7 +1369,7 @@ function initAugmentations(): void { moneyCost: 0, info: "It's time to leave the cave.", stats: null, - factions: ["Daedalus"], + factions: [FactionNames.Daedalus], }); resetAugmentation(RedPill); @@ -1334,7 +1388,7 @@ function initAugmentations(): void { dexterity_mult: 1.75, agility_mult: 1.75, hacking_mult: 1.15, - factions: ["The Covenant"], + factions: [FactionNames.TheCovenant], }); resetAugmentation(SPTN97); @@ -1344,12 +1398,12 @@ function initAugmentations(): void { repCost: 1.5e6, moneyCost: 5.5e9, info: - "A brain implant developed by ECorp. They do not reveal what " + + `A brain implant developed by ${FactionNames.ECorp}. They do not reveal what ` + "exactly the implant does, but they promise that it will greatly " + "enhance your abilities.", hacking_grow_mult: 3, stats: null, - factions: ["ECorp"], + factions: [FactionNames.ECorp], }); resetAugmentation(HiveMind); @@ -1371,7 +1425,7 @@ function initAugmentations(): void { defense_exp_mult: 1.35, dexterity_exp_mult: 1.35, agility_exp_mult: 1.35, - factions: ["MegaCorp"], + factions: [FactionNames.MegaCorp], }); resetAugmentation(CordiARCReactor); @@ -1388,7 +1442,7 @@ function initAugmentations(): void { charisma_exp_mult: 1.5, company_rep_mult: 1.25, faction_rep_mult: 1.25, - factions: ["Bachman & Associates"], + factions: [FactionNames.BachmanAssociates], }); resetAugmentation(SmartJaw); @@ -1404,7 +1458,7 @@ function initAugmentations(): void { "and restructure themselves.", strength_mult: 1.55, defense_mult: 1.55, - factions: ["Blade Industries"], + factions: [FactionNames.BladeIndustries], }); resetAugmentation(Neotra); @@ -1429,7 +1483,7 @@ function initAugmentations(): void { dexterity_exp_mult: 1.15, agility_exp_mult: 1.15, charisma_exp_mult: 1.15, - factions: ["NWO"], + factions: [FactionNames.NWO], }); resetAugmentation(Xanipher); @@ -1444,7 +1498,7 @@ function initAugmentations(): void { "alloy increases the user's strength to unbelievable levels. The augmentation " + "gets more powerful over time for seemingly no reason.", strength_mult: 2.7, - factions: ["NWO"], + factions: [FactionNames.NWO], }); resetAugmentation(HydroflameLeftArm); @@ -1463,7 +1517,7 @@ function initAugmentations(): void { dexterity_mult: 1.2, agility_mult: 1.2, charisma_mult: 1.2, - factions: ["Clarke Incorporated"], + factions: [FactionNames.ClarkeIncorporated], }); resetAugmentation(nextSENS); @@ -1478,7 +1532,7 @@ function initAugmentations(): void { "hacking abilities.", hacking_mult: 1.2, hacking_exp_mult: 1.25, - factions: ["OmniTek Incorporated"], + factions: [FactionNames.OmniTekIncorporated], }); resetAugmentation(OmniTekInfoLoad); @@ -1498,7 +1552,7 @@ function initAugmentations(): void { strength_mult: 1.4, defense_mult: 1.4, agility_mult: 1.4, - factions: ["KuaiGong International"], + factions: [FactionNames.KuaiGongInternational], }); resetAugmentation(PhotosyntheticCells); @@ -1509,14 +1563,14 @@ function initAugmentations(): void { moneyCost: 4.375e9, info: "A brain implant that provides a high-bandwidth, direct neural link between your " + - "mind and the BitRunners' data servers, which reportedly contain " + + `mind and the ${FactionNames.BitRunners}' data servers, which reportedly contain ` + "the largest database of hacking tools and information in the world.", hacking_mult: 1.15, hacking_exp_mult: 1.2, hacking_chance_mult: 1.1, hacking_speed_mult: 1.05, programs: [Programs.FTPCrackProgram.name, Programs.RelaySMTPProgram.name], - factions: ["BitRunners"], + factions: [FactionNames.BitRunners], }); resetAugmentation(Neurolink); @@ -1535,7 +1589,7 @@ function initAugmentations(): void { hacking_mult: 1.1, hacking_speed_mult: 1.02, hacking_money_mult: 1.1, - factions: ["The Black Hand"], + factions: [FactionNames.TheBlackHand], }); resetAugmentation(TheBlackHand); @@ -1550,7 +1604,7 @@ function initAugmentations(): void { "cortex and improves cognitive abilities.", hacking_mult: 1.08, hacking_exp_mult: 1.15, - factions: ["NiteSec"], + factions: [FactionNames.NiteSec], }); resetAugmentation(CRTX42AA); @@ -1564,7 +1618,7 @@ function initAugmentations(): void { "resulting in neurons that never die, continuously " + "regenerate, and strengthen themselves.", hacking_exp_mult: 1.4, - factions: ["Chongqing"], + factions: [FactionNames.Chongqing], }); resetAugmentation(Neuregen); @@ -1581,7 +1635,7 @@ function initAugmentations(): void { ), startingMoney: 1e6, programs: [Programs.BruteSSHProgram.name], - factions: ["Sector-12"], + factions: [FactionNames.Sector12], }); resetAugmentation(CashRoot); @@ -1599,7 +1653,7 @@ function initAugmentations(): void { defense_exp_mult: 1.2, dexterity_exp_mult: 1.2, agility_exp_mult: 1.2, - factions: ["New Tokyo"], + factions: [FactionNames.NewTokyo], }); resetAugmentation(NutriGen); @@ -1620,7 +1674,7 @@ function initAugmentations(): void { crime_success_mult: 1.0777, crime_money_mult: 1.0777, programs: [Programs.DeepscanV1.name, Programs.AutoLink.name], - factions: ["Aevum"], + factions: [FactionNames.Aevum], }); resetAugmentation(PCMatrix); @@ -1633,7 +1687,7 @@ function initAugmentations(): void { crime_success_mult: 1.25, crime_money_mult: 1.1, dexterity_mult: 1.1, - factions: ["Ishima"], + factions: [FactionNames.Ishima], }); resetAugmentation(INFRARet); @@ -1647,7 +1701,7 @@ function initAugmentations(): void { "millions of nanobots capable of projecting high-density muon beams, " + "creating an energy barrier around the user.", defense_mult: 1.4, - factions: ["Volhaven"], + factions: [FactionNames.Volhaven], }); resetAugmentation(DermaForce); @@ -1665,7 +1719,7 @@ function initAugmentations(): void { defense_mult: 1.4, crime_success_mult: 1.1, crime_money_mult: 1.3, - factions: ["Speakers for the Dead"], + factions: [FactionNames.SpeakersForTheDead], }); resetAugmentation(GrapheneBrachiBlades); @@ -1681,7 +1735,7 @@ function initAugmentations(): void { prereqs: [AugmentationNames.BionicArms], strength_mult: 1.85, dexterity_mult: 1.85, - factions: ["The Dark Army"], + factions: [FactionNames.TheDarkArmy], }); resetAugmentation(GrapheneBionicArms); @@ -1695,7 +1749,7 @@ function initAugmentations(): void { defense_mult: 1.15, crime_success_mult: 1.1, crime_money_mult: 1.15, - factions: ["The Syndicate"], + factions: [FactionNames.TheSyndicate], }); resetAugmentation(BrachiBlades); @@ -1707,7 +1761,7 @@ function initAugmentations(): void { info: "Cybernetic arms created from plasteel and carbon fibers that completely replace the user's organic arms.", strength_mult: 1.3, dexterity_mult: 1.3, - factions: ["Tetrads"], + factions: [FactionNames.Tetrads], }); resetAugmentation(BionicArms); @@ -1722,7 +1776,7 @@ function initAugmentations(): void { work_money_mult: 1.1, company_rep_mult: 1.15, faction_rep_mult: 1.15, - factions: ["Tian Di Hui"], + factions: [FactionNames.TianDiHui], }); resetAugmentation(SNA); @@ -1741,12 +1795,12 @@ function initAugmentations(): void { faction. ), - factions: ["Tian Di Hui"], + factions: [FactionNames.TianDiHui], }); resetAugmentation(NeuroreceptorManager); // Special Bladeburner Augmentations - const BladeburnersFactionName = "Bladeburners"; + const BladeburnersFactionName = FactionNames.Bladeburners; if (factionExists(BladeburnersFactionName)) { const EsperEyewear = new Augmentation({ name: AugmentationNames.EsperEyewear, @@ -1913,7 +1967,7 @@ function initAugmentations(): void { repCost: 2e4, moneyCost: 8.25e9, info: - "A cybernetic foot augmentation that was specifically created for Bladeburners " + + `A cybernetic foot augmentation that was specifically created for ${BladeburnersFactionName} ` + "during the Synthoid Uprising. The organic musculature of the human foot " + "is enhanced with flexible carbon nanotube matrices that are controlled by " + "intelligent servo-motors.", @@ -1930,7 +1984,7 @@ function initAugmentations(): void { repCost: 1.25e4, moneyCost: 1.375e9, info: - "A powered exoskeleton suit designed as armor for Bladeburner units. This " + + `A powered exoskeleton suit designed as armor for ${BladeburnersFactionName} units. This ` + "exoskeleton is incredibly adaptable and can protect the wearer from blunt, piercing, " + "concussive, thermal, chemical, and electric trauma. It also enhances the user's " + "physical abilities.", @@ -2046,7 +2100,7 @@ function initAugmentations(): void { } // Special CotMG Augmentations - const ChurchOfTheMachineGodFactionName = "Church of the Machine God"; + const ChurchOfTheMachineGodFactionName = FactionNames.ChurchOfTheMachineGod; if (factionExists(ChurchOfTheMachineGodFactionName)) { const StaneksGift1 = new Augmentation({ name: AugmentationNames.StaneksGift1, @@ -2262,9 +2316,9 @@ function installAugmentations(): boolean { Player.queuedAugmentations = []; dialogBoxCreate( "You slowly drift to sleep as scientists put you under in order " + - "to install the following Augmentations:
" + - augmentationList + - "
You wake up in your home...you feel different...", + "to install the following Augmentations:
" + + augmentationList + + "
You wake up in your home...you feel different...", ); prestigeAugmentation(); return true; diff --git a/src/BitNode/BitNode.tsx b/src/BitNode/BitNode.tsx index dfd815b9d..b4a7e515d 100644 --- a/src/BitNode/BitNode.tsx +++ b/src/BitNode/BitNode.tsx @@ -2,6 +2,8 @@ import React from "react"; import { BitNodeMultipliers } from "./BitNodeMultipliers"; import { IPlayer } from "../PersonObjects/IPlayer"; import { IMap } from "../types"; +import { FactionNames } from "../Faction/data/FactionNames"; +import { CityName } from "../Locations/data/CityNames"; class BitNode { // A short description, or tagline, about the BitNode @@ -80,8 +82,7 @@ BitNodes["BitNode2"] = new BitNode(
The amount of money gained from crimes and Infiltration is tripled
- Certain Factions (Slum Snakes, Tetrads, The Syndicate, The Dark Army, Speakers for the Dead, NiteSec, The Black - Hand) give the player the ability to form and manage their own gangs. These gangs will earn the player money and + Certain Factions ({FactionNames.SlumSnakes}, {FactionNames.Tetrads}, {FactionNames.TheSyndicate}, {FactionNames.TheDarkArmy}, {FactionNames.SpeakersForTheDead}, {FactionNames.NiteSec}, {FactionNames.TheBlackHand}) 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
Every Augmentation in the game will be available through the Factions listed above @@ -220,18 +221,18 @@ BitNodes["BitNode5"] = new BitNode( BitNodes["BitNode6"] = new BitNode( 6, 1, - "Bladeburners", + FactionNames.Bladeburners, "Like Tears in Rain", ( <> - In the middle of the 21st century, OmniTek Incorporated began designing and manufacturing advanced synthetic + In the middle of the 21st century, {FactionNames.OmniTekIncorporated} began designing and manufacturing advanced 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 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.

- In this BitNode you will be able to access the Bladeburner Division at the NSA, which provides a new mechanic for + In this BitNode you will be able to access the {FactionNames.Bladeburners} Division at the NSA, which provides a new mechanic for progression. Furthermore:

@@ -249,7 +250,7 @@ BitNodes["BitNode6"] = new BitNode(

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 Bladeburner Division in other + level up to a maximum of 3. This Source-File allows you to access the NSA's {FactionNames.Bladeburners} Division in other BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your combat stats by:
@@ -265,23 +266,23 @@ BitNodes["BitNode6"] = new BitNode( BitNodes["BitNode7"] = new BitNode( 7, 2, - "Bladeburners 2079", + `${FactionNames.Bladeburners} 2079`, "More human than humans", ( <> - In the middle of the 21st century, you were doing cutting-edge work at OmniTek Incorporated as part of the AI + In the middle of the 21st century, you were doing cutting-edge work at {FactionNames.OmniTekIncorporated} as part 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 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.

- In this BitNode you will be able to access the Bladeburner API, which allows you to access Bladeburner + In this BitNode you will be able to access the {FactionNames.Bladeburners} API, which allows you to access {FactionNames.Bladeburners} functionality through Netscript. Furthermore:

- The rank you gain from Bladeburner contracts/operations is reduced by 40% + The rank you gain from {FactionNames.Bladeburners} contracts/operations is reduced by 40%
- Bladeburner skills cost twice as many skill points + {FactionNames.Bladeburners} skills cost twice as many skill points
Augmentations are 3x more expensive
@@ -299,8 +300,8 @@ BitNodes["BitNode7"] = new BitNode(

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 Bladeburner Netscript API in other BitNodes. - In addition, this Source-File will increase all of your Bladeburner multipliers by: + level up to a maximum of 3. This Source-File allows you to access the {FactionNames.Bladeburners} Netscript API in other BitNodes. + In addition, this Source-File will increase all of your {FactionNames.Bladeburners} multipliers by:

Level 1: 8% @@ -363,9 +364,9 @@ BitNodes["BitNode9"] = new BitNode( "Hacknet Unleashed", ( <> - When Fulcrum Technologies released their open-source Linux distro Chapeau, it quickly became the OS of choice for + When {FactionNames.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 Hacknet, a global, - decentralized network used for nefarious purposes. Fulcrum quickly abandoned the project and dissociated + decentralized network used for nefarious purposes. {FactionNames.FulcrumSecretTechnologies} quickly abandoned the project and dissociated themselves from it.

@@ -537,12 +538,12 @@ BitNodes["BitNode13"] = new BitNode( "1 step back, 2 steps forward", ( <> - With the invention of Augmentations in the 2040s a religious group known as the Church of the Machine God has + 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.

Their leader, Allison "Mother" Stanek is said to have created her own Augmentation whose power goes beyond any - other. Find her in Chongqing and gain her trust. + other. Find her in {CityName.Chongqing} and gain her trust.

In this BitNode: @@ -554,7 +555,7 @@ BitNodes["BitNode13"] = new BitNode(

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 Church of the Machine God appear in other BitNodes. + level up to a maximum of 3. This Source-File lets the {FactionNames.ChurchOfTheMachineGod} appear in other BitNodes.

Each level of this Source-File increases the size of Stanek's Gift. diff --git a/src/Bladeburner/BlackOperations.tsx b/src/Bladeburner/BlackOperations.tsx index 540052ec7..588543c23 100644 --- a/src/Bladeburner/BlackOperations.tsx +++ b/src/Bladeburner/BlackOperations.tsx @@ -1,11 +1,12 @@ import { BlackOperation } from "./BlackOperation"; import { IMap } from "../types"; +import { BlackOperationNames } from "./data/BlackOperationNames"; export const BlackOperations: IMap = {}; (function () { - BlackOperations["Operation Typhoon"] = new BlackOperation({ - name: "Operation Typhoon", + BlackOperations[BlackOperationNames.OperationTyphoon] = new BlackOperation({ + name: BlackOperationNames.OperationTyphoon, baseDifficulty: 2000, reqdRank: 2.5e3, rankGain: 50, @@ -31,8 +32,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation Zero"] = new BlackOperation({ - name: "Operation Zero", + BlackOperations[BlackOperationNames.OperationZero] = new BlackOperation({ + name: BlackOperationNames.OperationZero, baseDifficulty: 2500, reqdRank: 5e3, rankGain: 60, @@ -58,8 +59,8 @@ export const BlackOperations: IMap = {}; }, isStealth: true, }); - BlackOperations["Operation X"] = new BlackOperation({ - name: "Operation X", + BlackOperations[BlackOperationNames.OperationX] = new BlackOperation({ + name: BlackOperationNames.OperationX, baseDifficulty: 3000, reqdRank: 7.5e3, rankGain: 75, @@ -85,8 +86,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation Titan"] = new BlackOperation({ - name: "Operation Titan", + BlackOperations[BlackOperationNames.OperationTitan] = new BlackOperation({ + name: BlackOperationNames.OperationTitan, baseDifficulty: 4000, reqdRank: 10e3, rankGain: 100, @@ -112,8 +113,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation Ares"] = new BlackOperation({ - name: "Operation Ares", + BlackOperations[BlackOperationNames.OperationAres] = new BlackOperation({ + name: BlackOperationNames.OperationAres, baseDifficulty: 5000, reqdRank: 12.5e3, rankGain: 125, @@ -139,8 +140,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation Archangel"] = new BlackOperation({ - name: "Operation Archangel", + BlackOperations[BlackOperationNames.OperationArchangel] = new BlackOperation({ + name: BlackOperationNames.OperationArchangel, baseDifficulty: 7500, reqdRank: 15e3, rankGain: 200, @@ -166,8 +167,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation Juggernaut"] = new BlackOperation({ - name: "Operation Juggernaut", + BlackOperations[BlackOperationNames.OperationJuggernaut] = new BlackOperation({ + name: BlackOperationNames.OperationJuggernaut, baseDifficulty: 10e3, reqdRank: 20e3, rankGain: 300, @@ -193,8 +194,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation Red Dragon"] = new BlackOperation({ - name: "Operation Red Dragon", + BlackOperations[BlackOperationNames.OperationRedDragon] = new BlackOperation({ + name: BlackOperationNames.OperationRedDragon, baseDifficulty: 12.5e3, reqdRank: 25e3, rankGain: 500, @@ -220,8 +221,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation K"] = new BlackOperation({ - name: "Operation K", + BlackOperations[BlackOperationNames.OperationK] = new BlackOperation({ + name: BlackOperationNames.OperationK, baseDifficulty: 15e3, reqdRank: 30e3, rankGain: 750, @@ -247,8 +248,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation Deckard"] = new BlackOperation({ - name: "Operation Deckard", + BlackOperations[BlackOperationNames.OperationDeckard] = new BlackOperation({ + name: BlackOperationNames.OperationDeckard, baseDifficulty: 20e3, reqdRank: 40e3, rankGain: 1e3, @@ -274,8 +275,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation Tyrell"] = new BlackOperation({ - name: "Operation Tyrell", + BlackOperations[BlackOperationNames.OperationTyrell] = new BlackOperation({ + name: BlackOperationNames.OperationTyrell, baseDifficulty: 25e3, reqdRank: 50e3, rankGain: 1.5e3, @@ -301,8 +302,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation Wallace"] = new BlackOperation({ - name: "Operation Wallace", + BlackOperations[BlackOperationNames.OperationWallace] = new BlackOperation({ + name: BlackOperationNames.OperationWallace, baseDifficulty: 30e3, reqdRank: 75e3, rankGain: 2e3, @@ -328,8 +329,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation Shoulder of Orion"] = new BlackOperation({ - name: "Operation Shoulder of Orion", + BlackOperations[BlackOperationNames.OperationShoulderOfOrion] = new BlackOperation({ + name: BlackOperationNames.OperationShoulderOfOrion, baseDifficulty: 35e3, reqdRank: 100e3, rankGain: 2.5e3, @@ -355,8 +356,8 @@ export const BlackOperations: IMap = {}; }, isStealth: true, }); - BlackOperations["Operation Hyron"] = new BlackOperation({ - name: "Operation Hyron", + BlackOperations[BlackOperationNames.OperationHyron] = new BlackOperation({ + name: BlackOperationNames.OperationHyron, baseDifficulty: 40e3, reqdRank: 125e3, rankGain: 3e3, @@ -382,8 +383,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation Morpheus"] = new BlackOperation({ - name: "Operation Morpheus", + BlackOperations[BlackOperationNames.OperationMorpheus] = new BlackOperation({ + name: BlackOperationNames.OperationMorpheus, baseDifficulty: 45e3, reqdRank: 150e3, rankGain: 4e3, @@ -409,8 +410,8 @@ export const BlackOperations: IMap = {}; }, isStealth: true, }); - BlackOperations["Operation Ion Storm"] = new BlackOperation({ - name: "Operation Ion Storm", + BlackOperations[BlackOperationNames.OperationIonStorm] = new BlackOperation({ + name: BlackOperationNames.OperationIonStorm, baseDifficulty: 50e3, reqdRank: 175e3, rankGain: 5e3, @@ -436,8 +437,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation Annihilus"] = new BlackOperation({ - name: "Operation Annihilus", + BlackOperations[BlackOperationNames.OperationAnnihilus] = new BlackOperation({ + name: BlackOperationNames.OperationAnnihilus, baseDifficulty: 55e3, reqdRank: 200e3, rankGain: 7.5e3, @@ -463,8 +464,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation Ultron"] = new BlackOperation({ - name: "Operation Ultron", + BlackOperations[BlackOperationNames.OperationUltron] = new BlackOperation({ + name: BlackOperationNames.OperationUltron, baseDifficulty: 60e3, reqdRank: 250e3, rankGain: 10e3, @@ -490,8 +491,8 @@ export const BlackOperations: IMap = {}; }, isKill: true, }); - BlackOperations["Operation Centurion"] = new BlackOperation({ - name: "Operation Centurion", + BlackOperations[BlackOperationNames.OperationCenturion] = new BlackOperation({ + name: BlackOperationNames.OperationCenturion, baseDifficulty: 70e3, reqdRank: 300e3, rankGain: 15e3, @@ -516,8 +517,8 @@ export const BlackOperations: IMap = {}; int: 0.75, }, }); - BlackOperations["Operation Vindictus"] = new BlackOperation({ - name: "Operation Vindictus", + BlackOperations[BlackOperationNames.OperationVindictus] = new BlackOperation({ + name: BlackOperationNames.OperationVindictus, baseDifficulty: 75e3, reqdRank: 350e3, rankGain: 20e3, @@ -542,8 +543,8 @@ export const BlackOperations: IMap = {}; int: 0.75, }, }); - BlackOperations["Operation Daedalus"] = new BlackOperation({ - name: "Operation Daedalus", + BlackOperations[BlackOperationNames.OperationDaedalus] = new BlackOperation({ + name: BlackOperationNames.OperationDaedalus, baseDifficulty: 80e3, reqdRank: 400e3, rankGain: 40e3, diff --git a/src/Bladeburner/Bladeburner.tsx b/src/Bladeburner/Bladeburner.tsx index 7f4d99936..f9b1e9524 100644 --- a/src/Bladeburner/Bladeburner.tsx +++ b/src/Bladeburner/Bladeburner.tsx @@ -33,6 +33,8 @@ import { AugmentationNames } from "../Augmentation/data/AugmentationNames"; import { getTimestamp } from "../utils/helpers/getTimestamp"; import { joinFaction } from "../Faction/FactionHelpers"; import { WorkerScript } from "../Netscript/WorkerScript"; +import { FactionNames } from "../Faction/data/FactionNames"; +import { BlackOperationNames } from "./data/BlackOperationNames"; interface BlackOpsAttempt { error?: string; @@ -229,7 +231,6 @@ export class Bladeburner implements IBladeburner { break; default: throw new Error("Invalid Action Type in startAction(Bladeburner,player, ): " + actionId.type); - break; } } @@ -291,7 +292,7 @@ export class Bladeburner implements IBladeburner { prestige(): void { this.resetAction(); - const bladeburnerFac = Factions["Bladeburners"]; + const bladeburnerFac = Factions[FactionNames.Bladeburners]; if (this.rank >= BladeburnerConstants.RankNeededForFaction) { joinFaction(bladeburnerFac); } @@ -320,7 +321,6 @@ export class Bladeburner implements IBladeburner { } else { return null; } - break; case "operation": case "operations": case "op": @@ -332,7 +332,6 @@ export class Bladeburner implements IBladeburner { } else { return null; } - break; case "blackoperation": case "black operation": case "black operations": @@ -347,7 +346,6 @@ export class Bladeburner implements IBladeburner { } else { return null; } - break; case "general": case "general action": case "gen": @@ -672,15 +670,15 @@ export class Bladeburner implements IBladeburner { this.postToConsole("Automation: " + (this.automateEnabled ? "enabled" : "disabled")); this.postToConsole( "When your stamina drops to " + - formatNumber(this.automateThreshLow, 0) + - ", you will automatically switch to " + - this.automateActionLow.name + - ". When your stamina recovers to " + - formatNumber(this.automateThreshHigh, 0) + - ", you will automatically " + - "switch to " + - this.automateActionHigh.name + - ".", + formatNumber(this.automateThreshLow, 0) + + ", you will automatically switch to " + + this.automateActionLow.name + + ". When your stamina recovers to " + + formatNumber(this.automateThreshHigh, 0) + + ", you will automatically " + + "switch to " + + this.automateActionHigh.name + + ".", ); } else if (flag.toLowerCase().includes("en")) { if ( @@ -975,8 +973,8 @@ export class Bladeburner implements IBladeburner { if (this.logging.events) { this.log( "Intelligence indicates that a large number of Synthoids migrated from " + - sourceCityName + - " to some other city", + sourceCityName + + " to some other city", ); } } else if (chance <= 0.7) { @@ -1291,10 +1289,10 @@ export class Bladeburner implements IBladeburner { } else if (!isOperation && this.logging.contracts) { this.log( action.name + - " contract successfully completed! Gained " + - formatNumber(gain, 3) + - " rank and " + - numeralWrapper.formatMoney(moneyGain), + " contract successfully completed! Gained " + + formatNumber(gain, 3) + + " rank and " + + numeralWrapper.formatMoney(moneyGain), ); } } @@ -1375,7 +1373,7 @@ export class Bladeburner implements IBladeburner { teamLossMax = Math.ceil(teamCount / 2); // Operation Daedalus - if (action.name === "Operation Daedalus") { + if (action.name === BlackOperationNames.OperationDaedalus) { this.resetAction(); return router.toBitVerse(false, false); } @@ -1405,11 +1403,11 @@ export class Bladeburner implements IBladeburner { if (this.logging.blackops) { this.log( action.name + - " failed! Lost " + - formatNumber(rankLoss, 1) + - " rank and took " + - formatNumber(damage, 0) + - " damage", + " failed! Lost " + + formatNumber(rankLoss, 1) + + " rank and took " + + formatNumber(damage, 0) + + " damage", ); } } @@ -1445,16 +1443,16 @@ export class Bladeburner implements IBladeburner { if (this.logging.general) { this.log( "Training completed. Gained: " + - formatNumber(strExpGain, 1) + - " str exp, " + - formatNumber(defExpGain, 1) + - " def exp, " + - formatNumber(dexExpGain, 1) + - " dex exp, " + - formatNumber(agiExpGain, 1) + - " agi exp, " + - formatNumber(staminaGain, 3) + - " max stamina", + formatNumber(strExpGain, 1) + + " str exp, " + + formatNumber(defExpGain, 1) + + " def exp, " + + formatNumber(dexExpGain, 1) + + " dex exp, " + + formatNumber(agiExpGain, 1) + + " agi exp, " + + formatNumber(staminaGain, 3) + + " max stamina", ); } this.startAction(player, this.action); // Repeat action @@ -1481,10 +1479,10 @@ export class Bladeburner implements IBladeburner { if (this.logging.general) { this.log( "Field analysis completed. Gained 0.1 rank, " + - formatNumber(hackingExpGain, 1) + - " hacking exp, and " + - formatNumber(charismaExpGain, 1) + - " charisma exp", + formatNumber(hackingExpGain, 1) + + " hacking exp, and " + + formatNumber(charismaExpGain, 1) + + " charisma exp", ); } this.startAction(player, this.action); // Repeat action @@ -1531,8 +1529,7 @@ export class Bladeburner implements IBladeburner { this.startAction(player, this.action); if (this.logging.general) { this.log( - `Rested in Hyperbolic Regeneration Chamber. Restored ${ - BladeburnerConstants.HrcHpGain + `Rested in Hyperbolic Regeneration Chamber. Restored ${BladeburnerConstants.HrcHpGain } HP and gained ${numeralWrapper.formatStamina(staminaGain)} stamina`, ); } @@ -1577,11 +1574,11 @@ export class Bladeburner implements IBladeburner { } this.maxRank = Math.max(this.rank, this.maxRank); - const bladeburnersFactionName = "Bladeburners"; + const bladeburnersFactionName = FactionNames.Bladeburners; if (factionExists(bladeburnersFactionName)) { const bladeburnerFac = Factions[bladeburnersFactionName]; if (!(bladeburnerFac instanceof Faction)) { - throw new Error("Could not properly get Bladeburner Faction object in Bladeburner UI Overview Faction button"); + throw new Error(`Could not properly get ${FactionNames.Bladeburners} Faction object in ${FactionNames.Bladeburners} UI Overview Faction button`); } if (bladeburnerFac.isMember) { const favorBonus = 1 + bladeburnerFac.favor / 100; @@ -1918,7 +1915,7 @@ export class Bladeburner implements IBladeburner { if (!router.isInitialized) return; // Edge case condition...if Operation Daedalus is complete trigger the BitNode - if (router.page() !== Page.BitVerse && this.blackops.hasOwnProperty("Operation Daedalus")) { + if (router.page() !== Page.BitVerse && this.blackops.hasOwnProperty(BlackOperationNames.OperationDaedalus)) { return router.toBitVerse(false, false); } @@ -2340,12 +2337,12 @@ export class Bladeburner implements IBladeburner { } joinBladeburnerFactionNetscriptFn(workerScript: WorkerScript): boolean { - const bladeburnerFac = Factions["Bladeburners"]; + const bladeburnerFac = Factions[FactionNames.Bladeburners]; if (bladeburnerFac.isMember) { return true; } else if (this.rank >= BladeburnerConstants.RankNeededForFaction) { joinFaction(bladeburnerFac); - workerScript.log("bladeburner.joinBladeburnerFaction", () => "Joined Bladeburners faction."); + workerScript.log("bladeburner.joinBladeburnerFaction", () => `Joined ${FactionNames.Bladeburners} faction.`); return true; } else { workerScript.log( diff --git a/src/Bladeburner/data/BlackOperationNames.ts b/src/Bladeburner/data/BlackOperationNames.ts new file mode 100644 index 000000000..893bc7114 --- /dev/null +++ b/src/Bladeburner/data/BlackOperationNames.ts @@ -0,0 +1,23 @@ +export enum BlackOperationNames { + OperationTyphoon = "Operation Typhoon", + OperationZero = "Operation Zero", + OperationX = "Operation X", + OperationTitan = "Operation Titan", + OperationAres = "Operation Ares", + OperationArchangel = "Operation Archangel", + OperationJuggernaut = "Operation Juggernaut", + OperationRedDragon = "Operation Red Dragon", + OperationK = "Operation K", + OperationDeckard = "Operation Deckard", + OperationTyrell = "Operation Tyrell", + OperationWallace = "Operation Wallace", + OperationShoulderOfOrion = "Operation Shoulder of Orion", + OperationHyron = "Operation Hyron", + OperationMorpheus = "Operation Morpheus", + OperationIonStorm = "Operation Ion Storm", + OperationAnnihilus = "Operation Annihilus", + OperationUltron = "Operation Ultron", + OperationCenturion = "Operation Centurion", + OperationVindictus = "Operation Vindictus", + OperationDaedalus = "Operation Daedalus", +} diff --git a/src/Bladeburner/data/BlackOperations.tsx b/src/Bladeburner/data/BlackOperations.tsx index c15d90b8b..a156c92aa 100644 --- a/src/Bladeburner/data/BlackOperations.tsx +++ b/src/Bladeburner/data/BlackOperations.tsx @@ -1,4 +1,7 @@ import React from "react"; +import { FactionNames } from "../../Faction/data/FactionNames"; +import { CityName } from "../../Locations/data/CityNames"; +import { BlackOperationNames } from "./BlackOperationNames"; interface IBlackOp { desc: JSX.Element; @@ -7,34 +10,34 @@ interface IBlackOp { export const BlackOperations: { [key: string]: IBlackOp | undefined; } = { - "Operation Typhoon": { + [BlackOperationNames.OperationTyphoon]: { desc: ( <> 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.

- The goal of Operation Typhoon is to find and eliminate Zenyatta and RedWater by any means necessary. After the + The goal of {BlackOperationNames.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. ), }, - "Operation Zero": { + [BlackOperationNames.OperationZero]: { desc: ( <> 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.

- The goal of Operation Zero is to covertly infiltrate AeroCorp and uncover any incriminating evidence or + The goal of {BlackOperationNames.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. Incriminating evidence can be fabricated as a last resort. Be warned that AeroCorp has some of the most advanced security measures in the world. ), }, - "Operation X": { + [BlackOperationNames.OperationX]: { desc: ( <> We have recently discovered an underground publication group called Samizdat. Even though most of their @@ -44,12 +47,12 @@ export const BlackOperations: {

Samizdat has done a good job of keeping hidden and anonymous. However, we've just received intelligence that - their base of operations is in Ishima's underground sewer systems. Your task is to investigate the sewer + their base of operations is in {CityName.Ishima}'s underground sewer systems. Your task is to investigate the sewer systems, and eliminate Samizdat. They must never publish anything again. ), }, - "Operation Titan": { + [BlackOperationNames.OperationTitan]: { desc: ( <> Several months ago Titan Laboratories' Bioengineering department was infiltrated by Synthoids. As far as we @@ -58,13 +61,13 @@ export const BlackOperations: { dangerous.

- Your goal is to enter and destroy the Bioengineering department's facility in Aevum. The task is not just to + Your goal is to enter and destroy the Bioengineering department's facility in {CityName.Aevum}. The task is not just to retire the Synthoids there, but also to destroy any information or research at the facility that is relevant to the Synthoids and their goals. ), }, - "Operation Ares": { + [BlackOperationNames.OperationAres]: { desc: ( <> One of our undercover agents, Agent Carter, has informed us of a massive weapons deal going down in Dubai @@ -76,7 +79,7 @@ export const BlackOperations: { ), }, - "Operation Archangel": { + [BlackOperationNames.OperationArchangel]: { desc: ( <> Our analysts have discovered that the popular Red Rabbit brothel in Amsterdam is run and 'staffed' by MK-VI @@ -89,11 +92,11 @@ export const BlackOperations: { ), }, - "Operation Juggernaut": { + [BlackOperationNames.OperationJuggernaut]: { desc: ( <> The CIA has just encountered a new security threat. A new criminal group, lead by a shadowy operative who calls - himself Juggernaut, has been smuggling drugs and weapons (including suspected bioweapons) into Sector-12. We + himself Juggernaut, has been smuggling drugs and weapons (including suspected bioweapons) into {CityName.Sector12}. We also have reason to believe they tried to break into one of Universal Energy's facilities in order to cause a city-wide blackout. The CIA suspects that Juggernaut is a heavily-augmented Synthoid, and have thus enlisted our help. @@ -103,20 +106,20 @@ export const BlackOperations: { ), }, - "Operation Red Dragon": { + [BlackOperationNames.OperationRedDragon]: { desc: ( <> - The Tetrads criminal organization is suspected of reverse-engineering the MK-VI Synthoid design. We believe they + The {FactionNames.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 order to bolster their criminal activities.

- Your task is to infiltrate and destroy the Tetrads' base of operations in Los Angeles. Intelligence tells us + Your task is to infiltrate and destroy the {FactionNames.Tetrads}' base of operations in Los Angeles. Intelligence tells us that their base houses one of their Synthoid manufacturing units. ), }, - "Operation K": { + [BlackOperationNames.OperationK]: { desc: ( <> CODE RED SITUATION. Our intelligence tells us that VitaLife has discovered a new android cloning technology. @@ -132,49 +135,49 @@ export const BlackOperations: { ), }, - "Operation Deckard": { + [BlackOperationNames.OperationDeckard]: { desc: ( <> - Despite your success in eliminating VitaLife's new android-replicating technology in Operation K, we've + 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 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.

- The goal of Operation Deckard is to hunt down these Synthoids and retire them. I don't need to tell you how + The goal of {BlackOperationNames.OperationDeckard} is to hunt down these Synthoids and retire them. I don't need to tell you how critical this mission is. ), }, - "Operation Tyrell": { + [BlackOperationNames.OperationTyrell]: { desc: ( <> - A week ago Blade Industries reported a small break-in at one of their Aevum Augmentation storage facilities. We - figured out that The Dark Army was behind the heist, and didn't think any more of it. However, we've just + A week ago {FactionNames.BladeIndustries} reported a small break-in at one of their {CityName.Aevum} Augmentation storage facilities. We + figured out that {FactionNames.TheDarkArmy} was behind the heist, and didn't think any more of it. However, we've just discovered that several known MK-VI Synthoids were part of that break-in group.

We cannot have Synthoids upgrading their already-enhanced abilities with Augmentations. Your task is to hunt - down the associated Dark Army members and eliminate them. + down associated {FactionNames.TheDarkArmy} members and eliminate them. ), }, - "Operation Wallace": { + [BlackOperationNames.OperationWallace]: { desc: ( <> - Based on information gathered from Operation Tyrell, we've discovered that The Dark Army was well aware that - there were Synthoids amongst their ranks. Even worse, we believe that The Dark Army is working together with - other criminal organizations such as The Syndicate and that they are planning some sort of large-scale takeover - of multiple major cities, most notably Aevum. We suspect that Synthoids have infiltrated the ranks of these + Based on information gathered from {BlackOperationNames.OperationTyrell}, we've discovered that {FactionNames.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 {FactionNames.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 factions and are trying to stage another Synthoid uprising.

- The best way to deal with this is to prevent it before it even happens. The goal of Operation Wallace is to - destroy the Dark Army and Syndicate factions in Aevum immediately. Leave no survivors. + 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 {CityName.Aevum} immediately. Leave no survivors. ), }, - "Operation Shoulder of Orion": { + [BlackOperationNames.OperationShoulderOfOrion]: { desc: ( <> China's Solaris Space Systems is secretly launching the first manned spacecraft in over a decade using @@ -187,10 +190,10 @@ export const BlackOperations: { ), }, - "Operation Hyron": { + [BlackOperationNames.OperationHyron]: { desc: ( <> - Our intelligence tells us that Fulcrum Technologies is developing a quantum supercomputer using human brains as + Our intelligence tells us that {FactionNames.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 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. @@ -199,18 +202,18 @@ export const BlackOperations: { I do not need to remind you why sentient-level AIs pose a serious threat to all of mankind.

- The research for this project is being conducted at one of Fulcrum Technologies secret facilities in Aevum, + The research for this project is being conducted at one of {FactionNames.FulcrumSecretTechnologies} secret facilities in {CityName.Aevum}, codenamed 'Alpha Ranch'. Infiltrate the compound, delete and destroy the work, and then find and kill the project lead. ), }, - "Operation Morpheus": { + [BlackOperationNames.OperationMorpheus]: { desc: ( <> DreamSense Technologies is an advertising company that uses special technology to transmit their ads into the people's dreams and subconcious. They do this using broadcast transmitter towers. Based on information from our - agents and informants in Chonqging, we have reason to believe that one of the broadcast towers there has been + agents and informants in {CityName.Chongqing}, we have reason to believe that one of the broadcast towers there has been compromised by Synthoids and is being used to spread pro-Synthoid propaganda.

@@ -218,38 +221,38 @@ export const BlackOperations: { ), }, - "Operation Ion Storm": { + [BlackOperationNames.OperationIonStorm]: { desc: ( <> - Our analysts have uncovered a gathering of MK-VI Synthoids that have taken up residence in the Sector-12 Slums. + Our analysts have uncovered a gathering of MK-VI Synthoids that have taken up residence in the {CityName.Sector12} Slums. We don't know if they are rogue Synthoids from the Uprising, but we do know that they have been stockpiling weapons, money, and other resources. This makes them dangerous.

- This is a full-scale assault operation to find and retire all of these Synthoids in the Sector-12 Slums. + This is a full-scale assault operation to find and retire all of these Synthoids in the {CityName.Sector12} Slums. ), }, - "Operation Annihilus": { + [BlackOperationNames.OperationAnnihilus]: { desc: ( <> - Our superiors have ordered us to eradicate everything and everyone in an underground facility located in Aevum. + 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 organization called - 'The Covenant'. We have no prior intelligence about this organization, so you are going in blind. + '{FactionNames.TheCovenant}'. We have no prior intelligence about this organization, so you are going in blind. ), }, - "Operation Ultron": { + [BlackOperationNames.OperationUltron]: { desc: ( <> - OmniTek Incorporated, the original designer and manufacturer of Synthoids, has notified us of a malfunction in + {FactionNames.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 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.

- OmniTek has also told us they 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 Volhaven to form a terrorist group + {FactionNames.OmniTekIncorporated} has also told us they 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 {CityName.Volhaven} to form a terrorist group called Ultron.

@@ -261,7 +264,7 @@ export const BlackOperations: { ), }, - "Operation Centurion": { + [BlackOperationNames.OperationCenturion]: { desc: ( <> {"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)"} @@ -279,7 +282,7 @@ export const BlackOperations: { ), }, - "Operation Vindictus": { + [BlackOperationNames.OperationVindictus]: { desc: ( <> {"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)"} @@ -293,7 +296,7 @@ export const BlackOperations: { ), }, - "Operation Daedalus": { + [BlackOperationNames.OperationDaedalus]: { desc: <> Yesterday we obeyed kings and bent our neck to emperors. Today we kneel only to truth., }, }; diff --git a/src/Bladeburner/data/Constants.ts b/src/Bladeburner/data/Constants.ts index 6fbd2b38f..0ad20e2f8 100644 --- a/src/Bladeburner/data/Constants.ts +++ b/src/Bladeburner/data/Constants.ts @@ -1,3 +1,4 @@ +import { CityName } from './../../Locations/data/CityNames'; export const BladeburnerConstants: { CityNames: string[]; CyclesPerSecond: number; @@ -27,7 +28,7 @@ export const BladeburnerConstants: { HrcHpGain: number; HrcStaminaGain: number; } = { - CityNames: ["Aevum", "Chongqing", "Sector-12", "New Tokyo", "Ishima", "Volhaven"], + CityNames: [CityName.Aevum, CityName.Chongqing, CityName.Sector12, CityName.NewTokyo, CityName.Ishima, CityName.Volhaven], CyclesPerSecond: 5, // Game cycle is 200 ms StaminaGainPerSecond: 0.0085, diff --git a/src/Bladeburner/ui/BlackOpPage.tsx b/src/Bladeburner/ui/BlackOpPage.tsx index 1900951d2..6932aa9f4 100644 --- a/src/Bladeburner/ui/BlackOpPage.tsx +++ b/src/Bladeburner/ui/BlackOpPage.tsx @@ -3,6 +3,7 @@ import { BlackOpList } from "./BlackOpList"; import { IBladeburner } from "../IBladeburner"; import { IPlayer } from "../../PersonObjects/IPlayer"; import Typography from "@mui/material/Typography"; +import { FactionNames } from "../../Faction/data/FactionNames"; interface IProps { bladeburner: IBladeburner; @@ -17,7 +18,7 @@ export function BlackOpPage(props: IProps): React.ReactElement { successively by completing the one before it.

- Your ultimate goal to climb through the ranks of Bladeburners is to complete all of the Black Ops. + Your ultimate goal to climb through the ranks of {FactionNames.Bladeburners} is to complete all of the Black Ops.

Like normal operations, you may use a team for Black Ops. Failing a black op will incur heavy HP and rank diff --git a/src/Bladeburner/ui/BladeburnerCinematic.tsx b/src/Bladeburner/ui/BladeburnerCinematic.tsx index 93a612d0c..c00b3810a 100644 --- a/src/Bladeburner/ui/BladeburnerCinematic.tsx +++ b/src/Bladeburner/ui/BladeburnerCinematic.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { FactionNames } from "../../Faction/data/FactionNames"; import { use } from "../../ui/Context"; import { CinematicText } from "../../ui/React/CinematicText"; import { dialogBoxCreate } from "../../ui/React/DialogBox"; @@ -8,14 +9,14 @@ export function BladeburnerCinematic(): React.ReactElement { return ( { router.toTerminal(); dialogBoxCreate( - "Visit the National Security Agency (NSA) to apply for their Bladeburner " + - "division! You will need 100 of each combat stat before doing this.", + `Visit the National Security Agency (NSA) to apply for their ${FactionNames.Bladeburners} ` + + "division! You will need 100 of each combat stat before doing this.", ); }} /> diff --git a/src/Bladeburner/ui/Stats.tsx b/src/Bladeburner/ui/Stats.tsx index 0400f8cb5..d1b0cc2b4 100644 --- a/src/Bladeburner/ui/Stats.tsx +++ b/src/Bladeburner/ui/Stats.tsx @@ -15,6 +15,7 @@ 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 { bladeburner: IBladeburner; @@ -34,7 +35,7 @@ export function Stats(props: IProps): React.ReactElement { function openFaction(): void { if (!inFaction) return; - const faction = Factions["Bladeburners"]; + const faction = Factions[FactionNames.Bladeburners]; if (!faction.isMember) { joinFaction(faction); } diff --git a/src/Corporation/data/Constants.ts b/src/Corporation/data/Constants.ts index b20b03de7..4a9f3f95d 100644 --- a/src/Corporation/data/Constants.ts +++ b/src/Corporation/data/Constants.ts @@ -1,3 +1,4 @@ +import { CityName } from './../../Locations/data/CityNames'; const CyclesPerMarketCycle = 50; const AllCorporationStates = ["START", "PURCHASE", "PRODUCTION", "SALE", "EXPORT"]; export const CorporationConstants: { @@ -37,7 +38,7 @@ export const CorporationConstants: { CyclesPerIndustryStateCycle: CyclesPerMarketCycle / AllCorporationStates.length, SecsPerMarketCycle: CyclesPerMarketCycle / 5, - Cities: ["Aevum", "Chongqing", "Sector-12", "New Tokyo", "Ishima", "Volhaven"], + Cities: [CityName.Aevum, CityName.Chongqing, CityName.Sector12, CityName.NewTokyo, CityName.Ishima, CityName.Volhaven], WarehouseInitialCost: 5e9, //Initial purchase cost of warehouse WarehouseInitialSize: 100, diff --git a/src/CotMG/StaneksGift.ts b/src/CotMG/StaneksGift.ts index 0913130a8..2b9e1e1ef 100644 --- a/src/CotMG/StaneksGift.ts +++ b/src/CotMG/StaneksGift.ts @@ -1,3 +1,4 @@ +import { FactionNames } from '../Faction/data/FactionNames'; import { Fragment } from "./Fragment"; import { ActiveFragment } from "./ActiveFragment"; import { FragmentType } from "./FragmentType"; @@ -32,7 +33,7 @@ export class StaneksGift implements IStaneksGift { af.avgCharge = (af.numCharge * af.avgCharge + threads) / (af.numCharge + 1); af.numCharge++; - const cotmg = Factions["Church of the Machine God"]; + const cotmg = Factions[FactionNames.ChurchOfTheMachineGod]; cotmg.playerReputation += (player.faction_rep_mult * (Math.pow(threads, 0.95) * (cotmg.favor + 100))) / 1000; } diff --git a/src/DevMenu/ui/Companies.tsx b/src/DevMenu/ui/Companies.tsx index 6553823e8..567f02af0 100644 --- a/src/DevMenu/ui/Companies.tsx +++ b/src/DevMenu/ui/Companies.tsx @@ -11,11 +11,12 @@ import Select, { SelectChangeEvent } from "@mui/material/Select"; import { Companies as AllCompanies } from "../../Company/Companies"; import MenuItem from "@mui/material/MenuItem"; import { Adjuster } from "./Adjuster"; +import { FactionNames } from "../../Faction/data/FactionNames"; const bigNumber = 1e12; export function Companies(): React.ReactElement { - const [company, setCompany] = useState("ECorp"); + const [company, setCompany] = useState(FactionNames.ECorp as string); function setCompanyDropdown(event: SelectChangeEvent): void { setCompany(event.target.value as string); } diff --git a/src/DevMenu/ui/Factions.tsx b/src/DevMenu/ui/Factions.tsx index 8cdc85e9f..6e227e6c8 100644 --- a/src/DevMenu/ui/Factions.tsx +++ b/src/DevMenu/ui/Factions.tsx @@ -17,6 +17,7 @@ import IconButton from "@mui/material/IconButton"; import ReplyAllIcon from "@mui/icons-material/ReplyAll"; import ReplyIcon from "@mui/icons-material/Reply"; import InputLabel from "@mui/material/InputLabel"; +import { FactionNames } from "../../Faction/data/FactionNames"; const bigNumber = 1e12; @@ -25,7 +26,7 @@ interface IProps { } export function Factions(props: IProps): React.ReactElement { - const [faction, setFaction] = useState("Illuminati"); + const [faction, setFaction] = useState(FactionNames.Illuminati as string); function setFactionDropdown(event: SelectChangeEvent): void { setFaction(event.target.value as string); @@ -36,9 +37,7 @@ export function Factions(props: IProps): React.ReactElement { } function receiveAllInvites(): void { - for (const i of Object.keys(AllFaction)) { - props.player.receiveInvite(AllFaction[i].name); - } + Object.values(FactionNames).forEach(faction => props.player.receiveInvite(faction)) } function modifyFactionRep(modifier: number): (x: number) => void { diff --git a/src/Faction/FactionHelpers.tsx b/src/Faction/FactionHelpers.tsx index 51d72eec5..545fb68ad 100644 --- a/src/Faction/FactionHelpers.tsx +++ b/src/Faction/FactionHelpers.tsx @@ -18,42 +18,7 @@ import { SourceFileFlags } from "../SourceFile/SourceFileFlags"; import { dialogBoxCreate } from "../ui/React/DialogBox"; import { InvitationEvent } from "./ui/InvitationModal"; - -const factionOrder = [ - "CyberSec", - "Tian Di Hui", - "Netburners", - "Sector-12", - "Chongqing", - "New Tokyo", - "Ishima", - "Aevum", - "Volhaven", - "NiteSec", - "The Black Hand", - "BitRunners", - "ECorp", - "MegaCorp", - "KuaiGong International", - "Four Sigma", - "NWO", - "Blade Industries", - "OmniTek Incorporated", - "Bachman & Associates", - "Clarke Incorporated", - "Fulcrum Secret Technologies", - "Slum Snakes", - "Tetrads", - "Silhouette", - "Speakers for the Dead", - "The Dark Army", - "The Syndicate", - "The Covenant", - "Daedalus", - "Illuminati", - "Bladeburners", - "Church of the Machine God", -] +import { FactionNames } from "./data/FactionNames"; export function inviteToFaction(faction: Faction): void { Player.receiveInvite(faction.name); @@ -67,8 +32,9 @@ export function joinFaction(faction: Faction): void { if (faction.isMember) return; faction.isMember = true; Player.factions.push(faction.name); + const allFactions = Object.values(FactionNames).map(faction => faction as string) Player.factions.sort((a, b) => - factionOrder.indexOf(a) - factionOrder.indexOf(b)); + allFactions.indexOf(a) - allFactions.indexOf(b)); const factionInfo = faction.getInfo(); //Determine what factions you are banned from now that you have joined this faction @@ -166,15 +132,15 @@ export function purchaseAugmentation(aug: Augmentation, fac: Faction, sing = fal if (sing) { return "You purchased " + aug.name; } else if (!Settings.SuppressBuyAugmentationConfirmation) { - dialogBoxCreate( - "You purchased " + - aug.name + - ". Its enhancements will not take " + - "effect until they are installed. To install your augmentations, go to the " + - "'Augmentations' tab on the left-hand navigation menu. Purchasing additional " + - "augmentations will now be more expensive.", - ); - } + dialogBoxCreate( + "You purchased " + + aug.name + + ". Its enhancements will not take " + + "effect until they are installed. To install your augmentations, go to the " + + "'Augmentations' tab on the left-hand navigation menu. Purchasing additional " + + "augmentations will now be more expensive.", + ); + } } else { dialogBoxCreate( "Hmm, something went wrong when trying to purchase an Augmentation. " + diff --git a/src/Faction/FactionInfo.tsx b/src/Faction/FactionInfo.tsx index 440898727..76d7a8c64 100644 --- a/src/Faction/FactionInfo.tsx +++ b/src/Faction/FactionInfo.tsx @@ -1,5 +1,6 @@ import React from "react"; import { IMap } from "../types"; +import { FactionNames } from "./data/FactionNames"; /** * Contains the "information" property for all the Factions, which is just a description of each faction @@ -84,13 +85,15 @@ export class FactionInfo { } } + + /** * A map of all factions and associated info to them. */ // tslint:disable-next-line:variable-name export const FactionInfos: IMap = { // Endgame - Illuminati: new FactionInfo( + [FactionNames.Illuminati]: new FactionInfo( ( <> Humanity never changes. No matter how civilized society becomes, it will eventually fall back into chaos. And @@ -106,7 +109,7 @@ export const FactionInfos: IMap = { false, ), - Daedalus: new FactionInfo( + [FactionNames.Daedalus]: new FactionInfo( <>Yesterday we obeyed kings and bent our necks to emperors. Today we kneel only to truth., [], true, @@ -117,7 +120,7 @@ export const FactionInfos: IMap = { false, ), - "The Covenant": new FactionInfo( + [FactionNames.TheCovenant]: new FactionInfo( ( <> Surrender yourself. Give up your empty individuality to become part of something great, something eternal. @@ -137,11 +140,11 @@ export const FactionInfos: IMap = { ), // Megacorporations, each forms its own faction - ECorp: new FactionInfo( + [FactionNames.ECorp]: new FactionInfo( ( <> - ECorp's mission is simple: to connect the world of today with the technology of tomorrow. With our wide range of - Internet-related software and commercial hardware, ECorp makes the world's information universally accessible. + {FactionNames.ECorp}'s mission is simple: to connect the world of today with the technology of tomorrow. With our wide range of + Internet-related software and commercial hardware, {FactionNames.ECorp} makes the world's information universally accessible. ), [], @@ -153,15 +156,15 @@ export const FactionInfos: IMap = { true, ), - MegaCorp: new FactionInfo( + [FactionNames.MegaCorp]: new FactionInfo( ( <> - MegaCorp does what no other dares to do. We imagine. We create. We invent. We create what others have never even + {FactionNames.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 unprecedented scale, in ways that no other company can.

- In our labs and factories and on the ground with customers, MegaCorp is ushering in a new era for the world. + In our labs and factories and on the ground with customers, {FactionNames.MegaCorp} is ushering in a new era for the world. ), [], @@ -173,7 +176,7 @@ export const FactionInfos: IMap = { true, ), - "Bachman & Associates": new FactionInfo( + [FactionNames.BachmanAssociates]: new FactionInfo( ( <> Where Law and Business meet - thats where we are. @@ -191,9 +194,9 @@ export const FactionInfos: IMap = { true, ), - "Blade Industries": new FactionInfo(<>Augmentation is Salvation., [], true, true, true, true, false, true), + [FactionNames.BladeIndustries]: new FactionInfo(<>Augmentation is Salvation., [], true, true, true, true, false, true), - NWO: new FactionInfo( + [FactionNames.NWO]: new FactionInfo( ( <> Humans don't truly desire freedom. They want to be observed, understood, and judged. They want to be given @@ -210,7 +213,7 @@ export const FactionInfos: IMap = { true, ), - "Clarke Incorporated": new FactionInfo( + [FactionNames.ClarkeIncorporated]: new FactionInfo( <>The Power of the Genome - Unlocked., [], true, @@ -221,7 +224,7 @@ export const FactionInfos: IMap = { true, ), - "OmniTek Incorporated": new FactionInfo( + [FactionNames.OmniTekIncorporated]: new FactionInfo( <>Simply put, our mission is to design and build robots that make a difference., [], true, @@ -232,11 +235,11 @@ export const FactionInfos: IMap = { true, ), - "Four Sigma": new FactionInfo( + [FactionNames.FourSigma]: new FactionInfo( ( <> 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 Four Sigma. + deep learning and innovative ideas. And improved by iteration. That's {FactionNames.FourSigma}. ), [], @@ -248,7 +251,7 @@ export const FactionInfos: IMap = { true, ), - "KuaiGong International": new FactionInfo( + [FactionNames.KuaiGongInternational]: new FactionInfo( <>Dream big. Work hard. Make history., [], true, @@ -260,7 +263,7 @@ export const FactionInfos: IMap = { ), // Other Corporations - "Fulcrum Secret Technologies": new FactionInfo( + [FactionNames.FulcrumSecretTechnologies]: new FactionInfo( ( <> The human organism has an innate desire to worship. That is why they created gods. If there were no gods, it @@ -277,7 +280,7 @@ export const FactionInfos: IMap = { ), // Hacker groups - BitRunners: new FactionInfo( + [FactionNames.BitRunners]: new FactionInfo( ( <> Our entire lives are controlled by bits. All of our actions, our thoughts, our personal information. It's all @@ -299,7 +302,7 @@ export const FactionInfos: IMap = { false, ), - "The Black Hand": new FactionInfo( + [FactionNames.TheBlackHand]: new FactionInfo( ( <> The world, so afraid of strong government, now has no government. Only power - Digital power. Financial power. @@ -320,42 +323,42 @@ export const FactionInfos: IMap = { ), // prettier-ignore - NiteSec: new FactionInfo(<> -{" __..__ "}
-{" _.nITESECNIt. "}
-{" .-'NITESECNITESEc. "}
-{" .' NITESECNITESECn "}
-{" / NITESECNITESEC; "}
-{" : :NITESECNITESEC; "}
-{" ; $ NITESECNITESECN "}
-{" : _, ,N'ITESECNITESEC "}
-{" : .+^^`, : `NITESECNIT "}
-{" ) /), `-,-=,NITESECNI "}
-{" / ^ ,-;|NITESECN; "}
-{" / _.' '-';NITESECN "}
-{" ( , ,-''`^NITE' "}
-{" )` :`. .' "}
-{" )-- ; `- / "}
-{" ' _.-' : "}
-{" ( _.-' . "}
-{" ------. "}
-{" . "}
-{" _.nIt "}
-{" _.nITESECNi "}
-{" nITESECNIT^' "}
-{" NITE^' ___ "}
-{" / .gP''''Tp. "}
-{" : d' . `b "}
-{" ; d' o `b ; "}
-{" / d; `b| "}
-{" /, $; @ `: "}
-{" /' $/ ; "}
-{" .' $/b o | "}
-{" .' d$/$; : "}
-{" / .d/$/$; , ; "}
-{" d .dNITESEC $ | "}
-{" :bp.__.gNITESEC/$ :$ ; "}
-{" NITESECNITESECNIT /$b : "}
, + [FactionNames.NiteSec]: new FactionInfo(<> + {" __..__ "}
+ {" _.nITESECNIt. "}
+ {" .-'NITESECNITESEc. "}
+ {" .' NITESECNITESECn "}
+ {" / NITESECNITESEC; "}
+ {" : :NITESECNITESEC; "}
+ {" ; $ NITESECNITESECN "}
+ {" : _, ,N'ITESECNITESEC "}
+ {" : .+^^`, : `NITESECNIT "}
+ {" ) /), `-,-=,NITESECNI "}
+ {" / ^ ,-;|NITESECN; "}
+ {" / _.' '-';NITESECN "}
+ {" ( , ,-''`^NITE' "}
+ {" )` :`. .' "}
+ {" )-- ; `- / "}
+ {" ' _.-' : "}
+ {" ( _.-' . "}
+ {" ------. "}
+ {" . "}
+ {" _.nIt "}
+ {" _.nITESECNi "}
+ {" nITESECNIT^' "}
+ {" NITE^' ___ "}
+ {" / .gP''''Tp. "}
+ {" : d' . `b "}
+ {" ; d' o `b ; "}
+ {" / d; `b| "}
+ {" /, $; @ `: "}
+ {" /' $/ ; "}
+ {" .' $/b o | "}
+ {" .' d$/$; : "}
+ {" / .d/$/$; , ; "}
+ {" d .dNITESEC $ | "}
+ {" :bp.__.gNITESEC/$ :$ ; "}
+ {" NITESECNITESECNIT /$b : "}
, [], true, true, @@ -366,9 +369,9 @@ export const FactionInfos: IMap = { ), // City factions, essentially governments - Aevum: new FactionInfo( + [FactionNames.Aevum]: new FactionInfo( <>The Silicon City., - ["Chongqing", "New Tokyo", "Ishima", "Volhaven"], + [FactionNames.Chongqing, FactionNames.NewTokyo, FactionNames.Ishima, FactionNames.Volhaven], true, true, true, @@ -376,9 +379,9 @@ export const FactionInfos: IMap = { false, false, ), - Chongqing: new FactionInfo( + [FactionNames.Chongqing]: new FactionInfo( <>Serve the People., - ["Sector-12", "Aevum", "Volhaven"], + [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven], true, true, true, @@ -386,9 +389,9 @@ export const FactionInfos: IMap = { false, false, ), - Ishima: new FactionInfo( + [FactionNames.Ishima]: new FactionInfo( <>The East Asian Order of the Future., - ["Sector-12", "Aevum", "Volhaven"], + [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven], true, true, true, @@ -396,9 +399,9 @@ export const FactionInfos: IMap = { false, false, ), - "New Tokyo": new FactionInfo( + [FactionNames.NewTokyo]: new FactionInfo( <>Asia's World City., - ["Sector-12", "Aevum", "Volhaven"], + [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven], true, true, true, @@ -406,9 +409,9 @@ export const FactionInfos: IMap = { false, false, ), - "Sector-12": new FactionInfo( + [FactionNames.Sector12]: new FactionInfo( <>The City of the Future., - ["Chongqing", "New Tokyo", "Ishima", "Volhaven"], + [FactionNames.Chongqing, FactionNames.NewTokyo, FactionNames.Ishima, FactionNames.Volhaven], true, true, true, @@ -416,9 +419,9 @@ export const FactionInfos: IMap = { false, false, ), - Volhaven: new FactionInfo( + [FactionNames.Volhaven]: new FactionInfo( <>Benefit, Honor, and Glory., - ["Chongqing", "Sector-12", "New Tokyo", "Aevum", "Ishima"], + [FactionNames.Chongqing, FactionNames.Sector12, FactionNames.NewTokyo, FactionNames.Aevum, FactionNames.Ishima], true, true, true, @@ -428,7 +431,7 @@ export const FactionInfos: IMap = { ), // Criminal Organizations/Gangs - "Speakers for the Dead": new FactionInfo( + [FactionNames.SpeakersForTheDead]: new FactionInfo( <>It is better to reign in Hell than to serve in Heaven., [], true, @@ -439,7 +442,7 @@ export const FactionInfos: IMap = { false, ), - "The Dark Army": new FactionInfo( + [FactionNames.TheDarkArmy]: new FactionInfo( <>The World doesn't care about right or wrong. It only cares about power., [], true, @@ -450,9 +453,9 @@ export const FactionInfos: IMap = { false, ), - "The Syndicate": new FactionInfo(<>Honor holds you back., [], true, true, true, true, false, false), + [FactionNames.TheSyndicate]: new FactionInfo(<>Honor holds you back., [], true, true, true, true, false, false), - Silhouette: new FactionInfo( + [FactionNames.Silhouette]: new FactionInfo( ( <> Corporations have filled the void of power left behind by the collapse of Western government. The issue is @@ -472,7 +475,7 @@ export const FactionInfos: IMap = { false, ), - Tetrads: new FactionInfo( + [FactionNames.Tetrads]: new FactionInfo( <>Following the mandate of Heaven and carrying out the way., [], false, @@ -483,14 +486,14 @@ export const FactionInfos: IMap = { false, ), - "Slum Snakes": new FactionInfo(<>Slum Snakes rule!, [], false, false, true, true, false, false), + [FactionNames.SlumSnakes]: new FactionInfo(<>{FactionNames.SlumSnakes} rule!, [], false, false, true, true, false, false), // Earlygame factions - factions the player will prestige with early on that don't belong in other categories. - Netburners: new FactionInfo(<>{"~~//*>H4CK||3T 8URN3R5**>?>\\~~"}, [], true, true, false, false, false, false), + [FactionNames.Netburners]: new FactionInfo(<>{"~~//*>H4CK||3T 8URN3R5**>?>\\~~"}, [], true, true, false, false, false, false), - "Tian Di Hui": new FactionInfo(<>Obey Heaven and work righteously., [], true, true, false, true, false, false), + [FactionNames.TianDiHui]: new FactionInfo(<>Obey Heaven and work righteously., [], true, true, false, true, false, false), - CyberSec: new FactionInfo( + [FactionNames.CyberSec]: new FactionInfo( ( <> The Internet is the first thing that was built that we don't fully understand, the largest experiment in anarchy @@ -508,13 +511,13 @@ export const FactionInfos: IMap = { ), // Special Factions - Bladeburners: new FactionInfo( + [FactionNames.Bladeburners]: new FactionInfo( ( <> It's too bad they won't live. But then again, who does?

- Note that for this faction, reputation can only be gained through Bladeburner actions. Completing Bladeburner + Note that for this faction, reputation can only be gained through {FactionNames.Bladeburners} actions. Completing {FactionNames.Bladeburners} contracts/operations will increase your reputation. ), @@ -528,7 +531,7 @@ export const FactionInfos: IMap = { ), // prettier-ignore - "Church of the Machine God": new FactionInfo(<> + [FactionNames.ChurchOfTheMachineGod]: new FactionInfo(<> {" `` "}
{" -odmmNmds: "}
{" `hNmo:..-omNh. "}
@@ -558,7 +561,7 @@ export const FactionInfos: IMap = { {" -smNNNNmdo- "}
{" `..` "}

Many cultures predict an end to humanity in the near future, a final - Armageddon that will end the world; but we disagree. + Armageddon that will end the world; but we disagree.

Note that for this faction, reputation can only be gained by charging Stanek's gift., [], diff --git a/src/Faction/data/FactionNames.ts b/src/Faction/data/FactionNames.ts new file mode 100644 index 000000000..bd5a068ac --- /dev/null +++ b/src/Faction/data/FactionNames.ts @@ -0,0 +1,35 @@ +export enum FactionNames { + Illuminati = "Illuminati", + Daedalus = "Daedalus", + TheCovenant = "The Covenant", + ECorp = "ECorp", + MegaCorp = "MegaCorp", + BachmanAssociates = "Bachman & Associates", + BladeIndustries = "Blade Industries", + NWO = "NWO", + ClarkeIncorporated = "Clarke Incorporated", + OmniTekIncorporated = "OmniTek Incorporated", + FourSigma = "Four Sigma", + KuaiGongInternational = "KuaiGong International", + FulcrumSecretTechnologies = "Fulcrum Secret Technologies", + BitRunners = "BitRunners", + TheBlackHand = "The Black Hand", + NiteSec = "NiteSec", + Aevum = "Aevum", + Chongqing = "Chongqing", + Ishima = "Ishima", + NewTokyo = "NewTokyo", + Sector12 = "Sector12", + Volhaven = "Volhaven", + SpeakersForTheDead = "Speakers for the Dead", + TheDarkArmy = "The Dark Army", + TheSyndicate = "The Syndicate", + Silhouette = "Silhouette", + Tetrads = "Tetrads", + SlumSnakes = "Slum Snakes", + Netburners = "Netburners", + TianDiHui = "Tian Di Hui", + CyberSec = "CyberSec", + Bladeburners = "Bladeburners", + ChurchOfTheMachineGod = "Church of the Machine God", +} diff --git a/src/Faction/ui/CreateGangModal.tsx b/src/Faction/ui/CreateGangModal.tsx index c2592286f..5d023376c 100644 --- a/src/Faction/ui/CreateGangModal.tsx +++ b/src/Faction/ui/CreateGangModal.tsx @@ -6,6 +6,7 @@ import { Modal } from "../../ui/React/Modal"; import { use } from "../../ui/Context"; import Typography from "@mui/material/Typography"; import Button from "@mui/material/Button"; +import { FactionNames } from "../data/FactionNames"; interface IProps { open: boolean; @@ -27,7 +28,7 @@ export function CreateGangModal(props: IProps): React.ReactElement { "is not as important."; function isHacking(): boolean { - return ["NiteSec", "The Black Hand"].includes(props.facName); + return [FactionNames.NiteSec as string, FactionNames.TheBlackHand as string].includes(props.facName); } function createGang(): void { diff --git a/src/Faction/ui/FactionRoot.tsx b/src/Faction/ui/FactionRoot.tsx index 1dd5a1a66..151d58687 100644 --- a/src/Faction/ui/FactionRoot.tsx +++ b/src/Faction/ui/FactionRoot.tsx @@ -21,6 +21,8 @@ import { CreateGangModal } from "./CreateGangModal"; import Typography from "@mui/material/Typography"; import Button from "@mui/material/Button"; import { CovenantPurchasesRoot } from "../../PersonObjects/Sleeve/ui/CovenantPurchasesRoot"; +import { FactionNames } from "../data/FactionNames"; +import { GangConstants } from "../../Gang/data/Constants"; type IProps = { faction: Faction; @@ -50,16 +52,6 @@ const augmentationsInfo = "your abilities."; const sleevePurchasesInfo = "Purchase Duplicate Sleeves and upgrades. These are permanent!"; -const GangNames = [ - "Slum Snakes", - "Tetrads", - "The Syndicate", - "The Dark Army", - "Speakers for the Dead", - "NiteSec", - "The Black Hand", -]; - interface IMainProps { faction: Faction; rerender: () => void; @@ -111,9 +103,9 @@ function MainPage({ faction, rerender, onAugmentations }: IMainProps): React.Rea const favorToDonate = Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction); const canDonate = faction.favor >= favorToDonate; - const canPurchaseSleeves = faction.name === "The Covenant" && player.bitNodeN === 10; + const canPurchaseSleeves = faction.name === FactionNames.TheCovenant && player.bitNodeN === 10; - let canAccessGang = player.canAccessGang() && GangNames.includes(faction.name); + let canAccessGang = player.canAccessGang() && GangConstants.Names.includes(faction.name); if (player.inGang()) { if (player.getGangName() !== faction.name) { canAccessGang = false; diff --git a/src/Gang/AllGangs.ts b/src/Gang/AllGangs.ts index ef9366ad0..fcf57a2db 100644 --- a/src/Gang/AllGangs.ts +++ b/src/Gang/AllGangs.ts @@ -1,3 +1,4 @@ +import { FactionNames } from '../Faction/data/FactionNames'; import { Reviver } from "../utils/JSONReviver"; interface GangTerritory { @@ -8,31 +9,31 @@ interface GangTerritory { export let AllGangs: { [key: string]: GangTerritory; } = { - "Slum Snakes": { + [FactionNames.SlumSnakes]: { power: 1, territory: 1 / 7, }, - Tetrads: { + [FactionNames.Tetrads]: { power: 1, territory: 1 / 7, }, - "The Syndicate": { + [FactionNames.TheSyndicate]: { power: 1, territory: 1 / 7, }, - "The Dark Army": { + [FactionNames.TheDarkArmy]: { power: 1, territory: 1 / 7, }, - "Speakers for the Dead": { + [FactionNames.SpeakersForTheDead]: { power: 1, territory: 1 / 7, }, - NiteSec: { + [FactionNames.NiteSec]: { power: 1, territory: 1 / 7, }, - "The Black Hand": { + [FactionNames.TheBlackHand]: { power: 1, territory: 1 / 7, }, @@ -40,31 +41,31 @@ export let AllGangs: { export function resetGangs(): void { AllGangs = { - "Slum Snakes": { + [FactionNames.SlumSnakes]: { power: 1, territory: 1 / 7, }, - Tetrads: { + [FactionNames.Tetrads]: { power: 1, territory: 1 / 7, }, - "The Syndicate": { + [FactionNames.TheSyndicate]: { power: 1, territory: 1 / 7, }, - "The Dark Army": { + [FactionNames.TheDarkArmy]: { power: 1, territory: 1 / 7, }, - "Speakers for the Dead": { + [FactionNames.SpeakersForTheDead]: { power: 1, territory: 1 / 7, }, - NiteSec: { + [FactionNames.NiteSec]: { power: 1, territory: 1 / 7, }, - "The Black Hand": { + [FactionNames.TheBlackHand]: { power: 1, territory: 1 / 7, }, diff --git a/src/Gang/data/Constants.ts b/src/Gang/data/Constants.ts index 0675a43cf..73a938090 100644 --- a/src/Gang/data/Constants.ts +++ b/src/Gang/data/Constants.ts @@ -1,3 +1,5 @@ +import { FactionNames } from "../../Faction/data/FactionNames"; + export const GangConstants: { GangRespectToReputationRatio: number; MaximumGangMembers: number; @@ -13,12 +15,12 @@ export const GangConstants: { AscensionMultiplierRatio: 0.15, // Names of possible Gangs Names: [ - "Slum Snakes", - "Tetrads", - "The Syndicate", - "The Dark Army", - "Speakers for the Dead", - "NiteSec", - "The Black Hand", + FactionNames.SlumSnakes, + FactionNames.Tetrads, + FactionNames.TheSyndicate, + FactionNames.TheDarkArmy, + FactionNames.SpeakersForTheDead, + FactionNames.NiteSec, + FactionNames.TheBlackHand, ], }; diff --git a/src/Gang/data/power.ts b/src/Gang/data/power.ts index 709d63f72..fb5784a2c 100644 --- a/src/Gang/data/power.ts +++ b/src/Gang/data/power.ts @@ -1,11 +1,12 @@ +import { FactionNames } from '../../Faction/data/FactionNames'; export const PowerMultiplier: { [key: string]: number | undefined; } = { - "Slum Snakes": 1, - Tetrads: 2, - "The Syndicate": 2, - "The Dark Army": 2, - "Speakers for the Dead": 5, - NiteSec: 2, - "The Black Hand": 5, + [FactionNames.SlumSnakes]: 1, + [FactionNames.Tetrads]: 2, + [FactionNames.TheSyndicate]: 2, + [FactionNames.TheDarkArmy]: 2, + [FactionNames.SpeakersForTheDead]: 5, + [FactionNames.NiteSec]: 2, + [FactionNames.TheBlackHand]: 5, }; diff --git a/src/Hacknet/ui/HacknetUpgradeElem.tsx b/src/Hacknet/ui/HacknetUpgradeElem.tsx index 3abc7bf49..babc089ae 100644 --- a/src/Hacknet/ui/HacknetUpgradeElem.tsx +++ b/src/Hacknet/ui/HacknetUpgradeElem.tsx @@ -16,6 +16,7 @@ import Typography from "@mui/material/Typography"; import Paper from "@mui/material/Paper"; import Button from "@mui/material/Button"; import { SelectChangeEvent } from "@mui/material/Select"; +import { FactionNames } from "../../Faction/data/FactionNames"; interface IProps { player: IPlayer; @@ -28,7 +29,7 @@ const serversMap: { [key: string]: string } = {}; export function HacknetUpgradeElem(props: IProps): React.ReactElement { const [selectedServer, setSelectedServer] = useState( - serversMap[props.upg.name] ? serversMap[props.upg.name] : "ecorp", + serversMap[props.upg.name] ? serversMap[props.upg.name] : FactionNames.ECorp.toLowerCase(), ); function changeTargetServer(event: SelectChangeEvent): void { setSelectedServer(event.target.value); @@ -42,7 +43,7 @@ export function HacknetUpgradeElem(props: IProps): React.ReactElement { if (!res) { dialogBoxCreate( "Failed to purchase upgrade. This may be because you do not have enough hashes, " + - "or because you do not have access to the feature upgrade affects.", + "or because you do not have access to the feature upgrade affects.", ); } props.rerender(); diff --git a/src/Literature/Literatures.ts b/src/Literature/Literatures.ts index bf66b142c..d9c04306a 100644 --- a/src/Literature/Literatures.ts +++ b/src/Literature/Literatures.ts @@ -1,6 +1,8 @@ +import { CityName } from './../Locations/data/CityNames'; import { Literature } from "./Literature"; import { LiteratureNames } from "./data/LiteratureNames"; import { IMap } from "../types"; +import { FactionNames } from "../Faction/data/FactionNames"; export const Literatures: IMap = {}; @@ -84,29 +86,29 @@ export const Literatures: IMap = {}; "Synthetic androids, or Synthoids for short, are genetically engineered robots and, short of Augmentations, " + "are composed entirely of organic substances. For this reason, Synthoids are virtually identical to " + "humans in form, composition, and appearance.

" + - "Synthoids were first designed and manufactured by OmniTek Incorporated sometime around the middle of the century. " + + `Synthoids were first designed and manufactured by ${FactionNames.OmniTekIncorporated} sometime around the middle of the century. ` + "Their original purpose was to be used for manual labor and as emergency responders for disasters. As such, they " + "were initially programmed only for their specific tasks. Each iteration that followed improved upon the " + "intelligence and capabilities of the Synthoids. By the 6th iteration, called MK-VI, the Synthoids were " + - "so smart and capable enough of making their own decisions that many argued OmniTek had created the first " + + `so smart and capable enough of making their own decisions that many argued ${FactionNames.OmniTekIncorporated} had created the first ` + "sentient AI. These MK-VI Synthoids were produced in mass quantities (estimates up to 50 billion) with the hopes of increasing society's " + "productivity and bolstering the global economy. Stemming from humanity's desire for technological advancement, optimism " + "and excitement about the future had never been higher.

" + "All of that excitement and optimism quickly turned to fear, panic, and dread in 2070, when a terrorist group " + - "called Ascendis Totalis hacked into OmniTek and uploaded a rogue AI into severeal of their Synthoid manufacturing facilities. " + - "This hack went undetected and for months OmniTek unknowingly churned out legions of Synthoids embedded with this " + + `called Ascendis Totalis hacked into ${FactionNames.OmniTekIncorporated} and uploaded a rogue AI into severeal of their Synthoid manufacturing facilities. ` + + `This hack went undetected and for months ${FactionNames.OmniTekIncorporated} unknowingly churned out legions of Synthoids embedded with this ` + "rogue AI. Then, on December 24th, 2070, Omnica activated dormant protocols in the rogue AI, causing all of the " + "infected Synthoids to immediately launch a military campaign to seek and destroy all of humanity.

" + "What ensued was the deadlist conflict in human history. This crisis, now commonly known as the Synthoid Uprising, " + "resulted in almost ten billion deaths over the course of a year. Despite the nations of the world banding together " + "to combat the threat, the MK-VI Synthoids were simply stronger, faster, more intelligent, and more adaptable than humans, " + "outsmarting them at every turn.

" + - "It wasn't until the sacrifice of an elite international military taskforce, called the Bladeburners, that humanity " + - "was finally able to defeat the Synthoids. The Bladeburners' final act was a suicide bombing mission that " + + `It wasn't until the sacrifice of an elite international military taskforce, called the ${FactionNames.Bladeburners}, that humanity ` + + `was finally able to defeat the Synthoids. The ${FactionNames.Bladeburners}' final act was a suicide bombing mission that ` + "destroyed a large portion of the MK-VI Synthoids, including many of its leaders. In the following " + "weeks militaries from around the world were able to round up and shut down the remaining rogue MK-VI Synthoids, ending " + "the Synthoid Uprising.

" + - "In the aftermath of the bloodshed, the Synthoid Accords were drawn up. These Accords banned OmniTek Incorporated " + + `In the aftermath of the bloodshed, the Synthoid Accords were drawn up. These Accords banned ${FactionNames.OmniTekIncorporated} ` + "from manufacturing any Synthoids beyond the MK-III series. They also banned any other corporation " + "from constructing androids with advanced, near-sentient AI. MK-VI Synthoids that did not have the rogue Ascendis Totalis " + "AI were allowed to continue their existence, but they were stripped of all rights and protections as they " + @@ -114,7 +116,7 @@ export const Literatures: IMap = {}; "as working for any military/defense organization or conducting any bioengineering, computing, or robotics related research.

" + "Unfortunately, many believe 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. In response, many nations have created " + - "Bladeburner divisions, special military branches that are tasked with investigating and dealing with any Synthoid threats.

" + + `${FactionNames.Bladeburners} divisions, special military branches that are tasked with investigating and dealing with any Synthoid threats.

` + "To this day, tensions still exist between the remaining Synthoids and humans as a result of the Uprising.

" + "Nobody knows what happened to the terrorist group Ascendis Totalis."; Literatures[fn] = new Literature(title, fn, txt); @@ -199,9 +201,9 @@ export const Literatures: IMap = {}; title = "Brighter than the Sun"; fn = LiteratureNames.BrighterThanTheSun; txt = - "When people think about the corporations that dominate the East, they typically think of KuaiGong International, which " + + `When people think about the corporations that dominate the East, they typically think of ${FactionNames.KuaiGongInternational}, which ` + "holds a complete monopoly for manufacturing and commerce in Asia, or Global Pharmaceuticals, the world's largest " + - "drug company, or OmniTek Incorporated, the global leader in intelligent and autonomous robots. But there's one company " + + `drug company, or ${FactionNames.OmniTekIncorporated}, the global leader in intelligent and autonomous robots. But there's one company ` + "that has seen a rapid rise in the last year and is poised to dominate not only the East, but the entire world: TaiYang Digital.

" + "TaiYang Digital is a Chinese internet-technology corporation that provides services such as " + "online advertising, search engines, gaming, media, entertainment, and cloud computing/storage. Its name TaiYang comes from the Chinese word " + @@ -213,7 +215,7 @@ export const Literatures: IMap = {}; "TaiYang Digital's meteoric rise is extremely surprising in modern society. This sort of growth is " + "something you'd commonly see in the first half of the century, especially for tech companies. However in " + "the last two decades the number of corporations has significantly declined as the largest entities " + - "quickly took over the economy. Corporations such as ECorp, MegaCorp, and KuaiGong have established " + + `quickly took over the economy. Corporations such as ${FactionNames.ECorp}, ${FactionNames.MegaCorp}, and ${FactionNames.KuaiGongInternational} have established ` + "such strong monopolies in their market sectors that they have effectively killed off all " + "of the smaller and new corporations that have tried to start up over the years. This is what makes " + "the rise of TaiYang Digital so impressive. And if TaiYang continues down this path, then they have " + @@ -234,11 +236,11 @@ export const Literatures: IMap = {}; "And now democracy is dead, in the USA."; Literatures[fn] = new Literature(title, fn, txt); - title = "Figures Show Rising Crime Rates in Sector-12"; + title = `Figures Show Rising Crime Rates in ${CityName.Sector12}`; fn = LiteratureNames.Sector12Crime; txt = "A recent study by analytics company Wilson Inc. shows a significant rise " + - "in criminal activity in Sector-12. Perhaps the most alarming part of the statistic " + + `in criminal activity in ${CityName.Sector12}. Perhaps the most alarming part of the statistic ` + "is that most of the rise is in violent crime such as homicide and assault. According " + "to the study, the city saw a total of 21,406 reported homicides in 2076, which is over " + "a 20% increase compared to 2075.

" + @@ -246,7 +248,7 @@ export const Literatures: IMap = {}; "whether these figures indicate the beginning of a sustained increase in crime rates, or whether " + "the year was just an unfortunate outlier. He states that many intelligence and law enforcement " + "agents have noticed an increase in organized crime activites, and believes that these figures may " + - "be the result of an uprising from criminal organizations such as The Syndicate or the Slum Snakes."; + `be the result of an uprising from criminal organizations such as ${FactionNames.TheSyndicate} or the ${FactionNames.SlumSnakes}.`; Literatures[fn] = new Literature(title, fn, txt); title = "Man and the Machine"; @@ -276,15 +278,15 @@ export const Literatures: IMap = {}; "most radical of conspiracy theorists claiming that they control everything in the entire world. And while the world " + "may never know for sure, it is likely that many secret societies do actually exist, even today.

" + "However, the secret societies of the modern world are nothing like those that (supposedly) existed " + - "decades and centuries ago. The Freemasons, Knights Templar, and Illuminati, while they may have been around " + + `decades and centuries ago. The Freemasons, Knights Templar, and ${FactionNames.Illuminati}, while they may have been around ` + "at the turn of the 21st century, almost assuredly do not exist today. The dominance of the Web in " + "our everyday lives and the fact that so much of the world is now digital has given rise to a new breed " + "of secret societies: Internet-based ones.

" + "Commonly called 'hacker groups', Internet-based secret societies have become well-known in today's " + - "world. Some of these, such as The Black Hand, are black hat groups that claim they are trying to " + - "help the oppressed by attacking the elite and powerful. Others, such as NiteSec, are hacktivist groups " + + `world. Some of these, such as ${FactionNames.TheBlackHand}, are black hat groups that claim they are trying to ` + + `help the oppressed by attacking the elite and powerful. Others, such as ${FactionNames.NiteSec}, are hacktivist groups ` + "that try to push political and social agendas. Perhaps the most intriguing hacker group " + - "is the mysterious Bitrunners, whose purpose still remains unknown."; + `is the mysterious ${FactionNames.BitRunners}, whose purpose still remains unknown.`; Literatures[fn] = new Literature(title, fn, txt); title = "Space: The Failed Frontier"; @@ -313,7 +315,7 @@ export const Literatures: IMap = {}; "Medical, service, and manufacturing robots. All of these are examples of how far AI has come and how much it has " + "improved our daily lives. However, the question still remains of whether AI will ever be advanced enough to re-create " + "human intelligence.

" + - "We've certainly come close to artificial intelligence that is similar to humans. For example OmniTek Incorporated's " + + `We've certainly come close to artificial intelligence that is similar to humans. For example ${FactionNames.OmniTekIncorporated}'s ` + "CompanionBot, a robot meant to act as a comforting friend for lonely and grieving people, is eerily human-like " + "in its appearance, speech, mannerisms, and even movement. However its artificial intelligence isn't the same as " + "that of humans. Not yet. It doesn't have sentience or self-awareness or consciousness.

" + @@ -340,9 +342,9 @@ export const Literatures: IMap = {}; fn = LiteratureNames.TensionsInTechRace; txt = "Have we entered a new Cold War? Is WWIII just beyond the horizon?

" + - "After rumors came out that OmniTek Incorporated had begun developing advanced robotic supersoldiers, " + + `After rumors came out that ${FactionNames.OmniTekIncorporated} had begun developing advanced robotic supersoldiers, ` + "geopolitical tensions quickly flared between the USA, Russia, and several Asian superpowers. " + - "In a rare show of cooperation between corporations, MegaCorp and ECorp have " + + `In a rare show of cooperation between corporations, ${FactionNames.MegaCorp} and ${FactionNames.ECorp} have ` + "reportedly launched hundreds of new surveillance and espionage satellites. " + "Defense contractors such as " + "DeltaOne and AeroCorp have been working with the CIA and NSA to prepare " + @@ -381,13 +383,13 @@ export const Literatures: IMap = {}; txt = "WAKE UP SHEEPLE

" + "THE GOVERNMENT DOES NOT EXIST. CORPORATIONS DO NOT RUN SOCIETY

" + - "THE ILLUMINATI ARE THE SECRET RULERS OF THE WORLD!

" + - "Yes, the Illuminati of legends. The ancient secret society that controls the entire " + + `THE ${FactionNames.Illuminati.toUpperCase()} ARE THE SECRET RULERS OF THE WORLD!

` + + `Yes, the ${FactionNames.Illuminati} of legends. The ancient secret society that controls the entire ` + "world from the shadows with their invisible hand. The group of the rich and wealthy " + "that have penetrated every major government, financial agency, and corporation in the last " + "three hundred years.

" + "OPEN YOUR EYES

" + - "It was the Illuminati that brought an end to democracy in the world. They are the driving force " + + `It was the ${FactionNames.Illuminati} that brought an end to democracy in the world. They are the driving force ` + "behind everything that happens.

" + "THEY ARE ALL AROUND YOU

" + "After destabilizing the world's governments, they are now entering the final stage of their master plan. " + @@ -416,15 +418,15 @@ export const Literatures: IMap = {}; "territories. They were often considered one of the first and biggest criminal secret societies. " + "While most of the branches of the Triads have been destroyed over the past few decades, the " + "crime faction has spawned and inspired a number of other Asian crime organizations over the past few years. " + - "The most notable of these is the Tetrads.

" + - "It is widely believed that the Tetrads are a rogue group that splintered off from the Triads sometime in the " + - "mid 21st century. The founders of the Tetrads, all of whom were ex-Triad members, believed that the " + - "Triads were losing their purpose and direction. The Tetrads started off as a small group that mainly engaged " + + `The most notable of these is the ${FactionNames.Tetrads}.

` + + `It is widely believed that the ${FactionNames.Tetrads} are a rogue group that splintered off from the Triads sometime in the ` + + `mid 21st century. The founders of the ${FactionNames.Tetrads}, all of whom were ex-Triad members, believed that the ` + + `Triads were losing their purpose and direction. The ${FactionNames.Tetrads} started off as a small group that mainly engaged ` + "in fraud and extortion. They were largely unknown until just a few years ago when they took over the illegal " + "drug trade in all of the major Asian cities. They quickly became the most powerful crime syndicate in the " + "continent.

" + - "Not much else is known about the Tetrads, or about the efforts the Asian governments and corporations are making " + - "to take down this large new crime organization. Many believe that the Tetrads have infiltrated the governments " + + `Not much else is known about the ${FactionNames.Tetrads}, or about the efforts the Asian governments and corporations are making ` + + `to take down this large new crime organization. Many believe that the ${FactionNames.Tetrads} have infiltrated the governments ` + "and powerful corporations in Asia, which has helped faciliate their recent rapid rise."; Literatures[fn] = new Literature(title, fn, txt); diff --git a/src/Locations/data/LocationNames.ts b/src/Locations/data/LocationNames.ts index f3b4f96e5..4a8efdc44 100644 --- a/src/Locations/data/LocationNames.ts +++ b/src/Locations/data/LocationNames.ts @@ -2,14 +2,6 @@ * Names of all locations */ export enum LocationName { - // Cities - Aevum = "Aevum", - Chongqing = "Chongqing", - Ishima = "Ishima", - NewTokyo = "New Tokyo", - Sector12 = "Sector-12", - Volhaven = "Volhaven", - // Aevum Locations AevumAeroCorp = "AeroCorp", AevumBachmanAndAssociates = "Bachman & Associates", diff --git a/src/Locations/ui/SpecialLocation.tsx b/src/Locations/ui/SpecialLocation.tsx index d7be2c170..7f9b5b91d 100644 --- a/src/Locations/ui/SpecialLocation.tsx +++ b/src/Locations/ui/SpecialLocation.tsx @@ -33,6 +33,7 @@ import { HacknetNode } from "../../Hacknet/HacknetNode"; import { HacknetServer } from "../../Hacknet/HacknetServer"; import { GetServer } from "../../Server/AllServers"; import { ArcadeRoot } from "../../Arcade/ui/ArcadeRoot"; +import { FactionNames } from "../../Faction/data/FactionNames"; type IProps = { loc: Location; @@ -54,7 +55,7 @@ export function SpecialLocation(props: IProps): React.ReactElement { router.toBladeburner(); } else if (p.strength >= 100 && p.defense >= 100 && p.dexterity >= 100 && p.agility >= 100) { // Apply for Bladeburner division - p.startBladeburner({new: true}); + p.startBladeburner({ new: true }); dialogBoxCreate("You have been accepted into the Bladeburner division!"); setRerender((old) => !old); @@ -158,8 +159,8 @@ export function SpecialLocation(props: IProps): React.ReactElement { } function handleCotMG(): void { - const faction = Factions["Church of the Machine God"]; - if (!player.factions.includes("Church of the Machine God")) { + const faction = Factions[FactionNames.ChurchOfTheMachineGod]; + if (!player.factions.includes(FactionNames.ChurchOfTheMachineGod)) { joinFaction(faction); } if ( @@ -174,35 +175,35 @@ export function SpecialLocation(props: IProps): React.ReactElement { function renderCotMG(): React.ReactElement { // prettier-ignore - const symbol = - {" `` "}
- {" -odmmNmds: "}
- {" `hNmo:..-omNh. "}
- {" yMd` `hNh "}
- {" mMd oNm "}
- {" oMNo .mM/ "}
- {" `dMN+ -mM+ "}
- {" -mMNo -mN+ "}
- {" .+- :mMNo/mN/ "}
- {":yNMd. :NMNNN/ "}
- {"-mMMMh. /NMMh` "}
- {" .dMMMd. /NMMMy` "}
- {" `yMMMd. /NNyNMMh` "}
- {" `sMMMd. +Nm: +NMMh. "}
- {" oMMMm- oNm: /NMMd. "}
- {" +NMMmsMm- :mMMd. "}
- {" /NMMMm- -mMMd. "}
- {" /MMMm- -mMMd. "}
- {" `sMNMMm- .mMmo "}
- {" `sMd:hMMm. ./. "}
- {" `yMy` `yNMd` "}
- {" `hMs` oMMy "}
- {" `hMh sMN- "}
- {" /MM- .NMo "}
- {" +MM: :MM+ "}
- {" sNNo-.`.-omNy` "}
- {" -smNNNNmdo- "}
- {" `..` "}
+ const symbol = + {" `` "}
+ {" -odmmNmds: "}
+ {" `hNmo:..-omNh. "}
+ {" yMd` `hNh "}
+ {" mMd oNm "}
+ {" oMNo .mM/ "}
+ {" `dMN+ -mM+ "}
+ {" -mMNo -mN+ "}
+ {" .+- :mMNo/mN/ "}
+ {":yNMd. :NMNNN/ "}
+ {"-mMMMh. /NMMh` "}
+ {" .dMMMd. /NMMMy` "}
+ {" `yMMMd. /NNyNMMh` "}
+ {" `sMMMd. +Nm: +NMMh. "}
+ {" oMMMm- oNm: /NMMd. "}
+ {" +NMMmsMm- :mMMd. "}
+ {" /NMMMm- -mMMd. "}
+ {" /MMMm- -mMMd. "}
+ {" `sMNMMm- .mMmo "}
+ {" `sMd:hMMm. ./. "}
+ {" `yMy` `yNMd` "}
+ {" `hMs` oMMy "}
+ {" `hMh sMN- "}
+ {" /MM- .NMo "}
+ {" +MM: :MM+ "}
+ {" sNNo-.`.-omNy` "}
+ {" -smNNNNmdo- "}
+ {" `..` "}
if (player.hasAugmentation(AugmentationNames.StaneksGift3, true)) { return ( <> @@ -231,7 +232,7 @@ export function SpecialLocation(props: IProps): React.ReactElement { ); } - if (player.factions.includes("Church of the Machine God")) { + if (player.factions.includes(FactionNames.ChurchOfTheMachineGod)) { return ( <> diff --git a/src/Message/MessageHelpers.ts b/src/Message/MessageHelpers.ts index 8493f1f2e..ccb3835c8 100644 --- a/src/Message/MessageHelpers.ts +++ b/src/Message/MessageHelpers.ts @@ -8,6 +8,7 @@ import { GetServer } from "../Server/AllServers"; import { Settings } from "../Settings/Settings"; import { dialogBoxCreate } from "../ui/React/DialogBox"; import { Reviver } from "../utils/JSONReviver"; +import { FactionNames } from "../Faction/data/FactionNames"; //Sends message to player, including a pop up function sendMessage(msg: Message, forced = false): void { @@ -128,48 +129,48 @@ function initMessages(): void { new Message( MessageFilenames.Jumper0, "I know you can sense it. I know you're searching for it. " + - "It's why you spend night after " + - "night at your computer.

It's real, I've seen it. And I can " + - "help you find it. But not right now. You're not ready yet.

" + - "Use this program to track your progress

" + - "The fl1ght.exe program was added to your home computer

" + - "-jump3R", + "It's why you spend night after " + + "night at your computer.

It's real, I've seen it. And I can " + + "help you find it. But not right now. You're not ready yet.

" + + "Use this program to track your progress

" + + "The fl1ght.exe program was added to your home computer

" + + "-jump3R", ), ); AddToAllMessages( new Message( MessageFilenames.Jumper1, - "Soon you will be contacted by a hacking group known as CyberSec. " + - "They can help you with your search.

" + - "You should join them, garner their favor, and " + - "exploit them for their Augmentations. But do not trust them. " + - "They are not what they seem. No one is.

" + - "-jump3R", + `Soon you will be contacted by a hacking group known as ${FactionNames.NiteSec}. ` + + "They can help you with your search.

" + + "You should join them, garner their favor, and " + + "exploit them for their Augmentations. But do not trust them. " + + "They are not what they seem. No one is.

" + + "-jump3R", ), ); AddToAllMessages( new Message( MessageFilenames.Jumper2, "Do not try to save the world. There is no world to save. If " + - "you want to find the truth, worry only about yourself. Ethics and " + - "morals will get you killed.

Watch out for a hacking group known as NiteSec." + - "

-jump3R", + "you want to find the truth, worry only about yourself. Ethics and " + + `morals will get you killed.

Watch out for a hacking group known as ${FactionNames.NiteSec}.` + + "

-jump3R", ), ); AddToAllMessages( new Message( MessageFilenames.Jumper3, "You must learn to walk before you can run. And you must " + - "run before you can fly. Look for the black hand.

" + - "I.I.I.I

-jump3R", + `run before you can fly. Look for ${FactionNames.TheBlackHand}.

` + + "I.I.I.I

-jump3R", ), ); AddToAllMessages( new Message( MessageFilenames.Jumper4, "To find what you are searching for, you must understand the bits. " + - "The bits are all around us. The runners will help you.

" + - "-jump3R", + "The bits are all around us. The runners will help you.

" + + "-jump3R", ), ); @@ -178,31 +179,31 @@ function initMessages(): void { new Message( MessageFilenames.CyberSecTest, "We've been watching you. Your skills are very impressive. But you're wasting " + - "your talents. If you join us, you can put your skills to good use and change " + - "the world for the better. If you join us, we can unlock your full potential.

" + - "But first, you must pass our test. Find and install the backdoor on our server.

" + - "-CyberSec", + "your talents. If you join us, you can put your skills to good use and change " + + "the world for the better. If you join us, we can unlock your full potential.

" + + "But first, you must pass our test. Find and install the backdoor on our server.

" + + `-${FactionNames.CyberSec}`, ), ); AddToAllMessages( new Message( MessageFilenames.NiteSecTest, "People say that the corrupted governments and corporations rule the world. " + - "Yes, maybe they do. But do you know who everyone really fears? People " + - "like us. Because they can't hide from us. Because they can't fight shadows " + - "and ideas with bullets.

" + - "Join us, and people will fear you, too.

" + - "Find and install the backdoor on our server. Then, we will contact you again." + - "

-NiteSec", + "Yes, maybe they do. But do you know who everyone really fears? People " + + "like us. Because they can't hide from us. Because they can't fight shadows " + + "and ideas with bullets.

" + + "Join us, and people will fear you, too.

" + + "Find and install the backdoor on our server. Then, we will contact you again." + + `

-${FactionNames.NiteSec}`, ), ); AddToAllMessages( new Message( MessageFilenames.BitRunnersTest, "We know what you are doing. We know what drives you. We know " + - "what you are looking for.

" + - "We can help you find the answers.

" + - "run4theh111z", + "what you are looking for.

" + + "We can help you find the answers.

" + + "run4theh111z", ), ); @@ -210,9 +211,9 @@ function initMessages(): void { new Message( MessageFilenames.RedPill, "@)(#V%*N)@(#*)*C)@#%*)*V)@#(*%V@)(#VN%*)@#(*%
" + - ")@B(*#%)@)M#B*%V)____FIND___#$@)#%(B*)@#(*%B)
" + - "@_#(%_@#M(BDSPOMB__THE-CAVE_#)$(*@#$)@#BNBEGB
" + - "DFLSMFVMV)#@($*)@#*$MV)@#(*$V)M#(*$)M@(#*VM$)", + ")@B(*#%)@)M#B*%V)____FIND___#$@)#%(B*)@#(*%B)
" + + "@_#(%_@#M(BDSPOMB__THE-CAVE_#)$(*@#$)@#BNBEGB
" + + "DFLSMFVMV)#@($*)@#*$MV)@#(*$V)M#(*$)M@(#*VM$)", ), ); } diff --git a/src/Milestones/Milestones.ts b/src/Milestones/Milestones.ts index 1843e2c88..a420c90ce 100644 --- a/src/Milestones/Milestones.ts +++ b/src/Milestones/Milestones.ts @@ -3,6 +3,7 @@ import { IPlayer } from "../PersonObjects/IPlayer"; import { Factions } from "../Faction/Factions"; import { Faction } from "../Faction/Faction"; import { GetServer } from "../Server/AllServers"; +import { FactionNames } from "../Faction/data/FactionNames"; function allFactionAugs(p: IPlayer, f: Faction): boolean { const factionAugs = f.augmentations.slice().filter((aug) => aug !== "NeuroFlux Governor"); @@ -37,60 +38,60 @@ export const Milestones: Milestone[] = [ { title: "Join the faction hinted at in csec-test.msg", fulfilled: (p: IPlayer): boolean => { - return p.factions.includes("CyberSec"); + return p.factions.includes(FactionNames.CyberSec); }, }, { - title: "Install all the Augmentations from CyberSec", + title: `Install all the Augmentations from ${FactionNames.CyberSec}`, fulfilled: (p: IPlayer): boolean => { - return allFactionAugs(p, Factions["CyberSec"]); + return allFactionAugs(p, Factions[FactionNames.CyberSec]); }, }, { title: "Join the faction hinted at in nitesec-test.msg", fulfilled: (p: IPlayer): boolean => { - return p.factions.includes("NiteSec"); + return p.factions.includes(FactionNames.NiteSec); }, }, { - title: "Install all the Augmentations from NiteSec", + title: `Install all the Augmentations from ${FactionNames.NiteSec}`, fulfilled: (p: IPlayer): boolean => { - return allFactionAugs(p, Factions["NiteSec"]); + return allFactionAugs(p, Factions[FactionNames.NiteSec]); }, }, { title: "Join the faction hinted at in j3.msg", fulfilled: (p: IPlayer): boolean => { - return p.factions.includes("The Black Hand"); + return p.factions.includes(FactionNames.TheBlackHand); }, }, { - title: "Install all the Augmentations from The Black Hand", + title: `Install all the Augmentations from ${FactionNames.TheBlackHand}`, fulfilled: (p: IPlayer): boolean => { - return allFactionAugs(p, Factions["The Black Hand"]); + return allFactionAugs(p, Factions[FactionNames.TheBlackHand]); }, }, { title: "Join the faction hinted at in 19dfj3l1nd.msg", fulfilled: (p: IPlayer): boolean => { - return p.factions.includes("BitRunners"); + return p.factions.includes(FactionNames.BitRunners); }, }, { - title: "Install all the Augmentations from BitRunners", + title: `Install all the Augmentations from ${FactionNames.BitRunners}`, fulfilled: (p: IPlayer): boolean => { - return allFactionAugs(p, Factions["BitRunners"]); + return allFactionAugs(p, Factions[FactionNames.BitRunners]); }, }, { title: "Complete fl1ght.exe", fulfilled: (p: IPlayer): boolean => { // technically wrong but whatever - return p.factions.includes("Daedalus"); + return p.factions.includes(FactionNames.Daedalus); }, }, { - title: "Install the special Augmentation from Daedalus", + title: `Install the special Augmentation from ${FactionNames.Daedalus}`, fulfilled: (p: IPlayer): boolean => { return p.augmentations.some((aug) => aug.name == "The Red Pill"); }, diff --git a/src/NetscriptFunctions/Gang.ts b/src/NetscriptFunctions/Gang.ts index f16cbff6f..1edf4bcbb 100644 --- a/src/NetscriptFunctions/Gang.ts +++ b/src/NetscriptFunctions/Gang.ts @@ -1,3 +1,5 @@ +import { FactionNames } from '../Faction/data/FactionNames'; +import { GangConstants } from '../Gang/data/Constants'; import { INetscriptHelper } from "./INetscriptHelper"; import { IPlayer } from "../PersonObjects/IPlayer"; import { getRamCost } from "../Netscript/RamCostGenerator"; @@ -49,20 +51,12 @@ export function NetscriptGang(player: IPlayer, workerScript: WorkerScript, helpe createGang: function (faction: string): boolean { helper.updateDynamicRam("createGang", getRamCost(player, "gang", "createGang")); // this list is copied from Faction/ui/Root.tsx - const GangNames = [ - "Slum Snakes", - "Tetrads", - "The Syndicate", - "The Dark Army", - "Speakers for the Dead", - "NiteSec", - "The Black Hand", - ]; - if (!player.canAccessGang() || !GangNames.includes(faction)) return false; + + if (!player.canAccessGang() || !GangConstants.Names.includes(faction)) return false; if (player.inGang()) return false; if (!player.factions.includes(faction)) return false; - const isHacking = faction === "NiteSec" || faction === "The Black Hand"; + const isHacking = faction === FactionNames.NiteSec || faction === FactionNames.TheBlackHand; player.startGang(faction, isHacking); return true; }, diff --git a/src/NetscriptFunctions/Singularity.ts b/src/NetscriptFunctions/Singularity.ts index 338835203..92c89d12e 100644 --- a/src/NetscriptFunctions/Singularity.ts +++ b/src/NetscriptFunctions/Singularity.ts @@ -42,6 +42,7 @@ import { Terminal } from "../Terminal"; import { calculateHackingTime } from "../Hacking"; import { Server } from "../Server/Server"; import { netscriptCanHack } from "../Hacking/netscriptCanHack"; +import { FactionNames } from "../Faction/data/FactionNames"; export function NetscriptSingularity( player: IPlayer, @@ -282,7 +283,7 @@ export function NetscriptSingularity( if (player.city != CityName.Aevum) { workerScript.log( "universityCourse", - () => "You cannot study at 'Summit University' because you are not in 'Aevum'.", + () => `You cannot study at 'Summit University' because you are not in '${CityName.Aevum}'.`, ); return false; } @@ -294,7 +295,7 @@ export function NetscriptSingularity( if (player.city != CityName.Sector12) { workerScript.log( "universityCourse", - () => "You cannot study at 'Rothman University' because you are not in 'Sector-12'.", + () => `You cannot study at 'Rothman University' because you are not in '${CityName.Sector12}'.`, ); return false; } @@ -306,7 +307,7 @@ export function NetscriptSingularity( if (player.city != CityName.Volhaven) { workerScript.log( "universityCourse", - () => "You cannot study at 'ZB Institute of Technology' because you are not in 'Volhaven'.", + () => `You cannot study at 'ZB Institute of Technology' because you are not in '${CityName.Volhaven}'.`, ); return false; } @@ -369,7 +370,7 @@ export function NetscriptSingularity( if (player.city != CityName.Aevum) { workerScript.log( "gymWorkout", - () => "You cannot workout at 'Crush Fitness' because you are not in 'Aevum'.", + () => `You cannot workout at '${LocationName.AevumCrushFitnessGym}' because you are not in '${CityName.Aevum}'.`, ); return false; } @@ -381,7 +382,7 @@ export function NetscriptSingularity( if (player.city != CityName.Aevum) { workerScript.log( "gymWorkout", - () => "You cannot workout at 'Snap Fitness' because you are not in 'Aevum'.", + () => `You cannot workout at '${LocationName.AevumSnapFitnessGym}' because you are not in '${CityName.Aevum}'.`, ); return false; } @@ -393,7 +394,7 @@ export function NetscriptSingularity( if (player.city != CityName.Sector12) { workerScript.log( "gymWorkout", - () => "You cannot workout at 'Iron Gym' because you are not in 'Sector-12'.", + () => `You cannot workout at '${LocationName.Sector12IronGym}' because you are not in '${CityName.Sector12}'.`, ); return false; } @@ -405,7 +406,7 @@ export function NetscriptSingularity( if (player.city != CityName.Sector12) { workerScript.log( "gymWorkout", - () => "You cannot workout at 'Powerhouse Gym' because you are not in 'Sector-12'.", + () => `You cannot workout at '${LocationName.Sector12PowerhouseGym}' because you are not in '${CityName.Sector12}'.`, ); return false; } @@ -417,7 +418,7 @@ export function NetscriptSingularity( if (player.city != CityName.Volhaven) { workerScript.log( "gymWorkout", - () => "You cannot workout at 'Millenium Fitness Gym' because you are not in 'Volhaven'.", + () => `You cannot workout at '${LocationName.VolhavenMilleniumFitnessGym}' because you are not in '${CityName.Volhaven}'.`, ); return false; } @@ -1033,85 +1034,85 @@ export function NetscriptSingularity( const fac = Factions[name]; // Arrays listing factions that allow each time of work const hackAvailable = [ - "Illuminati", - "Daedalus", - "The Covenant", - "ECorp", - "MegaCorp", - "Bachman & Associates", - "Blade Industries", - "NWO", - "Clarke Incorporated", - "OmniTek Incorporated", - "Four Sigma", - "KuaiGong International", - "Fulcrum Secret Technologies", - "BitRunners", - "The Black Hand", - "NiteSec", - "Chongqing", - "Sector-12", - "New Tokyo", - "Aevum", - "Ishima", - "Volhaven", - "Speakers for the Dead", - "The Dark Army", - "The Syndicate", - "Silhouette", - "Netburners", - "Tian Di Hui", - "CyberSec", + FactionNames.Illuminati as string, + FactionNames.Daedalus as string, + FactionNames.TheCovenant as string, + FactionNames.ECorp as string, + FactionNames.MegaCorp as string, + FactionNames.BachmanAssociates as string, + FactionNames.Bladeburners as string, + FactionNames.NWO as string, + FactionNames.ClarkeIncorporated as string, + FactionNames.OmniTekIncorporated as string, + FactionNames.FourSigma as string, + FactionNames.KuaiGongInternational as string, + FactionNames.FulcrumSecretTechnologies as string, + FactionNames.BitRunners as string, + FactionNames.TheBlackHand as string, + FactionNames.NiteSec as string, + FactionNames.Chongqing as string, + FactionNames.Sector12 as string, + FactionNames.NewTokyo as string, + FactionNames.Aevum as string, + FactionNames.Ishima as string, + FactionNames.Volhaven as string, + FactionNames.SpeakersForTheDead as string, + FactionNames.TheDarkArmy as string, + FactionNames.TheSyndicate as string, + FactionNames.Silhouette as string, + FactionNames.Netburners as string, + FactionNames.TianDiHui as string, + FactionNames.CyberSec as string, ]; const fdWkAvailable = [ - "Illuminati", - "Daedalus", - "The Covenant", - "ECorp", - "MegaCorp", - "Bachman & Associates", - "Blade Industries", - "NWO", - "Clarke Incorporated", - "OmniTek Incorporated", - "Four Sigma", - "KuaiGong International", - "The Black Hand", - "Chongqing", - "Sector-12", - "New Tokyo", - "Aevum", - "Ishima", - "Volhaven", - "Speakers for the Dead", - "The Dark Army", - "The Syndicate", - "Silhouette", - "Tetrads", - "Slum Snakes", + FactionNames.Illuminati as string, + FactionNames.Daedalus as string, + FactionNames.TheCovenant as string, + FactionNames.ECorp as string, + FactionNames.MegaCorp as string, + FactionNames.BachmanAssociates as string, + FactionNames.Bladeburners as string, + FactionNames.NWO as string, + FactionNames.ClarkeIncorporated as string, + FactionNames.OmniTekIncorporated as string, + FactionNames.FourSigma as string, + FactionNames.KuaiGongInternational as string, + FactionNames.TheBlackHand as string, + FactionNames.Chongqing as string, + FactionNames.Sector12 as string, + FactionNames.NewTokyo as string, + FactionNames.Aevum as string, + FactionNames.Ishima as string, + FactionNames.Volhaven as string, + FactionNames.SpeakersForTheDead as string, + FactionNames.TheDarkArmy as string, + FactionNames.TheSyndicate as string, + FactionNames.Silhouette as string, + FactionNames.Tetrads as string, + FactionNames.SlumSnakes as string, ]; const scWkAvailable = [ - "ECorp", - "MegaCorp", - "Bachman & Associates", - "Blade Industries", - "NWO", - "Clarke Incorporated", - "OmniTek Incorporated", - "Four Sigma", - "KuaiGong International", - "Fulcrum Secret Technologies", - "Chongqing", - "Sector-12", - "New Tokyo", - "Aevum", - "Ishima", - "Volhaven", - "Speakers for the Dead", - "The Syndicate", - "Tetrads", - "Slum Snakes", - "Tian Di Hui", + FactionNames.ECorp as string, + FactionNames.MegaCorp as string, + FactionNames.BachmanAssociates as string, + FactionNames.Bladeburners as string, + FactionNames.NWO as string, + FactionNames.ClarkeIncorporated as string, + FactionNames.OmniTekIncorporated as string, + FactionNames.FourSigma as string, + FactionNames.KuaiGongInternational as string, + FactionNames.FulcrumSecretTechnologies as string, + FactionNames.Chongqing as string, + FactionNames.Sector12 as string, + FactionNames.NewTokyo as string, + FactionNames.Aevum as string, + FactionNames.Ishima as string, + FactionNames.Volhaven as string, + FactionNames.SpeakersForTheDead as string, + FactionNames.TheSyndicate as string, + FactionNames.Tetrads as string, + FactionNames.SlumSnakes as string, + FactionNames.TianDiHui as string, ]; switch (type.toLowerCase()) { diff --git a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx index ee97fc982..022819b21 100644 --- a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx +++ b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx @@ -65,6 +65,7 @@ import { serverMetadata } from "../../Server/data/servers"; import { SnackbarEvents } from "../../ui/React/Snackbar"; import { calculateClassEarnings } from "../formulas/work"; import { achievements } from "../../Achievements/Achievements"; +import { FactionNames } from "../../Faction/data/FactionNames"; export function init(this: IPlayer): void { /* Initialize Player's home computer */ @@ -609,8 +610,8 @@ export function process(this: IPlayer, router: IRouter, numCycles = 1): void { router.toCity(); } } else if (this.work(numCycles)) { - router.toCity(); - } + router.toCity(); + } } } @@ -1509,20 +1510,20 @@ export function finishCrime(this: IPlayer, cancelled: boolean): string { if (ws.disableLogs.ALL == null && ws.disableLogs.commitCrime == null) { ws.scriptRef.log( "SUCCESS: Crime successful! Gained " + - numeralWrapper.formatMoney(this.workMoneyGained) + - ", " + - numeralWrapper.formatExp(this.workHackExpGained) + - " hack exp, " + - numeralWrapper.formatExp(this.workStrExpGained) + - " str exp, " + - numeralWrapper.formatExp(this.workDefExpGained) + - " def exp, " + - numeralWrapper.formatExp(this.workDexExpGained) + - " dex exp, " + - numeralWrapper.formatExp(this.workAgiExpGained) + - " agi exp, " + - numeralWrapper.formatExp(this.workChaExpGained) + - " cha exp.", + numeralWrapper.formatMoney(this.workMoneyGained) + + ", " + + numeralWrapper.formatExp(this.workHackExpGained) + + " hack exp, " + + numeralWrapper.formatExp(this.workStrExpGained) + + " str exp, " + + numeralWrapper.formatExp(this.workDefExpGained) + + " def exp, " + + numeralWrapper.formatExp(this.workDexExpGained) + + " dex exp, " + + numeralWrapper.formatExp(this.workAgiExpGained) + + " agi exp, " + + numeralWrapper.formatExp(this.workChaExpGained) + + " cha exp.", ); } } else { @@ -1561,18 +1562,18 @@ export function finishCrime(this: IPlayer, cancelled: boolean): string { if (ws.disableLogs.ALL == null && ws.disableLogs.commitCrime == null) { ws.scriptRef.log( "FAIL: Crime failed! Gained " + - numeralWrapper.formatExp(this.workHackExpGained) + - " hack exp, " + - numeralWrapper.formatExp(this.workStrExpGained) + - " str exp, " + - numeralWrapper.formatExp(this.workDefExpGained) + - " def exp, " + - numeralWrapper.formatExp(this.workDexExpGained) + - " dex exp, " + - numeralWrapper.formatExp(this.workAgiExpGained) + - " agi exp, " + - numeralWrapper.formatExp(this.workChaExpGained) + - " cha exp.", + numeralWrapper.formatExp(this.workHackExpGained) + + " hack exp, " + + numeralWrapper.formatExp(this.workStrExpGained) + + " str exp, " + + numeralWrapper.formatExp(this.workDefExpGained) + + " def exp, " + + numeralWrapper.formatExp(this.workDexExpGained) + + " dex exp, " + + numeralWrapper.formatExp(this.workAgiExpGained) + + " agi exp, " + + numeralWrapper.formatExp(this.workChaExpGained) + + " cha exp.", ); } } else { @@ -1755,7 +1756,6 @@ export function applyForJob(this: IPlayer, entryPosType: CompanyPosition, sing = } return false; } - return false; //Same job, do nothing } } @@ -2088,7 +2088,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Illuminati - const illuminatiFac = Factions["Illuminati"]; + const illuminatiFac = Factions[FactionNames.Illuminati]; if ( !illuminatiFac.isBanned && !illuminatiFac.isMember && @@ -2105,7 +2105,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Daedalus - const daedalusFac = Factions["Daedalus"]; + const daedalusFac = Factions[FactionNames.Daedalus]; if ( !daedalusFac.isBanned && !daedalusFac.isMember && @@ -2119,7 +2119,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //The Covenant - const covenantFac = Factions["The Covenant"]; + const covenantFac = Factions[FactionNames.TheCovenant]; if ( !covenantFac.isBanned && !covenantFac.isMember && @@ -2136,7 +2136,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //ECorp - const ecorpFac = Factions["ECorp"]; + const ecorpFac = Factions[FactionNames.ECorp]; if ( !ecorpFac.isBanned && !ecorpFac.isMember && @@ -2147,7 +2147,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //MegaCorp - const megacorpFac = Factions["MegaCorp"]; + const megacorpFac = Factions[FactionNames.MegaCorp]; if ( !megacorpFac.isBanned && !megacorpFac.isMember && @@ -2158,7 +2158,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Bachman & Associates - const bachmanandassociatesFac = Factions["Bachman & Associates"]; + const bachmanandassociatesFac = Factions[FactionNames.BachmanAssociates]; if ( !bachmanandassociatesFac.isBanned && !bachmanandassociatesFac.isMember && @@ -2169,7 +2169,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Blade Industries - const bladeindustriesFac = Factions["Blade Industries"]; + const bladeindustriesFac = Factions[FactionNames.BladeIndustries]; if ( !bladeindustriesFac.isBanned && !bladeindustriesFac.isMember && @@ -2180,7 +2180,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //NWO - const nwoFac = Factions["NWO"]; + const nwoFac = Factions[FactionNames.NWO]; if ( !nwoFac.isBanned && !nwoFac.isMember && @@ -2191,7 +2191,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Clarke Incorporated - const clarkeincorporatedFac = Factions["Clarke Incorporated"]; + const clarkeincorporatedFac = Factions[FactionNames.ClarkeIncorporated]; if ( !clarkeincorporatedFac.isBanned && !clarkeincorporatedFac.isMember && @@ -2202,7 +2202,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //OmniTek Incorporated - const omnitekincorporatedFac = Factions["OmniTek Incorporated"]; + const omnitekincorporatedFac = Factions[FactionNames.OmniTekIncorporated]; if ( !omnitekincorporatedFac.isBanned && !omnitekincorporatedFac.isMember && @@ -2213,7 +2213,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Four Sigma - const foursigmaFac = Factions["Four Sigma"]; + const foursigmaFac = Factions[FactionNames.FourSigma]; if ( !foursigmaFac.isBanned && !foursigmaFac.isMember && @@ -2224,7 +2224,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //KuaiGong International - const kuaigonginternationalFac = Factions["KuaiGong International"]; + const kuaigonginternationalFac = Factions[FactionNames.KuaiGongInternational]; if ( !kuaigonginternationalFac.isBanned && !kuaigonginternationalFac.isMember && @@ -2235,27 +2235,27 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Fulcrum Secret Technologies - If u've unlocked fulcrum secret technolgoies server and have a high rep with the company - const fulcrumsecrettechonologiesFac = Factions["Fulcrum Secret Technologies"]; + const fulcrumsecrettechonologiesFac = Factions[FactionNames.FulcrumSecretTechnologies]; const fulcrumSecretServer = GetServer(SpecialServers.FulcrumSecretTechnologies); - if (!(fulcrumSecretServer instanceof Server)) throw new Error("Fulcrum Secret Technologies should be normal server"); + if (!(fulcrumSecretServer instanceof Server)) throw new Error(`${FactionNames.FulcrumSecretTechnologies} should be normal server`); if (fulcrumSecretServer == null) { - console.error("Could not find Fulcrum Secret Technologies Server"); + console.error(`Could not find ${FactionNames.FulcrumSecretTechnologies} Server`); } else if ( - !fulcrumsecrettechonologiesFac.isBanned && - !fulcrumsecrettechonologiesFac.isMember && - !fulcrumsecrettechonologiesFac.alreadyInvited && - fulcrumSecretServer.backdoorInstalled && - checkMegacorpRequirements(LocationName.AevumFulcrumTechnologies, 250e3) - ) { - invitedFactions.push(fulcrumsecrettechonologiesFac); - } + !fulcrumsecrettechonologiesFac.isBanned && + !fulcrumsecrettechonologiesFac.isMember && + !fulcrumsecrettechonologiesFac.alreadyInvited && + fulcrumSecretServer.backdoorInstalled && + checkMegacorpRequirements(LocationName.AevumFulcrumTechnologies, 250e3) + ) { + invitedFactions.push(fulcrumsecrettechonologiesFac); + } //BitRunners - const bitrunnersFac = Factions["BitRunners"]; + const bitrunnersFac = Factions[FactionNames.BitRunners]; const bitrunnersServer = GetServer(SpecialServers.BitRunnersServer); - if (!(bitrunnersServer instanceof Server)) throw new Error("BitRunners should be normal server"); + if (!(bitrunnersServer instanceof Server)) throw new Error(`${FactionNames.BitRunners} should be normal server`); if (bitrunnersServer == null) { - console.error("Could not find BitRunners Server"); + console.error(`Could not find ${FactionNames.BitRunners} Server`); } else if ( !bitrunnersFac.isBanned && !bitrunnersFac.isMember && @@ -2267,11 +2267,11 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { //The Black Hand - const theblackhandFac = Factions["The Black Hand"]; + const theblackhandFac = Factions[FactionNames.TheBlackHand]; const blackhandServer = GetServer(SpecialServers.TheBlackHandServer); - if (!(blackhandServer instanceof Server)) throw new Error("TheBlackHand should be normal server"); + if (!(blackhandServer instanceof Server)) throw new Error(`${FactionNames.TheBlackHand} should be normal server`); if (blackhandServer == null) { - console.error("Could not find The Black Hand Server"); + console.error(`Could not find ${FactionNames.TheBlackHand} Server`); } else if ( !theblackhandFac.isBanned && !theblackhandFac.isMember && @@ -2282,11 +2282,11 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //NiteSec - const nitesecFac = Factions["NiteSec"]; + const nitesecFac = Factions[FactionNames.NiteSec]; const nitesecServer = GetServer(SpecialServers.NiteSecServer); - if (!(nitesecServer instanceof Server)) throw new Error("NiteSec should be normal server"); + if (!(nitesecServer instanceof Server)) throw new Error(`${FactionNames.NiteSec} should be normal server`); if (nitesecServer == null) { - console.error("Could not find NiteSec Server"); + console.error(`Could not find ${FactionNames.NiteSec} Server`); } else if ( !nitesecFac.isBanned && !nitesecFac.isMember && @@ -2297,7 +2297,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Chongqing - const chongqingFac = Factions["Chongqing"]; + const chongqingFac = Factions[FactionNames.Chongqing]; if ( !chongqingFac.isBanned && !chongqingFac.isMember && @@ -2309,7 +2309,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Sector-12 - const sector12Fac = Factions["Sector-12"]; + const sector12Fac = Factions[FactionNames.Sector12]; if ( !sector12Fac.isBanned && !sector12Fac.isMember && @@ -2321,7 +2321,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //New Tokyo - const newtokyoFac = Factions["New Tokyo"]; + const newtokyoFac = Factions[FactionNames.NewTokyo]; if ( !newtokyoFac.isBanned && !newtokyoFac.isMember && @@ -2333,7 +2333,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Aevum - const aevumFac = Factions["Aevum"]; + const aevumFac = Factions[FactionNames.Aevum]; if ( !aevumFac.isBanned && !aevumFac.isMember && @@ -2345,7 +2345,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Ishima - const ishimaFac = Factions["Ishima"]; + const ishimaFac = Factions[FactionNames.Ishima]; if ( !ishimaFac.isBanned && !ishimaFac.isMember && @@ -2357,7 +2357,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Volhaven - const volhavenFac = Factions["Volhaven"]; + const volhavenFac = Factions[FactionNames.Volhaven]; if ( !volhavenFac.isBanned && !volhavenFac.isMember && @@ -2369,7 +2369,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Speakers for the Dead - const speakersforthedeadFac = Factions["Speakers for the Dead"]; + const speakersforthedeadFac = Factions[FactionNames.SpeakersForTheDead]; if ( !speakersforthedeadFac.isBanned && !speakersforthedeadFac.isMember && @@ -2388,7 +2388,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //The Dark Army - const thedarkarmyFac = Factions["The Dark Army"]; + const thedarkarmyFac = Factions[FactionNames.TheDarkArmy]; if ( !thedarkarmyFac.isBanned && !thedarkarmyFac.isMember && @@ -2408,7 +2408,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //The Syndicate - const thesyndicateFac = Factions["The Syndicate"]; + const thesyndicateFac = Factions[FactionNames.TheSyndicate]; if ( !thesyndicateFac.isBanned && !thesyndicateFac.isMember && @@ -2428,7 +2428,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Silhouette - const silhouetteFac = Factions["Silhouette"]; + const silhouetteFac = Factions[FactionNames.Silhouette]; if ( !silhouetteFac.isBanned && !silhouetteFac.isMember && @@ -2443,7 +2443,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Tetrads - const tetradsFac = Factions["Tetrads"]; + const tetradsFac = Factions[FactionNames.Tetrads]; if ( !tetradsFac.isBanned && !tetradsFac.isMember && @@ -2459,7 +2459,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //SlumSnakes - const slumsnakesFac = Factions["Slum Snakes"]; + const slumsnakesFac = Factions[FactionNames.SlumSnakes]; if ( !slumsnakesFac.isBanned && !slumsnakesFac.isMember && @@ -2475,7 +2475,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Netburners - const netburnersFac = Factions["Netburners"]; + const netburnersFac = Factions[FactionNames.Netburners]; let totalHacknetRam = 0; let totalHacknetCores = 0; let totalHacknetLevels = 0; @@ -2507,7 +2507,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //Tian Di Hui - const tiandihuiFac = Factions["Tian Di Hui"]; + const tiandihuiFac = Factions[FactionNames.TianDiHui]; if ( !tiandihuiFac.isBanned && !tiandihuiFac.isMember && @@ -2520,11 +2520,11 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { } //CyberSec - const cybersecFac = Factions["CyberSec"]; + const cybersecFac = Factions[FactionNames.CyberSec]; const cybersecServer = GetServer(SpecialServers.CyberSecServer); - if (!(cybersecServer instanceof Server)) throw new Error("cybersec should be normal server"); + if (!(cybersecServer instanceof Server)) throw new Error(`${FactionNames.CyberSec} should be normal server`); if (cybersecServer == null) { - console.error("Could not find CyberSec Server"); + console.error(`Could not find ${FactionNames.CyberSec} Server`); } else if ( !cybersecFac.isBanned && !cybersecFac.isMember && @@ -2581,7 +2581,7 @@ export function gainCodingContractReward(this: IPlayer, reward: ICodingContractR const totalGain = CONSTANTS.CodingContractBaseFactionRepGain * difficulty; // Ignore Bladeburners and other special factions for this calculation - const specialFactions = ["Bladeburners"]; + const specialFactions = [FactionNames.Bladeburners as string]; const factions = this.factions.slice().filter((f) => { return !specialFactions.includes(f); }); @@ -2600,7 +2600,6 @@ export function gainCodingContractReward(this: IPlayer, reward: ICodingContractR Factions[facName].playerReputation += gainPerFaction; } return `Gained ${gainPerFaction} reputation for each of the following factions: ${factions.toString()}`; - break; case CodingContractRewardType.CompanyReputation: { if (reward.name == null || !(Companies[reward.name] instanceof Company)) { //If no/invalid company was designated, just give rewards to all factions diff --git a/src/PersonObjects/Sleeve/SleeveHelpers.ts b/src/PersonObjects/Sleeve/SleeveHelpers.ts index 0c9787ce3..69ee92688 100644 --- a/src/PersonObjects/Sleeve/SleeveHelpers.ts +++ b/src/PersonObjects/Sleeve/SleeveHelpers.ts @@ -1,3 +1,4 @@ +import { FactionNames } from '../../Faction/data/FactionNames'; import { Sleeve } from "./Sleeve"; import { IPlayer } from "../IPlayer"; @@ -80,10 +81,10 @@ export function findSleevePurchasableAugs(sleeve: Sleeve, p: IPlayer): Augmentat } for (const facName of p.factions) { - if (facName === "Bladeburners") { + if (facName === FactionNames.Bladeburners) { continue; } - if (facName === "Netburners") { + if (facName === FactionNames.Netburners) { continue; } const fac: Faction | null = Factions[facName]; diff --git a/src/PersonObjects/Sleeve/ui/CovenantPurchasesRoot.tsx b/src/PersonObjects/Sleeve/ui/CovenantPurchasesRoot.tsx index 96d0a7a63..10278017b 100644 --- a/src/PersonObjects/Sleeve/ui/CovenantPurchasesRoot.tsx +++ b/src/PersonObjects/Sleeve/ui/CovenantPurchasesRoot.tsx @@ -16,6 +16,7 @@ import { use } from "../../../ui/Context"; import { dialogBoxCreate } from "../../../ui/React/DialogBox"; import Typography from "@mui/material/Typography"; import Button from "@mui/material/Button"; +import { FactionNames } from "../../../Faction/data/FactionNames"; interface IProps { open: boolean; @@ -76,7 +77,7 @@ export function CovenantPurchasesRoot(props: IProps): React.ReactElement { <> Purchase an additional Sleeves. These Duplicate Sleeves are permanent (they persist through BitNodes). You - can purchase a total of {MaxSleevesFromCovenant} from The Covenant. + can purchase a total of {MaxSleevesFromCovenant} from {FactionNames.TheCovenant}.