API: Added CompanyName to NetscriptDefinitions (#731)

This commit is contained in:
Zelow79
2023-08-16 17:31:41 -04:00
committed by GitHub
parent 7500ef0da2
commit b7ad3395ae
18 changed files with 160 additions and 37 deletions

View File

@@ -47,7 +47,7 @@ interface Player extends Person {
money: number;
numPeopleKilled: number;
entropy: number;
jobs: Record<string, string>;
jobs: Partial<Record<CompanyName, JobName>>;
factions: string[];
totalPlaytime: number;
location: string;
@@ -980,7 +980,7 @@ type SleeveClassTask = {
};
/** @public */
type SleeveCompanyTask = { type: "COMPANY"; companyName: string };
type SleeveCompanyTask = { type: "COMPANY"; companyName: CompanyName };
/** @public */
type SleeveCrimeTask = {
@@ -1759,7 +1759,10 @@ export interface Singularity {
* @param positionName - Name of position to get the requirements for. Must be an exact match.
* @returns CompanyPositionInfo object.
*/
getCompanyPositionInfo(companyName: string, positionName: JobName): CompanyPositionInfo;
getCompanyPositionInfo(
companyName: CompanyName | `${CompanyName}`,
positionName: JobName | `${JobName}`,
): CompanyPositionInfo;
/**
* Get List of Company Positions.
@@ -1779,7 +1782,7 @@ export interface Singularity {
* @param companyName - Name of company to get the position list for. Must be an exact match.
* @returns The position list if the company name is valid.
*/
getCompanyPositions(companyName: string): JobName[];
getCompanyPositions(companyName: CompanyName | `${CompanyName}`): JobName[];
/**
* Work for a company.
@@ -1804,7 +1807,7 @@ export interface Singularity {
* @param focus - Acquire player focus on this work operation. Optional. Defaults to true.
* @returns True if the player starts working, and false otherwise.
*/
workForCompany(companyName: string, focus?: boolean): boolean;
workForCompany(companyName: CompanyName, focus?: boolean): boolean;
/**
* Quit jobs by company.
@@ -1816,7 +1819,7 @@ export interface Singularity {
*
* @param companyName - Name of the company.
*/
quitJob(companyName?: string): void;
quitJob(companyName?: CompanyName | `${CompanyName}`): void;
/**
* Apply for a job at a company.
@@ -1837,7 +1840,7 @@ export interface Singularity {
* @param field - Field to which you want to apply.
* @returns True if the player successfully get a job/promotion, and false otherwise.
*/
applyToCompany(companyName: string, field: string): boolean;
applyToCompany(companyName: CompanyName | `${CompanyName}`, field: string): boolean;
/**
* Get company reputation.
@@ -1851,7 +1854,7 @@ export interface Singularity {
* @param companyName - Name of the company.
* @returns Amount of reputation you have at the specified company.
*/
getCompanyRep(companyName: string): number;
getCompanyRep(companyName: CompanyName | `${CompanyName}`): number;
/**
* Get company favor.
@@ -1865,7 +1868,7 @@ export interface Singularity {
* @param companyName - Name of the company.
* @returns Amount of favor you have at the specified company.
*/
getCompanyFavor(companyName: string): number;
getCompanyFavor(companyName: CompanyName | `${CompanyName}`): number;
/**
* Get company favor gain.
@@ -1879,7 +1882,7 @@ export interface Singularity {
* @param companyName - Name of the company.
* @returns Amount of favor you gain at the specified company when you reset by installing Augmentations.
*/
getCompanyFavorGain(companyName: string): number;
getCompanyFavorGain(companyName: CompanyName | `${CompanyName}`): number;
/**
* List all current faction invitations.
@@ -3749,7 +3752,7 @@ export interface Sleeve {
* @param companyName - Name of the company to work for.
* @returns True if the sleeve started working for this company, false otherwise.
*/
setToCompanyWork(sleeveNumber: number, companyName: string): boolean;
setToCompanyWork(sleeveNumber: number, companyName: CompanyName | `${CompanyName}`): boolean;
/**
* Set a sleeve to take a class at a university.
@@ -3974,7 +3977,12 @@ interface WorkFormulas {
/** @returns The WorkStats applied every game cycle (200ms) by performing the specified faction work. */
factionGains(person: Person, workType: FactionWorkType | `${FactionWorkType}`, favor: number): WorkStats;
/** @returns The WorkStats applied every game cycle (200ms) by performing the specified company work. */
companyGains(person: Person, companyName: string, workType: JobName | `${JobName}`, favor: number): WorkStats;
companyGains(
person: Person,
companyName: CompanyName | `${CompanyName}`,
workType: JobName | `${JobName}`,
favor: number,
): WorkStats;
}
/**
@@ -6895,6 +6903,49 @@ declare enum LocationName {
Void = "The Void",
}
/** Names of all companies
* @public */
declare enum CompanyName {
ECorp = "ECorp",
MegaCorp = "MegaCorp",
BachmanAndAssociates = "Bachman & Associates",
BladeIndustries = "Blade Industries",
NWO = "NWO",
ClarkeIncorporated = "Clarke Incorporated",
OmniTekIncorporated = "OmniTek Incorporated",
FourSigma = "Four Sigma",
KuaiGongInternational = "KuaiGong International",
FulcrumTechnologies = "Fulcrum Technologies",
StormTechnologies = "Storm Technologies",
DefComm = "DefComm",
HeliosLabs = "Helios Labs",
VitaLife = "VitaLife",
IcarusMicrosystems = "Icarus Microsystems",
UniversalEnergy = "Universal Energy",
GalacticCybersystems = "Galactic Cybersystems",
AeroCorp = "AeroCorp",
OmniaCybersystems = "Omnia Cybersystems",
SolarisSpaceSystems = "Solaris Space Systems",
DeltaOne = "DeltaOne",
GlobalPharmaceuticals = "Global Pharmaceuticals",
NovaMedical = "Nova Medical",
CIA = "Central Intelligence Agency",
NSA = "National Security Agency",
WatchdogSecurity = "Watchdog Security",
LexoCorp = "LexoCorp",
RhoConstruction = "Rho Construction",
AlphaEnterprises = "Alpha Enterprises",
Police = "Aevum Police Headquarters",
SysCoreSecurities = "SysCore Securities",
CompuTek = "CompuTek",
NetLinkTechnologies = "NetLink Technologies",
CarmichaelSecurity = "Carmichael Security",
FoodNStuff = "FoodNStuff",
JoesGuns = "Joe's Guns",
OmegaSoftware = "Omega Software",
NoodleBar = "Noodle Bar",
}
/** @public */
export type NSEnums = {
CityName: typeof CityName;
@@ -6905,6 +6956,7 @@ export type NSEnums = {
LocationName: typeof LocationName;
ToastVariant: typeof ToastVariant;
UniversityClassType: typeof UniversityClassType;
CompanyName: typeof CompanyName;
};
/**